Sharepoint学习笔记—习题系列--70-576习题解析 -(Q92-Q94)

Question  92 
You are designing a SharePoint 2010 application. You need to make sure the application aggregates list items from multiple site collections into a single view. Which object should you recommend to accomplish this?
A. SPListItemCollection
B. SPSiteDataQuery
C. SPQuery
D. Keyword Query


解析:
  如果你想要通过你设计的Sharepoint2010应用程序在一个列表视图中汇集显示来自于不同网站集的其它列表的数据,你该采用哪个对象来完成此任务呢?
  直接分析备选项:
选项A. SPListItemCollection类用于返回某个列表或文档库中的所有记录项。它针对的是单个List或document library。显然不符合本题要求的跨多个网站集的多个List的要求。
 选项B. SPSiteDataQuery对象功能比较强大, sharepoint 里面还有个SPQuery对象【如选项C】,一个是基于列表(list)里面来查询,一个可以跨列表来查询。但不论哪种,它们都受限于同一网站集,无法实现本题所要求的跨网站集查询。所以均排除。
选项D. Keyword Query,我们可按企业级搜索查询体系结构中指定的方式访问对象模型。在使用查询对象模型时,可通过使用 KeywordQuery 类的 QueryText 属性来指定查询字符串。默认查询类型是关键字查询语法。通过关键字查询建立覆盖整个Sharepoint。
因此本题答案应该选 D

参考 
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.splistitemcollection.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.spquery(v=office.12).aspx
http://msdn.microsoft.com/zh-cn/library/ee558911.aspx
http://msdn.microsoft.com/zh-cn/library/ff394628(v=office.14).aspx

 

Question  93
You are designing the environment for a SharePoint 2010 server farm. You need to design the environment to meet the following requirements:
.SharePoint must log critical error messages to the Windows Event Log.
.To save log space, duplicate error messages must not be logged.
Which approach should you recommend?
A. Restrict the Trace Log disk usage space to 1 GB.
B. Enable Event Log Flood Protection.
C. Find the error category and set the "Least critical event to report to the event log" value to "Warning" for that category.
D. Find the error category and set the "Least critical event to report to the trace log" value to "None".

解析:
 你需要设计一个Sharepoint2010服务器场以满足如下要求:
 要求1. Sharepoint必须记录所有的关键错误信息到Windows Event Log中
 要求2. 为节省日志空间,重复的错误信息必须被排除
 本题是关于Sharepoint日志配置的问题。
 SharePoint Server 2010 环境可能要求您在首次部署或升级后配置诊断日志记录设置,也可能在整个系统生命周期内要求您这样做。以下列表中列出的准则可帮助您制定出针对特定环境的最佳实践。
• 更改日志将写入到的驱动器。默认情况下,诊断日志记录将配置为将日志写入到已安装 SharePoint Server 2010 的同一驱动器和分区。由于诊断日志记录会使用大量驱动器空间,并且写入日志会影响驱动器性能,因此应将日志记录配置为将日志写入到与已安装 SharePoint Server 2010 的驱动器不同的驱动器。还应考虑与日志写入到的驱动器的连接速度。如果配置详细级别日志记录,则将记录大量日志数据。这样一来,连接速度较慢可能会导致日志性能较低。
• 限制日志磁盘空间使用率。默认情况下,诊断日志记录可使用的磁盘空间量是不受限制的。因此,限制日志记录使用的磁盘空间量可确保磁盘不会被填满,尤其是在将日志记录配置为写入详细级别的事件时。在使用完限定的磁盘空间量后,将删除最早的记录并记录新的日志记录数据信息。【选项A涉及此知识点,从描述可知,选项A不满足要求1,所以应该排除】
• 慎用“详细”设置。可以将诊断日志记录配置为记录详细级别的事件。这意味着系统将记录 SharePoint Server 2010 采用的每个操作。详细级别日志记录会快速使用驱动器空间并会影响驱动器和服务器的性能。可以在进行重要更改时使用详细级别日志记录来记录更高级别的详细信息,然后将日志记录重新配置为仅在进行更改后记录更高级别的事件。
• 定期备份日志。诊断日志包含了重要数据。定期备份这些日志可确保保留此类数据。若限制日志驱动器空间使用率或只将日志保留几天时间,则在达到相应阈值时,将自动删除日志文件(首先删除最早的日志文件)。
• 启用事件日志淹没保护(Event Log Flood Protection)。启用此设置可将系统配置为检测 Windows 事件日志中的重复事件。在重复记录同一个事件时,将会检测到重复事件并加以阻止,直到条件返回某个典型状态。【选项B所涉及的知识点,从描述可判断,选项B符合本题的要求】
  选项C.D涉及Least critical event to report to the event log(要报告给事件日志的关键程度最低的事件)设置,其设置是用于配置事件限制,结果会满足不了要求1。所以予以排除。

因此本题答案应该选 B

参考 
http://msdn.microsoft.com/zh-cn/library/gg193966(v=office.14).aspx#中国(简体中文)
http://technet.microsoft.com/zh-cn/library/ee748656(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ff604025(v=office.14).aspx

 

