Showing posts with label machine. Show all posts
Showing posts with label machine. Show all posts

Tuesday, March 20, 2012

BACKUP db to network machine

Hi all
win 2k pro (on all machines)
sql 2k (1 machine)
in our maintance plan I have the DB backing up every 24 hours - this
backup is into the default BACKUPS folder - on the SAME machine &
drive.
I would also like the maintance plan to back up the DB accross the
network to a 2nd machine (where we keep all our backups of other
files) but in the "backup device" bit it's only listing the c:\ and
not any netword paths...
Q) How can i get it to back up across the network to a 2nd machine in
the maintance plan?
thanks
AlIN SEM simply select backup... then choose Add button and type in the unc
name ie
\\london\sqlshare\mybackup.bak and you will be good ( as long as permissions
allow.)
"Harag" <harag@.softhome.net> wrote in message
news:kd47kvcm6qrpmbda1jes9rk1pm8oqgg5bn@.4ax.com...
> Hi all
> win 2k pro (on all machines)
> sql 2k (1 machine)
> in our maintance plan I have the DB backing up every 24 hours - this
> backup is into the default BACKUPS folder - on the SAME machine &
> drive.
> I would also like the maintance plan to back up the DB accross the
> network to a 2nd machine (where we keep all our backups of other
> files) but in the "backup device" bit it's only listing the c:\ and
> not any netword paths...
> Q) How can i get it to back up across the network to a 2nd machine in
> the maintance plan?
> thanks
> Al|||Harag,
Set up a share in the destination server and use UNC pattern, as in
BACKUP DATABASE <dbname>
TO DISK = '\\destserver\d$\dbbackup.BAK'
That said, I have seen that backing across the network can slow things
down.Do the backup locally and then have some process to copy the file over.
--
Dinesh.
SQL Server FAQ at
http://www.tkdinesh.com
"Harag" <harag@.softhome.net> wrote in message
news:kd47kvcm6qrpmbda1jes9rk1pm8oqgg5bn@.4ax.com...
> Hi all
> win 2k pro (on all machines)
> sql 2k (1 machine)
> in our maintance plan I have the DB backing up every 24 hours - this
> backup is into the default BACKUPS folder - on the SAME machine &
> drive.
> I would also like the maintance plan to back up the DB accross the
> network to a 2nd machine (where we keep all our backups of other
> files) but in the "backup device" bit it's only listing the c:\ and
> not any netword paths...
> Q) How can i get it to back up across the network to a 2nd machine in
> the maintance plan?
> thanks
> Al

Wednesday, March 7, 2012

Backup and restore to the same machine

We are using SQL Server 2005.
I did a full back up of myDatabase. I would like to restore it to a
different database name on the same machine (I still want the original
database to be there), can I do that ?
On the Restore database, under the "To database" I typed in "myNewDatabase",
and on the "From device" I selected the full backup that I made.
When I try to restore it, it gave me an error "The file c:\program
files\...\myDatabase.mdf" cannot be overwritten. It is being used by
database 'myDatabase'. (Microsoft.SQLServer.Smo).
So, does it mean that even though I restore it to a different database name,
I can not restore the database in the same machine ?
Thank you.
fniles,
You also need to use the BACKUP feature to MOVE Filename TO
NewPhysicalFileName.
If you are using the SQL Server Management Studio to do this, on the RESTORE
dialog, click on the OPTIONS tab. You can give new file names to the
restoring mdf and ldg there.
RLF
"fniles" <fniles@.pfmail.com> wrote in message
news:eq5y9tVTIHA.5980@.TK2MSFTNGP04.phx.gbl...
> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in
> "myNewDatabase", and on the "From device" I selected the full backup that
> I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database
> name, I can not restore the database in the same machine ?
> Thank you.
>
|||It can be done .. do this:
1) Create a new database called 'myDB2'.
2) Right click on the myDB2, and go to Restore.
3) Select the From Device to the BAK file you created from myDatabase.
4) Under options, select overwrite.
5) Change the location of the data file and log file to that of myDB2. So
it can over write the files for this database to match what is in your backup.
That should work for yaa ;-).
Or you can run the following script:
RESTORE DATABASE [myDB2]
FROM DISK = 'D:\MSSQL\Backup\myDatabase.bak'
WITH FILE = 1,
MOVE N'myDatabase_dat' TO 'D:\MSSQL\DATA\myDB2_dat.mdf'
MOVE N'myDatabase_log' TO 'E:\MSSQL\LOG\myDB2.ldf',
NOUNLOAD, REPLACE, STATS = 10
After creating the database
Thanks!
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
"fniles" wrote:

> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database name,
> I can not restore the database in the same machine ?
> Thank you.
>
>
|||Hi
You will need to use the move option for the restore command see example E at
http://msdn2.microsoft.com/en-us/library/ms186858.aspx
John
"fniles" wrote:

> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database name,
> I can not restore the database in the same machine ?
> Thank you.
>
>
|||First line should have said: ... use the RESTORE feature to MOVE Filename TO
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:OMqsA2VTIHA.1164@.TK2MSFTNGP02.phx.gbl...
> fniles,
> You also need to use the BACKUP feature to MOVE Filename TO
> NewPhysicalFileName.
> If you are using the SQL Server Management Studio to do this, on the
> RESTORE dialog, click on the OPTIONS tab. You can give new file names to
> the restoring mdf and ldg there.
> RLF
> "fniles" <fniles@.pfmail.com> wrote in message
> news:eq5y9tVTIHA.5980@.TK2MSFTNGP04.phx.gbl...
>
|||Hi
I should have added use RESTORE FILELISTONLY to get the logical file names
of you don't know what they are, or look at the existing database. Logical
file names do not have to be different between databases (and in this case
will not unless you change them later!)
John
"fniles" wrote:

> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database name,
> I can not restore the database in the same machine ?
> Thank you.
>
>
|||"Russell Fields" <russellfields@.nomail.com> wrote in message
news:%23$DDE5VTIHA.5524@.TK2MSFTNGP05.phx.gbl...
> First line should have said: ... use the RESTORE feature to MOVE Filename
> TO
>
And here I was thinking that was a nifty new feature I was going to try out.
(I actually could think of cases where it would be useful.)

> "Russell Fields" <russellfields@.nomail.com> wrote in message
> news:OMqsA2VTIHA.1164@.TK2MSFTNGP02.phx.gbl...
>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Backup and restore to the same machine

We are using SQL Server 2005.
I did a full back up of myDatabase. I would like to restore it to a
different database name on the same machine (I still want the original
database to be there), can I do that ?
On the Restore database, under the "To database" I typed in "myNewDatabase",
and on the "From device" I selected the full backup that I made.
When I try to restore it, it gave me an error "The file c:\program
files\...\myDatabase.mdf" cannot be overwritten. It is being used by
database 'myDatabase'. (Microsoft.SQLServer.Smo).
So, does it mean that even though I restore it to a different database name,
I can not restore the database in the same machine ?
Thank you.fniles,
You also need to use the BACKUP feature to MOVE Filename TO
NewPhysicalFileName.
If you are using the SQL Server Management Studio to do this, on the RESTORE
dialog, click on the OPTIONS tab. You can give new file names to the
restoring mdf and ldg there.
RLF
"fniles" <fniles@.pfmail.com> wrote in message
news:eq5y9tVTIHA.5980@.TK2MSFTNGP04.phx.gbl...
> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in
> "myNewDatabase", and on the "From device" I selected the full backup that
> I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database
> name, I can not restore the database in the same machine ?
> Thank you.
>|||It can be done .. do this:
1) Create a new database called 'myDB2'.
2) Right click on the myDB2, and go to Restore.
3) Select the From Device to the BAK file you created from myDatabase.
4) Under options, select overwrite.
5) Change the location of the data file and log file to that of myDB2. So
it can over write the files for this database to match what is in your backup.
That should work for yaa ;-).
Or you can run the following script:
RESTORE DATABASE [myDB2]
FROM DISK = 'D:\MSSQL\Backup\myDatabase.bak'
WITH FILE = 1,
MOVE N'myDatabase_dat' TO 'D:\MSSQL\DATA\myDB2_dat.mdf'
MOVE N'myDatabase_log' TO 'E:\MSSQL\LOG\myDB2.ldf',
NOUNLOAD, REPLACE, STATS = 10
After creating the database :)
Thanks!
--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
"fniles" wrote:
> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database name,
> I can not restore the database in the same machine ?
> Thank you.
>
>|||Hi
You will need to use the move option for the restore command see example E at
http://msdn2.microsoft.com/en-us/library/ms186858.aspx
John
"fniles" wrote:
> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database name,
> I can not restore the database in the same machine ?
> Thank you.
>
>|||First line should have said: ... use the RESTORE feature to MOVE Filename TO
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:OMqsA2VTIHA.1164@.TK2MSFTNGP02.phx.gbl...
> fniles,
> You also need to use the BACKUP feature to MOVE Filename TO
> NewPhysicalFileName.
> If you are using the SQL Server Management Studio to do this, on the
> RESTORE dialog, click on the OPTIONS tab. You can give new file names to
> the restoring mdf and ldg there.
> RLF
> "fniles" <fniles@.pfmail.com> wrote in message
> news:eq5y9tVTIHA.5980@.TK2MSFTNGP04.phx.gbl...
>> We are using SQL Server 2005.
>> I did a full back up of myDatabase. I would like to restore it to a
>> different database name on the same machine (I still want the original
>> database to be there), can I do that ?
>> On the Restore database, under the "To database" I typed in
>> "myNewDatabase", and on the "From device" I selected the full backup that
>> I made.
>> When I try to restore it, it gave me an error "The file c:\program
>> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
>> database 'myDatabase'. (Microsoft.SQLServer.Smo).
>> So, does it mean that even though I restore it to a different database
>> name, I can not restore the database in the same machine ?
>> Thank you.
>|||Hi
I should have added use RESTORE FILELISTONLY to get the logical file names
of you don't know what they are, or look at the existing database. Logical
file names do not have to be different between databases (and in this case
will not unless you change them later!)
John
"fniles" wrote:
> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database name,
> I can not restore the database in the same machine ?
> Thank you.
>
>|||"Russell Fields" <russellfields@.nomail.com> wrote in message
news:%23$DDE5VTIHA.5524@.TK2MSFTNGP05.phx.gbl...
> First line should have said: ... use the RESTORE feature to MOVE Filename
> TO
>
And here I was thinking that was a nifty new feature I was going to try out.
(I actually could think of cases where it would be useful.)
> "Russell Fields" <russellfields@.nomail.com> wrote in message
> news:OMqsA2VTIHA.1164@.TK2MSFTNGP02.phx.gbl...
>> fniles,
>> You also need to use the BACKUP feature to MOVE Filename TO
>> NewPhysicalFileName.
>> If you are using the SQL Server Management Studio to do this, on the
>> RESTORE dialog, click on the OPTIONS tab. You can give new file names to
>> the restoring mdf and ldg there.
>> RLF
>
Greg Moore
SQL Server DBA Consulting Remote and Onsite available!
Email: sql (at) greenms.com http://www.greenms.com/sqlserver.html

