Oracle goldengate bi-directional active-active configure
1. Install the golden gate software. After creating the installation directory, decompress it under the directory. (Both the source and target are executed)
Note: We recommend that you use oracle to install the environment variable of oralce:
LD_LIBRARY_PATH =/usr/lib:/usr/X11R6/lib: $ ORACLE_GOLDENGATE: $ ORACLE_HOME/lib
LD_LIBRARY_PATH must contain $ ORACLE_HOME/lib to execute./ggsci. Otherwise, the error of missing dynamic library file is returned:
However, in this case, the oracle database runs normally.
[Oracle @ haozg goldengate] $./ggsci
./Ggsci: error while loading shared libraries: libclntsh. so.11.1: cannot open shared object file:
No such file or directory
The reason is: goldengate requires oralce dynamic library files during runtime. Therefore, you need to put the oracle dynamic library file in the shared library,
The environment variable LD_LIBRARY_PATH is assigned. The ogg official document is described as follows:
Make certain that the database libraries are added to the shared-library environment variables of the system.
-- Installation Steps in ogg official documentation
Installing Oracle GoldenGate on Linux and UNIX
Follow these steps to install Oracle GoldenGate for Oracle on a Linux or UNIX system.
Installing the Oracle GoldenGate files
1. Extract the Oracle GoldenGate mediapack.zip file to the system and directory where you
Want Oracle GoldenGate to be installed.
2. Run the command shell.
./Ggsci
3. In GGSCI, issue the following command to create the Oracle GoldenGate working directories.
CREATE SUBDIRS
4. Issue the following command to exit GGSCI.
EXIT
2. Create a goldengate user (both on the source and target)
Note: database users are created for goldengate software. In order not to affect the production environment, this user is used to install and store procedure and table used by the replication software,
That is, the tables and processes used to build the ddl replication environment. This user must have certain permissions. --- Ddl objects are all under this user.
Oracle GoldenGate schema-the name on the ogg Official Website
Note: This user is also called an external user on the official website: replicate user
1. Create an ogg schema
SQL> create user ogg identified by ogg;
User created.
2. authorize it
SQL> grant connect, resource, dba to ogg;
Grant succeeded.
SQL> GRANT EXECUTE ON utl_file TO ogg;
Grant succeeded.
SQL>! Pwd
/Oracle/goldengate
============ The configuration idea is: first configure one-way replication from the master end to the disaster recovery end, and then configure one-way replication from the disaster recovery end to the master end, to achieve bidirectional replication ================
3. Perform one-way replication configuration from the master end to the disaster recovery end.
---------------------------- Master configuration ---------------------------------------------------
--------------------------- Database-level Configuration --------------------------------------------------
1. Check additional logs
Select
SUPPLEMENTAL_LOG_DATA_MIN
, SUPPLEMENTAL_LOG_DATA_PK
, SUPPLEMENTAL_LOG_DATA_UI
, SUPPLEMENTAL_LOG_DATA_FK
, SUPPLEMENTAL_LOG_DATA_ALL from v $ database;
The correct status is as follows:
SUPPLEME SUP
--------------------
YES NO
2. Add additional database logs and roll back
Alter database add supplemental log data;
Alter database add supplemental log data (primary key, unique, foreign key) columns;
--- Rollback
Alter database drop supplemental log data (primary key, unique, foreign key) columns;
Alter database drop supplemental log data;
3. Enable the forced log mode of the database.
Alter database force logging;
---------------------------- Support for installing ddl replication -----------------------------
4. Run the marker_setup. SQL script. This script. installsupport for the Oracle GoldenGate DDL marker system
SQL> @ marker_setup. SQL
Marker setup script
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name: ogg
Marker setup table script. complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to OGG
MARKER TABLE
-------------------------------
OK
MARKER SEQUENCE
-------------------------------
OK
Script. complete.
SQL>
5. Run @ ddl_setup. SQL
SQL> @ ddl_setup. SQL
Oracle GoldenGate DDL Replication setup script
Verifying that current user has privileges to install DDL Replication...
You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter Oracle GoldenGate schema name: ogg
Working, please wait...
Spooling to file ddl_setup_spool.txt
Checking for sessions that are holding locks on Oracle Golden Gate metadata tables...
Check complete.
Using OGG as a Oracle GoldenGate schema name.
Working, please wait...
DDL replication setup script. complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to OGG
CLEAR_TRACE STATUS:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
CREATE_TRACE STATUS:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
TRACE_PUT_LINE STATUS:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
INITIAL_SETUP STATUS:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
Ddlversionspecific package status:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
Ddlreplication package status:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
Ddlreplication package body status:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
DDL IGNORE TABLE
-----------------------------------
OK
DDL IGNORE LOG TABLE
-----------------------------------
OK
Ddlaux package status:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
Ddlaux package body status:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
SYS. ddlctxinfo package status:
Line/pos Error
-------------------------------------------------------------------------------------
No errors
SYS. ddlctxinfo package body status:
Line/pos Error
-------------------------------------------------------------------------------------
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
DDL TRIGGER INSTALL STATUS
-----------------------------------
OK
DDL TRIGGER RUNNING STATUS
----------------------------------------------------------------------
ENABLED
STAYMETADATA IN TRIGGER
----------------------------------------------------------------------
OFF
DDL TRIGGER SQL TRACING
----------------------------------------------------------------------
0
DDL TRIGGER TRACE LEVEL
----------------------------------------------------------------------
0
LOCATION OF DDL TRACE FILE
Bytes ------------------------------------------------------------------------------------------------------------------------
/Oracle/diag/rdbms/ora11/ora11/trace/ggs_ddl_trace.log
Analyzing installation status...
STATUS OF DDL REPLICATION
Bytes ------------------------------------------------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components
Script. complete.
SQL>
6. Run role_setup. SQL.
The script. drops and creates the role that is needed for DDL synchronization, and it grants DML permissions on
The Oracle GoldenGate DDL objects.
SQL> @ role_setup. SQL.
GGS Role setup script
This script. will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script. and then edit the params. SQL script. to change the gg_role parameter to the preferred name. (Do not run the script .)
You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.
Enter GoldenGate schema name: ogg
Wrote file role_setup_set.txt
PL/SQL procedure successfully completed.
Role setup script. complete
Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:
GRANT GGS_GGSUSER_ROLE TO <loggedUser>
Where <loggedUser> is the user assigned to the GoldenGate processes.
SQL>
7. Grant the role that was created (default name is GGS_GGSUSER_ROLE to all Oracle GoldenGate Extract users.
SQL> Grant GGS_GGSUSER_ROLE to ogg;
Grant succeeded.
SQL>