Showing posts with label remote. Show all posts
Showing posts with label remote. Show all posts

Tuesday, March 20, 2012

restore question on sql2000

Hi
I have a 60 GB sql 2000 STD edition database backup.
I take backup on a remote machine A where I can restore it.
But I have to restore the same database on another machine B where it can
not restore it.
I have already copied the file over a very slow network and when I say
restore and select the backup file I do not see any datafiles listed. I clic
k
on "VIEW CONTENTS" and there is nothing.
What could cause this as same backup seen on the Machine A is fine but when
moved to machine B I can not "view the contents" and restore it.
All the version across all these machines are same.
Tks
MangeshHi
I found the reason. The copy command is still running on the Machine A for
12 hrs.
I did not know that copy command creates the file size as that of source
when it starts copy unlike ftp.
Thanks
Mangesh
"Mangesh Deshpande" wrote:

> Hi
> I have a 60 GB sql 2000 STD edition database backup.
> I take backup on a remote machine A where I can restore it.
> But I have to restore the same database on another machine B where it can
> not restore it.
> I have already copied the file over a very slow network and when I say
> restore and select the backup file I do not see any datafiles listed. I cl
ick
> on "VIEW CONTENTS" and there is nothing.
> What could cause this as same backup seen on the Machine A is fine but whe
n
> moved to machine B I can not "view the contents" and restore it.
> All the version across all these machines are same.
> Tks
> Mangesh|||Hi Mangesh,
You can try using Query Analyzer from ServerB to restore DB's from remote
locations. It is possible the backup gets corrupt during the copy. At leas
t
you can try listing the contents remotely; try this:
--
-- i.e. EXEC xp_cmdshell 'command' <-- remove any <ENTER> bewteen quotes (''
)
-- ServerA is the remote DB Server
-- Share the remote backup folder, in this example is ShareDriveA
-- account is a domain account with access to the shared folder
-- accountpassword (account password)
-- ACCOUNTDOMAIN is the domain where 'account' belongs to
EXEC xp_cmdshell 'net use \\ServerA\ShareDriveA accountpassword
/USER:ACCOUNTDOMAIN\account'
GO
-- to test if the account you used has access to the remote folder
EXEC xp_cmdshell 'dir \\ServerA\ShareFolderA\BackupFolder'
GO
-- to list the backup contents
RESTORE FILELISTONLY
FROM DISK = '\\ServerA\ShareFolder\BackupFolder\Back
upFile.BAK'
-- to finally restore the backup
RESTORE DATABASE DatabaseName
FROM DISK = '\\ServerA\ShareFolder\BackupFolder\Back
upFile.BAK'
WITH REPLACE,
MOVE 'LogicalFileName_Data' TO 'C:\SQLdata\DatabaseName.MDF',
MOVE 'LogicalFileName_Log' TO 'C:\SQLdata\DatabaseName.LDF'
--
"Mangesh Deshpande" wrote:

> Hi
> I have a 60 GB sql 2000 STD edition database backup.
> I take backup on a remote machine A where I can restore it.
> But I have to restore the same database on another machine B where it can
> not restore it.
> I have already copied the file over a very slow network and when I say
> restore and select the backup file I do not see any datafiles listed. I cl
ick
> on "VIEW CONTENTS" and there is nothing.
> What could cause this as same backup seen on the Machine A is fine but whe
n
> moved to machine B I can not "view the contents" and restore it.
> All the version across all these machines are same.
> Tks
> Mangesh

restore question on sql2000

Hi
I have a 60 GB sql 2000 STD edition database backup.
I take backup on a remote machine A where I can restore it.
But I have to restore the same database on another machine B where it can
not restore it.
I have already copied the file over a very slow network and when I say
restore and select the backup file I do not see any datafiles listed. I click
on "VIEW CONTENTS" and there is nothing.
What could cause this as same backup seen on the Machine A is fine but when
moved to machine B I can not "view the contents" and restore it.
All the version across all these machines are same.
Tks
Mangesh
Hi
I found the reason. The copy command is still running on the Machine A for
12 hrs.
I did not know that copy command creates the file size as that of source
when it starts copy unlike ftp.
Thanks
Mangesh
"Mangesh Deshpande" wrote:

