http://iotn.co.kr 연락처: gilho.kr@gmail.com [ The Japanese government should apologize to Japanese Military Sexual Slavery victim. / 日本政府は日本軍の性的奴隷?牲者に謝罪すべき. ]

사용자

ID:
PW:

INDEX
01.게시판
게시판 [69]
02.File Book
File 자료실 [95]
Site Link [18]
개인폴더 [194]
03.Field Book
Altibase [19]
Tibero [30]
MS-SQL [18]
MySQL [40]
DB2 [79]
ORACLE [2888]
PostgreSQL [103]
기타정보 [150]
운영체제 [577]
04.Q/A Book
Q/A [53]
05.방명록
방명록 [54]
레벨업 [37]
구인/구직 [2]

기념일
Search
LINK
+ 가족 Hompy
+ DNSEver
IOTN :: Field Book :: Altibase

 회원가입

altibase replication test
최길호 [LIST]   2016-11-17 12:41:53, 조회 : 1,846

grep PORT $ALTIBASE_HOME/conf/altibase.properties
PORT_NO                = 20300
REPLICATION_PORT_NO    = 20301
//
PORT_NO                = 22300
REPLICATION_PORT_NO    = 22301

select count(*) from v$statement where execute_flag = 1;    # 수행 중인 statement

select name from v$datafiles;
create tablespace tester1 datafile '/home/altibase/data/tester1.dbf' size 10m
autoextend on next 20m maxsize unlimited;

create user tester1 identified by pwd default tablespace tester1;

connect tester1/pwd
create table tester1.test1 ( i1 integer primary key, i2 char(10));

drop replication rep
-- node1
create replication rep with '192.168.20.5',22301 from tester1.test1 to tester1.test1;
-- node2
create replication rep with '192.168.20.5',20301 from tester1.test1 to tester1.test1;

insert into tester1.test1 select level,level from dual connect by level <=100;
insert into tester1.test1 select level,level from dual where level > 100 connect by level <=150;
select count(1) from tester1.test1 ;

// 서비스 test:  node2 down / node1 data insert / node2 start [ 자동적용 ] / 확인
node2$ server stop [ 중지 ]
node1> delete tester1.test1 ; [ rollback 안됨 [default] , 옵션주면 가능할지도 ]
node1> insert into tester1.test1 select level,level from dual connect by level <=100;
node2$ server start [ 자동 적용 ]

// 컬럼 변경
node1,node2>
alter replication rep stop;
alter replication rep drop table from tester1.test1 to tester1.test1;
alter system set REPLICATION_DDL_ENABLE=1;
alter table tester1.test1 add column ( i3 varchar(10));
alter system set REPLICATION_DDL_ENABLE=0;
alter replication rep add table from tester1.test1 to tester1.test1;
<<완료>>
// 진행중 에러
alter table tester1.test1 add column ( i3 varchar(10));
[ERR-312C4 : Cannot execute this DDL on a replicated table when the system property REPLICATION_DDL_ENABLE is 0.]
>> alter system set REPLICATION_DDL_ENABLE=1;
iSQL> alter replication rep drop table from tester1.test1 to tester1.test1;
[ERR-6106F : You cannot drop only one replicated table.]
>> create table sys.rep1 (id integer primary key );
>> alter replication rep add table from sys.rep1 to sys.rep1;

// 추가 변경
alter replication rep stop
alter replication rep add host 'ip','port';

// 관련 정보 확인
select * from v$repreceiver;
select * from v$repsender;
select * from system_.SYS_REPLICATIONS_ ;
SELECT rep_name, rep_gap FROM v$repgap;
select replication_name||': '||local_user_name||'.'||local_table_name from system_.sys_repl_items_ order by replication_name;



// insert conflict test
tail -f $ALTIBASE_HOME/trc/altibase_rp.log
node1,node2>
alter replication rep stop;
node1> insert into tester1.test1 values(1000,'node1');
node2> insert into tester1.test1 values(1000,'node2');
alter replication rep start;
select * from tester1.test1 where i1=1000;
node1: i1=1000 ,i2=node1
node2: i1=1000 ,i2=node2
delete tester1.test1 where i1=1000;
//
// test with replication_insert_replace=1
alter system set replication_insert_replace=1;
>> [ 먼저 실행한게 sync 또는 서로 바뀌기도한다.]
node1: i1=1000 ,i2=node2
node2: i1=1000 ,i2=node1

