关闭或开启memory_target
對(duì)于Oracle數(shù)據(jù)庫(kù)內(nèi)存參數(shù)配置大小,一般滿足如下規(guī)則
?
sga_target + pga_aggregate_target < memory_target <=memory_max_targetsga_max_size < memory_targetPGA_AGGREGATE_TARGET= memory_target - sga_target?
?
本篇文檔,配置ASMM,ASM進(jìn)行轉(zhuǎn)換,進(jìn)行配置。
?
?
1.關(guān)閉ASM(關(guān)閉)memory_target
SQL> show parameter memory NAME VALUE ------------------------------ memory_max_target 800M memory_target 720MSQL> show parameter pga
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
pga_aggregate_target big integer 175M
SQL> show parameter sga
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
pre_page_sga boolean FALSE
sga_max_size big integer 800M
sga_target big integer 528M
******************關(guān)閉memory_target 兩種方法
方法一。參數(shù)修改方式
SQL> alter system reset memory_max_target;
SQL> alter system set memory_target=0;
SQL> alter system set memory_max_target=0 scope=spfile;
SQL> alter system set memory_target=0;
SQL> shutdown immediate;
SQL> alter system set memory_target=0 scope=spfile; 要么數(shù)據(jù)庫(kù)實(shí)例無(wú)法啟動(dòng),要么并沒(méi)有關(guān)閉memory管理方式
方法三。編輯參數(shù)文件方式
SQL> create pfile='/tmp/pfile.ora' from spfile;
vi /tmp/pfile.ora
修改前
*.memory_max_target=0
*.memory_target=0
修改后
#*.memory_max_target=0
#*.memory_target=0
SQL> startup
?
2.啟用ASM管理
?
參數(shù)說(shuō)明
Memory_max_target 代表Oracle數(shù)據(jù)庫(kù)總內(nèi)存最大值memory_target 代表總內(nèi)存最小值參數(shù)限制:memory_max_target(初始化參數(shù):需要重啟生效)Linux環(huán)境下:memory_max_target=>受到操作系統(tǒng)shared memory的影響:memory_max_target < /etc/fstab報(bào)錯(cuò)描述:ORA-00845: MEMORY_TARGET not supported on this system參數(shù)查看:[root@hukou ~]# df -h |grep tmpfs tmpfs 1.7G 0 1.7G 0% /dev/shm操作系統(tǒng)shared memory大小增加:默認(rèn)為系統(tǒng)整體內(nèi)存的一半大小:修改后,size指定值解決方案:增加:vi /etc/fstab tmpfs /dev/shm tmpfs defaults,size=3200m 0 0[root@hukou ~]# mount -o remount /dev/shm [root@hukou ~]# df -h |grep shm tmpfs 3.2G 0 3.2G 0% /dev/shm參數(shù)限制:memory_target(在線即可修改)報(bào)錯(cuò)信息: 內(nèi)存的最小值:需要小于或者等于內(nèi)存的最大值ORA-00837: Specified value of MEMORY_TARGET greater than MEMORY_MAX_TARGETmemory_target <= memory_max_target報(bào)錯(cuò)信息:內(nèi)存的最小值小于512MORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least512Mmemory_target > sga_target +pga_aggregate_targetsga_target big integer 400Mpga_aggregate_target big integer 100M參數(shù)限制:sga_max_size(初始化參數(shù):需要重啟生效)參數(shù)說(shuō)明: SGA區(qū)域內(nèi)存最大值報(bào)錯(cuò)信息:sga_max_size的值大于memory_target ORA-00851: SGA_MAX_SIZE 1048576000 cannot be set to more than MEMORY_TARGET 629145600.sga_max_size < memory_target參數(shù)限制:sga_target(在線修改即可)參數(shù)說(shuō)明:SGA區(qū)域內(nèi)存最小值報(bào)錯(cuò)信息:SGA_TARGET 的值大于sga_max_sizeORA-00823: Specified value of sga_target greater than sga_max_sizeSQL> show parameter pga NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ pga_aggregate_target big integer 100M參數(shù)限制:pga_aggregate_target (在線修改即可)
?
?使用ASM管理,啟用memory參數(shù)
?
當(dāng)前內(nèi)存參數(shù) SQL> show parameter sgaNAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ lock_sga boolean FALSE pre_page_sga boolean FALSE sga_max_size big integer 528M sga_target big integer 528M SQL> show parameter pgaNAME TYPE VALUE ------------------------------------ ---------------------- ------------------------------ pga_aggregate_target big integer 192M按照規(guī)則,如果不修改sga/pga內(nèi)存大小,那么memory_target >620M,memory_max_target >620M, memory_max_target小于操作系統(tǒng)內(nèi)存參數(shù)最大值3.9G
enmo:/home/oracle df -h |grep tmpfs
tmpfs 3.9G 0 3.9G 0% /dev/shm
本次參數(shù)配置: memory_target =620M,memory_max_target=2200m;
方法一:
SQL> alter system set memory_target=620m scope=spfile;
SQL> alter system set memory_max_target=2200m scope=spfile;
SQL> shutdown immediate;
---本次小學(xué)生算數(shù)錯(cuò)誤,因此啟動(dòng)報(bào)錯(cuò)
ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 720M
---由于本次數(shù)據(jù)庫(kù)已關(guān)閉,因此無(wú)法通過(guò)sqlplus alter system 修改參數(shù),可以通過(guò)手工編輯參數(shù)文件。? ?開車沒(méi)開好
方法二:
SQL> create pfile='/tmp/pfile.ora' from spfile;
vi /tmp/pfile.ora
修改前
?
*.memory_max_target=2306867200
*.memory_target=650117120
修改后
*.memory_max_target=2306867200
*.memory_target=720m
SQL> create spfile from pfile='/tmp/pfile.ora';
SQL> startup
SQL> show parameter memory
NAME TYPE VALUE
------------------------------------ ---------------------- ------------------------------
hi_shared_memory_address integer 0
memory_max_target big integer 2208M
memory_target big integer 720M
?
轉(zhuǎn)載于:https://www.cnblogs.com/lvcha001/p/7892871.html
總結(jié)
以上是生活随笔為你收集整理的关闭或开启memory_target的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 库对比工具mysqldiff使用
- 下一篇: hashCode()方法(覆盖hashC