I need help with a dbora, Oracle startup script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting I need help with a dbora, Oracle startup script
# 1  
Old 10-27-2016
I need help with a dbora, Oracle startup script

I have the following script, /etc/init.d/dbora, and it is working on several servers but its
not working on one of the servers. I would like to add logging, but the exec redirects that
I had previously added did not work. The log file was not created. I put the log file under
/home/oracle/scripts/log. Since boot should run as root, I would not think that this is a
problem. But maybe it is. Any advice would be appreciated. Thanks.

Code:
exec >${STARTUP_LOGFILE}
exec 2>&1
...
exec 1>&-
exec 2>&-

Code:
#!/bin/sh
# chkconfig: 345 99 01
# description: dbora script start or stop database when the server startsup or shutsdown
set -x
export DBORA_ACTION=${1}
echo ">>> dbora running with ${DBORA_ACTION} parameter<<<" 1>&2
RETVAL=0

ORA_OWNER=oracle
export ORA_OWNER

case "${DBORA_ACTION}" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        # Remove "&" if you don't want startup as a background process.
        su ${ORA_OWNER} -c "/home/oracle/scripts/bin/startup_all_dbs.sh" &
        touch /var/lock/subsys/dbora 1>&2
        echo "database startup script launched" 1>&2
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su ${ORA_OWNER} -c "/home/oracle/scripts/bin/shutdown_all_dbs.sh"
        rm -vf /var/lock/subsys/dbora 1>&2
        echo "database shutdown script launched" 1>&2
        RETVAL=1
        ;;
    '*')
        echo "Usage: $0 {start|stop}"
        exit 1
esac

exit $RETVAL

# 2  
Old 10-27-2016
What errors do you see? Or just no logfile created?

If no logfile at all -
The environment variable $STARTUP_LOGFILE - I would start with that and make sure the variable exists and is defined correctly, then check permissions.
# 3  
Old 10-27-2016
Our servers are in AWS. So I just booted this server that had been stopped
and here is the output from the /var/log/boot.log file. I made some changes
to the dbora file. I am including that as well. I think the errors are from the
gcstartup script which is for the grid agent. I guess adding a few echo commands
is as good as it will get.

Code:
Starting sshd:                                             [  OK  ]
Starting postfix:                                          [  OK  ]
Starting abrt daemon:                                      [  OK  ]
Starting crond:                                            [  OK  ]
Starting atd:                                              [  OK  ]
Starting rhsmcertd...                                      [  OK  ]
stty: standard input: unable to perform all requested operations
sudo exist
stty: standard input: unable to perform all requested operations
>>> dbora running with start parameter <<<
database startup script launched
starting up database db1
starting up database db2
starting up database db3

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Startup script

I can't quite find a clear answer on how to properly write a start up script. Does anybody have any ideas?? (3 Replies)
Discussion started by: Huitzilopochtli
3 Replies

2. Shell Programming and Scripting

Apache tomcat startup script not booting at startup.

I copied the script from an AskUbuntu post - #!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO ... (14 Replies)
Discussion started by: Hijanoqu
14 Replies

3. AIX

startup script

Hi I need the below script to be started whenever I reboot my aix server ? #cat cdbegin /cdirect/cdunix/ndm/bin/cdpmgr -i /cdirect/cdunix/ndm/cfg/cbspsdb01/initparm.cfg Please suggest how to add this to the startup ? (2 Replies)
Discussion started by: samsungsamsung
2 Replies

4. Solaris

oracle and weblogic startup

Hi All, i am facing problem after restart my Unix Box PC i should to startup oracle manual and weblogic also how yo make it start automatic (1 Reply)
Discussion started by: xxmasrawy
1 Replies

5. UNIX for Dummies Questions & Answers

run a script at startup

hi, i am using rhel 5, and i wanna run a script as soon as the operating system open. How can i do this ? ( i was reading rc.d files but i could not understand exactly what are the run levels and where should i put the my shell script. my script will be : #!/bin/ksh iptables -I INPUT... (1 Reply)
Discussion started by: futi
1 Replies

6. UNIX for Dummies Questions & Answers

Startup Script Somewhere ?

Hello there! I need help. Everytime I login to my ssh, i see this: -bash: .export: command not found -bash: .export: command not found -bash: .export: command not found -bash: .export: command not found any help ? thanks (0 Replies)
Discussion started by: fbauto1
0 Replies

7. Shell Programming and Scripting

how to take input at the startup script!!

Hi all, I am trying to modify a startup script... The problem is that i am unable to figure out how to take inputs from the user at the startup screen and proceed with the processing accordingly... Eg: $ echo "this is a test" (typically this would produce the output)... $ echo "this is a... (6 Replies)
Discussion started by: wrapster
6 Replies

8. Shell Programming and Scripting

Startup script

New in Unix, I am adding a line "route add 57.14.y.y 57.14.x.x" every day after rebooting the system. Where can I add the line so during boot up (the system is re-started every day by design (???) the line is executed? (I tried the /etc/rc2.d/S90 but for some reason the line needs to be added... (2 Replies)
Discussion started by: texaspanama
2 Replies

9. Shell Programming and Scripting

Startup script DSL

Hi, I'm using Damn Small Linux 2.3, could you tell me which script starts up the browser when fluxbox loads? Thanks C19 (0 Replies)
Discussion started by: c19h28O2
0 Replies
Login or Register to Ask a Question