1. Create a new table in the source database. On the source server (dbv01) , using SQL*Plus, logon as the OE REPOE schema and create a new table.
No Format |
---|
sqlplus oerepoe/oe@ttorclrepoe@ttorcl_src |
No Format |
---|
SQL>CREATE create tableTABLE sales ( prod_id number primary key, NUMBER PRIMARY KEY, cust_id number not null, NUMBER NOT NULL, quantity_sold number NUMBER(10,2) notNOT nullNULL, amount_sold numberNUMBER(10,2) notNOT nullNULL, amount_received numberNUMBER(10,2), sales_status varchar2 VARCHAR2(10) notNOT nullNULL ); |
...
2. Insert data into this table and commit the data.
No Format |
---|
SQL>INSERT insertINTO into sales valuesVALUES ( 101, 201, 233, 1299, null, 'OVERDUE'); insertINSERT intoINTO sales valuesVALUES ( 102, 301, 30, 1099, 1099, 'PAID'); insertINSERT intoINTO sales valuesVALUES ( 103, 401, 30, 120, 120, 'PAID'); insertINSERT intoINTO sales valuesVALUES ( 104, 401, 40, 160, null, 'OVERDUE'); commitCOMMIT; |
...
3. The Assuming you still have the replication running from the One-Way Logical Replication Setup excercise, the replication console will show the new table. The By default, DDL and the DML will be replicated so the table will be in sync on the target database.
No Format |
---|
OEREPOE.SALES: 100% Mine:4/4 Unrecov:0/0 Applied:4/4 |
...
4. Synchronization may take some timea few moments, depending on your virtualized environment. Go to the target database and verify that the data is in sync.
...
host machine. On the source server, as oracle, in the $HOME/replicate directory, execute the record_cound.bash script to check the record counts for the new SALES table.
No Format |
---|
./record_count.bash
TABLE_NAME TTORCL_SRC TTORCL_TRG
------------------------------ ----------- -----------
ADDRESSES 750816 750816
CARD_DETAILS 750760 750760
CUSTOMERS 500760 500760
INVENTORIES 900131 900131
LOGON 1196958 1196958
ORDERENTRY_METADATA 4 4
ORDERS 716839 716839
ORDER_ITEMS 2148955 2148955
PRODUCT_DESCRIPTIONS 1000 1000
PRODUCT_INFORMATION 1000 1000
SALES 4 4
WAREHOUSES 1000 1000
12 rows selected.
Sum of orders TTORCL_SRC TTORCL_TRG
------------- ------------------ ------------------
ORDERS $3,586,575,013.00 $3,586,575,013.00
|
Check the contents of the SALES table in both the source and target databases.
No Format |
---|
SQL> select * from sales; PROD_ID CUST_ID QUANTITY_SOLD AMOUNT_SOLD AMOUNT_RECEIVED SALES_STAT ---------- ---------- ------------- ----------- --------------- ---------- 101 201 233 233 1299 OVERDUE 102 301 30 30 1099 1099 PAID 103 401 30 30 120 120 PAID 104 401 40 40 160 OVERDUE |