收藏 分销(赏)

手把手教你生产安装goldengate的步骤---最终版.docx

上传人:pc****0 文档编号:8758769 上传时间:2025-03-01 格式:DOCX 页数:61 大小:2.13MB 下载积分:10 金币
下载 相关 举报
手把手教你生产安装goldengate的步骤---最终版.docx_第1页
第1页 / 共61页
手把手教你生产安装goldengate的步骤---最终版.docx_第2页
第2页 / 共61页


点击查看更多>>
资源描述
目录 1. 安装配置GoldenGate 3 1.1. 设置环境变量 3 1.1.1. 官方资料 3 1.1.2. 源端10.34.1.1机器 7 1.1.3. 源端10.34.1.1上增加tns解析 8 1.1.4. 修改10.34.1.1上ASM数据库的参数 9 1.1.5. 目标端10.34.1.72机器 10 1.2. 安装GG(只在小机1和分析2上建) 11 1.3. 官方系统要求 13 1.4. 目标机器manager进程添加到Windows服务 16 1.5. GoldenGate相关命令 17 1.6. 数据库准备 19 1.6.1. 源数据库要开归档 19 1.6.2. 打开数据库级别的补充日志(supplemental log) 19 1.6.3. 在源端和目标端创建GoldenGate管理用户,并授权 20 1.6.4. 官方技术要求 21 1.6.5. 数据库字符集检查 27 1.7. 在源端添加表级的transdata 28 1.8. 在目标端添加checkpoint表 29 1.9. 源端配置MGR管理进程组 30 1.9.1. 配置参数文件 30 1.9.2. 官方技术要求 31 1.9.3. 使用GGSCI命令管理MGR 33 1.10. 源端配置Extract抽取进程组 35 1.10.1. 创建和编辑Extract进程配置文件 35 1.10.2. Extract相关命令 36 1.11. 源端配置Pump投递进程组 37 1.11.1. 创建和编辑Pump进程配置文件 37 1.11.2. 使用GGSCI命令管理Pump 38 1.12. 目标端创建和配置MGR管理进程组 39 1.13. 目标端配置Replicat复制进程组 40 1.14. 验证DML复制结果 41 1.15. 增加表进行监控的方法 42 2. 安装配置Director 43 2.1. 安装配置Director Server 43 2.1.1. 安装前准备 43 2.1.2. 启动weblogic server 47 2.1.3. 登入服务端 47 2.2. 安装配置Director Client 48 2.2.1. 安装客户端。 48 2.2.2. 登陆信息 48 2.2.3. 配置监控的页面 49 2.2.4. 启动监控 50 2.2.5. 登录页面进行监控 51 2.3. 安装配置Monitor 52 1. 安装配置GoldenGate 1.1. 设置环境变量 设置ORACLE_HOME和ORACLE_SID 1.1.1. 官方资料 To specify Oracle variables on UNIX-based systems ●If there is one instance of Oracle on the system, you only need to set ORACLE_HOME and ORACLE_SID at the system level. If you cannot set them that way, use the following SETENV statements in the parameter file of every Extract and Replicat group that will be connecting to the instance. SETENV (ORACLE_HOME = “<path to Oracle home location>”) SETENV (ORACLE_SID = “<SID>”) These parameters override the system settings and allow the Oracle GoldenGate process to set the variables at the session level when it connects to the database. ●If there are multiple Oracle instances on the system with Extract and Replicat processes connecting to them, you will need to use a SETENV statement in the parameter file of each process group and point it to the correct instance. For example, the following shows parameter files for two Extract groups, each capturing from a different Oracle instance. Group 1: EXTRACT ora9a SETENV (ORACLE_HOME = “/home/oracle/ora9/product”) SETENV (ORACLE_SID = “ora9a”) USERID ggsa, PASSWORD ggsa RMTHOST sysb RMTTRAIL /home/ggs/dirdat/rt TABLE hr.emp; TABLE hr.salary; Group 2: EXTRACT ora9b SETENV (ORACLE_HOME = “/home/oracle/ora9/product”) SETENV (ORACLE_SID = “ora9b”) USERID ggsb, PASSWORD ggsb RMTHOST sysb RMTTRAIL /home/ggs/dirdat/st TABLE fin.sales; TABLE fin.cust; To specify Oracle variables on Windows systems ●If there is one instance of Oracle on the system, the Registry settings for ORACLE_HOME and ORACLE_SID should be sufficient for Oracle GoldenGate. If those settings are incorrect in the Registry and cannot be changed, you can set an override as follows. ❍On the desktop or Start menu (depending on the Windows version), right-click My Computer, and then select Properties. ❍In Properties, click the Advanced tab. ❍Click Environment Variables. ❍Under System Variables, click New. ❍For Variable Name, type ORACLE_HOME. ❍For Variable Value, type the path to the Oracle binaries. ❍Click OK. ❍Click New again. ❍For Variable Name, type ORACLE_SID. ❍For Variable Value, type the instance name. ❍Click OK. ●If there are multiple Oracle instances on the system with Extract and Replicat processes connecting to them, do the following. ❍Use the preceding procedure (single Oracle instance on system) to set the ORACLE_HOME and ORACLE_SID system variables to the first Oracle instance. ❍Start all of the Oracle GoldenGate processes that will connect to that instance. ❍Repeat the procedure for the next Oracle instance, but this time Edit the existing ORACLE_HOME and ORACLE_SID variables to specify the new information. ❍Start the Oracle GoldenGate processes that will connect to that instance. ❍Repeat the Edit and startup procedure for the rest of the Oracle instances. Setting library paths for dynamic builds on UNIX systems Oracle GoldenGate uses shared libraries. When you install Oracle GoldenGate on a UNIX system, the following must be true before you run GGSCI or any other Oracle GoldenGate process. 1.When Oracle GoldenGate connects to the database locally, all of the following must have the same bit type, either all 32-bit, all 64-bit, or all IA64: 2.When Oracle GoldenGate connects through SQL*Net, the Oracle client library and the Oracle GoldenGate build must match. This means that the Oracle version, the bit type (32-bit, 64-bit, IA64) and the operating system version all must match. If you are using the TRANLOGOPTIONS parameter with the LOGSOURCE option and Oracle GoldenGate connects to transaction logs from a different operating system, the Oracle versions must also be the same. 3.Make certain that the database libraries are added to the shared-library environment variables of the system. This procedure is usually performed at database installation time. Consult your Database Administrator if you have any questions. 4.If you will be running an Oracle GoldenGate program from outside the Oracle GoldenGate installation directory on a UNIX system: ❍(Optional) Add the Oracle GoldenGate installation directory to the PATH environment variable. ❍(Required) Add the Oracle GoldenGate installation directory to the shared- libraries environment variable. For example, given an Oracle GoldenGate installation directory of /ggs/10.0, the second command in the following table requires these variables to be set: To set the variables in Korn shell PATH=<installation directory>:$PATH export PATH <shared libraries variable>=<absolute path of installation directory>:$<shared libraries variable> export <shared libraries variable> To set the variables in Bourne shell export PATH=<installation directory>:$PATH export <shared libraries variable>=<absolute path of installation directory>:$<shared libraries variable> To set the variables in C shell setenv PATH <installation directory>:$PATH setenv <shared libraries variable> <absolute path of installation directory>:$<shared libraries variable> 1.1.2. 源端10.34.1.1机器 创建GG用户,密码gg mkdir /home/gg useradd -d /home/gg -g oinstall -G dba gg passwd gg 修改配置文件 增加如下配置: export ORACLE_SID=jiesuan1 export ORACLE_BASE=/opt/oracle/app/oracle export ORACLE_HOME=/opt/oracle/app/oracle/11.2.0 export ORACLE_UNQNAME=jiesuan export LD_LIBRARY_PATH=$ORACLE_HOME/lib:${LD_LIBRARY_PATH} export PATH=${ORACLE_HOME}/bin:${PATH} export LD_LIBRARY_PATH=/opt/oracle/app/oracle/11.2.0/lib:/bak/gg:${LD_LIBRARY_PATH} umask 022 1.1.3. 源端10.34.1.1上增加tns解析 使用oracle用户,修改/opt/oracle/app/oracle/11.2.0/network/admin目录中的tnsnames.ora文件。 增加以下内容: asm = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.34.1.1)(PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = +asm) (UR = A) ) ) 使用sqlplus sys/asmjsdb@asm as sysdba 命令,看是否能连接到数据库。 1.1.4. 修改10.34.1.1上ASM数据库的参数 1) 使用grid用户登录 是id命令可以看当前用户 2) 修改参数remote_login_passwordfile alter system set remote_login_passwordfile = shared scope=spfile; 3) 重启数据库 用root用户操作。 crsctl stop crs -f crsctl start crs shutdown -r (不能用reboot) Crsctl stop 1.1.5. 目标端10.34.1.72机器 设置环境变量 ORACLE_HOME=e:\app\Administrator\product\11.2.0\dbhome_1 ORACLE_SID=fenxiDB2 重启服务器 C:\Users\Administrator>echo %ORACLE_HOME% C:\app\Administrator\product\11.2.0\dbhome_1 C:\Users\Administrator>echo %ORACLE_SID% JSDB142 1.2. 安装GG(只在小机1和分析2上建) 1) 解压GG软件到f:\gg目录(分析服务器2),\bak\gg目录(小机1) 2) 用cmd命令,进入f:\gg目录中,敲“GGSCI”命令 3) 敲“CREATE SUBDIRS”命令 10.34.1.1机器截图 1034.1.72机器截图 1.3. 官方系统要求 每个GoldenGate实例可以支持并发500个Extract和Replicat进程。 每个Extract和Replicat进程需要大约25--55MB内存,这取决于transaction的大小和并发transaction数量。 工作目录 每个GoldenGate实例的工作目录,大约需要40M的空间。 辅助空间 这部分空间主要存放Tails,它包含了工作数据。这部分空间的消耗取决于Trail,依赖于将要处理的数据量。 可以保持7-10天的GoldenGate队列文件即可。 对于RAC环境 GoldenGate的相关软件和工作目录都需要配置在共享盘中,从而保证对所有node都是可用的,从任何一个node都可以启动GoldenGate的进程,当其中一个node出现异常是,可以在剩余的node启动而无须修改任何配置参数。否则,如果运行在单个node上的话,需要将剩余node中的归档日志通过一定的技术共享出来并加载到GoldenGate运行节点。 必须两台机子保持时钟同步。 GoldenGate一个Port用于Manager Process之间通信(Source和Target),本地进程间通信使用的端口范围:缺省范围从7809开始,或者可以定义一个从7809+256的端口。 Oracle GoldenGate parameters settings for RAC ●On AIX and Solaris machines, use the Extract parameter THREADOPTIONS with the BINDCPU <n> option. This parameter handles thread-safety issues related to memory that is updated by different processors. ●Oracle GoldenGate queues data in memory before sending it to the target system. The INQUEUESIZE and OUTQUEUESIZE options of the THREADOPTIONS parameter determine how much data to queue. If needed, you can increase the performance of Extract on Oracle RAC by tuning these parameters. ●Oracle GoldenGate detects orphaned transactions, which can occur when a node fails during a transaction and Extract cannot capture the rollback. Although the database performs the rollback on the failover node, the transaction would otherwise remain in the Extract transaction list indefinitely and prevent further checkpointing for the Extract thread that was processing the transaction. By default, Oracle GoldenGate purges these transactions from its list after they are confirmed as orphaned. To control this behavior, use the TRANLOGOPTIONS parameter with the PURGEORPHANEDTRANSACTIONS | NOPURGEORPHANEDTRANSACTIONS and TRANSCLEANUPFREQUENCY options. This functionality can be controlled on demand with the SEND EXTRACT command in GGSCI. Special procedures on RAC ●If the primary database instance against which Oracle GoldenGate is running stops or fails for any reason, Extract will abend. To resume processing, you can restart the instance, or you can mount the Oracle GoldenGate binaries to another node where the database is running and then restart the Oracle GoldenGate processes. Stop the Manager process on the original node before starting Oracle GoldenGate processes from another node. ●Any time the number of redo threads changes, the Extract group must be dropped and re-created. For the recommended procedure, see the Oracle GoldenGate Windows and UNIX Administrator’s Guide. ●To write SQL operations to the trail, Extract must verify that there are no other operations from other RAC nodes that precede those in the current redo log that it is reading. For example, if a log contains operations that were performed from 1:00 a.m. to 2:00 a.m., and the log from Node 2 contains operations that were performed from 1:30 a.m. to 2:30 a.m., then only those operations up to, and including, the 2:00 a.m. one can be moved to the server where the main Extract is coordinating the redo data. Extract must ensure that there are no more operations between 2:00 a.m. and 2:30 a.m. that need to be captured. ●In active-passive environments, the preceding requirement means that you might need to perform some operations and archive log switching on the passive node to ensure that operations from the active node are passed to the passive node. This eliminates any issues that could arise from a slow archiver process, failed network links, and other latency issues caused by moving archive logs from the Oracle nodes to the server where the main Extract is coordinating the redo data. ●To process the last transaction in a RAC cluster before shutting down Extract, insert a dummy record into a source table that Oracle GoldenGate is replicating, and then switch log files on all nodes. This will update the Extract checkpoint and confirm to the process that all available archive logs are available to read. It also confirms that all transactions in those archive logs are captured and written to the trail in the correct order. 对于ASM环境 GoldenGate的Extract进程需要一个用户来访问ASM实例,所以可以使用sys用户或其他具有sysdba/sysasm权限的用户来连接到ASM实例。 对于ASM user,可以通过TRANLOGOPTIONS(带有ASMUSER和ASMPASSWORD选项)参数来配置。 操作系统要求 ●To install on Windows, the user installing Oracle GoldenGate must log in as Administrator. ●To install on UNIX, the user installing Oracle GoldenGate must have read and write privileges on the Oracle GoldenGate installation directory. ●The Oracle GoldenGate processes require an operating system user that has privileges to read, write, and delete files and subdirectories in the Oracle GoldenGate directory. In addition, the user for the Manager process requires privileges to control Oracle GoldenGate processes. ●The Extract process requires an operating system user that has read access to thetransaction log files, both online and archived. On UNIX systems, that user must be a member of the group that owns the Oracle instance. If you install the Manager process as a Windows service during the installation steps in this documentation, you must install as Administrator for the correct permissions to be assigned. If you cannot install Manager as a service, assign read access to Extract manually, and then run Manager and Extract as Administrator whenever you start them. ●Dedicate these operating system users to Oracle GoldenGate. Sensitive informationmight be available to anyone who runs an Oracle GoldenGate process, depending onhow database authentication is configured. ●Before installing Oracle GoldenGate on a Windows system, install and configure the Microsoft Visual C ++ 2005 SP1 Redistributable Package. Make certain it is the SP1 version of this package, and make certain to get the correct bit version for your server. This package installs runtime components of Visual C++ Libraries. For more information, and to download this package, go to . 1.4. 目标机器manager进程添加到Windows服务 1) 在目标机子上配置,进入ggsci命令界面 2) 输入“EDIT PARAMS ./GLOBALS”命令,注意:./GLOBALS最好使用大写 3) 输入“MGRSERVNAME GGSMGR” ,系统默认的名字是“GGSMGR” 4) 输入“exit”命令 5) 输入“install addservice”命令 1.5. GoldenGate相关命令 1.6. 数据库准备 1.6.1. 源数据库要开归档 已经开启 1.6.2. 打开数据库级别的补充日志(supplemental log) SQL> select supplemental_log_data_min from v$database; SUPPLEMENTAL_LOG_DATA_MIN ------------------------- NO SQL> alter database add supplemental log data; Database altered SQL> select supplemental_log_data_min from v$database; SUPPLEMENTAL_LOG_DATA_MIN ------------------------- YES SQL> 1.6.3. 在源端和目标端创建GoldenGate管理用户,并授权 源端 create user ggs identified by ggs default tablespace GGS temporary tablespace TEMPB; grant dba to ggs; 目标端: create user ggs identified by ggs default tablespace ggs temporary tablespace TEMPa; grant dba to ggs; 1.6.4. 官方技术要求 Disabling triggers and cascade delete constraints You have the following options to handle triggers and integrity constraints on the target: ●For Oracle 10.2.0.5 and later patches, and for Oracle 11.2.0.2 and later, you can use the Replicat parameter DBOPTIONS with the SUPPRESSTRIGGERS option to cause Replicat to disable the trigge
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 管理财经 > 管理学资料

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服