I'm upgrading the hard drives in my SQL server and need
to rebuild the entire server because of the RAID
configuration.
Q. is there a way I can backup all the DTS Packages and
Scheduled Jobs? And is there a way to restore them after
the server is rebuilt?
Packages and jobs are stored in msdb (as long as you are
saving your packages to SQL Server). If you restore msdb,
you will get your packages and jobs restored with it.
-Sue
On Thu, 1 Apr 2004 12:35:19 -0800, "Joe"
<anonymous@.discussions.microsoft.com> wrote:
>I'm upgrading the hard drives in my SQL server and need
>to rebuild the entire server because of the RAID
>configuration.
>Q. is there a way I can backup all the DTS Packages and
>Scheduled Jobs? And is there a way to restore them after
>the server is rebuilt?
|||Thank you,
Joe
>--Original Message--
>Packages and jobs are stored in msdb (as long as you are
>saving your packages to SQL Server). If you restore msdb,
>you will get your packages and jobs restored with it.
>-Sue
>On Thu, 1 Apr 2004 12:35:19 -0800, "Joe"
><anonymous@.discussions.microsoft.com> wrote:
after
>.
>
Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts
Monday, March 12, 2012
Package backup
I'm upgrading the hard drives in my SQL server and need
to rebuild the entire server because of the RAID
configuration.
Q. is there a way I can backup all the DTS Packages and
Scheduled Jobs? And is there a way to restore them after
the server is rebuilt?Packages and jobs are stored in msdb (as long as you are
saving your packages to SQL Server). If you restore msdb,
you will get your packages and jobs restored with it.
-Sue
On Thu, 1 Apr 2004 12:35:19 -0800, "Joe"
<anonymous@.discussions.microsoft.com> wrote:
>I'm upgrading the hard drives in my SQL server and need
>to rebuild the entire server because of the RAID
>configuration.
>Q. is there a way I can backup all the DTS Packages and
>Scheduled Jobs? And is there a way to restore them after
>the server is rebuilt?|||Thank you,
Joe
>--Original Message--
>Packages and jobs are stored in msdb (as long as you are
>saving your packages to SQL Server). If you restore msdb,
>you will get your packages and jobs restored with it.
>-Sue
>On Thu, 1 Apr 2004 12:35:19 -0800, "Joe"
><anonymous@.discussions.microsoft.com> wrote:
>
after
>.
>
to rebuild the entire server because of the RAID
configuration.
Q. is there a way I can backup all the DTS Packages and
Scheduled Jobs? And is there a way to restore them after
the server is rebuilt?Packages and jobs are stored in msdb (as long as you are
saving your packages to SQL Server). If you restore msdb,
you will get your packages and jobs restored with it.
-Sue
On Thu, 1 Apr 2004 12:35:19 -0800, "Joe"
<anonymous@.discussions.microsoft.com> wrote:
>I'm upgrading the hard drives in my SQL server and need
>to rebuild the entire server because of the RAID
>configuration.
>Q. is there a way I can backup all the DTS Packages and
>Scheduled Jobs? And is there a way to restore them after
>the server is rebuilt?|||Thank you,
Joe
>--Original Message--
>Packages and jobs are stored in msdb (as long as you are
>saving your packages to SQL Server). If you restore msdb,
>you will get your packages and jobs restored with it.
>-Sue
>On Thu, 1 Apr 2004 12:35:19 -0800, "Joe"
><anonymous@.discussions.microsoft.com> wrote:
>
after
>.
>
Friday, March 9, 2012
Owner of the database after restore
I restored a database SynComp_TEST from a backup using a login testbinu,
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?
Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?
Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>
Owner of the database after restore
I restored a database SynComp_TEST from a backup using a login testbinu,
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>|||Follow the steps that Hari outlined for you to change the
owner.
To check a db owner, you can execute:
sp_helpdb
-Sue
On Tue, 27 Jul 2004 11:40:11 -0400, "Abraham"
<binu_ca@.yahoo.com> wrote:
>I restored a database SynComp_TEST from a backup using a login testbinu,
>which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
>I got below message ..
>Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
>file1.
>Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on fil
e
>1.
>Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1
.
>Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
>Msg 916, Level 14, State 1, Server BOYD, Line 1
>Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
>Msg 3013, Level 16, State 1, Server BOYD, Line 1
>RESTORE DATABASE is terminating abnormally.
>
>Now I think the owner of the database is 'sa ' ?Am I right ?
>Is there any way I can restore this database with testbinu as the owner ?
>Or at least testbinu as a valid user in the database?
>
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>|||Follow the steps that Hari outlined for you to change the
owner.
To check a db owner, you can execute:
sp_helpdb
-Sue
On Tue, 27 Jul 2004 11:40:11 -0400, "Abraham"
<binu_ca@.yahoo.com> wrote:
>I restored a database SynComp_TEST from a backup using a login testbinu,
>which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
>I got below message ..
>Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
>file1.
>Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on fil
e
>1.
>Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1
.
>Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
>Msg 916, Level 14, State 1, Server BOYD, Line 1
>Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
>Msg 3013, Level 16, State 1, Server BOYD, Line 1
>RESTORE DATABASE is terminating abnormally.
>
>Now I think the owner of the database is 'sa ' ?Am I right ?
>Is there any way I can restore this database with testbinu as the owner ?
>Or at least testbinu as a valid user in the database?
>
Owner of the database after restore
I restored a database SynComp_TEST from a backup using a login testbinu,
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>
Owner of the database after restore
I restored a database SynComp_TEST from a backup using a login testbinu,
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>
which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
I got below message ..
Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
file1.
Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on file
1.
Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file 1.
Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
Msg 916, Level 14, State 1, Server BOYD, Line 1
Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
Msg 3013, Level 16, State 1, Server BOYD, Line 1
RESTORE DATABASE is terminating abnormally.
Now I think the owner of the database is 'sa ' ?Am I right ?
Is there any way I can restore this database with testbinu as the owner ?
Or at least testbinu as a valid user in the database?Hi,
First you have to correct the user testbinu. The error has come because the
login testbinu was not there in the master database syslogins table.
You can rectify the problem using the procedure sp_change_users_login (see
sql server books online on usage)
After builing up the Login/ user chain , you can change the database owner
to testbinu if you need
use <dbname>
go
sp_changedbowner testbinu
Thanks
Hari
MCDBA
"Abraham" <binu_ca@.yahoo.com> wrote in message
news:#34ScB$cEHA.3664@.TK2MSFTNGP12.phx.gbl...
> I restored a database SynComp_TEST from a backup using a login testbinu,
> which have dbcreator fixed server role. ( SynComp_TEST not exists earlier)
> I got below message ..
> Processed 1672 pages for database 'SynComp_TEST', file 'Metadata_001' on
> file1.
> Processed 104 pages for database 'SynComp_TEST', file 'Datasets_001' on
file
> 1.
> Processed 8 pages for database 'SynComp_TEST', file 'Indexes_001' on file
1.
> Processed 1 pages for database 'SynComp_TEST', file 'Logs_001' on file 1.
> Msg 916, Level 14, State 1, Server BOYD, Line 1
> Server user 'testbinu' is not a valid user in database 'SynComp_TEST'.
> Msg 3013, Level 16, State 1, Server BOYD, Line 1
> RESTORE DATABASE is terminating abnormally.
>
> Now I think the owner of the database is 'sa ' ?Am I right ?
> Is there any way I can restore this database with testbinu as the owner ?
> Or at least testbinu as a valid user in the database?
>
Wednesday, March 7, 2012
Overwriting the backup media
Hi,
Is there a command to overwrite the backup mdeia (I tried the NOSKIP
option but that doesn't serve the purpose). I want the command equivalent to the checkbox in the backup window that says "Overwrite existing media".
Thanks.don't know in which languagebut if you're using sqLDMO
in VB it's like this...
dim oBackup as new SQLDMO.Backup
oBackup.initialize = true
(This will put the backupdevice to 'overwrite')|||To over write using the BACKUP command, you need to specify 'SKIP, INIT' If you want to oblitirate the backup AND any other backupsets written across the tape (stripped set) then use FORMAT. Let us know if you are still having problems.|||Hi Paul,
That seems to work.
Thanks a lot.
Is there a command to overwrite the backup mdeia (I tried the NOSKIP
option but that doesn't serve the purpose). I want the command equivalent to the checkbox in the backup window that says "Overwrite existing media".
Thanks.don't know in which languagebut if you're using sqLDMO
in VB it's like this...
dim oBackup as new SQLDMO.Backup
oBackup.initialize = true
(This will put the backupdevice to 'overwrite')|||To over write using the BACKUP command, you need to specify 'SKIP, INIT' If you want to oblitirate the backup AND any other backupsets written across the tape (stripped set) then use FORMAT. Let us know if you are still having problems.|||Hi Paul,
That seems to work.
Thanks a lot.
Overwriting backups
I'm backing up my transaction log on backup device every 15 minutes. I want
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
Leon
You can't if you are using a single device. It is all or nothing with your
only options being to use INIT or NOINIT. INIT will remove ALL files in the
device and NOINIT will simply append. Don't use a logical device and
instead backup to a different file name each time. Then you can delete what
you want.
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> I'm backing up my transaction log on backup device every 15 minutes. I
> want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
>
|||Thank you, Andrew, I hope this is something that is going to be addressed in
Yukon.
Thanks again for your help!
"Andrew J. Kelly" wrote:
> You can't if you are using a single device. It is all or nothing with your
> only options being to use INIT or NOINIT. INIT will remove ALL files in the
> device and NOINIT will simply append. Don't use a logical device and
> instead backup to a different file name each time. Then you can delete what
> you want.
> --
> Andrew J. Kelly SQL MVP
>
> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
>
>
|||Not that I know of. This isn't a bug it is simply the way it works. There
is alreay a viable way to handle this. That is to use multiple devices as I
already mentioned. Here is a simple example of how to do this with tsql:
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups\' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:176BA8ED-9759-4D19-BD95-25086540C399@.microsoft.com...[vbcol=seagreen]
> Thank you, Andrew, I hope this is something that is going to be addressed
> in
> Yukon.
> Thanks again for your help!
> "Andrew J. Kelly" wrote:
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
Leon
You can't if you are using a single device. It is all or nothing with your
only options being to use INIT or NOINIT. INIT will remove ALL files in the
device and NOINIT will simply append. Don't use a logical device and
instead backup to a different file name each time. Then you can delete what
you want.
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> I'm backing up my transaction log on backup device every 15 minutes. I
> want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
>
|||Thank you, Andrew, I hope this is something that is going to be addressed in
Yukon.
Thanks again for your help!
"Andrew J. Kelly" wrote:
> You can't if you are using a single device. It is all or nothing with your
> only options being to use INIT or NOINIT. INIT will remove ALL files in the
> device and NOINIT will simply append. Don't use a logical device and
> instead backup to a different file name each time. Then you can delete what
> you want.
> --
> Andrew J. Kelly SQL MVP
>
> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
>
>
|||Not that I know of. This isn't a bug it is simply the way it works. There
is alreay a viable way to handle this. That is to use multiple devices as I
already mentioned. Here is a simple example of how to do this with tsql:
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups\' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:176BA8ED-9759-4D19-BD95-25086540C399@.microsoft.com...[vbcol=seagreen]
> Thank you, Andrew, I hope this is something that is going to be addressed
> in
> Yukon.
> Thanks again for your help!
> "Andrew J. Kelly" wrote:
Overwriting backups
I'm backing up my transaction log on backup device every 15 minutes. I want
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
Leon
Hi Leon,
If you are using DB Maintenance plan, in the transaction log backup section,
"Remove file older than" provides the functionality you are looking for.
And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
Check out for BACKUP in BOL.
Thanks
Yogish
"Leon Shargorodsky" wrote:
> I'm backing up my transaction log on backup device every 15 minutes. I want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
|||Thanks for your reply, Yogish, but this is not what I'm asking for.
The key-word here is BACKUP DEVICE, Maintenance Plan does not have option to
backup to a DEVICE.
"Yogish" wrote:
[vbcol=seagreen]
> Hi Leon,
> If you are using DB Maintenance plan, in the transaction log backup section,
> "Remove file older than" provides the functionality you are looking for.
> And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
> Check out for BACKUP in BOL.
> --
> Thanks
> Yogish
> "Leon Shargorodsky" wrote:
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
Leon
Hi Leon,
If you are using DB Maintenance plan, in the transaction log backup section,
"Remove file older than" provides the functionality you are looking for.
And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
Check out for BACKUP in BOL.
Thanks
Yogish
"Leon Shargorodsky" wrote:
> I'm backing up my transaction log on backup device every 15 minutes. I want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
|||Thanks for your reply, Yogish, but this is not what I'm asking for.
The key-word here is BACKUP DEVICE, Maintenance Plan does not have option to
backup to a DEVICE.
"Yogish" wrote:
[vbcol=seagreen]
> Hi Leon,
> If you are using DB Maintenance plan, in the transaction log backup section,
> "Remove file older than" provides the functionality you are looking for.
> And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
> Check out for BACKUP in BOL.
> --
> Thanks
> Yogish
> "Leon Shargorodsky" wrote:
Overwriting backups
I'm backing up my transaction log on backup device every 15 minutes. I want
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonYou can't if you are using a single device. It is all or nothing with your
only options being to use INIT or NOINIT. INIT will remove ALL files in the
device and NOINIT will simply append. Don't use a logical device and
instead backup to a different file name each time. Then you can delete what
you want.
--
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> I'm backing up my transaction log on backup device every 15 minutes. I
> want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
>|||Thank you, Andrew, I hope this is something that is going to be addressed in
Yukon.
Thanks again for your help!
"Andrew J. Kelly" wrote:
> You can't if you are using a single device. It is all or nothing with your
> only options being to use INIT or NOINIT. INIT will remove ALL files in the
> device and NOINIT will simply append. Don't use a logical device and
> instead backup to a different file name each time. Then you can delete what
> you want.
> --
> Andrew J. Kelly SQL MVP
>
> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> > I'm backing up my transaction log on backup device every 15 minutes. I
> > want
> > every backup expire in 1 hour so only 4 sequential transaction log backups
> > reside on my backup device. How do I do that? Thank you in advance
> >
> > Leon
> >
>
>|||Not that I know of. This isn't a bug it is simply the way it works. There
is alreay a viable way to handle this. That is to use multiple devices as I
already mentioned. Here is a simple example of how to do this with tsql:
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
----
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
----
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups\' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:176BA8ED-9759-4D19-BD95-25086540C399@.microsoft.com...
> Thank you, Andrew, I hope this is something that is going to be addressed
> in
> Yukon.
> Thanks again for your help!
> "Andrew J. Kelly" wrote:
>> You can't if you are using a single device. It is all or nothing with
>> your
>> only options being to use INIT or NOINIT. INIT will remove ALL files in
>> the
>> device and NOINIT will simply append. Don't use a logical device and
>> instead backup to a different file name each time. Then you can delete
>> what
>> you want.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote
>> in
>> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
>> > I'm backing up my transaction log on backup device every 15 minutes. I
>> > want
>> > every backup expire in 1 hour so only 4 sequential transaction log
>> > backups
>> > reside on my backup device. How do I do that? Thank you in advance
>> >
>> > Leon
>> >
>>
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonYou can't if you are using a single device. It is all or nothing with your
only options being to use INIT or NOINIT. INIT will remove ALL files in the
device and NOINIT will simply append. Don't use a logical device and
instead backup to a different file name each time. Then you can delete what
you want.
--
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> I'm backing up my transaction log on backup device every 15 minutes. I
> want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
>|||Thank you, Andrew, I hope this is something that is going to be addressed in
Yukon.
Thanks again for your help!
"Andrew J. Kelly" wrote:
> You can't if you are using a single device. It is all or nothing with your
> only options being to use INIT or NOINIT. INIT will remove ALL files in the
> device and NOINIT will simply append. Don't use a logical device and
> instead backup to a different file name each time. Then you can delete what
> you want.
> --
> Andrew J. Kelly SQL MVP
>
> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> > I'm backing up my transaction log on backup device every 15 minutes. I
> > want
> > every backup expire in 1 hour so only 4 sequential transaction log backups
> > reside on my backup device. How do I do that? Thank you in advance
> >
> > Leon
> >
>
>|||Not that I know of. This isn't a bug it is simply the way it works. There
is alreay a viable way to handle this. That is to use multiple devices as I
already mentioned. Here is a simple example of how to do this with tsql:
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
----
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
----
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups\' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:176BA8ED-9759-4D19-BD95-25086540C399@.microsoft.com...
> Thank you, Andrew, I hope this is something that is going to be addressed
> in
> Yukon.
> Thanks again for your help!
> "Andrew J. Kelly" wrote:
>> You can't if you are using a single device. It is all or nothing with
>> your
>> only options being to use INIT or NOINIT. INIT will remove ALL files in
>> the
>> device and NOINIT will simply append. Don't use a logical device and
>> instead backup to a different file name each time. Then you can delete
>> what
>> you want.
>> --
>> Andrew J. Kelly SQL MVP
>>
>> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote
>> in
>> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
>> > I'm backing up my transaction log on backup device every 15 minutes. I
>> > want
>> > every backup expire in 1 hour so only 4 sequential transaction log
>> > backups
>> > reside on my backup device. How do I do that? Thank you in advance
>> >
>> > Leon
>> >
>>
Labels:
backing,
backup,
backups,
database,
device,
expire,
log,
microsoft,
mysql,
oracle,
overwriting,
sequential,
server,
sql,
transaction
Overwriting backups
I'm backing up my transaction log on backup device every 15 minutes. I want
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonHi Leon,
If you are using DB Maintenance plan, in the transaction log backup section,
"Remove file older than" provides the functionality you are looking for.
And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
Check out for BACKUP in BOL.
--
Thanks
Yogish
"Leon Shargorodsky" wrote:
> I'm backing up my transaction log on backup device every 15 minutes. I want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon|||Thanks for your reply, Yogish, but this is not what I'm asking for.
The key-word here is BACKUP DEVICE, Maintenance Plan does not have option to
backup to a DEVICE.
"Yogish" wrote:
> Hi Leon,
> If you are using DB Maintenance plan, in the transaction log backup section,
> "Remove file older than" provides the functionality you are looking for.
> And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
> Check out for BACKUP in BOL.
> --
> Thanks
> Yogish
> "Leon Shargorodsky" wrote:
> > I'm backing up my transaction log on backup device every 15 minutes. I want
> > every backup expire in 1 hour so only 4 sequential transaction log backups
> > reside on my backup device. How do I do that? Thank you in advance
> >
> > Leon
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonHi Leon,
If you are using DB Maintenance plan, in the transaction log backup section,
"Remove file older than" provides the functionality you are looking for.
And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
Check out for BACKUP in BOL.
--
Thanks
Yogish
"Leon Shargorodsky" wrote:
> I'm backing up my transaction log on backup device every 15 minutes. I want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon|||Thanks for your reply, Yogish, but this is not what I'm asking for.
The key-word here is BACKUP DEVICE, Maintenance Plan does not have option to
backup to a DEVICE.
"Yogish" wrote:
> Hi Leon,
> If you are using DB Maintenance plan, in the transaction log backup section,
> "Remove file older than" provides the functionality you are looking for.
> And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
> Check out for BACKUP in BOL.
> --
> Thanks
> Yogish
> "Leon Shargorodsky" wrote:
> > I'm backing up my transaction log on backup device every 15 minutes. I want
> > every backup expire in 1 hour so only 4 sequential transaction log backups
> > reside on my backup device. How do I do that? Thank you in advance
> >
> > Leon
Labels:
backing,
backup,
backups,
database,
device,
expire,
log,
microsoft,
mysql,
oracle,
overwriting,
sequential,
server,
sql,
transaction
Overwriting backups
I'm backing up my transaction log on backup device every 15 minutes. I want
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonYou can't if you are using a single device. It is all or nothing with your
only options being to use INIT or NOINIT. INIT will remove ALL files in the
device and NOINIT will simply append. Don't use a logical device and
instead backup to a different file name each time. Then you can delete what
you want.
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> I'm backing up my transaction log on backup device every 15 minutes. I
> want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
>|||Thank you, Andrew, I hope this is something that is going to be addressed in
Yukon.
Thanks again for your help!
"Andrew J. Kelly" wrote:
> You can't if you are using a single device. It is all or nothing with you
r
> only options being to use INIT or NOINIT. INIT will remove ALL files in t
he
> device and NOINIT will simply append. Don't use a logical device and
> instead backup to a different file name each time. Then you can delete wh
at
> you want.
> --
> Andrew J. Kelly SQL MVP
>
> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
>
>|||Not that I know of. This isn't a bug it is simply the way it works. There
is alreay a viable way to handle this. That is to use multiple devices as I
already mentioned. Here is a simple example of how to do this with tsql:
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
----
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
----
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:176BA8ED-9759-4D19-BD95-25086540C399@.microsoft.com...[vbcol=seagreen]
> Thank you, Andrew, I hope this is something that is going to be addressed
> in
> Yukon.
> Thanks again for your help!
> "Andrew J. Kelly" wrote:
>
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonYou can't if you are using a single device. It is all or nothing with your
only options being to use INIT or NOINIT. INIT will remove ALL files in the
device and NOINIT will simply append. Don't use a logical device and
instead backup to a different file name each time. Then you can delete what
you want.
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
> I'm backing up my transaction log on backup device every 15 minutes. I
> want
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon
>|||Thank you, Andrew, I hope this is something that is going to be addressed in
Yukon.
Thanks again for your help!
"Andrew J. Kelly" wrote:
> You can't if you are using a single device. It is all or nothing with you
r
> only options being to use INIT or NOINIT. INIT will remove ALL files in t
he
> device and NOINIT will simply append. Don't use a logical device and
> instead backup to a different file name each time. Then you can delete wh
at
> you want.
> --
> Andrew J. Kelly SQL MVP
>
> "Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
> message news:FA6D9E38-FD99-456D-93B0-7C3ED322E3E1@.microsoft.com...
>
>|||Not that I know of. This isn't a bug it is simply the way it works. There
is alreay a viable way to handle this. That is to use multiple devices as I
already mentioned. Here is a simple example of how to do this with tsql:
-- Do a backup and create a separate file for each day of the
eek --
DECLARE @.DBName NVARCHAR(50), @.Device NVARCHAR(100), @.Name NVARCHAR(100)
IF OBJECT_ID('tempdb..#DBs') IS NOT NULL
DROP TABLE #DBs
CREATE TABLE #DBs ([name] VARCHAR(50),[db_size] VARCHAR(20),
[Owner] VARCHAR(20),[DBID] INT, [Created] VARCHAR(14),
[Status] VARCHAR(1000), [Compatibility_Level] INT)
INSERT INTO #DBs EXEC sp_helpdb
DECLARE cur_DBs CURSOR STATIC LOCAL
FOR SELECT [Name]
FROM #DBs
WHERE [DBID] IN (5,6)
OPEN cur_DBs
FETCH NEXT FROM cur_DBs INTO @.DBName
WHILE @.@.FETCH_STATUS = 0
BEGIN
SET @.Device = N'C:\Backups\DD_' + @.DBName + '_Full_' +
CAST(DAY(GETDATE()) AS NVARCHAR(4)) +
CAST(MONTH(GETDATE()) AS NVARCHAR(4)) +
CAST(YEAR(GETDATE()) AS NVARCHAR(8)) + N'.BAK'
SET @.Name = @.DBName + N' Full Backup'
BACKUP DATABASE @.DBName TO DISK = @.Device WITH INIT , NOUNLOAD ,
NAME = @.Name, NOSKIP , STATS = 10, NOFORMAT
RESTORE VERIFYONLY FROM DISK = @.Device WITH FILE = 1
FETCH NEXT FROM cur_DBs INTO @.DBName
END
CLOSE cur_DBs
DEALLOCATE cur_DBs
----
-- Removing Older Backup Files --
DECLARE @.Error INT, @.D DATETIME
SET @.D = CAST('20020801 15:00:00' AS DATETIME)
EXEC @.Error = remove_old_log_files @.D
SELECT @.Error
----
-- *** Procedure to remove old backups **** --
CREATE PROCEDURE remove_old_log_files
@.DelDate DATETIME
AS
SET NOCOUNT ON
DECLARE @.SQL VARCHAR(500), @.FName VARCHAR(40), @.Error INT
DECLARE @.Delete VARCHAR(300), @.Msg VARCHAR(100), @.Return INT
SET DATEFORMAT MDY
IF OBJECT_ID('tempdb..#dirlist') IS NOT NULL
DROP TABLE #DirList
CREATE TABLE #dirlist (FName VARCHAR(1000))
CREATE TABLE #Errors (Results VARCHAR(1000))
-- Insert the results of the dir cmd into a table so we can scan it
INSERT INTO #dirlist (FName)
exec master..xp_cmdshell 'dir /OD C:\Backups\*.trn'
SET @.Error = @.@.ERROR
IF @.Error <> 0
BEGIN
SET @.Msg = 'Error while getting the filenames with DIR '
GOTO On_Error
END
--SELECT * FROM #dirList
-- Remove the garbage
DELETE #dirlist WHERE
SUBSTRING(FName,1,2) < '00' OR
SUBSTRING(FName,1,2) > '99' OR
FName IS NULL
-- Create a cursor and for each file name do the processing.
-- The files will be processed in date order.
DECLARE curDir CURSOR READ_ONLY LOCAL
FOR
SELECT SUBSTRING(FName,40,40) AS FName
FROM #dirlist
WHERE CAST(SUBSTRING(FName,1,20) AS DATETIME) < @.DelDate
AND SUBSTRING(FName,40,40) LIKE '%.TRN'
OPEN curDir
FETCH NEXT FROM curDir INTO @.Fname
WHILE (@.@.fetch_status = 0)
BEGIN
-- Delete the old backup files
SET @.Delete = 'DEL "C:\Backups' + @.FName + '"'
INSERT INTO #Errors (Results)
exec master..xp_cmdshell @.Delete
IF @.@.RowCount > 1
BEGIN
SET @.Error = -1
SET @.Msg = 'Error while Deleting file ' + @.FName
GOTO On_Error
END
-- PRINT @.Delete
PRINT 'Deleted ' + @.FName + ' at ' +
CONVERT(VARCHAR(28),GETDATE(),113)
FETCH NEXT FROM curDir INTO @.Fname
END
CLOSE curDir
DEALLOCATE curDir
DROP TABLE #DirList
DROP TABLE #Errors
RETURN @.Error
On_Error:
BEGIN
IF @.Error <> 0
BEGIN
SELECT @.Msg + '. Error # ' + CAST(@.Error AS VARCHAR(10))
RAISERROR(@.Msg,12,1)
RETURN @.Error
END
END
GO
Andrew J. Kelly SQL MVP
"Leon Shargorodsky" <Leon Shargorodsky@.discussions.microsoft.com> wrote in
message news:176BA8ED-9759-4D19-BD95-25086540C399@.microsoft.com...[vbcol=seagreen]
> Thank you, Andrew, I hope this is something that is going to be addressed
> in
> Yukon.
> Thanks again for your help!
> "Andrew J. Kelly" wrote:
>
Overwriting backups
I'm backing up my transaction log on backup device every 15 minutes. I want
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonHi Leon,
If you are using DB Maintenance plan, in the transaction log backup section,
"Remove file older than" provides the functionality you are looking for.
And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
Check out for BACKUP in BOL.
Thanks
Yogish
"Leon Shargorodsky" wrote:
> I'm backing up my transaction log on backup device every 15 minutes. I wan
t
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon|||Thanks for your reply, Yogish, but this is not what I'm asking for.
The key-word here is BACKUP DEVICE, Maintenance Plan does not have option to
backup to a DEVICE.
"Yogish" wrote:
[vbcol=seagreen]
> Hi Leon,
> If you are using DB Maintenance plan, in the transaction log backup sectio
n,
> "Remove file older than" provides the functionality you are looking for.
> And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
> Check out for BACKUP in BOL.
> --
> Thanks
> Yogish
> "Leon Shargorodsky" wrote:
>
every backup expire in 1 hour so only 4 sequential transaction log backups
reside on my backup device. How do I do that? Thank you in advance
LeonHi Leon,
If you are using DB Maintenance plan, in the transaction log backup section,
"Remove file older than" provides the functionality you are looking for.
And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
Check out for BACKUP in BOL.
Thanks
Yogish
"Leon Shargorodsky" wrote:
> I'm backing up my transaction log on backup device every 15 minutes. I wan
t
> every backup expire in 1 hour so only 4 sequential transaction log backups
> reside on my backup device. How do I do that? Thank you in advance
> Leon|||Thanks for your reply, Yogish, but this is not what I'm asking for.
The key-word here is BACKUP DEVICE, Maintenance Plan does not have option to
backup to a DEVICE.
"Yogish" wrote:
[vbcol=seagreen]
> Hi Leon,
> If you are using DB Maintenance plan, in the transaction log backup sectio
n,
> "Remove file older than" provides the functionality you are looking for.
> And if you are using, T-SQL you can specify "RETAINDAYS" parameter.
> Check out for BACKUP in BOL.
> --
> Thanks
> Yogish
> "Leon Shargorodsky" wrote:
>
Overwriting Backup Set
Hi,
I did a full backup of my database, but everyday when it is backing up I
would like it to overwrite the previous day's backup.
I'm doing it thru Transact-SQL script(T-SQL) so i am entering the following
command:
"EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
WSS_Content to backup_file6 with init"
Is this right? Or do I need to include something else?From BOL:
INIT Specifies that all backup sets should be overwritten, but preserves
the media header. If INIT is specified, any existing backup set on that
device is overwritten, if conditions permit. By default, BACKUP checks for
the following conditions and does not overwrite the backup media if either
condition exists:
a.. Any backup set has not yet expired. For more information, see the
EXPIREDATE and RETAINDAYS options.
b.. The backup set name given in the BACKUP statement, if provided, does
not match the name on the backup media. For more information, see the NAME
option, earlier in this section.
To override these checks, use the SKIP option.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> Hi,
> I did a full backup of my database, but everyday when it is backing up I
> would like it to overwrite the previous day's backup.
> I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> following
> command:
> "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> WSS_Content to backup_file6 with init"
> Is this right? Or do I need to include something else?|||Hi, thanks for the response........
Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
Also, I use the SKIP option with "with skip, init"?
"TheSQLGuru" wrote:
> From BOL:
> INIT Specifies that all backup sets should be overwritten, but preserves
> the media header. If INIT is specified, any existing backup set on that
> device is overwritten, if conditions permit. By default, BACKUP checks for
> the following conditions and does not overwrite the backup media if either
> condition exists:
> a.. Any backup set has not yet expired. For more information, see the
> EXPIREDATE and RETAINDAYS options.
>
> b.. The backup set name given in the BACKUP statement, if provided, does
> not match the name on the backup media. For more information, see the NAME
> option, earlier in this section.
> To override these checks, use the SKIP option.
>
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>
>|||See Backup Database in Books Online. Everything is explained nicely there.
To answer your question here yes, WITH options are simply comma separated.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for the response........
> Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> Also, I use the SKIP option with "with skip, init"?
> "TheSQLGuru" wrote:
>|||Hi,
I'm trying to do an automated backup where it overwrites the previous
backup. I'm running the command:
"EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
WSS_Content to backup_file9
with skip, init"
But when I go to View Job History, I'm getting the error:
"The add device request was denied. A physical device named 'C:\Friday'
already exists. Only one backup device may refer to any physical device
name.[SQLSTATE 42000](Error 15061). The step failed."
Why exactly is that? What needs to be done?
Please help.......
"TheSQLGuru" wrote:
> See Backup Database in Books Online. Everything is explained nicely there
.
> To answer your question here yes, WITH options are simply comma separated.
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>
>|||sp_addumpdevice creates a backupdevice, which you later use in your backup c
ommand. So, you only
need to do this once.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...[vbcol=seagreen]
> Hi,
> I'm trying to do an automated backup where it overwrites the previous
> backup. I'm running the command:
> "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
> WSS_Content to backup_file9
> with skip, init"
> But when I go to View Job History, I'm getting the error:
> "The add device request was denied. A physical device named 'C:\Friday'
> already exists. Only one backup device may refer to any physical device
> name.[SQLSTATE 42000](Error 15061). The step failed."
> Why exactly is that? What needs to be done?
> Please help.......
>
> "TheSQLGuru" wrote:
>|||Hi, thanks for your response......
What command exactly do I need to use -
"EXEC backup database WSS_Content to backup_file9
with skip, init" ?
"Tibor Karaszi" wrote:
> sp_addumpdevice creates a backupdevice, which you later use in your backup
command. So, you only
> need to do this once.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
>
>|||If your dumbdevice is "backup_file9" then:
BACKUP DATABASE mydb TO backup_file9 WITH INIT
This command will backup "mydb" database to "bacup_file9" dumbdevice and
it'll overwrite the old one(s).
Ekrem ?nsoy
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for your response......
> What command exactly do I need to use -
> "EXEC backup database WSS_Content to backup_file9
> with skip, init" ?
> "Tibor Karaszi" wrote:
>|||Thank you so much......It worked!
"Ekrem ?nsoy" wrote:
> If your dumbdevice is "backup_file9" then:
> BACKUP DATABASE mydb TO backup_file9 WITH INIT
> This command will backup "mydb" database to "bacup_file9" dumbdevice and
> it'll overwrite the old one(s).
> --
> Ekrem ?nsoy
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
>
I did a full backup of my database, but everyday when it is backing up I
would like it to overwrite the previous day's backup.
I'm doing it thru Transact-SQL script(T-SQL) so i am entering the following
command:
"EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
WSS_Content to backup_file6 with init"
Is this right? Or do I need to include something else?From BOL:
INIT Specifies that all backup sets should be overwritten, but preserves
the media header. If INIT is specified, any existing backup set on that
device is overwritten, if conditions permit. By default, BACKUP checks for
the following conditions and does not overwrite the backup media if either
condition exists:
a.. Any backup set has not yet expired. For more information, see the
EXPIREDATE and RETAINDAYS options.
b.. The backup set name given in the BACKUP statement, if provided, does
not match the name on the backup media. For more information, see the NAME
option, earlier in this section.
To override these checks, use the SKIP option.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> Hi,
> I did a full backup of my database, but everyday when it is backing up I
> would like it to overwrite the previous day's backup.
> I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> following
> command:
> "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> WSS_Content to backup_file6 with init"
> Is this right? Or do I need to include something else?|||Hi, thanks for the response........
Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
Also, I use the SKIP option with "with skip, init"?
"TheSQLGuru" wrote:
> From BOL:
> INIT Specifies that all backup sets should be overwritten, but preserves
> the media header. If INIT is specified, any existing backup set on that
> device is overwritten, if conditions permit. By default, BACKUP checks for
> the following conditions and does not overwrite the backup media if either
> condition exists:
> a.. Any backup set has not yet expired. For more information, see the
> EXPIREDATE and RETAINDAYS options.
>
> b.. The backup set name given in the BACKUP statement, if provided, does
> not match the name on the backup media. For more information, see the NAME
> option, earlier in this section.
> To override these checks, use the SKIP option.
>
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>
>|||See Backup Database in Books Online. Everything is explained nicely there.
To answer your question here yes, WITH options are simply comma separated.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for the response........
> Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> Also, I use the SKIP option with "with skip, init"?
> "TheSQLGuru" wrote:
>|||Hi,
I'm trying to do an automated backup where it overwrites the previous
backup. I'm running the command:
"EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
WSS_Content to backup_file9
with skip, init"
But when I go to View Job History, I'm getting the error:
"The add device request was denied. A physical device named 'C:\Friday'
already exists. Only one backup device may refer to any physical device
name.[SQLSTATE 42000](Error 15061). The step failed."
Why exactly is that? What needs to be done?
Please help.......
"TheSQLGuru" wrote:
> See Backup Database in Books Online. Everything is explained nicely there
.
> To answer your question here yes, WITH options are simply comma separated.
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>
>|||sp_addumpdevice creates a backupdevice, which you later use in your backup c
ommand. So, you only
need to do this once.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...[vbcol=seagreen]
> Hi,
> I'm trying to do an automated backup where it overwrites the previous
> backup. I'm running the command:
> "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
> WSS_Content to backup_file9
> with skip, init"
> But when I go to View Job History, I'm getting the error:
> "The add device request was denied. A physical device named 'C:\Friday'
> already exists. Only one backup device may refer to any physical device
> name.[SQLSTATE 42000](Error 15061). The step failed."
> Why exactly is that? What needs to be done?
> Please help.......
>
> "TheSQLGuru" wrote:
>|||Hi, thanks for your response......
What command exactly do I need to use -
"EXEC backup database WSS_Content to backup_file9
with skip, init" ?
"Tibor Karaszi" wrote:
> sp_addumpdevice creates a backupdevice, which you later use in your backup
command. So, you only
> need to do this once.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
>
>|||If your dumbdevice is "backup_file9" then:
BACKUP DATABASE mydb TO backup_file9 WITH INIT
This command will backup "mydb" database to "bacup_file9" dumbdevice and
it'll overwrite the old one(s).
Ekrem ?nsoy
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for your response......
> What command exactly do I need to use -
> "EXEC backup database WSS_Content to backup_file9
> with skip, init" ?
> "Tibor Karaszi" wrote:
>|||Thank you so much......It worked!
"Ekrem ?nsoy" wrote:
> If your dumbdevice is "backup_file9" then:
> BACKUP DATABASE mydb TO backup_file9 WITH INIT
> This command will backup "mydb" database to "bacup_file9" dumbdevice and
> it'll overwrite the old one(s).
> --
> Ekrem ?nsoy
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
>
Overwriting Backup Set
Hi,
I did a full backup of my database, but everyday when it is backing up I
would like it to overwrite the previous day's backup.
I'm doing it thru Transact-SQL script(T-SQL) so i am entering the following
command:
"EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
WSS_Content to backup_file6 with init"
Is this right? Or do I need to include something else?From BOL:
INIT Specifies that all backup sets should be overwritten, but preserves
the media header. If INIT is specified, any existing backup set on that
device is overwritten, if conditions permit. By default, BACKUP checks for
the following conditions and does not overwrite the backup media if either
condition exists:
a.. Any backup set has not yet expired. For more information, see the
EXPIREDATE and RETAINDAYS options.
b.. The backup set name given in the BACKUP statement, if provided, does
not match the name on the backup media. For more information, see the NAME
option, earlier in this section.
To override these checks, use the SKIP option.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> Hi,
> I did a full backup of my database, but everyday when it is backing up I
> would like it to overwrite the previous day's backup.
> I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> following
> command:
> "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> WSS_Content to backup_file6 with init"
> Is this right? Or do I need to include something else?|||Hi, thanks for the response........
Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
Also, I use the SKIP option with "with skip, init"?
"TheSQLGuru" wrote:
> From BOL:
> INIT Specifies that all backup sets should be overwritten, but preserves
> the media header. If INIT is specified, any existing backup set on that
> device is overwritten, if conditions permit. By default, BACKUP checks for
> the following conditions and does not overwrite the backup media if either
> condition exists:
> a.. Any backup set has not yet expired. For more information, see the
> EXPIREDATE and RETAINDAYS options.
>
> b.. The backup set name given in the BACKUP statement, if provided, does
> not match the name on the backup media. For more information, see the NAME
> option, earlier in this section.
> To override these checks, use the SKIP option.
>
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> > Hi,
> > I did a full backup of my database, but everyday when it is backing up I
> > would like it to overwrite the previous day's backup.
> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> > following
> > command:
> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> > WSS_Content to backup_file6 with init"
> >
> > Is this right? Or do I need to include something else?
>
>|||See Backup Database in Books Online. Everything is explained nicely there.
To answer your question here yes, WITH options are simply comma separated.
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> Hi, thanks for the response........
> Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> Also, I use the SKIP option with "with skip, init"?
> "TheSQLGuru" wrote:
>> From BOL:
>> INIT Specifies that all backup sets should be overwritten, but preserves
>> the media header. If INIT is specified, any existing backup set on that
>> device is overwritten, if conditions permit. By default, BACKUP checks
>> for
>> the following conditions and does not overwrite the backup media if
>> either
>> condition exists:
>> a.. Any backup set has not yet expired. For more information, see the
>> EXPIREDATE and RETAINDAYS options.
>>
>> b.. The backup set name given in the BACKUP statement, if provided,
>> does
>> not match the name on the backup media. For more information, see the
>> NAME
>> option, earlier in this section.
>> To override these checks, use the SKIP option.
>>
>> --
>> Kevin G. Boles
>> TheSQLGuru
>> Indicium Resources, Inc.
>>
>> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>> > Hi,
>> > I did a full backup of my database, but everyday when it is backing up
>> > I
>> > would like it to overwrite the previous day's backup.
>> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
>> > following
>> > command:
>> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
>> > WSS_Content to backup_file6 with init"
>> >
>> > Is this right? Or do I need to include something else?
>>|||Hi,
I'm trying to do an automated backup where it overwrites the previous
backup. I'm running the command:
"EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
WSS_Content to backup_file9
with skip, init"
But when I go to View Job History, I'm getting the error:
"The add device request was denied. A physical device named 'C:\Friday'
already exists. Only one backup device may refer to any physical device
name.[SQLSTATE 42000](Error 15061). The step failed."
Why exactly is that? What needs to be done?
Please help.......
"TheSQLGuru" wrote:
> See Backup Database in Books Online. Everything is explained nicely there.
> To answer your question here yes, WITH options are simply comma separated.
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> > Hi, thanks for the response........
> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> > Also, I use the SKIP option with "with skip, init"?
> >
> > "TheSQLGuru" wrote:
> >
> >> From BOL:
> >>
> >> INIT Specifies that all backup sets should be overwritten, but preserves
> >> the media header. If INIT is specified, any existing backup set on that
> >> device is overwritten, if conditions permit. By default, BACKUP checks
> >> for
> >> the following conditions and does not overwrite the backup media if
> >> either
> >> condition exists:
> >> a.. Any backup set has not yet expired. For more information, see the
> >> EXPIREDATE and RETAINDAYS options.
> >>
> >>
> >> b.. The backup set name given in the BACKUP statement, if provided,
> >> does
> >> not match the name on the backup media. For more information, see the
> >> NAME
> >> option, earlier in this section.
> >>
> >> To override these checks, use the SKIP option.
> >>
> >>
> >> --
> >> Kevin G. Boles
> >> TheSQLGuru
> >> Indicium Resources, Inc.
> >>
> >>
> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> >> > Hi,
> >> > I did a full backup of my database, but everyday when it is backing up
> >> > I
> >> > would like it to overwrite the previous day's backup.
> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> >> > following
> >> > command:
> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> >> > WSS_Content to backup_file6 with init"
> >> >
> >> > Is this right? Or do I need to include something else?
> >>
> >>
> >>
>
>|||sp_addumpdevice creates a backupdevice, which you later use in your backup command. So, you only
need to do this once.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
> Hi,
> I'm trying to do an automated backup where it overwrites the previous
> backup. I'm running the command:
> "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
> WSS_Content to backup_file9
> with skip, init"
> But when I go to View Job History, I'm getting the error:
> "The add device request was denied. A physical device named 'C:\Friday'
> already exists. Only one backup device may refer to any physical device
> name.[SQLSTATE 42000](Error 15061). The step failed."
> Why exactly is that? What needs to be done?
> Please help.......
>
> "TheSQLGuru" wrote:
>> See Backup Database in Books Online. Everything is explained nicely there.
>> To answer your question here yes, WITH options are simply comma separated.
>> --
>> Kevin G. Boles
>> TheSQLGuru
>> Indicium Resources, Inc.
>>
>> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>> > Hi, thanks for the response........
>> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
>> > Also, I use the SKIP option with "with skip, init"?
>> >
>> > "TheSQLGuru" wrote:
>> >
>> >> From BOL:
>> >>
>> >> INIT Specifies that all backup sets should be overwritten, but preserves
>> >> the media header. If INIT is specified, any existing backup set on that
>> >> device is overwritten, if conditions permit. By default, BACKUP checks
>> >> for
>> >> the following conditions and does not overwrite the backup media if
>> >> either
>> >> condition exists:
>> >> a.. Any backup set has not yet expired. For more information, see the
>> >> EXPIREDATE and RETAINDAYS options.
>> >>
>> >>
>> >> b.. The backup set name given in the BACKUP statement, if provided,
>> >> does
>> >> not match the name on the backup media. For more information, see the
>> >> NAME
>> >> option, earlier in this section.
>> >>
>> >> To override these checks, use the SKIP option.
>> >>
>> >>
>> >> --
>> >> Kevin G. Boles
>> >> TheSQLGuru
>> >> Indicium Resources, Inc.
>> >>
>> >>
>> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>> >> > Hi,
>> >> > I did a full backup of my database, but everyday when it is backing up
>> >> > I
>> >> > would like it to overwrite the previous day's backup.
>> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
>> >> > following
>> >> > command:
>> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
>> >> > WSS_Content to backup_file6 with init"
>> >> >
>> >> > Is this right? Or do I need to include something else?
>> >>
>> >>
>> >>
>>|||Hi, thanks for your response......
What command exactly do I need to use -
"EXEC backup database WSS_Content to backup_file9
with skip, init" ?
"Tibor Karaszi" wrote:
> sp_addumpdevice creates a backupdevice, which you later use in your backup command. So, you only
> need to do this once.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
> > Hi,
> > I'm trying to do an automated backup where it overwrites the previous
> > backup. I'm running the command:
> > "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
> > WSS_Content to backup_file9
> > with skip, init"
> >
> > But when I go to View Job History, I'm getting the error:
> > "The add device request was denied. A physical device named 'C:\Friday'
> > already exists. Only one backup device may refer to any physical device
> > name.[SQLSTATE 42000](Error 15061). The step failed."
> >
> > Why exactly is that? What needs to be done?
> >
> > Please help.......
> >
> >
> > "TheSQLGuru" wrote:
> >
> >> See Backup Database in Books Online. Everything is explained nicely there.
> >> To answer your question here yes, WITH options are simply comma separated.
> >>
> >> --
> >> Kevin G. Boles
> >> TheSQLGuru
> >> Indicium Resources, Inc.
> >>
> >>
> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> >> > Hi, thanks for the response........
> >> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> >> > Also, I use the SKIP option with "with skip, init"?
> >> >
> >> > "TheSQLGuru" wrote:
> >> >
> >> >> From BOL:
> >> >>
> >> >> INIT Specifies that all backup sets should be overwritten, but preserves
> >> >> the media header. If INIT is specified, any existing backup set on that
> >> >> device is overwritten, if conditions permit. By default, BACKUP checks
> >> >> for
> >> >> the following conditions and does not overwrite the backup media if
> >> >> either
> >> >> condition exists:
> >> >> a.. Any backup set has not yet expired. For more information, see the
> >> >> EXPIREDATE and RETAINDAYS options.
> >> >>
> >> >>
> >> >> b.. The backup set name given in the BACKUP statement, if provided,
> >> >> does
> >> >> not match the name on the backup media. For more information, see the
> >> >> NAME
> >> >> option, earlier in this section.
> >> >>
> >> >> To override these checks, use the SKIP option.
> >> >>
> >> >>
> >> >> --
> >> >> Kevin G. Boles
> >> >> TheSQLGuru
> >> >> Indicium Resources, Inc.
> >> >>
> >> >>
> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> >> >> > Hi,
> >> >> > I did a full backup of my database, but everyday when it is backing up
> >> >> > I
> >> >> > would like it to overwrite the previous day's backup.
> >> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> >> >> > following
> >> >> > command:
> >> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> >> >> > WSS_Content to backup_file6 with init"
> >> >> >
> >> >> > Is this right? Or do I need to include something else?
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>|||If your dumbdevice is "backup_file9" then:
BACKUP DATABASE mydb TO backup_file9 WITH INIT
This command will backup "mydb" database to "bacup_file9" dumbdevice and
it'll overwrite the old one(s).
--
Ekrem Ã?nsoy
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
> Hi, thanks for your response......
> What command exactly do I need to use -
> "EXEC backup database WSS_Content to backup_file9
> with skip, init" ?
> "Tibor Karaszi" wrote:
>> sp_addumpdevice creates a backupdevice, which you later use in your
>> backup command. So, you only
>> need to do this once.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
>> > Hi,
>> > I'm trying to do an automated backup where it overwrites the previous
>> > backup. I'm running the command:
>> > "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup
>> > database
>> > WSS_Content to backup_file9
>> > with skip, init"
>> >
>> > But when I go to View Job History, I'm getting the error:
>> > "The add device request was denied. A physical device named
>> > 'C:\Friday'
>> > already exists. Only one backup device may refer to any physical
>> > device
>> > name.[SQLSTATE 42000](Error 15061). The step failed."
>> >
>> > Why exactly is that? What needs to be done?
>> >
>> > Please help.......
>> >
>> >
>> > "TheSQLGuru" wrote:
>> >
>> >> See Backup Database in Books Online. Everything is explained nicely
>> >> there.
>> >> To answer your question here yes, WITH options are simply comma
>> >> separated.
>> >>
>> >> --
>> >> Kevin G. Boles
>> >> TheSQLGuru
>> >> Indicium Resources, Inc.
>> >>
>> >>
>> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> >> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>> >> > Hi, thanks for the response........
>> >> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
>> >> > Also, I use the SKIP option with "with skip, init"?
>> >> >
>> >> > "TheSQLGuru" wrote:
>> >> >
>> >> >> From BOL:
>> >> >>
>> >> >> INIT Specifies that all backup sets should be overwritten, but
>> >> >> preserves
>> >> >> the media header. If INIT is specified, any existing backup set on
>> >> >> that
>> >> >> device is overwritten, if conditions permit. By default, BACKUP
>> >> >> checks
>> >> >> for
>> >> >> the following conditions and does not overwrite the backup media if
>> >> >> either
>> >> >> condition exists:
>> >> >> a.. Any backup set has not yet expired. For more information, see
>> >> >> the
>> >> >> EXPIREDATE and RETAINDAYS options.
>> >> >>
>> >> >>
>> >> >> b.. The backup set name given in the BACKUP statement, if
>> >> >> provided,
>> >> >> does
>> >> >> not match the name on the backup media. For more information, see
>> >> >> the
>> >> >> NAME
>> >> >> option, earlier in this section.
>> >> >>
>> >> >> To override these checks, use the SKIP option.
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Kevin G. Boles
>> >> >> TheSQLGuru
>> >> >> Indicium Resources, Inc.
>> >> >>
>> >> >>
>> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> >> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>> >> >> > Hi,
>> >> >> > I did a full backup of my database, but everyday when it is
>> >> >> > backing up
>> >> >> > I
>> >> >> > would like it to overwrite the previous day's backup.
>> >> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
>> >> >> > following
>> >> >> > command:
>> >> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup
>> >> >> > database
>> >> >> > WSS_Content to backup_file6 with init"
>> >> >> >
>> >> >> > Is this right? Or do I need to include something else?
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>|||Thank you so much......It worked!
"Ekrem Ã?nsoy" wrote:
> If your dumbdevice is "backup_file9" then:
> BACKUP DATABASE mydb TO backup_file9 WITH INIT
> This command will backup "mydb" database to "bacup_file9" dumbdevice and
> it'll overwrite the old one(s).
> --
> Ekrem Ã?nsoy
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
> > Hi, thanks for your response......
> > What command exactly do I need to use -
> > "EXEC backup database WSS_Content to backup_file9
> > with skip, init" ?
> >
> > "Tibor Karaszi" wrote:
> >
> >> sp_addumpdevice creates a backupdevice, which you later use in your
> >> backup command. So, you only
> >> need to do this once.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://sqlblog.com/blogs/tibor_karaszi
> >>
> >>
> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
> >> > Hi,
> >> > I'm trying to do an automated backup where it overwrites the previous
> >> > backup. I'm running the command:
> >> > "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup
> >> > database
> >> > WSS_Content to backup_file9
> >> > with skip, init"
> >> >
> >> > But when I go to View Job History, I'm getting the error:
> >> > "The add device request was denied. A physical device named
> >> > 'C:\Friday'
> >> > already exists. Only one backup device may refer to any physical
> >> > device
> >> > name.[SQLSTATE 42000](Error 15061). The step failed."
> >> >
> >> > Why exactly is that? What needs to be done?
> >> >
> >> > Please help.......
> >> >
> >> >
> >> > "TheSQLGuru" wrote:
> >> >
> >> >> See Backup Database in Books Online. Everything is explained nicely
> >> >> there.
> >> >> To answer your question here yes, WITH options are simply comma
> >> >> separated.
> >> >>
> >> >> --
> >> >> Kevin G. Boles
> >> >> TheSQLGuru
> >> >> Indicium Resources, Inc.
> >> >>
> >> >>
> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> >> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> >> >> > Hi, thanks for the response........
> >> >> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> >> >> > Also, I use the SKIP option with "with skip, init"?
> >> >> >
> >> >> > "TheSQLGuru" wrote:
> >> >> >
> >> >> >> From BOL:
> >> >> >>
> >> >> >> INIT Specifies that all backup sets should be overwritten, but
> >> >> >> preserves
> >> >> >> the media header. If INIT is specified, any existing backup set on
> >> >> >> that
> >> >> >> device is overwritten, if conditions permit. By default, BACKUP
> >> >> >> checks
> >> >> >> for
> >> >> >> the following conditions and does not overwrite the backup media if
> >> >> >> either
> >> >> >> condition exists:
> >> >> >> a.. Any backup set has not yet expired. For more information, see
> >> >> >> the
> >> >> >> EXPIREDATE and RETAINDAYS options.
> >> >> >>
> >> >> >>
> >> >> >> b.. The backup set name given in the BACKUP statement, if
> >> >> >> provided,
> >> >> >> does
> >> >> >> not match the name on the backup media. For more information, see
> >> >> >> the
> >> >> >> NAME
> >> >> >> option, earlier in this section.
> >> >> >>
> >> >> >> To override these checks, use the SKIP option.
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> Kevin G. Boles
> >> >> >> TheSQLGuru
> >> >> >> Indicium Resources, Inc.
> >> >> >>
> >> >> >>
> >> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> >> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> >> >> >> > Hi,
> >> >> >> > I did a full backup of my database, but everyday when it is
> >> >> >> > backing up
> >> >> >> > I
> >> >> >> > would like it to overwrite the previous day's backup.
> >> >> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> >> >> >> > following
> >> >> >> > command:
> >> >> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup
> >> >> >> > database
> >> >> >> > WSS_Content to backup_file6 with init"
> >> >> >> >
> >> >> >> > Is this right? Or do I need to include something else?
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
I did a full backup of my database, but everyday when it is backing up I
would like it to overwrite the previous day's backup.
I'm doing it thru Transact-SQL script(T-SQL) so i am entering the following
command:
"EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
WSS_Content to backup_file6 with init"
Is this right? Or do I need to include something else?From BOL:
INIT Specifies that all backup sets should be overwritten, but preserves
the media header. If INIT is specified, any existing backup set on that
device is overwritten, if conditions permit. By default, BACKUP checks for
the following conditions and does not overwrite the backup media if either
condition exists:
a.. Any backup set has not yet expired. For more information, see the
EXPIREDATE and RETAINDAYS options.
b.. The backup set name given in the BACKUP statement, if provided, does
not match the name on the backup media. For more information, see the NAME
option, earlier in this section.
To override these checks, use the SKIP option.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> Hi,
> I did a full backup of my database, but everyday when it is backing up I
> would like it to overwrite the previous day's backup.
> I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> following
> command:
> "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> WSS_Content to backup_file6 with init"
> Is this right? Or do I need to include something else?|||Hi, thanks for the response........
Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
Also, I use the SKIP option with "with skip, init"?
"TheSQLGuru" wrote:
> From BOL:
> INIT Specifies that all backup sets should be overwritten, but preserves
> the media header. If INIT is specified, any existing backup set on that
> device is overwritten, if conditions permit. By default, BACKUP checks for
> the following conditions and does not overwrite the backup media if either
> condition exists:
> a.. Any backup set has not yet expired. For more information, see the
> EXPIREDATE and RETAINDAYS options.
>
> b.. The backup set name given in the BACKUP statement, if provided, does
> not match the name on the backup media. For more information, see the NAME
> option, earlier in this section.
> To override these checks, use the SKIP option.
>
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> > Hi,
> > I did a full backup of my database, but everyday when it is backing up I
> > would like it to overwrite the previous day's backup.
> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> > following
> > command:
> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> > WSS_Content to backup_file6 with init"
> >
> > Is this right? Or do I need to include something else?
>
>|||See Backup Database in Books Online. Everything is explained nicely there.
To answer your question here yes, WITH options are simply comma separated.
--
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> Hi, thanks for the response........
> Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> Also, I use the SKIP option with "with skip, init"?
> "TheSQLGuru" wrote:
>> From BOL:
>> INIT Specifies that all backup sets should be overwritten, but preserves
>> the media header. If INIT is specified, any existing backup set on that
>> device is overwritten, if conditions permit. By default, BACKUP checks
>> for
>> the following conditions and does not overwrite the backup media if
>> either
>> condition exists:
>> a.. Any backup set has not yet expired. For more information, see the
>> EXPIREDATE and RETAINDAYS options.
>>
>> b.. The backup set name given in the BACKUP statement, if provided,
>> does
>> not match the name on the backup media. For more information, see the
>> NAME
>> option, earlier in this section.
>> To override these checks, use the SKIP option.
>>
>> --
>> Kevin G. Boles
>> TheSQLGuru
>> Indicium Resources, Inc.
>>
>> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>> > Hi,
>> > I did a full backup of my database, but everyday when it is backing up
>> > I
>> > would like it to overwrite the previous day's backup.
>> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
>> > following
>> > command:
>> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
>> > WSS_Content to backup_file6 with init"
>> >
>> > Is this right? Or do I need to include something else?
>>|||Hi,
I'm trying to do an automated backup where it overwrites the previous
backup. I'm running the command:
"EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
WSS_Content to backup_file9
with skip, init"
But when I go to View Job History, I'm getting the error:
"The add device request was denied. A physical device named 'C:\Friday'
already exists. Only one backup device may refer to any physical device
name.[SQLSTATE 42000](Error 15061). The step failed."
Why exactly is that? What needs to be done?
Please help.......
"TheSQLGuru" wrote:
> See Backup Database in Books Online. Everything is explained nicely there.
> To answer your question here yes, WITH options are simply comma separated.
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> > Hi, thanks for the response........
> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> > Also, I use the SKIP option with "with skip, init"?
> >
> > "TheSQLGuru" wrote:
> >
> >> From BOL:
> >>
> >> INIT Specifies that all backup sets should be overwritten, but preserves
> >> the media header. If INIT is specified, any existing backup set on that
> >> device is overwritten, if conditions permit. By default, BACKUP checks
> >> for
> >> the following conditions and does not overwrite the backup media if
> >> either
> >> condition exists:
> >> a.. Any backup set has not yet expired. For more information, see the
> >> EXPIREDATE and RETAINDAYS options.
> >>
> >>
> >> b.. The backup set name given in the BACKUP statement, if provided,
> >> does
> >> not match the name on the backup media. For more information, see the
> >> NAME
> >> option, earlier in this section.
> >>
> >> To override these checks, use the SKIP option.
> >>
> >>
> >> --
> >> Kevin G. Boles
> >> TheSQLGuru
> >> Indicium Resources, Inc.
> >>
> >>
> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> >> > Hi,
> >> > I did a full backup of my database, but everyday when it is backing up
> >> > I
> >> > would like it to overwrite the previous day's backup.
> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> >> > following
> >> > command:
> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> >> > WSS_Content to backup_file6 with init"
> >> >
> >> > Is this right? Or do I need to include something else?
> >>
> >>
> >>
>
>|||sp_addumpdevice creates a backupdevice, which you later use in your backup command. So, you only
need to do this once.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
> Hi,
> I'm trying to do an automated backup where it overwrites the previous
> backup. I'm running the command:
> "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
> WSS_Content to backup_file9
> with skip, init"
> But when I go to View Job History, I'm getting the error:
> "The add device request was denied. A physical device named 'C:\Friday'
> already exists. Only one backup device may refer to any physical device
> name.[SQLSTATE 42000](Error 15061). The step failed."
> Why exactly is that? What needs to be done?
> Please help.......
>
> "TheSQLGuru" wrote:
>> See Backup Database in Books Online. Everything is explained nicely there.
>> To answer your question here yes, WITH options are simply comma separated.
>> --
>> Kevin G. Boles
>> TheSQLGuru
>> Indicium Resources, Inc.
>>
>> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>> > Hi, thanks for the response........
>> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
>> > Also, I use the SKIP option with "with skip, init"?
>> >
>> > "TheSQLGuru" wrote:
>> >
>> >> From BOL:
>> >>
>> >> INIT Specifies that all backup sets should be overwritten, but preserves
>> >> the media header. If INIT is specified, any existing backup set on that
>> >> device is overwritten, if conditions permit. By default, BACKUP checks
>> >> for
>> >> the following conditions and does not overwrite the backup media if
>> >> either
>> >> condition exists:
>> >> a.. Any backup set has not yet expired. For more information, see the
>> >> EXPIREDATE and RETAINDAYS options.
>> >>
>> >>
>> >> b.. The backup set name given in the BACKUP statement, if provided,
>> >> does
>> >> not match the name on the backup media. For more information, see the
>> >> NAME
>> >> option, earlier in this section.
>> >>
>> >> To override these checks, use the SKIP option.
>> >>
>> >>
>> >> --
>> >> Kevin G. Boles
>> >> TheSQLGuru
>> >> Indicium Resources, Inc.
>> >>
>> >>
>> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>> >> > Hi,
>> >> > I did a full backup of my database, but everyday when it is backing up
>> >> > I
>> >> > would like it to overwrite the previous day's backup.
>> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
>> >> > following
>> >> > command:
>> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
>> >> > WSS_Content to backup_file6 with init"
>> >> >
>> >> > Is this right? Or do I need to include something else?
>> >>
>> >>
>> >>
>>|||Hi, thanks for your response......
What command exactly do I need to use -
"EXEC backup database WSS_Content to backup_file9
with skip, init" ?
"Tibor Karaszi" wrote:
> sp_addumpdevice creates a backupdevice, which you later use in your backup command. So, you only
> need to do this once.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
> > Hi,
> > I'm trying to do an automated backup where it overwrites the previous
> > backup. I'm running the command:
> > "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
> > WSS_Content to backup_file9
> > with skip, init"
> >
> > But when I go to View Job History, I'm getting the error:
> > "The add device request was denied. A physical device named 'C:\Friday'
> > already exists. Only one backup device may refer to any physical device
> > name.[SQLSTATE 42000](Error 15061). The step failed."
> >
> > Why exactly is that? What needs to be done?
> >
> > Please help.......
> >
> >
> > "TheSQLGuru" wrote:
> >
> >> See Backup Database in Books Online. Everything is explained nicely there.
> >> To answer your question here yes, WITH options are simply comma separated.
> >>
> >> --
> >> Kevin G. Boles
> >> TheSQLGuru
> >> Indicium Resources, Inc.
> >>
> >>
> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> >> > Hi, thanks for the response........
> >> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> >> > Also, I use the SKIP option with "with skip, init"?
> >> >
> >> > "TheSQLGuru" wrote:
> >> >
> >> >> From BOL:
> >> >>
> >> >> INIT Specifies that all backup sets should be overwritten, but preserves
> >> >> the media header. If INIT is specified, any existing backup set on that
> >> >> device is overwritten, if conditions permit. By default, BACKUP checks
> >> >> for
> >> >> the following conditions and does not overwrite the backup media if
> >> >> either
> >> >> condition exists:
> >> >> a.. Any backup set has not yet expired. For more information, see the
> >> >> EXPIREDATE and RETAINDAYS options.
> >> >>
> >> >>
> >> >> b.. The backup set name given in the BACKUP statement, if provided,
> >> >> does
> >> >> not match the name on the backup media. For more information, see the
> >> >> NAME
> >> >> option, earlier in this section.
> >> >>
> >> >> To override these checks, use the SKIP option.
> >> >>
> >> >>
> >> >> --
> >> >> Kevin G. Boles
> >> >> TheSQLGuru
> >> >> Indicium Resources, Inc.
> >> >>
> >> >>
> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> >> >> > Hi,
> >> >> > I did a full backup of my database, but everyday when it is backing up
> >> >> > I
> >> >> > would like it to overwrite the previous day's backup.
> >> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> >> >> > following
> >> >> > command:
> >> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> >> >> > WSS_Content to backup_file6 with init"
> >> >> >
> >> >> > Is this right? Or do I need to include something else?
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>|||If your dumbdevice is "backup_file9" then:
BACKUP DATABASE mydb TO backup_file9 WITH INIT
This command will backup "mydb" database to "bacup_file9" dumbdevice and
it'll overwrite the old one(s).
--
Ekrem Ã?nsoy
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
> Hi, thanks for your response......
> What command exactly do I need to use -
> "EXEC backup database WSS_Content to backup_file9
> with skip, init" ?
> "Tibor Karaszi" wrote:
>> sp_addumpdevice creates a backupdevice, which you later use in your
>> backup command. So, you only
>> need to do this once.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
>> > Hi,
>> > I'm trying to do an automated backup where it overwrites the previous
>> > backup. I'm running the command:
>> > "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup
>> > database
>> > WSS_Content to backup_file9
>> > with skip, init"
>> >
>> > But when I go to View Job History, I'm getting the error:
>> > "The add device request was denied. A physical device named
>> > 'C:\Friday'
>> > already exists. Only one backup device may refer to any physical
>> > device
>> > name.[SQLSTATE 42000](Error 15061). The step failed."
>> >
>> > Why exactly is that? What needs to be done?
>> >
>> > Please help.......
>> >
>> >
>> > "TheSQLGuru" wrote:
>> >
>> >> See Backup Database in Books Online. Everything is explained nicely
>> >> there.
>> >> To answer your question here yes, WITH options are simply comma
>> >> separated.
>> >>
>> >> --
>> >> Kevin G. Boles
>> >> TheSQLGuru
>> >> Indicium Resources, Inc.
>> >>
>> >>
>> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> >> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>> >> > Hi, thanks for the response........
>> >> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
>> >> > Also, I use the SKIP option with "with skip, init"?
>> >> >
>> >> > "TheSQLGuru" wrote:
>> >> >
>> >> >> From BOL:
>> >> >>
>> >> >> INIT Specifies that all backup sets should be overwritten, but
>> >> >> preserves
>> >> >> the media header. If INIT is specified, any existing backup set on
>> >> >> that
>> >> >> device is overwritten, if conditions permit. By default, BACKUP
>> >> >> checks
>> >> >> for
>> >> >> the following conditions and does not overwrite the backup media if
>> >> >> either
>> >> >> condition exists:
>> >> >> a.. Any backup set has not yet expired. For more information, see
>> >> >> the
>> >> >> EXPIREDATE and RETAINDAYS options.
>> >> >>
>> >> >>
>> >> >> b.. The backup set name given in the BACKUP statement, if
>> >> >> provided,
>> >> >> does
>> >> >> not match the name on the backup media. For more information, see
>> >> >> the
>> >> >> NAME
>> >> >> option, earlier in this section.
>> >> >>
>> >> >> To override these checks, use the SKIP option.
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Kevin G. Boles
>> >> >> TheSQLGuru
>> >> >> Indicium Resources, Inc.
>> >> >>
>> >> >>
>> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
>> >> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>> >> >> > Hi,
>> >> >> > I did a full backup of my database, but everyday when it is
>> >> >> > backing up
>> >> >> > I
>> >> >> > would like it to overwrite the previous day's backup.
>> >> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
>> >> >> > following
>> >> >> > command:
>> >> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup
>> >> >> > database
>> >> >> > WSS_Content to backup_file6 with init"
>> >> >> >
>> >> >> > Is this right? Or do I need to include something else?
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>|||Thank you so much......It worked!
"Ekrem Ã?nsoy" wrote:
> If your dumbdevice is "backup_file9" then:
> BACKUP DATABASE mydb TO backup_file9 WITH INIT
> This command will backup "mydb" database to "bacup_file9" dumbdevice and
> it'll overwrite the old one(s).
> --
> Ekrem Ã?nsoy
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
> > Hi, thanks for your response......
> > What command exactly do I need to use -
> > "EXEC backup database WSS_Content to backup_file9
> > with skip, init" ?
> >
> > "Tibor Karaszi" wrote:
> >
> >> sp_addumpdevice creates a backupdevice, which you later use in your
> >> backup command. So, you only
> >> need to do this once.
> >>
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >> http://www.karaszi.com/sqlserver/default.asp
> >> http://sqlblog.com/blogs/tibor_karaszi
> >>
> >>
> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
> >> > Hi,
> >> > I'm trying to do an automated backup where it overwrites the previous
> >> > backup. I'm running the command:
> >> > "EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup
> >> > database
> >> > WSS_Content to backup_file9
> >> > with skip, init"
> >> >
> >> > But when I go to View Job History, I'm getting the error:
> >> > "The add device request was denied. A physical device named
> >> > 'C:\Friday'
> >> > already exists. Only one backup device may refer to any physical
> >> > device
> >> > name.[SQLSTATE 42000](Error 15061). The step failed."
> >> >
> >> > Why exactly is that? What needs to be done?
> >> >
> >> > Please help.......
> >> >
> >> >
> >> > "TheSQLGuru" wrote:
> >> >
> >> >> See Backup Database in Books Online. Everything is explained nicely
> >> >> there.
> >> >> To answer your question here yes, WITH options are simply comma
> >> >> separated.
> >> >>
> >> >> --
> >> >> Kevin G. Boles
> >> >> TheSQLGuru
> >> >> Indicium Resources, Inc.
> >> >>
> >> >>
> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> >> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
> >> >> > Hi, thanks for the response........
> >> >> > Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> >> >> > Also, I use the SKIP option with "with skip, init"?
> >> >> >
> >> >> > "TheSQLGuru" wrote:
> >> >> >
> >> >> >> From BOL:
> >> >> >>
> >> >> >> INIT Specifies that all backup sets should be overwritten, but
> >> >> >> preserves
> >> >> >> the media header. If INIT is specified, any existing backup set on
> >> >> >> that
> >> >> >> device is overwritten, if conditions permit. By default, BACKUP
> >> >> >> checks
> >> >> >> for
> >> >> >> the following conditions and does not overwrite the backup media if
> >> >> >> either
> >> >> >> condition exists:
> >> >> >> a.. Any backup set has not yet expired. For more information, see
> >> >> >> the
> >> >> >> EXPIREDATE and RETAINDAYS options.
> >> >> >>
> >> >> >>
> >> >> >> b.. The backup set name given in the BACKUP statement, if
> >> >> >> provided,
> >> >> >> does
> >> >> >> not match the name on the backup media. For more information, see
> >> >> >> the
> >> >> >> NAME
> >> >> >> option, earlier in this section.
> >> >> >>
> >> >> >> To override these checks, use the SKIP option.
> >> >> >>
> >> >> >>
> >> >> >> --
> >> >> >> Kevin G. Boles
> >> >> >> TheSQLGuru
> >> >> >> Indicium Resources, Inc.
> >> >> >>
> >> >> >>
> >> >> >> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> >> >> >> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> >> >> >> > Hi,
> >> >> >> > I did a full backup of my database, but everyday when it is
> >> >> >> > backing up
> >> >> >> > I
> >> >> >> > would like it to overwrite the previous day's backup.
> >> >> >> > I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> >> >> >> > following
> >> >> >> > command:
> >> >> >> > "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup
> >> >> >> > database
> >> >> >> > WSS_Content to backup_file6 with init"
> >> >> >> >
> >> >> >> > Is this right? Or do I need to include something else?
> >> >> >>
> >> >> >>
> >> >> >>
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
Overwriting Backup Set
Hi,
I did a full backup of my database, but everyday when it is backing up I
would like it to overwrite the previous day's backup.
I'm doing it thru Transact-SQL script(T-SQL) so i am entering the following
command:
"EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
WSS_Content to backup_file6 with init"
Is this right? Or do I need to include something else?
From BOL:
INIT Specifies that all backup sets should be overwritten, but preserves
the media header. If INIT is specified, any existing backup set on that
device is overwritten, if conditions permit. By default, BACKUP checks for
the following conditions and does not overwrite the backup media if either
condition exists:
a.. Any backup set has not yet expired. For more information, see the
EXPIREDATE and RETAINDAYS options.
b.. The backup set name given in the BACKUP statement, if provided, does
not match the name on the backup media. For more information, see the NAME
option, earlier in this section.
To override these checks, use the SKIP option.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> Hi,
> I did a full backup of my database, but everyday when it is backing up I
> would like it to overwrite the previous day's backup.
> I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> following
> command:
> "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> WSS_Content to backup_file6 with init"
> Is this right? Or do I need to include something else?
|||Hi, thanks for the response........
Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
Also, I use the SKIP option with "with skip, init"?
"TheSQLGuru" wrote:
> From BOL:
> INIT Specifies that all backup sets should be overwritten, but preserves
> the media header. If INIT is specified, any existing backup set on that
> device is overwritten, if conditions permit. By default, BACKUP checks for
> the following conditions and does not overwrite the backup media if either
> condition exists:
> a.. Any backup set has not yet expired. For more information, see the
> EXPIREDATE and RETAINDAYS options.
>
> b.. The backup set name given in the BACKUP statement, if provided, does
> not match the name on the backup media. For more information, see the NAME
> option, earlier in this section.
> To override these checks, use the SKIP option.
>
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>
>
|||See Backup Database in Books Online. Everything is explained nicely there.
To answer your question here yes, WITH options are simply comma separated.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for the response........
> Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> Also, I use the SKIP option with "with skip, init"?
> "TheSQLGuru" wrote:
|||Hi,
I'm trying to do an automated backup where it overwrites the previous
backup. I'm running the command:
"EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
WSS_Content to backup_file9
with skip, init"
But when I go to View Job History, I'm getting the error:
"The add device request was denied. A physical device named 'C:\Friday'
already exists. Only one backup device may refer to any physical device
name.[SQLSTATE 42000](Error 15061). The step failed."
Why exactly is that? What needs to be done?
Please help.......
"TheSQLGuru" wrote:
> See Backup Database in Books Online. Everything is explained nicely there.
> To answer your question here yes, WITH options are simply comma separated.
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>
>
|||Hi, thanks for your response......
What command exactly do I need to use -
"EXEC backup database WSS_Content to backup_file9
with skip, init" ?
"Tibor Karaszi" wrote:
> sp_addumpdevice creates a backupdevice, which you later use in your backup command. So, you only
> need to do this once.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
>
>
|||If your dumbdevice is "backup_file9" then:
BACKUP DATABASE mydb TO backup_file9 WITH INIT
This command will backup "mydb" database to "bacup_file9" dumbdevice and
it'll overwrite the old one(s).
Ekrem ?nsoy
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for your response......
> What command exactly do I need to use -
> "EXEC backup database WSS_Content to backup_file9
> with skip, init" ?
> "Tibor Karaszi" wrote:
|||Thank you so much......It worked!
"Ekrem ?nsoy" wrote:
> If your dumbdevice is "backup_file9" then:
> BACKUP DATABASE mydb TO backup_file9 WITH INIT
> This command will backup "mydb" database to "bacup_file9" dumbdevice and
> it'll overwrite the old one(s).
> --
> Ekrem ?nsoy
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
>
I did a full backup of my database, but everyday when it is backing up I
would like it to overwrite the previous day's backup.
I'm doing it thru Transact-SQL script(T-SQL) so i am entering the following
command:
"EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
WSS_Content to backup_file6 with init"
Is this right? Or do I need to include something else?
From BOL:
INIT Specifies that all backup sets should be overwritten, but preserves
the media header. If INIT is specified, any existing backup set on that
device is overwritten, if conditions permit. By default, BACKUP checks for
the following conditions and does not overwrite the backup media if either
condition exists:
a.. Any backup set has not yet expired. For more information, see the
EXPIREDATE and RETAINDAYS options.
b.. The backup set name given in the BACKUP statement, if provided, does
not match the name on the backup media. For more information, see the NAME
option, earlier in this section.
To override these checks, use the SKIP option.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
> Hi,
> I did a full backup of my database, but everyday when it is backing up I
> would like it to overwrite the previous day's backup.
> I'm doing it thru Transact-SQL script(T-SQL) so i am entering the
> following
> command:
> "EXEC sp_addumpdevice 'disk', 'backup_file6', 'C:\test' backup database
> WSS_Content to backup_file6 with init"
> Is this right? Or do I need to include something else?
|||Hi, thanks for the response........
Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
Also, I use the SKIP option with "with skip, init"?
"TheSQLGuru" wrote:
> From BOL:
> INIT Specifies that all backup sets should be overwritten, but preserves
> the media header. If INIT is specified, any existing backup set on that
> device is overwritten, if conditions permit. By default, BACKUP checks for
> the following conditions and does not overwrite the backup media if either
> condition exists:
> a.. Any backup set has not yet expired. For more information, see the
> EXPIREDATE and RETAINDAYS options.
>
> b.. The backup set name given in the BACKUP statement, if provided, does
> not match the name on the backup media. For more information, see the NAME
> option, earlier in this section.
> To override these checks, use the SKIP option.
>
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AFAA262A-FF58-4ABB-A2AC-A6803A88C87A@.microsoft.com...
>
>
|||See Backup Database in Books Online. Everything is explained nicely there.
To answer your question here yes, WITH options are simply comma separated.
Kevin G. Boles
TheSQLGuru
Indicium Resources, Inc.
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for the response........
> Where do I need to go to see the EXPIREDATE and RETAINDAYS options?
> Also, I use the SKIP option with "with skip, init"?
> "TheSQLGuru" wrote:
|||Hi,
I'm trying to do an automated backup where it overwrites the previous
backup. I'm running the command:
"EXEC sp_addumpdevice 'disk', 'backup_file9', 'C:\Friday' backup database
WSS_Content to backup_file9
with skip, init"
But when I go to View Job History, I'm getting the error:
"The add device request was denied. A physical device named 'C:\Friday'
already exists. Only one backup device may refer to any physical device
name.[SQLSTATE 42000](Error 15061). The step failed."
Why exactly is that? What needs to be done?
Please help.......
"TheSQLGuru" wrote:
> See Backup Database in Books Online. Everything is explained nicely there.
> To answer your question here yes, WITH options are simply comma separated.
> --
> Kevin G. Boles
> TheSQLGuru
> Indicium Resources, Inc.
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:73A564B3-E7E1-4EB8-BE86-5660091A7A97@.microsoft.com...
>
>
|||Hi, thanks for your response......
What command exactly do I need to use -
"EXEC backup database WSS_Content to backup_file9
with skip, init" ?
"Tibor Karaszi" wrote:
> sp_addumpdevice creates a backupdevice, which you later use in your backup command. So, you only
> need to do this once.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:2808B4FF-8B74-4596-BDF2-A574E6FDA2D4@.microsoft.com...
>
>
|||If your dumbdevice is "backup_file9" then:
BACKUP DATABASE mydb TO backup_file9 WITH INIT
This command will backup "mydb" database to "bacup_file9" dumbdevice and
it'll overwrite the old one(s).
Ekrem ?nsoy
"Shelley" <Shelley@.discussions.microsoft.com> wrote in message
news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...[vbcol=seagreen]
> Hi, thanks for your response......
> What command exactly do I need to use -
> "EXEC backup database WSS_Content to backup_file9
> with skip, init" ?
> "Tibor Karaszi" wrote:
|||Thank you so much......It worked!
"Ekrem ?nsoy" wrote:
> If your dumbdevice is "backup_file9" then:
> BACKUP DATABASE mydb TO backup_file9 WITH INIT
> This command will backup "mydb" database to "bacup_file9" dumbdevice and
> it'll overwrite the old one(s).
> --
> Ekrem ?nsoy
>
> "Shelley" <Shelley@.discussions.microsoft.com> wrote in message
> news:AAE46936-7E69-45AD-8E02-BF986546FD28@.microsoft.com...
>
Saturday, February 25, 2012
overwrite backup don't overwrite the backup device
I created a plan for a backup. This first truncates the log and after backups the data with overwrite mode and after backups the transaction log with overwrite mode.
The process is using different backup devices for the data and log backups.
The first 2 step is success (truncate and data backup) but in the last step the backup process don't overwrite the backup device. Why ?It had been set to Full databases, after i set to specified database...it was success.
So if I'm setting to full databases, it's can't overwrite the log backup device (only append)...
sneaky
|||
after when i set to specified database and i choose the db in the script was "backup log db_log INIT" so it didn't have inconsistency between the form and the ran sql script.
(sorry my english)|||
The process is using different backup devices for the data and log backups.
The first 2 step is success (truncate and data backup) but in the last step the backup process don't overwrite the backup device. Why ?It had been set to Full databases, after i set to specified database...it was success.
So if I'm setting to full databases, it's can't overwrite the log backup device (only append)...
sneaky
Hi Molnarcs,
Just FYI
The backup device can be overwritten even when doing the log backups.
Jag
|||when the backup was set to full databases then in the form the mode was overwrite but if i checked the sql statement (plan's history log- view T-SQL)...in the script was the "backup log model... NOINIT...backup log db_log....NOINIT"...after when i set to specified database and i choose the db in the script was "backup log db_log INIT" so it didn't have inconsistency between the form and the ran sql script.
(sorry my english)|||
Hi Molnarcs,
you r right you have to secify INIT option with backup log.
Jag
Subscribe to:
Posts (Atom)