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

How to install and configure OGG on RAC

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

Share

Shulou(Shulou.com)05/31 Report--

This article is about how OGG installs and configures on RAC. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

The purpose of this experiment is to simulate the initialization of OGG in a provincial power company. The drill process is divided into two blog posts to record the whole process. The first part is installation and configuration, which mainly introduces the configuration of OGG under dual-node RAC on both the source end and the disaster recovery end. The second part is OGG initialization, which uses rman to restore the database on the disaster recovery side and enables the OGG replication process to append logs.

Environment introduction:

Source Target

OS:Enterprise Linux Server release 5.7

OGG: 11.2.1.0.1

ORACLE: 11.2.0.4 RAC dual Node

172.16.228.101 node1

172.16.228.102 node2

OGG path node1 / goldengateOS:Enterprise Linux Server release 5.7

OGG 11.2.1.0.1

ORACLE: 11.2.0.4 RAC dual Node

172.16.228.103 node3

172.16.228.104 node4

OGG path node3 / goldengate

Source system Settings

1. Extract the ogg installation package in Node1

# su-oracle

[oracle@node1 ~] $cd / goldengate/

[oracle@node1 goldengate] $unzip / tmp/ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip

[oracle@node1 goldengate] $tar xvf fbo_ggs_Linux_x64_ora11g_64bit.tar

two。 Add OGG_HOME to bash_profile

Su-oraclecdvi .bash _ profile

Export ORACLE_HOSTNAME=node1

Export ORACLE_SID=PROD1

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

Export ORACLE_UNQNAME=PROD

Export OGG_HOME=/goldengate

Export TNS_ADMIN=$ORACLE_HOME/network/admin

Export ORACLE_TERM=xterm

Export PATH=/usr/sbin:$PATH

Export PATH=$ORACLE_HOME/bin:$PATH:$OGG_HOME

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Export EDITOR=vi

Export LANG=en_US

Export NLS_LANG=american_america.AL32UTF8

Export NLS_DATE_FORMAT='yyyy/mm/dd hh34:mi:ss'

3. Create an OGG application directory, which needs to be under the OGG_HOME path

Cd $OGG_HOME

[oracle@node1 goldengate] $ggsci

GGSCI (node1) 1 > CREATE SUBDIRS

4. Database enables archiving mode

Check whether archive mode # srvctl stop database-d prodSQL > startup mount;SQL > alter database archivelog;SQL > shutdown immediate;# srvctl start database-d prod is enabled for archive mode archivelog list;

5. Enable database-level log replenishment

Sqlplus / as sysdba

SQL > ALTER DATABASE FORCE LOGGING

SQL > ALTER DATABASE ADD SUPPLEMENTAL LOG DATA

SQL > ALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY, UNIQUE,FOREIGN KEY) COLUMNS

SQL > ALTER SYSTEM ARCHIVE LOG CURRENT

SELECT

SUPPLEMENTAL_LOG_DATA_MIN

SUPPLEMENTAL_LOG_DATA_PK

SUPPLEMENTAL_LOG_DATA_UI

SUPPLEMENTAL_LOG_DATA_FK

SUPPLEMENTAL_LOG_DATA_ALL

FROM v$database

SUPPLEME SUP SUP SUP SUP

YES YES YES YES NO

Parameters required for Oracle11.2.0.4 version

SQL > ALTER SYSTEM SET ENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH

6. Create a test user

Sqlplus / as sysdba

SQL > CREATE USER snow IDENTIFIED BY snow DEFAULT TABLESPACE USERS

SQL > GRANT CONNECT, RESOURCE TO snow

SQL > conn snow/snow

SQL > CREATE TABLE T1 (id INT PRIMARY KEY, name VARCHAR2 (10))

7. Create OGG administrative user oggadmin and its tablespace goldengate

Sqlplus / as sysdba

SQL > select name from v$datafile

SQL > CREATE TABLESPACE goldengate DATAFILE'+ DATA' SIZE 100m AUTOEXTEND ON

SQL > CREATE USER oggadmin IDENTIFIED BY oggadmin DEFAULT TABLESPACE goldengate

SQL > GRANT dba TO oggadmin

8. Add Rol

Cd $OGG_HOME

Sqlplus / as sysdba

SQL > @ / goldengate/role_setup

Enter GoldenGate schema name:oggadmin

GRANT GGS_GGSUSER_ROLE TO oggadmin

9. Install sequence support

Cd $OGG_HOMEsqlplus / as sysdbaSQL > @ sequence.sqlSQL > GRANT EXECUTE ON oggadmin.updateSequence TO oggadmin;SQL > ALTER TABLE sys.seq$ ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY) COLUMNS

