单机部署
服务器信息及软件版本:
(以下均为使用默认参数新建的实例操作)
#对比1.2.1.2参数情况
select archivelog_mode from v$archivelog;
select property_name ,property_value from v$property where property_name in (‘SUPPLEMENTAL_LOG_DATA_PRIMARY_KEY’,‘CLUSTER_ASYNC_COMMIT’,‘ARCHIVELOG_MODE’,‘DATA_STORE_MODE’);
如修改则增加或修改以下属性,修改后需重启sundb(重启时注意是否开启归档,参考1.2.1.3):
SUPPLEMENTAL_LOG_DATA_PRIMARY_KEY = YES
CLUSTER_ASYNC_COMMIT = NO
ARCHIVELOG_MODE = 1
DATA_STORE_MODE = 2
(需重启sundb,集群需mount后open { local | global } database)
shutdown abort
startup mount
alter database archivelog;
alter system open database;
create user cdc identified by cdc;
grant create session on database to cdc;
grant create object on tablespace mem_data_tbs to cdc;
grant create object on tablespace mem_temp_tbs to cdc;
grant create object on tablespace mem_undo_tbs to cdc;
grant control schema on schema cdc to cdc;
commit;
create user cdc01 identified by cdc01 without schema;
grant create session on database to cdc01;
grant select table on schema cdc to cdc01;
commit;
select username,user_id,account_status,default_tablespace,temporary_tablespace,index_tablespace,created from dba_users;
create table cdc.t1(col1 native_bigint primary key,col2 varchar(20));
create table cdc.t2(col1 native_bigint primary key,col2 varchar(20));
commit;
(开启附加日志配置后建的表,可忽略此操作)
ALTER TABLE cdc.t1 ADD SUPPLEMENTAL LOG DATA ( PRIMARY KEY ) COLUMNS;
ALTER TABLE cdc.t2 ADD SUPPLEMENTAL LOG DATA ( PRIMARY KEY ) COLUMNS;
select tablespace_name,table_schema||’.’||table_name as table_name,ceil(blocks*8192/) || ’ MB’ as table_size from all_all_tables where table_schema not in (‘DEFINITION_SCHEMA’,‘DICTIONARY_SCHEMA’) order by table_name;
cat ${SUNDB_DATA}/conf/cyfile.conf
cyfile --start #开启所有cyfile
cyfile --start --group g1 #开启g1的cyfile
cyfile --start --reset { all | table1,table2 } #开启并重置cyfile
connect cdc cdc
insert into cdc.t1(col1,col2) values (11,‘test1’),(12,‘test2’),(13,‘test3’);
insert into cdc.t2(col1,col2) values (21,‘test1’),(22,‘test2’),(23,‘test3’);
tail -200f /home/sundb01/dat/cyfile.G1_1.dat
insert into cdc.t1(col1,col2) values (14,‘test4’),(15,‘test5’),(16,‘test6’);
tail -200f /home/sundb01/dat/cyfile.G1_1.dat
版权声明:
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若内容造成侵权、违法违规、事实不符,请将相关资料发送至xkadmin@xkablog.com进行投诉反馈,一经查实,立即处理!
转载请注明出处,原文链接:https://www.xkablog.com/sjkxydsj/36724.html