> Hi
> I have a 60 GB sql 2000 STD edition database backup.
> I take backup on a remote machine A where I can restore it.
> But I have to restore the same database on another machine B where it can
> not restore it.
> I have already copied the file over a very slow network and when I say
> restore and select the backup file I do not see any datafiles listed. I click
> on "VIEW CONTENTS" and there is nothing.
> What could cause this as same backup seen on the Machine A is fine but when
> moved to machine B I can not "view the contents" and restore it.
> All the version across all these machines are same.
> Tks
> Mangesh
|||Hi Mangesh,
You can try using Query Analyzer from ServerB to restore DB's from remote
locations. It is possible the backup gets corrupt during the copy. At least
you can try listing the contents remotely; try this:
-- i.e. EXEC xp_cmdshell 'command' <-- remove any <ENTER> bewteen quotes ('')
-- ServerA is the remote DB Server
-- Share the remote backup folder, in this example is ShareDriveA
-- account is a domain account with access to the shared folder
-- accountpassword (account password)
-- ACCOUNTDOMAIN is the domain where 'account' belongs to
EXEC xp_cmdshell 'net use \\ServerA\ShareDriveA accountpassword
/USER:ACCOUNTDOMAIN\account'
GO
-- to test if the account you used has access to the remote folder
EXEC xp_cmdshell 'dir \\ServerA\ShareFolderA\BackupFolder'
GO
-- to list the backup contents
RESTORE FILELISTONLY
FROM DISK = '\\ServerA\ShareFolder\BackupFolder\BackupFile.BAK '
-- to finally restore the backup
RESTORE DATABASE DatabaseName
FROM DISK = '\\ServerA\ShareFolder\BackupFolder\BackupFile.BAK '
WITH REPLACE,
MOVE 'LogicalFileName_Data' TO 'C:\SQLdata\DatabaseName.MDF',
MOVE 'LogicalFileName_Log' TO 'C:\SQLdata\DatabaseName.LDF'
"Mangesh Deshpande" wrote:

> Hi
> I have a 60 GB sql 2000 STD edition database backup.
> I take backup on a remote machine A where I can restore it.
> But I have to restore the same database on another machine B where it can
> not restore it.
> I have already copied the file over a very slow network and when I say
> restore and select the backup file I do not see any datafiles listed. I click
> on "VIEW CONTENTS" and there is nothing.
> What could cause this as same backup seen on the Machine A is fine but when
> moved to machine B I can not "view the contents" and restore it.
> All the version across all these machines are same.
> Tks
> Mangesh

restore question on sql2000

