Welcome 微信登录

首页 / 数据库 / MySQL / 在Oracle 12C上实施ACFS replication

环境: qc550705 & qc550707, AIX6.1+12c RACPrimary FS: qc550705:/acfs3Standby FS: qc550707:/acfsstd1实施前提:primary FS的可用空间必须等于其已使用空间以下是实施Replication的步骤:1、 建立replication admin(一个节点上操作)grid@qc550705:/home/grid>sqlplus "/as sysasm" SQL*Plus: Release 12.1.0.1.0 Production on Fri Feb 14 16:24:33 2014 Copyright (c) 1982, 2013, Oracle.  All rights reserved.  Connected to:Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit ProductionWith the Real Application Clusters and Automatic Storage Management options SQL> CREATE USER acfsrep1 IDENTIFIED BY "773946"; User created. SQL> GRANT sysasm,sysdba TO acfsrep1; Grant succeeded.。 2、 建立standby FS--Add ACFS volumeSQL> select a.group_number,b.name,a.name,value from v$asm_attribute a,v$asm_diskgroup b where lower(a.name) like "%compatible%" and b.group_number=a.group_number; GROUP_NUMBER NAME                                   NAME                                   VALUE------------ ---------------------------------------- ---------------------------------------- ------------------------------         1 ACFSDG                                 compatible.asm                         12.1.0.0.0         1 ACFSDG                                 compatible.rdbms                       12.1.0.0.0         1 ACFSDG                                 compatible.advm                          12.1.0.0.0         2 SYSDG                                    compatible.asm                         12.1.0.0.0         2 SYSDG                                    compatible.rdbms                       10.1.0.0.0 SQL> alter diskgroup acfsdg add volume acfsvol_std1 size 16G unprotected stripe_columns 1; Diskgroup altered. SQL> quitDisconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit ProductionWith the Real Application Clusters and Automatic Storage Management optionsgrid@qc550707:/home/grid>ls -l /dev/asm/acfsvol*brw-rw-r--    1 root   asmadmin   50,24577 Jan 29 13:46 /dev/asm/acfsvol1-48brw-rw-r--    1 root   asmadmin   50,24578 Jan 29 12:31 /dev/asm/acfsvol3-48brw-rw-r--    1 root   asmadmin   50,24579 Feb 14 16:32 /dev/asm/acfsvol_std1-48grid@qc550707:/home/grid>mkfs -V acfs -s 16G /dev/asm/acfsvol_std1-48mkfs: version                 = 12.1.0.1.0mkfs: on-disk version         = 39.0mkfs: volume                    = /dev/asm/acfsvol_std1-48mkfs: volume size             = 17179869184mkfs: Format complete. --Mount /acfsstd1root@qc550707:/>srvctl add filesystem -device /dev/asm/acfsvol_std1-48 -path /acfsstd1 -node qc550707root@qc550707:/>srvctl start filesystem -device /dev/asm/acfsvol_std1-48 -node qc550707 root@qc550707:/>crsctl status res ora.acfsdg.acfsvol_std1.acfs -t--------------------------------------------------------------------------------Name         Target  State        Server                 State details--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.acfsdg.acfsvol_std1.acfs      1        ONLINE  ONLINE     qc550707               mounted on /acfsstd1                                                           ,STABLE-------------------------------------------------------------------------------- 3、 为ASM instances增加ACFS replication专用的Service(两节点都要执行) --add service name for +ASM1grid@qc550705:/home/grid>sqlplus "/as sysasm" SQL*Plus: Release 12.1.0.1.0 Production on Fri Feb 14 16:36:29 2014 Copyright (c) 1982, 2013, Oracle.  All rights reserved.  Connected to:Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit ProductionWith the Real Application Clusters and Automatic Storage Management options SQL> alter system set service_names="+ASM1,primary_acfsrep" sid="+ASM1"; System altered. SQL> show parameter service_name NAME                               TYPE        VALUE------------------------------------ ----------- ------------------------------service_names                        string      +ASM1,primary_acfsrep --add service name for +ASM1 & +ASM2grid@qc550707:/home/grid>sqlplus "/as sysasm" SQL*Plus: Release 12.1.0.1.0 Production on Fri Feb 14 16:37:06 2014 Copyright (c) 1982, 2013, Oracle.  All rights reserved.  Connected to:Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit ProductionWith the Real Application Clusters and Automatic Storage Management options SQL> alter system set service_names="+ASM2,standby_acfsrep" sid="+ASM2"; System altered. SQL> show parameter service_name NAME                               TYPE        VALUE------------------------------------ ----------- ------------------------------service_names                        string      +ASM2,standby_acfsrep 4、 在Primary 和 Standby节点tnsnames.ora文件中增加指向ASM instance的连接串--add standby FS net service name to tnsnames.ora in Primary node qc550705standby_acfsrep=(DESCRIPTION=  (ADDRESS=(PROTOCOL=tcp)(HOST=qc550707)(PORT=1521))  (CONNECT_DATA=(SERVICE_NAME=standby_acfsrep)))    --add Primary FS net service name to tnsnames.ora in standby node qc550707primary_acfsrep=(DESCRIPTION=  (ADDRESS=(PROTOCOL=tcp)(HOST=qc550705)(PORT=1521))  (CONNECT_DATA=(SERVICE_NAME=primary_acfsrep))) --Test connection to standby ASM instance using sqlplus on primary nodesqlplus acfsrep1/773946@standby_acfsrep as sysasm --Test connection to primary ASM instance using sqlplus on standby nodesqlplus acfsrep1/773946@primary_acfsrep as sysasm 5、 在Standby node和Primary node上发起replication initialize--initialize standby FSroot@qc550707:/>acfsutil repl init standby -p acfsrep1/773946@primary_acfsrep -c standby_acfsrep /acfsstd1Registering with user specified service name-standby_acfsrep --观察standby node上的复制已经启动root@qc550707:/>acfsutil repl info -c -v /acfsstd1Site:                                StandbyStandby status:                      Initializing    Initializing directoriesBackground Resources:                4 of 4 OnlineStandby mount point:               /acfsstd1Standby Oracle Net service name:   standby_acfsrepPrimary mount point:Primary Oracle Net service name:   primary_acfsrepPrimary Oracle Net alias:            repladm/****@primary_acfsrepReplicated tags:Log compression:                   OffDebug log level:                   2 --紧接着在Primary node上发起ACFS replication的操作/sbin/acfsutil repl init primary -s acfsrep1/773946@standby_acfsrep -m /acfsstd1 -c primary_acfsrep /acfs3root@qc550705:/>/sbin/acfsutil repl init primary -s acfsrep1/773946@standby_acfsrep -m /acfsstd1 -c primary_acfsrep /acfs3validating the remote connectionremote connection has been establishedRegistering with user specified service name-primary_acfsrepThe standby replication site is initialized. ACFS replication will begin. 6、 验证replication是否已经完成--Primary noderoot@qc550705:/acfs3/.ACFS/repl/logs>acfsutil repl info -c -v /acfs3Site:                                PrimaryLag Time:                            00:00:00Primary status:                      OnlineBackground Resources:                3 of 3 OnlinePrimary mount point:               /acfs3Primary Oracle Net service name:   primary_acfsrepStandby mount point:               /acfsstd1Standby Oracle Net service name:   standby_acfsrepStandby Oracle Net alias:            acfsrep1/****@standby_acfsrepReplicated tags:Log compression:                   OffDebug log level:                   2 --Standby noderoot@qc550707:/>acfsutil repl info -c -v /acfsstd1Site:                                StandbyStandby status:                      OnlineLast sync time with primary:       Tue Mar 25 11:46:09 2014Background Resources:                4 of 4 OnlineStandby mount point:               /acfsstd1Standby Oracle Net service name:   standby_acfsrepPrimary mount point:               /acfs3Primary Oracle Net service name:   primary_acfsrepPrimary Oracle Net alias:            acfsrep1/****@primary_acfsrepReplicated tags:Log compression:                   OffDebug log level:                   2实施过程中的注意事项:(1)   在standby node上发起initial replication操作后要紧接着在primary node上发起initial replication操作,否则standby node上的FS会一直处于initializing状态,且日志里还有有如下显示,the truck config information是由primary node生成的:transportstdbyacfsvol_std1-48.log:2014-03-25 10:40:35.433: [transprt][/acfsstd1]Waiting for truck config info...sleeping(2)   Primary FS中必须要有一半的空余空间用于存放Primary log,位置在/acfs3/.ACFS/repl目录下,一旦Primary FS的可用空间少于2G,复制就会停止,在/oracle/app/grid/product/12.1.0/grid_1/log/qc550705/acfs/replication/monitorprimacfsvol3-48.log 日志里会有如下报错:[ monitor][/acfs3]usrmCheckFreeSpace: primary replication file system has 2GB or less space available per active node.  Automatically terminating replication. Flags: 0xE3在CentOS 6.4下安装Oracle 11gR2(x64) http://www.linuxidc.com/Linux/2014-02/97374.htmOracle 11gR2 在VMWare虚拟机中安装步骤 http://www.linuxidc.com/Linux/2013-09/89579p2.htmDebian 下 安装 Oracle 11g XE R2 http://www.linuxidc.com/Linux/2014-03/98881.htm更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12本文永久更新链接地址