oracle as报错,oracle sqlplus / as sysdba连接的时候报错ORA-12547: TNS:Lost Contact

原因分析:

1.内核参数设置有问题

2.ORACLE文件执行权限有问题

3.用户参数 stack 设置有问题

4. $ORACLE_HOME/rdbms/lib/config.o 文件大小为0字节

5. Oracle binaries have not been linked correctly

6.没有 $ORACLE_HOME/dbs 目录,且该目录下应该有ora文件,如果没有则报错:

ORA-01078:failure in processing system parameters

(Note that creating an empty dbs directory already solves this error and you can for instance shutdown the instance. However, you will obviously not be able to restart because of the missing parameter file. So, the dbs directory needs to be fully restored.)

7.缺少rpm包 例如 libaio,

解决办法:

Oracle11g官方给出了内核参数为:

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048576

检查oracle运行权限

$ cd $ORACLE_HOME/bin

$ ls -l oracle

权限应该为 -rwsr-s–x 1 oracle dba 或者 -rwsr-s–x 1 oracle oinstall

如果不是请更改:

$ chmod 6751 oracle

$ ls -l oracle

检查 stack 的值

ulimit -a

看用户参数的值是否符合官方要求

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

oracle hard stack 10240

确保下面两个文件不为0字节

$ORACLE_HOME/bin/oracle

$ORACLE_HOME/rdbms/lib/config.o

If yes, rename the following file:

% cd $ORACLE_HOME/rdbms/lib

% mv config.o config.o.bad

Then, relink the oracle binary:

% relink oracle

如果以上检查都没有问题,建议停掉数据库和监听

使用relink all 命令 重新编译

查看是否有$ORACLE_HOME/dbs目录,

本次错误可能就是由于该问题导致,创建dbs目录后,sqlplus / as sysdba 命令没有再报错,但是在启动数据库的时候报如下错误:

7dd45ada03ab39cd14f38b1e484661c2.png

原因:

在oracle9i、10g、11g最近几个版本中,数据库默认使用spfile启动数据库,如果spfile不存在,则就会出现上述错误

解决办法:

使用命令查找pfile文件:find /u01 -name pfile -print 进入该文件夹,查看文件

0b7e040845dbedca182fb64b6d1126bc.png

将O R A C L E H O M E / a d m i n / c v t e 63 / p f i l e 目 录 下 的 i n i t . o r a . 6420171848 形 式 的 文 件 c o p y 到 ORACLE_HOME/admin/cvte63/pfile目录下的init.ora.6420171848 形式的文件copy 到ORACLEH​OME/admin/cvte63/pfile目录下的init.ora.6420171848形式的文件copy到ORACLE_HOME/dbs目录下命名为initfxorcl.ora即可 (fxorcl 的意思是数据库实例的名称,根据自己的实例名命名)

现在启动数据库即可

7.检查rpm包是否有缺失,例如

rpm -qa | grep libaio

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值