精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>电脑技术>>● 认证工程师>>Microsoft 认证>>试题回忆>>70-228>>70-228模拟试题(二十六)

主题:70-228模拟试题(二十六)
发信人: reynolds(雷龙.DBA中)
整理人: reynolds(2002-06-13 14:34:38), 站内信件
126. You are the administrator of a SQL Server 2000 computer. The server contains a database that has the torn page detection database option enabled. Backups of the database are made daily. The server loses power for one minute. When power is restored, torn pages are detected. You notice in SQL Server Enterprise Manager that the database is marked suspect. You need to correct the problem. What should you do?

A. Execute the DBCC CHECKDB statement, and then specify the PHYSICAL_ONLY option.
B. Execute the DBCC CHECKDB statement, and then specify the REPAIR_REBUILD option.
C. Execute the sp_resetstatus stored procedure.
D. Restore the suspect database from backups.
 
Answer: B
Reason:
======================================================================
DBCC CHECKDB

检查指定数据库中的所有对象的分配和结构完整性。

语法
DBCC CHECKDB
    ( 'database_name'
            [ , NOINDEX
                | { REPAIR_ALLOW_DATA_LOSS
                    | REPAIR_FAST
                    | REPAIR_REBUILD
                    } ] 
    )    [ WITH { [ ALL_ERRORMSGS ]
                    [ , [ NO_INFOMSGS ] ]
                    [ , [ TABLOCK ] ]
                    [ , [ ESTIMATEONLY ] ]
                    [ , [ PHYSICAL_ONLY ] ] 
                    } 
        ] 

参数
'database_name'

是要对其中的所有对象分配和结构完整性进行检查的数据库。如果未指定,则默认为当前数据库。数据库名称必须符合标识符的规则。有关更多信息,请参见使用标识符。 

NOINDEX

指定不检查非系统表的非聚集索引。NOINDEX 减少执行总时间,因为它不对用户定义的表的非聚集索引进行检查。NOINDEX 对系统表没有影响,因为 DBCC CHECKDB 总是对所有系统表索引进行检查。

REPAIR_ALLOW_DATA_LOSS | REPAIR_FAST | REPAIR_REBUILD

指定 DBCC CHECKDB 修复发现的错误。给定的 database_name 必须在单用户模式下以使用修复选项,它可以是下列值之一。

REPAIR_ALLOW_DATA_LOSS:
    执行由 REPAIR_REBUILD 完成的所有修复,包括对行和页进行分配和取消分配以改正分配错误、结构行或页的错误,以及删除已损坏的文本对象。这些修复可能会导致一些数据丢失。修复操作可以在用户事务下完成以允许用户回滚所做的更改。如果回滚修复,则数据库仍会含有错误,应该从备份进行恢复。如果由于所提供修复等级的缘故遗漏某个错误的修复,则将遗漏任何取决于该修复的修复。修复完成后,备份数据库。 
REPAIR_FAST:
    进行小的、不耗时的修复操作,如修复非聚集索引中的附加键。这些修复可以很快完成,并且不会有丢失数据的危险。 
REPAIR_REBUILD:
    执行由 REPAIR_FAST 完成的所有修复,包括需要较长时间的修复(如重建索引)。执行这些修复时不会有丢失数据的危险。 


WITH

指定有关下列内容的选项:返回错误信息的数量、获得的锁或估计的 tempdb 要求。

ALL_ERRORMSGS

显示每个对象不受限制的错误数。如果没有指定 ALL_ERRORMSGS,每个对象至多显示 200 个错误信息。按对象 ID 对错误信息进行排序(从 tempdb 中生成的消息除外)。

NO_INFOMSGS

禁止显示所有信息性消息(严重级别 10)和关于所用空间的报告。 

TABLOCK

导致 DBCC CHECKDB 获得共享表锁。TABLOCK 可使 DBCC CHECKDB 在负荷较重的数据库上运行得更快,但 DBCC CHECKDB 运行时会减少数据库上可获得的并发性。

ESTIMATE ONLY

