生产管理知识_手把手教你生产安装goldengate的步骤_第1页
生产管理知识_手把手教你生产安装goldengate的步骤_第2页
生产管理知识_手把手教你生产安装goldengate的步骤_第3页
生产管理知识_手把手教你生产安装goldengate的步骤_第4页
生产管理知识_手把手教你生产安装goldengate的步骤_第5页
已阅读5页,还剩60页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

目录1. 安装配置GoldenGate31.1. 设置环境变量31.1.1. 官方资料31.1.2. 源端机器71.1.3. 源端上增加tns解析81.1.4. 修改上ASM数据库的参数91.1.5. 目标端2机器101.2. 安装GG(只在小机1和分析2上建)111.3. 官方系统要求131.4. 目标机器manager进程添加到Windows服务161.5. GoldenGate相关命令171.6. 数据库准备191.6.1. 源数据库要开归档191.6.2. 打开数据库级别的补充日志(supplemental log)191.6.3. 在源端和目标端创建GoldenGate管理用户,并授权201.6.4. 官方技术要求211.6.5. 数据库字符集检查271.7. 在源端添加表级的transdata281.8. 在目标端添加checkpoint表291.9. 源端配置MGR管理进程组301.9.1. 配置参数文件301.9.2. 官方技术要求311.9.3. 使用GGSCI命令管理MGR331.10. 源端配置Extract抽取进程组351.10.1. 创建和编辑Extract进程配置文件351.10.2. Extract相关命令361.11. 源端配置Pump投递进程组371.11.1. 创建和编辑Pump进程配置文件371.11.2. 使用GGSCI命令管理Pump381.12. 目标端创建和配置MGR管理进程组391.13. 目标端配置Replicat复制进程组401.14. 验证DML复制结果411.15. 增加表进行监控的方法422. 安装配置Director432.1. 安装配置Director Server432.1.1. 安装前准备432.1.2. 启动weblogic server472.1.3. 登入服务端472.2. 安装配置Director Client482.2.1. 安装客户端。482.2.2. 登陆信息482.2.3. 配置监控的页面492.2.4. 启动监控502.2.5. 登录页面进行监控512.3. 安装配置Monitor52我们总羡慕别人的幸福,却常常忽略自己生活中的美好。其实,幸福很平凡也很简单,它就藏在看似琐碎的生活中。幸福的人,并非拿到了世界上最好的东西,而是珍惜了生命中的点点滴滴,用感恩的心态看待生活,用乐观的态度闯过磨难。1. 安装配置GoldenGate1.1. 设置环境变量设置ORACLE_HOME和ORACLE_SID1.1.1. 官方资料To specify Oracle variables on UNIX-based systemsIf there is one instance of Oracle on the system, you only need to set ORACLE_HOME andORACLE_SID at the system level. If you cannot set them that way, use the following SETENVstatements in the parameter file of every Extract and Replicat group that will beconnecting to the instance.SETENV (ORACLE_HOME = “”)SETENV (ORACLE_SID = “”)These parameters override the system settings and allow the Oracle GoldenGateprocess 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 Replicatprocesses connecting to them, you will need to use a SETENV statement in the parameterfile of each process group and point it to the correct instance. For example, thefollowing shows parameter files for two Extract groups, each capturing from a differentOracle instance.Group 1:EXTRACT ora9aSETENV (ORACLE_HOME = “/home/oracle/ora9/product”)SETENV (ORACLE_SID = “ora9a”)USERID ggsa, PASSWORD ggsaRMTHOST sysbRMTTRAIL /home/ggs/dirdat/rtTABLE hr.emp;TABLE hr.salary;Group 2:EXTRACT ora9bSETENV (ORACLE_HOME = “/home/oracle/ora9/product”)SETENV (ORACLE_SID = “ora9b”)USERID ggsb, PASSWORD ggsbRMTHOST sysbRMTTRAIL /home/ggs/dirdat/stTABLE fin.sales;TABLE fin.cust;To specify Oracle variables on Windows systemsIf there is one instance of Oracle on the system, the Registry settings for ORACLE_HOMEand ORACLE_SID should be sufficient for Oracle GoldenGate. If those settings areincorrect 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 MyComputer, 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 Replicatprocesses connecting to them, do the following.Use the preceding procedure (single Oracle instance on system) to set theORACLE_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 existingORACLE_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 systemsOracle GoldenGate uses shared libraries. When you install Oracle GoldenGate on a UNIXsystem, the following must be true before you run GGSCI or any other Oracle GoldenGateprocess.1.When Oracle GoldenGate connects to the database locally, all of the following musthave 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 theOracle 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 usingthe TRANLOGOPTIONS parameter with the LOGSOURCE option and Oracle GoldenGateconnects to transaction logs from a different operating system, the Oracle versionsmust also be the same.3.Make certain that the database libraries are added to the shared-library environmentvariables of the system. This procedure is usually performed at database installationtime. Consult your Database Administrator if you have any questions.4.If you will be running an Oracle GoldenGate program from outside the OracleGoldenGate installation directory on a UNIX system:(Optional) Add the Oracle GoldenGate installation directory to the PATHenvironment 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 secondcommand in the following table requires these variables to be set:To set the variables in Korn shellPATH=:$PATHexport PATH=:$export To set the variables in Bourne shellexport PATH=:$PATHexport =:$To set the variables in C shellsetenv PATH :$PATHsetenv :$1.1.2. 源端机器创建GG用户,密码ggmkdir /home/gguseradd -d /home/gg -g oinstall -G dba ggpasswd gg修改配置文件增加如下配置:export ORACLE_SID=jiesuan1export ORACLE_BASE=/opt/oracle/app/oracleexport ORACLE_HOME=/opt/oracle/app/oracle/11.2.0export ORACLE_UNQNAME=jiesuanexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATHexport PATH=$ORACLE_HOME/bin:$PATHexport LD_LIBRARY_PATH=/opt/oracle/app/oracle/11.2.0/lib:/bak/gg:$LD_LIBRARY_PATHumask 0221.1.3. 源端上增加tns解析使用oracle用户,修改/opt/oracle/app/oracle/11.2.0/network/admin目录中的tnsnames.ora文件。增加以下内容:asm = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = )(PORT = 1521) (CONNECT_DATA = (SERVICE_NAME = +asm) (UR = A) ) )使用sqlplus sys/asmjsdbasm as sysdba 命令,看是否能连接到数据库。1.1.4. 修改上ASM数据库的参数1) 使用grid用户登录是id命令可以看当前用户2) 修改参数remote_login_passwordfilealter system set remote_login_passwordfile = shared scope=spfile;3) 重启数据库用root用户操作。 crsctl stop crs -f crsctl start crsshutdown -r (不能用reboot)Crsctl stop1.1.5. 目标端2机器设置环境变量ORACLE_HOME=e:appAdministratorproduct11.2.0dbhome_1ORACLE_SID=fenxiDB2重启服务器C:UsersAdministratorecho %ORACLE_HOME%C:appAdministratorproduct11.2.0dbhome_1C:UsersAdministratorecho %ORACLE_SID%JSDB1421.2. 安装GG(只在小机1和分析2上建)1) 解压GG软件到f:gg目录(分析服务器2),bakgg目录(小机1)2) 用cmd命令,进入f:gg目录中,敲“GGSCI”命令3) 敲“CREATE SUBDIRS”命令机器截图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 RACOn AIX and Solaris machines, use the Extract parameter THREADOPTIONS with theBINDCPU option. This parameter handles thread-safety issues related to memorythat is updated by different processors.Oracle GoldenGate queues data in memory before sending it to the target system. TheINQUEUESIZE and OUTQUEUESIZE options of the THREADOPTIONS parameter determine howmuch data to queue. If needed, you can increase the performance of Extract on OracleRAC by tuning these parameters.Oracle GoldenGate detects orphaned transactions, which can occur when a node failsduring a transaction and Extract cannot capture the rollback. Although the databaseperforms the rollback on the failover node, the transaction would otherwise remain inthe Extract transaction list indefinitely and prevent further checkpointing for theExtract thread that was processing the transaction. By default, Oracle GoldenGatepurges these transactions from its list after they are confirmed as orphaned. To controlthis behavior, use the TRANLOGOPTIONS parameter with the PURGEORPHANEDTRANSACTIONS| NOPURGEORPHANEDTRANSACTIONS and TRANSCLEANUPFREQUENCY options. This functionalitycan be controlled on demand with the SEND EXTRACT command in GGSCI.Special procedures on RACIf the primary database instance against which Oracle GoldenGate is running stops orfails for any reason, Extract will abend. To resume processing, you can restart theinstance, or you can mount the Oracle GoldenGate binaries to another node where thedatabase is running and then restart the Oracle GoldenGate processes. Stop theManager process on the original node before starting Oracle GoldenGate processesfrom another node.Any time the number of redo threads changes, the Extract group must be dropped andre-created. For the recommended procedure, see the Oracle GoldenGate Windows andUNIX Administrators Guide.To write SQL operations to the trail, Extract must verify that there are no otheroperations from other RAC nodes that precede those in the current redo log that it isreading. 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 from1: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 needto perform some operations and archive log switching on the passive node to ensurethat operations from the active node are passed to the passive node. This eliminatesany issues that could arise from a slow archiver process, failed network links, and otherlatency issues caused by moving archive logs from the Oracle nodes to the server wherethe main Extract is coordinating the redo data.To process the last transaction in a RAC cluster before shutting down Extract, insert adummy record into a source table that Oracle GoldenGate is replicating, and thenswitch log files on all nodes. This will update the Extract checkpoint and confirm to theprocess that all available archive logs are available to read. It also confirms that alltransactions in those archive logs are captured and written to the trail in the correctorder.对于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 OracleGoldenGate 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 constraintsYou have the following options to handle triggers and integrity constraints on the target:For Oracle and later patches, and for Oracle and later, you can use theReplicat parameter DBOPTIONS with the SUPPRESSTRIGGERS option to cause Replicat todisable the triggers during its session.主要参加官方安装文档第43页左右1.6.5. 数据库字符集检查SETENV (NLS_LANG = SIMPLIFIED CHINESE_CHINA.ZHS16GBK)小机分析数据库1.7. 在源端添加表级的transdata例如:添加“scott”对像中的表回头在这里试试添加新的表。add trandata qy.a add trandata qy.b 1.8. 查询数据库对哪些表添加了附加日志SELECT owner,table_name,log_group_name FROM dba_log_groupsWHERE owner=DZZWUSER ;1.9. 在目标端添加checkpoint表在目标机器上的GLOBALS文件中加入,添加一行,“checkpointtable ggs.checkpoint”1.10. 源端配置MGR管理进程组在源端和目标端都必须要有的,他负责启动GoldenGate进程,已经相关的动态进程、trail文件的管理、以及错误信息报告等等。1.10.1. 配置参数文件进入ggsci , edit params mgr,在弹出的文件里添加需要的参数内容。* port 7809 dynamicportlist 7840-7880 purgeoldextracts /bak/gg/dirdat/et* , USECHECKPOINTS , MINKEEPDAYS 3 autostart extract * autorestart extract *,waitminutes 2, retries 360,resetminutes 60*管理端口7809动态通信端口7840-7880动态通信端口分配前延时3600秒,重新制定一次自动清除已经使用过的tail文件Mgr启动后,自动启动extract进程组Mgr启动后,自动重启extract进程组GoldenGate一个Port用于Manager Process之间通信(Source和Target),本地进程间通信使用的端口范围:缺省范围从7809开始,或者可以定义一个从7809+256的端口。Port 表示MGR进程通信的端口号,必须存在。dynamicportlist 表示manager进程可以为源端和目标端的动态通信动态的指定端口。autorestart extract 表示自动重启extract进程组,每次尝试的时间间隔为2分钟,最大尝试360次,如果没有成功则放弃30分钟清零。1.10.2. 官方技术要求Configuring ManagerTo configure Manager, create a parameter file by following these steps. If you installedOracle GoldenGate on a UNIX cluster, configure the Oracle GoldenGate Manager processwithin the cluster application as directed by the vendors documentation, so that OracleGoldenGate will fail over properly with the other applications.To configure Manager1.From the Oracle GoldenGate directory, run the ggsci program to open the OracleGoldenGate Software Command Interface, commonly known as GGSCI.2.In GGSCI, issue the following command to edit the Manager parameter file.EDIT PARAMS MGR3.Add the following parameter to specify the Manager port number.PORT PORT defines the port number on which Manager runs on the local system. The default portis 7809. You must specify either the default port or another port. The port must beunreserved and unrestricted. GGSCI uses this port to request Manager to start processes.The Extract process uses this port to request Manager to start a remote Collector processor an initial-load Replicat process. PORT is the only required Manager parameter.NOTEThe port number also must be specified with the MGRPORT argument of the Extractparameter RMTHOST.Database user parameterIf using Oracle GoldenGate DDL support, specify the Manager user and password with the USERID parameter.Dynamic port parametersUse the DYNAMICPORTLIST parameter to specify up to 256 unreserved, unrestricted ports fordynamic

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论