// delete conflict test
node1>
insert into tester1.test1 values(10,'test');
alter session set replication=false;
insert into tester1.test1 values(1000,'node1');
node2>
alter session set replication=true;
delete from tester1.test1 ;

// update conflict test
node1>
alter session set replication=false;
insert into tester1.test1 values(1000,'node1');
node2>
alter session set replication=false;
insert into tester1.test1 values(1000,'node2');
node1>
alter session set replication=true;
update tester1.test1 set i2='test' where i1=1000;
>> node2 반영되지 않는다.
>> node2$ $ALTIBASE_HOME/trc/altibase_rp.log
>> [2016/11/22 17:40:54] [Thread-1096284480] [Level-2]
>> ERR-61035(errno=0) [Receiver] An update conflict occurred.
>> [2016/11/22 17:40:54] [Thread-1096284480] [Level-3]
>> UPDATE TESTER1.TEST1 SET I2 = test       WHERE I1 = 1000;

iSQL> alter replication rep sync;
[ERR-6100D : [Sender] Failed to handshake with the peer server (Handshake Process Error)]
=> ip,port check

[ERR-311B1 : The user must have CREATE_ANY_TABLE privilege(s) to execute this statement.]
=> alter user tester1 access tester1 on;

iSQL> drop table tester1.test1;
[ERR-3103F : No DDL statement may be executed on a replicated table.]
iSQL> create replication rep with '127.0.0.1',22301 from tester1.test1 to tester1.test1;
[ERR-31088 : A replicated table must have a primary key. (TESTER1.TEST1)]

http://support.altibase.com/kr/faq-view?no=163
http://a07274.tistory.com/89
3.235.78.122


  LIST

제목 작성자 작성일 조회
Admin  dbf 위치 확인 / 삭제 / create database [$ server create MS949 UTF8 ] / 서비스 시작    최길호 2020/10/08 262
Troubleshoot  [FAILURE] Unable to invoke the open() function on [/home/altibase/altibase-HDB-server-6.1.1-2/logs/logfile100]    최길호 2020/10/07 343
Admin  주소 iloader in [ csv data import ]    최길호 2020/10/07 271
Admin  altibase replication test    최길호 2016/11/17 1846
Backup & Recovery  hot backup script [ alter database backup database to '/backup/'; ]    최길호 2016/10/02 1181
Admin  -- 모든 테이블    최길호 2016/10/02 1092
Admin  [ERR-110A4 : Backup in progress. Please wait until the current backup is completed.]    최길호 2016/10/02 746
Admin  Sybase IQ 15.2 evaluation software    최길호 2013/08/21 2875
Admin  alter database rename datafile    최길호 2013/07/27 4149
Backup & Recovery  aexport lv:9   최길호 2013/07/22 1346
Admin  alter tablespace ts_disk1 alter datafile '/altibase/6.1/dbs/tbs_disk1_200.dbf' autoextend on next 200m maxsize unlimited;    최길호 2013/04/13 2784
Troubleshoot  [FAILURE] The data file '/altibase/6.1/dbs/SYS_TBS_MEM_DIC-0-0' has an invalid header. lv:9   최길호 2013/04/11 1382
Troubleshoot  oracle to altibase data type 호환     최길호 2013/04/05 2892
Admin  getdata.sql [ 오라클, 알티베이스 마이그레이션 내용 ] lv:9   최길호 2013/04/05 1299
Admin  http://support.altibase.com/kr/manual [ NLS_DATE_FORMAT = altibase.properties:DEFAULT_DATE_FORMAT ]    최길호 2013/04/04 13604
Admin  altibase 교육 자료 lv:4   최길호 2013/04/03 1496

    목록보기 1
       

Copyright 1999-2022 Zeroboard / skin by 최길호(gilho.kr@gmail.com)
최근 댓글
최근 게시물
06/29
[ORACLE]
DDE: Problem Key 'ORA 600 [133....
by 최길호
06/25
[ORACLE]
Replication may not be valid i....
by 최길호
06/22
[운영체제]
CentOS7 홈페이지 Migration 메모.
by 최길호