【启动】数据库nomount参数文件的选择

1)         查看参数文件情况,创建pfile

[oracle@ocmu ~]$ cd $ORACLE_HOME/dbs

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

ls: spfile.ora*: No such file or directory

ls: initQQ.ora*: No such file or directory

ls: spfileQQ.ora*: No such file or directory

[oracle@ocmu dbs]$

[oracle@ocmu dbs]$ echo db_name=QQ > initQQ.ora

[oracle@ocmu dbs]$ cat initQQ.ora

db_name=QQ

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

ls: spfile.ora*: No such file or directory

ls: spfileQQ.ora*: No such file or directory

initQQ.ora

[oracle@ocmu dbs]$

2)         利用pfile生成spfile

[oracle@ocmu ~]$ cd $ORACLE_HOME/dbs

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

ls: spfile.ora*: No such file or directory

ls: spfileQQ.ora*: No such file or directory

initQQ.ora

[oracle@ocmu dbs]$ export ORACLE_SID=QQ

[oracle@ocmu dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 5 22:25:52 2012

 

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

 

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SYS@QQ>create spfile from pfile;

 

File created.

 

SYS@QQ>exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

ls: spfile.ora*: No such file or directory

initQQ.ora  spfileQQ.ora

[oracle@ocmu dbs]$

3)         拷贝spfile$ORACLE_SID.ora生成spfile.ora

[oracle@ocmu dbs]$ cp spfileQQ.ora spfile.ora

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

initQQ.ora  spfile.ora  spfileQQ.ora

[oracle@ocmu dbs]$

4)         启动QQ实例(spfile$ORACLE_SID.ora

[oracle@ocmu dbs]$ export ORACLE_SID=QQ

[oracle@ocmu dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 5 22:29:27 2012

 

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

 

Connected to an idle instance.

 

SYS@QQ>startup nomount;

ORACLE instance started.

 

Total System Global Area  146472960 bytes

Fixed Size                  1335080 bytes

Variable Size              92274904 bytes

Database Buffers           50331648 bytes

Redo Buffers                2531328 bytes

SYS@QQ>

SYS@QQ>show parameter spfile;

 

NAME                                 TYPE        VALUE

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

spfile                               string      /u01/app/oracle/product/11.2.0/db_1/dbs/spfileQQ.ora

SYS@QQ>

SYS@QQ>show parameter job

 

NAME                                 TYPE        VALUE

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

job_queue_processes                  integer     1000

SYS@QQ>

SYS@QQ>shutdown abort;

ORACLE instance shut down.

SYS@QQ>exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@ocmu dbs]$

5)         重命名spfileQQ.ora参数文件

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

initQQ.ora  spfile.ora  spfileQQ.ora

[oracle@ocmu dbs]$ mv spfileQQ.ora spfileQQ.ora.bak

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

initQQ.ora  spfile.ora  spfileQQ.ora.bak

[oracle@ocmu dbs]$

6)         启动QQ实例(spfile.ora

[oracle@ocmu dbs]$ export ORACLE_SID=QQ

[oracle@ocmu dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 5 22:33:30 2012

 

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

 

Connected to an idle instance.

 

SYS@QQ>startup nomount;

ORACLE instance started.

 

Total System Global Area  146472960 bytes

Fixed Size                  1335080 bytes

Variable Size              92274904 bytes

Database Buffers           50331648 bytes

Redo Buffers                2531328 bytes

SYS@QQ>

SYS@QQ>show parameter spfile;

 

NAME                                 TYPE        VALUE

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

spfile                               string      /u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora

SYS@QQ>show parameter job;

 

NAME                                 TYPE        VALUE

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

job_queue_processes                  integer     1000

SYS@QQ>

SYS@QQ>shutdown abort;

ORACLE instance shut down.

SYS@QQ>exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@ocmu dbs]$

7)         重命名spfile.ora参数文件(同时pfile文件中增加一个参数job_queue_processes=50)

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

initQQ.ora  spfile.ora  spfileQQ.ora.bak

[oracle@ocmu dbs]$ mv spfile.ora spfile.ora.bak

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

initQQ.ora  spfile.ora.bak  spfileQQ.ora.bak

[oracle@ocmu dbs]$ echo job_queue_processes=50 >> initQQ.ora

[oracle@ocmu dbs]$ cat initQQ.ora

db_name=QQ

job_queue_processes=50

[oracle@ocmu dbs]$

8)         启动QQ实例(init$ORACLE_SID.ora

[oracle@ocmu dbs]$ export ORACLE_SID=QQ

[oracle@ocmu dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 5 22:37:37 2012

 

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

 

Connected to an idle instance.

 

SYS@QQ>startup nomount;

ORACLE instance started.

 

Total System Global Area  146472960 bytes

Fixed Size                  1335080 bytes

Variable Size              92274904 bytes

Database Buffers           50331648 bytes

Redo Buffers                2531328 bytes

SYS@QQ>

SYS@QQ>show parameter spfile;

 

NAME                                 TYPE        VALUE

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

spfile                               string

SYS@QQ>show parameter job;

 

NAME                                 TYPE        VALUE

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

job_queue_processes                  integer     50

SYS@QQ>

SYS@QQ>shutdown abort;

ORACLE instance shut down.

SYS@QQ>exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

[oracle@ocmu dbs]$

9)         重命名pfile,再次启动QQ实例

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

initQQ.ora  spfile.ora.bak  spfileQQ.ora.bak

[oracle@ocmu dbs]$ mv initQQ.ora initQQ.ora.bak

[oracle@ocmu dbs]$ ls spfile.ora* initQQ.ora* spfileQQ.ora*

initQQ.ora.bak  spfile.ora.bak  spfileQQ.ora.bak

[oracle@ocmu dbs]$ export ORACLE_SID=QQ

[oracle@ocmu dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 5 22:39:21 2012

 

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

 

Connected to an idle instance.

 

SYS@QQ>startup nomount;

ORA-01078: failure in processing system parameters

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

SYS@QQ>

小结:

         通过上面的实验,我们会发现,oracle在启动的时候,会优先使用spfile$ORACLE_SID.ora,如果spfile$ORACLE_SID.ora不存在的话,那么会使用spfile.ora,如果spfile.orau不存在的话,那么会使用init$ORACLE_SID.ora(pfile)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/685769/viewspace-742758/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/685769/viewspace-742758/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值