Admin.GetDatabaseTimeout 方法
读取 SQL 超时设置用于 Project Server 核心数据库,以秒为单位。
命名空间: WebSvcAdmin
程序集: ProjectServerServices(位于 ProjectServerServices.dll 中)
语法
声明
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Admin/GetDatabaseTimeout", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Admin/", _
ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Admin/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetDatabaseTimeout ( _
timeoutType As DatabaseTimeoutType _
) As Integer
用法
Dim instance As Admin
Dim timeoutType As DatabaseTimeoutType
Dim returnValue As Integer
returnValue = instance.GetDatabaseTimeout(timeoutType)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Admin/GetDatabaseTimeout", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Admin/",
ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Admin/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public int GetDatabaseTimeout(
DatabaseTimeoutType timeoutType
)
参数
timeoutType
类型:WebSvcAdmin.DatabaseTimeoutType在 Project Server 中可用的唯一值是Core常量 (值 = 0),它指定核心数据库。
返回值
类型:System.Int32
核心数据库的超时值。
备注
提示
在某些 Project Server 部署中,默认的数据库超时值不够。如果 Project Server 作业失败由于 SQL 超时错误,管理员可以通过使用SetDatabaseTimeout方法中,增加数据库超时设置,然后重试作业。
最小值和默认值为 30 秒。最大值是Int32最大或 2147483647 秒 (超过 15 年)。
若要读取 SQL 命令项目队列或时间表队列的超时值,可以使用ReadQueueConfiguration方法,或使用Project Web App (https://ServerName/ProjectServerName/_layouts/pwa/Admin/queuesettings.aspx) 中的队列设置页。
Project Server 权限
权限 |
描述 |
---|---|
允许用户管理 Project Server 的配置信息。全局权限。 |
示例
若要使用以下Windows PowerShell脚本,保存在文件命名,例如, Get DatabaseTimeout.ps1中的脚本。以管理员身份 (开始菜单的Microsoft SharePoint 2010 项目文件夹中) 中运行SharePoint 2010 Management Shell ,导航到保存 Get DatabaseTimeout.ps1 文件的目录,然后键入以下命令: .\Get-DatabaseTimeout
###############################################################################
## Get-DatabaseTimeout
## Uses the Admin web service of the PSI to call the GetDatabaseTimeout method.
## The script user must have Project Server administrator permissions.
## To run on your Project Server installation, change the $pwaUrl value.
################################################################################
$pwaUrl = "https://ServerName/ProjectServerName"
$svcAdminUrl = $pwaUrl + "/_vti_bin/PSI/Admin.asmx?wsdl"
$c = get-credential
# Create a proxy for the Admin web service.
$svcAdminProxy = New-WebServiceProxy -uri $svcAdminUrl -credential $c
$secTimeout = $svcAdminProxy.GetDatabaseTimeout(0)
Write-Host "Database timeout for Project Server: $secTimeout seconds"