Question  94
Your developers have discovered an issue with a SharePoint 2010 application. The code has produced an exception and SharePoint has rendered an error page in the browser. The error page displays a Correlation ID and the time when the error occurred. You need the developers to investigate the problem by viewing logged exception messages. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Open the SharePoint content database. Filter the Event Log table for rows with an Event Time column value the same as the time shown on the error page and with an Event Data column value equal to the Correlation ID found on the error page.
B. Open the Application Event Log on the server. Filter the events for an exception that occurred at the time shown on the error page, and with a Source value equal to the Correlation ID found on the error page.
C. Search for an exception in the SharePoint Unified Logging Service (ULS) logs with the same Correlation ID and time stamp displayed on the error page.
D. Use the Power Shell get-splogevent command, passing in the Correlation ID as a parameter, which will return a list of items in the ULS log with the same Correlation ID. Look for an exception that occurred at the time shown on the error page.

解析:
   开发人员发现了一个Sharepoint2010应用程序的问题: 程序代码产生了Exception报错并且Sharepoint把相关信息呈现到了报错页面。此页面上显示了Correlation ID以及错误发生的时间。你要求开发人员通过查找相关日志文件来查出具体的原因(两个选项答案)。
   长期以来,系统管理员都将有效的日志记录策略作为一种方式来跟踪组件和应用程序问题、为应用程序历史记录提供可计量的统计信息、帮助解决疑难问题以及帮助监视管理员所负责的系统的整体运行状况。在Sharepoint中,开发人员则常常会使用 Microsoft SharePoint Foundation 提供的日志记录机制来更轻松地开发应用程序和提供更深入的调试信息,以及在遇到问题或达到阈值时与系统管理员进行沟通。Sharepoint中的主要日志记录机制是统一日志记录服务 (ULS),它将 SharePoint Foundation 事件写入 SharePoint 跟踪日志并将它们存储在文件系统中。(注意:ULS 日志有时也称为跟踪日志。)
   每台运行SharePoint Server的服务器都会将日志记录信息写入 ULS 日志文件和服务器事件日志。在服务器场中每台运行 SharePoint 的服务器上的 {SharePoint Root}\LOGS 文件夹中找到的 ULS 日志文件可包含相当多的信息,具体取决于诊断日志限制的配置情况。尽管通常情况下日志记录越详细越好,但在日志文件中查找特定项可能会有一定难度。通过为每个日志项分配唯一性,SharePoint 2010 提高了查找特定日志项的效率。此唯一性(称为相关令牌Correlation ID)是一个在出现错误时提供给用户的 GUID。管理员或开发人员随后可在错误中提取此 GUID 字符串,并使用它在日志文件中搜索特定项。这将加快在日志文件中查找项的速度以便跟踪特定事件。
   我们还能够使用 Windows PowerShell cmdlet 执行管理任务。此技术还可用于处理统一日志记录服务 (ULS) 的日志设置。ULS 可提供 Windows PowerShell cmdlet 来执行大量操作,包括:

  •  更改 ULS 配置设置
  •  跟踪和事件级限制
  •  刷新当前日志和启动新日志
  •  查询和筛选跟踪日志(可配合Correlation ID快速定位相关信息)
  •  合并多台计算机的跟踪日志

Microsoft 引入的另一个更改是一个新数据库,即: 日志记录数据库,该数据库包含服务器场中的所有服务器的所有日志记录信息。通过使用几个新的计时器作业即可做到这一点。在启用这些作业(默认情况下它们处于禁用状态)后,SharePoint 会将诊断日志记录数据插入新的 Microsoft SQL Server 数据库。
  在本题的备选项中,只有选项C.D涉及ULS的操作,且符合上述的描述。
  选项A.是在内容数据库中去找Event Log table,实际上Sharepoint的日志记录数据库是一个新的数据库,它并不在内容数据库中。
  选项B是使用的应用程序日志(Application Event Log),它针对的并不是Sharepoint环境,Windows系统将事件记录在以下三种日志中:
1.应用程序日志 :应用程序日志包含由程序记录的事件。例如,数据库程序可能在应用程序日志中记录文件错误。写入到应用程序日志中的事件是由软件程序开发人员确定的。
2.安全日志 :安全日志记录有效和无效的登录尝试等事件,以及与资源使用有关的事件(如创建、打开或删除文件)。例如,在启用登录审核的情况下,每当用户尝试登录到计算机上时,都会在安全日志中记录一个事件。您必须以 Administrator 或 Administrators 组成员的身份登录,才能打开、使用安全日志以及指定将哪些事件记录在安全日志中。
3.系统日志 :系统日志包含 Windows 系统组件所记录的事件。例如,如果在启动过程中未能加载某个驱动程序,则会在系统日志中记录一个事件。Windows预先确定由系统组件记录的事件。
  所以选项B也被排除。
因此本题答案应该选 C.D

参考 
http://msdn.microsoft.com/zh-cn/library/gg512103(v=office.14).aspx
http://msdn.microsoft.com/zh-cn/library/ff512738(v=office.14).aspx
http://technet.microsoft.com/en-us/library/hh769360(v=office.14).aspx
http://book.51cto.com/art/200809/89903.htm

posted @ 2013-11-07 07:37  wsdj  阅读(610)  评论(0编辑  收藏  举报