Fast synchronization of Oracle Dblinik tables

Source: Internet
Author: User

Create Public database link Link_mm_dev
Connect to STL identified by Fosssit
Using ' (DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.10.111) (PORT = 1521))
)
(Connect_data =
(service_name = FOSSDBSB)
)
)‘;

--1 Link_mm_dev dblink Name
--2%mm% external database required tables
Declare
Num number (1);
Begin
For V_row in (select T.table_name
from [email Protected]_mm_dev t
where t.table_name like '%mm% ') loop
Select COUNT (1)
Into num
From User_tables t
where t.table_name = V_row.table_name;
If num > 0 Then
Execute immediate ' drop table ' | | V_row.table_name;
num:=0;
End If;
Execute immediate ' CREATE TABLE ' | | V_row.table_name | |
' AS SELECT * from ' | | v_row.table_name| | ' @link_mm_dev ';
End Loop;
End

Fast synchronization of Oracle Dblinik tables

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.