您好,登录后才能下订单哦!
本篇内容介绍了“安装oracle数据库以及解压安装glodengate软件的步骤”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
源 和 目标 环境都如下:
(1) 数据库
(2)监听
(3) TNSNAME 文件配置
tnsname.ora 文件内容,后面很多配置基于这个配置:
##CDB YUNGG = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.180)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = yun) ) ) ##PDB YUNGGXC = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.180)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xiaochong) ) )
以下步骤,通过oracle用户执行
(1) 创建安装目录:
(创建源端安装目录)
mkdir -p /u01/app/oracle/product/ogg_src
(创建目标端安装目录)
mkdir -p /u01/app/oracle/product/ogg_trg
(2) 修改oracle用户环境变量
vim ~/.bash_profile
#添加如下内容 (源和目标端的路径不同,这里以源端为例): export OGG_HOME=/u01/app/oracle/product/ogg_src export PATH=$OGG_HOME:$PATH export LD_LIBRARY_PATH=$OGG_HOME:$LD_LIBRARY_PATH
使之生效:
source ~/.bash_profile
(3)解压安装包(root)
(4) 图形界面安装 (源端安装,目标直接拷贝安装好的文件目录即可)
将安装文件目录拷贝到目标端,这样目标端就可以免安装了
[oracle@yun@oggp:ogg_src]scp -r * oracle@192.168.56.180:/u01/app/oracle/product/ogg_trg/
(5)测试
登录GGSCI
此用户为glodengate管理用户,在12C的容器数据库环境下,需要在CDB库下创建。
create tablespace goldengate datafile size 8M autoextend on; create user c##goldengate identified by goldengate default tablespace goldengate; grant dba to c##goldengate; exec dbms_goldengate_auth.grant_admin_privilege('c##goldengate');
测试连接:
这里容易错误的地方:
(1)在CDB环境中创建公共用户,需要以C##或c##开头,且PDB中不能用有剔除C##后相同的用户名。
(2)赋权需要在CDB和PDB都要执行
(3)如果需要指定表空间,必须在CDB和所有PDB中创建相同的表空间。不然会报如下错误。
Warning: PDB altered with errors.
有一点不明白:删除了pdb里重复的用户,重启创建公共用户,重启系统后,pdb中公共用户失效。
如下: C##OGG 用户,而重新定义的用户C##OGGP是没有问题的
SQL> show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 XIAOCHONG READ WRITE NO SQL> select username,common,con_id from cdb_users where username like '%OGG%'; USERNAME COMMON CON_ID C##OGG YES 1 C##OGGP YES 1 C##OGGP YES 3 SQL> alter session set container=xiaochong; Session altered. SQL> select username,common,con_id from cdb_users where username like '%OGG%'; USERNAME COMMON CON_ID C##OGGP YES 3
(1)修改:
修改归档(略)
SQL> alter database force logging;
Database altered.
SQL> alter system set enable_goldengate_replication=true;
System altered.
---开启附加日志
SQL> alter database add supplemental log data;
Database altered.
(2)查询
--确认开启数据库级附加日志
SQL> select supplemental_log_data_min from v$database; SUPPLEMENTAL_LOG_DATA_MI ------------------------ YES
--确认已经开启归档
SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 52 Next log sequence to archive 54 Current log sequence 54
GGSCI (oggp) 1> edit param ./GLOBALS ##添加如下内容: GGSCHEMA C##GOLDENGATE
连接CDB,注意test为用户,t1为表名,后面以分好结尾。
容器数据库必须是集成模式(integrated)
将T表插入一条记录后,
GGSCI (oggp as C##goldengate@yun/CDB$ROOT) 18> stats ext exttest Sending STATS request to EXTRACT EXTTEST ... Start of Statistics at 2019-06-13 15:42:07. Output to ./dirdat/ex: Extracting from XIAOCHONG.TEST.T to XIAOCHONG.TEST.T: *** Total statistics since 2019-06-13 15:41:21 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00 *** Daily statistics since 2019-06-13 15:41:21 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00 *** Hourly statistics since 2019-06-13 15:41:21 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00 *** Latest statistics since 2019-06-13 15:41:21 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00
End of Statistics.
GGSCI (oggp) 6> stats ext dptest Sending STATS request to EXTRACT DPTEST ... Start of Statistics at 2019-06-13 16:01:46. Output to ./dirdat/dp: Extracting from XIAOCHONG.TEST.T to XIAOCHONG.TEST.T: *** Total statistics since 2019-06-13 15:57:31 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00 *** Daily statistics since 2019-06-13 15:57:31 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00 *** Hourly statistics since 2019-06-13 15:57:31 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00 *** Latest statistics since 2019-06-13 15:57:31 *** Total inserts 1.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 1.00 End of Statistics.
GGSCI (oggs as c##goldengate@yun/XIAOCHONG) 51> stats rep reptest Sending STATS request to REPLICAT REPTEST ... Start of Statistics at 2019-06-13 17:03:39. Replicating from XIAOCHONG.TEST.T to XIAOCHONG.TEST.T: *** Total statistics since 2019-06-13 17:03:35 *** Total inserts 2.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 2.00 *** Daily statistics since 2019-06-13 17:03:35 *** Total inserts 2.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 2.00 *** Hourly statistics since 2019-06-13 17:03:35 *** Total inserts 2.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 2.00 *** Latest statistics since 2019-06-13 17:03:35 *** Total inserts 2.00 Total updates 0.00 Total deletes 0.00 Total discards 0.00 Total operations 2.00 End of Statistics.
最终测试: 自行测试即可。
“安装oracle数据库以及解压安装glodengate软件的步骤”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。