測試同步HELLOWORLD
一、測試校驗
校驗源資料庫與備庫的資料是否具有一緻性,首先确定源資料庫與備庫中都不存在表名為scott.test_hello的表。
使用sqlplus指令descscott.test_hello
SQL>descscott.test_hello;
如顯示ERROR:
ORA-04043:objectscott.test_hellodoesnotexist
則表示資料庫中不存在該表,否則則有。
二、資料準備
測試源資料庫名為tt,備庫名為orcl;
資料庫版本:ORACLE11.2.0.1.0;
作業系統:UBUNTU12.0464位
需用到的SQL語句:
descscott.test_hello;
createtablescott.test_hello(strvarchar2(20));
insertintoscott.test_hellovalues('helloworld');
三、使用過程
A.在源資料庫中産生helloworld
使用sqlplus在源資料庫tt中先建立一張表:
SQL>createtablescott.test_hello(strvarchar2(20));
Tablecreated.
向表中添加資料:
SQL>insertintoscott.test_hellovalues('helloworld');
1rowcreated.
使用sqlplus在備octl中檢視是否有scott.test_hello表,然後檢視表中是否有helloworld資料。
SQL>selectowner,table_namefromall_tableswhereowner='SCOTT'andtable_name='TEST_HELLO';
OWNERTABLE_NAME
------------------------------------------------------------
SCOTTTEST_HELLO
C.備庫中存在表scott.test_hello。
操作描述
sqlplus顯示
結果
檢視源庫scott.test_hello的表結構:
NameNull?Type
-----------------------------------------------------------------------------
STRVARCHAR2(20)
說明目标資料庫與源庫中的表結構一緻。
檢視備庫scott.test_hello的表結構:
檢視源庫scott.test_hello表資料
SQL>select*fromscott.test_hello;
STR
--------------------
helloworld
說明源庫與備庫的資料一緻。
檢視備庫scott.test_hello表資料
四、源庫、備庫同步
從上述結果可以看出在源庫tt中所做的操作,全部同步到了備庫orcl上。Sota系統完成了資料庫的同步。
如果有疑問請咨詢沃信科技公司的技術人員,有興趣着請登入沃信科技網站了解相關的内容。