10. Set global parameters

Cd $OGG_HOME

Ggsci

GGSCI > EDIT PARAMS. / GLOBALS

GGSCHEMA oggadmin

Target system Settings

11. Extract the ogg installation package in node3

# su-oracle

[oracle@node3 ~] $cd / goldengate/

[oracle@node3 goldengate] $unzip / tmp/ogg112101_fbo_ggs_Linux_x64_ora11g_64bit.zip

[oracle@node3 goldengate] $tar xvf fbo_ggs_Linux_x64_ora11g_64bit.tar

twelve。 Add OGG_HOME to bash_profile

Su-oracle

Cd

Vi .bash _ profile

Export ORACLE_HOSTNAME=node3

Export ORACLE_SID=PROD1

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

Export ORACLE_UNQNAME=PROD

Export OGG_HOME=/goldengate

Export TNS_ADMIN=$ORACLE_HOME/network/admin

Export ORACLE_TERM=xterm

Export PATH=/usr/sbin:$PATH

Export PATH=$ORACLE_HOME/bin:$PATH:$OGG_HOME

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib:

Export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

Export EDITOR=vi

Export LANG=en_US

Export NLS_LANG=american_america.AL32UTF8

Export NLS_DATE_FORMAT='yyyy/mm/dd hh34:mi:ss'

13. Create an OGG application directory, which needs to be under the OGG_HOME path

Cd $OGG_HOME

[oracle@node1 goldengate] $ggsci

GGSCI (node1) 1 > CREATE SUBDIRS

14. Database enables archiving mode

Check to see if it is in archive mode

Archive log list

Turn on archiving mode

# srvctl stop database-d prod

SQL > startup mount

SQL > alter database archivelog

SQL > shutdown immediate

# srvctl start database-d prod

15. Create a test user

Sqlplus / as sysdba

SQL > CREATE USER snow IDENTIFIED BY snow DEFAULT TABLESPACE USERS

SQL > GRANT CONNECT, RESOURCE TO snow

SQL > conn snow/snow

SQL > CREATE TABLE T1 (id INT PRIMARY KEY, name VARCHAR2 (10))

16. Create OGG administrative user oggadmin and its tablespace goldengate

Sqlplus / as sysdba

SQL > select name from v$datafile

SQL > CREATE TABLESPACE goldengate DATAFILE'+ DATA' SIZE 100m AUTOEXTEND ON

SQL > CREATE USER oggadmin IDENTIFIED BY oggadmin DEFAULT TABLESPACE goldengate

SQL > GRANT dba TO oggadmin

17. Set global parameters

Cd $OGG_HOME

GGSCI

GGSCI > EDIT PARAMS. / GLOBALS

GGSCHEMA oggadmin

Source system Settings

18. Configuration management process

GGSCI > EDIT PARAM MGR

PORT 7839

DYNAMICPORTLIST 7840-7914

-- AUTORESTART EXTRACT *, RETRIES 5, WAITMINUTES 7

