1、操作 (oracle使用內存約等於 SGA+PGA,所以可以減少SGA與PGA解決你的問題,生產庫慎用)
alter system set sga_max_size=100m scope=spfile; --減少SGA大小,靜態參數,重啟后生效
alter system set sga_target=80m scope=both; --動態參數;oracle推薦:啟動時修改此參數,不要動態設置此參數
alter system set pga_aggregate_target=40m sope=both; ---減少pga大小
2、拓展
SGA_MAX_SIZE的大小不是隨意指定的,必須滿足一定條件的。
sga_max_size=100M,必須滿足SGA所有組件的最小和;至少滿足db_cache_size,log_buffer,shared_pool_size,large_pool_size,java_pool_size總和的大小)
alter system set sga_max_size=100m scope=spfile; --減少SGA大小,靜態參數,重啟后生效
alter system set sga_target=80m scope=both; --動態參數;oracle推薦:啟動時修改此參數,不要動態設置此參數
alter system set pga_aggregate_target=40m sope=both; ---減少pga大小
2、拓展
SGA_MAX_SIZE的大小不是隨意指定的,必須滿足一定條件的。
sga_max_size=100M,必須滿足SGA所有組件的最小和;至少滿足db_cache_size,log_buffer,shared_pool_size,large_pool_size,java_pool_size總和的大小)
oracle內存結構介紹: Introduction to Oracle Memory Structures Oracle uses memory to store information such as the following: Program code Information about a connected session, even if it is not currently active Information needed during program execution (for example, the current state of a query from which rows are being fetched) Information that is shared and communicated among Oracle processes (for example, locking information) Cached data that is also permanently stored on peripheral memory (for example, data blocks and redo log entries) The basic memory structures associated with Oracle include: System Global Area (SGA), which is shared by all server and background processes. Program Global Areas (PGA), which is private to each server and background process; there is one PGA for each process. 1.sqlplus “/ as sysdba" 2. 3.create pfile='d:/cj.ora' from spfile; 然后去你的oracle安裝目錄 找一個init數據庫名。ora這樣一個文件 把幾個oracle內存參數改小點 一個2G的內存是如下配置的: *.sga_max_size=712M *.large_pool_size=8M *.shared_pool_size=250M *.sort_area_size=0.5M *.db_cache_size=350M 然后shutdown數據庫 1.shutdown immediate; 2. 3.create spfile from pfile='d:/cj2.ora'; 4. 5.startup; 然后啟動,就可以了。 以上就是調整oracle內存參數,減少數據庫內存占用的方法介紹。 |