Backup and restore to the same machine

We are using SQL Server 2005.
I did a full back up of myDatabase. I would like to restore it to a
different database name on the same machine (I still want the original
database to be there), can I do that ?
On the Restore database, under the "To database" I typed in "myNewDatabase",
and on the "From device" I selected the full backup that I made.
When I try to restore it, it gave me an error "The file c:\program
files\...\myDatabase.mdf" cannot be overwritten. It is being used by
database 'myDatabase'. (Microsoft.SQLServer.Smo).
So, does it mean that even though I restore it to a different database name,
I can not restore the database in the same machine ?
Thank you.fniles,
You also need to use the BACKUP feature to MOVE Filename TO
NewPhysicalFileName.
If you are using the SQL Server Management Studio to do this, on the RESTORE
dialog, click on the OPTIONS tab. You can give new file names to the
restoring mdf and ldg there.
RLF
"fniles" <fniles@.pfmail.com> wrote in message
news:eq5y9tVTIHA.5980@.TK2MSFTNGP04.phx.gbl...
> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in
> "myNewDatabase", and on the "From device" I selected the full backup that
> I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database
> name, I can not restore the database in the same machine ?
> Thank you.
>|||It can be done .. do this:
1) Create a new database called 'myDB2'.
2) Right click on the myDB2, and go to Restore.
3) Select the From Device to the BAK file you created from myDatabase.
4) Under options, select overwrite.
5) Change the location of the data file and log file to that of myDB2. So
it can over write the files for this database to match what is in your backu
p.
That should work for yaa ;-).
Or you can run the following script:
RESTORE DATABASE [myDB2]
FROM DISK = 'D:\MSSQL\Backup\myDatabase.bak'
WITH FILE = 1,
MOVE N'myDatabase_dat' TO 'D:\MSSQL\DATA\myDB2_dat.mdf'
MOVE N'myDatabase_log' TO 'E:\MSSQL\LOG\myDB2.ldf',
NOUNLOAD, REPLACE, STATS = 10
After creating the database
Thanks!
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
"fniles" wrote:

> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase
",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database nam
e,
> I can not restore the database in the same machine ?
> Thank you.
>
>|||Hi
You will need to use the move option for the restore command see example E a
t
http://msdn2.microsoft.com/en-us/library/ms186858.aspx
John
"fniles" wrote:

> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase
",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database nam
e,
> I can not restore the database in the same machine ?
> Thank you.
>
>|||First line should have said: ... use the RESTORE feature to MOVE Filename TO
"Russell Fields" <russellfields@.nomail.com> wrote in message
news:OMqsA2VTIHA.1164@.TK2MSFTNGP02.phx.gbl...
> fniles,
> You also need to use the BACKUP feature to MOVE Filename TO
> NewPhysicalFileName.
> If you are using the SQL Server Management Studio to do this, on the
> RESTORE dialog, click on the OPTIONS tab. You can give new file names to
> the restoring mdf and ldg there.
> RLF
> "fniles" <fniles@.pfmail.com> wrote in message
> news:eq5y9tVTIHA.5980@.TK2MSFTNGP04.phx.gbl...
>|||Hi
I should have added use RESTORE FILELISTONLY to get the logical file names
of you don't know what they are, or look at the existing database. Logical
file names do not have to be different between databases (and in this case
will not unless you change them later!)
John
"fniles" wrote:

> We are using SQL Server 2005.
> I did a full back up of myDatabase. I would like to restore it to a
> different database name on the same machine (I still want the original
> database to be there), can I do that ?
> On the Restore database, under the "To database" I typed in "myNewDatabase
",
> and on the "From device" I selected the full backup that I made.
> When I try to restore it, it gave me an error "The file c:\program
> files\...\myDatabase.mdf" cannot be overwritten. It is being used by
> database 'myDatabase'. (Microsoft.SQLServer.Smo).
> So, does it mean that even though I restore it to a different database nam
e,
> I can not restore the database in the same machine ?
> Thank you.
>
>

Backup and restore to a different machine

I am using SQL Server 2000. I backup database dbA in machine A. I would like
to restore this backup in another machine (machine B).
In Machine B I map network drive to machine A (say to drive X).
So, in Enterprise Manager on the SQL Server for machine B, I created a
database called dbA, then I go to task - restore database.
In restore database I do not see drive X to restore the database from.
Can I restore dbA that is located on machine A to dbA on machine B without
copying the backup for dbA to machine B ?
Thank you.
It's best to do this by executing the RESTORE DATABASE statement, and by
using UNC instead of a mapped drive letter.
First, find out the database files used by the database on Machine A. You
can execute RESTORE FILELISTONLY against the MacbineB instance as follows to
find the logical names of these database files (assuming that the backup file
DBA.bak is in C:\junk):
restore filelistonly from disk='\\MachineA\c$\junk\DBA.bak'
Then, you can execute RESTORE DATABASE against the MachineB instance as
follows to restore the database (assuming that the database file logical
names are 'dba' and 'dba_log'):
restore database DBA from disk='\\MachineA\c$\junk\DBA.bak'
with recovery, move 'dba' to 'd:\junk\dba.mdf',
move 'dba_log' to 'd:\junk\dba_log.ldf'
Linchi
"fniles" wrote:

> I am using SQL Server 2000. I backup database dbA in machine A. I would like
> to restore this backup in another machine (machine B).
> In Machine B I map network drive to machine A (say to drive X).
> So, in Enterprise Manager on the SQL Server for machine B, I created a
> database called dbA, then I go to task - restore database.
> In restore database I do not see drive X to restore the database from.
> Can I restore dbA that is located on machine A to dbA on machine B without
> copying the backup for dbA to machine B ?
> Thank you.
>
>
|||In addition to Linchi's suggestion you also need to copy the logins to make
sure you won't have problems with accessing those databases once they are
restored on the other machine. Creating those same users on the other
machine manually won't do the trick as accounts are mapped using SID values
"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:98E7782B-40E4-40AE-A891-7A03143BAD84@.microsoft.com...[vbcol=seagreen]
> It's best to do this by executing the RESTORE DATABASE statement, and by
> using UNC instead of a mapped drive letter.
> First, find out the database files used by the database on Machine A. You
> can execute RESTORE FILELISTONLY against the MacbineB instance as follows
> to
> find the logical names of these database files (assuming that the backup
> file
> DBA.bak is in C:\junk):
> restore filelistonly from disk='\\MachineA\c$\junk\DBA.bak'
> Then, you can execute RESTORE DATABASE against the MachineB instance as
> follows to restore the database (assuming that the database file logical
> names are 'dba' and 'dba_log'):
> restore database DBA from disk='\\MachineA\c$\junk\DBA.bak'
> with recovery, move 'dba' to 'd:\junk\dba.mdf',
> move 'dba_log' to 'd:\junk\dba_log.ldf'
> Linchi
> "fniles" wrote:

