beautypg.com

Sample input parameters, Implementation – HP Storage Essentials Enterprise Edition Software User Manual

Page 81

background image

User Guide

67

This section describes the following:

Sample Input Parameters

, page 67

Implementation

, page 67

Sample Input Parameters

A script designed to attach the SAP Database Instance for a particular system must be provided with

the following input parameter:

SID

: System ID of the SAP system installed on the Managed Node

The command line interface for this script is the following:

attachDB.cmd SID

The header in the attachDB.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

attach the SAP Database Instance. The sample script includes all of the necessary steps. Have the
attachDB.cmd.rename script open in an editor for reference to best follow these instructions:

1.

Run the SQL stored procedure that prepares the running SQL server to attach the Database

Instance. A sample stored procedure to perform this task is hpqcc_attach_db, which is

included in the hpqcc_attach_db.sql.rename file in the sample directory. This stored

procedure creates a specific file (attachDB_%SID%.sql) for the SAP instance ID. This file

contains a single SQL command, as shown below, that is later executed by the sample script as

described in

step 3

below.

exit(

hpqcc_attach_db 'X22', @filename1 =

N'C:\database\X22\X22_DATA_DISK\X22DATA1.mdf'

)

The hpqcc_attach_db.sql.rename sample file also includes a separate SQL procedure

called sp_detach_db. The purpose of this stored procedure is to detach the Database

Instance before the hpqcc_attach_db procedure is executed.
The sample SQL stored procedures can be run separately using the SQL Server before running

the sample attachDB.cmd script.

2.

Start the SQL server service. In the sample script, this is done only if the service is stopped. If the

SQL server is already running and a script tries to start it again, the Windows operating system

will display an error message.

3.

Run the attachDB_%SID%.sql stored procedure created in step 1, and confirm that the

Database Instance has been successfully attached. This is done in the sample script by printing a

message in a specific file (C:\database\X22\X22_DATA_DISK\X22DATA1.mdf). This file

is used to store either a successful message (indicating that the Database Instance has been

attached), or an error message stating otherwise.