显示估计的 tempdb 空间大小,要运行带有所有其它指定选项的 DBCC CHECKDB 则需要该空间。不执行该检查。

PHYSICAL_ONLY

仅限于检查页和记录标题物理结构的完整性,以及页对象 ID 和索引 ID 与分配结构之间的一致性。该检查旨在以较低的开销检查数据库的物理一致性,同时还检测会危及用户数据安全的残缺页和常见的硬件故障。PHYSICAL_ONLY 始终意味着 NO_INFOMSGS,并且不能与任何修复选项一起使用。



sp_resetstatus 关闭数据库的置疑标志,但是原封不动地保持数据库的其它选项。

注意  只有在您的主要支持提供者指导下或有疑难解答建议的做法时,才可以使用 sp_resetstatus。否则,可能会损坏数据库。


该题主要是由于电力故障所导致的数据库完整性被破坏,因此简单地修改置疑标志是不妥当的,必须修复数据库的完整性,否则容易导致数据库不可访问。
======================================================================



127. 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:

CHECKDB found 0 allocation errors and 9 consistency errors in the 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 CHECKTABLE statement for the Orders table, and specify the REPAIR_REBUILD option.
C. Disconnect users from the Sales database.
   Execute the RESTORE 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: 理由一样可以参考上面的解释,检测时使用单用户选项而不是DBO Only。因为使用DBO Only是允许具备db_owner、dbcreator和sysadmin成员登录的,这样同时可以连接多个用户。而单用户就只允许一个用户登录。而执行DBCC CHECKTABLE需要用户必须是sysadmin 固定服务器角色、db_owner 固定数据库角色的成员或表的所有者且不可转让。


 
128. You are the administrator of two SQL Server 2000 computers for an online retailer. One of the SQL Servers records customer buying preferences and demographic data. A DTS package populates a data warehouse with this information and a second SQL server uses Analysis Services to create multidimensional cubes.

The Data Transformation Services (DTS) package is stored in the Meta Data Services repository on the second server. You want to maximize the amount of lineage data that can be recovered if a data file is damaged or lost. Which two actions should you take? (Each correct answer represents part of the solution. Choose two.)

A. Use the Full Recovery model for the staging database.
B. Use the Full Recovery model for the msdb database.
C. Back up the transaction log in the staging database by using the NO_TRUNCATE option.
D. Back up the transaction log in the msdb database by using the NO_TRUNCATE option.
E. Back up the multidimensional data cube.
F. Save the DTS package as a file.
 
Answer: B D
Reason: 选择B是因为DTC存储在msdb数据库中,但是选择D为什么?我觉得好像应该选择C,欢迎大家来交流这道题目。



129. You are the administrator of a SQL Server 2000 computer at your company's warehouse. All product orders are shipped from this warehouse. Orders are received at 30 sales offices. Each sales office offers a range of products specific to its region. Each sales office contains one SQL Server 2000 computer. These servers connect to the warehouse through dial-up connections as needed, typically once a day. Each sales office needs data pertaining only to its region. You need to replicate inventory data from the server at the warehouse to the servers at the sales offices. You want to minimize the amount of time needed to replicate the data. Which three actions should you take? (Each correct answer represents part of the solution. Choose three.)

A. Create one publication for each Subscriber.
B. Create one publication for all Subscribers.
C. Enable horizontal filtering.
D. Enable vertical filtering.
E. Use pull subscriptions.
F. Use push subscriptions.
 
Answer: A C E
Reason: 答案说是BDE,我有我观点。^_^ 既然每个分公司只需要相关的产品资料,那么不用水平分区用什么?
======================================================================
由于每个销售点所需要的产品数据是不尽相同的,所以需要为每一个销售点定制不同的发布内容。

行筛选和列筛选清参照联机手册的复制-复制选项-筛选已发布数据

水平分区
水平分区将一个表分段为多个表,每个表包含相同数目的列和较少的行。例如,可以将一个包含十亿行的表水平分区成 12 个表,每个小表代表特定年份内一个月的数据。任何需要特定月份数据的查询只引用相应月份的表。