Hi
I have a 60 GB sql 2000 STD edition database backup.
I take backup on a remote machine A where I can restore it.
But I have to restore the same database on another machine B where it can
not restore it.
I have already copied the file over a very slow network and when I say
restore and select the backup file I do not see any datafiles listed. I click
on "VIEW CONTENTS" and there is nothing.
What could cause this as same backup seen on the Machine A is fine but when
moved to machine B I can not "view the contents" and restore it.
All the version across all these machines are same.
Tks
MangeshHi
I found the reason. The copy command is still running on the Machine A for
12 hrs.
I did not know that copy command creates the file size as that of source
when it starts copy unlike ftp.
Thanks
Mangesh
"Mangesh Deshpande" wrote:
> Hi
> I have a 60 GB sql 2000 STD edition database backup.
> I take backup on a remote machine A where I can restore it.
> But I have to restore the same database on another machine B where it can
> not restore it.
> I have already copied the file over a very slow network and when I say
> restore and select the backup file I do not see any datafiles listed. I click
> on "VIEW CONTENTS" and there is nothing.
> What could cause this as same backup seen on the Machine A is fine but when
> moved to machine B I can not "view the contents" and restore it.
> All the version across all these machines are same.
> Tks
> Mangesh|||Hi Mangesh,
You can try using Query Analyzer from ServerB to restore DB's from remote
locations. It is possible the backup gets corrupt during the copy. At least
you can try listing the contents remotely; try this:
--
-- i.e. EXEC xp_cmdshell 'command' <-- remove any <ENTER> bewteen quotes ('')
-- ServerA is the remote DB Server
-- Share the remote backup folder, in this example is ShareDriveA
-- account is a domain account with access to the shared folder
-- accountpassword (account password)
-- ACCOUNTDOMAIN is the domain where 'account' belongs to
EXEC xp_cmdshell 'net use \\ServerA\ShareDriveA accountpassword
/USER:ACCOUNTDOMAIN\account'
GO
-- to test if the account you used has access to the remote folder
EXEC xp_cmdshell 'dir \\ServerA\ShareFolderA\BackupFolder'
GO
-- to list the backup contents
RESTORE FILELISTONLY
FROM DISK = '\\ServerA\ShareFolder\BackupFolder\BackupFile.BAK'
-- to finally restore the backup
RESTORE DATABASE DatabaseName
FROM DISK = '\\ServerA\ShareFolder\BackupFolder\BackupFile.BAK'
WITH REPLACE,
MOVE 'LogicalFileName_Data' TO 'C:\SQLdata\DatabaseName.MDF',
MOVE 'LogicalFileName_Log' TO 'C:\SQLdata\DatabaseName.LDF'
--
"Mangesh Deshpande" wrote:
> Hi
> I have a 60 GB sql 2000 STD edition database backup.
> I take backup on a remote machine A where I can restore it.
> But I have to restore the same database on another machine B where it can
> not restore it.
> I have already copied the file over a very slow network and when I say
> restore and select the backup file I do not see any datafiles listed. I click
> on "VIEW CONTENTS" and there is nothing.
> What could cause this as same backup seen on the Machine A is fine but when
> moved to machine B I can not "view the contents" and restore it.
> All the version across all these machines are same.
> Tks
> Mangesh

restore question

Hi
I am taking a backup of SQLSERVER on remote machine. I need to restore the
database on a daily basis on the remote machine.
I take backup of transaction log using maintenance plan every 30 mins.
It generates 48 transaciton log per day.
How can write a script to restore the database applying those 48 logs.
I can create linked server to production but what table keeps the backup log
information that I can use to build this.
Thanks
Mangesh
I keep my own table to track which log files I've applied
I store the table in a DB named "Admin"
then I select the logfiles on the file system that have not yet been applied
sorted in datetime order for example
then I apply them one at a time.
hope this makes sense.
I can dig up the scripts if you really need (But it will cost you some
Sushi)
Greg Jackson
PDX, Oregon
|||You can get all the DB backup history from the msdb database.
Specifically, you get the media_set_id values for the backups you wish
to restore from dbo.backupset based on DB name, DB vs LOG backups, dates
& times, etc., etc. And then you can get the physical file location for
those backups from dbo.backupmediafamily (using
dbo.backupset.media_set_id, which corresponds to
dbo.backupmediafamily.media_set_id). Something like:
select bs.backup_start_date, bs.type, bmf.physical_device_name
from msdb.dbo.backupset bs
inner join msdb.dbo.backupmediafamily bmf
on bmf.media_set_id = bs.media_set_id
where bs.database_name = N'MyDB'
order by bs.backup_start_date
Based on that kind of query it should be a piece of cake to automate a
restore procedure given some constraints around the restore (like
DBName, start datetime, finish datetime, etc.) also not forgetting to
restore a "D" backup followed by zero or more "L" backups.
HTH,
Mike.
PS. Do I get Sushi now?
pdxJaxon wrote:
> I keep my own table to track which log files I've applied
> I store the table in a DB named "Admin"
> then I select the logfiles on the file system that have not yet been applied
> sorted in datetime order for example
> then I apply them one at a time.
>
> hope this makes sense.
> I can dig up the scripts if you really need (But it will cost you some
> Sushi)
>
> Greg Jackson
> PDX, Oregon
>
C
|||Hi Mangesh,
If your objective is to have a standby database, have you thought of SQL
Server log-shipping as an option? Its pretty simple to set-up and get it
running.
Thanks
Yogish

restore question

