前段时间随意在OEM中修改下内存参数,当时没有重启,也没发现问题,今天重启下,结果oracle10g起不来了,当时立马头大了,这可是生产环境下。oracle报错:
SQL> startup
ORA-00824: cannot set sga_target due to existing internal settings, see alert log for more information
马上祭出google法宝,原来跟把sga值改大了有关系,赶紧修改pfile文件,路径是/usr/oracle/admin/ora/pfile/init.ora.2112007144027,改sga_target=0;保存。
然后运行startup pfile='/usr/oracle/admin/ora/pfile/init.ora.2112007144027',乖乖,祸不单行,继续报错:
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 2019320 bytes
Variable Size 113246216 bytes
Database Buffers 50331648 bytes
Redo Buffers 6369280 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
这又是什么原因?
用$ ls -lart
找到/usr/oracle/admin/ora/udump/目录下最近产生的日志文件打开一看,最后有一句:
RA-30012: undo tablespace 'UNDOTBS1' does not exist or of wrong type
原来undo表空间出了问题,找不到了,回想可能重做过undo表空间,表空间名称变化了,pfile中没有记录。只有试着改了,还是修改/usr/oracle/admin/ora/pfile/init.ora.2112007144027这个文件中的UNDO表空间名称,改成UNDOTBS2,重新运行startup pfile='/usr/oracle/admin/ora/pfile/init.ora.2112007144027',居然通过了,数据库起来了,终于松了口气,再通过pfile重建spfile文件
SQL>create spfile from pfile='/usr/oracle/admin/ora/pfile/init.ora.2112007144027'
File created.
然后正常重启oracle
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
终于搞定!