OGG中启用DDL支持

运行marker_setup.sql

[oracle@test ogg]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Wed Jun 6 10:12:52 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

@>conn / as sysdba
Connected.
SYS@test>@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:ggs


Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGS

MARKER TABLE
-------------------------------
OK

MARKER SEQUENCE
-------------------------------
OK

Script complete.
SYS@test>

@ddl_setup.sql .这里出错了 

SYS@test>@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:ggs

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 GGS 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 GGS

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
---------------------------------------- -----------------------------------------------------------------
1878/17                                  PL/SQL: SQL Statement ignored
1878/38                                  PL/SQL: ORA-00942: table or view does not exist
2811/25                                  PL/SQL: SQL Statement ignored
2811/46                                  PL/SQL: ORA-00942: table or view does not exist
2850/29                                  PL/SQL: SQL Statement ignored
2850/50                                  PL/SQL: ORA-00942: table or view does not exist
3009/17                                  PL/SQL: SQL Statement ignored
3009/38                                  PL/SQL: ORA-00942: table or view does not exist
3040/29                                  PL/SQL: SQL Statement ignored
3040/50                                  PL/SQL: ORA-00942: table or view does not exist
3258/33                                  PL/SQL: SQL Statement ignored

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
3258/54                                  PL/SQL: ORA-00942: table or view does not exist


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
-----------------------------------
FAILED: Table does not exist

DDL HISTORY TABLE(1)
-----------------------------------
FAILED: Table does not exist

DDL DUMP TABLES
-----------------------------------
FAILED: Table does not exist

DDL DUMP COLUMNS
-----------------------------------
FAILED: Table does not exist

DDL DUMP LOG GROUPS
-----------------------------------
FAILED: Table does not exist

DDL DUMP PARTITIONS
-----------------------------------
FAILED: Table does not exist

DDL DUMP PRIMARY KEYS
-----------------------------------
FAILED: Table does not exist

DDL SEQUENCE
-----------------------------------
FAILED: Sequence does not exist

GGS_TEMP_COLS
-----------------------------------
OK

GGS_TEMP_UK
-----------------------------------
OK

DDL TRIGGER CODE STATUS:

Line/pos                                 Error
---------------------------------------- -----------------------------------------------------------------
133/21                                   PL/SQL: ORA-02289: sequence does not exist
133/5                                    PL/SQL: SQL Statement ignored
992/25                                   PL/SQL: ORA-00942: table or view does not exist
992/4                                    PL/SQL: SQL Statement ignored


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
------------------------------------------------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/test/test/trace/ggs_ddl_trace.log

Analyzing installation status...


STATUS OF DDL REPLICATION
------------------------------------------------------------------------------------------------------------------------
ERRORS detected in installation of DDL Replication software components (6)

Script complete.

查看错误内容:

[root@test ~]# more /u01/app/oracle/diag/rdbms/test/test/trace/ggs_ddl_trace.log
SESS 4294967295-2018-06-06 10:14:17 : DDL : Initial setup starting
SESS 4294967295-2018-06-06 10:14:17 : DDL : Creating DDL sequence: :ORA-01031: i
nsufficient privileges
SESS 4294967295-2018-06-06 10:14:17 : DDL : initial_setup: :ORA-01031: insuffici
ent privileges
SESS 4294967295-2018-06-06 10:14:17 : DDL : STARTING DDL REPLICATION SETUP
SESS 4294967295-2018-06-06 10:14:18 : DDL : Instantiating new DDL replication pa
ckage
[root@test ~]#

解决方法:

GRANT CREATE TABLE,CREATE SEQUENCE TO OGG;
权限配置以后.要重新执行
SQL>@ddl_setup
SQL>@role_setup
SQL> grant GGS_GGSUSER_ROLE to ogg;
SQL>@ddl_enable
SYS@test>grant create table to ggs;
grant create table to ggs
*
ERROR at line 1:
ORA-04098: trigger 'SYS.GGS_DDL_TRIGGER_BEFORE' is invalid and failed re-validation


SYS@test>drop trigger SYS.GGS_DDL_TRIGGER_BEFORE;

Trigger dropped.

SYS@test>grant create table,create sequence to ggs;

Grant succeeded.

SYS@test>@ddl_setup.sql


SYS@test>@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:ggs
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.
SYS@test>grant ggs_ggsuser_role to ggs;

Grant succeeded.

SYS@test>


SYS@test>@ddl_enable.sql

Trigger altered.

SYS@test>

补充,强制删除ogg进程,加上! 即可。

GGSCI (test02) 9> delete replicat repdb1
ERROR: Could not delete DB checkpoint for REPLICAT REPDB1 (OCI Error ORA-00942:                                                                              table or view does not exist (status = 942). Deleting from checkpoint table ggs.                                                                             checkpoint, group 'REPDB1', key 909832057 (0x363aef79), SQL <DELETE FROM ggs.che                                                                             ckpoint  WHERE group_name = 'REPDB1' AND        group_key  = 909832057>).


GGSCI (test02) 10> delete replicat repdb1!
WARNING: Could not delete DB checkpoint for REPLICAT REPDB1 (OCI Error ORA-00942                                                                             : table or view does not exist (status = 942). Deleting from checkpoint table gg                                                                             s.checkpoint, group 'REPDB1', key 909832057 (0x363aef79), SQL <DELETE FROM ggs.c                                                                             heckpoint  WHERE group_name = 'REPDB1' AND        group_key  = 909832057>).


GGSCI (test02) 11> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED

END。

猜你喜欢

转载自blog.csdn.net/xxzhaobb/article/details/80596281
ogg