[oracle@yangtk ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jan 10 15:06:30 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create pfile='/home/oracle/initora11g_p.ora' from memory;
File created.
SQL> create spfile='/home/oracle/spfileora11g_p.ora' from memory;
File created.
注意:上面的这种方式要求数据库至少处于NOMOUNT状态,否则会出现报错:
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> create pfile='/home/oracle/initora11g_p.ora' from memory;
create pfile='/home/oracle/initora11g_p.ora' from memory
*
ERROR at line 1:
ORA-00922: missing or invalid option
SQL> create spfile='/home/oracle/spfileora11g_p.ora' from memory;
create spfile='/home/oracle/spfileora11g_p.ora' from memory
*
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/initora11g_p.ora' from memory;
File created.
SQL> create spfile='/home/oracle/spfileora11g_p.ora' from memory;
File created.