分类: Oracle
2008-02-20 11:51:48
打算写一系列的文章介绍
从9i推出了SPFILE之后,就给出了使用PFILE创建SPFILE以及由SPFILE创建PFILE的语法。
在
采用这种方式创建的PFILE或SPFILE,可以保证获得的参数就是当前运行的参数,而如果从PFILE或SPFILE则无法确保文件中的参数设置与运行的参数设置一致。
语法其实很简单,将创建时的FROM语句后面的文件类型PFILE或SPFILE改为MEMORY即可:
[oracle@yangtk ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create pfile='/home/oracle/initora
File created.
SQL> create spfile='/home/oracle/spfileora
File created.
这种方式要求数据库至少处于NOMOUNT状态,否则会报错:
SQL> shutdown immediate
Database dismounted.
ORACLE instance shut down.
SQL> create pfile='/home/oracle/initora
create pfile='/home/oracle/initora
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> create spfile='/home/oracle/spfileora
create spfile='/home/oracle/spfileora
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> startup nomount
ORACLE instance started.
Total System Global Area 267825152 bytes
Fixed Size 1299316 bytes
Variable Size 176163980 bytes
Database Buffers 88080384 bytes
Redo Buffers 2281472 bytes
SQL> create pfile='/home/oracle/initora
File created.
SQL> create spfile='/home/oracle/spfileora
File created.