Database recovery procedure for COMPASS (at new node)

  • -1. We should make a backup of catalog if we don't want to loose the backups, with export tool.
Jacek to complete...

  • 0. Determine SID of the database you want to replace. This SID will be referenced later
as ''. Make sure that the tivoli tivoli client software has been installed and that the machine is registered to the storage system.

  • 1. Install the Oracle database software according to the usual procedure

  • 2. Check if ORACLE_BASE environment variable is set to /ORA/dbs01/oracle.
If not, set it:

export ORACLE_BASE=/ORA/dbs01/oracle

Add appropriate entry to the .bashrc file.

  • 3. Create the following directories and links:
mkdir $ORACLE_BASE/product/dbhome
mkdir -p $ORACLE_BASE/admin/<SID>
mkdir -p $ORACLE_BASE/admin/<SID>/pfile
mkdir -p $ORACLE_BASE/admin/<SID>/rman
mkdir -p $ORACLE_BASE/admin/<SID>/ad-hoc
mkdir -p /ORA/dbs00/oracle/admin/<SID>/adump
mkdir -p /ORA/dbs00/oracle/admin/<SID>/bdump
mkdir -p /ORA/dbs00/oracle/admin/<SID>/cdump
mkdir -p /ORA/dbs00/oracle/admin/<SID>/udump
mkdir -p /ORA/dbs03/oracle/admin/arch/
ln -s $ORACLE_BASE/product/rdbms9.2.0.4 $ORACLE_BASE/product/dbhome/<SID>
ln -s /ORA/dbs00/oracle/admin/<SID>/adump $ORACLE_BASE/admin/<SID>
ln -s /ORA/dbs00/oracle/admin/<SID>/bdump $ORACLE_BASE/admin/<SID>
ln -s /ORA/dbs00/oracle/admin/<SID>/cdump $ORACLE_BASE/admin/<SID>
ln -s /ORA/dbs00/oracle/admin/<SID>/udump $ORACLE_BASE/admin/<SID>
mkdir -p /ORA/dbs03/oradata/<SID>

  • 4. Check and if necessary set the following environment variables:
export ORACLE_HOME=$ORACLE_BASE/product/dbhome/<SID>
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export TNSNAMES=$ORACLE_HOME/network/admin/tnsnames.ora
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export NLS_LANG=american_america.WE8ISO8859P9
alias orasys='sqlplus "/ as sysdba"'
export ORACLE_SID=<SID>
Add appropriate entries to the .bashrc file.

  • 5. Prepare the init.ora file. To do this go to the pdb-backup1.cern.ch machine and check contents of the /backup5//pfile directory. Choose the latest pfile and copy it to your machine.
ssh oracle@pdb-backup1.cern.ch
ls /backup5/compdb7/pfile
....
scp oracle@pdb-backup1.cern.ch:/backup5/compdb7/pfile/<THE_LATEST_PFILE> $ORACLE_BASE/admin/<SID>/pfile/init<SID>.ora
ln -s /ORA/dbs01/oracle/admin/<SID>/pfile/init<SID>.ora $ORACLE_HOME/dbs

  • 6. Prepare listener.ora and tnsnames.ora files and copy them into appropriate place. The files should be otained from
one of the other COMPASS nodes e.g. compassdb08.
scp oracle@compassdb08.cern.ch:/ORA/dbs01/oracle/admin/network/listener.ora /ORA/dbs01/oracle/admin/network/listener.ora
scp oracle@compassdb08.cern.ch:/ORA/dbs01/oracle/admin/network/tnsnames.ora /ORA/dbs01/oracle/admin/network/tnsnames.ora
ln -s /ORA/dbs01/oracle/admin/network/listener.ora $ORACLE_HOME/network/admin
ln -s /ORA/dbs01/oracle/admin/network/tnsnames.ora $ORACLE_HOME/network/admin

then replace all host and SID specific entries with appropriate ones.

  • 7. Create an oracle password file:

orapwd file=$ORACLE_HOME/dbs/orapw<SID> password=XXXXXX
ln -s $ORACLE_HOME/dbs/orapw<SID> $ORACLE_HOME/dbs/orapw

  • 8. Start the database in the nomount mode:
sqlplus "/ as sysdba"
startup nomount

  • 9. Start the listener:
lsnrctl start

  • 10. Configure TMS and TDPO clients:
a. Update the environment: add to the .bashrc the lines:
export DSM_CONFIG=/opt/tivoli/tsm/client/ba/bin/dsm.opt
export DSM_DIR=/opt/tivoli/tsm/client/ba/bin
export LD_LIBRARY_PATH=/opt/tivoli/tsm/client/api/bin
and execute:
source ~/.bashrc

b. Check existence of configuration files and eventually install them (as root). They are available on CVS in Applications/COMPASS/tsm_files. These files have to be copied in the corresponding folders on the machine of the new database server, as follows:

cp api_bin_dsm.sys /opt/tivoli/tsm/client/api/bin/dsm.sys
cp ba_bin_dsm.opt /opt/tivoli/tsm/client/ba/bin/dsm.opt
cp ba_bin_dsm.sys /opt/tivoli/tsm/client/ba/bin/dsm.sys
cp ba_bin_backup.excl /opt/tivoli/tsm/client/ba/bin/backup.excl
cp oracle_bin_dsm.opt /opt/tivoli/tsm/client/oracle/bin/dsm.opt
cp oracle_bin_tdpo.opt /opt/tivoli/tsm/client/oracle/bin/tdpo.opt
ln -s /opt/tivoli/tsm/client/ba/bin /usr/dsm

c. Set node-specific parameters in one of the configuration files:

/opt/tivoli/tsm/client/oracle/bin/tdpo.opt

and set the field TDPO_NODE with the corresponding label for the node (as agreed for the node registration, see above). For example in case of compdb7 database the field should be set to compassdb07_ora.

d. Set required access rights and password.

cd /opt/tivoli/tsm/client/api
sudo chmod 777 bin/

Change the TDPO password used for replaced node:

sudo su
tdpoconf password -TDPO_OPTfile=/opt/tivoli/tsm/client/oracle/bin/tdpo.opt
exit

  • 11. Connect to the rman catalog and check the id of the database you are recovering:

sqlplus pdb_rman5/XXXXXX@oemrep
select dbid, name from rc_database where name='<SID>';

  • 12. Connect to target in new machine:
rman

connect catalog pdb_rman5/XXXXXX@oemrep
set dbid #####
connect target /

  • 13. Check with RMAN the sequence number of the last backed up archivelog

list backup of archivelog from time 'sysdate-1';

  • 14. Start the recovery procedure (!!sequence should be the number after the last selected from catalog list command!!)
run {
restore controlfile;
set until sequence 1830 thread 1;
alter database mount;
restore database;
recover database;
alter database open resetlogs;
}

Than go for a coffee or even to sleep.

  • 15. Grant sysdba privilage to pdb_admin user
sqlplus "/ as sysdba"
grant sysdba to pdb_admin;

  • 16. Create temporary file on TEMP tablespace
ALTER TABLESPACE temp01 ADD TEMPFILE '/ORA/dbs03/oradata/<SID>/<SID>_temp01_01.dbf' size 2000M;


This topic: PSSGroup > PhysicsDatabasesSection > OnShift > RecoveryCompassDB
Topic revision: r2 - 2005-12-19 - DirkGeppert
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback