当前位置: 代码迷 >> Oracle管理 >> Linux 环境下登录oracle失败,提示ORA-12541: TNS: 无监听程序,该如何解决
  详细解决方案

Linux 环境下登录oracle失败,提示ORA-12541: TNS: 无监听程序,该如何解决

热度:116   发布时间:2016-04-24 05:34:24.0
Linux 环境下登录oracle失败,提示ORA-12541: TNS: 无监听程序
我在linux服务有两个用户oracle, 和admin. 我用oracle用户sqlplus数据库时,可以正常登录;但用admin用户登录时 ,却提示ORA-12541: TNS: 无监听程序。执行lsnrctl status时,显示如下:我怀疑可能是权限问题,但不知如何确认是否权限问题。请大侠们不吝指教。


oracle安装目录的权限如下:
$ ll
总用量 40
drwxr-x--- 3 oracle oinstall 4096 2012-01-06 14:43 admin
drwxr-xr-x 5 oracle oinstall 4096 2012-01-06 13:44 cfgtoollogs
drwxr-xr-x 2 oracle oinstall 4096 2012-01-06 10:56 checkpoints
drwxrwxr-x 4 oracle oinstall 4096 2012-01-06 10:25 diag
drwxr-x--- 6 oracle oinstall 4096 2012-01-06 13:52 flash_recovery_area
drwxr-xr-x 3 oracle oinstall 4096 2012-01-06 14:43 oradata
drwxr-xr-x 3 oracle oinstall 4096 2012-01-06 11:22 oradiag_oracle
drwxrwx--- 5 oracle oinstall 4096 2012-01-06 10:24 oraInventory
drwxr-xr-x 3 oracle oinstall 4096 2012-01-06 10:13 product
drwxr-xr-x 2 oracle oinstall 4096 2012-01-06 10:01 server


$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 10-1? -2012 16:12:50

Copyright (c) 1991, 2009, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 06-1? -2012 14:56:05
Uptime 4 days 1 hr. 16 min. 44 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /usr/local/oracle11g/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /usr/local/oracle11g/diag/tnslsnr/caihf-deepin/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=caihf-deepin)(PORT=1521)))
Services Summary...
Service "upnet" has 2 instance(s).
  Instance "upnet", status UNKNOWN, has 1 handler(s) for this service...
  Instance "upnet", status READY, has 1 handler(s) for this service...
Service "upnetXDB" has 1 instance(s).
  Instance "upnet", status READY, has 1 handler(s) for this service...
The command completed successfully

------解决方案--------------------
在listener.ora里面增加如下
(SID_DESC =
(GLOBAL_DBNAME=orcl)
(ORACLE_HOME = /oracle/product/10.2.0/db_1)
(SID_NAME = orcl)
)

然后重启监听,再试试。

------解决方案--------------------
两个用户oracle, 和admin 是Linux的用戶,還是Oracle數據庫的用戶,
sqlplus命令只對Oracle數據庫的用戶有效,與Linux系統用戶無關。
------解决方案--------------------
执行以下命令即可:usermod -G oinstall admin ,将 oinstall 作为 admin 的非默认组
  相关解决方案