duplicate搭建DG最大效能(rac-單例項)

zhangsharp20發表於2017-04-21
備庫操作:
一、建立pfile和密碼口令檔案

我建立的pfile如下:

*.control_files='/dup1/control01.ctl'
*.db_block_size=8192
*.db_create_file_dest='/dup1'
*.db_file_name_convert='+oradata','/dup1'
*.db_name='test'
*.db_recovery_file_dest='/arch'
*.db_recovery_file_dest_size=4621074432
*.fal_client='dup1'
*.fal_server='test'
*.log_archive_format='%t_%s_%r.dbf'
*.log_file_name_convert='+oradata','/dup1','+rcy','/dup2'
*.remote_login_passwordfile='exclusive'
*.standby_file_management='AUTO'
db_unique_name=testt
log_archive_config='DG_CONFIG=(testt,test)'
LOG_ARCHIVE_DEST_1='LOCATION=/arch VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=testt';

建立密碼口令檔案:

orapwd file=$ORACLE_HOME/dbs/orapwtest password=oracle entries=3

在備庫上配置監聽

LISTENER=
  (DESCRIPTION=
    (ADDRESS_LIST=
      (ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.120)(PORT=1521))))
SID_LIST_LISTENER=
  (SID_LIST=
    (SID_DESC=
      (GLOBAL_DBNAME=dup1)
      (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME=test)))

配置完成重啟監聽

[oracle@ora3 admin]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-MAR-2017 04:33:42


Copyright (c) 1991, 2013, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.120)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                01-JAN-2017 14:10:43
Uptime                    81 days 14 hr. 23 min. 19 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Log File         /u01/app/oracle/diag/tnslsnr/ora3/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ora3)(PORT=1521)))
Services Summary...
Service "test" has 1 instance(s).
  Instance "test", status BLOCKED, has 1 handler(s) for this service...
The command completed successfully
[oracle@ora3 admin]$ lsnrctl stop


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-MAR-2017 04:33:49


Copyright (c) 1991, 2013, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.120)(PORT=1521)))
The command completed successfully
[oracle@ora3 admin]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 24-MAR-2017 04:33:55


Copyright (c) 1991, 2013, Oracle.  All rights reserved.


Starting /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/ora3/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.120)(PORT=1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.120)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date                24-MAR-2017 04:33:55
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/ora3/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.162.120)(PORT=1521)))
Services Summary...
Service "test" has 1 instance(s).
  Instance "test", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

主庫操作:

1、開啟最小日誌


SQL> select log_mode,force_logging from v$database;


LOG_MODE     FOR
------------ ---
ARCHIVELOG   NO


SQL> alter database force logging;


Database altered.


SQL> select log_mode,force_logging from v$database;


LOG_MODE     FOR
------------ ---
ARCHIVELOG   YES

2、修改引數

主庫:
alter system set log_archive_config='DG_CONFIG=(test,testt)';
alter system set LOG_ARCHIVE_DEST_1='LOCATION=+RCY VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=test';
alter system set LOG_ARCHIVE_DEST_2='SERVICE=dup1 arch SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=testt';

3、登入rman


rman target / auxiliary sys/oracle@dup1 nocatalog


4、開始複製
run 
{
DUPLICATE TARGET DATABASE
FOR STANDBY
FROM ACTIVE DATABASE
DORECOVER;
}

恢復完之後備庫:


alter database recover managed standby database disconnect from session;


然後主庫切換日誌,備庫檢視告警是否已經傳輸日誌

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29802484/viewspace-2137741/,如需轉載,請註明出處,否則將追究法律責任。

相關文章