Install Goldengate On Oracle Rac 11.2.0.4

安装环境:

source:
OS:redhat 6.3
DB:11.2.0.4 rac
OGG:11.2.1.0.1

target:
OS:redhat 6.3
DB:11.2.0.4
OGG:11.2.1.0.1

rac到单机的一个传输配置,这里测试ogg没有放入到共享存储中。建议生产环境将ogg放入共享存储,以免单点故障。

Prepare(Source And Target DB):

useradd ogg -g oinstall

Add Environment Varible
vi /home/oracle/.bash_profile
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:/ogg

Configure Database
alter database archivelog;
alter database force logging;
alter database add supplemental log data;

For Oracle DB versions 11.2.0.4 and 12.1.0.2 there will be a new init.ora parameter called ENABLE_GOLDENGATE_REPLICATION.  In order for some of the Oracle GoldenGate functionality to work, this parameter must be set to true.

ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH;

Create OGG User:
sqlplus / as sysdba
create user ogg identified by ogg;
grant dba to ogg;

GGSCI (zbdba1) 1> edit params ./GLOBAL
GGSCHEMA ogg
CHECKPOINTTABLE ogg.checkpoint

Installing the DDL objects:
1、Run the @marker_setup.sql script. This script installs support for the Oracle GoldenGate
marker system, which is required for DDL support. You will be prompted for the name
of the Oracle GoldenGate schema.
2、Run the @ddl_setup.sql script   Script that installs the Oracle GoldenGate DDL extraction and
replication objects. (Oracle installations)
3、Run the @role_setup.sql script. This script drops and creates the role needed for DDL
synchronization. It grants DML permissions on the Oracle GoldenGate DDL objects
4、Grant the role to all Oracle GoldenGate Extract users. You may need to make multiple
grants if the processes have different user names.
Run the @ddl_enable.sql script to enable the DDL trigger.
5、To improve the performance of the DDL trigger, make the ddl_pin script part of the database
startup. It must be invoked with the Oracle GoldenGate DDL user name, as in:
@?/rdbms/admin/dbmspool.sql
SQL> @ddl_pin ogg
To improve the performance of the DDL trigger
This script pins the PL/SQL package that is used by the trigger into memory. If executing
this script from SQL*Plus, connect as SYSDBA from the Oracle GoldenGate home directory.
This script relies on the Oracle dmbs_shared_pool system package, so install that package
before using ddl_pin.

Source DB:

MANAGER
GGSCI (zbdba1) 1>  create subdirs

GGSCI (zbdba1) 22> view param mgr

