首页 > 数据库 > Oracle > Linux下卸载GoldenGate
1 打开终端,进入GoldenGate安装目录
$ cd /u01/ogg
2 进入GoldenGate环境
$ ./ggsci
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (localhost) 1>
3 停止所有的管理、抽取、复制进程
GGSCI (localhost) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED EXT_L 00:00:00 00:23:49
REPLICAT STOPPED REP_L 00:00:00 00:23:52
GGSCI (localhost) 2>
上图表示三个进程都已经停止了。
假如有进程还处于running状态,则可用stop命令来停止。
例子:stop ext_l,stop rep_l, stop mgr
4 退出GoldenGate环境
GGSCI (localhost) 2> exit
[oracle@localhost ogg]$
5 运行SQL*Plus,并用具有SYSDBA权限的用户登录
[oracle@localhost ogg]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on 星期三 7月 29 11:28:14 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
6 断开产生过DDL的所有会话,包括GoldenGate进程、SQL*Plus、业务应用、以及其他任何使用Oracle的软件。否则数据库可能会报ORA-04021的错误
7 运行ddl_disabl.sql脚本来禁用DDL触发器
SQL> @ddl_disable
触发器已更改
SQL>
8 运行ddl_remove.sql脚本来移除GoldenGate DDL触发器、DDL历史和标记表以及其他相关的对象。这个脚本会生成一个ddl_remove_spool.txt文件,记录了脚本的输出,还有一个ddl_remove_set.txt文件,记录了当前的用户环境设置,以防debug之用。
SQL> @ddl_remove
DDL replication removal script.
WARNING: this script removes all DDL replication objects and data.
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.
Enter Oracle GoldenGate schema name:ogg
Working, please wait ...
Spooling to file ddl_remove_spool.txt
Script complete.
SQL>
9 运行marker_remove.sql脚本来移除GoldenGate marker支持系统。这个脚本生成一个marker_remove_spool.txt和marker_remove_set.txt文件,作用和上面的相同
SQL> @ddl_remove
DDL replication removal script.
WARNING: this script removes all DDL replication objects and data.
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.
Enter Oracle GoldenGate schema name:ogg
Working, please wait ...
Spooling to file ddl_remove_spool.txt
Script complete.
SQL> @marker_remove
Marker removal script.
WARNING: this script removes all marker objects and data.
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.
Enter Oracle GoldenGate schema name:ogg
PL/SQL 过程已成功完成。
序列已删除。
表已删除。
Script complete.
SQL>
10 删除GoldenGate用户
SQL> drop user ogg cascade;
用户已删除。
SQL>
11 删除ogg目录
SQL> exit
[oracle@localhost ogg]$ cd ..
[oracle@localhost u01]$ remove -rf ogg
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29485627/viewspace-1784358/ ,如需转载,请注明出处,否则将追究法律责任。