Backup and restore to a different machine

I am using SQL Server 2000. I backup database dbA in machine A. I would like
to restore this backup in another machine (machine B).
In Machine B I map network drive to machine A (say to drive X).
So, in Enterprise Manager on the SQL Server for machine B, I created a
database called dbA, then I go to task - restore database.
In restore database I do not see drive X to restore the database from.
Can I restore dbA that is located on machine A to dbA on machine B without
copying the backup for dbA to machine B ?
Thank you.It's best to do this by executing the RESTORE DATABASE statement, and by
using UNC instead of a mapped drive letter.
First, find out the database files used by the database on Machine A. You
can execute RESTORE FILELISTONLY against the MacbineB instance as follows to
find the logical names of these database files (assuming that the backup file
DBA.bak is in C:\junk):
restore filelistonly from disk='\\MachineA\c$\junk\DBA.bak'
Then, you can execute RESTORE DATABASE against the MachineB instance as
follows to restore the database (assuming that the database file logical
names are 'dba' and 'dba_log'):
restore database DBA from disk='\\MachineA\c$\junk\DBA.bak'
with recovery, move 'dba' to 'd:\junk\dba.mdf',
move 'dba_log' to 'd:\junk\dba_log.ldf'
Linchi
"fniles" wrote:
> I am using SQL Server 2000. I backup database dbA in machine A. I would like
> to restore this backup in another machine (machine B).
> In Machine B I map network drive to machine A (say to drive X).
> So, in Enterprise Manager on the SQL Server for machine B, I created a
> database called dbA, then I go to task - restore database.
> In restore database I do not see drive X to restore the database from.
> Can I restore dbA that is located on machine A to dbA on machine B without
> copying the backup for dbA to machine B ?
> Thank you.
>
>|||In addition to Linchi's suggestion you also need to copy the logins to make
sure you won't have problems with accessing those databases once they are
restored on the other machine. Creating those same users on the other
machine manually won't do the trick as accounts are mapped using SID values
"Linchi Shea" <LinchiShea@.discussions.microsoft.com> wrote in message
news:98E7782B-40E4-40AE-A891-7A03143BAD84@.microsoft.com...
> It's best to do this by executing the RESTORE DATABASE statement, and by
> using UNC instead of a mapped drive letter.
> First, find out the database files used by the database on Machine A. You
> can execute RESTORE FILELISTONLY against the MacbineB instance as follows
> to
> find the logical names of these database files (assuming that the backup
> file
> DBA.bak is in C:\junk):
> restore filelistonly from disk='\\MachineA\c$\junk\DBA.bak'
> Then, you can execute RESTORE DATABASE against the MachineB instance as
> follows to restore the database (assuming that the database file logical
> names are 'dba' and 'dba_log'):
> restore database DBA from disk='\\MachineA\c$\junk\DBA.bak'
> with recovery, move 'dba' to 'd:\junk\dba.mdf',
> move 'dba_log' to 'd:\junk\dba_log.ldf'
> Linchi
> "fniles" wrote:
>> I am using SQL Server 2000. I backup database dbA in machine A. I would
>> like
>> to restore this backup in another machine (machine B).
>> In Machine B I map network drive to machine A (say to drive X).
>> So, in Enterprise Manager on the SQL Server for machine B, I created a
>> database called dbA, then I go to task - restore database.
>> In restore database I do not see drive X to restore the database from.
>> Can I restore dbA that is located on machine A to dbA on machine B
>> without
>> copying the backup for dbA to machine B ?
>> Thank you.
>>
>>

Saturday, February 25, 2012

Backup and restore

We are using SQL Server 2005.
To do db backup and restore from 1 machine to another, do I need to already
have the database created on the 2nd machine ? Do I need to have the tables
and stored procedures and views created already on the 2nd machine ?
Thank you
Hi,
You do not need to create anything on the second server. Just restore the
database from your backup files and the database and everything inside
(tables, stored procedures, views, etc.) will be created for you.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"fniles" wrote:

> We are using SQL Server 2005.
> To do db backup and restore from 1 machine to another, do I need to already
> have the database created on the 2nd machine ? Do I need to have the tables
> and stored procedures and views created already on the 2nd machine ?
> Thank you
>
>

