Friday, June 15, 2012

OBIEE Backup and Recovery

BI Backup and Recovery Using Windows Batch Files:

These batch files can be executed as a windows scheduled task.

For Backup:


File Name: backup_bi.bat

Following are the contents of this file:
-----------------
@echo off

java.exe -jar D:\OracleBI\oc4j_bi\j2ee\home\admin.jar ormi://localhost:23791 oc4jadmin admin1 -shutdown force
sleep 10
net stop "Oracle BI Presentation Server"
sleep 10
net stop "Oracle BI Java Host"
sleep 10
net stop "Oracle BI Server"

if not exist D:\BIBackup1\Tues mkdir D:\BIBackup1\Tues
echo Backing Up Repository...
copy /Y D:\OracleBI\server\Repository\myrepository.rpd D:\BIBackup1\Tues
copy /Y D:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora D:\BIBackup1\Tues
echo Backing Up Configs...
copy /Y D:\OracleBI\server\Config\NQSConfig.INI D:\BIBackup1\Tues
copy /Y D:\OracleBI\server\Config\DBFeatures.INI D:\BIBackup1\Tues
echo Backing Up XML...
copy /Y D:\OracleBI\xmlp\XMLP\Admin\Configuration\xmlp-server-config.xml D:\BIBackup1\Tues
copy /Y D:\OracleBI\xmlp\XMLP\Admin\Security\principals.xml D:\BIBackup1\Tues
copy /Y D:\OracleBI\xmlp\XMLP\Admin\Security\security.xml D:\BIBackup1\Tues
copy /Y D:\OracleBI\xmlp\XMLP\Admin\DataSource\datasources.xml D:\BIBackup1\Tues
if not exist D:\BIBackup1\Tues\msgdb mkdir D:\BIBackup1\Tues\msgdb
xcopy /E /Y /Q D:\OracleBI\web\msgdb D:\BIBackup1\Tues\msgdb
copy /Y D:\OracleBIData\web\config\credentialstore.xml D:\BIBackup1\Tues
copy /Y D:\OracleBIData\web\config\instanceconfig.xml D:\BIBackup1\Tues\web_instanceconfig.xml
copy /Y D:\OracleBIData\scheduler\config\instanceconfig.xml D:\BIBackup1\Tues\scheduler_instanceconfig.xml
echo Backing Up WEB Catalog...
if not exist D:\BIBackup1\Tues\Cataloge mkdir D:\BIBackup1\Tues\Cataloge
xcopy /E /Y /Q D:\OracleBIData\web\catalog D:\BIBackup1\Tues\Cataloge
echo Backing Up WEB Resources...
if not exist D:\BIBackup1\Tues\res mkdir D:\BIBackup1\Tues\res
xcopy /E /Y /Q D:\OracleBIData\web\res D:\BIBackup1\Tues\res
echo Backup Complete!


start D:\OracleBI\oc4j_bi\bin\oc4j.cmd -start
sleep 10
net start "Oracle BI Server"
sleep 10
net start "Oracle BI Java Host"
sleep 10
net start "Oracle BI Presentation Server"

@exit
-----------------


For Restore:

File Name: restore_bi.bat

Following are the contents of this file:
-----------------
@echo off

java.exe -jar D:\OracleBI\oc4j_bi\j2ee\home\admin.jar ormi://localhost:23791 oc4jadmin admin1 -shutdown force
sleep 10
net stop "Oracle BI Presentation Server"
sleep 10
net stop "Oracle BI Java Host"
sleep 10
net stop "Oracle BI Server"


echo Restoring Repository file…
xcopy /s/Y/Q D:\BIBACKUP\myrepository.rpd D:\oraclebi\server\Repository
echo Restoring all Configuration files…
xcopy /s/Y/Q D:\BIBACKUP\NQSConfig.INI D:\oraclebi\server\Config
xcopy /s/Y/Q D:\BIBACKUP\DBFeatures.INI D:\oraclebi\server\Config
echo Restoring XML Files…
del D:\oraclebidata\web\config\instanceconfig.xml
del D:\oraclebidata\scheduler\config\instanceconfig.xml
del D:\oraclebi\web\msgdb\l_en\messages\uimessages.xml
xcopy /s/Y/Q D:\BIBACKUP\xmlp-server-config.xml D:\oraclebi\xmlp\XMLP\Admin\Configuration
xcopy /s/Y/Q D:\BIBACKUP\principals.xml D:\oraclebi\xmlp\XMLP\Admin\Security
xcopy /s/Y/Q D:\BIBACKUP\security.xml D:\oraclebi\xmlp\XMLP\Admin\Security
xcopy /s/Y/Q D:\BIBACKUP\datasources.xml D:\oraclebi\xmlp\XMLP\Admin\DataSource
if not exist D:\oraclebi\web\msgdb mkdir D:\oraclebi\web\msgdb
xcopy /s/Y/Q D:\BIBACKUP\msgdb D:\oraclebi\web\msgdb
xcopy /s/Y/Q D:\BIBACKUP\credentialstore.xml D:\oraclebidata\web\config
copy D:\BIBACKUP\web_instanceconfig.xml D:\oraclebidata\web\config\instanceconfig.xml
copy D:\BIBACKUP\scheduler_instanceconfig.xml D:\oraclebidata\scheduler\config\instanceconfig.xml
echo Restoring web catalog.Please wait….
xcopy /s/Y/Q D:\BIBACKUP\Cataloge D:\oraclebidata\web\catalog
echo Restoring Up WEB Resources.Please wait….
xcopy /S/Y/Q D:\BIBACKUP\res D:\oraclebi\web\app\res
echo Restore Complete!


start D:\OracleBI\oc4j_bi\bin\oc4j.cmd -start
sleep 10
net start "Oracle BI Server"
sleep 10
net start "Oracle BI Java Host"
sleep 10
net start "Oracle BI Presentation Server"


@exit
------------------

Cheers ;)


1 comment:

  1. That's a great post and it helps a lot. Thanks Umer

    ReplyDelete