#vi mespkg.cntl
###################################
# START OF CUSTOMER DEFINED FUNCTIONS
# This function is a place holder for customer define functions.
# You should define all actions you want to happen here, before the service is
# started. You can create as many functions as you need.
function customer_defined_run_cmds
{
# ADD customer defined run commands.
: # do nothing instruction, because a function must contain some command.
/etc/cmcluster/mespkg/ora_start
test_return 51
}
# This function is a place holder for customer define functions.
# You should define all actions you want to happen here, before the service is
# halted.
function customer_defined_halt_cmds
{
# ADD customer defined halt commands.
: # do nothing instruction, because a function must contain some command.
/etc/cmcluster/mespkg/ora_stop
test_return 52
}
# END OF CUSTOMER DEFINED FUNCTIONS
[lgxmes:(root)/etc/cmcluster/mespkg]# cat ora_start
#!/usr/bin/sh
################################################################
su - oracle -c "sqlplus '/as sysdba'" << EOFotpt
startup mount;
recover database;
alter database open;
exit
EOFotpt
su - oracle -c "lsnrctl start"
################################################################
[lgxmes:(root)/etc/cmcluster/mespkg]# cat ora_stop
#!/usr/bin/sh
######################################################################
su - oracle -c "lsnrctl" <set password qkrtm123
stop
exit
EOF
su - oracle -c "sqlplus '/as sysdba" < shutdown abort;
exit
EOFotpt
######################################################################
[saemes:(root)/etc/cmcluster/mespkg]#
阅读(1102) | 评论(0) | 转发(0) |