本附录包含安装对象的说明,这些对象支持Oracle GoldenGate DDL支持的基于触发器的方法。
要配置Oracle GoldenGate来捕获和复制DDL, see Configuring DDL Support.
Note:
DDL对序列(创建、修改、删除、重命名)的支持与复制序列值本身兼容,但不是必需的。要复制序列值,不需要安装Oracle GoldenGate DDL支持环境。您可以只在提取配置中使用序列参数。
Topics:
This topic describes the configuration where you must use trigger-based DDL Extract.
You must use trigger-based DDL capture when Extract will operate in the following configurations:
Extract operates in classic capture mode against any version of Oracle Database.
Extract operates in integrated mode against an Oracle Database version 11.2.0.3 or earlier.
If Extract will run in integrated mode against a version 11.2.0.4 or later Oracle Database, the DDL trigger is not required. By default, DDL capture is handled transparently through the database logmining server.
If Extract will capture from a multitenant container database, integrated capture mode must be used with the native DDL capture method.
See Choosing Capture and Apply Modes for more information about capture modes.
See Configuring DDL Support for more information about configuring DDL support.
Parent topic: Installing Trigger-Based DDL Capture
This topic lists the requirements for installing Oracle GoldenGate trigger-based DDL environment.
To install the Oracle GoldenGate trigger-based DDL environment, you will be installing the database objects listed in the following table.
Object | Purpose | Default name |
---|---|---|
DDL marker table |
Stores DDL information. This table only receives inserts. |
|
Sequence on marker table |
Used for a column in the marker table. |
|
DDL history table |
Stores object metadata history. This table receives inserts, updates, deletes. |
|
Object ID history table |
Contains object IDs of configured objects. |
|
DDL trigger |
Fires on DDL operations. Writes information about the operation to the marker and history tables. Installed with the trigger are some packages. |
|
DDL schema |
Contains the DDL synchronization objects. |
None; must be specified during installation and in the |
User role |
Establishes the role needed to execute DDL operations. |
|
Internal setup table |
Database table for internal use only. |
|
|
Pins DDL tracing, the DDL package, and the DDL trigger for performance improvements. |
|
|
Removes the DDL trace file. |
|
|
Verifies that the Oracle GoldenGate DDL objects are installed |
|
|
Verifies that the marker table is installed. |
|
|
Sets the level for DDL tracing. |
|
Parent topic: Installing Trigger-Based DDL Capture
To install DDL objects, you need scripts to perform various tasks during the installation.
These scripts are located in the installation directory of Oracle GoldenGate Microservices Architecture. The specific location is: oggma_install_home/lib/sql/legacy
.
Follow these steps to install the database objects that support Oracle GoldenGate DDL capture.
Note:
When using Extract in classic mode to capture in an Active Data Guard environment, the DDL objects must be installed on the source database, not the standby.
GRANT EXECUTE ON utl_file TO schema;
AUTOEXTEND
to ON
for the DDL tablespace, and size it to accommodate the growth of the GGS_DDL_HIST
and GGS_MARKER
tables. The GGS_DDL_HIST
table, in particular, will grow in proportion to overall DDL activity.params.sql
script and set the ddl_fire_error_in_trigger
parameter to TRUE
. Extract cannot capture DDL if the tablespace fills up, so stopping the DDL gives you time to extend the tablespace size and prevent the loss of DDL capture. Managing tablespace sizing this way, however, requires frequent monitoring of the business applications and Extract to avoid business disruptions. As a best practice, make certain to size the tablespace appropriately in the first place, and set AUTOEXTEND
to ON
so that the tablespace does not fill up. WARNING:
Make a backup of the params.sql
script before you edit it to preserve its original state.
GLOBALS
file (or edit it, if one exists). EDIT PARAMS ./GLOBALS
Note:
EDIT PARAMS
creates a simple text file. When you save the file after EDIT PARAMS
, it is saved with the name GLOBALS
in upper case, without a file extension, at the root of the Oracle GoldenGate directory. Do not alter the file name or location.
GLOBALS
file, specify the name of the DDL schema by adding the following parameter to the GLOBALS
file. GGSCHEMA schema_name
Record all name changes in the params.sql
script. Edit this script and change the appropriate parameters. Do not run this script.
List the names shown in Table D-1 in the GLOBALS
file. The correct parameters to use are listed in the Parameter column of the table.
Table D-1 GLOBALS Parameters for Changing DDL Object Names
Object | Parameter |
---|---|
Marker table |
|
History table |
|
Footnote 1
Do not qualify the name of any of these tables. The schema name for these table must be either the one that is specified with GGSCHEMA
or the schema of the current user, if GGSCHEMA
is not specified in GLOBALS
.
TRUE
in the params.sql
script: define allow_invisible_index_keys = 'TRUE'
GLOBALS
file and the params.sql
file.SYSDBA
privilege. This privilege is required to install the DDL trigger in the SYS
schema, which is required by Oracle. All other DDL objects are installed in the schema that you created in 1.marker_setup.sql
script. Supply the name of the Oracle GoldenGate schema when prompted, and then press Enter to execute the script. The script installs support for the Oracle GoldenGate DDL marker system. @marker_setup.sql
ddl_setup.sql
script. You are prompted to specify the name of the DDL schema that you configured in 1. (Note: ddl_setup.sql
will fail if the tablespace for this schema is shared by any other users. It will not fail, however, if the default tablespace does not have AUTOEXTEND
set to ON
, the recommended setting.) @ddl_setup.sql
role_setup.sql
script. At the prompt, supply the DDL schema name. The script drops and creates the role that is needed for DDL synchronization, and it grants DML permissions on the Oracle GoldenGate DDL objects. @role_setup.sql
GGS_GGSUSER_ROLE
) to all Oracle GoldenGate Extract users. You may need to make multiple grants if the processes have different user names. GRANT role TO user;
ddl_enable.sql
script to enable the DDL trigger. @ddl_enable.sql
To Install and Use the Optional Performance Tool
To improve the performance of the DDL trigger, make the ddl_pin
script part of the database startup. It must be invoked with the Oracle GoldenGate DDL user name, as in:
@ddl_pin DDL_user
This script pins the PL/SQL package that is used by the trigger into memory. If executing this script from SQL*Plus, connect as SYSDBA
from the Oracle GoldenGate installation directory. This script relies on the Oracle dmbs_shared_pool
system package, so install that package before using ddl_pin
.
Parent topic: Installing Trigger-Based DDL Capture