Sunteți pe pagina 1din 5

Contents

Purpose & Scope..............................................................................................................................3


Access testing: Procedure................................................................................................................3
DR test procedure Oracle 10g databases..............................................................................................................................3
Document History:...........................................................................................................................................................3
Intended audience:............................................................................................................................................................3
Objectives of this document:............................................................................................................................................3
Conventions used:............................................................................................................................................................3
Concepts:..........................................................................................................................................................................3
Stop log shipping between primary and standby:............................................................................................................3
Shut down Primary database and configure standby:......................................................................................................4
Start DR Oracle Database as primary:.............................................................................................................................5
Shut down DR standby database:.....................................................................................................................................5
Restart the PROD Oracle DB as primary:........................................................................................................................5
Activate Dataquard between Primary and Standby:........................................................................................................6
References........................................................................................................................................6

1 of 5

Purpose & Scope


This document covers how to start , stop services on tru64 and AIX servers
Also explains handling service problems with respect to clusters
Please note services stop start on tru64 clusters is usually in Unix teams scope, we should only be
starting services on specific hosts if Unix are aware and happy for us to do so.

Access testing: Procedure

DR test procedure Oracle 10g databases


Document History:
K Chaitanya

2014-09-09

Original

STOP PROD

Stop log shipping between primary and standby:


Login to PRIMARY:
<service>a % cd ~/../../rc
<service>a % ./${SERVICE}a d (ensure you dont have multiple databases running under same
service)
<service>a % sqlplus /as sysdba
SQL>
SQL>
SQL>
SQL>

alter
alter
alter
alter

system
system
system
system

archive log current;


switch logfile;
switch logfile;
set log_archive_dest_state_2=defer scope=both;

Shut down Primary database and configure standby:


PRIMARY:
<service>a % ./${SERVICE}a stop (ensure you dont have multiple databases running under same
service)

2 of 5

<service>a % cd ~/../../etc
<service>a % vi oratab lsnrtab
put N in the oratab and lsnrtab so nothing auto starts.
N.B. As the shutdown step reconfigure the standby to be a primary.
Otherwise if they are performing cluster reconfiguration (rather than just a dns rename) the
services will automatically start.
STANDBY:
<service>a % cd ~/../../rc
<service>a % ./${SERVICE}a d (ensure you dont have multiple databases running under same
service)
Ensure all archives applied.
<service>a % sqlplus /as sysdba
SQL > select thread# "APPL_THREAD#",sequence# "APPL_SEQUENCE#" from v$archived_log
where recid in (select max(recid) from v$archived_log
where applied='YES'
and resetlogs_id = (select resetlogs_id from v$database_incarnation where
status='CURRENT')
group by thread#
)
order by thread#;
Pre requisite for snapshot standby setup is to have flashback setup.
1) Configure flash recovery area as given below
a) Set the size for recovery area, as part of the DR test app teams will do basic testing
so usage will be very less, if available assign 10g otherwise 5g should be OK.
SQL > alter system set db_recovery_file_dest_size=10g scope=both;
b) Set Flash recovery area.
Ensure you have flash recovery area else create one using below.
mkdir $ORACLE_ADMIN/flash
Use this location to create flash recovery destination example one is below.
Note modify directory structure below accordingly
SQL > alter system set db_recovery_file_dest='/app/gors004/01/admin/GORS004T/flash'

scope=both;

c) Cancel the recovery on the applying instance, Switch on flashback and create a
Guaranteed Restore Point
SQL> alter database recover managed standby database cancel;
SQL> ALTER DATABASE FLASHBACK ON;
SQL> create restore point DR_TEST guarantee flashback database;
d) Convert physical standby database to snapshot standby database.
SQL> alter database activate standby database;
SQL> startup mount force;
SQL> alter database open;

(Below is optional step discuss with app team)


Set job_queue_processes and aq_tm_processes to 0 as we need to ensure unwanted jobs and
queues are not running.
e) Once the database is restarted any transaction can be executed.
SQL> select open_mode, database_role from v$database;

OPEN_MODE DATABASE_ROLE
---------- ---------------READ WRITE PRIMARY
f) On standby change host name in local_listener parameter
SQL> alter system set local_listener='(address=(protocol=tcp)
(host=gors004a.eu.unilever.com)(port=16572))' scope=both;
g) Finally stop standby services modify configuration files.
<service>a % ~/../../rc
<service>a % ./${SERVICE}a stop (ensure you dont have multiple databases running under
same service)
<service>a % cd ~/../../etc
<service>a % cp /app/${SERVICE}/01/etc/${SERVICE}a.definitions /app/${SERVICE}/01/etc/$
{SERVICE}a.definitions.orig
vi

the ~/../../etc/${SERVICE}a.definitions file and remove the references to_stby

export GORS004A_START[1]=dbstart_stby -> change to export GORS004A_START[1]=dbstart


export GORS004A_STOP[0]=dbshut_stby -> change to export GORS004A_STOP[0]=dbshut
export SERVICE_NAME=gors804a -> change to export SERVICE_NAME=gors004a

3 of 5

<service>a % cp /app/${SERVICE}/01/etc/listener.ora /app/$


{SERVICE}/01/etc/listener.ora.orig
<service>a % vi /app/${SERVICE}/01/etc/listener.ora
Change host name for example change gors804.eu.unilever.com to gors004a.eu.unilever.com
Before Unix team task logout from all your opened sessions on primary and standby
(least case Unix guy will kill all your sessions)

Activate DR

Shutdown HACMP resources for prod AIX-cluster and reconfigure on DR AIX-Cluster UNIX task

Start DR Oracle Database as primary:


You just need to check it has come up and is available.

Business Process testing App team


Realign PROD services

Shut down DR standby database:


Standby: stop the services put N in the oratab and lsnrtab so nothing auto starts.
1) Shutdown the snapshot standby database.
SQL > Shut immediate
2) Bring the database to the mount stage.
SQL > startup mount;
3) Issue the command
SQL > FLASHBACK DATABASE TO RESTORE POINT DR_TEST;
SQL > ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
4) Shutdown the database and mount it.
SQL > shut immediate
SQL > startup nomount
SQL > alter database mount standby database;
SQL > select open_mode, database_role from v$database;
OPEN_MODE DATABASE_ROLE
---------- ---------------MOUNTED
PHYSICAL STANDBY
5) SQL > alter system set local_listener='(address=(protocol=tcp)
(host=gors804a.eu.unilever.com)(port=16572))' scope=both;
6) shutdown the database & listener(ensure you dont have multiple databases running under same
service)
7) restore old definitions file & revert changes from listener.ora (host name)

Restore HACMP resources for DR AIX cluster and reconfigure on PROD AIX cluster - UNIX task

Restart the PROD Oracle DB as primary:


Standby: put Y in the oratab and lsnrtab
1) start listener
<service>a % lsnrctl start (in case if you have stopped)
2) start database
SQL > startup nomount
SQL > alter database mount standby database;
PRIMARY: put Y in the oratab and lsnrtab
3) start listener (in case if you have stopped)
<service>a % lsnrctl start
4) start database
SQL>startup mount
SQL> alter system set log_archive_dest_state_2=enable scope=both; (database is in maximum
availability mode hence this has to be enabled first)
SQL> alter database open;

Activate Dataquard between Primary and Standby:


Standby:
Stop flash back and drop restore point
4 of 5

SQL > ALTER DATABASE FLASHBACK OFF;


SQL > drop restore point DR_TEST;
start recovery
SQL > alter database recover managed standby database disconnect;

References

5 of 5

S-ar putea să vă placă și