日期:2014-05-16 浏览次数:20372 次
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/11924597
正确答案:CD(题库给出的答案是AD,大家要相信自己,有些答案是错的!一切以实战为依据)
一、我们先来看Oracle 11g内存架构图,来自OCP教材:
二、内存参数的一些关系:
memory_max_target、 memory_target、sga_max_size、sga_target、pga_aggregate_target
1、 sga_target=0 ,pga_aggregate_target=0 -〉完全自动管理,SGA=memory_target*60% PGA=memory_target*40%
2、 sga_target=600(最小值) ,pga_aggregate_target=200(最小值) -〉memory_target=sga_target+pga_aggregate_target
3、 sga_target=600,pga_aggregate_target=0 -〉pga_aggregate_target=memory_target-sga_target
4、 sga_target=0,pga_aggregate_target=200 -〉sga_target=memory_target-pga_aggregate_target
了解了内存的基本知识后,我们一起来解题:
答案A,不正确
根据题意,我们来实验一把:
1、设置参数
sys@OCM> alter system set memory_max_target=0 scope=spfile; System altered. sys@OCM> alter system set memory_target=804M; System altered. sys@OCM> alter system set pga_aggregate_target=90M; System altered. sys@OCM> alter system set sga_target=270M; System altered.
2、重启数据库,报错如下
sys@OCM> startup force; ORA-00837: Specified value of MEMORY_TARGET greater than MEMORY_MAX_TARGET sys@OCM> show parameter mem ORA-01034: ORACLE not available Process ID: 0 Session ID: 148 Serial number: 493
3、 从spfile创建出一个pfile
sys@OCM> create pfile='/tmp/pfile.ora' from spfile; ERROR: OCI-21710: argument is expecting a valid memory address of an object File created.
4、 查pfile中memory_max_target的值,结果看到:
[root@mydb tmp]# more /temp/pfile.ora ocm.__db_cache_size=343932928 ocm.__java_pool_size=4194304 ocm.__large_pool_size=4194304 ocm.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment ocm.__pga_aggregate_target=159383552 ocm.__sga_target=683671552 ocm.__shared_io_pool_size=0 ocm.__shared_pool_size=314572800 ocm.__streams_pool_size=4194304 *.audit_file_dest='/u01/app/oracle/admin/ocm/adump' *.audit_trail='db' *.compatible='11.2.0.0.0' *.control_files='/u01/app/oracle/oradata/ocm/control01.ctl','/u01/app/oracle/oradata/ocm/control02.ctl' *.db_block_size=8192 *.db_domain='' *.db_name='ocm' *.diagnostic_dest='/u01/app/oracle' *.dispatchers='(PROTOCOL=TCP) (SERVICE=ocmXDB)' *.log_archive_dest_1='location=/arch' *.memory_max_target=0 *.memory_target=842006528 *.open_cursors=300 *.pga_aggregate_target=94371840 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=285212672 *.undo_tablespace='UNDOTBS1'
从上面的参数可以看出memory_max_target=0,还没有自动变为804M,所以不正确。实际上memory_max_target是控制memory_target的值不能超过它。
答案B,不正确,我们从上面的参数可以看出:pga_aggregate_target=94371840和sga_target=285212672,而并非为0