Lab Procedures:

advertisement
Lab Procedures:
Unit 10, Ex – 1
The SQL Server error log can be viewed using Enterprise Manager.
To view the error log, perform the following steps:
1. Click Start>Programs>Microsoft SQL Server>Enterprise Manager. The
Enterprise Manager console is displayed.
2. Expand the Microsoft SQL Servers and the SQL Server Group nodes, in succession.
Expand the PRABS-ING (Window NT) node and expand the Management
3. Click SQL Server Logs. The SQL Server Logs appear in the right pane, as shown in
the Figure:
SQL Server Logs
4. Double-click Archive #1 in the right pane. The messages in the log file appear, as
shown in the Figure:
1
Lab Handout for IT390
Business Database Administration
Facsimile of SQL Server Error Log Archive #1
5. Double-click any message to see the description in the SQL Server Error Log Message
dialog box, as shown in the Figure:
SQL Server Error Log Message Dialog Box
2
Lab Handout for IT390
Business Database Administration
To view the problems encountered for the day, you, the DBA, need to open Event
Viewer and view application logs. To do this, click Start>Programs>Administrative
Tools>Event Viewer. Click Application Log, as shown in the Figure:
Event Viewer Application Logs
You might observe the following error messages are seen in the error log:
-SQL Server is terminating due to 'stop' request from Service Control Manager.
-LogEvent: Failed to report the current event. Operating system error = 31 (A device
attached to the system is not functioning).
-SQL Server terminating because of system shutdown.
-There are no errors generated by SQL Server.
Conclusion
You, the DBA, have successfully checked for SQL problems through the use of the logs.
3
Lab Handout for IT390
Business Database Administration
Unit 10, Ex – 2
To test the network connection with the computer with IP Address 192.168.10.1 (the
Server where SQL Server is installed), perform the following steps:
1. Open the command prompt, and type ping 192.168.10.1.
A message displays the number of bytes of data transfer.
2. Open the command prompt again, and type Net use.
All the users who connected or disconnected onto the machine will be listed, as shown in
the Code:
Net Use Command
3. Use the Query Analyzer to run DBCC CHECKALLOC. DBCC CHECKALLOC
results are obtained in the results pane in SQL Server Query Analyzer.
4. Use the Query Analyzer to run DBCC CHECKTABLE DBCC CHECKTABLE results
are obtained in the results pane in SQL Server Query Analyzer.
Conclusion
You have used some basic troubleshooting tools to check your network connectivity and
database.
4
Lab Handout for IT390
Business Database Administration
Unit 10, Ex – 3
To check the currently logged on users and the processes that have obtained locks on the
master database, perform the following steps:
1. Open SQL Server Query Analyzer.
2. Type the sp_who command in the SQL Query Analyzer window.
3. Press F5 to execute the query.
4. After executing the sp_who command, type the sp_lock command in Query Analyzer.
5. Press F5 to execute the query.
6. The following information is obtained on executing the sp_who command:
spid
status
login name
database
When you execute sp_lock command, the process ID of the process that has obtained a
lock on the current database is displayed.
Conclusion
You have used some basic troubleshooting tools to check your database users logged in
and locks.
5
Lab Handout for IT390
Business Database Administration
Download