最近接连有人问到数据库连接的问题,就把这篇文章拿出来翻译一下,希望能对碰上类似问题的朋友有所帮助。
PS 用数据库一个好处就是不用费神费力地去写一大堆的Customsettings.ini,至少我当初就是为了这个原因去捣鼓AdminDB
 

BDD 2007 - Troubleshooting Database issues

I have lost count of the number of times I have been asked to help some troubleshoot their database issues, so I decided it was time to write a blog about it. This blog details the common issues faced when using the BDD configuration database. The first part details the common causes of database issues and the second recommends troubleshooting methods.
我已经忘了多少次被求助于解决数据库的问题,所以我决定写这篇blog。这篇blog描述了配置BDD配置数据库时通常遇到的问题。第一部分描述了造成问题的原因,第二部分则是排查问题的方法

Common issues常见问题

The following section details common issues and recommended configurations for each. 
Database Rules - Ensure that the appropriate database rules have been created. Database rules are specified using the deployment point rules tab. Configuration database rules can be created manually or using the Configure DB Wizard in the Deployment Workbench.
数据库规则——确认已经创建了合适的数据库规则。数据库规则在分发点的rules中进行配置,配置数据库规则既可以手动创建,也可以用config DB来自动创建
A typical database section should look similar to the follwing:例如:
[CSettings]
SQLServer=SERVERNAME
Database=BDDAdminDB
Netlib=DBNMPNTW
SQLShare=logs
Table=ComputerSettings
Parameters=MacAddress
ParameterCondition=OR
The critical components of the database section are:以下几个组件是必须配置的
  • SQLServer - must specify the SQL server that hosts the BDD configuration database.指定包含BDD配置数据库的服务器
  • SQLShare – must be a valid share on the SQL server and the user account (UserID as specified in the rules) must have access rights to that share. If SMS OSD Feature Pack is used for deployment then the SMS Advanced Client installation account will require access rights rather than the user account. 指定一个数据库服务器上的共享,而且你用于连接Distribution共享的帐号必须有登录这个共享的权限。如果你似乎用了OSD,则SMS Advanced Client安装帐号得有这个权限,而不是用户帐号。
  • Netlib – there are many issues with using TCP/IP sockets based connections so ONLY USE NAMED PIPES (DBNMPNTW).必须使用命名管道
Database connectivity issues – There are a number of issues that can stop the client connecting to the SQL server, these are detailed below:有许多问题可能导致客户端断开连接
  • Ensure that Named Pipes is enabled for remote connectivity on the SQL server, this is not enabled by default. 确认你的SQL服务器打开了命名管道
  • Has the surface area been configured to enable Named Pipes? When using SQL 2005 it is important to ensure that the “Surface area” is configured in such a way that remote connectivity to Named Pipes is allowed. 2005下在你的外围配置里打开命名管道
  • If you have issues accessing the database from the workbench then ensure that you are using Named Pipes. The Deployment Workbench always uses Named Pipes to connect to the database.还是命名管道.....
Security - has the deployment account got the appropriate database rights? The account used will need read rights to the BDD admin database. The account can vary depending on the deployment type: 你的部署帐号是否有足够的数据库权限?帐号需要数据库的admin权限,而且根据部署方式不同也有所区别
  • ZTI – The SMS advanced client installation account.SMS高级客户端安装帐号
  • LTI – The user account specified in the rules (bootstrap.ini).bootstrap里配置的帐号
SQL instances – If you are connecting to a database instance then this instance must be specified. This value is specified using the Instance field in the deployment workbench. 如果你连接到数据库的某个特定实例,那这个值就必须填写

Troubleshooting methods

During the troubleshooting process it is critical that you can easily test the database rules. The following instructions detail how to manually test the database connectivity. The rules specified in the deployment point can be tested without running through the entire BDD build process. Rules are processed using a script called ZTIGather.wsf, this script can be run separately from the other BDD scripts allowing easy testing. The steps below detail the process required to perform manual rule testing. To properly reflect the deployment environment it is important to perform these tests from a client device: (一堆废话,不翻了)
 
  1. Create a folder on the client device and copy the following files from the deployment point to this folder: 在客户端上建立一个目录,并把下列文件从分发点上拷贝过去
  • ZTIGather.wsf
  • ZTIGather.xml
  • ZTIUtility.vbs
  • CustomSettings.ini
  2. Delete C:\MININT directory if it already exists. This folder can also be located at X:\MININT if the C drive is not available.删掉C盘的MININT文件夹
NOTE: BDD stores configuration and progress information in the MININT folder, if this folder is not removed between tests then the results will be invalid.
  3. From the command prompt navigate to the newly created folder and execute the rule processing script using the following command: 运行命令
"cscript.exe ZTIGather.wsf /debug:true"
      The script will then be processed and the results outputted to the command prompt and a log file ( .\MININT\SMSOSD\OSDLOGS\ZTIGather.log)脚本会把运行结果保存在minint目录里
NOTE: The script can be run within Windows PE or the host operating system.
  4. Review the results of the script.
The following screen shots show five examples of the output that you will see from this process. The first three screen shots show general database lookups while the other two show common errors you are likely to see.
This screen shoot shows a successful connection to the database. The computer record is then queried based on the MAC Address and the OSINSTALL, COMPUTERNAME and MACHINEOBJECTOU values are returned.
排查BDD2007数据库连接问题_休闲  
The next two screen shots show a database lookup based on the make and model of the client device. In the first screen shot shows a database lookup based on a Virtual PC client where the model is a "Virtual Machine" and the make is "Microsoft Corporation".  This record does not exist in the database and the log reflects this - "Record count from SQL = 0". I then created a record in the database using this information and assigned an application to the model type via the deployment workbench. The script is then rerun and and the lookup successfully returns the application. (Second screen shot).
排查BDD2007数据库连接问题_职场_02
排查BDD2007数据库连接问题_MDT_03
NOTE: Applications are identified as GUID's in the BDD logs. To determine which application is represented by the GUID you should reference the applications.xml file.
The following screen shot show the results of a database look up where the user account does not have rights to the database. The important thing to note is the error message - "login failed for user 'WOODGROVE\BDDBuild'". Remember that the user account must have at least read rights to the BDD configuration database.
排查BDD2007数据库连接问题_MDT_04
The following screen shot show the results of a database look up where named pipes has been disabled. The important thing to note is the error message, "SQL Server does not exist or access denied". This problem can be caused by a number of issues, please refer to the database connectivity issues point above.
排查BDD2007数据库连接问题_MDT_05
Hopefully this will help get you started with troubleshooting your BDD configuration database issues.
  • 收藏
  • 评论
  • 举报
提问和评论都可以,用心的回复会被更多人看到 评论
发布评论
相关文章