因为一些内存大小设置的问题,搞不定,一上火,我直接重启了整台服务器。
登录之后,启动数据库,还是出错:
ORA-00844: Parameter not taking MEMORY_TARGET into account
ORA-00851: SGA_MAX_SIZE 2147483648 cannot be set to more than MEMORY_TARGET 1258291200.
ORA-01078: failure in processing system parameters
可是尼玛,spfile是二进制文件,没法修改啊,怎么办?
还好从网上找了些资料,还是有办法。你碰到的问题,都会有人碰到的。
解决的办法就是:
通过pfile启动Oracle–>在Oracle中通过create pfile='' from spfile=''
取出spfile的内容(pfile是可以手动修改的)–>修改新建的pfile–>以新的pfile启动Oracle–>在Oracle中通过create spfile='' from pfile=''
获得修改后的spfile
具体实战:
SQL> create pfile = '/opt/oracle/product/12.2.0/dbhome/dbs/initORCL.ora' from spfile = '/opt/oracle/product/12.2.0/dbhome/dbs/spfileORCL.ora';
File created.
SQL> startup mount pfile='/opt/oracle/product/12.2.0/dbhome/dbs/initORCL.ora';
此时,参数可能还有一些问题,但你可以打开initORCL.ora修改了,搞定之后。
SQL> alter database open;
Database altered.
SQL> create spfile = '/opt/oracle/product/12.2.0/dbhome/dbs/spfileORCL.ora' from pfile = '/opt/oracle/product/12.2.0/dbhome/dbs/initORCL.ora';
File created.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 1258291200 bytes
Fixed Size 8792200 bytes
Variable Size 1023412088 bytes
Database Buffers 201326592 bytes
Redo Buffers 24760320 bytes
Database mounted.
Database opened.