Thursday, February 8, 2007

Backing up entire application

I use this backup steps on my 11.5.8 on Windows 2003 Server Enterprise Edition. You need three scripts to automate this backup process. During backup process aplication will be shut down.

The first script is a windows command file. This is the script, copy and save as backup.cmd:
echo ==========================
echo SISKEU Backup Started at
time /T
date /T
CALL e:\oracle\itb2appl\ITB2.cmd
CALL e:\oracle\itb2comn\admin\scripts\ITB2\adstpall.cmd
ren E:\oracle\itb2appl\au\11.5.0\resource\CUSTOM.plx CUSTOM.plx.old
copy E:\oracle\itb2appl\au\11.5.0\resource\CUSTOM.plx.new E:\oracle\itb2appl\au\11.5.0\resource\CUSTOM.plx
CALL e:\oracle\itb2db\8.1.7\ITB2.cmd
SET ORACLE_SID=ITB2
svrmgrl @c:\shutdown.sql
e:\oracle\itb2comn\util\wait.exe 10000
net stop "OracleServiceITB2"
e:\oracle\itb2comn\util\wait.exe 10000
rem xcopy e:\oracle\itb2data d:\backup2006\itb2data /E /Y /K /H /R /Q /I
net start "OracleServiceITB2"
e:\oracle\itb2comn\util\wait.exe 10000
SET ORACLE_SID=ITB2
svrmgrl @c:\startup.sql
e:\oracle\itb2comn\util\wait.exe 10000
rem xcopy e:\oracle\itb2appl d:\backup2006\itb2appl /E /Y /K /H /R /Q /I
rem xcopy e:\oracle\itb2comn d:\backup2006\itb2comn /E /Y /K /H /R /Q /I
rem xcopy e:\oracle\itb2db d:\backup2006\itb2db /E /Y /K /H /R /Q /I
rem xcopy e:\oracle\itb2ora d:\backup2006\itb2ora /E /Y /K /H /R /Q /I
CALL e:\oracle\itb2comn\admin\scripts\ITB2\adstrtal.cmd
echo SISKEU Backup Completed at:
time /T
date /T
echo ===========================
Second one is sql script to shutdown the database. This is the script, copy and save it as shutdown.sql:
connect internal
shutdown immediate
exit
The last one is a script to startup the database. This is the script, copy and save it as startup.sql:
connect internal
startup
exit

Use the first file and run it on command prompt or you can put it on scheduled task.
Before you run it, change ITB2 on that file to your oracle instance name and change path to suite your installation. Save two other file to a directory, remember to change the directory on backup script to directory where you extracted them.


No comments: