March 9, 2008 at 3:19 pm
I have two instances of SQL server, sbs\si and sbs\test.
On sbs\si I have 6 databases and on sbs\test I have 3 test databases that are a copy of 3 databases on sbs\si.
1. question:
Is it possible to be on SQL QA on test instance and do a backup of databases that are on the si instance?
2. question:
Is it possible to delete files that are created with "backup database.." with TSQL?
lp,K
March 9, 2008 at 3:37 pm
OK, I found the answer to te second question 😀
backup database Cert55_KV to disk='C:\Temp\TEST_DELETA.bak'
execute master.dbo.xp_delete_file 0,'C:\Temp\TEST_DELETA.bak'
March 9, 2008 at 10:59 pm
Hi,
If you want to perform backup from being in one server to another server, you need to create a share in that server and ensure that Sqlservice account has modify permissions to that.
1. Backup database dbname to disk='\\servername\share name\.bak'
2. You can also use xp_cmdshell command to delete the backup files created. Since it is a powerful command the permissions to use it needs to be restricted.
execute master..xp_cmdshell 'del C:\Test\deepak.bak'
Running the above command will delete the deepak.bak file from C:\test folder.
Refer this link for more info about the command,
http://msdn2.microsoft.com/en-us/library/aa260689.aspx
[font="Verdana"]- Deepak[/font]
March 10, 2008 at 12:04 am
i'm on instance sbs/test and i wanna make a backup from sbs/si (now i must have two scriptsm i wanna have only one) , something like:
backup database [sbs/si]..database to disk='\\kv\temp\DatabaseFromSi.bak'
go
restore database DatabaseFromSi from ....
go
delete file (ok that part is ok:))
any idea?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply