1. 程式人生 > >刪除OGG使用者的時候,提示ORA-00604,ORA-20782,ORA-06512等錯誤

刪除OGG使用者的時候,提示ORA-00604,ORA-20782,ORA-06512等錯誤

之前有一環境配置了OGG,現在做測試,需要把之前的OGG相關資訊幹掉。

在刪除ogg帳號的時候,發現提示有一些錯誤

[email protected]>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%'
[email protected]>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