Backup and restore

We are using SQL Server 2005.
To do db backup and restore from 1 machine to another, do I need to already
have the database created on the 2nd machine ? Do I need to have the tables
and stored procedures and views created already on the 2nd machine ?
Thank youHi,
You do not need to create anything on the second server. Just restore the
database from your backup files and the database and everything inside
(tables, stored procedures, views, etc.) will be created for you.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"fniles" wrote:

> We are using SQL Server 2005.
> To do db backup and restore from 1 machine to another, do I need to alread
y
> have the database created on the 2nd machine ? Do I need to have the tabl
es
> and stored procedures and views created already on the 2nd machine ?
> Thank you
>
>

Backup and restore

We are using SQL Server 2005.
To do db backup and restore from 1 machine to another, do I need to already
have the database created on the 2nd machine ? Do I need to have the tables
and stored procedures and views created already on the 2nd machine ?
Thank youHi,
You do not need to create anything on the second server. Just restore the
database from your backup files and the database and everything inside
(tables, stored procedures, views, etc.) will be created for you.
Hope this helps,
Ben Nevarez
Senior Database Administrator
AIG SunAmerica
"fniles" wrote:
> We are using SQL Server 2005.
> To do db backup and restore from 1 machine to another, do I need to already
> have the database created on the 2nd machine ? Do I need to have the tables
> and stored procedures and views created already on the 2nd machine ?
> Thank you
>
>

Friday, February 24, 2012

Backup and Log Strategies

Hi all,
I'm mostly an application developer - so please don't flog me for not
knowing things which are probably very basic. Our machine keeps
running out of space. We have all our data/bak/log files on e: , and
they have some kind of maintenance plan set up. Backups of the data
and log are created one after another and never deleted. In the 4
years we've been running various systems, we've never had to restore to
a previous time - just restore to current state once.
I've also read that the transaction log should automatically shrink
after it is backed up. When I do this manually it doesn't happen - I
have to run 'shrink db' after to make it happen. It doesn't seem to
happen with their scheduled routines either.
Do people write scripts to delete old backups?
Should we be using the overwrite option so we don't get a buildup?
What other tips might you have?
thanks alot
SamMaint Plans creates a new file for every backup. so if you use maint plans, there no "overwrite"
considerations. MPs also have option to remove backups "older than...". Check the plan to see what
it is configured for. MPs has (among other things) one bad behavior, though. If a plan fails, it
stops. And removal of old backup files is among the last things performed. One such frequent reason
if that you have included databases in simple recovery mode for plans that try to do log backups. So
sqlmaint tries a log backups for, for example master, it fails and the execution stops without
removing *any* old backup files.
The ldf file is emptied when you do a log backup, that is not the same as shrinking the file size.
See http://www.karaszi.com/SQLServer/info_dont_shrink.asp for elaborations on the subject.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<samuelgreene@.gmail.com> wrote in message
news:1154533293.924009.30720@.m73g2000cwd.googlegroups.com...
> Hi all,
> I'm mostly an application developer - so please don't flog me for not
> knowing things which are probably very basic. Our machine keeps
> running out of space. We have all our data/bak/log files on e: , and
> they have some kind of maintenance plan set up. Backups of the data
> and log are created one after another and never deleted. In the 4
> years we've been running various systems, we've never had to restore to
> a previous time - just restore to current state once.
> I've also read that the transaction log should automatically shrink
> after it is backed up. When I do this manually it doesn't happen - I
> have to run 'shrink db' after to make it happen. It doesn't seem to
> happen with their scheduled routines either.
> Do people write scripts to delete old backups?
> Should we be using the overwrite option so we don't get a buildup?
> What other tips might you have?
> thanks alot
> Sam
>|||Thank you very much!

Backup and Log Strategies

