1827474 Members
1845 Online
109965 Solutions
New Discussion

Automation Script

 
SOLVED
Go to solution
John Pyle
Occasional Advisor

Automation Script

I have an EMC Symmetrix that holds the databases for my two servers. Through the use of the BCV disks on the Symmetrix I have been performing cold backups on a weekly basis. I have automated the process of synchronizing the disks with a symmetrix disk group and would like to further automate the process of bringing down the database and splitting the BCV disks. I have a script that will bring down the database instances and the listener in Oracle7?s path. Another that starts the synchronization and a third that "watches" the synchronization process and pages me when the process is complete, these run as root. My question is this, I usually bring down the database as Oracle7 and perform the BCV split as root, not sure if this is necessary but that is how I've always done it. I would like to do this all as root but I?m not sure that is wise. If Oracle7 should bring down the database, I would like to create a script that would start the synchronization process as root, when the sync is complete su to Oracle7 and bring down the database, test to insure the database processes are stopped, split the bcv as root, su back to Oracle7 and bring up the database processes. Has anyone had any experience with something as convoluted as this?
Administrators make better brewers
2 REPLIES 2
Keith Bunge
Occasional Advisor
Solution

Re: Automation Script

Yeah this is similiar to some of the things I've setup before. All you really need to do is alter the parts of your script that bring down and bring up the database. Make sure that the part that brings down and up the database are separate shell scripts. I'll call them:

/usr/local/bin/down_database.sh
/usr/local/bin/up_database.sh

In your scripts where you call these just change the call to something like this.

su - oracle -c /usr/local/bin/down_database.sh

su - oracle -c /usr/local/bin/up_database.sh

This causes a login as oracle and executes that command. Should work out nicely for you.
Steve Post
Trusted Contributor

Re: Automation Script

I agree. We have the same type of scripts for our sybase database here. Our root program has a line in it for sybase work:
/bin/su -c sybase "${SYBHOME/in...2>/dev/null "