In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "introduction to the basic principles of GoldenGate". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
What is GoldenGate?
Official definition:
Oracle GoldenGate is a comprehensive software package for real-time data integration and replication in heterogeneous IT environments.The product set enables high availability solutions, real-time data integration, transactional change data capture, data replication, transformations, and verification between operational and analytical enterprise systems.
Vernacular version:
Oracle GoldenGate (OGG) does only one thing: copy data. Besides, I don't know anything.
Single-minded
High efficiency
Cross platform
Platforms supported by OGG
Supported databases:
Oracle
MySQL
DB2
SQL Server
NonStop SQL/MX
Sybase
Teradata
TimesTen
PostgreSQL
Informix
Supported platforms:
Unix (Solaris,AIX,HP-UX)
Linux
Windows
Z/OS
HP NonStop
Supported actions:
DML
DDL
Architectures supported by OGG
The basic principle of OGG-Redo Log Mechanism of Oracle
LGWR: Log Writer Process
Log write process, which writes Change Vector from the cache to a file (Online Redo Log)
ARCn: Archiver Processes
Archiving process, copying Online Redo Log
Redo Log:
Record the change data (Change Vector) of the database.
Divided into: Online Redo Log and Archived Redo Log
Basic principles of OGG-working mechanism
Main processes:
Manager
Master control process
Manage other processes
Manage network port
Manage TRAIL files
Manage operation log
Extract
Data capture
Data distribution (Data Pump)
Replicat
Data application
Collector
Data reception
Main documents:
Trail
Record of data
Checkpoints
Data checkpoint information
Installation of OGG
Environment: CentOS 6.7/Oracle 11.2.0.4/GoldenGate 11.2.1.0.32
Step 1. Set environment variabl
Export ORACLE_HOME=/u01/app/oracle/product/database/11.2.0/db_1
Export LD_LIBRARY_PATH=$ORACLE_HOME/lib
Export PATH=$ORACLE_HOME/bin:$PATH
Step 2. Decompress the software package
Cd / u01/app/oracle/product/ogg/gghome/11.2.1/gghome_1
Tar xf fbo_ggs_Linux_x64_ora11g_64bit.tar
Step 3. Installation run directory
Cd / u01/app/oracle/product/ogg/gghome/11.2.1/gghome_1
. / ggsci
GGSCI > create subdirs
Basic steps of OGG implementation
Scenario: the table J.T1 of the source database is synchronized to the J.T1 of the target database in real time
Step 1. Source OGG account configuration
SQL > CREATE TABLESPACE GGS DATAFILE'+ DATA01' SIZE 4G
SQL > CREATE USER GGS IDENTIFIED BY GGS123 DEFAULT TABLESPACE GGS QUOTA UNLIMITED ON GGS
SQL > GRANT DBA TO GGS
$. / keygen 128 1
0xD63ED81A1DA4DA0596004362410C5522
$cat > ENCKEYS
DEFKEY 0xD63ED81A1DA4DA0596004362410C5522
GGSCI > encrypt password GGS123 encryptkey DEFKEY
Encrypted password: AADAAAAAAAAAAAGAJDSJTIIEHJJBOBPDNEZBYIAAPDOCCFGILFMAOGNCMCCAXABIQIFIJAXCKBLFQIMC
Algorithm used: AES128
Step 2. Source-side database configuration
SQL > ALTER DATABASE FORCE LOGGING
SQL > ALTER DATABASE ADD SUPPLEMENTAL LOG DATA
GGSCI > dblogin userid ggs, password AADAAAAAAAAAAAGAJDSJTIIEHJJBOBPDNEZBYIAAPDOCCFGILFMAOGNCMCCAXABIQIFIJAXCKBLFQIMC, encryptkey DEFKEY
GGSCI > add trandata J.T1
Step 3. Source-side Manager process configuration
GGSCI > edit params MGR
PORT 7809
PURGEOLDEXTRACTS / data01/oracle/ogg/dirdat/ta*, USECHECKPOINTS, MINKEEPDAYS 30
AUTORESTART ER *, RETRIES 5, WAITMINUTES 1, RESETMINUTES 30
LAGREPORTMINUTES 30
LAGCRITICALMINUTES 60
GGSCI > start MGR
Step 4. Source-side Extract process configuration
GGSCI > edit params EJT
EXTRACT EJT
SETENV (ORACLE_HOME= "/ u01/app/oracle/product/database/11.2.0/db_1")
SETENV (ORACLE_SID= "stest")
USERID GGS, PASSWORD AADAAAAAAAAAAAGAJDSJTIIEHJJBOBPDNEZBYIAAPDOCCFGILFMAOGNCMCCAXABIQIFIJAXCKBLFQIMC, ENCRYPTKEY DEFKEY
TRANLOGOPTIONS DBLOGREADER, DBLOGREADERBUFSIZE 2097152
EXTTRAIL / data01/oracle/ogg/dirdat/ta
DISCARDFILE / u01/app/oracle/product/ogg/gghome/11.2.1/gghome_1/dirrpt/EJT.dsc, APPEND Megabytes 256
DISCARDROLLOVER AT 00:00 on SUNDAY
REPORTROLLOVER AT 00:00 on SUNDAY
REPORTCOUNT EVERY 4 HOURS, RATE
FETCHOPTIONS, FETCHPKUPDATECOLS, USESNAPSHOT, NOUSELATESTVERSION, MISSINGROW REPORT
STATOPTIONS REPORTFETCH
WARNLONGTRANS 1H, CHECKINTERVAL 5M
TABLE J.T1
Step 5. Add Extract process on the source side
GGSCI > add extract EJT, tranlog, begin now
GGSCI > add exttrail / data01/oracle/ogg/dirdat/ta, extract EJT, megabytes 256
GGSCI > start extract EJT
Step 6. Target database configuration
SQL > ALTER SYSTEM SET enable_goldengate_replication=TRUE
Step 7. OGG account configuration on the target side
See Step 1. Source OGG account configuration
Step 8. Target side Checkpoint configuration
GGSCI > dblogin userid ggs, password AADAAAAAAAAAAAGAJDSJTIIEHJJBOBPDNEZBYIAAPDOCCFGILFMAOGNCMCCAXABIQIFIJAXCKBLFQIMC, encryptkey DEFKEY
GGSCI > add checkpointtable ggs.checkpoint
Step 9. Target side Manager process configuration
GGSCI > edit params. / GLOBALS
CHECKPOINTTABLE ggs.checkpoint
ALLOWOUTPUTDIR / data01/oracle/ogg/dirdat
GGSCI > edit params MGR
PORT 7809
PURGEOLDEXTRACTS / data01/oracle/ogg/dirdat/ta*, USECHECKPOINTS, MINKEEPDAYS 30
AUTORESTART ER *, RETRIES 5, WAITMINUTES 1, RESETMINUTES 30
LAGREPORTMINUTES 30
LAGCRITICALMINUTES 60
GGSCI > start MGR
Step 10. Source-side Data Pump process configuration
GGSCI > edit params PJT
EXTRACT PJT
SETENV (ORACLE_HOME= "/ u01/app/oracle/product/database/11.2.0/db_1")
PASSTHRU
RMTHOST tj, MGRPORT 7809
RMTTRAIL / data01/oracle/ogg/dirdat/ta
DISCARDFILE / u01/app/oracle/product/ogg/gghome/11.2.1/gghome_1/dirrpt/PJT.dsc, APPEND, MEGABYTES 256
DISCARDROLLOVER AT 00:00 on SUNDAY
REPORTROLLOVER AT 00:00 on SUNDAY
REPORTCOUNT EVERY 4 HOURS, RATE
TABLE J.T1
Step 11. Add Data Pump process on the source side
GGSCI > add extract PJT, exttrailsource / data01/oracle/ogg/dirdat/ta
GGSCI > add rmttrail / data01/oracle/ogg/dirdat/ta, extract PJT, megabytes 256
GGSCI > start extract PJT
Step 12. Target side Replicat process configuration
GGSCI > edit params RJT
REPLICAT RJT
SETENV (ORACLE_HOME = "/ u01/app/oracle/product/database/11.2.0/db_1")
SETENV (ORACLE_SID= "ttest")
SETENV (NLS_LANG = "AMERICAN_CHINA.ZHS16GBK")
USERID GGS, PASSWORD AADAAAAAAAAAAAGAJDSJTIIEHJJBOBPDNEZBYIAAPDOCCFGILFMAOGNCMCCAXABIQIFIJAXCKBLFQIMC, ENCRYPTKEY DEFKEY
DISCARDFILE / u01/app/oracle/product/ogg/gghome/11.2.1/gghome_1/dirrpt/RJT.dsc, APPEND Megabytes 256
DISCARDROLLOVER AT 00:00 on SUNDAY
REPORTROLLOVER AT 00:00 on SUNDAY
REPORTCOUNT EVERY 4 HOURS, RATE
ASSUMETARGETDEFS
MAP J.T1, TARGET J.T1
Step 13. Add a Replicat process to the destination side
GGSCI > dblogin userid ggs, password AADAAAAAAAAAAAGAJDSJTIIEHJJBOBPDNEZBYIAAPDOCCFGILFMAOGNCMCCAXABIQIFIJAXCKBLFQIMC, encryptkey DEFKEY
GGSCI > add replicat RJT, exttrail / data01/oracle/ogg/dirdat/ta
Step 14. Data initialization-source-side data export
SQL > SELECT CURRENT_SCN FROM V$DATABASE
CURRENT_SCN
-
373926987
$expdp system/systm123 directory=DUMPDIR dumpfile=JT1.dump tables=J.T1 flashback_scn=373926987 logfile=JT1.expdp.log
Step 15. Data initialization-destination data import
$impdp system/systm123 directory=DUMPDIR dumpfile=JT1.dump logfile=JT1.impdp.log
Step 16. The target side starts the Replicat process
GGSCI > start replicat RJT, atcsn 373926987
This is the end of the introduction to the basic principles of GoldenGate. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
Step 1: create a temporary tablespace (
© 2024 shulou.com SLNews company. All rights reserved.