发信人: reynolds(雷龙.DBA中)
整理人: reynolds(2002-06-04 13:15:39), 站内信件
|
31. You are the administrator of a SQL Server 2000 computer. The server is used to store sales information for your company. Your company hires a new sales manager named Paulo. You create a user account named Paulo in your company's Microsoft Windows NT domain, which is named CORPORATE. You create a Windows authenticated login for Paul on the server. The permissions on the sales table are configured as shown below:
User/Role Select Insert Create View CreateSP
Accountants Allow Allow Allow Deny
Administrators Allow Blank Blank Blank
Reporters Allow Deny Deny Deny
Sales Managers Allow Allow Allow Allow
Salespeople Allow Allow Deny Deny
Guest Blank Blank Blank Blank
Paulo needs permission to view, add, edit, and remove information in the database tables. Which transact-SQL statement should you execute?
A. EXEC sp_addrolemember ‘SalesManagers’, ‘Corporate\Paul’
B. GRANT ALL ON sales TO ‘Corportae\Paul’
C. EXEC sp_addrolemember ‘SalesManagers’, ‘Paul’
D. EXEC sp_grantdbaccess ‘Corporate\Paulo’, ‘Paul’
EXEC sp_addrolemember ‘SalesManagers’, ‘Paul’
Answer: D
Reason: Windows认证方式加上明显的提示,选择D应该是毫无疑问的。
32. You are the administrator of a SQL Server 2000 computer. The server contains a database named FinanceData that is used by a client/server application. Each employee has a SQL server login that the application uses to access the server. Your company hires a new employee named Andrew. You create a SQL server login named Andrew. You also create a database user named Andrew in the database and grant the database user full permissions in the database. Whenever Andrew runs the client/server application, he receives the error message ‘Invalid object name’. Which transact-SQL statement should you execute?
A. EXEC sp_grantdbaccess ‘Financedata’, ‘Andrew’
GO
Sp_addrolemember ‘db_datareader’, ‘Andrew’
B. GRANT ALL ON Financedata TO Andrew.
C. EXEC sp_defaultdb ‘Andrew’, ‘Financedata’
D. EXEC sp_addlogin ‘Andrew’
Answer: C
Reason:
33. You are the administrator of a SQL Server 2000 computer. The server is used to store information for your company's sales department.
The permissions on the SalesFigures table are configured as shown below:
User/Role Select Insert Update Delete
Accountants Allow Allow Deny Deny
Managers Allow Blank Deny Deny
Salespeople Allow Blank Blank Blank
Guest Blank Blank Blank Blank
Lisa is a user in the sales department. She needs to review the data in the SalesFigures table. She also needs to add new items to the table. You need to allow Lisa to perform these tasks without giving her additional permissions in the database. What should you do? (Each correct answer presents part of the solution. Choose all that apply)
A. Add Lisa to the Managers database role.
B. Add Lisa to the Salespeople database role.
C. Grant Lisa INSERT permissions on the Sales Table.
D. Grant Lisa UPDATE permissions on the Sales Table.
E. Revoke UPDATE permissions on the table for Lisa.
F. Revoke DELETE permissions on the table for Lisa.
Answer: B C
Reason:
34. You are the administrator of three SQL Server 2000 computers at Parker publishing. One server, FLPSQL01, stores other data. You want to be able to use the other two servers, FLPSQL02 and FLPSQL03, to answer queries and run reports. The planned network configuration is shown in the exhibit below:
See http://www.cheet-sheets.com/228/image6.jpg
You want to use the Database Maintenance Plan wizard to configure log shipping from FLPSQL01 to FLPSQL02 and FLPSQL03. You do not want users to add any new data on FLPSQL02 and FLPSQL03, but they must be able to run queries and reports. Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Set the database load state for each destination server to No Recovery mode.
B. Set the database load state for each destination server to Standby mode.
C. Enable the ‘Allow database to assume primary role’ option for both destination servers.
D. Enable the ‘Allow database to assume primary role’ option for one destination server and then disable this option for other destination server.
E. Disable the ‘Allow database to assume primary role’ option for both destination servers.
Answer: B E
Reason: No Recovey Mode下数据库是不可以访问的,和题目所要求的可以运行查询和报表不相符合,所以排除A。
35. You are the administrator of an SQL Server 2000 computer. The server contains a database named Sales. Pete reports that he cannot modify data in the database. You use SQL Profiler to capture his activities shown below:
Event Class Test Date
TraceStart
Existing Connections --network protocol:LPC set qualid_identifier on set implicit_transaction off…
Existing Connections --network protocol:LPC set qualid_identifier on set implicit_transaction off…
SQL:Batch Completed set transaction isolation level serializable begin transaction select * from….
You want Pete to be able to modify data. You also want the Transact-SQL statement to execute without compromising data integrity. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)
A. Change the isolation level of the database connection.
B. Add indexes to the product table.
C. Remove the explicit transaction from the Transact-SQL batch.
D. Create a stored procedure to execute the Transact-SQL batch.
E. Add a cascading UPDATE trigger to the Products table.
Answer: A C
Reason:
参见以下说明:
======================================================================
幻像 (phantom)
通过一个任务,在以前由另一个尚未提交其事务的任务读取的行的范围中插入新行或删除现有行。带有未提交事务的任务由于该范围中行数的更改而无法重复其原始读取。如果某个连接设置其事务隔离级别为可串行,则 SQL Server 使用键范围锁定以防止幻像。
SET TRANSACTION ISOLATION LEVEL
控制由连接发出的所有 Microsoft SQL Server SELECT 语句的默认事务锁定行为。
语法
SET TRANSACTION ISOLATION LEVEL
{ READ COMMITTED
| READ UNCOMMITTED
| REPEATABLE READ
| SERIALIZABLE
}
参数
READ COMMITTED
指定在读取数据时控制共享锁以避免脏读,但数据可在事务结束前更改,从而产生不可重复读取或幻像数据。该选项是 SQL Server 的默认值。
READ UNCOMMITTED
执行脏读或 0 级隔离锁定,这表示不发出共享锁,也不接受排它锁。当设置该选项时,可以对数据执行未提交读或脏读;在事务结束前可以更改数据内的数值,行也可以出现在数据集中或从数据集消失。该选项的作用与在事务内所有语句中的所有表上设置 NOLOCK 相同。这是四个隔离级别中限制最小的级别。
REPEATABLE READ
锁定查询中使用的所有数据以防止其他用户更新数据,但是其他用户可以将新的幻像行插入数据集,且幻像行包括在当前事务的后续读取中。因为并发低于默认隔离级别,所以应只在必要时才使用该选项。
SERIALIZABLE
在数据集上放置一个范围锁,以防止其他用户在事务完成之前更新数据集或将行插入数据集内。这是四个隔离级别中限制最大的级别。因为并发级别较低,所以应只在必要时才使用该选项。该选项的作用与在事务内所有 SELECT 语句中的所有表上设置 HOLDLOCK 相同。
***** 注意 *****
事务必须运行于可重复读或更高的隔离级别以防止丢失更新。当两个事务检索相同的行,然后基于原检索的值对行进行更新时,会发生丢失更新。如果两个事务使用一个 UPDATE 语句更新行,并且不基于以前检索的值进行更新,则在默认的提交读隔离级别不会发生丢失更新。
======================================================================
----
/
<>< o /| /
<>< (o / |/|
) ) <@ <
( O )( \ |\| <><
) <>< () \| \
\
每天在网易游水的鱼 |
|