oracle9ioracle10g中,数据库默认将使用spfile启动数据库,如果spfile不存在,并且找不到静态参数文件或环境变量设置错误,则就会出现ORA-01078和LRM-00109错误。

这里介绍一种情况spfile不存在后的数据库启动。

实验前:

移走动态参数文件,并且没有静态参数文件。

[oracle@redhat4 dbs]$ ls

hc_jiagulun.dat  init.ora    orapwjiagulun      spfilejiagulun.ora

initdw.ora       lkJIAGULUN  snapcf_jiagulun.f

[oracle@redhat4dbs]mvspfilejiagulun.ora ../spfilejiagulun.ora

启动数据库,报错找不到静态参数文件initjiagulun.ora(因为数据库找不到动态参数文件之后就会去找静态参数文件)

SQL> startup;      

ORA-01078: failure in processing system parameters

LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0/db_1/dbs/initjiagulun.ora'


解决方法:

1、复制并重命名:

[oracle@redhat4 pfile]$ cp /u01/app/oracle/admin/jiagulun/pfile/init.ora.1019201314446 /u01/app/oracle/product/10.2.0/db_1/dbs/initjiagulun.ora

2、成功启动数据库,注意此时只是用静态参数文件启动。

[oracle@redhat4 pfile]$ sqlplus / as sysdba;


SQL*Plus: Release 10.2.0.1.0 - Production on Fri Dec 27 19:37:48 2013


Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to an idle instance.


SQL> startup;

ORACLE instance started.


Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size              92276304 bytes

Database Buffers          188743680 bytes

Redo Buffers                2973696 bytes

Database mounted.

Database opened.

SQL>

3、重新生成动态参数文件,再次启动时就会用动态参数文件启动数据。


SQL> create spfile from pfile ;


File created.


SQL> shutdown abort;

ORACLE instance shut down.

SQL>

SQL>

SQL>

SQL> startup;

ORACLE instance started.


Total System Global Area  285212672 bytes

Fixed Size                  1218992 bytes

Variable Size              92276304 bytes

Database Buffers          188743680 bytes

Redo Buffers                2973696 bytes

Database mounted.

Database opened.

SQL> show parameter spfile;


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

spfile                               string      /u01/app/oracle/product/10.2.0

                                                /db_1/dbs/spfilejiagulun.ora