数据库启动报错两种情况的解决办法

通常服务器在突然断电或者频繁关机的情况下很容易造成数据库损坏,然后启动不了数据库,针对这种情况出现最多的有两种,

其一:启动的时候数据文件损坏

      这种情况比较简单,

1、  首先关闭数据库

     sql>shutdown immediate;
2、 其次启动数据库,

     sql>startup;

    此时启动数据库会报错,

    data file 12: '/u01/app/oracle/oradata/csc/tmp.dbf' 

 3、恢复数据文件

      sql>recover datafile 12;

4、重复1、2、3步骤,直到能够正常启动!

其二:数据库版本号不一致

  这种情况比较复杂

1、关闭数据库

   SQL> shutdown immediate
   ORA-01507: database not mounted
   ORACLE instance shut down.

2、启动数据库报如下错误

   SQL> startup mount
   ORACLE instance started.

   Total System Global Area 188743680 bytes
   Fixed Size 778036 bytes
   Variable Size 162275532 bytes
   Database Buffers 25165824 bytes
   Redo Buffers 524288 bytes
   ORA-00214: controlfile '/home/oracle/oradata/csc/control01.ctl' version 9190435 inconsistent with file
     '/home/oracle/oradata/csc/control02.ctl' version 9190433

   Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
   With the Partitioning and Data Mining options
   [uniread] Saved history (2163 lines)

3、创建初始化启动文件

   SQL> create pfile='/home/oracle/init.ora' from spfile;

   File created.

4、编辑该文件,把低版本的控制文件去掉,保留高版本的

  编辑init.ora,把'/home/oracle/oradata/csc/control02.ctl'去掉,然后再重启数据库

5、关闭数据库
   SQL> shutdown immediate
6、指定启动文件

   SQL> create spfile from pfile='/home/oracle/init.ora';

7、通过nomount 方式启动数据库

   SQL> startup nomount

   ORACLE instance started.

   Total System Global Area 188743680 bytes
   Fixed Size 778036 bytes
   Variable Size 162275532 bytes
   Database Buffers 25165824 bytes
   Redo Buffers 524288 bytes

8、数据库mount
   SQL> alter database mount;
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值