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

Construction of unidirectional replication in oracle ogg stand-alone environment

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

OGG installation

Fbo_ggs_Linux_x64_shiphome.zip- supports both 11g and 12c

Add user

Useradd-u 1003-g oinstall-G dba ogg

Configure environment variables

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

Export ORACLE_SID=racdb1

Export OGG_HOME=$ORACLE_BASE/ogg

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

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/u01/app/oracle/ogg/:/lib:/usr/lib

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

Pay attention to the directory during installation

2. GgMessage not found

Cannot load ICU resource bundle'ggMessage', error code 2-No such file or directory

Aborted (core dumped)

Solution: execute under the HOME directory of oracle goldengate

GGSCI (oggtarget) 2 > help

GGSCI Command Summary:

Object: Command:

SUBDIRS CREATE

DATASTORE ALTER, CREATE, DELETE, INFO, REPAIR

ER INFO, KILL, LAG, SEND, STATUS,START, STATS, STOP

EXTRACT ADD, ALTER, CLEANUP, DELETE, INFO,KILL

LAG, REGISTER, SEND, START,STATS, STATUS, STOP

UNREGISTER

EXTTRAIL ADD, ALTER, DELETE, INFO

GGSEVT VIEW

JAGENT INFO, START, STATUS, STOP

MANAGER INFO, SEND, START, STOP, STATUS

MARKER INFO

PARAMETERS EDIT, VIEW, SET EDITOR, INFO,GETPARAMINFO

REPLICAT ADD, ALTER, CLEANUP, DELETE, INFO,KILL, LAG, REGISTER, SEND

START, STATS, STATUS, STOP,SYNCHRONIZE, UNREGISTER

REPORT VIEW

RMTTRAIL ADD, ALTER, DELETE, INFO

TRACETABLE ADD, DELETE, INFO

TRANDATA ADD, DELETE, INFO

SCHEMATRANDATA ADD, DELETE, INFO

CHECKPOINTTABLE ADD, DELETE, CLEANUP, INFO, UPGRADE

WALLET CREATE, OPEN, PURGE

MASTERKEY ADD, INFO, RENEW, DELETE, UNDELETE

CREDENTIALSTORE ADD, ALTER, INFO, DELETE

HEARTBEATTABLE ADD, DELETE, ALTER, INFO

HEARTBEATENTRY DELETE

Commands without an object:

(Database) DBLOGIN, LIST TABLES, ENCRYPT PASSWORD,FLUSH SEQUENCE

MININGDBLOGIN, SET NAMECCSID

(DDL) DUMPDDL

(Miscellaneous)!, ALLOWNESTED | NOALLOWNESTED, CREATESUBDIRS

DEFAULTJOURNAL, FC, HELP,HISTORY, INFO ALL, OBEY, SHELL

SHOW, VERSIONS, VIEW GGSEVT,VIEW REPORT

