oracle 11g修改 memory_max_target和memory_target

测试过程中想要调整oracle的内存设置,进行如下操作:


SQL> show parameter memory_max_target

NAME TYPE VALUE


memory_max_target big integer 10G
SQL> show parameter memory_target

NAME TYPE VALUE


memory_target big integer 10G
SQL> alter system set memory_max_target=36G;
alter system set memory_max_target=36G
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified

SQL> alter system set memory_target=36G;
alter system set memory_target=36G

ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00837: Specified value of MEMORY_TARGET greater than MEMORY_MAX_TARGET

SQL> show parameter memory

NAME TYPE VALUE


hi_shared_memory_address integer 0
memory_max_target big integer 10G
memory_target big integer 10G
shared_memory_address integer 0
SQL> alter system set memory_max_target=36G scope=spfile;

System altered.

SQL> alter system set memory_target=36G scope=spfile;

System altered.

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 10G
memory_target big integer 10G
parallel_servers_target integer 96
pga_aggregate_target big integer 0
sga_target big integer 0
SQL> shu immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-00845: MEMORY_TARGET not supported on this system
SQL> startup
ORACLE instance started.

Total System Global Area 3.8482E+10 bytes
Fixed Size 2215704 bytes
Variable Size 2.0133E+10 bytes
Database Buffers 1.8254E+10 bytes
Redo Buffers 93642752 bytes
Database mounted.
Database opened.
SQL>

中间出现ORA-00845: MEMORY_TARGET not supported on this system导致无法启动数据库,是因为设置的memory_target 超出了操作系统的虚拟内存 /dev/shm

vim /etc/fstab

/etc/fstab

Created by anaconda on Wed Sep 17 16:07:17 2014

Accessible filesystems, by reference, are maintained under '/dev/disk'

See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

UUID=512c5b24-c85c-46be-804a-d7318b8578f9 / ext4 defaults 1 1
UUID=ee652fe8-ca59-40fa-b80c-b239631b8451 /boot ext2 defaults 1 2
UUID=a9de50b8-4ac3-4887-80a4-928f4d7f5dd5 /data1 ext4 defaults 1 2
UUID=ff49ce48-e4f4-4c1a-95e2-80dfef47a772 /data2 ext4 defaults 1 2

UUID=68c8714b-7b6d-4608-92d4-5460a29787f2 /data3 ext4 defaults 1 2

UUID=2343ead8-8dd4-4e1b-827e-4257ed622f5f /data4 ext4 defaults 1 2

UUID=609a5f91-8e50-408b-949b-9b33f5536036 swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults,size=48G 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
~


保存后重新mount一下

root@db~]# umount /dev/shm
umount: /dev/shm: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
[root@db ~]# lsof |grep shm
db2sysc 3433 db2inst1 mem REG 0,16 4096 24061 /dev/shm/DB2_SELF_TUNING_MEMORY_MANAGER_CROSS_INSTANCE_SHARED_MEMORY_SEGMENT
[root@db ~]# kill -9 3433
[root@db ~]# lsof |grep shm
[root@db bin]# umount /dev/shm
[root@db bin]# mount /dev/shm
[root@db bin]# df -h
文件系统 容量 已用 可用 已用%% 挂载点
/dev/sda3 774G 300G 436G 41% /
/dev/sda1 2.0G 29M 1.8G 2% /boot
/dev/sdb1 825G 547G 237G 70% /data1
/dev/sdc1 825G 124G 660G 16% /data2
tmpfs 48G 0 48G 0% /dev/shm

你可能感兴趣的:(oracle 11g修改 memory_max_target和memory_target)