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
 Other Forums
 Other Topics
 Log Explorer on your box? master-msdb restore tips

Author  Topic 

franco
Constraint Violating Yak Guru

255 Posts

Posted - 2003-05-12 : 09:34:09
This is about restoring master and msdb databases when you have Log Explorer (www.Lumigent.com) installed on your server.

Restore MASTER database

Normally you start SQL Server in single user mode in order to be able to restore the master database with the command "sqlservr -m".
Once SQL Server is started in single user mode you will need to open a QA session in order to perform the restore operation.

Here comes the problem, and the problem is that you cannot launch the QA session because there is already somebody logged on the system and this is a stored procedure from Lumigent, "sp_LumigentStart" that is launched by default every time SQL Server starts.
This stored procedure will be placed on the master database when you install Log Explorer.

If you try to launch a QA session you will receive the following error:

"Unable to connect to server 'Server_Name' "
Server:Msg 18461,Level 16 State 1
"Login failed for user 'sa'."
"Reason: Server is in single user mode. Only one administrator can connect at this time".


Solutions:

1
You can start SQL Server in single user mode + startup options -f and -c, so the command would be "sqlservr -c -f -m"
This would prevent SQL Server to start procedures and let you finally permit to launch the QA session to perform the restore operation.

2
You can start SQL Server in single user mode and with Trace Flag 4022 (Bypass automatic started procedures), so the command would be "sqlservr - m -T4022"


Restore MSDB database

First of all as usually, you need to stop SQL Server Agent.

If, during installation of Log Explorer you choosed to have "Session login information Capture mode" on MSDB database, which is the default, you will need to stop this activity thru Lumigent Server Manager, only after that you will be able to restore msdb database.

Another way is to change the registry settings:

You will find the registry at:

HKEY_LOCAL_MACHINE\SOFTWARE\Lumigent\Log Explorer\(instancename)\Capture.
This value is normally 1. If you set it to 0, using regedit, then Log Explorer will not automatically log in to the database. This is the same as unchecking the "Set Capture State" using Server Manager.

If you try to restore MSDB database without this action you will end up on this error:
"Exclusive access could not be obtained because the database is in use"

HTH

Franco
   

- Advertisement -