on 12-02-2009 6:52 AM
Dear ALL,
we are planning for DR site , and we have already one production server running on HP-UNIX, i,e ECC 6.0 on oracle 10g.
in DR site , we built a NEW Production server using complete offline file system of Exisitng Production server. the new server is up and running. we have built this server by taking filesystem backup of 8th Nov.i copied all the offlie redo logs from the existing PRD server till date, Now i would like to apply the offline redo logs generated in Existing PRD server to New PRD server(DR site), from 9th November i want the complete database changes in to my New PRD server.and This is a continious process.
whenever the new offline redolog come in exisitng PRD, it should be applied in NEW PRD server.
Kindly help on this senario...... also let me know any available scripts for applying redo logs auatically..
with regrds
kirankumar M
Hi,
I think you are using rcp/ftp methods to copy archivelogs!
If it is i would suggest to make a shell script which automatically applies archivelogs into your standby server.
all the details are below, which i have performed in setting up one of my DR.
Below steps you need to perform only after mount your database in standby mode in DR server:
5. Setting up the Replication
To start the replication between production and DR server, you need to make following changes on the server. The following steps have not been documented in SAP documentation. In case of any confusion please contact the author of the document.
5.1 DR Server:
1. Change the password of user orapro on DR server, use the same password used on production server.
2. Create .rhost file in $HOME Directory of user orapro and put the following entries in .rhost file.
u2022 Ndeluxs1 orapro
NOTE: This step is required to facilitate the copy of redo log files from production server to DR server using RCP, in case you want to use FTP for transferring the files , this step will not be mandatory, we are currently using RCP, once the server is moved to remote location, we may used FTP is required for performance reasons.
3. Make sure that you /etc/host files is updated in containing the host reference to production server.
4. Change to following directory $OARCLE_HOME/network/admin and append the following entries in u2018tnsnames.orau2019.
PR1.WORLD=
(DESCRIPTION =
(SDU = 32768)
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = SAP.WORLD)
(PROTOCOL = TCP)
(HOST = ndeluxs9)
(PORT = 1527)
)
)
(CONNECT_DATA =
(SID = PRO)
(GLOBAL_NAME = PR1.WORLD)
)
)
5. Test the connection using sqlplus, you should be able to connect to the production server remotely.
6. Now change your directory to $ORACLE_HOME/DBS and edit initPRO.sap, make the following changes to the parameters, in case the parameter doesnu2019t not exist, please create a new entry.
u2022 stage_copy_cmd = rcp
u2022 stage_root_dir = /oracle/PRO/sapbackup
u2022 archive_stage_dir = /oracle/PRO/saparch
u2022 stage_db_home = /oracle/PRO
u2022 remote_host = ndeluxs9
u2022 remote_user = u201Corapro/<password>u201D
u2022 primary_db = pr1
NOTE: Please remember that there may be some existing entries in initPRO.sap , as that may have been copied from production server, you will find detailed initPRO.sap file at end of this document for production and DR server, so you can compare it at the time of setup.
7. Now move to user home directory and create a directory where you can store the scripts file to run the automatic applying of redo log files to standby database. Create file u201Crunarch.cshu201D and write the following lines in that.
u2022 # /bin/csh -f
u2022 setenv BR_RSH_CMD true
u2022 setenv BR_RCP_CMD true
u2022 brarchive -d stage -sd -m -f -u system/oramgr1
NOTE: The setenv command used in script are required if you want to delete the redo offline files once they have been applied to database, in case you wish to take the backup of redo log files to tape, please remove the lines, the brarchive command running in u2013m (modify ) mode and u2013f (fill up) mode will wait for the log files from production server and will apply them as soon they are available, in case you want to delay the process specify time in minutes after the u2013m option.
8. Use chmod 755 to make the file executable in shell.
5.2 Production Server
1. Make sure that you /etc/host files is updated in containing the host reference to DR server.
2. Make the following changes in initPRO.sap at the production server.
u2022 archive_stage_dir = /oracle/PRO/saparch
u2022 remote_host = target host name
u2022 remote_user = "orapro <password>"
u2022 stage_copy_cmd = rcp
NOTE: In case you want to use FTP is transfer method to offline redo log files please change the stage_copy_cmd parameter to ftp.
3. Move to user home directory and create a directory where you can store the scripts file to run the automatic applying of redo log files to standby database.
4. Create file u201Cstartrepl.cshu201D and write the following lines in that.
u2022 brarchive -s -f -d stage -c -u system/oramgr1
5. Use chmod 755 to make the file executable in shell.
Now you have completed the setup part of the standby server, please run the scripts on the respective server and the online replication should start working. As these scripts are interactive you can see the output on the screen and verify that the replication is running fine.
5.3 Advance configuration:
Once the initial replication was completed, we identified few problem areas, mention below are the problem areas we encountered.
1. A Telnet console should be always running on both of the server to monitor the status.
2. Backup of archive files cannot run because a brarchive session is always running for synchronization, In case you stop the brarchive session to take the backup, there are chances that redo log file may be created during backup and written on the tape but not copied to DR server, hence invalidating the sequence of redo log files on server.
3. In case you make any changes to the structure of database, the archive process on DR server terminates with error.
We will discuss the above points and will answer them.
1. The telnet session will be required onto the DR server to monitor the replication, this is required because of the problem discussed in point number 3, you may need to the data file manually whenever archive process stops on DR server.
NOTE: The problem with the database structure replication had been provided in kernel version 6.40, once the Pepsi upgraded to this version monitoring of BR process on DR server will be minimum, instruction about adding the data file had been provided in monitoring document.
2. To address point number 2 we have created a shell script and scheduled to using cron, this script run and 10:30 AM and 10:30 PM. Takes the backup of offline redo log files to tape, make sure that all the file backed up in tape are synchronized with the DR server and then deletes all the backed up files from the disk.
3. Create a file u201Carchback.shu201D in $SAPDATA_HOME/log directory with the following text and use chmod 755 to make it executable.
#!/bin/sh
HOME=/oracle/PRO
export HOME
PATH=/oracle/PRO/920_64/bin:/usr/sap/PRO/SYS/exe/run:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/opt/resmon/bin:/opt/gnome/bin:/opt/netscape:/usr/bin/X11:/usr/contrib/bin/X11:/opt/graphics/common/bin:/opt/scr/bin:/usr/sbin/diag/contrib:/opt/mx/bin:/opt/ignite/bin:/opt/perf/bin:/opt/java1.3/bin:/opt/sanmgr/commandview/client/sbin:/opt/sanmgr/cssi/Licensing/sbin
export PATH
SAPSYSTEMNAME=PRO;export SAPSYSTEMNAME
dbms_type=ORA;export dbms_type
DIR_LIBRARY=/usr/sap/PRO/SYS/exe/run;export DIR_LIBRARY
SHLIB_PATH=/usr/sap/PRO/SYS/exe/run:/oracle/PRO/920_64/lib;export SHLIB_PATH
DBENV_CSH=SET;export DBENV_CSH
NLS_LANG=AMERICAN_AMERICA.US7ASCII;export NLS_LANG
ORACLE_PSRV=PRO;export ORACLE_PSRV
ORACLE_SID=PRO;export ORACLE_SID
ORACLE_HOME=/oracle/PRO/920_64;export ORACLE_HOME
ORA_NLS33=/oracle/PRO/920_64/ocommon/nls/admin/data;export ORA_NLS33
SAPDATA_HOME=/oracle/PRO;export SAPDATA_HOME
ORACLE_BASE=/oracle;export ORACLE_BASE
LD_LIBRARY_PATH=/usr/sap/PRO/SYS/exe/run;export LD_LIBRARY_PATH
tlog=/oracle/PRO/log/tape_log
plog=/oracle/PRO/log/remote_log
blog=/oracle/PRO/log/perm_log
alog=/oracle/PRO/log/delete_log
archlog=/oracle/PRO/log/archlog_log
lockfile=/oracle/PRO/saparch/.lock.bra
dlog=/oracle/PRO/log/stop_log
cplog=/oracle/PRO/log/copyfiles_log
pat=successfully
mailuser="orapro"
hr_min=`date "+%c"`
echo "************Log Status for $hr_min ******************\n" >> $blog
Check if brachive is running already
if [ -f $lockfile ]; then
d=`brarchive -f stop -c|tee $dlog|grep $pat`
if [ "$d" = "" ]; then
mailx -s "Unable to Stop Ararchive at $hr_min" $mailuser < $dlog
echo "Unable to Stop Ararchive at $hr_min" >> $blog
exit 1
else
echo "Brarchive Stopped $pat at $hr_min" >> $blog
fi
fi
if [ -f $tlog ]; then
rm -f $tlog >> $blog
fi
touch $tlog
Start The backup on the tape drive
a=`brarchive -d tape -s -c -u system/oramgr1|tee $tlog|grep $pat`
if [ "$a" = "" ]; then
mailx -s "Backup Operation Failed at $hr_min" $mailuser < $tlog
echo "Backup Operation Failed at $hr_min" >> $blog
exit 1
else
echo "Backup of Archive Log on Tape Completed $hr_min" >> $blog
fi
if [ -f $plog ]; then
rm -f $plog >> $blog
fi
touch $plog
Start Copy to Remote Server Directory
b=`brarchive -d stage -s -c -u system/oramgr1|tee $plog|grep $pat`
if [ "$b" = "" ]; then
mailx -s "Transfer of Redo Log Files Failed, Please check network" $mailuser < $plog
echo "Transfer of Redo Log Files Failed, Please check network" >> $blog
exit 1
else
echo "Transfer to Remote Server Completed $pat $hr_min" >> $blog
fi
if [ -f $alog ]; then
rm -f $alog >> $blog
fi
touch $alog
Copy archive log files to the sub-directory 'saparch_bak'
cp -p /oracle/PRO/saparch/*.dbf /oracle/PRO/saparch/saparch_bak >> $cplog
echo u201C Archive Log files are copied to saparch_bak directoryu201D
Checking whether the replication script is running
if [ -f $lockfile ]; then
brarchive -c -f stop
echo u201CReplication process is stopped for deleting the Archive Log Filesu201D
else
echo u201CProceeding the deletion of Archived Log Filesu201D
fi
Start Deletion of Files backed up in Tape
c=`brarchive -d tape -ds -c -u system/oramgr1|tee $alog|grep $pat`
if [ "$c" = "" ]; then
hr_min=`date "+%c"`
mailx -s "Files not deleted Successfully,Please check" $mailuser < $alog
echo "Files not deleted Successfully,Please check" >> $blog
exit 1
else
hr_min=`date "+%c"`
echo "Files Deleted $pat at $hr_min" >> $blog
fi
Starting of Synconization of Logs
#brarchive -d stage -s -f -c -u system/oramgr1 > $archlog 2>&1
4. Create a cron entry using crontab u2013e command as :
50 16 * * * /oracle/PRO/log/archback.sh >>/oracle/PRO/log/run.log 2>&1
Regards
Nick Loy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As said, it sounds like you are describing a Oracle Standby database scenario.
the online help gives you more input:
[http://help.sap.com/saphelp_nw70/helpdata/EN/08/5744b84ae611d1894f0000e829fbbd/content.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/08/5744b84ae611d1894f0000e829fbbd/content.htm]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi....the scenario you have mentioned can be maintained in synchronous and asynchronous mode. If you want to create the in asynchronous mode you just apply offline redolog to the database in standby mode. You should bring this database up only if something goes wrong with the database at primary site.
Cheers..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.