(1)如果是dedicate连接,uga是驻留在pga中的;如果是shared连接,uga是驻留在sga中的。pga是不会占用sga的空间。两者是单独分配。
pga中包含sort_area_size和hash_area_size,当用户session使用sort或者hash操作时自然使用这两个空间的大小。
如果uga是驻留在sga中的,这两个操作所占用的内存是sga哪个部分啊?
fixed uga在中分配shared pool,variable UGA默认在large pool分配,如果large pool没设置或者各种原因导致从large pool中分配不到chunk,那么从shared pool中分配。
(2)书中对pga的解释是:
it is memory specific to a single operating system process or thread.This memory is not accessible by any other or memmap()
解释中提到的a single operating system process 是指啥子啊?怎么感觉和数据库没有关系,更像是操作系统层面上的东西啊。麻烦高手解释一下,谢谢!!
针对系统来说,是一个os的进程,这里的意思就是说pga和sga是不一样的,sga是在share segment中分配,pga只是process private memory。
如果我的数据库在进行运行期间,发现temp表空间急剧增加,可不可以认为我的pga分配空间不足够,因为如果pga空间足够,其中sort_area_size的大小应该能分配更多,导致排序操作可以尽量在内存中满足,而不是转到temp表空间上去。 我这个想法正确么?
如果能实现在完全内存中排序,当然就不会用到temp空间。
比上面的结果要小一些 是为什么啊? 应该以哪个为准啊?
show sga看到的Variable Size 包含了shared pool,large pool,java pool+the permanent memory arrays size。无所谓以哪个为准,不用这么细。
关于pga详情请参考
http://www.orawh.com/index.php/archives/45
http://www.orawh.com/index.php/archives/3
http://www.orawh.com/index.php/archives/25
http://www.orawh.com/index.php/archives/36