when facing the requirement to configue a dataguard and switch over it twice in 60 minutes, I feel so hard.
network need configue , database archive mode ,force logging ,password file , ssh ,parameter file, standby logfile and standby control file all come to you in a rush. too much typing work .
if any of the critcal step missed ,you missed the testing. Switchover is another chanllege , any possible status not the "TO PRIMARY" or " TO STANDBY " you will lost you mind and crashed. no time to do it again.
following is some files in the try:
initocm.ora in server fred3 : inital as the primary
db_name=ocm
db_files = 80 # SMALL
db_file_multiblock_read_count = 8 # SMALL
log_checkpoint_interval = 10000
sga_target=500m
processes = 50 # SMALL
parallel_max_servers = 5 # SMALL
log_buffer = 32768 # SMALL
max_dump_file_size = 10240 # limit trace file size to 5 Meg each
global_names = TRUE
control_files = (/n01/oradata1/ocm/control01.ctf,/n01/oradata1/ocm/control02.ctf)
undo_management=auto
undo_tablespace=undotbs
background_dump_dest=/n01/oraadmin1/ocm/bdump
core_dump_dest=/n01/oraadmin1/ocm/cdump
user_dump_dest=/n01/oraadmin1/ocm/udump
db_file_name_convert='std','ocm'
log_file_name_convert='std','ocm'
standby_file_management=auto
fal_server=std
fal_client=ocm
log_archive_dest_1='location=/n01/oradata1/arch/ocm valid_for=(all_logfiles,all_roles) db_unique_name=ocm'
log_archive_dest_2='service=std lgwr sync affirm valid_for=(online_logfiles,primary_role) db_unique_name=std'
log_archive_config='dg_config=(std,ocm)'
db_unique_name=ocm
initocm.ora in server fred2 : inital as the standby
db_name=ocm
db_files = 80 # SMALL
db_file_multiblock_read_count = 8 # SMALL
log_checkpoint_interval = 10000
sga_target=500m
processes = 50 # SMALL
parallel_max_servers = 5 # SMALL
log_buffer = 32768 # SMALL
max_dump_file_size = 10240 # limit trace file size to 5 Meg each
global_names = TRUE
control_files = (/n01/oradata1/std/control01.ctf,/n01/oradata1/std/control02.ctf)
undo_management=auto
undo_tablespace=undotbs
background_dump_dest=/n01/oraadmin1/ocm/bdump
core_dump_dest=/n01/oraadmin1/ocm/cdump
user_dump_dest=/n01/oraadmin1/ocm/udump
db_file_name_convert='ocm','std'
log_file_name_convert='ocm','std'
standby_file_management=auto
fal_server=ocm
fal_client=std
log_archive_dest_1='location=/n01/oradata1/arch/ocm valid_for=(all_logfiles,all_roles) db_unique_name=std'
log_archive_dest_2='service=ocm lgwr sync affirm valid_for=(online_logfiles,primary_role) db_unique_name=ocm'
log_archive_config='dg_config=(std,ocm)'
db_unique_name=std
listener.ora in server fred3 : inital as the primary
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=fred3)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=ocm)
(SID_NAME=ocm)
(ORACLE_HOME=/u01/app/oracle/product/10.2.0.0/database)
)
)
tnsnames.ora in server fred3 & fred2 : same for both side
ocm=(description=(address=(host=fred3)(port=1521)(protocol=tcp))
(connect_data=(service_name=ocm))
)
std=(description=(address=(host=fred2)(port=1521)(protocol=tcp))
(connect_data=(service_name=std))
)
commands:
alter database archivelog;
alter database force logging;
alter database set standby database to maximize protection;
alter database create standby controlfile as '/u01/sss.ctf';
alter database recover managed standby database using current logfile disconnect;
alter database commit to switchover to physcial standby database with session shutdown;
alter database commit to switchover to primary;
alter database add standby logfile group 4 ('/n01/oradata1/ocm/dredo04.log') size 10m;
alter database add standby logfile group 5 ('/n01/oradata1/ocm/dredo05.log') size 10m;
alter database add standby logfile group 6 ('/n01/oradata1/ocm/dredo06.log') size 10m;
alter database add standby logfile group 7 ('/n01/oradata1/ocm/dredo07.log') size 10m;
select switchover_status from v$database;
orapwd
scp