具体如何将表进行水平分区取决于如何分析数据。将表进行分区是为了使查询引用尽可能少的表。否则,查询时须使用过多的 UNION 查询来逻辑合并表,而这会削弱查询性能。有关查询水平分区的表的更多信息,请参见视图使用方案。

常用的方法是根据时期/使用对数据进行水平分区。例如,一个表可能包含最近五年的数据,但是只定期访问本年度的数据。在这种情况下,可考虑将数据分区成五个表,每个表只包含一年的数据。

垂直分区
垂直分区将一个表分段为多个表,每个表包含较少的列。垂直分区的两种类型是规范化和行拆分。

规范化是个标准数据库进程,该进程从表中删除冗余列并将其放到次表中,次表按主键与外键的关系链接到主表。

行拆分将原始表垂直分成多个只包含较少列的表。拆分的表内的每个逻辑行与其它表内的相同逻辑行匹配。例如,联接每个拆分的表内的第十行将重新创建原始行。

与水平分区一样,垂直分区使查询得以扫描较少的数据,因此提高查询性能。例如有一个包含七列的表,通常只引用该表的前四列,那么将该表的后三列拆分到一个单独的表中可获得性能收益。

应谨慎考虑垂直分区操作,因为分析多个分区内的数据需要有联接表的查询,而如果分区非常大将可能影响性能。

======================================================================



130. You are the administrator of a SQL Server 2000 computer. Your company purchases an accounting application from a vendor. The application stores its data in a database named Accounting on the server. The tables in this database contain columns that function as primary keys, but PRIMARY KEY and FOREIGN KEY constraints are not used. You need to replicate data from this database to another SQL Server computer. This server will use the replicated data to generate reports. Most reports will run each month, but the accounting department needs to have the ability to run reports at any time. Reports should be accurate through the last full working day. You cannot make any changes to the database, but you need to implement replication. Which two actions should you take? (Each correct answer represents part of the solution. Choose two.)

A. Implement merge replication.
B. Implement snapshot replication.
C. Implement transactional replication.
D. Schedule replication to run continuously.
E. Schedule replication to run during off-peak hours.

Answer: B E
Reason: 因为只需要截至到上个工作日的精确数据,那么就不用实时地合并了。
======================================================================
SQL Server 2000 使用三种类型的复制:

快照复制

快照复制可精确地复制数据或数据库对象在任一时刻的瞬时状态。快照发布通常被定义为按调度发生。订阅服务器包含发布的项目在上次快照复制时的复本。当源数据相对来说是静态的,订阅服务器可能已有些过期,以及要复制的数据量很少时,使用快照复制。

事务复制

在事务复制中,一般先通过快照复制使订阅服务器与发布服务器同步,然后,当发布数据被修改时,捕获事务并将其发送到订阅服务器。通过在发布服务器上进行所有的修改,然后将所有修改复制到订阅服务器,得以在订阅服务器间维护事务完整性。当必须在数据被修改时对其进行复制,必须保留事务,以及发布服务器和订阅服务器通过网络可靠和/或经常地连接在一起时,使用事务复制。

合并复制

合并复制使多个站点得以自主地使用一组订阅服务器,然后过一段时间将工作合在一起合并到发布服务器。通过快照复制使订阅服务器与发布服务器同步。对订阅服务器和发布服务器上的更改进行跟踪。过一段时间,合并更改以形成单个的数据版本。在合并过程中,如果多个订阅服务器修改相同的数据,可能会发生冲突。合并复制支持冲突解决程序的定义,即用来定义如何解决上述冲突的规则集。也可以编写自定义冲突解决程序脚本,以处理正确解决复杂冲突情形所需的任何逻辑。当自主运行对于订阅服务器计算机(例如移动的脱接用户)很重要时,或者当多个订阅服务器必须更新相同的数据时,使用合并复制。

======================================================================



----
         /
    <>< o /| /
   <>< (o / |/|
    ) ) <@ <
   ( O )( \ |\| <><
  ) <>< () \| \
         \

   天在ICQ:6074713           

[关闭][返回]