Hi all,
I'm mostly an application developer - so please don't flog me for not
knowing things which are probably very basic. Our machine keeps
running out of space. We have all our data/bak/log files on e: , and
they have some kind of maintenance plan set up. Backups of the data
and log are created one after another and never deleted. In the 4
years we've been running various systems, we've never had to restore to
a previous time - just restore to current state once.
I've also read that the transaction log should automatically shrink
after it is backed up. When I do this manually it doesn't happen - I
have to run 'shrink db' after to make it happen. It doesn't seem to
happen with their scheduled routines either.
Do people write scripts to delete old backups?
Should we be using the overwrite option so we don't get a buildup?
What other tips might you have?
thanks alot
SamMaint Plans creates a new file for every backup. so if you use maint plans,
there no "overwrite"
considerations. MPs also have option to remove backups "older than...". Chec
k the plan to see what
it is configured for. MPs has (among other things) one bad behavior, though.
If a plan fails, it
stops. And removal of old backup files is among the last things performed. O
ne such frequent reason
if that you have included databases in simple recovery mode for plans that t
ry to do log backups. So
sqlmaint tries a log backups for, for example master, it fails and the execu
tion stops without
removing *any* old backup files.
The ldf file is emptied when you do a log backup, that is not the same as sh
rinking the file size.
See http://www.karaszi.com/SQLServer/info_dont_shrink.asp for elaborations o
n the subject.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<samuelgreene@.gmail.com> wrote in message
news:1154533293.924009.30720@.m73g2000cwd.googlegroups.com...
> Hi all,
> I'm mostly an application developer - so please don't flog me for not
> knowing things which are probably very basic. Our machine keeps
> running out of space. We have all our data/bak/log files on e: , and
> they have some kind of maintenance plan set up. Backups of the data
> and log are created one after another and never deleted. In the 4
> years we've been running various systems, we've never had to restore to
> a previous time - just restore to current state once.
> I've also read that the transaction log should automatically shrink
> after it is backed up. When I do this manually it doesn't happen - I
> have to run 'shrink db' after to make it happen. It doesn't seem to
> happen with their scheduled routines either.
> Do people write scripts to delete old backups?
> Should we be using the overwrite option so we don't get a buildup?
> What other tips might you have?
> thanks alot
> Sam
>|||Thank you very much!

Thursday, February 16, 2012

Backup

Hi

I had problem with my backup file. I'm taking backup on remote machine a full backup in append mode just because my database size is small.Due to some reason the backup was incompleted that was shown when i'm looking the file. Now when i' try to backup on same file it gives an error messages. Is it possible to remove the incomplete mark on file.Even if i try overite the file its not allowed. Tell me why its so and how to use the same file without moving it.Howdy

No - rename the old file & use a new file . If the old file is corrupted, you run the risk of continually using a corrupted backup - not a good thing.

Cheers,

SG.

Backup

I am very new to SQL Express. A database is located on a local machine. When I try to do a backup I get the following error:

Backup failed for server ‘server name’

(Microsoft.sql server.Express.smo)

Additional information:

Set property Devices to accomplish this action.

(Microsoft.sql server.Express.smo)

Their IT tecnicians insits that I have full administrative rights.

I am lost for a solution.

Would it be wise to shrink the database, detach from the database and copy both the mdf and idf to a different machine? I have never done this procedure before.

Please help.

Could you please send over the executed script ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||I am having same problem.
I am connected to sql server 2000 instance.
When trying to backup the database i got the same error
Any idea why ?|||

Which Gui are you using ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||Sql Server Management Studio|||

Could you please then post the resulting Backup SQL command which is available through the script functionality within the Backup UI.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Did anyone get a resolution to this? I'm having the same problem. I uninstalled and reinstalled SQL Server 2005 Express and then reinstalled and it worked fine. I was able to back up the database for two days. Then the error started coming up again and now I'm getting the "Set property Devices to accomplish this action." error again.

I have no clue what property device it's talking about or where to set them. Any help would be greatly appreciated!

Thanks,

Steve

Tuesday, February 14, 2012

Backup

I am very new to SQL Express. A database is located on a local machine. When I try to do a backup I get the following error:

Backup failed for server ‘server name’

(Microsoft.sql server.Express.smo)

Additional information:

Set property Devices to accomplish this action.

(Microsoft.sql server.Express.smo)

Their IT tecnicians insits that I have full administrative rights.

I am lost for a solution.

Would it be wise to shrink the database, detach from the database and copy both the mdf and idf to a different machine? I have never done this procedure before.

Please help.

Could you please send over the executed script ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||I am having same problem.
I am connected to sql server 2000 instance.
When trying to backup the database i got the same error
Any idea why ?|||

Which Gui are you using ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||Sql Server Management Studio|||

Could you please then post the resulting Backup SQL command which is available through the script functionality within the Backup UI.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Did anyone get a resolution to this? I'm having the same problem. I uninstalled and reinstalled SQL Server 2005 Express and then reinstalled and it worked fine. I was able to back up the database for two days. Then the error started coming up again and now I'm getting the "Set property Devices to accomplish this action." error again.

I have no clue what property device it's talking about or where to set them. Any help would be greatly appreciated!

