Escolar Documentos
Profissional Documentos
Cultura Documentos
SL
No
Description
Preparing
standby
using Rman
image copy
Versio
n
Date
Changed
By
14/08/2
012
Phanikis
han
Approved
By
Remarks
create the password file if already they take the backup and create new one
$orapwd file=orapw$ORACLE_SID password=welcome
log_file_name_convert='/1500/sai/app/sai/oradata/prod','/oracle/database/saistby/app/s
aistby/oradata/dev'
Create the directories according to the parameter file.
Use the following parameter to change the database name from prod to dev keep the
format as
db_name ='prod'
db_unique_name='dev'
Here in this section we will configure the two listener one is used by the database
and other is used for the RMAN to send the data from Target to the Auxiliary
Main listener for the primary
prod =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.17.44)(PORT = 2000))
)
)
SID_LIST_prod =
(SID_LIST =
(SID_DESC =
(SID_NAME = prod)
(ORACLE_HOME = /1500/sai/app/sai/product/11.2.0/dbhome_1)
)
)
local =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.17.44)(PORT = 2501))
)
)
SID_LIST_local=
(SID_LIST =
(SID_DESC =
(SID_NAME = prod)
(ORACLE_HOME = /1500/sai/app/sai/product/11.2.0/dbhome_1)
)
)
Tns entry for the Standby listener. According to this configure the standby listener.
to_standby =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.17.35)(PORT = 3000))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(ORACLE_SID =dev)
)
)
Check Whether the listener and tnsnames pinging correctly are not
At Primary
lsnrctl
lsnrctl
tnsping
tnsping
status prod
status local
to_standby
to_local
At Standby
lsnrctl status dev
tns_ping to_prod
After pinging correctly check whether we are connecting to the database using sys
user both in primary and standby
AT Primary
sqlplus sys/welcome as sysdba
sqlplus sys/welcome@to_standby as sysdba
AT Standby
sqlplus sys/welcome as sysdba
sqlplus sys/welcome@to_prod as sysdba
If Successfully Connected then our Network configured successfully.
Note : Please put the standby database in nomount while restore
Now connect to the Rman via target and Auxiliary to send the data from primary to
standby.
5
FINALLY AT THE STANDBY FINISH TASKS TO SYNC THE ARCHIVES AND TO APPLY
ARCHIVES
Here the database will be in nomount state issue the following commands after
completing the RMAN restore.
SQL>alter database mount standby database;
SQL>alter database recover managed standby database disconnect from session;
The above query will put the data in MRM mode (Managed Recovery Mode)
The archives will sync now.
To Come out of MRM mode use the following query.
SQL>alter database recover managed standby database cancel;
Check the archvies syncing and wheather applied are not using the following queries.
SQL>select name,applied from v$archived_log;
SQL>select process,status,sequence#,block# from vss$managed_standby;
Now check the archive log list in both the databases by connecting to sqlplus and
check the sequence number. It should match.
If it matches it is done
We have prepared the standby database for the primary database.
Suddenly if the Primary database gets crashed do the following tasks to make the
Standby database as Primary.
Firstly check the Archive log sequence of the primary if the server is up and
compare the Archive log sequence of primary with standby if any archives are
missing copy them from primary to standby.
Use the following tables to check the Archive log sequence applied are not.
SQL> select name, applied from v$archived_log;
SQL> select sequence#,process,status,block# from v$managed_standby;
SQL> select database_role from v$database;
IT should be Physical Standby
After doing this confirm the archives are up to date or not and issue the following
commands.
SQL> alter database recovery managed standby database finish;
The above query will make the database to come out of MRM mode.
SQL> alter database active standby database;
SQL> alter database open;
SQL>select database_role from v$database;