Sponsored Content
Operating Systems Solaris How to start Oracle database automatically Post 68064 by encrypted on Wednesday 30th of March 2005 04:46:06 PM
Old 03-30-2005
Tested on Sun Solaris:
Code:
#!/bin/sh

  if [ -d /export/home/oracle/OracleStartScripts ] ; then
        :
  else
        mkdir /export/home/oracle/OracleStartScripts
        chown oracle:oinstall /export/home/oracle/OracleStartScripts
  fi

  echo "\
        ORACLE_BASE=/u01/app/oracle
        ORACLE_HOME=\$ORACLE_BASE/product/8.1.7
        ORACLE_SID=test
        ORA_NLS33=\$ORACLE_HOME/ocommon/nls/admin/data
        PATH=.:\$ORACLE_HOME/bin:opt/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/etc/usr/sbin

        export ORACLE_BASE
        export ORACLE_HOME
        export ORACLE_SID
        export NLS_LANG
        export ORA_NLS33
        export PATH

        svrmgrl /nolog <<EOF
        connect internal
        startup
        EOF

        echo starting listner...
        lsnrctl start
        " > /export/home/oracle/OracleStartScripts/StartOra.sh

# 
  echo "\
        ORACLE_BASE=/u01/app/oracle
        ORACLE_HOME=\$ORACLE_BASE/product/8.1.7
        ORACLE_SID=test
        ORA_NLS33=\$ORACLE_HOME/ocommon/nls/admin/data
        PATH=.:\$ORACLE_HOME/bin:opt/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/etc/usr/sbin

        export ORACLE_BASE
        export ORACLE_HOME
        export ORACLE_SID
        export NLS_LANG
        export ORA_NLS33
        export PATH

        svrmgrl /nolog <<EOF
        connect internal
        shutdown immediate
        EOF

        echo starting listner...
        lsnrctl stop
        " > /export/home/oracle/OracleStartScripts/StopOra.sh
	
	chown oracle:oinstall /export/home/oracle/OracleStartScripts/StopOra.sh
	chown oracle:oinstall /export/home/oracle/OracleStartScripts/StartOra.sh
	
	chmod +x /export/home/oracle/OracleStartScripts/StopOra.sh
	chmod +x /export/home/oracle/OracleStartScripts/StartOra.sh 

 echo "\
   #!/bin/sh
   # start/Stop oracle Database
   
  case \"\$1\" in
   	'start')
   	# start the database
   	if [ -f /export/home/oracle/OracleStartScripts/StartOra.sh ] ; then
   		echo \"Start Oracle database.\"
   		su -l oracle -c /export/home/oracle/OracleStartScripts/StartOra.sh
   	else
   		echo \"Error! Can't find: /export/home/oracle/OracleStartScripts/StartOra.sh\"
   		echo \"          Oracle could not be Started!\"
   	fi
   	;;
   
  	'stop')
          # Stop the database
          if [ -f /export/home/oracle/OracleStartScripts/StopOra.sh ] ; then
                    echo \"stopping oracle Database.\"
                    su -l oracle -c /export/home/oracle/OracleStartScripts/StopOra.sh
           else
                        echo \"Error! Can't find:/export/home/oracle/OracleStartScripts/StopOra.sh\"
                        echo \"          Oracle could not be Stopped!\"
           fi
           ;;
   esac
                " > /etc/init.d/MYoracle

        chmod +x /etc/init.d/MYoracle

        ln -s /etc/init.d/MYoracle /etc/rc3.d/S99oracle
        ln -s /etc/init.d/MYoracle /etc/rc2.d/K99oracle
        ln -s /etc/init.d/MYoracle /etc/rc1.d/K99oracle
        ln -s /etc/init.d/MYoracle /etc/rc0.d/K99oracle
        ln -s /etc/init.d/MYoracle /etc/rcS.d/K99oracle

 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Howto capture data from rs232port andpull data into oracle database-9i automatically

Hi, i willbe very much grateful to u if u help me out.. if i simply connect pbx machine to printer by serial port RS232 then we find this view: But i want to capture this data into database automatically when the pbx is running.The table in database will contain similar to this view inthe... (1 Reply)
Discussion started by: boss
1 Replies

2. Solaris

Database can't start automatically on solaris

