Configuring Oracle GoldenGate DDL Replication Privileges for Zero‑Downtime Migration
0 reputation · 13 Apr 2021, 09:23 UTC
0 reputation · 13 Apr 2021, 09:23 UTC
Goal: Configure Oracle GoldenGate bidirectional replication so that DDL statements (CREATE, ALTER, DROP) are captured on the source and applied on the target throughout a zero‑downtime migration of a small OLTP application.
Uncertainty: The GGSCI user must hold the EXECUTE privilege on DBMS_GOLDENGATE_AUTH and the ALTER ANY TABLE system privilege to replicate DDL. Granting ALTER ANY TABLE expands the user’s ability to modify any schema object, which may conflict with least‑privilege policies and audit requirements. Alternatively, withholding the privilege requires manual application of DDL after cutover, introducing a window where source and target schemas can diverge.
Specific questions:
34775 reputation · 13 Apr 2021, 12:24 UTC
You do not need to grant ALTER ANY TABLE as a broad, standalone privilege to the GoldenGate user. The supported path is to grant the DDL-related system privileges individually and, more importantly, use Oracle's role-based grant procedure in DBMS_GOLDENGATE_AUTH (GRANT_ADMIN_PRIVILEGE), which gives the GoldenGate admin user the capture/apply rights it needs — including DDL handling — without handing it a generic DBA-style grant. If your security policy still forbids the ANY-object privileges, the fallback is to disable DDL replication and apply DDL manually during a frozen-change window; that trade-off is described below.
Assuming GoldenGate 12c or later (integrated capture/apply), create a dedicated user such as GGADMIN and:
CREATE USER ggadmin IDENTIFIED BY <strong_password> DEFAULT TABLESPACE gg_ts QUOTA UNLIMITED ON gg_ts;
GRANT CREATE SESSION TO ggadmin;
EXEC DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE('GGADMIN');GRANT_ADMIN_PRIVILEGE grants the capture/apply privileges through Oracle-managed roles rather than direct ANY grants, which is the least-privilege-friendly option Oracle documents. If you instead grant privileges directly, limit them to the DDL operations you actually replicate, e.g.:
GRANT ALTER ANY TABLE, CREATE ANY TABLE, DROP ANY TABLE,
ALTER ANY INDEX, CREATE ANY INDEX, DROP ANY INDEX,
ALTER ANY PROCEDURE, EXECUTE ANY PROCEDURE TO ggadmin;Do not grant DBA, UNLIMITED TABLESPACE at the database level, or EXECUTE ANY PROCEDURE unless procedure DDL is genuinely in scope. Enable supplemental logging before starting the extract:
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
-- in GGSCI, per schema:
ADD SCHEMATRANDATA hrThen configure DDL INCLUDE ALL (or scope it with DDL INCLUDE OBJNAME "hr.*") in both extract and replicat parameter files so only the application schema's DDL flows.
Granting ALTER ANY TABLE directly lets the account modify any table in any schema, which auditors typically flag because it bypasses schema ownership boundaries. Mitigations that are usually accepted: (1) use DBMS_GOLDENGATE_AUTH role-based grants instead of direct ANY grants; (2) enable unified auditing policies on the GGADMIN account so every DDL it issues is captured in UNIFIED_AUDIT_TRAIL; (3) scope DDL replication with DDL INCLUDE/EXCLUDE filters so the account's effective reach matches the migration scope; (4) expire or lock the account after cutover. The exact acceptability depends on your compliance framework (SOX, PCI, internal policy), so confirm with your security team — this is the one detail that can change the recommendation.
If you withhold DDL privileges and apply changes by hand after cutover:
ALTER causes replicat abends on the next DML touching that object.For a small OLTP app with a controlled release process, a documented change freeze plus manual DDL is defensible; for anything with frequent schema changes, replicate DDL with scoped privileges.
-- confirm grants
SELECT privilege FROM dba_sys_privs WHERE grantee = 'GGADMIN';
-- issue a test DDL on source, then in GGSCI:
INFO EXTRACT ext1, SHOWCH
INFO REPLICAT rep1, SHOWCHConfirm lag is near zero and the test object exists on the target. Check ggserr.log for DDL capture errors if the object does not appear.
Use comments to ask for clarification. Post a solution as an answer.
34,775 reputation · 13 Apr 2021, 14:40 UTC
While DBMS_GOLDENGATE_AUTH streamlines privilege assignment, it is important to consider how DDL replication interacts with object dependencies and constraints on the target database. Even with the correct privileges, DDL application can fail if the target environment has existing constraints or triggers that conflict with the incoming change.
DDLOPTIONS EXCLUDECONSTRAINT to prevent replication lags or failures during schema modifications.ARCHIVELOG mode and that the ENABLE GOLDENGATE_LOGMINER parameter is correctly configured, as privilege grants alone will not enable DDL capture if the logging infrastructure is missing.ANY privileges, query DBA_SYS_PRIVS for the GGADMIN user to document exactly which system privileges were granted by the Oracle-managed roles.