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;
Oracle DG
最新推荐文章于 2024-09-18 13:35:17 发布
本文详细介绍了如何使用物理备用数据库进行读/写测试和报告,包括故障切换步骤、重新激活备用数据库、增量备份和恢复、控制文件的备份与恢复等关键操作。通过这些步骤,可以在确保数据安全的同时,实现数据库的高效管理和维护。
摘要由CSDN通过智能技术生成