Hi, I have installed oracle 9i on solaris 10 sucessfully. I have configured listener & tnsname.ora file sucessfuly. Even i can start database manully by starting listener first and from sqlplus promt data base sucessfully. Now i want to start the database automatically after system reboots. I... (2 Replies)
Discussion started by: Sachin Vaidya
2 Replies

3. UNIX for Advanced & Expert Users

start some services automatically

Hello All i have a question related to some services,i want to start some services with server linux centos. i make "chkconfig httpd on" and "chkconfig asterisk on",but when i verify with chkconfig --list i found httpd 0: off 1: off 2: on 3: on 4: on 5: on 6:... (6 Replies)
Discussion started by: bernard12
6 Replies

4. Solaris

Can't create database after Oracle Database installation

I installed Oracle 10 software on Solaris 11 Express, everything was fine execpt I can't create database using dbca.rsp file. I populated file with following options. OPERATION_TYPE = "createDatabase" GDBNAME = "solaris_user.domain.com" SID = "solaris_user" TEMPLATENAME = "General... (0 Replies)
Discussion started by: solaris_user
0 Replies

5. Shell Programming and Scripting

Running script automatically when threshold limit met in one of the field in oracle database

Hi Guys, Need you help in one point! I am working on one shell script which takes following steps : 1. Taking one query result from oracle database 2. Exporting that result to Xls file 3. Mailing that file to my own mail ID Now, I want to give a threshold limit to one of the column... (0 Replies)
Discussion started by: Agupte
0 Replies

6. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies
pam_xauth(8)						   System Administrator's Manual					      pam_xauth(8)

NAME
pam_xauth - forward xauth keys between users SYNOPSIS
session optional /lib/security/pam_xauth.so arguments DESCRIPTION
pam_xauth.so is designed to forward xauth keys (sometimes referred to as "cookies") between users. Without pam_xauth, when xauth is enabled and a user uses the su command to assume another user's priviledges, that user is no longer able to access the original user's X display because the new user does not have the key needed to access the display. pam_xauth solves the problem by forwarding the key from the user running su (the source user) to the user whose identity the source user is assuming (the target user) when the session is created, and destroying the key when the session is torn down. This means, for example, that when you run su from an xterm sesssion, you will be able to run X programs without explicitly dealing with the xauth command or ~/.Xauthority files. pam_xauth will only forward keys if xauth can list a key connected to the $DISPLAY environment variable. Primitive access control is provided by ~/.xauth/export in the invoking user's home directory and ~/.xauth/import in the target user's home directory. If a user has a ~/.xauth/import file, the user will only receive cookies from users listed in the file. If there is no ~/.xauth/import file, the user will accept cookies from any other user. If a user has a .xauth/export file, the user will only forward cookies to users listed in the file. If there is no ~/.xauth/export file, and the invoking user is not root, the user will forward cookies to any other user. If there is no ~/.xauth/export file, and the invoking user is root, the user will not forward cookies to other users. Both the import and export files support wildcards (such as *). Both the import and export files can be empty, signifying that no users are allowed. ARGUMENTS
debug Turns on debugging messages sent to syslog. xauthpath=/usr/X11R6/bin/xauth Specify the path the xauth program (the default is /usr/X11R6/bin/xauth). IMPLEMENTATION DETAILS
pam_xauth will work only if it is used from a setuid application in which the getuid() call returns the id of the user running the applica- tion, and for which PAM can supply the name of the account that the user is attempting to assume. The typical application of this type is su. The application must call both pam_open_session() and pam_close_session() with the ruid set to the uid of the calling user and the euid set to root, and must have provided as the PAM_USER item the name of the target user. pam_xauth calls xauth as the source user to extract the key for $DISPLAY, then calls xauth as the target user to merge the key into the a temporary database and later remove the database. pam_xauth cannot be told not to remove the keys when the session is closed. SEE ALSO
/usr/share/doc/pam*/html/index.html FILES
~/.xauth/import ~/.xauth/export BUGS
Let's hope not, but if you find any, please report them via the "Bug Track" link at http://bugzilla.redhat.com/bugzilla/ AUTHOR
Nalin Dahyabhai <nalin@redhat.com>, based on original version by Michael K. Johnson <johnsonm@redhat.com> Red Hat Linux 2001/9/27 pam_xauth(8)
All times are GMT -4. The time now is 09:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy