looks so easy while hard to do -standby in 60minutes

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

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值