日期:2014-05-16  浏览次数:20508 次

Oracle参数文件的本质


环境:

SQL> select * from v$version where rownum=1;

BANNER
---------------------------------------------------------------- 
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod

SQL> !uname -r
2.6.18-308.el5xen
参数文件的根本作用就是“覆盖参数的默认值”,以便刻画出一个最适合自己应用场景的环境
因此参数文件中记录的都是我们调研的,与默认值存在不同
通过删除pfile参数文件中的的参数,可达到恢复参数为其默认值的目的
下面用一个实验来测试一下:
db_recovery_file_dest_size参数的作用是限制闪回恢复区可存放文件总大小
一旦将参数db_recovery_file_dest_size设置为非零值后“很难”恢复为默认值“0”。
这里我们用reset对spfile操作,来恢复为0

sys@ORCL> show parameter db_recovery_file_dest_size

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------ 
db_recovery_file_dest_size           big integer 2G

sys@ORCL> alter system reset db_recovery_file_dest_size scope=spfile sid='*';

System altered.

sys@ORCL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

sys@ORCL> create pfile from spfile;

编辑pfile 去掉DB_RECOVERY_FILE_DEST

SQL> startup pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora';
ORACLE instance started.

Total System Global Area  419430400 bytes
Fixed Size                  1219760 bytes
Variable Size             146801488 bytes
Database Buffers          268435456 bytes
Redo Buffers                2973696 bytes
Database mounted.
Database opened.
SQL> show parameter db_recovery_file_dest_size

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------ 
db_recovery_file_dest_size           big integer 0