台灣最大程式設計社群網站
線上人數
1164
 
會員總數:246038
討論主題:189625
歡迎您免費加入會員
討論區列表 >> Oracle >> oracle 遠端連線問題
[]  
[我要回覆]
1
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
oracle 遠端連線問題
價值 : 150 QP  點閱數:2798 回應數:3
樓主

遲緩兒
門外漢
0 2
57 1
發送站內信

一個新手 慢慢摸索 努力中 請多指教
我自己摸索也知道自己學的不是很好

#使用oracle 12C
#SID為oracle


SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
oracle

SQL> select name from v$database;

NAME
---------
ORACLE

SQL> select value from v$parameter where name = 'service_name';

沒有任何資料列被選取

#------------------------------------------------------------------------------------

輸入使用者名稱: --------/--------- as SYSDBA
連線到:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions

#正常

#------------------------------------------------------------------------------------
輸入使用者名稱: user
輸入密碼:
最後成功登入時間: 星期日 10月 05 2014 00:20:20 +08:00

連線到:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt
ions

#正常
#------------------------------------------------------------------------------------
這是我的listener.ora文件

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\app\thunder\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\app\thunder\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = Oracle)
(SID_NAME = oracle)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)


SID_LIST_LISTENER2 =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = E:\app\thunder\product\12.1.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:E:\app\thunder\product\12.1.0\dbhome_1\bin\oraclr12.dll")
)
(SID_DESC =
(GLOBAL_DBNAME = Oracle)
(SID_NAME = oracle)
)
)

LISTENER2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 111.255.65.81)(PORT = 1522))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1522))
)
)

#111.255.65.81為我的電腦對外IP

#------------------------------------------------------------------------------
#這是我的tnsname.ora

# tnsnames.ora Network Configuration File: E:\app\thunder\product\12.1.0\dbhome_1\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = thunder-PC)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oracle)
)
)

ORACLE_CONNECTION_COMPANY =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oracle)
)
)



ORACLE2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = thunder-PC)(PORT = 1522))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oracle)
)
)


ORACLE_CONNECTION_COMPANY2=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 111.255.69.229)(PORT = 1522))
)
(CONNECT_DATA =
(SID = oracle)
)
)
#----------------------------------------------------------------

SQL> create database link companynetwork connect to CompanyDBA identified by Poo
doogoo168 using '(description=(address=(protocol=TCP) (host=111.255.65.81)(port=
1522))(connect_data=(sid=oracle)))';

已建立資料庫連結.

#----------------------------------------------------------------
#錯誤訊息1
#start listener2錯誤
#start listener正常

LSNRCTL> start listener2
TNS-01106: 已啟動名稱為 listener 的監聽器
LSNRCTL> stop
連線至 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=thunder-PC)(PORT=1521)))
TNS-12541: TNS:沒有監聽器
TNS-12560: TNS:協定介面程式錯誤
TNS-00511: 沒有監聽器
64-bit Windows Error: 61: Unknown error
連線至 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
命令順利完成
LSNRCTL> start listener2
正在啟動 tnslsnr: 請稍候...

TNSLSNR for 64-bit Windows: Version 12.1.0.2.0 - Production
系統參數檔案是 E:\app\thunder\product\12.1.0\dbhome_1\network\admin\listener.ora

日誌訊息寫入 E:\app\thunder\diag\tnslsnr\thunder-PC\listener2\alert\log.xml
監聽有錯誤: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=111.255.65.81)(PORT=1522))
)
TNS-12545: 連線失敗, 因為目標主機或物件不存在
TNS-12560: TNS:協定介面程式錯誤
TNS-00515: 連線失敗, 因為目標主機或物件不存在
64-bit Windows Error: 49: Unknown error

無法啟動監聽器. 請參閱以上的錯誤訊息...

#----------------------------------------------------------------
#錯誤訊息2



搜尋相關Tags的文章: [ tnsname ] , [ listener ] , [ oracle ] ,
本篇文章發表於2014-10-05 12:49
1樓
回應

花旗蔘
檢舉此回應
圖太小 看不清error message
另外為何要設兩個listener? 有特殊目的嗎?
若是要設定多個port來連oracle 可一個listener監聽兩個port 即可!
本篇文章回覆於2014-10-10 19:09
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
2樓
作者回應

遲緩兒
檢舉此回應
我曾經設同一個監聽器
可是依然無法連接所以才設成兩個
本篇文章回覆於2014-10-12 14:45
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
3樓
回應

神來之筆
捐贈 VP 給 神來之筆 檢舉此回應
可以把你有問題部份簡單描述
並列出錯誤誤訊息
本篇文章回覆於2014-10-12 19:45
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
   
1

回覆
如要回應,請先登入.