您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“安裝oracle數(shù)據(jù)庫以及解壓安裝glodengate軟件的步驟”的有關(guān)知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細閱讀,能夠?qū)W有所成!
源 和 目標 環(huán)境都如下:
(1) 數(shù)據(jù)庫
(2)監(jiān)聽
(3) TNSNAME 文件配置
tnsname.ora 文件內(nèi)容,后面很多配置基于這個配置:
##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用戶執(zhí)行
(1) 創(chuàng)建安裝目錄:
(創(chuàng)建源端安裝目錄)
mkdir -p /u01/app/oracle/product/ogg_src
(創(chuàng)建目標端安裝目錄)
mkdir -p /u01/app/oracle/product/ogg_trg
(2) 修改oracle用戶環(huán)境變量
vim ~/.bash_profile
#添加如下內(nèi)容 (源和目標端的路徑不同,這里以源端為例): 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的容器數(shù)據(jù)庫環(huán)境下,需要在CDB庫下創(chuàng)建。
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環(huán)境中創(chuàng)建公共用戶,需要以C##或c##開頭,且PDB中不能用有剔除C##后相同的用戶名。
(2)賦權(quán)需要在CDB和PDB都要執(zhí)行
(3)如果需要指定表空間,必須在CDB和所有PDB中創(chuàng)建相同的表空間。不然會報如下錯誤。
Warning: PDB altered with errors.
有一點不明白:刪除了pdb里重復(fù)的用戶,重啟創(chuàng)建公共用戶,重啟系統(tǒng)后,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)查詢
--確認開啟數(shù)據(jù)庫級附加日志
SQL> select supplemental_log_data_min from v$database; SUPPLEMENTAL_LOG_DATA_MI ------------------------ YES
--確認已經(jīng)開啟歸檔
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 ##添加如下內(nèi)容: GGSCHEMA C##GOLDENGATE
連接CDB,注意test為用戶,t1為表名,后面以分好結(jié)尾。
容器數(shù)據(jù)庫必須是集成模式(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數(shù)據(jù)庫以及解壓安裝glodengate軟件的步驟”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。