Related differences

Ques 16. What are database states in MS SQL Server?

A database is always in one specific state. For example, these states include ONLINE, OFFLINE, or SUSPECT. To verify the current state of a database, select the state_desc column in the sys.databases catalog view. The following table defines the database states.

* ONLINE - Database is available for access. The primary filegroup is online, although the undo phase of recovery may not have been completed.

* OFFLINE - Database is unavailable. A database becomes offline by explicit user action and remains offline until additional user action is taken. For example, the database may be taken offline in order to move a file to a new disk. The database is then brought back online after the move has been completed.

* RESTORING - One or more files of the primary filegroup are being restored, or one or more secondary files are being restored offline. The database is unavailable.

* RECOVERING - Database is being recovered. The recovering process is a transient state; the database will automatically become online if the recovery succeeds. If the recovery fails, the database will become suspect. The database is unavailable.

Is it helpful? Add Comment View Comments
 

Ques 17. How to install SQL Server 2005 Express Edition?

Once you have downloaded SQL Server 2005 Express Edition, you should follow this tutorial to install it on your system:

1. Double click SQLEXPR.EXE. The setup window shows up.

2. Click Next to let the setup program to unpack all files from the downloaded file.

3. When unpack is down, the setup program will check all required programs on your system.

4. Then the setup program will start the installation process.

5. On the Authentication Mode window, click the radio button for Mixed Mode (Windows Authentication and SQL Server Authentication). And enter "GlbalGuideLine" in the "Specify the sa logon password below:" fields.

6. Continue to finish the installation process.

7. When installation is done, you will see a new program menu entry as: Start > Programs > Microsoft SQL Server 2005 > Configuration Tools.

Is it helpful? Add Comment View Comments
 

Ques 18. How to set a database state to OFFLINE in MS SQL Server?

If you want to move database physical files, you should take the database offline by using the "ALTER DATABASE" statement with the following syntax:

ALTER DATABASE database_name SET OFFLINE

The following tutorial example will bring "withoutbook" offline:

ALTER DATABASE withoutbook SET OFFLINE
GO

SELECT name, state_desc from sys.databases
GO
name state_desc
master ONLINE
tempdb ONLINE
model ONLINE
msdb ONLINE
withoutbook OFFLINE

USE withoutbook
GO
Msg 942, Level 14, State 4, Line 1
Database 'withoutbook' cannot be opened because
it is offline.

Is it helpful? Add Comment View Comments
 

Ques 19. What is sqlservr.exe - Process - SQL Server (SQLEX?PRESS)?

Process sqlservr.exe is the Microsoft SQL Server system service installed as part of the Microsoft SQL Server 2005 Express Edition.

mscorsvw.exe process and program file info:

CPU usage: 00%
Memory usage: 1,316K
Launching method: System Service
Directory: C:Program FilesMicrosoft SQL ServerMSSQL.1
MSSQLBinn
File name: sqlservr.exe
Description: SQL Server Windows NT
Size: 28,768,528 bytes
Date: Friday, October 14, 2005, 3:51:46 AM
Version: 2005.90.1399.0
Company name: Microsoft
System essential: No
Virus/Spyware/Adware: No

Is it helpful? Add Comment View Comments
 

Ques 20. How to move database physical files in MS SQL Server?

If you want to move database physical files to a new location, you can use the "ALTER DATABASE" statements to bring the database offline, and link it to the files at the new location. The following tutorial gives you a good example:

ALTER DATABASE withoutbook SET ONLINE
GO

USE withoutbook
GO

CREATE TABLE Links (Name NVARCHAR(32))
GO

ALTER DATABASE withoutbook SET OFFLINE
GO

Now it is safe to move the database physical files to a new location:

1. Run Windows Explorer
2. Create a new directory: c:tempdata
3. Drag and drop c:tempwithoutbook.mdf to c:tempdata
3. Drag and drop c:tempwithoutbook.mdf to c:tempdata

Go back to the SQL client program and run:

ALTER DATABASE withoutbook
MODIFY FILE (NAME = withoutbookDB,
FILENAME = 'C:tempdatawithoutbookDB.mdf')
GO

Is it helpful? Add Comment View Comments
 

Most helpful rated by users: