发信人: reynolds(雷龙.DBA中)
整理人: reynolds(2002-03-06 15:42:20), 站内信件
|
36. You are the administrator of two SQL Server 2000 computers. Each server contains data for one of your company's two regional divisions. Company employees currently use a single data entry application on client computers. After the new application is installed, query response times slow. You want to monitor server traffic during business hours to help diagnose this problem. What should you do?
A. Run SQL Profiler, and create one trace to monitor both servers. Configure the trace to include data from the new data entry application only.
B. Run two instances of SQL Profiler, and create a trace to monitor each server. Configure the trace to include data from both data entry applications.
C. Run the sqldrag utility from a command prompt.
Write diagnostic data to a text file.
D. Execute the sp_monitor stored procedure.
Save the output to a text file.
Answer: A ??
Reason: 这道题目有些凭感觉,瞎蒙呗。
37. You are the administrator of a SQL Server 2000 computer. The server contains a database named Inventory. Users report that several storage locations in the UnitsStored field contain negative numbers. You examine the database’s table structure. The table properties are configured as shown in the exhibit (exhibit not available).
You correct all the negative number numbers in the table. You must prevent the database from storing negative numbers. You also want to minimize use of server resources and physical I/O. Which transact-SQL statement should you execute?
A. ALTER TABLE dbo.storagelocations ADD CONSTRAINS
CK_storagelocations_UnitsStored
CHECK (UnitsStored>= 0)
B. CREATE TRIGGER CK_UnitsStored On StorageLocations
FOR INSERT, UPDATE AS
IF INSERTED, UnitsStored < 0 ROLLBACK TRAN
C. CREATE TABLE ck_unitsstored As @Units >= 0
GO
Sp_bindrule ‘OK_UnitsStored’,
‘StorageLocations, UnitsStored’
GO
D. CREATE PROC UpdateUnitsStored
(0StorageLocationID int, @UnitsStored bigint)AS
IF @UnitsStored < 0
DATSERROR (50099, 17)
ELSE
UPDATE storaheLocations SET UnitsStored = @UnitsStored WHERE StorageLocationID = @storageLocationID
Answer: A
Reason: 典型的触发器题目。
======================================================================
约束
约束使您得以定义 Microsoft® SQL Server™ 2000 自动强制数据库完整性的方式。约束定义关于列中允许值的规则,是强制完整性的标准机制。使用约束优先于使用触发器、规则和默认值。查询优化器也使用约束定义生成高性能的查询执行计划。
触发器
触发器是一种特殊类型的存储过程,当使用下面的一种或多种数据修改操作在指定表中对数据进行修改时,触发器会生效:UPDATE、INSERT 或 DELETE。触发器可以查询其它表,而且可以包含复杂的 SQL 语句。它们主要用于强制复杂的业务规则或要求。例如,可以控制是否允许基于顾客的当前帐户状态插入定单。
触发器还有助于强制引用完整性,以便在添加、更新或删除表中的行时保留表之间已定义的关系。然而,强制引用完整性的最好方法是在相关表中定义主键和外键约束。如果使用数据库关系图,则可以在表之间创建关系以自动创建外键约束。有关详细信息,请参见表关系。
规则
规则是一个向后兼容的功能,用于执行一些与 CHECK 约束相同的功能。CHECK 约束是用来限制列值的首选标准方法。CHECK 约束比规则更简明,一个列只能应用一个规则,但是却可以应用多个 CHECK 约束。CHECK 约束作为 CREATE TABLE 语句的一部分进行指定,而规则以单独的对象创建,然后绑定到列上。
SQL 存储过程
存储过程是一组编译在单个执行计划中的 Transact-SQL 语句。
======================================================================
38. You are the database administrator of a SQL Server 2000 computer. The server contains your company's Accounts database. Hundreds of users access the database each day. Because you have had power interruptions in the past, you want to perfect the physical integrity of the Accounts database. You do not want to slow down server operations. What should you do?
A. Enable the ‘Torn page detection database’ option for each database.
B. Disable ‘Write caching’ on all disk controllers.
C. Ensure that write caching disk controllers have better backups.
D. Create a database maintenance plan to check database integrity and make repairs each night.
Answer: C
Reason: 再高明的软件技术都敌不过Raid卡上一块充满的后备电池,正如软RAID永远超不过硬RAID一样。
39. You are the administrator of an SQL Server 2000 computer. The server contains a database named Inventory. Users report that the following query responds slowly:
SELECT parts.SKU AS SKS, parts, inscription AS Part Description), locations, inscription AS location
FROM partslocations INSERT JOIN parts (G PartsLocations.Parts )
You examine the indexes in the PartsLocations table. The indexes are configured as shown below:
index_name index_description index_keys
IX_PartsLocaion_LocationsID_PK nonclustered, located on PRIMARY Location ID
IX_PartsLocation_PartsID_PK nonclustered, located on PRIMARY PartsID
PK_PartsLocations clustered, unique, primary… PartsID, LocationID
You need to improve the performance of the query. What should you do?
A. Rebuild the PK_PartsLoactions index.
B. Rebuild the IX_PartsLoactions_PartsID index.
C. Rebuild the IX_PartsLoactions_LocationId index.
D. Create the IX_PartsLocations_PartsID_LocationID index.
Answer: A ??
Reason:
40. You are the administrator of a SQL Server 2000 computer. The server contains a database named Sales. You perform full database backups every two days. You also run regular database consistency checks on the server. The most recent check of the Sales database returns the following message:
HECKDB found 0 allocations errors and 3 consistency errors in table ‘Orders’ (object ID 214575782).
You want to correct the data integrity errors while minimizing the amount of data lost. What should you do?
A. Disconnect users from the Sales database.
Enable the single user database option.
Execute the DBCC CHECKTABLE statement for the Orders table, and specify the REPAIR_REBUILD option.
B. Disconnect users from the Sales database.
Enable the ‘dbo use only database’ option.
Execute the DBCC CHECKALLOC statement for the Orders table, and specify the REPAIR_REBUILD option.
C. Disconnect users from the Sales database.
Execute the RESTORES DATABASE statement for the Sales database.
D. Execute the DBCC CLEANTABLE statement for the Orders table.
E. Execute the sp_table_validation stored procedure for the Orders table.
Answer: A
Reason: 这道题目有些凭感觉,瞎蒙呗。有说法是B,但是我觉得错误提示说的是“Oders”的一致性错误,CheckTable是用于检查这个的,而CheckAlloc是检查数据库空间分配一致性的。
另外关于参数:
======================================================================
REPAIR_ALLOW_DATA_LOSS
执行由 REPAIR_REBUILD 完成的所有修复,包括对行和页进行分配和取消分配以改正分配错误、结构行或页的错误,以及删除已损坏的文本对象。这些修复可能会导致一些数据丢失。修复操作可以在用户事务下完成,以允许用户回滚所做的更改。如果回滚修复,则数据库仍会含有错误,应该从备份进行恢复。如果由于所提供修复等级的缘故遗漏某个错误的修复,则将遗漏任何取决于该修复的修复。修复完成后,备份数据库。
REPAIR_FAST
进行小的、不耗时的修复操作,如修复非聚集索引中的附加键。这些修复可以很快完成,并且不会有丢失数据的危险。
REPAIR_REBUILD
执行由 REPAIR_FAST 完成的所有修复,包括需要较长时间的修复(如重建索引)。执行这些修复时不会有丢失数据的危险。
======================================================================
----
/
<>< o /| /
<>< (o / |/|
) ) <@ <
( O )( \ |\| <><
) <>< () \| \
\
每天在网易游水的鱼 |
|