Information is provided about configuration files for use
with FlashCopy® cloning.
Tivoli® Storage FlashCopy Manager uses preprocessing
and postprocessing configuration files during cloning operations (for
example
/oracle/P01/acs/preprocessing.ini). The functions
that are provided by the processing scripts depend on the cloning
environment where they are issued. All processing configuration files
and the scripts that are defined in the configuration files must meet
the following requirements:
- Files and scripts are stored on the clone system.
- Files and scripts have permissions for read and write access for
the clone database instance owner. The preprocessing and postprocessing
scripts have permissions for read and write access for the user who
updates and runs the scripts. If the scripts are run by any user registered
on the system, the scripts are owned by the root user. The root user
has permission to read and write for the User, Group, and World user
groups.
- Files and scripts have permission for read access for the production
database instance owner.
Attention: If a write access level for the World user
group is given, there is a security risk.
When adding processing configuration files, place each script
on a separate line as shown in the following example:/oracle/P01/acs/scripts/PreProcessing_stopsap.sh
/oracle/P01/acs/scripts/PreProcessing_stopdb.sh
Both
processing configuration files support embedded user comments. A comment
line in the configuration file is denoted by the number sign character:
#.
The scripts are specified with fully qualified file names. Each line
of the processing configuration file represents one processing script.
The
FlashCopy Manager Offload
Agent,
tsm4acs, uses these arguments and their
values when calling the scripts:
- DBNAME_PROD
- The database name on the production system.
- DBNAME_CLONE
- The database name on the cloning system.
- DBHOST_PROD
- The host name of the production system.
- DBHOST_CLONE
- The host name of the cloning system.
- CLONE_TIMESTAMP
- The timestamp when the clone was created. This entry is also the
time when the production database is suspended and the FlashCopy operation begins. The timestamp
format is YYYYMMDDhhmmss. During preprocessing, the
timestamp identifies when the previous FlashCopy clone is created. During postprocessing,
the timestamp identifies when the current FlashCopy clone was created.
- SCHEMA
- The database schema of the production database as specified by
the profile parameter DATABASE_SCHEMA. Depending
on SAP Kernel release, this schema is SAPR3 or SAPDBname.
You can use the following processing scripts:
- SQL scripts (DB2® in an SAP environment or Oracle in an SAP environment)
with the extension .sql.
- Shell scripts with the extension .sh. Shell scripts
can be started by a database user who is different from the clone
database user. For example, when installing the SAP® license for the
cloned SAP® system, start the postprocessing shell script as the SAP®
administration user sidadm:
scripts/PostProcessing_saplicense.sh:c01adm
By
adding :c01adm to the script file name, the script
runs as user c01adm instead of user orac01 or db2c01.
This addition requires that the owner of the script to be identical
to the user who is intended operator of the script. In this example, c01adm is
the owner of the script. There is one exception. If a preprocessing
or postprocessing script is owned by the root user, the script can
be run by any user registered on the system.
The processing scripts that are defined in the processing configuration
files run sequentially. The return code of each script is validated.
The following values are used:
- RC=0
- Processing ends successfully. If this script is the last script
to be run, continue cloning. If this script is not the last script,
continue with the next script.
- RC=1
- Processing ends successfully with warning. If this script is the
last script to be run, continue cloning. If this script is not the
last script, continue with the next script.
- RC=2
- Processing ends with an error. Cloning immediately stops. No additional
scripts run.
The return code for each script is written to the cloning
log files. The output is written to dedicated log files with the following
file names:
clone_preproc.<timestamp>
clone_postproc.<timestamp>
Processing example: Cloning configuration files
In
the following processing example, the production database is named
P01,
and the clone database is named
C01:
./fcmcli -f preproc_clone -u db2c01 -C C01 -X /oracle/C01/acs/preprocessing.ini
./fcmcli -f postproc_clone -u db2c01 -C C01 -Y /oracle/C01/acs/postprocessing.ini
If
a processing script needs additional command-line options, add these
options to each line of the configuration file.
In this example,
the additional command-line argument LC01 is added
to the script entry in the configuration file:/oracle/C01/acs/scripts/PostProcessing_startListener.sh LC01
The
Tivoli Storage FlashCopy Manager command-line
interface issues a call to the processing script with the six default
arguments. After these arguments are provided, additional command-line
options are sent. In this example, the additional command-line argument
LC01 is
passed to the
PostProcessing_startListener.sh script
as the seventh argument:
#!/bin/ksh
# FOLLOWING ACTIONS ARE PERFORMED ---------------------------------------------
# start the Oracle Listener
DBNAME_PROD=$1
DBNAME_CLONE=$2
DBHOST_PROD=$3
DBHOST_CLONE=$4
CLONE_TIMESTAMP=$5
# ${SCHEMA} is schema owner (for SAP Kernel > 6.10, for userid other than SAPR3)
SCHEMA=$6
SCHEMA=$(echo ${SCHEMA} | tr [a-z] [A-Z])
# ${LISTENER} is the name of the listener to be started (taken from listener.ora)
LISTENER=$7
lsnrctl start ${LISTENER}
If a DB2 SQL script needs additional command-line
options, use a shell script as a wrapper with the DB2 SQL commands.
Tivoli Storage FlashCopy Manager requires
that the DB2 SQL script use
a semicolon delimiter:
;. If another delimiter
character is specified, use another shell script wrapper that calls
the DB2 SQL script with the
correct delimiter character in the command-line entry. This example
shows a shell script wrapper that specifies the correct delimiter
character:
#/bin/ksh
DELIMITER=#
db2 -td${DELIMITER} -svf PostProcessing_script1.sql