#added for oracle
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=pxxerxxs
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
[oracle@localhost root]$
配置里面有值,问题在哪里?
8,su的时候有差异
不加-的话的话只是切换用户 不去更换用户的配置,加上-后 再去sqlplus 试试
[oracle@localhost ~]$ exit
logout
[root@localhost ~]# su oracle
[oracle@localhost root]$ echo $ORACLE_BASE
[oracle@localhost root]$ exit
exit
[root@localhost ~]# su - oracle
[oracle@localhost ~]$ echo $ORACLE_BASE
/oracle/app/oracle
[oracle@localhost ~]$
9,验证下su - oracle
[oracle@localhost ~]$ rlwrap sqlplus "/ as sysdba"
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 10:36:51 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>
10,OK,尝试使用非sys账号登录报错
[oracle@localhost ~]$ rlwrap sqlplus "plas_prd/plrd_1628@pxxerxxs as sysdba"
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 16:53:11 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:
ERROR:
ORA-01017: invalid username/password; logon denied
Enter user-name:
[oracle@localhost ~]$
11,去check下,tnsping pxxerxxs 能否成功
[oracle@localhost ~]$ tnsping pxxerxxs
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 16-JAN-2015 16:53:27
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
TNS-03505: Failed to resolve name
[oracle@localhost ~]$
tnsping失败,得知pxxerxxs这个失效