(note: type the word COMMANDafter the! To display the

! Help topic, for example:GGSCI (sys1) > help! Command

OGG configuration

Experimental planning

Project

Operating system

Hostnam

Database version

Database character set

Oracle version

Ogg version

Oracle sid

Dbdream

Stream

The main library is fully prepared.

$rman target /

Run {

Allocate channel d0 type disk

Allocate channel d1 type disk

Backup format'/u01/backup/full_t%t_s%s_p%p' database

Sql 'alter system archive log current'

Backup format'/ u01/backup/arc_t%t_s%s_p%p'archivelog all

Release channel d0

Release channel d1

}

2.3.1 backup of main library

The main library is fully prepared.

$rman target /

Run {

Allocate channel d0 type disk

Allocate channel d1 type disk

Backup format'/u01/backup/full_t%t_s%s_p%p' database

Sql 'alter system archive log current'

Backup format'/ u01/backup/arc_t%t_s%s_p%p'archivelog all

Release channel d0

Release channel d1

}

Create an alternate control file

RMAN > backup current controlfile forstandby format'/ u01Accord backupcontrol 01.ctl'

Scp * 192.168.120.203:/u01/backup

Restore

[oracle@oggtarget ~] $export ORACLE_SID=stream

[oracle@oggtarget ~] $rman target /

Recovery Manager: Release 11.2.0.4.0-Production on Sun Aug 27 09:54:43 2017

Copyright (c) 1982, 2011, Oracle and/or itsaffiliates. All rights reserved.

Connected to target database (not started)

RMAN > set dbid=2496948349

RMAN > startup nomount

Startup failed: ORA-01078: failure inprocessing system parameters

LRM-00109: could not open parameter file'/u01/app/oracle/product/11.2.0/db_1/dbs/initstream.ora'

Starting Oracle instance without parameterfile for retrieval of spfile

Oracle instance started

Total System Global Area 1068937216 bytes

Fixed Size 2260088 bytes

Variable Size 281019272 bytes

Database Buffers 780140544 bytes

Redo Buffers 5517312 bytes

Note: even if there is no parameter file under rman, an instance of DUMMY will be started by default so that the parameter file can be restored.

1. Restore spfile

RMAN > restore spfile from'/u01/backup/full_t953113531_s4_p1'

RMAN > sql "create pfile from spfile"

Modify pfile parameters

Dbdream.__java_pool_size=4194304

Dbdream.__large_pool_size=8388608

Dbdream.__oracle_base='/u01/app/oracle'#ORACLE_BASEset from environment

Dbdream.__pga_aggregate_target=314572800

Dbdream.__sga_target=465567744

Dbdream.__shared_io_pool_size=0

Dbdream.__shared_pool_size=117440512

Dbdream.__streams_pool_size=0

* .audit_file_dest='/u01/app/oracle/admin/stream/adump'--- modifies the creation directory

* .audit_trail='db'

* .compatible='11.2.0.4.0'

* .control_files='/u01/app/oracle/oradata/stream/control01.ctl','/u01/app/oracle/fast_recovery_area/stream/control02.ctl'---- modification

* .db_block_size=8192

* .db_domain=''

* .db_name='stream'- modification

* .db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'

* .db_recovery_file_dest_size=4385144832

* .diagnostic_dest='/u01/app/oracle'

* .dispatchers=' (PROTOCOL=TCP) (SERVICE=streamXDB)'

* .log_archive_format='%t_%s_%r.dbf'

* .memory_target=780140544

* .open_cursors=300

* .processes=150

* .remote_login_passwordfile='EXCLUSIVE'

* .undo_tablespace='UNDOTBS1'

~

RMAN > shutdown abort

Start nomount with the newly modified file

RMAN > startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initstream.ora'

Create pfile

RMAN > sql "create spfile from pfile"

New spfile startup

RMAN > startup nomount

RMAN > startup force nomount

2. Restore control files

RMAN > restore controlfile from'/ u01 Universe backupUniple fullcards 953113527 accounts s3roomp1'

Starting restore at 27-AUG-17

Allocated channel: ORA_DISK_1

Channel ORA_DISK_1: SID=19 device type=DISK

Channel ORA_DISK_1: restoring control file

Channel ORA_DISK_1: restore complete,elapsed time: 00:00:01

Output filename=/u01/app/oracle/oradata/stream/control01.ctl

Output filename=/u01/app/oracle/fast_recovery_area/stream/control02.ctl

Finished restore at 27-AUG-17

3. Start the database to the loaded state

RMAN > alter database mount

RMAN > catalog start with'/ backup/'

RMAN > restore database

RMAN > recover database

RMAN > alter database open resetlogs Open the database

Nid target=/as sysdba dbname=stream

[oracle@oggtarget dbs] $nid target=/assysdba dbname=stream

DBNEWID: Release 11.2.0.4.0-Production onSun Aug 27 12:31:08 2017

Copyright (c) 1982, 2011, Oracle and/or itsaffiliates. All rights reserved.

Password:

Connected to database DBDREAM (DBID=2496948349)

Connected to server version 11.2.0

Control Files in database:

/ u01/app/oracle/oradata/stream/control01.ctl

/ u01/app/oracle/fast_recovery_area/stream/control02.ctl

Change database ID and database nameDBDREAM to STREAM? (y / [N]) = > y

Proceeding with operation

Changing database ID from 2496948349 to1719130576

Changing database name from DBDREAM toSTREAM

Control File / u01/app/oracle/oradata/stream/control01.ctl-modified

Control File / u01/app/oracle/fast_recovery_area/stream/control02.ctl-modified

Datafile / u01/app/oracle/oradata/dbdream/system01.db-dbid changed,wrote new name

Datafile / u01/app/oracle/oradata/dbdream/sysaux01.db-dbid changed,wrote new name

Datafile / u01/app/oracle/oradata/dbdream/undotbs01.db-dbid changed,wrote new name

Datafile / u01/app/oracle/oradata/dbdream/users01.db-dbid changed,wrote new name

Datafile / u01/app/oracle/oradata/dbdream/temp01.db-dbid changed, wrotenew name

Control File / u01/app/oracle/oradata/stream/control01.ctl-dbidchanged, wrote new name

Control File / u01/app/oracle/fast_recovery_area/stream/control02.ctl-dbid changed, wrote new name

Instance shut down

Database name changed to STREAM.

Modify parameter file and generate a newpassword file before restarting.

Database ID for database STREAM changed to1719130576.

All previous backups and archived redo logsfor this database are unusable.

Database is not aware of previous backupsand archived logs in Recovery Area.

Database has been shutdown, open databasewith RESETLOGS option.

Succesfully changed database name and ID.

DBNEWID-Completed succesfully.

If the DB_NAME parameter in the parameter file is not modified, an ORA-01103 error will be reported during MOUNT.

Modify the DB_NAME parameter and try to open the database directly.

Prompt that you must use RESETLOGS to open the database.

By default, both db_unique_name and service_names change with DB NAME, and due to changes in service_names, applications are normally unable to connect to the database (except for SID connections).

Building ogg main Library by Oracle goldengate

Set environment variables (oracle users)

PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin:/ggs

Export LD_LIBRARY_PATH=/ggs:$ORACLE_HOME/lib

1. Check to see if archiving is enabled

SQL > select log_mode fromgv$database

SQL > archive log list;-note that the archive path needs to be a shared path

two。 Check whether force logging is enabled and supplementary log

Selectforce_logging,supplemental_log_data_min,supplemental_log_data_all,flashback_onfrom v$database

Enable:

Alter database force logging

Alter database add supplemental logdata

Alter system archive log current

3. For the main library check, ogg does not allow: the column definition of the index column of the unique index is allowed to be null's

Select dic.table_owner

Dic.table_name

Dic.index_name

Di.uniqueness

Dic.column_name

From dba_ind_columns dic, dba_indexes di, dba_tab_columns dtc

Where dic.table_owner = 'add your own user'-modify the user name

And dtc.OWNER = 'add your own user'-modify the user name

AND dic.table_owner = di.table_owner

And dic.TABLE_NAME = di.table_name

And dic.index_name = di.index_name

And di.uniqueness = 'UNIQUE'

And dtc.owner = di.table_owner

And dtc.TABLE_NAME = di.table_name

And dic.column_name = dtc.COLUMN_NAME

And dtc.nullable ='Y'

Anddic.TABLE_NAME = dtc.TABLE_NAME

The row should not be returned, and if so, modify: either become a non-unique index, or set the column definition to not null while keeping the unique index.

4. Create an ogg user and authorize

Create user ogg identified by ogg default tablespaceusers

Grant dba to ogg

ALTER SYSTEM SETENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH

5. Check if there are tables in nologing mode (ogg does not support tables created in nologing mode)

Select owner,table_name,logging fromdba_tables where logging='NO' AND owner=' user name'

Syntax for tables modified to logging: alter table table name logging

Note: adding dboptions allownologging to the parameter file of the ext process will allow the ext process to continue to run, but will result in data loss.

6. Supplementary logs for adding tables to the source-side database

Enter the ogg installation path:

Ggsci

Dblogin userid ogg password ogg

GGSCI (oggsource) 1 > dblogin userid ogg password ogg

Successfully logged into database.

GGSCI (oggsource as ogg@dbdream) 2 > create subdirs

Creating subdirectories under current directory/u01/app/oracle/ogg

Parameter files / u01/app/oracle/ogg/dirprm:already exists

Report files / u01/app/oracle/ogg/dirrpt:already exists

Checkpoint files / u01/app/oracle/ogg/dirchk:already exists

Process status files / u01/app/oracle/ogg/dirpcs: alreadyexists

SQL script files / u01/app/oracle/ogg/dirsql:already exists

Database definitions files / u01/app/oracle/ogg/dirdef: already exists

Extract data files / u01/app/oracle/ogg/dirdat:already exists

Temporary files / u01/app/oracle/ogg/dirtmp:already exists

Credential store files / u01/app/oracle/ogg/dircrd: alreadyexists

Masterkey wallet files / u01/app/oracle/ogg/dirwlt: alreadyexists

Dump files / u01/app/oracle/ogg/dirdmp: already exists

GGSCI (oggsource as ogg@dbdream) 2 > addtrandata lm.testogg

-add additional logs to the table so that goldengate can extract and apply redo.

7. Configure DDL replication

Use ogg as the user to store the DDL objects to authorize ogg:

SQL > GRANT EXECUTE ON UTL_FILE TO ogg

8. Configure the GLOBALS file

Ggsci

Add to edit param. / GLOBALS:

GGSCHEMA goldengate

If it is 10g, you don't need to disable recyclebin,11g.

9. Database execution:

Execute after exiting all oracle connections:

Cd / ggs

Sqlplus / as sysdba

@ marker_setup.sql

SQL > @ marker_setup.sql

Marker setup script

You will be prompted for the name of aschema for the Oracle GoldenGate database objects.

NOTE: The schema must be created prior torunning this script.

NOTE: Stop all DDL replication beforestarting this installation.

Enter Oracle GoldenGate schema name:

Setting schema name to OGG

MARKER TABLE

-

OK

MARKER SEQUENCE

-

OK

Script complete.

SQL > @ ddl_setup.sql

Oracle GoldenGate DDL Replication setupscript

Verifying that current user has privilegesto install DDL Replication...

You will be prompted for the name of aschema for the Oracle GoldenGate database objects.

NOTE: For an Oracle 10g source, the systemrecycle bin must be disabled. For Oracle 11g and later, it can be enabled.

NOTE: The schema must be created prior torunning this script.

NOTE: Stop all DDL replication beforestarting this installation.

Enter Oracle GoldenGate schema name:ogg

Working, please wait...

Spooling to file ddl_setup_spool.txt

Checking for sessions that are holdinglocks on Oracle Golden Gate metadata tables...

Check complete.

Using OGG as an Oracle GoldenGate schemaname.

Working, please wait...

DDL replication setup script complete,running verification script...

Please enter the name of a schema for theGoldenGate database objects:

Setting schema name to OGG

CLEAR_TRACE STATUS:

Line/pos Error

-

No errors No errors

CREATE_TRACE STATUS:

Line/pos Error

-

No errors No errors

TRACE_PUT_LINE STATUS:

Line/pos Error

--

No errors No errors

INITIAL_SETUP STATUS:

Line/pos Error

-

No errors No errors

DDLVERSIONSPECIFIC PACKAGE STATUS:

Line/pos Error

-

No errors No errors

DDLREPLICATION PACKAGE STATUS:

Line/pos Error

-

No errors No errors

DDLREPLICATION PACKAGE BODY STATUS:

Line/pos Error

-

No errors No errors

DDL IGNORE TABLE

-

OK

DDL IGNORE LOG TABLE

-

OK

DDLAUX PACKAGE STATUS:

Line/pos Error

-

No errors No errors

DDLAUX PACKAGE BODY STATUS:

Line/pos Error

-

No errors No errors

SYS.DDLCTXINFO PACKAGE STATUS:

Line/pos Error

-

No errors No errors

SYS.DDLCTXINFO PACKAGE BODY STATUS:

Line/pos Error

--

No errors No errors

DDL HISTORY TABLE

-

OK

DDL HISTORY TABLE (1)

-

OK

DDL DUMP TABLES

-

OK

DDL DUMP COLUMNS

-

OK

DDL DUMP LOG GROUPS

-

OK

DDL DUMP PARTITIONS

-

OK

DDL DUMP PRIMARY KEYS

-

OK

DDL SEQUENCE

-

OK

GGS_TEMP_COLS

-

OK

GGS_TEMP_UK

-

OK

DDL TRIGGER CODE STATUS:

Line/pos Error

--

No errors No errors

DDL TRIGGER INSTALL STATUS

-

OK

DDL TRIGGER RUNNING STATUS

ENABLED

STAYMETADATA IN TRIGGER

OFF

DDL TRIGGER SQL TRACING

0

DDL TRIGGER TRACE LEVEL

NONE

LOCATION OF DDL TRACE FILE

-

/ u01/app/oracle/diag/rdbms/dbdream/dbdream/trace/ggs_ddl_trace.log

Analyzing installation status...

VERSION OF DDL REPLICATION

-

OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401

STATUS OF DDL REPLICATION

-

SUCCESSFUL installation of DDL Replicationsoftware components

Script complete.

SQL >

SQL > @ role_setup.sql

GGS Role setup script

This script will drop and recreate the roleGGS_GGSUSER_ROLE

To use a different role name, quit thisscript and then edit the params.sql script to change the gg_role parameter tothe preferred name. (Do not run the script.)

You will be prompted for the name of aschema for the GoldenGate database objects.

NOTE: The schema must be created prior torunning this script.

NOTE: Stop all DDL replication beforestarting this installation.

Enter GoldenGate schema name:ogg

SP2-0606: Cannot create SPOOL file "role_setup_spool.txt"

SP2-0606: Cannot create STORE file "role_setup_set.txt"

PL/SQL procedure successfully completed.

Role setup script complete

Grant this role to each user assigned tothe Extract, GGSCI, and Manager processes, by using the following SQL command:

GRANT GGS_GGSUSER_ROLE TO

Where is the userassigned to the GoldenGate processes.

SQL > grantggs_ggsuser_role to ogg

SQL > @ ddl_enable.sql

If there is a need for disaster recovery drills, you need to configure sequence synchronization

Cd / ggs-- ogg installation directory

Sqlplus / as sysdba

@ sequence.sql

GRANT EXECUTE on goldengate.updateSequenceTO goldengate

10. Source configuration parameter file

Su-grid

Vi$ORACLE_HOME/network/admin/listener.ora

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = + ASM)

(ORACLE_HOME=/u01/app/11.2.0/grid)

(SID_NAME = + ASM1)

. )

(.)

.

.

.su-oracle

.CD $ORACLE_HOME/network/admin

.vi tnsnames.ora

.ASM =

. (DESCRIPTION =

. (ADDRESS = (PROTOCOL = TCP) (HOST = 186.168.100.3) (PORT = 1521))

. (CONNECT_DATA =

. (SERVER = DEDICATED)

. (SERVICE_NAME = + ASM)

. (SID_NAME = + ASM1)

. )

. )

.

11. Configuration management process mgr:

GGSCI (NDSCDB1) 1 > edit param mgr

Port 7809

-- DYNAMICPORTLIST 7830-7835

Autostart extract *

Autorestart extract *, waitminutes 1 direction retries 60, RESETMINUTES 60

PURGEOLDEXTRACTS / ggs/dirdat/sd*,USECHECKPOINTS, MINKEEPHOURS 2

~ configuration description of MANAGER process parameters:

PORT: specify the service listening port. Take 7839 as an example. The default port is 7809.

DYNAMICPORTLIST: dynamic ports: you can make a dynamic list of up to 256available ports. When the specified port is not available, the management process will select an available port from the list, and these ports will also be used for Collector, Replicat, and GGSCI process communication between the source side and the destination segment.

