1.
sga_max_size;是静态的必须重启之后生效需要加scope=spfile;(不要超过物理内存值)
SQL> alter system set sga_max_size=500M scope=spfile; System altered.
sga_target 可以即时生效;不指定scope=spfile即可。
SQL> alter system set sga_target=500M; System altered.
sga_target 不能超过sga_max_size 的值,否则报错
show parameter target;查看
SQL> show parameter target; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ archive_lag_target integer 0 db_flashback_retention_target integer 1440 fast_start_io_target integer 0 fast_start_mttr_target integer 0 memory_max_target big integer 0 memory_target big integer 0 parallel_servers_target integer 32 pga_aggregate_target big integer 252M sga_target big integer 760M SQL> show parameter memory;
当因为sga_target的值太大,造成数据库起不来时,就需要到spfile或pfile下修改参数.
SQL> alter system set sga_max_size=20G scope=spfile; System altered. SQL> alter system set sga_target=20G; alter system set sga_target=20G * ERROR at line 1: ORA-02097: parameter cannot be modified because specified value is invalid ORA-00823: Specified value of sga_target greater than sga_max_size
最好强制关闭一下库; shutdown abort
找到spfile的位置,用strings查看
strings spfileorcl.ora #查看 strings spfileorcl.ora > /tmp/dbs.ora #将spfile导出到/tem下
/tem为临时目录
然后打开 vi /tem/dbs.ora 开始修改,修改中保证一下文件里的格式不要错(相关数据在一行,不要换行)
修改完成后startup pfile='/tem/dbs.ora'打开
然后再将 打开文件指定为spfile即可