分类:
2008-10-15 16:27:10
昨天在火车站,一个朋友打电话过来,说他将SPFILE修改错了,数据库无法启动,问我怎么办。
我说你创建一个PFILE,改一下用PFILE启动,而他说数据库无法连接,是的环境。
Ok,这类问题很多很多,我描述一下解决办法供参考。
假如我们修改了以下参数:
SQL> alter system set sga_max_size=5G scope=spfile;
System altered.
SQL> shutdown immediate;在Unix、Linux上可以连接到数据库,创建pfile:
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-27102: out of memory
SQL> create pfile from spfile;如果在Window上,你手上还没有任何可供参考的参数文件,那么很简单,用记事本(Notepad)编辑一个文件,包含如下两行:
File created.
[oracle@test126 dbs]$ cat initeygle.ora
SPFILE='/opt/oracle/product/10.2.0/dbs/spfileeygle.ora'
sga_max_size=1073741824
SQL> startup pfile=$ORACLE_HOME/dbs/initeygle.ora
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 1223540 bytes
Variable Size 918553740 bytes
Database Buffers 146800640 bytes
Redo Buffers 7163904 bytes
Database mounted.
Database opened.
[oracle@test126 dbs]$ mv spfileeygle.ora spfileeygle2.ora数据库可以自动使用PFILE启动:
[oracle@test126 dbs]$ cat initeygle.ora
SPFILE='/opt/oracle/product/10.2.0/dbs/spfileeygle2.ora'
sga_max_size=1073741824
SQL> startup
ORACLE instance started.
Total System Global Area 1073741824 bytes
Fixed Size 1223540 bytes
Variable Size 918553740 bytes
Database Buffers 146800640 bytes
Redo Buffers 7163904 bytes
Database mounted.
Database opened.
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string /opt/oracle/product/10.2.0/dbs
/spfileeygle2.ora