當實體記憶體小於sga+pga時
1,檢視當前系統的實體記憶體
[oracle@node1 ~]$ free -m
total used free shared buffers cached
Mem: 2026 1288 738 0 75 1051
-/+ buffers/cache: 161 1865
Swap: 2047 0 2047
2,開啟資料庫,備份pfile,並檢視當前記憶體和swap的使用率
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 9 20:48:52 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SYS@ test>startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 633343568 bytes
Database Buffers 209715200 bytes
Redo Buffers 5132288 bytes
Database mounted.
Database opened.
SYS@ test>
SYS@ test>
[oracle@node1 ~]$ top
top - 20:50:14 up 6 min, 2 users, load average: 2.55, 0.75, 0.28
Tasks: 137 total, 2 running, 135 sleeping, 0 stopped, 0 zombie
Cpu(s): 4.3%us, 1.6%sy, 0.0%ni, 69.6%id, 23.3%wa, 0.2%hi, 0.9%si, 0.0%st
Mem: 2075468k total, 1351256k used, 724212k free, 76984k buffers
Swap: 2097144k total, 0k used, 2097144k free, 1073448k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3007 oracle 18 0 968m 50m 47m D 8.0 2.5 0:00.25 oracle
1 root 15 0 2072 632 544 S 0.0 0.0 0:00.25 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.03 events/0
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
7 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kblockd/0
11 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
49 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
52 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
54 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
118 root 16 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
119 root 25 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
120 root 15 0 0 0 0 S 0.0 0.0 0:00.02 pdflush
121 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kswapd0
122 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
271 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
295 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
296 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
299 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
300 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
301 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
306 root 13 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
315 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ksnapd
326 root 10 -5 0 0 0 S 0.0 0.0 0:00.02 kjournald
352 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kauditd
385 root 21 -4 2480 944 392 S 0.0 0.0 0:00.09 udevd
885 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 iprt/0
3,修改memory_target pga sga的大小
SYS@ test>create pfile='/home/oracle/init.ora' from spfile;
File created.
SYS@ test>alter system set memory_max_target=3g scope=spfile;
System altered.
SYS@ test>alter system set sga_target=2g scope=spfile;
System altered.
SYS@ test>alter system set pga_aggregate_target=100m scope=spfile;
System altered.
4,從新開啟資料庫 ,檢視pga和sga的記憶體變大了,同時swap空間的使用率上升了。
SYS@ test>shutdown abort;
ORACLE instance shut down.
SYS@ test>startup
ORA-00845: MEMORY_TARGET not supported on this system
[root@node1 ~]# mount -t tmpfs shmfs -o size=7g /dev/shm
[root@node1 ~]# df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
shmfs 7.0G 0 7.0G 0% /dev/shm
SYS@ test>startup
ORACLE instance started.
Total System Global Area 2142715904 bytes
Fixed Size 1337688 bytes
Variable Size 369100456 bytes
Database Buffers 1761607680 bytes
Redo Buffers 10670080 bytes
Database mounted.
Database opened.
SYS@ test>show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 2G
sga_target big integer 2G
SYS@ test>show parameter pga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target big integer 100M
[root@node1 ~]# top
top - 21:08:59 up 24 min, 2 users, load average: 0.31, 0.46, 0.43
Tasks: 124 total, 3 running, 121 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 98.4%id, 0.0%wa, 0.0%hi, 1.3%si, 0.0%st
Mem: 2075468k total, 2014620k used, 60848k free, 2840k buffers
Swap: 2097144k total, 1549140k used, 548004k free, 759264k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 15 0 2072 632 544 S 0.0 0.0 0:00.27 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.15 events/0
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
7 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kblockd/0
11 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
49 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
52 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
54 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
118 root 15 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
119 root 15 0 0 0 0 S 0.0 0.0 0:00.01 pdflush
120 root 15 0 0 0 0 S 0.0 0.0 0:00.05 pdflush
121 root 19 -5 0 0 0 S 0.0 0.0 0:00.37 kswapd0
122 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
271 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
295 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
296 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
299 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
300 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
301 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
306 root 13 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
315 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ksnapd
326 root 10 -5 0 0 0 S 0.0 0.0 0:00.04 kjournald
352 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kauditd
385 root 21 -4 2480 944 392 S 0.0 0.0 0:00.09 udevd
885 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 iprt/0
1373 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kmpathd/0
SYS@ test>shutdown abort
ORACLE instance shut down.
5,恢復資料庫
SYS@ test>startup pfile='/home/oracle/init.ora';
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 633343568 bytes
Database Buffers 209715200 bytes
Redo Buffers 5132288 bytes
Database mounted.
Database opened.
SYS@ test>create spfile='/u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora' from pfile='/home/oracle/init.ora';
File created.
SYS@ test>shutdown abort
ORACLE instance shut down.
SYS@ test>startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 633343568 bytes
Database Buffers 209715200 bytes
Redo Buffers 5132288 bytes
Database mounted.
Database opened.
[oracle@node1 ~]$ free -m
total used free shared buffers cached
Mem: 2026 1288 738 0 75 1051
-/+ buffers/cache: 161 1865
Swap: 2047 0 2047
2,開啟資料庫,備份pfile,並檢視當前記憶體和swap的使用率
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 9 20:48:52 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SYS@ test>startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 633343568 bytes
Database Buffers 209715200 bytes
Redo Buffers 5132288 bytes
Database mounted.
Database opened.
SYS@ test>
SYS@ test>
[oracle@node1 ~]$ top
top - 20:50:14 up 6 min, 2 users, load average: 2.55, 0.75, 0.28
Tasks: 137 total, 2 running, 135 sleeping, 0 stopped, 0 zombie
Cpu(s): 4.3%us, 1.6%sy, 0.0%ni, 69.6%id, 23.3%wa, 0.2%hi, 0.9%si, 0.0%st
Mem: 2075468k total, 1351256k used, 724212k free, 76984k buffers
Swap: 2097144k total, 0k used, 2097144k free, 1073448k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3007 oracle 18 0 968m 50m 47m D 8.0 2.5 0:00.25 oracle
1 root 15 0 2072 632 544 S 0.0 0.0 0:00.25 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.03 events/0
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
7 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kblockd/0
11 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
49 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
52 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
54 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
118 root 16 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
119 root 25 0 0 0 0 S 0.0 0.0 0:00.00 pdflush
120 root 15 0 0 0 0 S 0.0 0.0 0:00.02 pdflush
121 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kswapd0
122 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
271 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
295 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
296 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
299 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
300 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
301 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
306 root 13 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
315 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ksnapd
326 root 10 -5 0 0 0 S 0.0 0.0 0:00.02 kjournald
352 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kauditd
385 root 21 -4 2480 944 392 S 0.0 0.0 0:00.09 udevd
885 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 iprt/0
3,修改memory_target pga sga的大小
SYS@ test>create pfile='/home/oracle/init.ora' from spfile;
File created.
SYS@ test>alter system set memory_max_target=3g scope=spfile;
System altered.
SYS@ test>alter system set sga_target=2g scope=spfile;
System altered.
SYS@ test>alter system set pga_aggregate_target=100m scope=spfile;
System altered.
4,從新開啟資料庫 ,檢視pga和sga的記憶體變大了,同時swap空間的使用率上升了。
ORACLE instance shut down.
SYS@ test>startup
ORA-00845: MEMORY_TARGET not supported on this system
[root@node1 ~]# mount -t tmpfs shmfs -o size=7g /dev/shm
[root@node1 ~]# df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
shmfs 7.0G 0 7.0G 0% /dev/shm
SYS@ test>startup
ORACLE instance started.
Total System Global Area 2142715904 bytes
Fixed Size 1337688 bytes
Variable Size 369100456 bytes
Database Buffers 1761607680 bytes
Redo Buffers 10670080 bytes
Database mounted.
Database opened.
SYS@ test>show parameter sga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
lock_sga boolean FALSE
pre_page_sga boolean FALSE
sga_max_size big integer 2G
sga_target big integer 2G
SYS@ test>show parameter pga
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target big integer 100M
[root@node1 ~]# top
top - 21:08:59 up 24 min, 2 users, load average: 0.31, 0.46, 0.43
Tasks: 124 total, 3 running, 121 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.3%sy, 0.0%ni, 98.4%id, 0.0%wa, 0.0%hi, 1.3%si, 0.0%st
Mem: 2075468k total, 2014620k used, 60848k free, 2840k buffers
Swap: 2097144k total, 1549140k used, 548004k free, 759264k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 15 0 2072 632 544 S 0.0 0.0 0:00.27 init
2 root RT -5 0 0 0 S 0.0 0.0 0:00.00 migration/0
3 root 34 19 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0
4 root RT -5 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
5 root 10 -5 0 0 0 S 0.0 0.0 0:00.15 events/0
6 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khelper
7 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kthread
10 root 10 -5 0 0 0 S 0.0 0.0 0:00.01 kblockd/0
11 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kacpid
49 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 cqueue/0
52 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 khubd
54 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 kseriod
118 root 15 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
119 root 15 0 0 0 0 S 0.0 0.0 0:00.01 pdflush
120 root 15 0 0 0 0 S 0.0 0.0 0:00.05 pdflush
121 root 19 -5 0 0 0 S 0.0 0.0 0:00.37 kswapd0
122 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 aio/0
271 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
295 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata/0
296 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ata_aux
299 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
300 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
301 root 10 -5 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
306 root 13 -5 0 0 0 S 0.0 0.0 0:00.00 kstriped
315 root 17 -5 0 0 0 S 0.0 0.0 0:00.00 ksnapd
326 root 10 -5 0 0 0 S 0.0 0.0 0:00.04 kjournald
352 root 11 -5 0 0 0 S 0.0 0.0 0:00.00 kauditd
385 root 21 -4 2480 944 392 S 0.0 0.0 0:00.09 udevd
885 root 12 -5 0 0 0 S 0.0 0.0 0:00.00 iprt/0
1373 root 20 -5 0 0 0 S 0.0 0.0 0:00.00 kmpathd/0
SYS@ test>shutdown abort
ORACLE instance shut down.
5,恢復資料庫
SYS@ test>startup pfile='/home/oracle/init.ora';
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 633343568 bytes
Database Buffers 209715200 bytes
Redo Buffers 5132288 bytes
Database mounted.
Database opened.
SYS@ test>create spfile='/u01/app/oracle/product/11.2.0/db_1/dbs/spfile.ora' from pfile='/home/oracle/init.ora';
File created.
SYS@ test>shutdown abort
ORACLE instance shut down.
SYS@ test>startup
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 633343568 bytes
Database Buffers 209715200 bytes
Redo Buffers 5132288 bytes
Database mounted.
Database opened.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29108064/viewspace-1293458/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 關於程式的實體記憶體RSS記憶體
- 當出現記憶體洩漏的時候記憶體
- 使用LiME收集主機實體記憶體的內容時發生當機記憶體
- 實體記憶體和虛擬記憶體記憶體
- 記憶體管理篇——實體記憶體的管理記憶體
- 關於redis記憶體分析,記憶體優化Redis記憶體優化
- 虛擬記憶體到實體記憶體(32位)記憶體
- 【Java基礎】實體記憶體&虛擬記憶體Java記憶體
- 當Linux用盡記憶體Linux記憶體
- linux記憶體管理(一)實體記憶體的組織和記憶體分配Linux記憶體
- 記憶體管理兩部曲之實體記憶體管理記憶體
- 當composer update卡住或提示記憶體不足時的分析記憶體
- Redis 記憶體優化神技,小記憶體儲存大資料Redis記憶體優化大資料
- 如何檢視linux系統中空閒記憶體/實體記憶體使用/剩餘記憶體Linux記憶體
- 記憶體管理中關於記憶體每次增長的大小記憶體
- Redis記憶體——記憶體消耗(記憶體都去哪了?)Redis記憶體
- 記憶體_大頁記憶體記憶體
- 關於autoreleasepool記憶體管理記憶體
- 關於記憶體錯誤記憶體
- 關於記憶體對齊記憶體
- filebeat實踐-記憶體佔用-最大記憶體佔用記憶體
- 如何讓手遊記憶體佔用更小?從記憶體消耗iOS實時統計開始記憶體iOS
- Linux讀寫實體記憶體Linux記憶體
- 記憶體管理 記憶體管理概述記憶體
- 【記憶體管理】記憶體佈局記憶體
- 實體記憶體過高怎麼辦 實體記憶體使用率高的解決方法記憶體
- TimesTen臨時(記憶體)空間使用和調整臨時(記憶體)空間記憶體
- OpenResty 和 Nginx 的共享記憶體區是如何消耗實體記憶體的RESTNginx記憶體
- 計算機作業系統——虛擬記憶體與實體記憶體計算機作業系統記憶體
- Sql Server實體記憶體及虛擬記憶體設定的總結SQLServer記憶體
- C++記憶體管理:簡易記憶體池的實現C++記憶體
- oracle體系結構梳理---SGA+PGAOracle
- JAVA堆外記憶體排查小結Java記憶體
- 關於C中記憶體操作記憶體
- 關於快閃記憶體磁碟記憶體
- 遊戲記憶體對比普通記憶體區別 遊戲記憶體和普通記憶體相差大嗎?遊戲記憶體
- oracle實驗記錄 關於記憶體的幾個viewOracle記憶體View
- Go:記憶體管理與記憶體清理Go記憶體