12,去找tnsnames.ora
[oracle@localhost admin]$ more /oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
也可以more $ORACLE_HOME/network/admin/tnsnames.ora
找到
MPMD2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.110.107)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME= pxxerxxs)
)
)
然后用非sys用户登录
[oracle@localhost ~]$ rlwrap sqlplus "pxxerxxsk/pa141215@MPMD2"
rlwrap: warning: your $TERM is 'xterm' but rlwrap couldn't find it in the terminfo database. Expect some problems.
SQL*Plus: Release 11.2.0.1.0 Production on Fri Jan 16 20:30:30 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
SQL>
OK登录显示成功。
总结,
(1)linux系统里面,su切换到oracle用户的时候,加上-就会更换oracle用户单独配置生效,如果不加-就不会使用oracle用户单独的配置。
(2)在使用sqlplus登录的时候,用非sys用户登录,@后面的是$ORACLE_HOME/network/admin/tnsnames.ora定义的那个前缀符号MPMD2,而不是SERVICE_NAME所指的oracle_sid,tnsnames.ora中MPMD2前缀定义如下所示
MPMD2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.110.101)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME= pxxerxxs)
)
)
sqlplus登录Oracle时ORA-01017: invalid username/password; logon denied的错误
在CentOS 6.4下安装Oracle 11gR2(x64)