Remote Copy Scripts for Windows-based Oracle
Posted: Fri Jul 28, 2017 3:04 pm
Preface:
I'm not looking for advice on how to do this but comments on making things better is always welcome. I'm also not looking for anyone's blessings on my design or how it is deployed, this is the best I could come up with and works great for me. My sole reason for sharing is the lack of information existing on deploying Remote Copy and HPE support's complete lack of understanding and/or willingness to help and just wanting to engage in an expensive and useless services engagement.
My Environment:
-Source 3PAR's: 7450 and 8440
-Destination 3PAR: 8440
-Operating Systems is W2k8R2 and W2k12R2
-Because we are running Windows we are unable to use HP's Oracle Agent
-Oracle 12c Enterprise (4 servers totaling 32TB)
-Dedicated Remote Copy Groups created for each server containing all of the LUN's for consistency
-Remote Copy is configured as Periodic Async with all 4 RCIP ports active on each array
-Connection between data centers is dedicated 1GB fibre (not dark)
Core Requirements for Replication:
-Need to place the databases into hot backup mode prior to the RC sync
-Need to take the databases out of hot backup mode after the RC snapshots have been completed
-Need to log all activities
-Need to email success and failure notifications
-Need to easily control the schedule
-Need to allow non-SAN people to manually run this on demand
Prerequisites:
-Created encrypted password file for 3PAR auth
-Note: I have a dedicated Windows VM where SSMC and 3PAR CLI is installed and this is also where my Scheduled Tasks are configured to run
-Created the following folder structure on the SSMC server: "D:\3parlogs\RemoteCopy\Archive"
-SQL scripts written to put the database into and take it out of hot backup mode
-Scheduled task created on the destination server (DB server) where credentials are specified to run the start and end hot backup mode scripts.
Script Flow Overview:
-Scheduled tasks is configured to run every 6 hours
-Launches a batch file named "<servername>_rcg.cmd"
-Set script specific environment variables
-Set 3PAR variables:
-3PAR Name
-Encrypted password file path
-Set System Variables
-Source server name
-Remote copy group name
-Set Email Variables:
-SMTP IP/CNAME/Servername
-From address (SSMC Server)
-To addresses (email or DL)
***Note: THE ABOVE VAIABLES ARE THE ONLY SETTINGS THAT NEED TO BE SET FOR THIS SCRIPT TO RUN***
-Pipe variables to log file (assists with troubleshooting)
:startrcopy
-Start the RCG
-Pipe out the RCG status
-Delete the Oracle trigger files on the source server showing before and after delete operation
:starthotbackup
-Launch the start hot backup mode scheduled tasks on the source server (DB)
-if the scheduled task fails it will abort the script and send an email
:rcsync
-Launch the RC sync operation on the 3PAR
:endhotbackup
-Launch the end hot backup mode scheduled tasks on the source server (DB)
-if the scheduled task fails it will abort the script and send an email
:rcsyncstatus
-The "showrcopy groups <rcg_anme>" command is piped to a txt file which this routine will check every 30 seconds, as soon as the log no longer contains the word "Syncing" it will complete and send out the success email.
I'm not looking for advice on how to do this but comments on making things better is always welcome. I'm also not looking for anyone's blessings on my design or how it is deployed, this is the best I could come up with and works great for me. My sole reason for sharing is the lack of information existing on deploying Remote Copy and HPE support's complete lack of understanding and/or willingness to help and just wanting to engage in an expensive and useless services engagement.
My Environment:
-Source 3PAR's: 7450 and 8440
-Destination 3PAR: 8440
-Operating Systems is W2k8R2 and W2k12R2
-Because we are running Windows we are unable to use HP's Oracle Agent
-Oracle 12c Enterprise (4 servers totaling 32TB)
-Dedicated Remote Copy Groups created for each server containing all of the LUN's for consistency
-Remote Copy is configured as Periodic Async with all 4 RCIP ports active on each array
-Connection between data centers is dedicated 1GB fibre (not dark)
Core Requirements for Replication:
-Need to place the databases into hot backup mode prior to the RC sync
-Need to take the databases out of hot backup mode after the RC snapshots have been completed
-Need to log all activities
-Need to email success and failure notifications
-Need to easily control the schedule
-Need to allow non-SAN people to manually run this on demand
Prerequisites:
-Created encrypted password file for 3PAR auth
-Note: I have a dedicated Windows VM where SSMC and 3PAR CLI is installed and this is also where my Scheduled Tasks are configured to run
-Created the following folder structure on the SSMC server: "D:\3parlogs\RemoteCopy\Archive"
-SQL scripts written to put the database into and take it out of hot backup mode
-Scheduled task created on the destination server (DB server) where credentials are specified to run the start and end hot backup mode scripts.
Script Flow Overview:
-Scheduled tasks is configured to run every 6 hours
-Launches a batch file named "<servername>_rcg.cmd"
-Set script specific environment variables
-Set 3PAR variables:
-3PAR Name
-Encrypted password file path
-Set System Variables
-Source server name
-Remote copy group name
-Set Email Variables:
-SMTP IP/CNAME/Servername
-From address (SSMC Server)
-To addresses (email or DL)
***Note: THE ABOVE VAIABLES ARE THE ONLY SETTINGS THAT NEED TO BE SET FOR THIS SCRIPT TO RUN***
-Pipe variables to log file (assists with troubleshooting)
:startrcopy
-Start the RCG
-Pipe out the RCG status
-Delete the Oracle trigger files on the source server showing before and after delete operation
:starthotbackup
-Launch the start hot backup mode scheduled tasks on the source server (DB)
-if the scheduled task fails it will abort the script and send an email
:rcsync
-Launch the RC sync operation on the 3PAR
:endhotbackup
-Launch the end hot backup mode scheduled tasks on the source server (DB)
-if the scheduled task fails it will abort the script and send an email
:rcsyncstatus
-The "showrcopy groups <rcg_anme>" command is piped to a txt file which this routine will check every 30 seconds, as soon as the log no longer contains the word "Syncing" it will complete and send out the success email.