Saturday, February 25, 2012

change status for standby database

I know i can recover a standby database by restoring the same with recovery
option
I want to try out something and want to know which system table all this
gets recorded so that instead of restoring the database with recovery
option, can I just update a column in a system table to have it recovered. I
tried to change the status column in sysdatabases but that didnt seem to do
it. It just took the status away from within EM that states its a read only
to have nothing displayed and make it look like its available but upon
modifying tables it still gave me an error message that the database is in
load state or something of that sort.
Does anyone know what else I need to update ?You don't need to execute the enture restore again to change the status.
You can issue a RESTORE from Query Analyzer with only the RECOVERY option
(omitting the FROM clause).
RESTORE DATABASE MyDatabase
WITH RECOVERY
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:u3Zamya%23EHA.2192@.TK2MSFTNGP14.phx.gbl...
>I know i can recover a standby database by restoring the same with recovery
> option
> I want to try out something and want to know which system table all this
> gets recorded so that instead of restoring the database with recovery
> option, can I just update a column in a system table to have it recovered.
> I
> tried to change the status column in sysdatabases but that didnt seem to
> do
> it. It just took the status away from within EM that states its a read
> only
> to have nothing displayed and make it look like its available but upon
> modifying tables it still gave me an error message that the database is in
> load state or something of that sort.
> Does anyone know what else I need to update ?
>|||Yes I am aware of this.. Just wanted to know if theres any other way by
internally hacking a system table that would make the database available..
i.e. assuming I do not wish to change anything on this standby database. I
would like to make this database available by updating some system table
values and then putting it back in standby state by resetting that system
table value.
"Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
news:%23EwGLRe%23EHA.2032@.tk2msftngp13.phx.gbl...
> You don't need to execute the enture restore again to change the status.
> You can issue a RESTORE from Query Analyzer with only the RECOVERY option
> (omitting the FROM clause).
> RESTORE DATABASE MyDatabase
> WITH RECOVERY
> --
> Hope this helps.
> Dan Guzman
> SQL Server MVP
> "Hassan" <fatima_ja@.hotmail.com> wrote in message
> news:u3Zamya%23EHA.2192@.TK2MSFTNGP14.phx.gbl...
> >I know i can recover a standby database by restoring the same with
recovery
> > option
> >
> > I want to try out something and want to know which system table all this
> > gets recorded so that instead of restoring the database with recovery
> > option, can I just update a column in a system table to have it
recovered.
> > I
> > tried to change the status column in sysdatabases but that didnt seem to
> > do
> > it. It just took the status away from within EM that states its a read
> > only
> > to have nothing displayed and make it look like its available but upon
> > modifying tables it still gave me an error message that the database is
in
> > load state or something of that sort.
> >
> > Does anyone know what else I need to update ?
> >
> >
>|||Not possible. The recovery process will apply the UNDO logic based on the transaction log, and once
that is done, you cannot restore any further backups.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hassan" <fatima_ja@.hotmail.com> wrote in message news:OFfF1of%23EHA.3368@.TK2MSFTNGP15.phx.gbl...
> Yes I am aware of this.. Just wanted to know if theres any other way by
> internally hacking a system table that would make the database available..
> i.e. assuming I do not wish to change anything on this standby database. I
> would like to make this database available by updating some system table
> values and then putting it back in standby state by resetting that system
> table value.
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:%23EwGLRe%23EHA.2032@.tk2msftngp13.phx.gbl...
>> You don't need to execute the enture restore again to change the status.
>> You can issue a RESTORE from Query Analyzer with only the RECOVERY option
>> (omitting the FROM clause).
>> RESTORE DATABASE MyDatabase
>> WITH RECOVERY
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Hassan" <fatima_ja@.hotmail.com> wrote in message
>> news:u3Zamya%23EHA.2192@.TK2MSFTNGP14.phx.gbl...
>> >I know i can recover a standby database by restoring the same with
> recovery
>> > option
>> >
>> > I want to try out something and want to know which system table all this
>> > gets recorded so that instead of restoring the database with recovery
>> > option, can I just update a column in a system table to have it
> recovered.
>> > I
>> > tried to change the status column in sysdatabases but that didnt seem to
>> > do
>> > it. It just took the status away from within EM that states its a read
>> > only
>> > to have nothing displayed and make it look like its available but upon
>> > modifying tables it still gave me an error message that the database is
> in
>> > load state or something of that sort.
>> >
>> > Does anyone know what else I need to update ?
>> >
>> >
>>
>|||To add to Tibor's response, the log restore process requires that the
database to be in exactly the state it was in at the time of the log backup.
Permitting database updates before a log restore will introduce the
potential for conflicting database modifications that the restore process
cannot handle. If you were able to circumvent the database status check,
you could very well end up with a corrupt database.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OFfF1of%23EHA.3368@.TK2MSFTNGP15.phx.gbl...
> Yes I am aware of this.. Just wanted to know if theres any other way by
> internally hacking a system table that would make the database available..
> i.e. assuming I do not wish to change anything on this standby database. I
> would like to make this database available by updating some system table
> values and then putting it back in standby state by resetting that system
> table value.
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:%23EwGLRe%23EHA.2032@.tk2msftngp13.phx.gbl...
>> You don't need to execute the enture restore again to change the status.
>> You can issue a RESTORE from Query Analyzer with only the RECOVERY option
>> (omitting the FROM clause).
>> RESTORE DATABASE MyDatabase
>> WITH RECOVERY
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Hassan" <fatima_ja@.hotmail.com> wrote in message
>> news:u3Zamya%23EHA.2192@.TK2MSFTNGP14.phx.gbl...
>> >I know i can recover a standby database by restoring the same with
> recovery
>> > option
>> >
>> > I want to try out something and want to know which system table all
>> > this
>> > gets recorded so that instead of restoring the database with recovery
>> > option, can I just update a column in a system table to have it
> recovered.
>> > I
>> > tried to change the status column in sysdatabases but that didnt seem
>> > to
>> > do
>> > it. It just took the status away from within EM that states its a read
>> > only
>> > to have nothing displayed and make it look like its available but upon
>> > modifying tables it still gave me an error message that the database is
> in
>> > load state or something of that sort.
>> >
>> > Does anyone know what else I need to update ?
>> >
>> >
>>
>|||Oops, should have been:
" The RESTORE process will apply the UNDO... "
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:%234UaCli%23EHA.1400@.TK2MSFTNGP11.phx.gbl...
> Not possible. The recovery process will apply the UNDO logic based on the transaction log, and
> once that is done, you cannot restore any further backups.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hassan" <fatima_ja@.hotmail.com> wrote in message news:OFfF1of%23EHA.3368@.TK2MSFTNGP15.phx.gbl...
>> Yes I am aware of this.. Just wanted to know if theres any other way by
>> internally hacking a system table that would make the database available..
>> i.e. assuming I do not wish to change anything on this standby database. I
>> would like to make this database available by updating some system table
>> values and then putting it back in standby state by resetting that system
>> table value.
>>
>> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
>> news:%23EwGLRe%23EHA.2032@.tk2msftngp13.phx.gbl...
>> You don't need to execute the enture restore again to change the status.
>> You can issue a RESTORE from Query Analyzer with only the RECOVERY option
>> (omitting the FROM clause).
>> RESTORE DATABASE MyDatabase
>> WITH RECOVERY
>> --
>> Hope this helps.
>> Dan Guzman
>> SQL Server MVP
>> "Hassan" <fatima_ja@.hotmail.com> wrote in message
>> news:u3Zamya%23EHA.2192@.TK2MSFTNGP14.phx.gbl...
>> >I know i can recover a standby database by restoring the same with
>> recovery
>> > option
>> >
>> > I want to try out something and want to know which system table all this
>> > gets recorded so that instead of restoring the database with recovery
>> > option, can I just update a column in a system table to have it
>> recovered.
>> > I
>> > tried to change the status column in sysdatabases but that didnt seem to
>> > do
>> > it. It just took the status away from within EM that states its a read
>> > only
>> > to have nothing displayed and make it look like its available but upon
>> > modifying tables it still gave me an error message that the database is
>> in
>> > load state or something of that sort.
>> >
>> > Does anyone know what else I need to update ?
>> >
>> >
>>
>>
>|||"Hassan" <fatima_ja@.hotmail.com> wrote in message
news:OFfF1of%23EHA.3368@.TK2MSFTNGP15.phx.gbl...
> Yes I am aware of this.. Just wanted to know if theres any other way by
> internally hacking a system table that would make the database available..
> i.e. assuming I do not wish to change anything on this standby database. I
> would like to make this database available by updating some system table
> values and then putting it back in standby state by resetting that system
> table value.
Why not use WITH STANDBY?
This will make it a READ-ONLY database that you can later RECOVER further if
need be.
>
> "Dan Guzman" <guzmanda@.nospam-online.sbcglobal.net> wrote in message
> news:%23EwGLRe%23EHA.2032@.tk2msftngp13.phx.gbl...
> > You don't need to execute the enture restore again to change the status.
> > You can issue a RESTORE from Query Analyzer with only the RECOVERY
option
> > (omitting the FROM clause).
> >
> > RESTORE DATABASE MyDatabase
> > WITH RECOVERY
> >
> > --
> > Hope this helps.
> >
> > Dan Guzman
> > SQL Server MVP
> >
> > "Hassan" <fatima_ja@.hotmail.com> wrote in message
> > news:u3Zamya%23EHA.2192@.TK2MSFTNGP14.phx.gbl...
> > >I know i can recover a standby database by restoring the same with
> recovery
> > > option
> > >
> > > I want to try out something and want to know which system table all
this
> > > gets recorded so that instead of restoring the database with recovery
> > > option, can I just update a column in a system table to have it
> recovered.
> > > I
> > > tried to change the status column in sysdatabases but that didnt seem
to
> > > do
> > > it. It just took the status away from within EM that states its a read
> > > only
> > > to have nothing displayed and make it look like its available but upon
> > > modifying tables it still gave me an error message that the database
is
> in
> > > load state or something of that sort.
> > >
> > > Does anyone know what else I need to update ?
> > >
> > >
> >
> >
>

No comments:

Post a Comment