golden gate同步的表結構修改檢查
-
問題
golden gate目標端檢查發現錯誤 ogg-01296
-
2.view report RORA_001找到錯誤ogg-01296對應的map表名
可以使用如下方式快速檢查
Tail -3000 RORA_001.rpt >> /tmp/ RORA_001.rpt
Cat /tmp/ RORA_001.rpt |grep -i OGG- 會出現ogg-01296錯誤
-
edit report RORA_001在對應的map語句加--註釋掉,啟動複製程式,一般沒有問題
-
如果修改的表比較多,可以使用指令碼檢查
檢查源端資料庫中修改了表結構的表,(LAST_DDL_TIME-CREATED)*24*60代表分鐘數
----------
cat /home/ogg/dirprm/eora_001.prm |grep -i table |awk '{print $2}'|cut -d ";" -f1 > /home/ogg/table_name.0517.txt
cat /dev/null > table_ddl_check.sql
cat >> table_ddl_check.sql <<EOF
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
col object_name for a20
set line 220
EOF
tabname=`cat table_name.0517.txt`
for tab in $tabname
do
echo "select owner,OBJECT_NAME,CREATED,LAST_DDL_TIME,(LAST_DDL_TIME-CREATED)*24*60 time_sicne_ddl from dba_objects where owner='`echo $tab|cut -d "." -f1`' and OBJECT_NAME='`echo $tab|cut -d "." -f2`' and (LAST_DDL_TIME-CREATED)*24*60>0;" >> table_ddl_check.sql
done
檢查結果
以上是修改了表結構的表,如果是重新建的表就沒法查了,目標端和源端表結構不一樣,同樣報0gg-01296錯誤
以下是檢視當天新建的表
檢視所有ogg源端配置中的使用者當日新建的表
建立測試表create table ggs.t0517(id number);
cat /home/ogg/dirprm/eora_001.prm |grep table |awk '{print $2}'|cut -d "," -f1 |cut -d "." -f1 >> /tmp/schema.txt --得到抽取程式表的所有schema
rm -f /tmp/1.sql
cat >>/tmp/1.sql <<EOF
alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
set line 220
col object_name for a20
EOF
schema=`cat /tmp/schema.txt|sort |uniq`
for user in $schema
do
echo "select owner,OBJECT_NAME,CREATED,LAST_DDL_TIME, (LAST_DDL_TIME-CREATED)*24*60 time_sicne_ddl from dba_objects where owner='$user' and trunc(CREATED)=trunc(sysdate);">> /tmp/1.sql
done
執行結果
---檢視scott使用者15天之前建立的表
select owner,OBJECT_NAME,CREATED,LAST_DDL_TIME, (LAST_DDL_TIME-CREATED)*24*60 time_sicne_ddl,trunc(sysdate-CREATED) from dba_objects where owner='SCOTT' and trunc(sysdate-CREATED)>=15;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25846553/viewspace-2692602/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle Golden Gate 系列小結OracleGo
- Oracle Golden Gate 系列 小結OracleGo
- Golden Gate 初探Go
- Golden Gate的definition檔案Go
- Oracle Golden Gate體系架構詳解OracleGo架構
- ORACLE golden gate 機制OracleGo
- 初探Oracle Golden Gate(一)OracleGo
- zt_oracle golden gateOracleGo
- golden gate 引數 PURGEOLDEXTRACTSGo
- 初次參與Golden -Gate POC,希望有機會做Golden -Gate for ERPGo
- Oracle golden gate程式說明OracleGo
- 配置Golden Gate 密碼加密Go密碼加密
- oracle golden gate 安裝配置OracleGo
- Oracle Golden Gate 安裝指南OracleGo
- golden gate 引數說明Go
- Golden Gate的一次教訓Go
- 一個奇怪的Golden Gate的問題Go
- 一個Golden Gate實時資料分發的例子Go
- SQL Server修改表結構後批量更新所有檢視SQLServer
- 查詢表結構
- IBM實時資料複製和同步解決方案 and IBM CDC ORACLE GOLDEN GATE 比較IBMOracleGo
- 檢視sqlite中的表結構SQLite
- sqlserver表結構查詢SQLServer
- 使用PL/SQL工具比對錶結構,同步表結構SQL
- MySQL修改表結構到底會不會鎖表?MySql
- 《Oracle Golden Gate 概念和原理》-新手入門->深入解析-圖文-可下載OracleGo
- Oracle Golden Gate 有關Data Pump 重置 trail 序列號 測試 說明OracleGoAI
- 結構損壞檢查指令碼指令碼
- mysql表結構同步工具SchemaSync使用初探MySql
- 兩種檢視oracle表結構的方法Oracle
- 檢視DB2表結構DB2
- Oracle 同步、非同步完全檢查點Oracle非同步
- SQL語句查詢表結構SQL
- 修改表結構遷移資料表來縮小表大小
- 使用 NineData GUI 建立與修改 ClickHouse 表結構GUI
- 修改SQL-SERVER資料庫表結構的SQL命令SQLServer資料庫
- 【體系結構】SCN與checkpoint(檢查點)
- Sql Server 獲取指定表、檢視結構SQLServer