Hi
I am taking a backup of SQLSERVER on remote machine. I need to restore the
database on a daily basis on the remote machine.
I take backup of transaction log using maintenance plan every 30 mins.
It generates 48 transaciton log per day.
How can write a script to restore the database applying those 48 logs.
I can create linked server to production but what table keeps the backup log
information that I can use to build this.
Thanks
MangeshI keep my own table to track which log files I've applied
I store the table in a DB named "Admin"
then I select the logfiles on the file system that have not yet been applied
sorted in datetime order for example
then I apply them one at a time.
hope this makes sense.
I can dig up the scripts if you really need (But it will cost you some
Sushi)
Greg Jackson
PDX, Oregon|||You can get all the DB backup history from the msdb database.
Specifically, you get the media_set_id values for the backups you wish
to restore from dbo.backupset based on DB name, DB vs LOG backups, dates
& times, etc., etc. And then you can get the physical file location for
those backups from dbo.backupmediafamily (using
dbo.backupset.media_set_id, which corresponds to
dbo.backupmediafamily.media_set_id). Something like:
select bs.backup_start_date, bs.type, bmf.physical_device_name
from msdb.dbo.backupset bs
inner join msdb.dbo.backupmediafamily bmf
on bmf.media_set_id = bs.media_set_id
where bs.database_name = N'MyDB'
order by bs.backup_start_date
Based on that kind of query it should be a piece of cake to automate a
restore procedure given some constraints around the restore (like
DBName, start datetime, finish datetime, etc.) also not forgetting to
restore a "D" backup followed by zero or more "L" backups.
HTH,
Mike.
PS. Do I get Sushi now?
pdxJaxon wrote:
> I keep my own table to track which log files I've applied
> I store the table in a DB named "Admin"
> then I select the logfiles on the file system that have not yet been applied
> sorted in datetime order for example
> then I apply them one at a time.
>
> hope this makes sense.
> I can dig up the scripts if you really need (But it will cost you some
> Sushi)
>
> Greg Jackson
> PDX, Oregon
>
--
ÿþC|||Hi Mangesh,
If your objective is to have a standby database, have you thought of SQL
Server log-shipping as an option? Its pretty simple to set-up and get it
running.
--
Thanks
Yogish

restore question

Hi
I am taking a backup of SQLSERVER on remote machine. I need to restore the
database on a daily basis on the remote machine.
I take backup of transaction log using maintenance plan every 30 mins.
It generates 48 transaciton log per day.
How can write a script to restore the database applying those 48 logs.
I can create linked server to production but what table keeps the backup log
information that I can use to build this.
Thanks
MangeshI keep my own table to track which log files I've applied
I store the table in a DB named "Admin"
then I select the logfiles on the file system that have not yet been applied
sorted in datetime order for example
then I apply them one at a time.
hope this makes sense.
I can dig up the scripts if you really need (But it will cost you some
Sushi)
Greg Jackson
PDX, Oregon|||You can get all the DB backup history from the msdb database.
Specifically, you get the media_set_id values for the backups you wish
to restore from dbo.backupset based on DB name, DB vs LOG backups, dates
& times, etc., etc. And then you can get the physical file location for
those backups from dbo.backupmediafamily (using
dbo.backupset.media_set_id, which corresponds to
dbo.backupmediafamily.media_set_id). Something like:
select bs.backup_start_date, bs.type, bmf.physical_device_name
from msdb.dbo.backupset bs
inner join msdb.dbo.backupmediafamily bmf
on bmf.media_set_id = bs.media_set_id
where bs.database_name = N'MyDB'
order by bs.backup_start_date
Based on that kind of query it should be a piece of cake to automate a
restore procedure given some constraints around the restore (like
DBName, start datetime, finish datetime, etc.) also not forgetting to
restore a "D" backup followed by zero or more "L" backups.
HTH,
Mike.
PS. Do I get Sushi now?
pdxJaxon wrote:
> I keep my own table to track which log files I've applied
> I store the table in a DB named "Admin"
> then I select the logfiles on the file system that have not yet been appli
ed
> sorted in datetime order for example
> then I apply them one at a time.
>
> hope this makes sense.
> I can dig up the scripts if you really need (But it will cost you some
> Sushi)
>
> Greg Jackson
> PDX, Oregon
>
C|||Hi Mangesh,
If your objective is to have a standby database, have you thought of SQL
Server log-shipping as an option? Its pretty simple to set-up and get it
running.
Thanks
Yogish