版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xxzhaobb/article/details/83826215
之前有一环境配置了OGG,现在做测试,需要把之前的OGG相关信息干掉。
在删除ogg帐号的时候,发现提示有一些错误
SYS@test>drop user ggs cascade;
drop user ggs cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 2
ORA-20782: Oracle GoldenGate DDL Replication Error: Code :ORA-20782: Cannot
DROP object used in Oracle GoldenGate replication while trigger is enabled.
Consult Oracle GoldenGate documentation and/or call Oracle GoldenGate Technical
Support if you wish to do so., error stack: ORA-06512: at line 231
ORA-06512: at line 1030
非官方的解决方法
删除掉 触发器,
kill掉相关session
select owner,trigger_name,trigger_type,triggering_event,status from dba_triggers where trigger_name like '%OGG%'
SYS@test>drop user ggs cascade;
drop user ggs cascade
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-14452: attempt to create, alter or drop an index on temporary table already in use
-- kill
select 'alter system kill session '''||sid||','||serial#||'''' from v$session where sid in
(select sid from v$lock where id1 in
(select object_id from dba_objects where object_name in (select table_name from dba_tables where owner='GGS')));
通过以上方法,可以解决问题。但是有一个问题,当时在使用数据泵导入数据,居然把数据泵的session也kill掉了 。
官方的做法,参考MOS 1924642.1
Unable to drop GoldenGate user: ORA-20782: Cannot DROP object used in Oracle GoldenGate replication while trigger is enabled (文档 ID 1924642.1)
Solution
The ddl_remove and ddl_disable can be run from any version, only to install the trigger we need the correct version. We suggest that you download the latest 11.2.x version available for your environment, go to OGG Installation location and open SQL prompt and login as sysdba
1)@ddl_disable.sql
2)@ ddl_remove.sql
3)@marker_remove.sql
Now try deleting the user and remove the installed directory.
END