环境配置:oracle11.2.0.2
--本地监听状态及配置
[oracle@njdyw dbs]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 31-7月 -2012 16:37:41
Copyright (c) 1991, 2010, Oracle. All rights reserved.
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER 的STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for Linux: Version 11.2.0.2.0 - Production
启动日期 31-7月 -2012 15:50:39
正常运行时间 0 天 0 小时 47 分 2 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP ON
监听程序参数文件 /u01/app/ora11g/product/11.2.0/grid/network/admin/listener.ora
监听程序日志文件 /u01/app/ora11g/diag/tnslsnr/njdyw/listener/alert/log.xml
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.5.238)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
服务摘要..
服务 "+ASM" 包含 1 个实例。
实例 "+ASM", 状态 READY, 包含此服务的 1 个处理程序...
服务 "gcdb" 包含 1 个实例。
实例 "gcdb", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
[oracle@njdyw dbs]$ tnsping gc
TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 31-7月 -2012 16:37:52
Copyright (c) 1997, 2010, Oracle. All rights reserved.
已使用的参数文件:
已使用 TNSNAMES 适配器来解析别名
尝试连接 (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.238)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = gcdb)(UR=A)))
OK (0 毫秒)
[oracle@njdyw dbs]$ cat /u01/app/ora11g/product/11.2.0/grid/network/admin/listener.ora
# listener.ora Network Configuration File: /u01/app/ora11g/product/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.238)(PORT = 1521))
)
)
#ADR_BASE_LISTENER = /u01/app/ora11g
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = gcdb)
(ORACLE_HOME = /u01/app/ora11g/product/11.2.0/grid)
(SID_NAME = gcdb)
)
)
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
--密码文件也创建无误
[oracle@njdyw dbs]$ ll orapwgcdb
-rw-r----- 1 oracle oinstall 1536 07-19 10:41 orapwgcdb
问题:
--但就是无法用连接符登录空闲实例
[oracle@njdyw dbs]$ export ORACLE_SID=gcdb
[oracle@njdyw dbs]$ sqlplus [email=sys/oracle123@gc]sys/oracle123@gc[/email] as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on 星期二 7月 31 16:41:26 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-01031: insufficient privileges
请输入用户名:
ERROR:
ORA-01017: 用户名/口令无效; 登录被拒绝
请输入用户名:
ERROR:
ORA-01017: 用户名/口令无效; 登录被拒绝
SP2-0157: 在 3 次尝试之后无法连接到 ORACLE, 退出 SQL*Plus
--如果用系统认证方式就可以用连接符方式登录
--直接用系统认证方式可以登录空闲实例
[oracle@njdyw dbs]$ sqlplus "/as sysdba"
SQL*Plus: Release 11.2.0.2.0 Production on 星期二 7月 31 16:44:54 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
已连接到空闲例程。
SQL> startupnomount
ORACLE 例程已经启动。
Total System Global Area 233861120 bytes
Fixed Size 2225224 bytes
Variable Size 159386552 bytes
Database Buffers 67108864 bytes
Redo Buffers 5140480 bytes
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
--实例启动后再用连接符方式能成功登录
[oracle@njdyw dbs]$ sqlplus [email=sys/oracle123@gc]sys/oracle123@gc[/email] as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on 星期二 7月 31 16:45:18 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
原因:
静态注册的ORACLE_HOME 是这个目录/u01/app/ora11g/product/11.2.0/grid
这个目录不是 RDBMS HOME 而是GRID HOME,
而password file在 RDBMS HOME/dbs下
解决:
把静态注册的ORACLE_HOME 改成/u01/app/ora11g/product/11.2.0/db_1
[oracle@njdyw admin]$ vi listener.ora
# listener.ora Network Configuration File: /u01/app/ora11g/product/11.2.0/grid/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.5.238)(PORT = 1521))
)
)
#ADR_BASE_LISTENER = /u01/app/ora11g
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = gcdb)
(ORACLE_HOME = /u01/app/ora11g/product/11.2.0/db_1)
(SID_NAME = gcdb)
)
)
--重启监听服务
--注意:在grid环境,如果使用lsnrctl重启监听有时可能无法找到服务,所以用crs_stop,crs_start命令重启。
[oracle@njdyw~]cd /u01/app/ora11g/product/11.2.0/grid/bin
[oracle@njdyw~]crs_stop ora.LISTENER.lsnr
[oracle@njdyw~]crs_start ora.LISTENER.lsnr
[oracle@njdyw bin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 01-8月 -2012 15:29:21
Copyright (c) 1991, 2010, Oracle. All rights reserved.
正在连接到 (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for Linux: Version 11.2.0.2.0 - Production
启动日期 01-8月 -2012 15:29:14
正常运行时间 0 天 0 小时 0 分 7 秒
跟踪级别 off
安全性 ON: Local OS Authentication
SNMP ON
监听程序参数文件 /u01/app/ora11g/product/11.2.0/grid/network/admin/listener.ora
监听程序日志文件 /u01/app/ora11g/product/11.2.0/grid/log/diag/tnslsnr/njdyw/listener/alert/log.xml
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.1.5.238)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
服务摘要..
服务 "gcdb" 包含 1 个实例。
实例 "gcdb", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
--再次用连接串登录空闲实例后成功。
[oracle@njdyw bin]$ sqlplus as sysdba
SQL*Plus: Release 11.2.0.2.0 Production on 星期三 8月 1 15:29:52 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
已连接到空闲例程。
SQL> startup nomount
ORACLE 例程已经启动。
Total System Global Area 233861120 bytes
Fixed Size 2225224 bytes
Variable Size 159386552 bytes
Database Buffers 67108864 bytes
Redo Buffers 5140480 bytes
SQL>