1752730 Members
5379 Online
108789 Solutions
New Discussion юеВ

Re: rman and cluster

 
Stanimir
Trusted Contributor

rman and cluster

Hi friends!
I want to ask about Oracle offline backup
using rman, but in cluster environment.

When I'm trying to stop DB for offline backup using rman,the package monitoring found this and moved/halted the package, where this DB is.
How I could stop the monitoring of the
services /oracle/ so I could stop/start
the DB with rman, without the halting of
package.

Regards,
Stan
9 REPLIES 9
Simon Hargrave
Honored Contributor

Re: rman and cluster

If you're running a cluster shouldn't you really be doing hot backups?

However if you want to shutdown the database without the cluster failing over, you can use a lock file.

eg if before you run your backup you touch a file called /tmp/oraclebackup, then remove it when the backup is finished. You can then change your cluster monitor scripts to only failover if this lock file does not exist.
Rajesh SB
Esteemed Contributor

Re: rman and cluster

Hi,

As Simon suggetion is the only best way to carry out your offline backup to avoid package to failover.

Similar mechanism I used in one of the clustser solution like.

while [ true ]
do
## Below if-then statement is included for Backup purpose
if [ ! -f /opt/backup/.runtime ]
then
statment1;
....
fi
done

Where /opt/backup/.runtime is a flag file.

There is abrupt way to halt the monitor service using command (not recommended)
# cmhaltserv
But, there is no way to start manually.


Regards,
Rajesh
Yogeeraj_1
Honored Contributor

Re: rman and cluster

hi,

also allow me to add:

With RMAN it is preferrable that you to an Online backup. No need to shutdown your database.

regards
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Stanimir
Trusted Contributor

Re: rman and cluster

Thank you for your usefull replies. :)
So let me remark, that the monitoring of Oracle processes in doing by PIDs.
So if I stop/start the Oracle without
halting package, these PIDs will be changed and the monitoring script will check the
wrong array of PIDS. So is there any workarround? May be another changes of the monitoring script?
Gary L. Paveza, Jr.
Trusted Contributor

Re: rman and cluster

If you're using HP's scripts for oracle startup / shutdown / monitoring and you need to be able to shutdown the database without failing over the package, modify the provided script.

Replace the monitor_process with the below. Once you do that, you just need to touch the file /var/tmp/${ORACLE_SID}_MAINT and monitoring is suspended until you remove it.

function monitor_processes
{
typeset -i n=0
for i in ${MONITOR_PROCESSES[@]}
do
MONITOR_PROCESSES_PID[$n]=`ps -fu oracle | awk '/'${i}$'/ { print $2 }'` #JAGad06432
print "Monitored process = ${i}, pid = ${MONITOR_PROCESSES_PID[$n]}"
if [[ ${MONITOR_PROCESSES_PID[$n]} = "" ]]
then
print "\n\n"
ps -ef
print "\n *** ${i} has failed at startup time. Aborting Oracle. ***"
set -m
nohup ${0} fault & # The script calls itself with the fault option.
set +m
sleep 999999
fi
(( n = n + 1 ))
done

sleep ${MONITOR_INTERVAL}

while true
do
#
# Added the following code to allow for the Oracle databases to be
# taken down for maintenance without causing a package failure.
#
# To use, touch the file /var/tmp/${ORACLE_SID}_MAINT (where
# ORACLE_SID is the SID of the database which is to have maintenance).
#
# To resume monitoring, remove this file.
#
# Added 9/11/2002 GLP
#

if [ -f /var/tmp/${ORACLE_SID}_MAINT ]
then
print "Entering Maintenance mode at $(date)"
while [ -f /var/tmp/${ORACLE_SID}_MAINT ]
do
print "Remove /var/tmp/${ORACLE_SID}_MAINT file to resume monitoring"
sleep ${MONITOR_INTERVAL}
done
print "Exiting Maintenance mode at $(date)"
#
# Since Oracle could have been shutdown - the PIDs could have changed.
# The next two statements will reevaluate the PIDs for monitoring.
# Added 9/11/2002 GLP
#
typeset -i n=0
for i in ${MONITOR_PROCESSES[@]}
do
MONITOR_PROCESSES_PID[$n]=`ps -fu oracle | awk '/'${i}$'/ { print $2 }'` #JAGad06432
print "Monitored process = ${i}, pid = ${MONITOR_PROCESSES_PID[$n]}"
if [[ ${MONITOR_PROCESSES_PID[$n]} = "" ]]
then
print "\n\n"
ps -ef
print "\n *** ${i} has failed at startup time. Aborting Oracle. ***"
set -m
nohup ${0} fault & # The script calls itself with the fault option.
set +m
sleep 999999
fi
(( n = n + 1 ))
done
fi

for i in ${MONITOR_PROCESSES_PID[@]}
do
kill -s 0 ${i} > /dev/null
if [[ $? != 0 ]]
then
print "\n\n"
ps -ef
print "\n *** ${i} has failed. Aborting Oracle. ***"
set -m
nohup ${0} fault & # The script calls itself with the fault option.
set +m
sleep 999999
fi
done
sleep ${MONITOR_INTERVAL}
done
Rajesh SB
Esteemed Contributor

Re: rman and cluster

Hi,

My thought here to avoid PID changes.
Use the package monitoring script with flag check.
Though you are using RMAN, supports online backup, this you can use.

OR

Just close the database and umount the database before start backup.
Post backup:
mount and open the database, it reduces the startup time of database.

Good luck,

Cheers,
RAjesh

Rajesh SB
Esteemed Contributor

Re: rman and cluster

In cont..

Instead full shutdown of Database, just

> alter database close;
> alter database umount;

wouldn't effect any running oracle pids/services.

Regards,
RAjesh
Simon Hargrave
Honored Contributor

Re: rman and cluster

If your oracle startup/shutdown scripts can write the PIDs into /var/run/oracle.pid files then when you stop/start the PIDs will be correct in here, and your monitor script can reference these.
TwoProc
Honored Contributor

Re: rman and cluster

In our environment the standard Oracle SG package used a file called /etc/cmcluster/[package_name]/monitor.

If the file existed then the system didn't monitor the database (this is how we do maintenance, including cold back ups).
When finished just delete/rename the file.

Check your package for this functionality, it may already be in there.
We are the people our parents warned us about --Jimmy Buffett