Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 SQL2000: Database status

Author  Topic 

dewacorp.alliances

452 Posts

Posted - 2006-08-20 : 19:20:38
In relation to previous query that I made, if I made a mistake to run this restore WITH NORECOVERY (currently database status sets as LOADING) how do I change this to NORMAL.

I run the following queries:

SELECT mode , status , status2
FROM master..sysdatabases
WHERE name = 'databasename'

RESULT:

Mode; status; status2;
0; 4194336; 1090519040

Also run the following:

SELECT restore_date, restore_type, replace, recovery, restart
FROM msdb..restorehistory
WHERE destination_database_name = 'databasename'
ORDER BY restore_history_id

Result:

Restore_date; restore_type; replace; recovery; restart;
2006-08-20 03:53:44.630 D 1 0 0
2006-08-20 11:27:49.200 D 1 1 0

Notice that the recovery sets as 1 @ 2006-08-20 11:27:49.200.

Again, can I change the database status?

Thanks


Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-08-20 : 20:07:42
Do a RESTORE database with RECOVERY or RESTORE log with RECOVERY. However, you will not be able to apply additional logs to that database.

You can redo your log shipping to restore your database to STANDBY mode if you need to access the database in read-only mode and still br able to apply logs to it.

You can read about RESTORE with the RECOVERY and STANDBY options in SQL Server Books Online:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ra-rz_25rm.asp






CODO ERGO SUM
Go to Top of Page
   

- Advertisement -