port 7839
DYNAMICPORTLIST 7840-7914
USERID OGG,PASSWORD ogg
AUTORESTART EXTRACT *, RETRIES 5, WAITMINUTES 3
PURGEOLDEXTRACTS ./DIRDAT/*,MINKEEPDAYS 3
PURGEDDLHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10,FREQUENCYMINUTES 30
PURGEMARKERHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45

EXTRACT
add extract ext1,tranlog, threads 2, begin now
add exttrail /ogg/dirdat/sa  extract ext1
add rmttrail ./dirdat/sa,extract ext1

这里使用asm时候,需要强调一下, Oracle 10.2.0.5、Oracle 11.2.0.2 版本和后续版本的数据库中,Oracle 提供了一个新的 ASM API接口 ,可以让 extract 进程直接利用数据库服务器来访问 redo 和 archive log。使用该 API 后,extract 将获得一个最大不超过 4 mb 的read buffer。read buffer 越大,对于 redo 量较高的 环境越容易提高 Extract 的进程。可以通过使用 TRANLOGOPTIONS
的 DBLOGREADERBUFSIZE 选项来指定read buffer 的大小。

这种方案只需要在抽取进程的参数中加:

TRANLOGOPTIONS DBLOGREADER

其他版本的方案:

指明asm用户密码和归档路径

TRANLOGOPTIONS ASMUSER [email protected], ASMPASSWORD oracle
TRANLOGOPTIONS ALTARCHIVELOGDEST primary instance test1 /opt/oracle/arch, ALTARCHIVELOGDEST primary instance test2 /opt/oracle/arch

配置tnsnames.ora

ASM1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.52)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = +ASM)
      (INSTANCE_NAME= +ASM1)
    )
  )

并且两个节点的归档需要用nfs映射。

这里数据库版本是11.2.0.4,所以采用方案一

EXTRACT EXT1
setenv ( NLS_LANG = AMERICAN_AMERICA.ZHS16GBK )
setenv (ORACLE_SID= "test1")
USERID ogg,PASSWORD ogg
TRANLOGOPTIONS DBLOGREADER
DDL &
INCLUDE MAPPED OBJTYPE 'TABLE' &
INCLUDE MAPPED OBJTYPE 'IDNEX' &
INCLUDE MAPPED OBJTYPE 'SEQUENCE' &
INCLUDE MAPPED OBJTYPE 'VIEW' &
INCLUDE MAPPED OBJTYPE 'PROCEDURE' &
INCLUDE MAPPED OBJTYPE 'FUNCTION' &
INCLUDE MAPPED OBJTYPE 'PACKAGE' &
INCLUDE MAPPED OBJTYPE 'MATERIALIZED VIEW' &
EXCLUDE OPTYPE COMMENT
DDLOPTIONS ADDTRANDATA NOCROSSRENAME REPORT
REPORTCOUNT EVERY 1 MINUTES,RATE
DISCARDFILE ./dirrpt/EXTSA.DSC,APPEND,MEGABYTES 1024
THREADOPTIONS MAXCOMMITPROPAGATIONDELAY 60000 IOLATENCY 60000
DBOPTIONS ALLOWUNUSEDCOLUMN
WARNLONGTRANS 2H,CHECKINTERVAL 3M
exttrail ./dirdat/sa
FETCHOPTIONS NOUSESNAPSHOT,FETCHPKUPDATECOLS,MISSINGROW REPORT
table zbdba.*;
datapump
GGSCI (zbdba1) 4>> add extract ext2,exttrailsource /ogg/dirdat/sa
EXTRACT added.

 ADD EXTTRAIL ./dirdat/sa, EXTRACT EXT2

GGGSCI (zbdba1) 4> add rmttrail  /ogg/dirdat/sa, extract ext2
RMTTRAIL added.

GGSCI (zbdba1) 2>  view param ext2

EXTRACT EXT2
passthru
RMTHOST 192.168.56.61,MGRPORT 7839,COMPRESS
RMTTRAIL ./dirdat/sa
table zbdba.*;

Target DB:

GGSCI (zbdba2) 1>  create subdirs

GGSCI (zbdba2) 42> view param mgr

port 7839
DYNAMICPORTLIST 7840-7914
USERID OGG,PASSWORD ogg
AUTORESTART REPLICAT *, RETRIES 5, WAITMINUTES 3
PURGEOLDEXTRACTS ./dirdat/*,MINKEEPDAYS 3
PURGEDDLHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10,FREQUENCYMINUTES 30
PURGEMARKERHISTORY MINKEEPDAYS 7,MAXKEEPDAYS 10
LAGREPORTHOURS 1
LAGINFOMINUTES 30
LAGCRITICALMINUTES 45 

Create Replicat
GGSCI (zbdba2) 1>  view param ./GLOBALS
GGSCHEMA ogg
CHECKPOINTTABLE ogg.checkpoint
GGSCI (zbdba2) 1> dblogin userid ogg,password ogg
GGSCI (zbdba2) 2> add checkpointtable  ogg.checkpoint

Successfully created checkpoint table OGG.CHECKPOINT.

GGSCI (zbdba2) 2>  add replicat rep1,exttrail /ogg/dirdat/sa, checkpointtable ogg.checkpoint
REPLICAT added.

GGSCI (zbdba2) 19> edit param rep1

REPLICAT rep1
ASSUMETARGETDEFS
USERID ogg, PASSWORD ogg
discardfile ./dirdat/rep1_discard.txt,append,megabytes 5
DDL INCLUDE MAPPED
DDLOPTIONS REPORT
BATCHSQL
DBOPTIONS DEFERREFCONST
DBOPTIONS LOBWRITESIZE 102400
HANDLECOLLISIONS
DDLERROR DEFAULT DISCARD RETRYOP MAXRETRIES 5 RETRYDELAY 20
--grouptransops 1
--maxtransops 1
APPLYNOOPUPDATES
MAP zbdba.*, TARGET zbdba.*;

start manager

GGSCI (zbdba2) 23> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    STOPPED     REP1        00:00:00      00:00:03

Test Data(Source and Target DB):

create tablepsace zbdab datafile '/opt/oracle/oradata/zbdba.dbf' size 100m;
create zbdba identified by oracle default tablespace zbdba;
grant dba to zbbda;

On Source DB:

User data pump:
expdp zbdba/oracle DIRECTORY=dumpdir
           DUMPFILE=zbdba.dmp LOGFILE=zbdba.log
           SCHEMAS=zbdba JOB_NAME=exp_zbdba_schema

scp data to target DB

On Target DB:
impdp zbdba/oracle DIRECTORY=dumpdir
           DUMPFILE=zbdba.dmp SCHEMAS=zbdba
           JOB_NAME=imp_zbdba_schema 

GGSCI (ogg2) 24> start rep1

Sending START request to MANAGER ...
REPLICAT REP1 starting

GGSCI (ogg2) 26> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     REP1        00:00:00      00:00:07  

On Source DB:
create table test as select * from dba_objects;

Monitor OGG(Source And Target DB):
tail -100f ggserr.log
时间: 2024-12-13 09:06:41

Install Goldengate On Oracle Rac 11.2.0.4的相关文章

Oracle Rac 11.2.0.3迁移OCR和VOTEDISK

环境:AIX7.1+Oracle Rac 11.2.0.3 迁移描述:今天在装Oracle Rac的时候,错误的将500G的数据盘用作OCRDG了,遂后续比较麻烦,只能讲ocr和votedisk迁移到新建的OCRDG上,并把DATADG删除并格式化该盘.(OCRDG为normal 冗余) 操作如下: [email protected]:/home/grid>/oraapp/grid/gridhome/bin/ocrcheck Status of Oracle Cluster Registry i

ORACLE RAC 11.2.0.4 CentOS release 6.9 静默安装1.0版本

RAC11.2.0.4静默安装 1.0版本,20180613 #本文档IP地址使用X隐藏,个人可按照自己的当前环境IP进行适当修改 1. 清除原环境中的单实例软件 #清除原环境: 删除/etc/ora* 删除 /usr/local/bin/oraenv 删除 /usr/local/bin/dbhome 删除 /usr/local/bin/coraenv 删除 $ORACLE_BASE/* 删除 cd /picclife/app  rm -rf * #解释说明: /etc/oratab ?数据库实

ORACLE RAC 11.2.0.4启动后报ORA-01172、ORA-01151错误

环境描述 操作系统:redhat6.4 64位 oracle版本:11.2.0.4 RAC(两节点) 盘阵:宏彬3300e 问题描述 年前实施RAC集群时,在rac集群所在的操作系统中只有一组路径,另外一组冗余路径没显示出来,但RAC能正常启动,因为时间关系,并没有去解决,直接shutdown RAC集群所在服务器.年后到现场,发现了启动文件集群发现了此问题,把一组光纤的两个小头在光纤交换机上交换一下即可,接着启动RAC集群时,发现存储的路径映射多一组冗余路径,但数据库启动不了,报错 ORA-0

Oracle RAC 11.2.0.4 CTSS 状态异常

通常Oracle RAC 安装完成CTSS 状态异常是由于跟服务器操作系统自带的NTP服务有冲突造成的,所以建议Oracle RAC安装之前彻底卸载操作系统自身的NTP相关的软件包. 正在运行的Oracle RAC发现节点之前进间不同步时(通常节点时间不同步并不会造成节点宕机),可以通过以下步骤进行修改,让CTSS状态恢复正常(以linux为例进行说明). 1.查看CTSS crsctl stat resource ora.ctssd -t -init----------------------

Oracle RAC 11.2.0.4 – RHRL 6.4: DiskGroup resource are not running on nodes. Database instance may not come up on these nodes

使用DBCA创建新库的时候报错: 查看资源状态: $ crsctl stat res -t -------------------------------------------------------------------------------- NAME TARGET STATE SERVER STATE_DETAILS -------------------------------------------------------------------------------- Loc

rhel7.4安装oracle 11G 11.2.0.4.0 RAC

一.操作系统 red hat 7.4oracle数据库版本11.2.0.4oracle grid版本11.2.0.4对应的文件p13390677_112040_Linux-x86-64_1of7.zip - database softwarep13390677_112040_Linux-x86-64_2of7.zip - database softwarep13390677_112040_Linux-x86-64_3of7.zip - grid software IP地址规划:DNS serve

11G RAC 11.2.0.1.0实例evict故障处理

Aix 7.1 参考文档: https://blogs.oracle.com/database4cn/rac Resolving ORA-481 and "terminating the instance due to error 481" (Doc ID 1950963.1) ORA-00481 After "The instance eviction reason is 0x2" due to Lack of Ticket (Doc ID 1644015.1)

Oracle 11g(11.2.0.4)手动打补丁PSU(11.2.0.4.8)

一.准备工作 1,数据库环境操作系统版本   : Redhat 6.5 x64数据库版本     : Oracle 11.2.0.4 x64Oracle database: 11.2.0.4 2,准备内容OPatch : p6880880_112000_Linux-x86-64.zipDB PSU : p21352635_112040_Linux-x86-64.zip 仅单实例使用.OPatch下载地址:https://updates.oracle.com/download/6880880.ht

Oracle database 11.2.0.3.0 升级至 11.2.0.3.14

下载PSU p20299017_112030_Linux-x86-64(DATABASE PATCH SET UPDATE 11.2.0.3.14 (INCLUDES CPUAPR2015)).zip 及Opatch p6880880_112000_Linux-x86-64(OPatch patch of version 11.2.0.3.10 for Oracle software releases 11..zip 下载地址 http://yunpan.cn/cHACmBerMb526 访问密