在Oracle 11g中用看Oracle的共享内存段---------IPCS

简介: Oracle 11g和10g共享内存段有什么不一样呢?

oracle@mydb ~]$ ipcs -a

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 32768 root 644 72 2
0x00000000 65537 root 644 16384 2
0x00000000 98306 root 644 280 2
0x00000000 1409028 oracle 640 4096 0
0x00000000 1441797 oracle 640 4096 0
0x079918e8 1474566 oracle 640 4096 0

------ Semaphore Arrays --------
key semid owner perms nsems
0x87a36da4 1343489 oracle 640 154

------ Message Queues --------
key msqid owner perms used-bytes messages
复制代码

今天突然想起,刚好有空,来总结一下:

上面显示Oracle共享内存段只有4096个字节,这太小了吧,哦,对了,我这是Oracle11g:

sys@OCM> select * from v$version;

BANNER

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
复制代码
Oraccle11g的对内存的管理用了两个新的参数:
sys@OCM> show parameter memory

NAME TYPE VALUE


hi_shared_memory_address integer 0
memory_max_target big integer 1G
memory_target big integer 0
shared_memory_address integer 0
复制代码

会不会是参数memory_max_target在作怪呢,把它关了试试,我这里把它设为0,然后重启数据库。
sys@OCM> alter system set memory_max_target=0 scope=spfile;

System altered.

sys@OCM> startup force;
ORACLE instance started.

Total System Global Area 943669248 bytes
Fixed Size 2234000 bytes
Variable Size 541067632 bytes
Database Buffers 394264576 bytes
Redo Buffers 6103040 bytes
Database mounted.
Database opened.
复制代码
再看共享内存:
[oracle@mydb ~]$ ipcs -a

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 32768 root 644 72 2
0x00000000 65537 root 644 16384 2
0x00000000 98306 root 644 280 2
0x00000000 1802244 oracle 640 4096 0
0x00000000 1835013 oracle 640 4096 0
0x079918e8 1867782 oracle 640 4096 0

------ Semaphore Arrays --------
key semid owner perms nsems
0x87a36da4 1736705 oracle 640 154

------ Message Queues --------
key msqid owner perms used-bytes messages
复制代码

怎么回事,没变啊?
是不是参数没改对,继续校验参数:
sys@OCM> show parameter mem

NAME TYPE VALUE


hi_shared_memory_address integer 0
memory_max_target big integer 904M
memory_target big integer 0
shared_memory_address integer 0
复制代码
果然没改过来,是不是命令alter system set memory_max_target=0 scope=spfile;没用啊,不能怎么设,但这命令本身设置重启也没报错。来个狠一点的命令重置默认值:
sys@OCM> alter system reset memory_max_target;

System altered.

sys@OCM> startup force;
ORACLE instance started.

Total System Global Area 680665088 bytes
Fixed Size 2231352 bytes
Variable Size 276825032 bytes
Database Buffers 394264576 bytes
Redo Buffers 7344128 bytes
Database mounted.
Database opened.
sys@OCM> show parameter mem

NAME TYPE VALUE


hi_shared_memory_address integer 0
memory_max_target big integer 0
memory_target big integer 0
shared_memory_address integer 0
复制代码
这下可以了,参数memory_max_target终于等于0了。我们再来看ORACLE共享内存:
[oracle@mydb ~]$ ipcs -a

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 32768 root 644 72 2
0x00000000 65537 root 644 16384 2
0x00000000 98306 root 644 280 2
0x00000000 1933316 oracle 640 12582912 30
0x00000000 1966085 oracle 640 671088640 30
0x079918e8 1998854 oracle 640 2097152 30

------ Semaphore Arrays --------
key semid owner perms nsems
0x87a36da4 1867777 oracle 640 154

------ Message Queues --------
key msqid owner perms used-bytes messages
复制代码
可以了!已从4096字节变成671088640多字节了。
,总结只要把参数memory_max_target设为0就能看到。这里不建议大家去这样改,只是为了解释一下这个现象。上面那幅图留给童鞋们思考,不再解释了。。。

相关文章
|
4月前
|
Oracle 关系型数据库 数据库
使用docker安装配置oracle 11g
使用docker安装配置oracle 11g
|
6月前
|
Oracle 关系型数据库 数据库
Oracle 11G常见性能诊断报告(AWR/ADDM/ASH)收集
Oracle 11G常见性能诊断报告(AWR/ADDM/ASH)收集
|
1月前
|
存储 Oracle 关系型数据库
手把手教你安装Oracle——以oracle 11g为例
手把手教你安装Oracle——以oracle 11g为例
手把手教你安装Oracle——以oracle 11g为例
|
4月前
|
SQL Oracle 关系型数据库
docker 方式安装ORACLE 11g
docker 方式安装ORACLE 11g
199 4
|
5月前
|
Oracle 关系型数据库 数据库
在Flink CDC中,使用Oracle 11g数据库的NUMBER类型作为主键
在Flink CDC中,使用Oracle 11g数据库的NUMBER类型作为主键
48 1
|
5月前
|
SQL Oracle 安全
window下Oracle 11G安装文档
window下Oracle 11G安装文档
|
7月前
|
Oracle 关系型数据库
Oracle 11g和12c的主要区别
Oracle 11g和12c的主要区别
|
9月前
|
Oracle 关系型数据库 数据库连接
Oracle 11g安装配置完美教程 - Windows(下)
Oracle 11g安装配置完美教程 - Windows(下)
154 0
|
9月前
|
SQL Oracle 安全
Oracle 11g安装配置完美教程 - Windows(上)
Oracle 11g安装配置完美教程 - Windows
748 0
|
安全 Oracle Java