ORACLE建立Database Link
本機資料庫資訊(schema: ABC, user: ABC, password: ABC) 0. 登入 oracle 帳號 1. 在 tnsnames.ora 檔案中, 加入要連線的遠端資料庫資料 REMOTE_DB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.10)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora1) ) ) 2. 重新啟動資料庫(讓第1步驟設定生效) ** 實測結果有時好像不用重啟就可以生效 sqlplus '/as sysdba' SQL> shutdown immediate SQL> startup 3. 檢查user是否有建立 Database Link 的權限 SQL> select grantee, privilege from dba_sys_privs where grantee='ABC'; GRANTEE PRIVILEGE ------------------------------ ---------------------------------------- ABC CREATE TABLE ABC CREATE SESSION ABC CREATE SYNONYM ABC UNLIMITED TABLESPACE 4. 新增user建立 Database Link 的權限 SQL> grant CREATE DATABASE LINK to ABC 5. 再檢查是否有權限 SQL> select grantee, privilege from dba_sys_priv...