对于仅有dml同步的goldengate进程,如果源端进行ddl加字段操作,如何处理对应的进程
--实验:对于仅有dml同步的goldengate进程,如果源端进行ddl加字段操作,如何处理对应的进程
--源端orcl
--首先检查进程状态,running状态:
[Oracle@localhost ogg]$ ./ggsci
GGSCI (localhost.localdomain) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPUMP1 00:00:00 00:00:08
EXTRACT RUNNING EXT1 00:00:00 00:00:06
--停止抽取进程及传输进程:
GGSCI (localhost.localdomain) 2> stop *
Sending STOP request to EXTRACT DPUMP1 ...
Request processed.
Sending STOP request to EXTRACT EXT1 ...
Request processed.
GGSCI (localhost.localdomain) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT STOPPED DPUMP1 00:00:00 00:00:11
EXTRACT STOPPED EXT1 00:00:00 00:00:09
--目标端orcltest
--确认复制进程状态为running,,并停掉进程:
GGSCI (localhost.localdomain) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REP1 00:00:00 00:00:06
GGSCI (localhost.localdomain) 9> stop *
Sending STOP request to REPLICAT REP1 ...
Request processed.
--源端orcl
--对同步的表添加一个字段
[oracle@localhost ogg]$ sqlplus / as sysdba
SQL> alter table ggs.test add new_col varchar2(10);
Table altered.
SQL> exit
--目标端orcltest
--同样添加字段:
[oracle@localhost ogg]$ sqlplus / as sysdba
SQL> alter table ggs.test add new_col varchar2(10);
Table altered.
SQL> exit
--源端orcl
--启动抽取,传输进程
[oracle@localhost ogg]$ ./ggsci
GGSCI (localhost.localdomain) 2> start *
Sending START request to MANAGER ...
EXTRACT DPUMP1 starting
Sending START request to MANAGER ...
EXTRACT EXT1 starting
GGSCI (localhost.localdomain) 4> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING DPUMP1 00:40:12 00:00:04
EXTRACT RUNNING EXT1 00:02:55 00:00:08
--目标端orcltest
--启动复制进程
[oracle@localhost ogg]$ ./ggsci
GGSCI (localhost.localdomain) 2> start *
Sending START request to MANAGER ...
REPLICAT REP1 starting
GGSCI (localhost.localdomain) 5> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
REPLICAT RUNNING REP1 00:00:00 00:00:01
--源端orcl
--进行数据修改测试
[oracle@localhost ~]$ sqlplus / as sysdba
SQL> select count(*) from ggs.test;
COUNT(*)
----------
33
SQL> delete from ggs.test where rownum
4 rows deleted.
SQL> commit;
Commit complete.
SQL> insert into ggs.test (username,user_id,account_status,default_tablespace,temporary_tablespace,created,profile,new_col)
values ('a','7','open','one','temp',sysdate,'default','test'); 2
1 row created.
SQL> commit;
Commit complete.
SQL>
--目标端orcltest
--对应的测试结果:结果正确,说明同步进程是正常的
SQL> select count(1) from ggs.test;
COUNT(1)
----------
29
SQL> select count(*) from ggs.test;
COUNT(*)
----------
30
SQL> exit
实验结论:对于正常进行的dml复制进程,如果目标表需要加字段,通过停止进程,源端目标端同时进行ddl操作,
然后重新启动进程就可以了,复制进程会正常进行。
本文永久更新链接地址:

mySqlStringTypesimpactStorageAndPerformanCeaseAsfollows:1)長度,始終使用theSamestoragespace,whatcanbefasterbutlessspace-felfficity.2)varCharisvariable varcharisvariable length,morespace-morespace-morespace-effficitybuteftife buteftife butfority butfority textifforlyslower.3)

mysqlStringTypesIncludeVarChar,文本,char,Enum和set.1)varCharisVersAtileForvariable-lengthStringStringSuptoPuptOuptoPepePecifiedLimit.2)textisidealforlargetStortStorStoverStoverStorageWithoutAutAdefinedLength.3)charlisfixed-lenftenge,for forConsistentDatalikeCodes.4)

MySQLoffersvariousstringdatatypes:1)CHARforfixed-lengthstrings,2)VARCHARforvariable-lengthtext,3)BINARYandVARBINARYforbinarydata,4)BLOBandTEXTforlargedata,and5)ENUMandSETforcontrolledinput.Eachtypehasspecificusesandperformancecharacteristics,sochoose

TograntpermissionstonewMySQLusers,followthesesteps:1)AccessMySQLasauserwithsufficientprivileges,2)CreateanewuserwiththeCREATEUSERcommand,3)UsetheGRANTcommandtospecifypermissionslikeSELECT,INSERT,UPDATE,orALLPRIVILEGESonspecificdatabasesortables,and4)

toadduserInmysqleffect和securly,跟隨台詞:1)USEtheCreateUserStattoDaneWuser,指定thehostandastrongpassword.2)GrantNecterAryAryaryPrivilegesSustherthing privilegesgeStatement,usifementStatement,adheringtotheprinciplelastprefilegege.3)

toaddanewuserwithcomplexpermissionsinmysql,loldtheSesteps:1)創建eTheEserWithCreateuser'newuser'newuser'@''localhost'Indedify'pa ssword';。 2)GrantreadAccesstoalltablesin'mydatabase'withGrantSelectOnMyDatabase.to'newuser'@'localhost';。 3)GrantWriteAccessto'

MySQL中的字符串數據類型包括CHAR、VARCHAR、BINARY、VARBINARY、BLOB、TEXT,排序規則(Collations)決定了字符串的比較和排序方式。 1.CHAR適合固定長度字符串,VARCHAR適合可變長度字符串。 2.BINARY和VARBINARY用於二進制數據,BLOB和TEXT用於大對像數據。 3.排序規則如utf8mb4_unicode_ci忽略大小寫,適合用戶名;utf8mb4_bin區分大小寫,適合需要精確比較的字段。

最佳的MySQLVARCHAR列長度選擇應基於數據分析、考慮未來增長、評估性能影響及字符集需求。 1)分析數據以確定典型長度;2)預留未來擴展空間;3)注意大長度對性能的影響;4)考慮字符集對存儲的影響。通過這些步驟,可以優化數據庫的效率和擴展性。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

PhpStorm Mac 版本
最新(2018.2.1 )專業的PHP整合開發工具

Dreamweaver CS6
視覺化網頁開發工具

記事本++7.3.1
好用且免費的程式碼編輯器