PURGEOLDEXTRACTS. / dirdat/*, USECHECKPOINTS, MINKEEPDAYS 10

LAGREPORTHOURS 1

LAGINFOMINUTES 30

LAGCRITICALMINUTES 45

19. Enable table-level log supplement, and append all tables under the user's snow

GGSCI > DBLOGIN USERID oggadmin,PASSWORD oggadmin

GGSCI > ADD TRANDATA snow.t1

20. Create a primary extraction group ex1. The source end is a two-node RAC. The parameter THREADS 2 is set here.

ADD EXTRACT ex1,TRANLOG,BEGIN NOW,THREADS 2

21. Specify a local trail file for the primary extraction group ex1

ADD EXTTRAIL / goldengate/dirdat/ex, EXTRACT ex1 MEGABYTES 5

twenty-two。 Generate the password for the OGG administrative user oggadmin

GGSCI > encrypt password oggadmin encryptkey default

Using default key...

Encrypted password: AACAAAAAAAAAAAIARFBCXDACYBXIVCND

Algorithm used: BLOWFISH

23. Configure the primary extraction group parameter file. The source end is a two-node RAC. Set the parameter TRANLOGOPTIONS DBLOGREADER here.

EXTRACT ex1

TRANLOGOPTIONS DBLOGREADER

EXTTRAIL / goldengate/dirdat/ex

SETENV (NLS_LANG= "AMERICAN_AMERICA.UTF8")

USERID oggadmin, PASSWORD AACAAAAAAAAAAAIARFBCXDACYBXIVCND, ENCRYPTKEY default

GETTRUNCATES

REPORTCOUNT EVERY 30 MINUTES, RATE

DISCARDFILE / goldengate/dirrpt/ex1.dsc, APPEND, MEGABYTES 1024

DISCARDROLLOVER AT 3:00

WARNLONGTRANS 2h, CHECKINTERVAL 3m

DYNAMICRESOLUTION

DBOPTIONS ALLOWUNUSEDCOLUMN

FETCHOPTIONS NOUSESNAPSHOT

FETCHOPTIONS FETCHPKUPDATECOLS

-- TRANLOGOPTIONS CONVERTUCS2CLOBS

-- THREADOPTIONS MAXCOMMITPROPAGATIONDELAY 60000 IOLATENCY 60000

TABLE snow.*

24. Create the delivery group dp1 and set the local trail file

ADD EXTRACT dp1 EXTTRAILSOURCE / goldengate/dirdat/ex

25. Set the target end trail file address for the delivery group dp1

ADD RMTTRAIL / u01/app/oracle/gg/dirdat/rt, EXTRACT dp1

twenty-six。 Configure the delivery group dp1 parameter file. 172.16.228.103 is the IP address of the server where the destination OGG resides

EXTRACT dp1

USERID oggadmin, PASSWORD oggadmin

RMTHOST 172.16.228.103, MGRPORT 7839, COMPRESS

PASSTHRU

NUMFILES 5000

RMTTRAIL / goldengate/dirdat/rt

DYNAMICRESOLUTION

TABLE snow.*

Target system

twenty-seven。 Configuration management process

PORT 7839

USERID oggadmin, PASSWORD AACAAAAAAAAAAAIARFBCXDACYBXIVCND, ENCRYPTKEY default

DYNAMICPORTLIST 7840-7914

AUTORESTART EXTRACT *, RETRIES 5 WAITMINUTES 3

PURGEOLDEXTRACTS. / dirdat/*,usecheckpoints, minkeepdays 5

LAGREPORTHOURS 1

LAGINFOMINUTES 30

LAGCRITICALMINUTES 45

twenty-eight。 Create a checkpoint table

GGSCI > DBLOGIN USERID oggadmin,PASSWORD oggadmin

GGSCI > ADD CHECKPOINTTABLE oggadmin.checkpointtable

twenty-nine。 Add a checkpoint table in the global environment

GGSCI > EDIT PARAMS. / GLOBALS

GGSCHEMA oggadmin

CHECKPOINTTABLE oggadmin.checkpointtable

thirty。 Create replication group rt1, set the path to read trail files and checkpoint table

ADD REPLICAT rt1, EXTTRAIL / goldengate/dirdat/rt, checkpointtable oggadmin.checkpointtable

thirty-one。 Configure the parameter file for the replication group rt1

REPLICAT rt1

SETENV (NLS_LANG = "American_America.UTF8")

USERID oggadmin, PASSWORD AACAAAAAAAAAAAIARFBCXDACYBXIVCND, ENCRYPTKEY default

DBOPTIONS DEFERREFCONST

GETTRUNCATES

REPORT AT 06:00

REPORTCOUNT EVERY 30 MINUTES, RATE

REPORTROLLOVER AT 02:00

REPERROR DEFAULT, ABEND

-- HANDLECOLLISIONS

ALLOWNOOPUPDATES

DISCARDFILE. / dirrpt/repsa.dsc, APPEND, MEGABYTES 1024M

DISCARDROLLOVER AT 02:00

ASSUMETARGETDEFS

MAP snow.*, TARGET snow.*

Test link

Start the source management process

GGSCI > START MGR

Start the target management process

GGSCI > START MGR

Start the source extraction process

GGSCI > START ex1

Start the target replication process

GGSCI > START rt1

Start the source delivery process

GGSCI > START dp1

Confirm source process status

GGSCI > INFO ALL

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING DP1 00:00:00 00:00:08

EXTRACT RUNNING EX1 00:00:00 00:00:03

Confirm target process status

GGSCI > INFO ALL

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

REPLICAT RUNNING RT1 00:00:00 00:00:02

Source-end node node1 inserts data

Begin

For i in 1..1000 loop

Insert into T1 values (iMagnum Ooo')

End loop

Commit

End

/

Replication side verification

Select count (*) from snow.t1

This is the end of the OGG configuration for production (source) and disaster recovery (target).

Thank you for reading! This is the end of the article on "how to install and configure OGG on RAC". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

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