Offline Backup: Oracle Application Server 10g


This post is a follow up on the Stop & Start script I made for Oracle Application Server 10g.

You will need to create a new bash script which would basically have the following lines and should be placed in /home/oracle/scripts/backupoas.sh

#THIS SCRIPT MUST BE RUN AS ROOT

time_start=`date +%s`

source /home/oracle/scripts/oas/settings.conf

##SHUTDOWN APPSERVER

su – oracle -c “cd /home/oracle/scripts/;./stopas.sh”

#Create Backup on this Machine in /backup/daily.tar

tar cvf – /backup/daily.tar /u01″

##END OF BACKUP SCRIPT

##START APPSERVER

su – oracle -c “cd /home/oracle/scripts/;./startas.sh”

time_end=`date +%s`

time_exec=`expr $(( $time_end – $time_start ))`

echo “Application Server Backup Execution time is $time_exec seconds”

To make the backup script better, put that in a crontab by issuing, crontab -e and adding the line 21 30 * * * /home/oracle/scripts/backupoas.sh.

DO NOT FORGET TO CHMOD 777 those script files

Read More

How-to: Linux: Oracle Application Server Startup/Shutdown Script


In my field of work as an Oracle DBA, it is quite important to have scripts which are easy for the end customer to startup and shutdown their Oracle Application Server 10g.

Login into the application server as oracle user on a terminal:

cd /home/oracle/

mkdir -p scripts

mkdir -p scripts/oas

vi /home/oracle/scripts/oas/stopdb.sql

shutdown immediate
quit

:wq

vi /home/oracle/scripts/oas/startdb.sql

startup
quit

:wq

vi /home/oracle/scripts/oas/settings.conf   —- This is the only file you need to modify!!

#Infrastructure Home Directory
INFRA=/u01/app/oracle/inf

#Instance Home Directory
INS=/u01/app/oracle/ins
ORACLESID=orclrep

vi /home/oracle/scripts/oas/startinfra.sh

source /home/oracle/scripts/oas/settings.conf
export ORACLE_HOME=$INFRA
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH
export ORACLE_SID=$ORACLESID
lsnrctl start
sqlplus / as sysdba @./oas/startdb.sql
opmnctl startall
emctl start iasconsole

vi /home/oracle/scripts/oas/startins.sh

source /home/oracle/scripts/oas/settings.conf
export ORACLE_HOME=$INS
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH
export ORACLE_SID=$ORACLESID
opmnctl startall
emctl start iasconsole

vi /home/oracle/scripts/oas/stopins.sh

source /home/oracle/scripts/oas/settings.conf
export ORACLE_HOME=$INS
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH
export ORACLE_SID=$ORACLESID
emctl stop iasconsole
opmnctl stopall

vi /home/oracle/scripts/oas/stopinfra.sh

source /home/oracle/scripts/oas/settings.conf
export ORACLE_HOME=$INFRA
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/lib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH
export ORACLE_SID=$ORACLESID
emctl stop iasconsole
opmnctl stopall
sqlplus / as sysdba @./oas/stopdb.sql
lsnrctl stop

vi /home/oracle/scripts/startas.sh

./oas/startinfra.sh
./oas/startins.sh

vi /home/oracle/scripts/stopas.sh

./oas/stopins.sh
./oas/stopinfra.sh

chmod -R 755 /home/oracle/scripts/

You can now run ./startas.sh or ./stopas.sh to either start or stop the application server.

Why all those files? I could have done it in a single sh file, well.. code reuse : )

Good Day

Read More

Connection 1,***,6201 connect (Connection refused)


The problem Connection 1,***,6201 connect (Connection refused) where *** is the server’s ip address might occur on Oracle Application Server 10g Infrastructure or MiddleTier.

Resolution: This problem is due to file permissions on the Application Server directory (/u01), try a chmod -R oracle:dba on the /u01 directory and then run root.sh on both infrastructure and portal.

Warning: My resolution might not always work, you might break your existing installation.(If it is already broken, you might as well give it a try 🙂 )

Read More