≡ Menu

Run level shell script to start Oracle 10g services on RedHat Enterprise Linux (RHAS 4)

#!/bin/bash
#
# Run level script to start Oracle 10g services on RedHat Enterprise Linux (RHAS 4)
# Script should work on other UNIX like oses :)
# -------------------------------------------------------------------------
# Copyright (c) 2006 nixCraft project 
# This script is licensed under GNU GPL version 2.0 or above
# Comment/suggestion: 
# -------------------------------------------------------------------------
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle service
OUSER="oracle"
OPATH="/home/oracle/oracle/product/10.2.0/db_1"
# check Oracle db status
function chkdb_status() {
# set username
SUSER="scott"
# set password
SPASS="123456"
sqlplus -s /nolog > /dev/null 2>&1 <
{ 9 comments… add one }
  • Anonymous March 22, 2011, 8:03 pm

    startup pfile =’/home/oracle/$dirname/admin/pfile/initswamy.ora’ nomount;

  • José Mosco March 3, 2011, 2:41 am

    A quick search on google reveal:
    Quote
    To enable hugetlbpages, first you need 2.6 kernel, and then you need to recompile it with the following config options enabled:

    CONFIG_HUGETLB_PAGE=y
    CONFIG_HUGETLBFS=y

    or just disable hugetlb tables:

    export DISABLE_HUGETLBFS=1

    If you are doing this you need to have a lot of free RAM

    Anyway optimizing oracle is a heavy job. Take a look after limits.conf and oracle. You need to increase the number of file descriptors and a lot of other things.

    Regards

  • Phil Page October 26, 2009, 1:22 pm

    The problem I am having is that although this script will start and stop oracle when run on the command line, it does not shutdown oracle at re-boot. After logging a call with RH they told me to check the status within the script by adding the following to the script
    # Source function library.
    . /etc/rc.d/init.d/functions
    and then in the status case statment
    status dbora # ie name of script

    This then returned
    [root@host init.d]# ./dbora status
    dbora dead but subsys locked
    because the status of the system is not running no attempt will be made to shut it down at boot.

    Anyone know what code is required such that status returned will be running?

  • WilliamG June 9, 2009, 6:07 pm

    Hi Nikhil, I had the same problem.
    I settled with the following instructions

    pront > sqlplus /nolog
    SQL>connect / as sysdba
    SQL>startup
    SQL>quit

    pront> cd $ORACLE_HOME/bin
    pront> lsnrctl start

  • Nikhil April 15, 2009, 12:50 pm

    I am using oracle 10g through command line..It gives me following error while connecting. i am trying to connect as a dba..i am suse LINUX operating system…

    SQL*PLUS:Release10.2.0.1.0- Production on Wed: Apr 15 17:26:27 2009

    Copyright(c) 1982, 2005, Oracle. All Rights Reserved.

    SQL> connect
    Enter user-name:SYS
    Enter password:123
    ERROR:
    ORA-01034: ORACLE not available.
    ORA-27121: unable to determine the size of share memory segment.
    Linux Error:13:Permission Denied

    kindly suggest me what to do?

  • seckin turk January 12, 2009, 2:30 pm

    COuld you please sendm me a mail?I want to ask you which editor did you use to paste this good looking code?

    Is it html code ?

  • Thomas January 3, 2009, 5:14 am

    Thank you. Quite helpful. :)

  • Internetagentur August 4, 2008, 11:19 am

    Thank you … that tutorial has me very helped.

Security: Are you a robot or human?

Leave a Comment