Wednesday, October 20, 2010

With DATABASEPROPERTYEX () check the status of the recovery process


The process of fruit you are recovering the database, the recovery process needs to be done after a few steps work, then you can use DATABASEPROPERTYEX () system function checks the status of the recovery process. The function of the state property will show the results of the database state. This is where SQL Server 2000 have the new function. Here is an example script:


SELECT DATABASEPROPERTYEX (''Northwind'',''Status'')
/ Bin / boot / dev / etc / home / lib / lost + found / media / misc / mnt / net / opt / proc / root / sbin / selinux / srv / sys / tmp / u01 / usr / var / vmware
ONLINE = database can be queried
OFFLINE = database explicitly Offline
RESTORING = database being restored
RECOVERING = database being restored, it can not query
SUSPECT = database can not be restored
backup / bin / bin_old / conf / data / eshow / log / maint / news: 10 / news: 11 / news: 12 / news: 13 / news: 14 / news: 15 / news: 16 / news: 17 / news: 18 / news: 2 / news: 3 / news: 4 / news: 5 / news: 6 / news: 7 / news: 8 / news: 9 / seeds / svn / tasks / tmp / xml2dict-read-only /

Previous versions of SQL Server 2000 with DATABASEPROPERTY () system function. IsInRecovery property will give the database to restore the state. The following are examples of SQL Server 7.0 of the script:

SELECT DATABASEPROPERTY (''Northwind'',''IsInRecovery'')
/ Bin / boot / dev / etc / home / lib / lost + found / media / misc / mnt / net / opt / proc / root / sbin / selinux / srv / sys / tmp / u01 / usr / var / vmware
1 = TRUE
0 = FALSE
NULL = Invalid input
backup / bin / bin_old / conf / data / eshow / log / maint / news: 10 / news: 11 / news: 12 / news: 13 / news: 14 / news: 15 / news: 16 / news: 17 / news: 18 / news: 2 / news: 3 / news: 4 / news: 5 / news: 6 / news: 7 / news: 8 / news: 9 / seeds / svn / tasks / tmp / xml2dict-read-only /

After carrying out steps to restore the database before work, always check the status of the database until the database is available online, and not until the recovery process. If the recovery period of time, did not return a state that data is available, then you need to check the database for other states. It shows that: in the process to continue until there is another problem to deal with.








Recommended links:



Compare Screen Capture



Audio Speech brief



Cisco Crusade Battle with Hewlett-Packard launched in China



Hot Active X



Shanghai Real Estate Control Policies Introduced Countdown



Office 2010 new authentication methods volume



FLV to IPOD



VOB to ZUNE



"Batman Arkham asylum" after playing a Little bit of getting



ASP.NET 2.0 at the same time to prevent the Same user login



A very nice MP3 Tools



File And Disk Management Wizard



Waves resurgence - Purple VS Sogou contest



PDM, from said do (next)



VOB to Flash



No comments:

Post a Comment