Thanks,

Steve

Backup

I am very new to SQL Express. A database is located on a local machine. When I try to do a backup I get the following error:

Backup failed for server ‘server name’

(Microsoft.sql server.Express.smo)

Additional information:

Set property Devices to accomplish this action.

(Microsoft.sql server.Express.smo)

Their IT tecnicians insits that I have full administrative rights.

I am lost for a solution.

Would it be wise to shrink the database, detach from the database and copy both the mdf and idf to a different machine? I have never done this procedure before.

Please help.

Could you please send over the executed script ?

Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||I am having same problem.
I am connected to sql server 2000 instance.
When trying to backup the database i got the same error
Any idea why ?|||

Which Gui are you using ?

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Sql Server Management Studio|||

Could you please then post the resulting Backup SQL command which is available through the script functionality within the Backup UI.

Jens K. Suessmeyer

http://www.sqlserver2005.de

|||

Did anyone get a resolution to this? I'm having the same problem. I uninstalled and reinstalled SQL Server 2005 Express and then reinstalled and it worked fine. I was able to back up the database for two days. Then the error started coming up again and now I'm getting the "Set property Devices to accomplish this action." error again.

I have no clue what property device it's talking about or where to set them. Any help would be greatly appreciated!

Thanks,

Steve

Friday, February 10, 2012

Backing up to different machine

I want to backup my databases on another remote machine, but ms sql doesnt seem to have that ability built in. Does anyone know to send the backup to a network mapped drive?

Background:

Currently, the backups are going to c:\backups located on the same machine, but I want the to go to machine backup in directories x:\backup

Any help would be appreciated.Try this,

BACKUP DATABASE [myDB] TO DISK = N'\\RemoteServerName\SharedDrive\myDB_Backup' WITH INIT , NOUNLOAD , NAME = 'myDB backup', NOSKIP , STATS = 10, NOFORMAT|||Thanks, ill give that a try.|||Any reason you want to backup directly to a network drive ? If possible, I would backup to a local device, then move it to another device... However, tape is my first choice.|||Would backing up to another machine in the network cause additional overheads to the network and indirectly effect the backup process?

If backup to a remote computer can't work, maybe you can consider replication, it is another way of backup!|||Having another server as a failover would be a nice situation. Anytime you push backups across a network you increase your chances for failure.|||ok, i guess I should spell this out a little better. The program I am running now does not support replication. Any attempt to do so would violate the license agreement and cuse the software to fail. Because of this, I find myself only able to backup on the existing sql machine. I would like these backups to go to my archive machine on the network for safety. If at all possible, I would like the local and remote backups to be created at the same time.|||Why not create a stored procedure to run after the backup has completed to copy to remote machine . That will do the task|||Thats the problem I am having. The stored procedure is not problem, but I cant get sql to recognize the other drive on the other machine on the network. the command given above in this forum doesnt seem to work for me.

I have the backups currently going to c:\ on the local machine and have mapped a shared drive that is designated e:\ that points to the other machine, but when ever I try to backup to that location, it fails.|||i believe using xp_cmdchell will solve the problem... do you have administrative rights over the shared folder.|||yes i do, and I will look into that, thanks

Backing up to a Remote machine in EM

I need to backup my databases to a remote server. The
problem is Enterprise manager will not recognize a UNC
address. Is there a way I can permanently change this
without just using trace flags.
I am running sql server 2000 with sp3a.
Any suggestions
Make mapped network drive on your machine. For what trace flags are you
talking?
Bojidar Alexandrov
"Kelly" <mavericc@.wepsoft.com> wrote in message
news:830101c431ea$54a0a920$a301280a@.phx.gbl...
> I need to backup my databases to a remote server. The
> problem is Enterprise manager will not recognize a UNC
> address. Is there a way I can permanently change this
> without just using trace flags.
> I am running sql server 2000 with sp3a.
> Any suggestions
|||Mapped drives are not recognized by Enterprise manager either.
I was refering to traceflag 1807.
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||Have the ID that SQL agent is running under map the drive letter then try
and connect to it.
Jeff Duncan
MCDBA, MCSE+I
"Kelly P" <mavericc@.wepsoft.com> wrote in message
news:%23pCT%23dgMEHA.1468@.TK2MSFTNGP12.phx.gbl...
>
> Mapped drives are not recognized by Enterprise manager either.
> I was refering to traceflag 1807.
> *** Sent via Developersdex http://www.codecomments.com ***
> Don't just participate in USENET...get rewarded for it!