oracle 修改sga 报错 及解决方法
1、如何修改sga_max_size参数SQL> show parameter spfileNAME TYPE VALUE------------------------------------ ----------- ------------------------------spfile string /oracle/product/10.2/db_1/dbs/ spfilezytk32.oraSQL> show parameter sgaNAME TYPE VALUE------------------------------------ ----------- ------------------------------lock_sga boolean FALSEpre_page_sga boolean FALSEsga_max_size big integer 2Gsga_target big integer 2GSQL> alter system set sga_max_size=2560M scope=spfile;System altered.SQL> show parameter sgaNAME TYPE VALUE------------------------------------ ----------- ------------------------------lock_sga boolean FALSEpre_page_sga boolean FALSEsga_max_size big integer 2Gsga_target big integer 2GSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL>startupORA-27123: unable to attach to shared memory segment 接下去我手动修改了spfilezytk32.ora文件的sga_max_size为原来2G的大小(由于这一步操作导致我接下去启动数据库又有问题,其实spfile是二进制文件不能手动去vi编辑,这样就破坏了spfile,才有了下面的报错SQL> startupORA-01078: failure in processing system parametersLRM-00109: could not open parameter file '/opt/oracle10g/product/10.2/db_1/dbs/initzytk32.ora'无法启动数据库,发现出现问题,是我没有pfile文件,默认数据库从spfile启动,现在我spfile破坏了又没有pfile文件就报这个错误了。现在只能先去创建pfile文件,再通过pfile文件恢复spfile文件[oracle@xxx dbs]$ cd $ORACLE_BASE[oracle@xxx oracle]$ lsadmin flash_recovery_area oradata oraInventory product[oracle@xxx oracle]$ cd admin[oracle@xxx admin]$ lszytk32[oracle@xxx admin]$ cd zytk32[oracle@xxx zytk32]$ lsadump bdump cdump dpdump pfile udump[oracle@xxx zytk32]$ cd pfile[oracle@xxx pfile]$ lsinit.ora.728201221849[oracle@xxx pfile]$cp init.ora.728201221849 $ORACLE_HOME/dbs/initzytk32.ora[oracle@xxx pfile]$ cd $ORACLE_HOME/dbs[oracle@xxx dbs]$ lshc_zytk32.dat initdw.ora init.ora initzytk32.ora lkZYTK32 orapwzytk32 snapcf_zytk32.f spfilezytk32.ora坐到这里我恢复了pfile文件initzytk32.ora,能够正常启动oracle数据库,此时是通过pfile文件启动oracle的。SQL> show parameter pfileNAME TYPE VALUE------------------------------------ ----------- ------------------------------spfile stringSQL> show parameter sgaNAME TYPE VALUE------------------------------------ ----------- ------------------------------lock_sga boolean FALSEpre_page_sga boolean FALSEsga_max_size big integer 2Gsga_target big integer 2G接下去我是要通过pfile文件create spfile文件,SQL> create spfile='/oracle/product/10.2/db_1/dbs/spfilezytk32.ora' from pfile='/oracle/product/10.2/db_1/dbs/initzytk32.ora';File created.[oracle@xxx dbs]$ ls -alæ