SQLDacApplication [SPFSDK][VMROLE]

 

适用于:Windows Azure Pack

SQLDacApplication 对象提供设置,用于在预配基于Windows的虚拟机时 (DC) 安装SQL Server数据层应用程序。

类型层次结构

ResourceExtension [SPFSDK][VMROLE].ExtensionSettings [SPFSDK][VMROLE].ApplicationProfile.WindowsApplicationProfile [SPFSDK][VMROLE].SQLDacApplication

语法

{
    "DeploymentName": "string",

    "ScriptCommands": [
        <Script>
    ],

    "SQLScriptCommands": [
        {
            "DatabaseName": "string",
            "DeploymentOrder": integer,
            "EncryptConnection": boolean,
            "ExecutionTimeoutSeconds": integer,
            "LoginTimeoutSeconds": integer,
            "OutputFilePath": "string",
            "SQLAuthenticationType": "string",
            "CommandParameters": "string",
            "SQLScriptApplicationPayloadId": "string",
            "ScriptCredential": credential string,
            "ScriptType": "string",
        }
    ],

    "ApplicationPayloadId": "string",
    "BlockOnChanges": boolean,
    "DacInstance": "string",
    "IgnoreDataLoss": boolean,
    "RollbackOnFailure": boolean,
    "SQLAuthenticationType": "string",

    "SQLDeploymentCredential": credential string,

    "SQLInstance": "string",
    "SkipPolicyValidation": boolean,
    "UninstallMode": "string",
}

属性

名称

类型

必须

默认值

说明

DeploymentName

字符串

部署的名称。

ScriptCommands

脚本数组 [SPFSDK][VMROLE]

Null

在预配期间运行的脚本。 Script.ScriptType 属性的唯一有效值为:

  • 预安装

  • PostInstall

  • PreService

  • PostService

  • PreUninstall

  • PostUninstall

SQLScriptCommands

SQLScriptCommand 数组

Null

使用安装SQL Server数据层应用程序运行的事务处理SQL脚本命令。

ApplicationPayloadId

字符串

ApplicationProfile.ApplicationPayload 项的标识符。 此有效负载必须指向 Transact-SQL 脚本 .sql 文件。

BlockOnChanges

布尔

如果为 true,则指示如果存在数据库偏移,则SQL Server数据层应用程序升级应失败。

有关详细信息,请参阅https://go.microsoft.com/fwlink/?LinkID=307133

DacInstance

字符串

SQL Server SQL Server实例的数据层应用程序名称。

IgnoreDataLoss

布尔

如果为 true,则指示在SQL Server数据层应用程序升级时应忽略数据丢失错误。

有关详细信息,请参阅https://go.microsoft.com/fwlink/?LinkID=307133

RollbackOnFailure

Boolean

如果 为 true,则指示在升级失败时应回滚数据库。

有关详细信息,请参阅https://go.microsoft.com/fwlink/?LinkID=307133

SQLAuthenticationType

字符串

用于部署SQL Server数据层应用程序的身份验证类型。 有效值是:

  • WindowsAuthentication

  • SQLAuthentication

SQLDeploymentCredential

字符串

在安装 SQL Server 数据层应用程序期间要使用的凭据,采用域\username:password 格式。

SQLInstance

字符串

MSSQLSERVER

要向其部署SQL Server数据层应用程序的SQL Server实例的名称。

SkipPolicyValidation

Boolean

如果为 true,则指示升级SQL Server数据层应用程序时应跳过SQL Server策略验证。

有关详细信息,请参阅https://go.microsoft.com/fwlink/?LinkID=307133

UninstallMode

字符串

有关数据库的SQL Server数据层应用程序的卸载行为。 有效值是:

  • MakeUnmanaged

  • DetachDatabase

  • DropDatabase

有关详细信息,请参阅https://go.microsoft.com/fwlink/?LinkID=307135

SQLScriptCommand

有关本部分使用的 Virtual Machine ManagerWindows PowerShell 脚本的详细信息,请参阅 https://go.microsoft.com/fwlink/?LinkID=218391

名称

类型

必须

默认值

说明

