oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含6005字,纯文字阅读大概需要9分钟。
内容图文
![oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle](/upload/InfoBanner/zyjiaocheng/908/487187340dcc4c5a9d45958f19f795b8.jpg)
--新增inset测试
--dept 表结构orcl,ogg都存在,数据相同(但是rep1配置文件没有添加)
SCOTT@ orcl >insert into dept values(1,'hongquan','BBA'); 1 row created. SCOTT@ orcl >commit; Commit complete. SCOTT@ orcl >select * from dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON 1 hongquan BBA
ogg端
由于rep1参数文件没有配置dept的map所以ogg不会有数据
2019-06-20 15:55:51 INFO OGG-03035 Operating system character set identified as UTF-8. Locale: en_US, LC_ALL:. REPLICAT rep1 SETENV (NLS_LANG=AMERICAN_AMERICA.AL32UTF8) Set environment variable (NLS_LANG=AMERICAN_AMERICA.AL32UTF8) USERID ogg, PASSWORD *** HANDLECOLLISIONS ASSUMETARGETDEFS DISCARDFILE ./dirrpt/rep1.dsc, PURGE MAP scott.emp_ogg, TARGET scott.emp_ogg; MAP scott.dept_ogg, TARGET scott.dept_ogg;
更新rep1参数文件,添加
MAP scott.dept, TARGET scott.dept; GGSCI (ogg) 37> stop rep1 GGSCI (ogg) 38> edit param rep1 GGSCI (ogg) 41> delete rep1 GGSCI (ogg) 44> add REPLICAT rep1,exttrail ./dirdat/t1,checkpointtable ogg.ggschkpt GGSCI (ogg) 45> start rep1 ogg端发现新插入的数据 SCOTT@ ogg >/ DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON 1 hongquan BBA 5 rows selected. 修改orcl端配置 GGSCI (DSI) 17> stop rep1 GGSCI (DSI) 18> edit param rep1 GGSCI (DSI) 19> start rep1 ogg端插入测试 SCOTT@ ogg >insert into dept values(2,'hongquan','ogg'); 1 row created. SCOTT@ ogg >commit; Commit complete. SCOTT@ ogg >select * from dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON 2 hongquan ogg 1 hongquan BBA 6 rows selected. 已经同步 SCOTT@ orcl >select * from dept; DEPTNO DNAME LOC ---------- -------------- ------------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON 2 hongquan ogg 1 hongquan BBA 6 rows selected.
2 更改表结构测试
SCOTT@ orcl >alter table emp_ogg add(ogg_t1 number); Table altered. SCOTT@ orcl >desc emp_ogg; Name Null? Type ----------------------------------------------------------------- -------- -------------------------------------------- EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SAL NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2) OGG_T1 NUMBER 已经同步 SCOTT@ ogg >desc emp_ogg; Name Null? Type ----------------------------------------------------------------- -------- -------------------------------------------- EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10) JOB VARCHAR2(9) MGR NUMBER(4) HIREDATE DATE SAL NUMBER(7,2) COMM NUMBER(7,2) DEPTNO NUMBER(2) OGG_T1 NUMBER
3 新增加表结构
--新增加表结构 SCOTT@ orcl >create table test_ogg(id number,name varchar2(20),create_time date default sysdate); Table created. SCOTT@ orcl >alter table test_ogg add constraint PK_test_ogg primary key (id); Table altered.
--orcl > DBLOGIN USERID ogg, PASSWORD ogg > add trandata scott.test_ogg > INFO TRANDATA scott.test_ogg > stop ext1 > edit param ext1 TABLE scott.TEST_OGG; > stop pump1 > edit param pump1 TABLE scott.TEST_OGG; > start ext1 > start pump1 > stop repl > edit param rep1 MAP scott.TEST_OGG, TARGET scott.TEST_OGG; > start rep1
orcl端操作详细
![oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle - 文章图片](/upload/getfiles/0001/2021/5/9/20210509032543313.jpg)
![oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle - 文章图片](/upload/getfiles/0001/2021/5/9/20210509032543326.jpg)
GGSCI (DSI) 21> DBLOGIN USERID ogg, PASSWORD ogg Successfully logged into database. GGSCI (DSI) 22> add trandata scott.test_ogg Logging of supplemental redo data enabled for table SCOTT.TEST_OGG. GGSCI (DSI) 23> INFO TRANDATA scott.test_ogg Logging of supplemental redo log data is enabled for table SCOTT.TEST_OGG. Columns supplementally logged for table SCOTT.TEST_OGG: ID. GGSCI (DSI) 24> stop ext1 Sending STOP request to EXTRACT EXT1 ... Request processed. GGSCI (DSI) 25> edit param ext1 GGSCI (DSI) 26> start ext1 Sending START request to MANAGER ... EXTRACT EXT1 starting GGSCI (DSI) 27> stop pump1 Sending STOP request to EXTRACT PUMP1 ... Request processed. GGSCI (DSI) 28> edit param pump1 GGSCI (DSI) 29> stop rep1 Sending STOP request to REPLICAT REP1 ... Request processed. GGSCI (DSI) 30> edit param rep1 GGSCI (DSI) 31> start pump1 Sending START request to MANAGER ... EXTRACT PUMP1 starting GGSCI (DSI) 32> start rep1 Sending START request to MANAGER ... REPLICAT REP1 starting GGSCI (DSI) 33> info all Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING EXTRACT RUNNING EXT1 00:00:00 00:00:00 EXTRACT RUNNING PUMP1 00:00:00 00:00:10 REPLICAT RUNNING REP1 00:00:00 00:00:09View Code
在ogg端添加trandata log之前,要先创建表,不然会报错
2019-06-20 17:15:04 WARNING OGG-00869 No unique key is defined for table 'TEST_OGG'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
insert测试
SCOTT@ orcl >insert into test_ogg (id,name) values(1,'hq1'); 1 row created. SCOTT@ orcl >commit; Commit complete. SCOTT@ orcl >select * from test_ogg; ID NAME CREATE_TI ---------- -------------------- --------- 1 hq1 20-JUN-19 1 row selected.
ogg端
SCOTT@ ogg >select * from test_ogg; ID NAME CREATE_TI ---------- -------------------- --------- 1 hq1 20-JUN-19 1 row selected.
内容总结
以上是互联网集市为您收集整理的oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle全部内容,希望文章能够帮你解决oracle ogg 单实例双向-新增表,修改表结构(oracle-oracle所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。