Upgrades an existing Touchstone®
Database.
Upgrading a Database means updating it to the latest version.
You can upgrade a database from one release of Touchstone to the next major release of Touchstone. For example, you can upgrade a Touchstone 3.x database to Touchstone 4.x.
To view the current version of your Touchstone client, use the GetSecurityPolicy() method.
Parameters
- request
- Contains a SubmitUpgradeDatabaseRequest that identifies the properties of the Database that you want to upgrade, along with the associated Touchstone-generated Business Unit Sequential Identifier (SID) and SQL Instance SID.
Return Value
A
SubmitUpgradeDatabaseResponse containing the
Activity SID that uniquely identifies the asynchronous web service call that you made to upgrade the specified Database.
The following example shows how to upgrade a Touchstone Database using the
SubmitUpgradeDatabase()
method:
using System;
using System.Linq;
using AIR.Services.Common.Data;
using AIR.Services.DataSourceManagement.Api;
using AIR.Services.DataSourceManagement.Data;
class SnippetSubmitUpgradeDatabaseRequest
{
private static void SubmitUpgradeDatabase(int businessUnitSid, int sqlInstanceSid, string dbServerName, string dbName)
{
DataSourceManagementServiceClient dsClient = new DataSourceManagementServiceClient();
GetDatabasesRequest request = new GetDatabasesRequest();
request.BusinessUnitSid = businessUnitSid;
request.SqlInstanceSid = sqlInstanceSid;
request.DataServerName = dbServerName;
GetDatabasesResponse response = dsClient.GetDatabases(request);
if (response.Status.Code == StatusCode.Success)
{
/// Find the Data Source object.
Database db = response.Databases.FirstOrDefault(d => d.Name == dbName);
if (db == null)
{
Console.WriteLine("Database not found");
return;
}
SubmitUpgradeDatabaseRequest upgradeDatabaseRequest = new SubmitUpgradeDatabaseRequest();
/// Set the BusinessUnitSid property (required property)
upgradeDatabaseRequest.BusinessUnitSid = businessUnitSid;
/// Set the SqlInstanceSid property (required property)
upgradeDatabaseRequest.SqlInstanceSid = sqlInstanceSid;
/// Set the database to upgrade (required property)
upgradeDatabaseRequest.Database = db;
/// Submit the request and get response back
SubmitUpgradeDatabaseResponse upgradeDatabaseResponse = dsClient.SubmitUpgradeDatabase(upgradeDatabaseRequest);
if (upgradeDatabaseResponse.Status.Code == StatusCode.Success)
Console.WriteLine("Submitted successfully to HPC with Activity ID: " + upgradeDatabaseResponse.ActivitySid);
}
}
}
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2