Sponsored Content
Top Forums Shell Programming and Scripting I need help with a dbora, Oracle startup script Post 302984563 by gandolf989 on Thursday 27th of October 2016 09:46:14 AM
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

 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
GIT-SH-SETUP(1) 						    Git Manual							   GIT-SH-SETUP(1)

NAME
git-sh-setup - Common git shell script setup code SYNOPSIS
. "$(git --exec-path)/git-sh-setup" DESCRIPTION
This is not a command the end user would want to run. Ever. This documentation is meant for people who are studying the Porcelain-ish scripts and/or are writing new ones. The git sh-setup scriptlet is designed to be sourced (using .) by other shell scripts to set up some variables pointing at the normal git directories and a few helper shell functions. Before sourcing it, your script should set up a few variables; USAGE (and LONG_USAGE, if any) is used to define message given by usage() shell function. SUBDIRECTORY_OK can be set if the script can run from a subdirectory of the working tree (some commands do not). The scriptlet sets GIT_DIR and GIT_OBJECT_DIRECTORY shell variables, but does not export them to the environment. FUNCTIONS
die exit after emitting the supplied error message to the standard error stream. usage die with the usage message. set_reflog_action set the message that will be recorded to describe the end-user action in the reflog, when the script updates a ref. git_editor runs an editor of user's choice (GIT_EDITOR, core.editor, VISUAL or EDITOR) on a given file, but error out if no editor is specified and the terminal is dumb. is_bare_repository outputs true or false to the standard output stream to indicate if the repository is a bare repository (i.e. without an associated working tree). cd_to_toplevel runs chdir to the toplevel of the working tree. require_work_tree checks if the current directory is within the working tree of the repository, and otherwise dies. require_work_tree_exists checks if the working tree associated with the repository exists, and otherwise dies. Often done before calling cd_to_toplevel, which is impossible to do if there is no working tree. require_clean_work_tree <action> [<hint>] checks that the working tree and index associated with the repository have no uncommitted changes to tracked files. Otherwise it emits an error message of the form Cannot <action>: <reason>. <hint>, and dies. Example: require_clean_work_tree rebase "Please commit or stash them." get_author_ident_from_commit outputs code for use with eval to set the GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE variables for a given commit. GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-SH-SETUP(1)
All times are GMT -4. The time now is 02:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy