Oracle 11G Dataguard with Broker and Fast_start failover

11G DG

修改listener和tns

Pri

Lsnr

——————————————————————————————————————————

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir01.us.oracle.com)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

)

)

SID_LIST_LISTENER=

(SID_LIST=

(SID_DESC=

(GLOBAL_DBNAME=orcl.us.oracle.com)

(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME=orcl))

(SID_DESC=

(GLOBAL_DBNAME=orcl_DGMGRL.us.oracle.com)

(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME=orcl))

)

ADR_BASE_LISTENER = /u01/app/oracle

——————————————————————————————————————————

 

Tns:

ORCL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir01.us.oracle.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl.us.oracle.com)

)

)

orcldg =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir02.us.oracle.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SID=orcl)

)

)

orclpri =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir01.us.oracle.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SID=orcl)

)

)

——————————————————————————————————————————

STB

Lsnr:

——————————————————————————————————————————

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir02.us.oracle.com)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

)

)

SID_LIST_LISTENER=

(SID_LIST=

(SID_DESC=

(GLOBAL_DBNAME=orcl.us.oracle.com)

(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME=orcl))

(SID_DESC=

(GLOBAL_DBNAME=orcldg_DGMGRL.us.oracle.com)

(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)

(SID_NAME=orcl))

)

ADR_BASE_LISTENER = /u01/app/oracle

——————————————————————————————————————————

Tns:

——————————————————————————————————————————

ORCL =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir02.us.oracle.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl.us.oracle.com)

)

)

orcldg =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir02.us.oracle.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SID=orcl)

)

)

orclpri =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = ed5sir01.us.oracle.com)(PORT = 1521))

(CONNECT_DATA =

(SERVER = DEDICATED)

(SID=orcl)

)

)

——————————————————————————————————————————

启动主备机lsnrctl

准备参数:

alter system set log_archive_config=’DG_CONFIG=(orcl,orcldg)’ ;

alter system set db_recovery_file_dest_size=4G;

alter system set db_recovery_file_dest=’/u01/app/oracle/flash_recovery_area’ scope=spfile;

alter system set log_archive_dest_1=’location=/u01/app/oracle/arch db_unique_name=orcl’;

alter system set log_archive_dest_2=’SERVICE=orcldg VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldg’;

alter system set log_archive_dest_state_2=’defer’;

alter system set db_file_name_convert=’/u01/app/oracle/oradata/orcl/’,'/u01/app/oracle/oradata/orcl/’ scope=spfile;

alter system set log_file_name_convert=’/u01/app/oracle/oradata/orcl/’,'/u01/app/oracle/oradata/orcl/’ scope=spfile;

alter system set standby_file_management=AUTO ;

alter system set db_lost_write_protect=’TYPICAL’;

alter system set fal_client=’orcl’;

alter system set fal_server=’orcldg’;

alter system set db_unique_name=’orcl’ scope=spfile;

数据库启动归档及闪回:

Shutdown immediate;

Startup mount;

alter database archivelog;

alter database force logging;

alter database flashback on;

alter database open;

增加standby redo log

alter database add standby logfile ‘/u01/app/oracle/oradata/orcl/stb_redo01.log’ size 60m;

alter database add standby logfile ‘/u01/app/oracle/oradata/orcl/stb_redo02.log’ size 60m;

alter database add standby logfile ‘/u01/app/oracle/oradata/orcl/stb_redo03.log’ size 60m;

alter database add standby logfile ‘/u01/app/oracle/oradata/orcl/stb_redo04.log’ size 60m;

备库准备参数文件、密码文件;创建audit目录,控制文件、数据文件、日志文件、归档目录

备库启动到nomount;

主数据通过rman 搭建dg

rman target / auxiliary sys/oracle@orcldg

rman>duplicate target database for standby from active database nofilenamecheck;

sql> alter system set log_archive_dest_state_2=enable;

备库启动MRP:

alter database recover managed standby database using current logfile disconnect;

验证DG

备库启动real time apply with query:

Shutdown immediate;

Startup mount;

Alter database flashback on;

Alter database open read only;

alter database recover managed standby database using current logfile disconnect;

配置DROKER:

alter system set dg_broker_start=TRUE;

dgmgrl sys/oracle@orclpri

create configuration orcl_dg as primary database is orcl connect identifier is orclpri;

add database orcldg;

enable configuration;

修改保护级别:

edit database orcl set property logxptmode=’SYNC’;

edit database orcldg set property logxptmode=’SYNC’;

edit configuration set protection mode as Maxavailability;

switchover:

switchover to orcldg;

switchover to orcl;

to snapshot

convert database orcldg to snapshot database;

convert database orcldg to physical standby;

配置fast_start failover

edit database orcl set property FastStartFailoverTarget=’orcldg’;

edit database orcldg set property FastStartFailoverTarget=’orcl’;

enable fast_start failover;

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>