今天连接数据库发现提示
C:\Users\zehua.xing> sqlplus his/***@oramh11g
SQL*Plus: Release 10.2.0.1.0 - Production on 星期一 8月 20 09:07:39 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12516: TNS: 监听程序找不到符合协议堆栈要求的可用处理程序
请输入用户名:
能够tnsping通服务器,说明服务断的监听进程是开启的
C:\Users\zehua.xing> tnsping oramh11g
TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 20-8月 -2012 09:07:18
Copyright (c) 1997, 2005, Oracle. All rights reserved.
已使用的参数文件:
D:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.2.2.4)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = oramh)))
OK (0 毫秒)
用oracle用户登录到操作系统提示/home/oracle权限不够,所有的oracle进程都是开启的
Could not chdir to home directory /home/oracle: Permission denied
-bash: /home/oracle/.bash_profile: 权限不够
-bash-4.1$ pwd
/
-bash-4.1$ ps -ef |grep ora
avahi 1952 1 0 Jun02 ? 00:00:00 avahi-daemon: running [ora.local]
oracle 2359 1 0 Jun02 ? 00:11:02 /home/u01/oracle/product/11.2.0/dbhome_1/bin/tnslsnr LISTENER -inherit
oracle 7362 1 0 Aug10 ? 00:01:06 oracleoramh (LOCAL=NO)
root 10081 17760 0 09:21 ? 00:00:00 sshd: oracle [priv]
oracle 10085 10081 0 09:21 ? 00:00:00 sshd: oracle@pts/1
oracle 10086 10085 0 09:21 pts/1 00:00:00 -bash
oracle 10142 10086 0 09:22 pts/1 00:00:00 ps -ef
oracle 10143 10086 0 09:22 pts/1 00:00:00 grep ora
oracle 10191 1 0 Aug14 ? 00:00:33 oracleoramh (LOCAL=NO)
oracle 10193 1 0 Aug14 ? 00:00:30 oracleoramh (LOCAL=NO)
oracle 10210 1 0 Aug14 ? 00:00:24 oracleoramh (LOCAL=NO)
oracle 17605 1 0 Jul17 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23605 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23607 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23609 1 0 Jul31 ? 00:01:30 oracleoramh (LOCAL=NO)
oracle 23611 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23613 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23615 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23617 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23619 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23621 1 0 Jul31 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 23623 1 0 Jul31 ? 00:01:31 oracleoramh (LOCAL=NO)
oracle 24308 1 0 Jul18 ? 00:00:00 oracleoramh (LOCAL=NO)
oracle 24357 1 0 Aug08 ? 00:00:06 oracleoramh (LOCAL=NO)
oracle 24598 1 0 Aug09 ? 00:02:11 oracleoramh (LOCAL=NO)
oracle 29468 1 0 Jun18 ? 00:11:34 ora_pmon_oramh
oracle 29470 1 0 Jun18 ? 01:06:40 ora_vktm_oramh
oracle 29474 1 0 Jun18 ? 00:00:31 ora_gen0_oramh
oracle 29476 1 0 Jun18 ? 00:01:47 ora_diag_oramh
。。。。。
尝试用系统管理员身份登录数据库,但是失败
-bash-4.1$ sqlplus / as sysdba
-bash: sqlplus: command not found
-bash-4.1$ more ~/.bash_profile
/home/oracle/.bash_profile: 权限不够
检查/home/oracle权限,发现所有者是root
-bash-4.1$ ll /home
总用量 570340
drwxrwxr-x 3 root root 4096 7月 17 09:43 include
drwxrwxr-x 2 root root 4096 7月 17 09:42 lib
drwx------. 2 root root 16384 6月 1 18:00 lost+found
drwxr-xr-x 3 root root 4096 7月 31 17:56 njl
drwx------. 28 root root 4096 8月 16 14:14 oracle
drwxr-xr-x 2 root root 4096 7月 27 11:00 redis-server
drwxr-xr-x 4 root root 4096 6月 2 10:42 u01
drwxrwxrwx 10 root root 4096 7月 18 11:10 ZeromqServer
-rw-r--r-- 1 root root 583976960 7月 18 10:39 ZeromqServer.tar.gz
问题的原因基本确定,/home/oracle的所有者变成root,这问题也许是某个用户的误操作造成的。
将oracle的用户根目录和oracle的安装目录的所有者设置成oracle,用户组为oinstall之后问题解决。