DatabaseName

String

运行此脚本命令的数据库的名称。

DeploymentOrder

int

运行此脚本命令的顺序。

EncryptConnection

布尔

False

如果为 true,则指示与SQL Server实例的连接加密。

ExecutionTimeoutSeconds

int

脚本命令的超时(以秒为单位)。

LoginTimeoutSeconds

建立与 SQL Server 实例的连接(以秒为单位)的超时。

OutputFilePath

字符串

用于捕获所有输出的日志文件路径。

SQLAuthenticationType

字符串

用于部署SQL Server数据层应用程序的身份验证类型。 有效值是:

  • WindowsAuthentication

  • SQLAuthentication

CommandParameters

字符串

Null

与 SQL 命令一起使用的命令参数的名称值对。

有关详细信息,请参阅 Sqlcmd 工具文档的 -v 开关。https://go.microsoft.com/fwlink/?LinkID=154481

SQLScriptApplicationPayloadId

字符串

ApplicationProfile.ApplicationPayload 项的标识符。 此有效负载必须指向 Transact SQL脚本 .sql 文件。

ScriptCredential

字符串

用于以 域\username:password 格式运行脚本的凭据。

ScriptType

字符串

脚本何时应运行规范。 有效值是:

  • 预安装

  • PostInstall

  • PreService

  • PostService

  • PreUninstall

  • PostUninstall

备注

下面的代码示例提供了一个 示例 SQLDacApplication 对象。

{
    "DeploymentName": "SQL App 1",

    "ScriptCommands": [
        {
            "AlwaysReboot": false,
            "ApplicationPayloadId": null,
            "ErrorPolicy": "FailOnMatch",
            "ExecutableAndParams": null,
            "ExitCodeRegex": "[1-9][0-9]*",
            "MaxOutputSize": 1048576,
            "RebootExitCodeRegex": "{1641}|{3010}|{3011}",
            "RestartOnRetry": false,
            "ScriptBlock": "rem some script that needs to run before sqldac package is installed",
            "ScriptCredential": {
                "Password": "mypassword4",
                "UserName": "dcmanagerlab\\esdcvsec4"
            },
            "ScriptType": "PreInstall",
            "StandardErrorPath": "c:\\err.txt",
            "StandardErrorRegex": ".+",
            "StandardInput": null,
            "StandardOutputPath": "c:\\out.txt",
            "StandardOutputRegex": null,
            "TimeoutInSeconds": 900,
            "WorkingDirectory": null
        }
    ],

    "SQLScriptCommands": [
        {
            "DatabaseName": "[Param.SharepointDB]",
            "DeploymentOrder": 1,
            "EncryptConnection": false,
            "ExecutionTimeoutSeconds": 500,
            "LoginTimeoutSeconds": 50,
            "OutputFilePath": "c:\\sharepointDB.sql.log",
            "SQLAuthenticationType": "WindowsAuthentication",
            "CommandParameters" : "VAR1=42 VAR2=\"Example String\"",
            "SQLScriptApplicationPayloadId": "db04416b-d0a8-44d5-b0ee-d5739378a98d",
            "ScriptCredential": "[Param.SQLScriptCommandCredential]",
            "ScriptType": "PostInstall"
        }
    ],

    "ApplicationPayloadId": "5b064b6a-d6d0-48f0-8979-9aafc676a9e5",
    "BlockOnChanges": false,
    "DacInstance": "[Param.SharepointDB]",
    "IgnoreDataLoss": false,
    "RollbackOnFailure": true,
    "SQLAuthenticationType": "WindowsAuthentication",

    "SQLDeploymentCredential": "[param.SQLDeploymentCredential]",

    "SQLInstance": "[Param.SQLInstance]",
    "SkipPolicyValidation": true,
    "UninstallMode": "DropDatabase"
}

另请参阅

ApplicationProfile.WindowsApplicationProfile [SPFSDK][VMROLE]
SQLProfile [SPFSDK][VMROLE]
WebDeployApplication [SPFSDK][VMROLE]
ScriptApplication [SPFSDK][VMROLE]
脚本 [SPFSDK][VMROLE]