ablog

不器用で落着きのない技術者のメモ

Oracleでデータベースリンクを作成する

  • データベースリンクを作成する。
SQL> create database link samplelink -- ... public database ... とするとみんなが接続できるリンクになる
connect to scott identified by tiger using 'orcl'; 
  • 作成したデータベースリンクを確認する。
SQL> select owner, db_link, username, host, created from dba_db_links;
  • データベースリンクを使ってみる。
SQL> desc emp@samplelink
SQL> select * from emp@samplelink;