COMMENT: comment line, or you can use-- instead

AUTOSTART: specifies which processes are started automatically when the administrative process starts

AUTORESTART: automatic restart parameter setting: this setting means that all EXTRACT processes are attempted to restart every 3 minutes, with a total of 5 attempts

PURGEOLDEXTRACTS: regularly clean up the trail file settings: this setting indicates that the trail files that are more than 3 days old are deleted.

LAGREPORT 、 LAGINFO 、 LAGCRITICAL:

Define the early warning mechanism of data delay: the setting here means that the MGR process checks the delay of EXTRACT every 1 hour, and records the delay as a message in the error log if it exceeds 30 minutes, and writes it in the error log as a warning if the delay exceeds 45 minutes.

12. Configure extfull

Add extract extfull, tranlog,begin now

Edit param extfull

Extract extfull

Setenv (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")-add an error

TRANLOGOPTIONS ASMUSERSYS@ASM, ASMPASSWORD oracle

THREADOPTIONS MAXCOMMITPROPAGATIONDELAY80000 IOLATENCY 160000

DBOPTIONS ALLOWUNUSEDCOLUMN

Userid goldengate, password goldengate

Ddl include mapped

Ddloptions addtrandata RETRYOP MAXRETRIES1000 RETRYDELAY 10, REPORT

WARNLONGTRANS 1h, CHECKINTERVAL 5m

Exttrail / ggs/dirdat/sd

Gettruncates

Dynamicresolution

NOCOMPRESSUPDATES

NOCOMPRESSDELETES

Table LM.testogg

Add exttrail / u01/app/oracle/ogg/dirdat/sd, extractextfull, MEGABYTES 50

13. Add a transport process

Add a transport process

Addextract dpfull exttrailsource / ggs/dirdat/sd

Create a remote queue file and assign it to the transport process

Addrmttrail / u01/app/oracle/ogg/td, extract dpfull, MEGABYTES 50

Configure transport process parameters

Editparam dpfull

= =

Extractdpfull

Passthru

Rmthost 186.168.100.22, mgrport 7809

Rmttrail / ggs/dirdat/td

Gettruncates

Table LM.testogg

12. Start the management process:

Dblogin userid ogg password ogg

GGSCI (oggsource as ogg@dbdream) 11 > start mgr

Manager started.

Check the process status and find that the MANAGER status is RUNNING:

GGSCI (NDSCDB1) 3 > info all

/ u01/app/oracle/ogg/dirrpt

13. Configure the extraction process:

GGSCI (oggsource as ogg@dbdream) 12 > addextract extnd,tranlog,begin now

EXTRACT added.

GGSCI (oggsource as ogg@dbdream) 13 > addexttrail. / dirdat/nd,extract extnd,megabytes 100

EXTTRAIL added.

Megabytes: specify the queue size. The setting here means 100m.

Add transport process, configure parameters

GGSCI (NDSCDB1) 15 > edit params extnd

EXTRACT extnd

Setenv (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")

SETENV (ORACLE_HOME = "/ u01/app/oracle/product/11.2.0/db_1")

SETENV (ORACLE_SID = "dbdream")

USERID ogg, PASSWORD ogg

-- GETTRUNCATES

REPORTCOUNTEVERY 1 MINUTES, RATE

DISCARDFILE./dirrpt/extnd.dsc,APPEND,MEGABYTES1024

-- THREADOPTIONS MAXCOMMITPROPAGATIONDELAY 60000 IOLATENS60000

DBOPTIONS ALLOWUNUSEDCOLUMN

WARNLONGTRANS2h,CHECKINTERVAL 3m

EXTTRAIL./dirdat/nd

-- TRANLOGOPTIONSEXCLUDEUSER USERNAME

FETCHOPTIONSNOUSESNAPSHOT

TRANLOGOPTIONS CONVERTUCS2CLOBS

TABLE olive.ol$_objects

GGSCI (NDSCDB1) 15 > add extract dpend,exttrailsource. / dirdat/nd

EXTRACT added.

GGSCI (NDSCDB1) 15 > add rmttrail / u01/app/oracle/ogg/nd, EXTRACT DPEND

RMTTRAIL added.

Edit params dpend

EXTRACT dpend

SETENV (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")

USERID ogg, PASSWORD ogg

PASSTHRU

RMTHOST10.122.0.113, MGRPORT 7839, compress

RMTTRAILF:/u01/app/oracle/ogg/dirdat/nd

TABLE olive.ol$_objects

In fact, both the extraction process and the transport process are EXTRACT processes, and they can also be configured in one process to complete these two functions, but when there is a problem with network transmission, the extraction process cannot continue to run, so it is recommended to configure them separately as two processes.

Configuration instructions for EXTRACT process parameters:

SETENV: configuring system environment variabl

USERID/ PASSWORD: specify the user name and password for OGG to connect to the database, using the database user OGG created in part 3.4

COMMENT: comment line, or you can use-- instead

TABLE: defines the table to be replicated, ending with;

TABLEEXCLUDE: defines the tables that need to be excluded, which can be used to specify excluded tables if wildcards are used in the TABLE parameter.

GETUPDATEAFTERS | IGNOREUPDATEAFTERS:

Whether to write the post-image in the queue, copy by default

GETUPDATEBEFORES | IGNOREUPDATEBEFORES:

Whether to write the previous image in the queue. It is not copied by default.

GETUPDATES | IGNOREUPDATES:

Whether to copy UPDATE operation, default replication

GETDELETES | IGNOREDELETES:

Whether to copy DELETE operation, default replication

GETINSERTS | IGNOREINSERTS:

Whether to copy INSERT operation, default replication

GETTRUNCATES | IGNORETRUNDATES:

Whether to copy TRUNCATE operations. Default is not to copy.

RMTHOST: specifies the port number of the target system and its GoldengateManager process. It is also used to define whether to use compression for transmission. In this case, compress is compressed transmission.

RMTTRAIL: specifies which queue to write to the destination break

EXTTRAIL: specifies which queue to write to locally

SQLEXEC: first run a SQL statement when the extract process is running

PASSTHRU: forbids the extract process from interacting with the database, applicable to the DataPump transport process

REPORT: define automatic scheduled reports

STATOPTIONS: defines whether statistics need to be reset each time stat is used

REPORTCOUNT: report statistics on the number of records processed

TLTRACE: open trace logs for database logs

DISCARDFILE: defines the location of the discardfile file, which will be written to this file if there is an error in processing the oil record.

DBOPTIONS: specify the special parameters required for a particular database

TRANLOGOPTIONS: specify the special parameters required when parsing database logs. For example, for bare devices, you may need to add the following parameter rawdeviceoggset 0

WARNLONGTRANS: specifies that warning messages can be written in gsserr.log for long transactions over a certain period of time. This department is configured to check trading every 3 minutes and warn for transactions that exceed 2 hours.

~

~

Target library

Prepare the library:

1. Create ogg users and authorize

Create user goldengatet identified bygoldengatet default tablespace tbs_ogg

Grant dba to ogg

Execdbms_streams_auth.grant_admin_privilege (grantee = > 'ogg',grant_privileges= > true)

ALTER SYSTEM SETENABLE_GOLDENGATE_REPLICATION = TRUE SCOPE=BOTH

two。 Configure environment variables (under oracle users)

Export LD_LIBRARY_PATH

Export PATH=

The target library creates GoldenGate database users and authorizes:

GGSCI (oggtarget) 1 > create subdirs

Creating subdirectories under currentdirectory / u01/app/oracle/ogg

Parameter files / u01/app/oracle/ogg/dirprm:already exists

Report files / u01/app/oracle/ogg/dirrpt:already exists

Checkpoint files / u01/app/oracle/ogg/dirchk:already exists

Process status files / u01/app/oracle/ogg/dirpcs: alreadyexists

SQL script files / u01/app/oracle/ogg/dirsql:already exists

Database definitions files / u01/app/oracle/ogg/dirdef: already exists

Extract data files / u01/app/oracle/ogg/dirdat:already exists

Temporary files / u01/app/oracle/ogg/dirtmp:already exists

Credential store files / u01/app/oracle/ogg/dircrd: alreadyexists

Masterkey wallet files / u01/app/oracle/ogg/dirwlt: alreadyexists

Dump files / u01/app/oracle/ogg/dirdmp: already exists

SQL > create tablespace ogg datafile'/u01/app/oracle/oradata/dbdream/ogg.dbf' size 50m autoextend on

SQL > create user ogg identified by oggdefault tablespace ogg

Grant connect,resource,unlimited tablespaceto ogg

Grant execute on utl_file to ogg

Grant select any dictionary,select anytable to ogg

Grant alter any table to ogg

Grant flashback any table to ogg

Grant execute on DBMS_FLASHBACK to ogg

Grant insert any table to ogg

Grant delete any table to ogg

Grant update any table to ogg

Library configuration check

SQL > select NAME,OPEN_MODE,FORCE_LOGGING,SUPPLEMENTAL_LOG_DATA_MINfrom v$database

SQL > alter database force logging

SQL > alter database add SUPPLEMENTAL log data

Configure MGR

Configuration parameter file

MGR:

Edit param mgr

PORT 7839

Autostart replicat *

Autorestart replicat *, waitminutes 1 direction retries 60, RESETMINUTES 60

PURGEOLDEXTRACTS/u01/app/oracle/ogg/dirdat/td*, USECHECKPOINTS, MINKEEPHOURS 2

Add checkpoint

Dblogin userid goldengate,password goldengate

ADD CHECKPOINTTABLE goldengate.ckptfull

Configure the target side process group

Add replicat repfull, exttrail/u01/app/oracle/ogg/dirdat/td, CHECKPOINTTABLE ogg.ckptfull

Edit params repfull

Replicat repfull

Setenv (NLS_LANG = "AMERICAN_AMERICA.ZHS16GBK")

Assumetargetdefs

Userid ogg, password ogg

DBOPTIONS DEFERREFCONST, SUPPRESSTRIGGERS

Gettruncates

ALLOWNOOPUPDATES

Ddl include mapped

Discardfile. / dirrpt/repfull.dsc, append,megabytes 4000

Map scott.t1, target scott.t1

GGSCI (oggtarget as ogg@stream) 74 > start mgr

GGSCI (oggtarget as ogg@stream) 75 > infoall

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

REPLICAT RUNNING REPFULL 00:00:00 00:00:02

Parameter description:

REPLICAT RINI_1: indicates that this is a REPLICAT application process, and its name is RINI_1

SETENV: language variable, same as capture process EINI_1

ASSUMETARGETDEFS: tell OGG that the structure of the table to be synchronized on the destination side and source side is exactly the same, and there is no need for OGG to check the structure of the table, including table name, field name, field type, field length, and so on. If the structure of the synchronized table on the destination side and the source side is different, you need to use the SOURCEDEFS parameter. For more information, please see the official OGG documentation.

USERID, PASSWORD: introduction to EINI_1 parameters of the same capture process

DISCARDFILE: location and naming rules for error messages

MAP: the name of the table captured by the source side

TARGET: the name of the synchronized table on the target side, which may not be in the same SCHEMA.

Test and check

Info all- check process

Info process name, detail

Stats REPFULL-- checks the status of data transmission

View report process name

Log in to the database to check whether the data has changed

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