Oracle DG

本文详细介绍了如何使用物理备用数据库进行读/写测试和报告,包括故障切换步骤、重新激活备用数据库、增量备份和恢复、控制文件的备份与恢复等关键操作。通过这些步骤,可以在确保数据安全的同时,实现数据库的高效管理和维护。
摘要由CSDN通过智能技术生成

  
   create tablespace "tbs001" datafile '/u01/app/oracle/oradata/icisep/tbs001.dbf' size 100m reuse autoextend on next 1280k maxsize 1024M logging extent management local segment space management auto;

   create table scott.t1 (f1 varchar2(100)) tablespace "tbs001" pctfree 10 initrans 1 maxtrans 255 storage (initial 64k buffer_pool default) logging;

create or replace procedure scott.insert_t1(
  p_times in number,
  p_desc  in varchar2
) as
begin
  for i in 1..p_times loop
    insert into scott.t1 values(to_char(systimestamp,'YYYYMMDD HH24:MI:SSXFF') || ' did ' || p_desc);
  end loop;
  commit;
end;
/

  

   1. Check flashback status on both DBs:
      SQL> Select flashback_on from v$database;
      # The results are 'YES'

   2. Disable the dg_broker_start on both DBs:
      SQL> Alter system set dg_broker_start=false scope=both;

   3. On standby DB(icises):
      SQL> Shutdown immediate;
      SQL> Startup nomount;
      SQL> Alter database mount standby database;

   4. Reset the log_archive_dest for remote:
      SQL> ALTER SYSTEM SET log_archive_dest_3='service="(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=tcp)(HOST=oracletest02.macaowater.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=icises_XPT)(INSTANCE_NAME=icises)(SERVER=dedicated)))"','   LGWR SYNC AFFIRM delay=0 OPTIONAL max_failure=0 max_connections=1   reopen=300 db_unique_name="icises" register net_timeout=180 valid_for=(online_logfile,primary_role)' SCOPE=BOTH;
      SQL> alter system set log_archive_dest_state_3=enable scope=both;

   5. On primary DB(icisep), login scott to do some transactions:
      SQL> call scott.insert_t1(10000, 'before failover');

   6. On primary DB(icisep), login sys to switch log file:
      SQL> alter system switch logfile;
      SQL> alter system switch logfile;
  

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值