一、oracle10g修改pga和sga
1、生产系统新安装的数据库sga和pga的设置原则
(1)
##sga_target=totalmem*80%*80% pga_aggregate_target=totalmem*80%*20%
##sga_target/pga_aggregate_target=3
(2)init<SID>.ora在首次使用create pfile命令后才会创建
SQL> show parameter sga_max_sizeNAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_max_size big integer 3584M
SQL> show parameter sga_target
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
sga_target big integer 3584M
SQL> show parameter pga_aggregate_target
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target big integer 1190M
SQL> alter system set sga_max_size=1785 scope=both; ##默认是kb
alter system set sga_max_size=1785 scope=both
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
SQL> alter system set sga_max_size=1785 scope=spfile; ##记得加m
System altered.
SQL> alter system set sga_target=1785 scope=spfile;
System altered.
SQL> alter system set pga_aggregate_target=595m scope=spfile;
System altered.
##需要重启生效
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup open;
ORA-00821: Specified value of sga_target 4M is too small, needs to be at least 36M
$ cd /oracle/product/10.2.0/dbs
$ ll
总用量 44
-rw-rw----. 1 oracle oinstall 1544 5月 7 17:32 hc_boss.dat
-rw-r--r--. 1 oracle oinstall 12920 5月 3 2001 initdw.ora
-rw-r-----. 1 oracle oinstall 8385 9月 11 1998 init.ora
-rw-rw----. 1 oracle oinstall 24 5月 6 02:36 lkBOSS
-rw-r-----. 1 oracle oinstall 1536 5月 6 15:59 orapwboss
-rw-r-----. 1 oracle oinstall 2560 5月 7 17:27 spfileboss.ora
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.5.0 - Production on Wed May 7 17:36:10 2014
Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> create pfile from spfile; --创建后,出现initboss.ora
File created.
SQL> exit
Disconnected
$ ll
总用量 48
-rw-rw----. 1 oracle oinstall 1544 5月 7 17:32 hc_boss.dat
-rw-r--r-- 1 oracle oinstall 970 5月 7 17:36 initboss.ora
-rw-r--r--. 1 oracle oinstall 12920 5月 3 2001 initdw.ora
-rw-r-----. 1 oracle oinstall 8385 9月 11 1998 init.ora
-rw-rw----. 1 oracle oinstall 24 5月 6 02:36 lkBOSS
-rw-r-----. 1 oracle oinstall 1536 5月 6 15:59 orapwboss
-rw-r-----. 1 oracle oinstall 2560 5月 7 17:27 spfileboss.ora
$ vi initboss.ora
*.sga_max_size=1871708160
*.sga_target=1871708160
SQL> create pfile from spfile; --创建后,出现initboss.ora
$ cp -rf initboss.ora initboss.ora.bak