Detaching the sap database instance, Sample input parameters, Implementation – HP Storage Essentials Enterprise Edition Software User Manual
Page 82
Application Scripts Description and Usage
68
4.
This script can be further improved by adding code that displays additional error messages if
any of the preceding steps is not completed. This is also illustrated in the sample script provided.
After customizing the script, verify that the script has successfully attached the Database Instance.
This process may vary depending on the particular system. Consult the corresponding vendor
documentation.
Prior to running the resulting script, the SQL service must be installed, and the user running the script
must have administrative permission to make changes on that server.
Detaching the SAP Database Instance
The purpose of this script is to detach the SAP Database (DB) Instance from the target SQL server.
This section describes the following:
Sample Input Parameters
A script designed to detach the SAP Database Instance from a particular system must be provided
with the following input parameters:
•
SID
: System ID of the SAP system installed on the Managed Node
•
VHOST
: Virtual hostname of the SAP DB
The command line interface for this script is the following:
detachDB.cmd SID VHOST
The header in the detachDB.cmd.rename sample script contains this command line interface
and variables used by the sample script. Read the legal disclaimer before running any sample
script.
Implementation
This section provides a brief description of the steps that must be included in a script designed to
detach the SAP Database (DB) Instance from the target SQL server. The sample script includes all of
the necessary steps. Have the detachDB.cmd.rename script open in an editor for reference to
best follow these instructions:
1.
Verify that the SQL server is not already running, and then start the SQL server. The script
performs this task by creating a file that contains a list of stopped services and checking if the
SQL server service is in this list. This verification is done to avoid Windows error messages.
2.
Run a SQL stored procedure that removes the stored procedures corresponding to the SAP
Database Instance that you want to remove. A sample stored procedure that performs this task is
included in the sap_clear_db.sql.rename file located in the sample directory.
3.
Run a SQL stored procedure to detach the SAP Database Instance. The sample stored procedure
to perform this task is hpqcc_detach_db, which is included in the
hpqcc_attach_db.sql.rename file in the sample directory. Similar to the approach used
for attaching the Database Instance, a success message or error message is generated and read
to confirm if the stored procedure has run successfully.