Oracle DBLink指令碼

來源:互聯網
上載者:User

Oracle DBLink指令碼

-- Drop existing database link
drop database link DBLink名稱;


-- Create database link
create database link  DBLink名稱
  connect to 遠端資料庫使用者名稱 identified by 密碼
  using '(DESCRIPTION =
     (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = 遠端資料庫IP地址)(PORT = 資料庫連接埠號碼))
     )
     (CONNECT_DATA =
       (SERVICE_NAME = 執行個體名)
     )
   )';

 

 例:

-- Drop existing database link
drop database link TEST_DBLINK;
-- Create database link
create database link TEST_DBLINK
  connect to test identified by test
  using '(DESCRIPTION =
     (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = 111.111.111.111)(PORT = 1521))
     )
     (CONNECT_DATA =
       (SERVICE_NAME = test)
     )
   )';

相關文章

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.