Sunday, March 25, 2012
Basic backup question
restore it I get the following exception:
*******
Msg 3159, Level 16, State 1, Line 1
The tail of the log for the database "MYBACKUP" has not been backed up. Use
BACKUP LOG WITH NORECOVERY to backup the log if it contains work you do not
want to lose. Use the WITH REPLACE or WITH STOPAT clause of the RESTORE
statement to just overwrite the contents of the log.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.
*******
What is this message?
Should I backup the log before backing up the database?
Is the database backup enought to recover data?
Thanks!
GasparA couple of questions first:
Are you doing regular transaction log backups?
If not, is there a reason for you to have the database in full recovery model?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Gaspar" <noreply@.nospamplease.com> wrote in message news:eSEAac8QIHA.4196@.TK2MSFTNGP04.phx.gbl...
> I'm doing a full backup of a SQL Server database with SSMS. When I try to restore it I get the
> following exception:
> *******
> Msg 3159, Level 16, State 1, Line 1
> The tail of the log for the database "MYBACKUP" has not been backed up. Use BACKUP LOG WITH
> NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE or
> WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
> Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> *******
> What is this message?
> Should I backup the log before backing up the database?
> Is the database backup enought to recover data?
> Thanks!
> Gaspar
>|||Yes. I have schedules to backup the transaction log every 6 hours. I don't
know if this is a good practice.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23aEpff8QIHA.5988@.TK2MSFTNGP02.phx.gbl...
>A couple of questions first:
> Are you doing regular transaction log backups?
> If not, is there a reason for you to have the database in full recovery
> model?
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Gaspar" <noreply@.nospamplease.com> wrote in message
> news:eSEAac8QIHA.4196@.TK2MSFTNGP04.phx.gbl...
>> I'm doing a full backup of a SQL Server database with SSMS. When I try to
>> restore it I get the following exception:
>> *******
>> Msg 3159, Level 16, State 1, Line 1
>> The tail of the log for the database "MYBACKUP" has not been backed up.
>> Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work you
>> do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of the
>> RESTORE statement to just overwrite the contents of the log.
>> Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>> *******
>> What is this message?
>> Should I backup the log before backing up the database?
>> Is the database backup enought to recover data?
>> Thanks!
>> Gaspar
>|||> Yes. I have schedules to backup the transaction log every 6 hours. I don't know if this is a good
> practice.
This we can't answer since we don't know how much data your organization can tolerate to lose in
case of a disaster...
Anyhow, I do now know you do log backups. OK, consider below:
1 Backup db
2 Users doing modifications
3 Backup log
4 Users doing modifications
5 Backup log
6 Users doing modifications
7 Backup log
8 Users doing modifications
And you now want to do RESTORE. But what about the modifications in step 8? This will be lost if you
perform the restore. The error is SQL Server's way of reminding you that you probably want to do a
log backup first:
9 Backup log
When you now RESTORE (1, 3, 5, 7 *and* 9), you will have no data loss. If you *want* to do RESTORE
*without* doing this last log backup, you can use the REPLACE parameter for the RESTORE command.
This behavior (the "reminder") is new for 2005, btw.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Gaspar" <noreply@.nospamplease.com> wrote in message news:ORsgVp8QIHA.5400@.TK2MSFTNGP04.phx.gbl...
> Yes. I have schedules to backup the transaction log every 6 hours. I don't know if this is a good
> practice.
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:%23aEpff8QIHA.5988@.TK2MSFTNGP02.phx.gbl...
>>A couple of questions first:
>> Are you doing regular transaction log backups?
>> If not, is there a reason for you to have the database in full recovery model?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Gaspar" <noreply@.nospamplease.com> wrote in message
>> news:eSEAac8QIHA.4196@.TK2MSFTNGP04.phx.gbl...
>> I'm doing a full backup of a SQL Server database with SSMS. When I try to restore it I get the
>> following exception:
>> *******
>> Msg 3159, Level 16, State 1, Line 1
>> The tail of the log for the database "MYBACKUP" has not been backed up. Use BACKUP LOG WITH
>> NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE
>> or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
>> Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>> *******
>> What is this message?
>> Should I backup the log before backing up the database?
>> Is the database backup enought to recover data?
>> Thanks!
>> Gaspar
>>
>|||So, this reminder "The tail of the log for the database "MYBACKUP" has not
been backed up" is just letting me know that after I backuped up the data,
some changes where done.
Suppose I don't care about this changes (my compain can "recover" from a
one-day data loss):
1) Can I restore by only having the database backup?
2) How to avoid this message from appearing?
Thanks again
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:O%23K04v8QIHA.3516@.TK2MSFTNGP02.phx.gbl...
>> Yes. I have schedules to backup the transaction log every 6 hours. I
>> don't know if this is a good practice.
> This we can't answer since we don't know how much data your organization
> can tolerate to lose in case of a disaster...
> Anyhow, I do now know you do log backups. OK, consider below:
> 1 Backup db
> 2 Users doing modifications
> 3 Backup log
> 4 Users doing modifications
> 5 Backup log
> 6 Users doing modifications
> 7 Backup log
> 8 Users doing modifications
> And you now want to do RESTORE. But what about the modifications in step
> 8? This will be lost if you perform the restore. The error is SQL Server's
> way of reminding you that you probably want to do a log backup first:
> 9 Backup log
> When you now RESTORE (1, 3, 5, 7 *and* 9), you will have no data loss. If
> you *want* to do RESTORE *without* doing this last log backup, you can use
> the REPLACE parameter for the RESTORE command.
> This behavior (the "reminder") is new for 2005, btw.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
> "Gaspar" <noreply@.nospamplease.com> wrote in message
> news:ORsgVp8QIHA.5400@.TK2MSFTNGP04.phx.gbl...
>> Yes. I have schedules to backup the transaction log every 6 hours. I
>> don't know if this is a good practice.
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
>> in message news:%23aEpff8QIHA.5988@.TK2MSFTNGP02.phx.gbl...
>>A couple of questions first:
>> Are you doing regular transaction log backups?
>> If not, is there a reason for you to have the database in full recovery
>> model?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Gaspar" <noreply@.nospamplease.com> wrote in message
>> news:eSEAac8QIHA.4196@.TK2MSFTNGP04.phx.gbl...
>> I'm doing a full backup of a SQL Server database with SSMS. When I try
>> to restore it I get the following exception:
>> *******
>> Msg 3159, Level 16, State 1, Line 1
>> The tail of the log for the database "MYBACKUP" has not been backed up.
>> Use BACKUP LOG WITH NORECOVERY to backup the log if it contains work
>> you do not want to lose. Use the WITH REPLACE or WITH STOPAT clause of
>> the RESTORE statement to just overwrite the contents of the log.
>> Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>> *******
>> What is this message?
>> Should I backup the log before backing up the database?
>> Is the database backup enought to recover data?
>> Thanks!
>> Gaspar
>>
>>
>|||> So, this reminder "The tail of the log for the database "MYBACKUP" has not been backed up" is just
> letting me know that after I backuped up the data, some changes where done.
Yes, the message states that after your last backup (database or log backup) there has been
modifications in the database.
> Suppose I don't care about this changes (my compain can "recover" from a one-day data loss):
> 1) Can I restore by only having the database backup?
Yes. Again, consider below:
1 Backup db
2 Users doing modifications
3 Backup log
4 Users doing modifications
5 Backup log
6 Users doing modifications
7 Backup log
8 Users doing modifications
You can restore from only 1. Of course you will lose all modifications done after 1.
> 2) How to avoid this message from appearing?
Specify the REPLACE option for your RESTORE command.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Gaspar" <noreply@.nospamplease.com> wrote in message news:ux4xwO9QIHA.1164@.TK2MSFTNGP02.phx.gbl...
> So, this reminder "The tail of the log for the database "MYBACKUP" has not been backed up" is just
> letting me know that after I backuped up the data, some changes where done.
> Suppose I don't care about this changes (my compain can "recover" from a one-day data loss):
> 1) Can I restore by only having the database backup?
> 2) How to avoid this message from appearing?
> Thanks again
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
> news:O%23K04v8QIHA.3516@.TK2MSFTNGP02.phx.gbl...
>> Yes. I have schedules to backup the transaction log every 6 hours. I don't know if this is a
>> good practice.
>> This we can't answer since we don't know how much data your organization can tolerate to lose in
>> case of a disaster...
>> Anyhow, I do now know you do log backups. OK, consider below:
>> 1 Backup db
>> 2 Users doing modifications
>> 3 Backup log
>> 4 Users doing modifications
>> 5 Backup log
>> 6 Users doing modifications
>> 7 Backup log
>> 8 Users doing modifications
>> And you now want to do RESTORE. But what about the modifications in step 8? This will be lost if
>> you perform the restore. The error is SQL Server's way of reminding you that you probably want to
>> do a log backup first:
>> 9 Backup log
>> When you now RESTORE (1, 3, 5, 7 *and* 9), you will have no data loss. If you *want* to do
>> RESTORE *without* doing this last log backup, you can use the REPLACE parameter for the RESTORE
>> command.
>> This behavior (the "reminder") is new for 2005, btw.
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Gaspar" <noreply@.nospamplease.com> wrote in message
>> news:ORsgVp8QIHA.5400@.TK2MSFTNGP04.phx.gbl...
>> Yes. I have schedules to backup the transaction log every 6 hours. I don't know if this is a
>> good practice.
>> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
>> news:%23aEpff8QIHA.5988@.TK2MSFTNGP02.phx.gbl...
>>A couple of questions first:
>> Are you doing regular transaction log backups?
>> If not, is there a reason for you to have the database in full recovery model?
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://sqlblog.com/blogs/tibor_karaszi
>>
>> "Gaspar" <noreply@.nospamplease.com> wrote in message
>> news:eSEAac8QIHA.4196@.TK2MSFTNGP04.phx.gbl...
>> I'm doing a full backup of a SQL Server database with SSMS. When I try to restore it I get the
>> following exception:
>> *******
>> Msg 3159, Level 16, State 1, Line 1
>> The tail of the log for the database "MYBACKUP" has not been backed up. Use BACKUP LOG WITH
>> NORECOVERY to backup the log if it contains work you do not want to lose. Use the WITH REPLACE
>> or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
>> Msg 3013, Level 16, State 1, Line 1
>> RESTORE DATABASE is terminating abnormally.
>> *******
>> What is this message?
>> Should I backup the log before backing up the database?
>> Is the database backup enought to recover data?
>> Thanks!
>> Gaspar
>>
>>
>>
>|||This may help, it helped me.
http://www.associatedcontent.com/article/267055/how_to_setup_sql_server_2005_backups.html
On Dec 21, 6:44 am, "Tibor Karaszi"
<tibor_please.no.email_kara...@.hotmail.nomail.com> wrote:
> > So, this reminder "The tail of the log for the database "MYBACKUP" has not been backed up" is just
> > letting me know that after I backuped up the data, some changes where done.
> Yes, the message states that after your lastbackup(database or logbackup) there has been
> modifications in the database.
> > Suppose I don't care about this changes (my compain can "recover" from a one-day data loss):
> > 1) Can I restore by only having the databasebackup?
> Yes. Again, consider below:
> 1Backupdb
> 2 Users doing modifications
> 3Backuplog
> 4 Users doing modifications
> 5Backuplog
> 6 Users doing modifications
> 7Backuplog
> 8 Users doing modifications
> You can restore from only 1. Of course you will lose all modifications done after 1.
> > 2) How to avoid this message from appearing?
> Specify the REPLACE option for your RESTORE command.
> --
> Tibor Karaszi, SQL Server MVPhttp://www.karaszi.com/sqlserver/default.asphttp://sqlblog.com/blogs/tibor_karaszi
> "Gaspar" <nore...@.nospamplease.com> wrote in messagenews:ux4xwO9QIHA.1164@.TK2MSFTNGP02.phx.gbl...
> > So, this reminder "The tail of the log for the database "MYBACKUP" has not been backed up" is just
> > letting me know that after I backuped up the data, some changes where done.
> > Suppose I don't care about this changes (my compain can "recover" from a one-day data loss):
> > 1) Can I restore by only having the databasebackup?
> > 2) How to avoid this message from appearing?
> > Thanks again
> > "Tibor Karaszi" <tibor_please.no.email_kara...@.hotmail.nomail.com> wrote in message
> >news:O%23K04v8QIHA.3516@.TK2MSFTNGP02.phx.gbl...
> >> Yes. I have schedules tobackupthe transaction log every 6 hours. I don't know if this is a
> >> good practice.
> >> This we can't answer since we don't know how much data your organization can tolerate to lose in
> >> case of a disaster...
> >> Anyhow, I do now know you do log backups. OK, consider below:
> >> 1Backupdb
> >> 2 Users doing modifications
> >> 3Backuplog
> >> 4 Users doing modifications
> >> 5Backuplog
> >> 6 Users doing modifications
> >> 7Backuplog
> >> 8 Users doing modifications
> >> And you now want to do RESTORE. But what about the modifications in step 8? This will be lost if
> >> you perform the restore. The error is SQL Server's way of reminding you that you probably want to
> >> do a logbackupfirst:
> >> 9Backuplog
> >> When you now RESTORE (1, 3, 5, 7 *and* 9), you will have no data loss. If you *want* to do
> >> RESTORE *without* doing this last logbackup, you can use the REPLACE parameter for the RESTORE
> >> command.
> >> This behavior (the "reminder") is new for 2005, btw.
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >>http://www.karaszi.com/sqlserver/default.asp
> >>http://sqlblog.com/blogs/tibor_karaszi
> >> "Gaspar" <nore...@.nospamplease.com> wrote in message
> >>news:ORsgVp8QIHA.5400@.TK2MSFTNGP04.phx.gbl...
> >> Yes. I have schedules tobackupthe transaction log every 6 hours. I don't know if this is a
> >> good practice.
> >> "Tibor Karaszi" <tibor_please.no.email_kara...@.hotmail.nomail.com> wrote in message
> >>news:%23aEpff8QIHA.5988@.TK2MSFTNGP02.phx.gbl...
> >>A couple of questions first:
> >> Are you doing regular transaction log backups?
> >> If not, is there a reason for you to have the database in full recovery model?
> >> --
> >> Tibor Karaszi, SQL Server MVP
> >>http://www.karaszi.com/sqlserver/default.asp
> >>http://sqlblog.com/blogs/tibor_karaszi
> >> "Gaspar" <nore...@.nospamplease.com> wrote in message
> >>news:eSEAac8QIHA.4196@.TK2MSFTNGP04.phx.gbl...
> >> I'm doing a fullbackupof a SQL Server database with SSMS. When I try to restore it I get the
> >> following exception:
> >> *******
> >> Msg 3159, Level 16, State 1, Line 1
> >> The tail of the log for the database "MYBACKUP" has not been backed up. UseBACKUPLOG WITH
> >> NORECOVERY tobackupthe log if it contains work you do not want to lose. Use the WITH REPLACE
> >> or WITH STOPAT clause of the RESTORE statement to just overwrite the contents of the log.
> >> Msg 3013, Level 16, State 1, Line 1
> >> RESTORE DATABASE is terminating abnormally.
> >> *******
> >> What is this message?
> >> Should Ibackupthe log before backing up the database?
> >> Is the databasebackupenought to recover data?
> >> Thanks!
> >> Gaspar
Base Functionality Script
In the BOL about Designing a Backup and Restore Strategy, it is mentioned there is a Base Functionality Script that should be run after SQL Server restored. What is Base Functionality Script? Just DBCC CHECKDB? Anything else?
Thanks
ZYTA "base functionality script" is a batch of code that can be used to quickly demonstrate the successful functioning of the database from a specific application's perspective. Most commonly this is a .sql file with batched SQL commands run into the server from ISQL. For other applications, a .bat file is more appropriate because it can contain BCP and ISQL commands. This base functionality script is very application-specific, and can take many different forms. For example, on a Decision Support/Reporting system, the script may merely be a copy of a couple of your key reporting queries; for an online transaction processing (OLTP) application it may be the execution of a batch of stored procedures to execute INSERT, UPDATE, and DELETE statements. The goal is to confirm, from a gross perspective, that everything is working as intended. The base functionality script provides a nice tool for the SA or DBA to be able to see that the database is back in a viable state, without depending on the end users for verification.
Sunday, March 11, 2012
backward compatability
I was just wondering if you build a database in sql2005 and then save the
file(backup dbase) would it work to perform a restore from this file with
sql2000?
thanks.
--
Paul G
Software engineer.Paul
No, it will not.
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:60AF58FA-67EE-4AF7-94A9-4AC5B3E34732@.microsoft.com...
> Hi,
> I was just wondering if you build a database in sql2005 and then save the
> file(backup dbase) would it work to perform a restore from this file with
> sql2000?
> thanks.
> --
> Paul G
> Software engineer.|||No.
Compatibility is forward only, typically for two versions. A SQL 7.0 backup
will restore to 2000 and 2005, but not 2008 (forthcoming).
--
Geoff N. Hiten
Senior SQL Infrastructure Consultant
Microsoft SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:60AF58FA-67EE-4AF7-94A9-4AC5B3E34732@.microsoft.com...
> Hi,
> I was just wondering if you build a database in sql2005 and then save the
> file(backup dbase) would it work to perform a restore from this file with
> sql2000?
> thanks.
> --
> Paul G
> Software engineer.|||Ok thanks for the information, I will use 2000 to build the dbase since we
are using both 2000 production/ 2005 testing(production in near future) .
--
Paul G
Software engineer.
"Geoff N. Hiten" wrote:
> No.
> Compatibility is forward only, typically for two versions. A SQL 7.0 backup
> will restore to 2000 and 2005, but not 2008 (forthcoming).
> --
> Geoff N. Hiten
> Senior SQL Infrastructure Consultant
> Microsoft SQL Server MVP
>
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:60AF58FA-67EE-4AF7-94A9-4AC5B3E34732@.microsoft.com...
> > Hi,
> > I was just wondering if you build a database in sql2005 and then save the
> > file(backup dbase) would it work to perform a restore from this file with
> > sql2000?
> > thanks.
> > --
> > Paul G
> > Software engineer.
>|||oops, someone asked the same question just a few posts earlier!
--
Paul G
Software engineer.
"Paul" wrote:
> Ok thanks for the information, I will use 2000 to build the dbase since we
> are using both 2000 production/ 2005 testing(production in near future) .
> --
> Paul G
> Software engineer.
>
> "Geoff N. Hiten" wrote:
> > No.
> >
> > Compatibility is forward only, typically for two versions. A SQL 7.0 backup
> > will restore to 2000 and 2005, but not 2008 (forthcoming).
> >
> > --
> > Geoff N. Hiten
> > Senior SQL Infrastructure Consultant
> > Microsoft SQL Server MVP
> >
> >
> > "Paul" <Paul@.discussions.microsoft.com> wrote in message
> > news:60AF58FA-67EE-4AF7-94A9-4AC5B3E34732@.microsoft.com...
> > > Hi,
> > > I was just wondering if you build a database in sql2005 and then save the
> > > file(backup dbase) would it work to perform a restore from this file with
> > > sql2000?
> > > thanks.
> > > --
> > > Paul G
> > > Software engineer.
> >
> >
backward compatability
I was just wondering if you build a database in sql2005 and then save the
file(backup dbase) would it work to perform a restore from this file with
sql2000?
thanks.
Paul G
Software engineer.
Paul
No, it will not.
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:60AF58FA-67EE-4AF7-94A9-4AC5B3E34732@.microsoft.com...
> Hi,
> I was just wondering if you build a database in sql2005 and then save the
> file(backup dbase) would it work to perform a restore from this file with
> sql2000?
> thanks.
> --
> Paul G
> Software engineer.
|||No.
Compatibility is forward only, typically for two versions. A SQL 7.0 backup
will restore to 2000 and 2005, but not 2008 (forthcoming).
Geoff N. Hiten
Senior SQL Infrastructure Consultant
Microsoft SQL Server MVP
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:60AF58FA-67EE-4AF7-94A9-4AC5B3E34732@.microsoft.com...
> Hi,
> I was just wondering if you build a database in sql2005 and then save the
> file(backup dbase) would it work to perform a restore from this file with
> sql2000?
> thanks.
> --
> Paul G
> Software engineer.
|||Ok thanks for the information, I will use 2000 to build the dbase since we
are using both 2000 production/ 2005 testing(production in near future) .
Paul G
Software engineer.
"Geoff N. Hiten" wrote:
> No.
> Compatibility is forward only, typically for two versions. A SQL 7.0 backup
> will restore to 2000 and 2005, but not 2008 (forthcoming).
> --
> Geoff N. Hiten
> Senior SQL Infrastructure Consultant
> Microsoft SQL Server MVP
>
> "Paul" <Paul@.discussions.microsoft.com> wrote in message
> news:60AF58FA-67EE-4AF7-94A9-4AC5B3E34732@.microsoft.com...
>
|||oops, someone asked the same question just a few posts earlier!
Paul G
Software engineer.
"Paul" wrote:
[vbcol=seagreen]
> Ok thanks for the information, I will use 2000 to build the dbase since we
> are using both 2000 production/ 2005 testing(production in near future) .
> --
> Paul G
> Software engineer.
>
> "Geoff N. Hiten" wrote:
Wednesday, March 7, 2012
backups and restore DB in SQL EXPRESS 2005
The sql express instance and my web aplication are running on the same server.
I need a script for directly execute it (and if possible also to restore the DB ) from my web aplication.
other question:
any idea how can i tell to sql express to do the backup automatically every day?
To backup SQL Server you either use a stored proc to do it or you use one of the best part of SQL Server called the backup and restore wizard to backup the database. To backup daily you need to schedule the backup with SQL Server Agent Job. To do all of the above you need the new Enterprise Manager called Management Studio but Express did not come with it so donwload the eval version from the link below it is good for 180 days install it as a named instance. Then right click at the top of the Management Studio and register the Express so you can use the Management Studio to do all of the above. Hope this helps.
http://www.microsoft.com/downloads/details.aspx?familyid=6931FA7F-C094-49A2-A050-2D07993566EC&displaylang=en
backups and restore
and also with Veritas. I need to do a test restore on a database and am
uncertain of the best way to go about it. Is it easier to restore from
Veritas or SQL backups? How do I do it without overwriting the existing
database? Any insights or help would be greatly appreciated.
Here is some info:
Windows 2003 Server
SQL 2000
Veritas 9.1
Thanks"NOBI" schrieb:
> I am backing up SQL databases two ways, once through the Enterprise Manage
r
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks
During the restore process you can define the name of the restored database.
There is no problem with overwriting the existing one (if you just choose a
different name). Don't forget to use the 'move ... to ...' option to give th
e
files a different location from the original!|||Hi Nobi,
You can use the RESTORE DATABASE command from query analyzer to restore the
database with a new name.
STEPS:-
1. Identify the logical name associated with MDf AND LDF using RESTORE
FILELISTONLY (see books online)
2. Use the RESTORE DATABASE command with MOVE options (see books online) to
create and restore the backupfile with new
database name. In the MOVE option for the physical name give a new name.
Thanks
Hari
SQL Server MVP
"NOBI" <NOBI@.discussions.microsoft.com> wrote in message
news:8AAA6DF0-3FCA-4F3B-9BFE-6FEA042E28EB@.microsoft.com...
>I am backing up SQL databases two ways, once through the Enterprise Manager
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks|||For full backups you shouldn't have any problems. But be carefull with
Transaction Log backups. If you run TLog backups from both sides (SQL Serve
r
and Veritas) it will be very difficult, almost impossible to restore a DB to
the Point of Failure. TLog backups have a sequence number used to know in
what order they have to be restored after the full backup. Running TLog
backups from both tools will assign a sequence number for every backup
created, then you will have something like this:
FULL BACKUP
SQLTLog(1)
SQLTLog(2)
VERITASTLog(3)
VERITASTLog(4)
SQLTLog(5)
VERITASTLog(6)
Restoring from Full Backup up to the point 6 would require SQL and VERITAS
TLogs. This can be very difficult to achieve depending on the frequency of
TLog backups.
Hope it helps
Lionel Chacon
"NOBI" wrote:
> I am backing up SQL databases two ways, once through the Enterprise Manage
r
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks
backups and restore
and also with Veritas. I need to do a test restore on a database and am
uncertain of the best way to go about it. Is it easier to restore from
Veritas or SQL backups? How do I do it without overwriting the existing
database? Any insights or help would be greatly appreciated.
Here is some info:
Windows 2003 Server
SQL 2000
Veritas 9.1
Thanks
"NOBI" schrieb:
> I am backing up SQL databases two ways, once through the Enterprise Manager
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks
During the restore process you can define the name of the restored database.
There is no problem with overwriting the existing one (if you just choose a
different name). Don't forget to use the 'move ... to ...' option to give the
files a different location from the original!
|||Hi Nobi,
You can use the RESTORE DATABASE command from query analyzer to restore the
database with a new name.
STEPS:-
1. Identify the logical name associated with MDf AND LDF using RESTORE
FILELISTONLY (see books online)
2. Use the RESTORE DATABASE command with MOVE options (see books online) to
create and restore the backupfile with new
database name. In the MOVE option for the physical name give a new name.
Thanks
Hari
SQL Server MVP
"NOBI" <NOBI@.discussions.microsoft.com> wrote in message
news:8AAA6DF0-3FCA-4F3B-9BFE-6FEA042E28EB@.microsoft.com...
>I am backing up SQL databases two ways, once through the Enterprise Manager
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks
|||For full backups you shouldn't have any problems. But be carefull with
Transaction Log backups. If you run TLog backups from both sides (SQL Server
and Veritas) it will be very difficult, almost impossible to restore a DB to
the Point of Failure. TLog backups have a sequence number used to know in
what order they have to be restored after the full backup. Running TLog
backups from both tools will assign a sequence number for every backup
created, then you will have something like this:
FULL BACKUP
SQLTLog(1)
SQLTLog(2)
VERITASTLog(3)
VERITASTLog(4)
SQLTLog(5)
VERITASTLog(6)
Restoring from Full Backup up to the point 6 would require SQL and VERITAS
TLogs. This can be very difficult to achieve depending on the frequency of
TLog backups.
Hope it helps
Lionel Chacon
"NOBI" wrote:
> I am backing up SQL databases two ways, once through the Enterprise Manager
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks
backups and restore
and also with Veritas. I need to do a test restore on a database and am
uncertain of the best way to go about it. Is it easier to restore from
Veritas or SQL backups? How do I do it without overwriting the existing
database? Any insights or help would be greatly appreciated.
Here is some info:
Windows 2003 Server
SQL 2000
Veritas 9.1
Thanks"NOBI" schrieb:
> I am backing up SQL databases two ways, once through the Enterprise Manager
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks
During the restore process you can define the name of the restored database.
There is no problem with overwriting the existing one (if you just choose a
different name). Don't forget to use the 'move ... to ...' option to give the
files a different location from the original!|||Hi Nobi,
You can use the RESTORE DATABASE command from query analyzer to restore the
database with a new name.
STEPS:-
1. Identify the logical name associated with MDf AND LDF using RESTORE
FILELISTONLY (see books online)
2. Use the RESTORE DATABASE command with MOVE options (see books online) to
create and restore the backupfile with new
database name. In the MOVE option for the physical name give a new name.
Thanks
Hari
SQL Server MVP
"NOBI" <NOBI@.discussions.microsoft.com> wrote in message
news:8AAA6DF0-3FCA-4F3B-9BFE-6FEA042E28EB@.microsoft.com...
>I am backing up SQL databases two ways, once through the Enterprise Manager
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks|||For full backups you shouldn't have any problems. But be carefull with
Transaction Log backups. If you run TLog backups from both sides (SQL Server
and Veritas) it will be very difficult, almost impossible to restore a DB to
the Point of Failure. TLog backups have a sequence number used to know in
what order they have to be restored after the full backup. Running TLog
backups from both tools will assign a sequence number for every backup
created, then you will have something like this:
FULL BACKUP
SQLTLog(1)
SQLTLog(2)
VERITASTLog(3)
VERITASTLog(4)
SQLTLog(5)
VERITASTLog(6)
Restoring from Full Backup up to the point 6 would require SQL and VERITAS
TLogs. This can be very difficult to achieve depending on the frequency of
TLog backups.
Hope it helps
Lionel Chacon
"NOBI" wrote:
> I am backing up SQL databases two ways, once through the Enterprise Manager
> and also with Veritas. I need to do a test restore on a database and am
> uncertain of the best way to go about it. Is it easier to restore from
> Veritas or SQL backups? How do I do it without overwriting the existing
> database? Any insights or help would be greatly appreciated.
> Here is some info:
> Windows 2003 Server
> SQL 2000
> Veritas 9.1
> Thanks
Saturday, February 25, 2012
Backups - 2000 -> 2005
Server 2005?
If not, is there some tool to convert a 2K DB to 2005?
Thanks."Don Miller" <nospam@.nospam.com> wrote in message
news:uyA8LekcGHA.4108@.TK2MSFTNGP03.phx.gbl...
> If I create a backup in SQL Server 2000 can I restore that database to SQL
> Server 2005?
Yes.
Note it's one way. You can't restore a 2005 backup to 2000.
> If not, is there some tool to convert a 2K DB to 2005?
> Thanks.
>|||Yes, you can restore a SQL Server 2000 backup to a 2005 server. You can also
detach from SQL Server 2000 and attach to 2005. However, you can not do the
same from SQL Server 2005 to 2000.
Ben Nevarez, MCDBA, OCP
Database Administrator
"Don Miller" wrote:
> If I create a backup in SQL Server 2000 can I restore that database to SQL
> Server 2005?
> If not, is there some tool to convert a 2K DB to 2005?
> Thanks.
>
>|||Thanks. That saved me an hour or two looking through BOL.
"Don Miller" <nospam@.nospam.com> wrote in message
news:uyA8LekcGHA.4108@.TK2MSFTNGP03.phx.gbl...
> If I create a backup in SQL Server 2000 can I restore that database to SQL
> Server 2005?
> If not, is there some tool to convert a 2K DB to 2005?
> Thanks.
>
Backups - 2000 -> 2005
Server 2005?
If not, is there some tool to convert a 2K DB to 2005?
Thanks."Don Miller" <nospam@.nospam.com> wrote in message
news:uyA8LekcGHA.4108@.TK2MSFTNGP03.phx.gbl...
> If I create a backup in SQL Server 2000 can I restore that database to SQL
> Server 2005?
Yes.
Note it's one way. You can't restore a 2005 backup to 2000.
> If not, is there some tool to convert a 2K DB to 2005?
> Thanks.
>|||Yes, you can restore a SQL Server 2000 backup to a 2005 server. You can also
detach from SQL Server 2000 and attach to 2005. However, you can not do the
same from SQL Server 2005 to 2000.
Ben Nevarez, MCDBA, OCP
Database Administrator
"Don Miller" wrote:
> If I create a backup in SQL Server 2000 can I restore that database to SQL
> Server 2005?
> If not, is there some tool to convert a 2K DB to 2005?
> Thanks.
>
>|||Thanks. That saved me an hour or two looking through BOL.
"Don Miller" <nospam@.nospam.com> wrote in message
news:uyA8LekcGHA.4108@.TK2MSFTNGP03.phx.gbl...
> If I create a backup in SQL Server 2000 can I restore that database to SQL
> Server 2005?
> If not, is there some tool to convert a 2K DB to 2005?
> Thanks.
>
Backups
basis. We do our backups using a Maintenance Plan. The name of the backup
file is different every night as the backups of each db run at different
times. Is there a way to fix the name of the backup files so they don't
have a time element in the name? Is there a way to discover the name that
was used last?
Barry
Set up a job to do the backup with T-SQL instead of using the maint plan.
<barryfz@.home.com> wrote in message
news:%23neDZcOnEHA.4004@.TK2MSFTNGP10.phx.gbl...
> I need to restore a backup dbs from one SQL Server to another on a nightly
> basis. We do our backups using a Maintenance Plan. The name of the backup
> file is different every night as the backups of each db run at different
> times. Is there a way to fix the name of the backup files so they don't
> have a time element in the name? Is there a way to discover the name that
> was used last?
> Barry
>
|||I had to do this for a file that was being sent through a firewall every
night via FTP. So I dynamically created the ftp script every night.
In your situation then in DOS do something like this
Create a batch file
SETLOCAL
SET File_Name=
FOR /F "usebackq" %%x IN (`dir *.txt /b /od`) DO SET FILE_NAME=%%x
IF {%File_Name%}={} exit 1
COPY %File_Name% Z:\SomeFolderNamedWhatEveryYouLike
ENDLOCAL
The for loop is the interesting bit, it simply lists every txt file in
date order and assigns the name to a variable File_Name. The only issue
is for every txt file the variable is changed, so if there are 100 files
the loop goes around 100 times before it finds the correct name
Adrian
barryfz@.home.com wrote:
> I need to restore a backup dbs from one SQL Server to another on a nightly
> basis. We do our backups using a Maintenance Plan. The name of the backup
> file is different every night as the backups of each db run at different
> times. Is there a way to fix the name of the backup files so they don't
> have a time element in the name? Is there a way to discover the name that
> was used last?
> Barry
>
|||Hi Barry,
As community members had provided sufficient information about the way of
backup, I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. We appreciate
your patience and look forward to hearing from you!
Sincerely yours,
Mingqing Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
Backups
basis. We do our backups using a Maintenance Plan. The name of the backup
file is different every night as the backups of each db run at different
times. Is there a way to fix the name of the backup files so they don't
have a time element in the name? Is there a way to discover the name that
was used last?
BarrySet up a job to do the backup with T-SQL instead of using the maint plan.
<barryfz@.home.com> wrote in message
news:%23neDZcOnEHA.4004@.TK2MSFTNGP10.phx.gbl...
> I need to restore a backup dbs from one SQL Server to another on a nightly
> basis. We do our backups using a Maintenance Plan. The name of the backup
> file is different every night as the backups of each db run at different
> times. Is there a way to fix the name of the backup files so they don't
> have a time element in the name? Is there a way to discover the name that
> was used last?
> Barry
>|||The following is a TSQL command that will perform a full
database backup to the file specified in the DISK=parameter. You can schedule this backup in SQL Server
Agent.
Backup Database DataBaseName to
DISK='\\Server\ShareName\DataBaseName_Data.BAK' with
RetainDays=1, INIT, Description='Daily Backup Routine'
This is just a direction for you to take your research.
Test this process as well as your restore procedures
prior to putting this into production.
Good luck,
D2
>--Original Message--
>I need to restore a backup dbs from one SQL Server to
another on a nightly
>basis. We do our backups using a Maintenance Plan. The
name of the backup
>file is different every night as the backups of each db
run at different
>times. Is there a way to fix the name of the backup
files so they don't
>have a time element in the name? Is there a way to
discover the name that
>was used last?
>Barry
>
>.
>|||I had to do this for a file that was being sent through a firewall every
night via FTP. So I dynamically created the ftp script every night.
In your situation then in DOS do something like this
Create a batch file
SETLOCAL
SET File_Name=FOR /F "usebackq" %%x IN (`dir *.txt /b /od`) DO SET FILE_NAME=%%x
IF {%File_Name%}={} exit 1
COPY %File_Name% Z:\SomeFolderNamedWhatEveryYouLike
ENDLOCAL
The for loop is the interesting bit, it simply lists every txt file in
date order and assigns the name to a variable File_Name. The only issue
is for every txt file the variable is changed, so if there are 100 files
the loop goes around 100 times before it finds the correct name
Adrian
barryfz@.home.com wrote:
> I need to restore a backup dbs from one SQL Server to another on a nightly
> basis. We do our backups using a Maintenance Plan. The name of the backup
> file is different every night as the backups of each db run at different
> times. Is there a way to fix the name of the backup files so they don't
> have a time element in the name? Is there a way to discover the name that
> was used last?
> Barry
>|||Hi Barry,
As community members had provided sufficient information about the way of
backup, I wanted to post a quick note to see if you would like additional
assistance or information regarding this particular issue. We appreciate
your patience and look forward to hearing from you!
Sincerely yours,
Mingqing Cheng
Online Partner Support Specialist
Partner Support Group
Microsoft Global Technical Support Center
---
Introduction to Yukon! - http://www.microsoft.com/sql/yukon
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks!
Friday, February 24, 2012
backupRestore progress bar
My app uses MSDE and I have created a UI for user which has buttons to backup and restore the database. Everything works fine but I want to give a visual display to user about the progress of the operation. You know like a progress bar indicating how mu
ch work is done.. so the question is:
Is there a way to find out how much time backup/restore will take.. does sql server provide any such event to us telling this information. I just want to trap this event and give the progress indication to my loyal users.
Thanks all.
dev
Thanks Andrea for the reply. I am using T-SQL commands right now to backup and restore database. If I use sql-dmo to trap progress event then would that mean that I will have to change the backup/restore sourcecode also to use sql-dmo. Please confirm.
Thanks
|||hi,
"dev" <anonymous@.discussions.microsoft.com> ha scritto nel messaggio
news:8CD41CBC-6EF7-46F8-BC3C-3415F14A6BD5@.microsoft.com...
> Thanks Andrea for the reply. I am using T-SQL commands right now to
backup
>and restore database. If I use sql-dmo to trap progress event then would
that
>mean that I will have to change the backup/restore sourcecode also to use
>sql-dmo. Please confirm.
yep.. you have to use the SQL-DMO backup object to trap the raised events...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||oh no.. so what is this sql-dmo. What is the purpose of it's existance. Why do we need it (besides for the progress bar). How is it different from programming with T-SQL. How can we choose which way to go, T-SQL or SQL-DMO. What are it's advantages an
d disadvantages.
Thanks
|||Also was it unwise of me to opt for T-SQL for doing everything instead of going for DMO. And is it ok to use DMO for backup/restore and use T-SQL for everything else. What are your recommendations.
We are as before an ISV, app will be deployed using MSDE, will have max a couple of databases. Will provide an interface to the user to backup and restore database. Will creare database from app and do version checks for database.
What should we do... or should we wait for SMO..
Thanks for your valuable time.
|||hi,
"dev" <anonymous@.discussions.microsoft.com> ha scritto nel messaggio
news:07DA4684-529D-48D5-9D6A-56DDFDB077A7@.microsoft.com...
> oh no.. so what is this sql-dmo. What is the purpose of it's existance.
Why do we need it
>(besides for the progress bar). How is it different from programming with
T-SQL. How can
> we choose which way to go, T-SQL or SQL-DMO. What are it's advantages and
disadvantages.
> Thanks
SQL-DMO is an acronym for SQL Distributed Management Object and is a full
object model to manage and administer SQL Server..
it exposes a nice object model you can navigate to perform quiet all
management tasks on SQL Server..
it's not designed for data manipulation even if it provides some features
to.
it comes with MSDE and/or can be installed from the Client Tools
installation package of SQL Server.
it is not provided as a separate download and/or package, so you have to
depoly it yourself in MSDE scenarios (you are legitimate to) ... this can be
count as a disadvantage too :-)
it's a little buggy =;-) and eats a lot of memory, but is very handy for
some admin scenario...
Transact-SQL, on the contrary, is the language SQL Server better understand,
and can perform both data manipulation and administration tasks... it's a
separate language where DMO is just a COM object model you can use in any
COM compliant client, so they can not be compared... you shoul'd stick with
Transact-SQL, and use DMO where and when appropriated...
by the way... there's only 1 book worth reading about SQL-DMO, by SQL Server
MVPs Allan Mitchell and Mark Allison,
http://www.compman.co.uk/cgi-win/browse.exe?ref=552118 , which I personally
recommend reading...
FWIW, you can have a look at a free prj of mine at the link following my
sign to have an idea aboout what you can do with SQL-DMO, a prj that
provides a user interface similar to Enteprise Manager written in VB6
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||hi,
"dev" <anonymous@.discussions.microsoft.com> ha scritto nel messaggio
news:AF907AC5-9610-41F9-95DD-FC68828844F6@.microsoft.com...
> Also was it unwise of me to opt for T-SQL for doing everything instead of
going for DMO.
>And is it ok to use DMO for backup/restore and use T-SQL for everything
else. What are your
>recommendations.
> We are as before an ISV, app will be deployed using MSDE, will have max a
couple of
>databases. Will provide an interface to the user to backup and restore
database.
>Will creare database from app and do version checks for database.
> What should we do... or should we wait for SMO..
if you only need DMO for presenting a progress bar indicating backup
progress, let it be...
you have to talk to SQL Server via Transact-SQL...
perform backup via ADO.Net commands...
SMO will be only available wit SQL Server 2005, and anyway I don't think it
shoul'd be used for traditional programming, but for the same things now
covered by DMO...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Thanks Andrea for the insight. I already use your tool since quiet some time and appreciate it. So do you recommend I use T-SQL for everything as now, you know db creation, data manipulation and use dmo for backup/restore which I can later port to use s
mo when yukon arrives..
dev
|||I am sorry Andrea but I didn't understand what you said here:
"if you only need DMO for presenting a progress bar indicating backup
progress, let it be...
you have to talk to SQL Server via Transact-SQL...
perform backup via ADO.Net commands..."
Do you mean that I use T-SQL for everything else and just use DMO for the backup/restore.
Sorry to bother you like this but Thanks
|||hi,
"dev" <anonymous@.discussions.microsoft.com> ha scritto nel messaggio
news:778938C6-1142-4954-B633-BBF0669342D3@.microsoft.com...
> I am sorry Andrea but I didn't understand what you said here:
> "if you only need DMO for presenting a progress bar indicating backup
> progress, let it be...
> you have to talk to SQL Server via Transact-SQL...
> perform backup via ADO.Net commands..."
> Do you mean that I use T-SQL for everything else and just use DMO for the
backup/restore.
> Sorry to bother you like this but Thanks
please excuse my poor english...
what I mean is go with Transact-SQL for all you stuffs, including
Backup/Restore, if you only need SQL-DMO for providing a progress
indicator...
if you need SQL-DMO for other things, then you can consider adding it to
your project references [and setup package :-( ]
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
Backup-Restore on Encrypted Columns
encryption. What happens when I backup and restore this database on another
server? Does SQL Server have to re-encrypt these columns on this new
server? The Master Key is different on the new server, right?
--IKEThe Service Master Key is different, yes. The Database Master Key and all
other keys in the database were carried over with your data.
So the only thing that you may need to do is to re-encrypt the Database
Master Key with the Service Master Key of the new server, if you had such SM
K
encryption on the old server as well. To do this, you need to do the
following steps while connected to the database:
-- open the database master key
OPEN MASTER KEY DECRYPTION BY PASSWORD = 'whatever_password'
-- re-encrypt with the current server's SMK
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY
For more info about these statements, see:
http://msdn2.microsoft.com/en-us/library/ms130214.aspx
http://msdn2.microsoft.com/en-us/library/ms186937.aspx
This scenario was also discussed here:
http://blogs.msdn.com/lcris/archive.../30/475822.aspx
Thanks
Laurentiu Cristofor [MSFT]
Software Design Engineer
SQL Server Engine
http://blogs.msdn.com/lcris/
This posting is provided "AS IS" with no warranties, and confers no rights.
"Ike the Potato" wrote:
> I have some columns that are encrypted using SQL Server 2005 built in
> encryption. What happens when I backup and restore this database on anoth
er
> server? Does SQL Server have to re-encrypt these columns on this new
> server? The Master Key is different on the new server, right?
> --IKE
>
>
BackupIoRequest::WaitForIoCompletion failure when restoring database
I have MS SQL 200 Server Developer Edition Installed from MSDN collection. (New installation with service pack 2). When I try to restore 7GB or bigger database, following error occurs in eventlog:
Source: MSSQLSERVER
Category: (6)
ID: 18210
Date: 11.9.2007
Time: 14:50:09
Description:
BackupIoRequest::WaitForIoCompletion: write failure on backup device ''. Operating system error 1450(here is message in local language like "here is no resources to complete requested service").
But I am not writting to backup device, I am restoring. Thank for any helpful answer.
Not sure about the cause of the error.. Check if its related to this KB : http://support.microsoft.com/default.aspx?scid=kb;en-us;304101
|||Thank you, dinakar.
KB howto i tried, but with no success.
backup\restore password?
restoring databases?
Like this:
1. Create db backup job
2. set pwd
3. restore db, by specifying the pwd set in step 2
Please, if possible, show me a screen shot.
Thanks!
MagnusYou can't do it through Enterprise Manager. You need to use
T-SQL backup, restore commands. Or use SQL-DMO which also
exposes the password property through the Backup2 object
(MediaPassword property).
-Sue
On Tue, 2 May 2006 15:57:37 +0300, "Magnus sterberg"
<magnus_osterberg@.hotmail.com> wrote:
>How and where in the GUI (Enterprise Manager) can I specify a password for
>restoring databases?
>Like this:
>1. Create db backup job
>2. set pwd
>3. restore db, by specifying the pwd set in step 2
>Please, if possible, show me a screen shot.
>Thanks!
>Magnus
>|||In QA, you can make a T-SQL using password.
BACKUP DATABASE Northwind TO MyNwind_1
WITH PASSWORD='password'
RESTORE DATABASE MyNwind FROM MyNwind_1
WITH PASSWORD='password'
"Magnus ?sterberg"?? ??? ??:
> How and where in the GUI (Enterprise Manager) can I specify a password for
> restoring databases?
> Like this:
> 1. Create db backup job
> 2. set pwd
> 3. restore db, by specifying the pwd set in step 2
> Please, if possible, show me a screen shot.
> Thanks!
> Magnus
>
>|||OK, now I found out how to add this to my SQL Server Agent backup job. But..
.the pwd is stored as a part of the SQL statement in plain text. Any sa-user
can easily check up the pwd by opening the job.
Mayby one can also schedule the job by T-SQL? As in:
BACKUP DATABASE [ABC_XZY] TO DISK = N'C:\ABCDB_BACKUPS\ABC_XZY' WITH I
NIT , NOUNLOAD , NAME = N'ABC_XZY', NOSKIP , STATS = 10, NOFORMAT, PASS
WORD='sjkf7wed8', SCHEDULE=daily, 21:00
...sounds a bit far-fetched. But my idea is that I could execute the T-SQL
statement once, which should store the job in the DBMSS, without allowing an
yone to see the pwd. Possible?
Mayby I have to take care of the scheduling myself?
Magnus
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message news:fjre5254k8q0e06t68tnmrhthsigu70
57u@.4ax.com...
> You can't do it through Enterprise Manager. You need to use
> T-SQL backup, restore commands. Or use SQL-DMO which also
> exposes the password property through the Backup2 object
> (MediaPassword property).
>
> -Sue
>
> On Tue, 2 May 2006 15:57:37 +0300, "Magnus sterberg"
> <magnus_osterberg@.hotmail.com> wrote:
>
>|||anyone got an answer to this one'
"Magnus sterberg" <magnus_osterberg@.hotmail.com> wrote in message news:u2XH
eGobGHA.4040@.TK2MSFTNGP02.phx.gbl...
OK, now I found out how to add this to my SQL Server Agent backup job. But..
.the pwd is stored as a part of the SQL statement in plain text. Any sa-user
can easily check up the pwd by opening the job.
Mayby one can also schedule the job by T-SQL? As in:
BACKUP DATABASE [ABC_XZY] TO DISK = N'C:\ABCDB_BACKUPS\ABC_XZY' WITH I
NIT , NOUNLOAD , NAME = N'ABC_XZY', NOSKIP , STATS = 10, NOFORMAT, PASS
WORD='sjkf7wed8', SCHEDULE=daily, 21:00
..sounds a bit far-fetched. But my idea is that I could execute the T-SQL s
tatement once, which should store the job in the DBMSS, without allowing any
one to see the pwd. Possible?
Mayby I have to take care of the scheduling myself?
Magnus
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message news:fjre5254k8q0e06t68tnmrhthsigu70
57u@.4ax.com...
> You can't do it through Enterprise Manager. You need to use
> T-SQL backup, restore commands. Or use SQL-DMO which also
> exposes the password property through the Backup2 object
> (MediaPassword property).
>
> -Sue
>
> On Tue, 2 May 2006 15:57:37 +0300, "Magnus sterberg"
> <magnus_osterberg@.hotmail.com> wrote:
>
>|||Can't do that. Even if you could execute a statement once and have it
lie dormant inside the DBMS somehow, a sysadmin can still look in the
proc cache and see SQL statements & also at the current processes to see
what statements are running (including any sensitive information
included in the statement batch).
The closest you could come to that with pure SQL (and not some 3rd party
tool) would be to write a stored proc that contains an infinite WHILE
loop (eg. "WHILE 1=1") and in the loop you'd have the backup statement
and a "WAITFOR TIME '2:00:00'" statement (see BOL), which would put the
thread to sleep until 2am for example at which time the thread would
wake up, do the backup, loop and go to sleep again. Then you'd get SQL
Server to run the proc on start up (see sp_procoption in BOL) and you
could create the proc with the WITH ENCRYPTION option to make it a
little harder to see the password embedded in the proc. However, a
sysadmin would still be able to see that T-SQL code by querying the
appropriate system metadata (proc cache and/or current processes).
What's the point of password protecting a backup so that the sysadmins
on the box cannot restore that database when they can see the real
online live version of the DB anyway? Seems like not a very credible
situation. Why would you make a login a sysadmin if they're not allowed
to see the data in one of the databases? Isn't that the point of NDAs
(non-disclosure agreements) for DBAs?
*mike hodgson*
http://sqlnerd.blogspot.com
Magnus sterberg wrote:
> anyone got an answer to this one'
>
> "Magnus sterberg" <magnus_osterberg@.hotmail.com
> <mailto:magnus_osterberg@.hotmail.com>> wrote in message
> news:u2XHeGobGHA.4040@.TK2MSFTNGP02.phx.gbl...
> OK, now I found out how to add this to my SQL Server Agent backup
> job. But...the pwd is stored as a part of the SQL statement in
> plain text. Any sa-user can easily check up the pwd by opening the
> job.
> Mayby one can also schedule the job by T-SQL? As in:
> BACKUP DATABASE [ABC_XZY] TO DISK = N'C:\ABCDB_BACKUPS\ABC_XZY'
> WITH INIT , NOUNLOAD , NAME = N'ABC_XZY', NOSKIP , STATS =
> 10, NOFORMAT, PASSWORD='sjkf7wed8', *SCHEDULE=daily, 21:00*
> **
> ...sounds a bit far-fetched. But my idea is that I could execute
> the T-SQL statement once, which should store the job in the DBMSS,
> without allowing anyone to see the pwd. Possible?
> Mayby I have to take care of the scheduling myself?
>
> Magnus
> "Sue Hoegemeier" <Sue_H@.nomail.please
> <mailto:Sue_H@.nomail.please>> wrote in message
> news:fjre5254k8q0e06t68tnmrhthsigu7057u@.
4ax.com...
> <mailto:magnus_osterberg@.hotmail.com>> wrote:
> password for
>
Backup\Restore Best Method?
I currently have a SQL 2000 server with around five small databases. I wish to have a full backup of each database every night. Currently I use the Database Maintenance Plan to backup the databases and logs to the C: drive of the server from where they can be picked up by backup software. Previously I used the backup wizard, but found it wasn't backing up the logs, would that cause a problem?
My two questions are ( I am new to SQL)
1 - How come the database only backsup 6.5 MB, when in explorer the database file is 46MB? Is it working correctly?
2- Using the above method, if I only backup the database each night, would this be enough to roll back. Say a user deletes a table and I want to restore back to yesterdays database, can I simply restore over the current mdf?
Thanks in advance.(1) Backups are compressed files and they only backup the actual data within your databases. Meaning if you have a 50mb database and only 30 mb is used, it will only backup the 30mb of data resulting in a backup file smaller than 30mb
(2) If your company does transactions all day long and someone deletes a table (like you said) at 5:00 PM. Would it be acceptable to restore to yesterdays backup losing all transactions for an entire day? If it is, you better make sure management is OK with this before it happens :)
The alternative is to run transaction log backups throughout the day so you could restore up to a point in time.
HTH|||Originally posted by rhigdon
(1) Backups are compressed files and they only backup the actual data within your databases. Meaning if you have a 50mb database and only 30 mb is used, it will only backup the 30mb of data resulting in a backup file smaller than 30mb
(2) If your company does transactions all day long and someone deletes a table (like you said) at 5:00 PM. Would it be acceptable to restore to yesterdays backup losing all transactions for an entire day? If it is, you better make sure management is OK with this before it happens :)
The alternative is to run transaction log backups throughout the day so you could restore up to a point in time.
HTH
What's your recovery model set to?
And no. You can not recover a single table from a dump or log.
You'd have to restore the entire database and then recover.|||The standard way to restore a table is to restore the database to a test database and then transfer over the deleted table. Or, you can use third party tools such as Lumigent's Log Explorer that allows you to reverse DDL commands.
HTH
Backup/Restore: Restoring to new server without rerunning a snapshot
I am designing a solution that utilizes replication from a front-end database to a back-end database. Historical data will be truncated from the front-end database in such a way that these truncation deletes will not be replicated - thus, the back-end database acts as a historical archive for the front-end database.
I am concerned about backup and restore scenarios for this environment.
Once we have begun truncating data from the front-end database, we will never be able to re-snapshot the database to rebuild the back-end database.
My concern comes if the servers are destroyed and the environment must be rebuilt. For SQL Server 2000, Books Online says:
"When you restore a backup of a replicated database to a server or database other than the one on which it was created, your replication settings cannot be preserved. For publishing databases and merge subscribing databases, a full restore of the database and logs is followed by an automatic removal of replication meta data from the database when the database or server you restore to differs from the one on which the backup was created."
Books Online for SQL Server 2005 has a similar statement. Does this mean that I would be unable to restore my front-end and back-end databases, and reestablish replication without taking a new snapshot? Does SQL 2005 provide any advantages for disaster recovery given this scenario? Does restoring with the KEEP_REPLICATION option override the behavior specified in the above BOL quote?
That isn't correct. You can restore a backup without preserving replication settings and then reconfigure replication in that environment. You would not want to issue a snapshot, so you would simply tell the replication engine that the subscriber already has the schema and data.
Now, there are two different behavior paths. With SQL Server 2000, you would tell it that the subscriber already has the schema and data "nosynch" and a subscription would be created, but changes would fail, because you would have to manually create the replication stored procedures that are called on the subscriber. But, once created, all of the data would flow normally.
With SQL Server 2005, you create the subscription with replication support only. This would not cause a snapshot to be sent to the subscriber, but it would create all of the necessary replication objects.
|||Hello,
I have read your comments about restoring backup in a diferent server. This is my case and I am really desesperated becuase I am totally unable to do it . I only have a backup from the old server and I have no idea about scripts procedures or programming I am only trying from the SQL SERVER Enterprise Manager. Please let me know if it does really exist the posibility.
Thanks a lot
Carlos
|||did you found any solution for this?Backup/Restore: Restoring to new server without rerunning a snapshot
I am designing a solution that utilizes replication from a front-end database to a back-end database. Historical data will be truncated from the front-end database in such a way that these truncation deletes will not be replicated - thus, the back-end database acts as a historical archive for the front-end database.
I am concerned about backup and restore scenarios for this environment.
Once we have begun truncating data from the front-end database, we will never be able to re-snapshot the database to rebuild the back-end database.
My concern comes if the servers are destroyed and the environment must be rebuilt. For SQL Server 2000, Books Online says:
"When you restore a backup of a replicated database to a server or database other than the one on which it was created, your replication settings cannot be preserved. For publishing databases and merge subscribing databases, a full restore of the database and logs is followed by an automatic removal of replication meta data from the database when the database or server you restore to differs from the one on which the backup was created."
Books Online for SQL Server 2005 has a similar statement. Does this mean that I would be unable to restore my front-end and back-end databases, and reestablish replication without taking a new snapshot? Does SQL 2005 provide any advantages for disaster recovery given this scenario? Does restoring with the KEEP_REPLICATION option override the behavior specified in the above BOL quote?
That isn't correct. You can restore a backup without preserving replication settings and then reconfigure replication in that environment. You would not want to issue a snapshot, so you would simply tell the replication engine that the subscriber already has the schema and data.
Now, there are two different behavior paths. With SQL Server 2000, you would tell it that the subscriber already has the schema and data "nosynch" and a subscription would be created, but changes would fail, because you would have to manually create the replication stored procedures that are called on the subscriber. But, once created, all of the data would flow normally.
With SQL Server 2005, you create the subscription with replication support only. This would not cause a snapshot to be sent to the subscriber, but it would create all of the necessary replication objects.
|||Hello,
I have read your comments about restoring backup in a diferent server. This is my case and I am really desesperated becuase I am totally unable to do it . I only have a backup from the old server and I have no idea about scripts procedures or programming I am only trying from the SQL SERVER Enterprise Manager. Please let me know if it does really exist the posibility.
Thanks a lot
Carlos
Backup/Restore vs Detach/Attach 2000 Databases to 2005
backup and detach a database from SQL Server 2000 SP3 and then attach and
restore it to SQL Server 2005 SP1.
The differences I noticed are:
1. The restored database has a much larger initial size (database size is
same) for data and log.
2. The attached database has a last backup date
3. If the backup is restored over a database, the restored database is
showing owned by the database owner of the database restored over but
syslogins and sysusers do not match.
I don't understand why #1 happens.
Are there any other differences between Backup/Restore and Attach/Detach?
Thanks,
PeterMy best guess on #1 would be that the database size was increased because
the database was upgraded to 2005 and so the file expanded to accomidate the
necessary operations. Or because additional objects were added (system sp's,
tables or views) which are part of the 2005 functionality.
"Peter" <Peter@.discussions.microsoft.com> wrote in message
news:BDCA44DC-CAD7-4A14-8E9B-3D492C3D6B20@.microsoft.com...
> I'm trying to see the differences between Backup/Restore and
> Attach/Detach. I
> backup and detach a database from SQL Server 2000 SP3 and then attach and
> restore it to SQL Server 2005 SP1.
> The differences I noticed are:
> 1. The restored database has a much larger initial size (database size is
> same) for data and log.
> 2. The attached database has a last backup date
> 3. If the backup is restored over a database, the restored database is
> showing owned by the database owner of the database restored over but
> syslogins and sysusers do not match.
> I don't understand why #1 happens.
> Are there any other differences between Backup/Restore and Attach/Detach?
>
> Thanks,
> Peter
>|||Hi Mark,
If your guess is correct, should it happen to both cases: restored database
and attached database not just restored database.
Peter
"Mark Miller" wrote:
> My best guess on #1 would be that the database size was increased because
> the database was upgraded to 2005 and so the file expanded to accomidate the
> necessary operations. Or because additional objects were added (system sp's,
> tables or views) which are part of the 2005 functionality.
> "Peter" <Peter@.discussions.microsoft.com> wrote in message
> news:BDCA44DC-CAD7-4A14-8E9B-3D492C3D6B20@.microsoft.com...
> > I'm trying to see the differences between Backup/Restore and
> > Attach/Detach. I
> > backup and detach a database from SQL Server 2000 SP3 and then attach and
> > restore it to SQL Server 2005 SP1.
> >
> > The differences I noticed are:
> >
> > 1. The restored database has a much larger initial size (database size is
> > same) for data and log.
> > 2. The attached database has a last backup date
> > 3. If the backup is restored over a database, the restored database is
> > showing owned by the database owner of the database restored over but
> > syslogins and sysusers do not match.
> >
> > I don't understand why #1 happens.
> >
> > Are there any other differences between Backup/Restore and Attach/Detach?
> >
> >
> >
> > Thanks,
> >
> > Peter
> >
>
>