sql server programming:
I am having trouble restoring a trans log from mone database to another. I am getting the following error: Server: Msg 3135, Level 16, State 2, Line 1 The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP LOG and cannot be used for this restore operation. Server: Msg 3013, Level 16, State 1, Line 1 RESTORE DATABASE is terminating abnormally. Any idea why a backup of one database to another will not restore.
You can not restore the transaction log backup to a different database. The steps to restore a log is:- 1. Restore the Full database backup with NORECOVERY 2. Restore the Transaction log backups in sequence of log backup order. Do not use RECOVERY if you need to apply more transaction log backups. 3. While restoring the Last log backup if you need to make the database operational give "RECOVERY" Thanks Hari [quoted text, click to view] "DBA" <DBA@discussions.microsoft.com> wrote in message news:8AA0B507-B91E-42A8-88F1-199475D0E202@microsoft.com... >I am having trouble restoring a trans log from mone database to another. I >am > getting the following error: > Server: Msg 3135, Level 16, State 2, Line 1 > The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP > LOG and cannot be used for this restore operation. > Server: Msg 3013, Level 16, State 1, Line 1 > RESTORE DATABASE is terminating abnormally. > > Any idea why a backup of one database to another will not restore. > > They are both set to FULL
DBA Can you post a whole script that you did? [quoted text, click to view] "DBA" <DBA@discussions.microsoft.com> wrote in message news:8AA0B507-B91E-42A8-88F1-199475D0E202@microsoft.com... >I am having trouble restoring a trans log from mone database to another. I >am > getting the following error: > Server: Msg 3135, Level 16, State 2, Line 1 > The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP > LOG and cannot be used for this restore operation. > Server: Msg 3013, Level 16, State 1, Line 1 > RESTORE DATABASE is terminating abnormally. > > Any idea why a backup of one database to another will not restore. > > They are both set to FULL
It seems you are trying to restore a transaction log backup using the RESTORE DATABASE command. Try RESTORE LOG instead. -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi [quoted text, click to view] "DBA" <DBA@discussions.microsoft.com> wrote in message news:8AA0B507-B91E-42A8-88F1-199475D0E202@microsoft.com... >I am having trouble restoring a trans log from mone database to another. I am > getting the following error: > Server: Msg 3135, Level 16, State 2, Line 1 > The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP > LOG and cannot be used for this restore operation. > Server: Msg 3013, Level 16, State 1, Line 1 > RESTORE DATABASE is terminating abnormally. > > Any idea why a backup of one database to another will not restore. > > They are both set to FULL
so then backup the database and tell it just to restore the log? [quoted text, click to view] "Tibor Karaszi" wrote: > It seems you are trying to restore a transaction log backup using the RESTORE DATABASE command. Try > RESTORE LOG instead. > > -- > Tibor Karaszi, SQL Server MVP > http://www.karaszi.com/sqlserver/default.asp > http://sqlblog.com/blogs/tibor_karaszi > > > "DBA" <DBA@discussions.microsoft.com> wrote in message > news:8AA0B507-B91E-42A8-88F1-199475D0E202@microsoft.com... > >I am having trouble restoring a trans log from mone database to another. I am > > getting the following error: > > Server: Msg 3135, Level 16, State 2, Line 1 > > The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP > > LOG and cannot be used for this restore operation. > > Server: Msg 3013, Level 16, State 1, Line 1 > > RESTORE DATABASE is terminating abnormally. > > > > Any idea why a backup of one database to another will not restore. > > > > They are both set to FULL >
[quoted text, click to view] On Feb 24, 9:55 pm, DBA <D...@discussions.microsoft.com> wrote: > I am having trouble restoring a trans log from mone database to another. I am > getting the following error: > Server: Msg 3135, Level 16, State 2, Line 1 > The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP > LOG and cannot be used for this restore operation. > Server: Msg 3013, Level 16, State 1, Line 1 > RESTORE DATABASE is terminating abnormally. > > Any idea why a backup of one database to another will not restore. > > They are both set to FULL
You don't use RESTORE DATABASE to restore a log backup, you use RESTORE LOG. What exactly are you trying to do?
What I want to do is backup a log file from one database, and restore the log to another database of the same name on a different server [quoted text, click to view] "Tracy McKibben" wrote: > On Feb 24, 9:55 pm, DBA <D...@discussions.microsoft.com> wrote: > > I am having trouble restoring a trans log from mone database to another. I am > > getting the following error: > > Server: Msg 3135, Level 16, State 2, Line 1 > > The backup set in file 't:\formbkp\SRE0223TRANS.trn' was created by BACKUP > > LOG and cannot be used for this restore operation. > > Server: Msg 3013, Level 16, State 1, Line 1 > > RESTORE DATABASE is terminating abnormally. > > > > Any idea why a backup of one database to another will not restore. > > > > They are both set to FULL > > You don't use RESTORE DATABASE to restore a log backup, you use > RESTORE LOG. What exactly are you trying to do? >
[quoted text, click to view] On Feb 26, 12:23 pm, DBA <D...@discussions.microsoft.com> wrote: > What I want to do is backup a log file from one database, and restore the log > to another database of the same name on a different server >
You can't do that - the transaction log is "tied" to the database file to which it belongs.
What if the database file is the same name [quoted text, click to view] "Tracy McKibben" wrote: > On Feb 26, 12:23 pm, DBA <D...@discussions.microsoft.com> wrote: > > What I want to do is backup a log file from one database, and restore the log > > to another database of the same name on a different server > > > > You can't do that - the transaction log is "tied" to the database file > to which it belongs. >
[quoted text, click to view] On Feb 26, 12:47 pm, DBA <D...@discussions.microsoft.com> wrote: > What if the database file is the same name >
Doesn't matter, the connection between them isn't based on filenames. What is the overall problem you're trying to solve? Why are you trying to do this?
I have two databases that have the same name on two different servers. one is live and the other is in a test env. what I would like to do is without changing the schema of the test database restore the transactions log from the live env to the test env database [quoted text, click to view] "Tracy McKibben" wrote: > On Feb 26, 12:47 pm, DBA <D...@discussions.microsoft.com> wrote: > > What if the database file is the same name > > > > Doesn't matter, the connection between them isn't based on filenames. > What is the overall problem you're trying to solve? Why are you > trying to do this? >
[quoted text, click to view] On Feb 26, 1:10 pm, DBA <D...@discussions.microsoft.com> wrote: > I have two databases that have the same name on two different servers. one is > live and the other is in a test env. what I would like to do is without > changing the schema of the test database restore the transactions log from > the live env to the test env database >
Again, the name has nothing to do with it. The transaction log is a "journal" that keeps track of data pages that have changed within the database file. You can't simply "replay" the log from one database into another database, which it sounds like you are wanting to do.
I am trying to run the transactions from one database to another. Is there another way? [quoted text, click to view] "Tracy McKibben" wrote: > On Feb 26, 1:10 pm, DBA <D...@discussions.microsoft.com> wrote: > > I have two databases that have the same name on two different servers. one is > > live and the other is in a test env. what I would like to do is without > > changing the schema of the test database restore the transactions log from > > the live env to the test env database > > > > Again, the name has nothing to do with it. The transaction log is a > "journal" that keeps track of data pages that have changed within the > database file. You can't simply "replay" the log from one database > into another database, which it sounds like you are wanting to do. >
[quoted text, click to view] On Feb 26, 1:57 pm, DBA <D...@discussions.microsoft.com> wrote: > I am trying to run the transactions from one database to another. Is there > another way? >
If you start with identical copies of the database, you can setup log shipping between the two. You MUST start by restoring a full backup of the source database. You cannot just restore a log backup to another database.
Don't see what you're looking for? Try a search.
|