設定 PL/SQL 與 DB 連線
Step 1: 進入 DB Server 中的 oracle 路徑並開啟 tnsnames.ora, 例如下列路徑
D:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora
Step 2: 在 tnsnames.ora 中新增下列字串
ConnectName(建議包含SID, ex: ServerName_SidName) =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = ServerName or Server IP)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = SidName)
)
)
Step 3: 進入 Client 中的 oracle client 路徑並開啟 tnsnames.ora, 例如下列路徑
C:\oracle\ora81\network\ADMIN
Step 4: 在 tnsnames.ora 中新增下列字串 (下列的 ConnectName 只是要在 PL/SQL 登入時挑選 Database 所選擇的名稱)
ConnectName =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = ServerName or Server IP)
(Port = 1521)
)
(ADDRESS =
(PROTOCOL = TCP)
(Host = ServerName or Server IP)
(Port = 1526)
)
(ADDRESS =
(PROTOCOL = TCP)
(Host = ServerName or Server IP)
(Port = 1525)
)
)
(CONNECT_DATA = (SID = SidName)
)
)
Step 5: 在 PL/SQL Developer 中, 執行 Tools > Preferences...
Step 5: 設定 Oracle Home 與 OCI library