Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

OGG synchronous testing in LINUX environment

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Because I just changed my job, I was a little busy at first. As soon as I was free, I retested the previous case and shared it with you. This article mainly records the test process command, although the result is not screenshot, but the result is ok and has been tested many times. If there are any questions in this article, you are welcome to leave a message and point out.

Environment description source host destination host operating system: RatHat Linux 6.5x64 operating system: RatHat Linux 6.5x64 hostname: source.zhan hostname: target.zhanIP address: 192.168.214.52 IP address: 192.168.214.53 number According to library version: 11.2.0.4 x64 database version: 11.2.0.4 x64 database SID:zhankys database SID:zhankytOGG version: 12.1.2.1 OGG version: 12.1.2.1 environment preparation (same source destination)

Create directory weighting

-- weighted archive directory mkdir-p / u01/archivelogchown-R oracle:oinstall / u01chmod-R 775 / u01muri-weighted software installation package directory mkdir-p / u01/zkychown-R oracle:oinstall / u01chmod-R 775 / u01Musi-create the OGG installation directory mkdir / oggchown-R oracle:oinstall / oggchmod-R 775 / ogg-- set the OGG environment variable echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib' > > / home/oracle/.bash_profile

Database preparation (same source destination)

-- Log in to the database sqlplus / as sysdba-- to create an ogg account create tablespace ogg_tablespace datafile'/ u01ActionPlaclePlacedoradata size ogg01.dbf' size 10m log 5m create user goldengate identified by goldengate default tablespace ogg_tablespace;grant dba to goldengate;-- to check whether the archive, mandatory log mode, and database-level supplementary logs are enabled (pay attention to the archive directory) archive log list;select force_logging,supplemental_log_data_min from vault database showing parameter enable_goldengate_replication -- enable archiving method shutdow immediatestart mountalter database archivelog;-- set archive log path alter system set log_archive_dest_1='location=/u01/archivelog' scope = both;alter database open;-- enable database mandatory log mode, database-level supplementary log alter database force logging;alter database add supplemental log data;-- modification allows the use of ogg parameters (for 11.2.0.4 library) ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH

Change tnsname (same source destination)

Vi / u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora ZHANKYS = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.214.52) (PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ZHANKYS) ZHANKYT = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.214.53) (PORT = 1521) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ZHANKYT) initialization data (same source destination)

Initialize the data preparation (the source destination is the same) (initialization is to keep the basic data of both databases the same. Ps: here because there is time to get a new copy of the simulated real environment initialization after testing, etc.)

Connect goldengate/goldengate-- creates tables DROP TABLE tcustmer;CREATE TABLE tcustmer (cust_code VARCHAR (4) NOT NULL, name VARCHAR (30), city VARCHAR (20), state CHAR (2), PRIMARY KEY (cust_code); DROP TABLE tcustord;CREATE TABLE tcustord (cust_code VARCHAR (4) NOT NULL, product_code VARCHAR (8) NOT NULL,order_id INTEGER NOT NULL, product_price DECIMAL (8), product_amount INTEGER,transaction_id INTEGER, PRIMARY KEY (cust_code, product_code, order_id); select * from goldengate.tcustmer Select * from goldengate.tcustord; graphical installation of OGG (same source destination)

OGG software installation (same source destination)

Xhost + su-oraclecd / u01/zky/unzip 121210_ggs_Linux_x64_shiphome.zipcd fbo_ggs_Linux_x64_shiphome/Disk1/./runInstaller

Configure OGG parameters

Create an ogg directory (same source destination)

Cd / ogg./ggscicreate subdirs

Create a checkpoint table (the source destination is the same) (if you have multiple instances, you need to dblogin @ library name: dblogin userid goldengate@ library name, password goldengate)

{dblogin userid goldengate,password goldengateadd checkpointtable goldengate.ggs_checkpoint}

Set globals (same source destination)

Edit params. / globals {CHECKPOINTTABLE goldengate.ggs_checkpointUNLOCKEDTRAILFILES}

Configure MGR (same source destination)

Edit params mgr {PORT 7809AUTOSTART ER * AUTORESTART ER *, RETRIES 3no. WAITMINUTES 5J RESETMINUTES 60LAGREPORTHOURS 1LAGINFOMINUTES 3LAGCRITICALMINUTES 10PURGEOLDEXTRACTS. / dirdat/*,USECHECKPOINTS,MINKEEPDAYS 3} start mgr

Configure objects that require trandata (source)

Dblogin userid goldengate,password goldengateadd trandata goldengate.tcustmeradd trandata goldengate.tcustord

Configure extract (source)

Add extract eBay userid goldengate,password goldengateEXTTRAIL. / dirdat/cs,extract eBay cs edit param e_cs megabytes 5 edit param e_cs {EXTRACT e_csSETENV (NLS_LANG= "AMERICAN_AMERICA.ZHS16GBK") GETENV (NLS_LANG) userid goldengate,password goldengateEXTTRAIL. / dirdat/cs,FORMAT RELEASE 12.1DISCARDFILE. / dirrpt/e_cs.dsc,PURGE--NOCOMPRESSDELETESNOCOMPRESSUPDATESGETUPDATEBEFORESGETUPDATEAFTERSTRANLOGOPTIONS LOGRETENTION disabledWARNLONGTRANS 30m cycle 3mtable goldengate.tcustmer;table goldengate.tcustord;} start e_cs

Configure pump (source)

Add extract pamphcsTexttrailsource. / dirdat/cs,begin nowadd rmttrail. / dirdat/cs,extract pamphcsMeigabytes 5edit param p_cs {EXTRACT p_csSETENV (NLS_LANG= "AMERICAN_AMERICA.ZHS16GBK") GETENV (NLS_LANG) userid goldengate,password goldengateNOPASSTHRU RMTHOST 192.168.214.53 userid goldengate,password goldengateNOPASSTHRU RMTHOST 7809 timeout 120RMTTRAIL. / dirdat/cs,format RELEASE 12.1DISCARDFILE. / dirrpt/p_cs.dsc,PURGEtable goldengate.tcustmer;table goldengate.tcustord;} start p_cs

Configure replicat (purpose)

Add replicat renders AMERICAN_AMERICA.ZHS16GBK. / dirdat/cs,checkpointtable goldengate.ggs_checkpointedit param r_cs {REPLICAT b_r_29SETENV (NLS_LANG= "AMERICAN_AMERICA.ZHS16GBK") GETENV (NLS_LANG) userid goldengate,password goldengateHANDLECOLLISIONSASSUMETARGETDEFSREPERROR DEFAULT,DISCARDDBOPTIONS NOSUPPRESSTRIGGERSDISCARDFILE. / dirrpt/b_r_29.dsc,PURGEMAP goldengate.TCUSTMER, TARGET goldengate.TCUSTMER;MAP goldengate.TCUSTORD, TARGET goldengate.TCUSTORD;} start r_cs

Check result

Select * from goldengate.TCUSTMER;select * from goldengate.TCUSTORD;INSERT INTO goldengate.tcustmer VALUES ('ZZZ','BG SOFTWARE CO.','SEATTLE','WZ'); INSERT INTO goldengate.tcustord VALUES (' ZZZ','CAR',144,17520,3100); COMMIT;INSERT INTO goldengate.tcustmer VALUES ('ZqZZ','BqG SOFTWARE CO.','SEATTLE','WZ'); INSERT INTO goldengate.tcustord VALUES (' ZqZZ','CAR',144,17520,3100); COMMIT INSERT INTO goldengate.tcustmer VALUES ('ZbZ','BzG SOFTWARE CO.','SEATTLE','WZ'); INSERT INTO goldengate.tcustord VALUES (' ZbZ','CAR',144,17520,3100); COMMIT;INSERT INTO goldengate.tcustmer VALUES ('ZghZ','BG SOFTWARE CO.','SEATTLE','WZ'); INSERT INTO goldengate.tcustord VALUES (' ZghZ','CAR',144,17520,3100); COMMIT;delete goldengate.tcustmer where cust_code='ZZZ';delete goldengate.tcustord where cust_code='ZZZ' Delete goldengate.tcustmer where cust_code='ZqZZ';delete goldengate.tcustord where cust_code='ZqZZ';delete goldengate.tcustmer where cust_code='ZbZ';delete goldengate.tcustord where cust_code='ZbZ';delete goldengate.tcustmer where cust_code='ZghZ';delete goldengate.tcustord where cust_code='ZghZ';commit

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report