二、Oracle的参数文件管理

1.参数文件的介绍

  两种参数文件:
   
   (1)spfile参数文件(二进制文件)
   (2)pfile参数文件(文本文件)

参数文件存储的路径:$ORACLE_HOME/dbs

[oracle@oracle3 dbs]$ ll
总计 56
-rw-r----- 1 oracle oinstall  1544 06-05 15:47 hc_LAW.dat
-rw-rw---- 1 oracle oinstall  1544 06-09 10:52 hc_ORCL.dat
-rw-r--r-- 1 oracle oinstall 12920 2001-05-03 initdw.ora
-rw-r----- 1 oracle oinstall  8385 1998-09-11 init.ora
-rw-r--r-- 1 oracle oinstall   987 06-09 09:28 initORCL.ora
-rw-r----- 1 oracle oinstall    24 06-04 16:20 lkORCL
-rw-r----- 1 oracle oinstall  1536 06-09 10:57 orapwORCL
-rw-r----- 1 oracle oinstall  2560 06-09 10:52 spfileORCL.ora
-rw-r----- 1 oracle oinstall  2584 06-09 09:38 sqlnet.log

spfileORCL.ora:ORCL实例的spfile文件

initORCL.ora:ORCL实例的pfile文件

注意:
   10gR2这个版本默认启动读取的是spfile文件,pfile文件在启动数据库的时候是不用的。

反解spfile文件:
SQL> create pfile from spfile;

File created.

强制使用pfile文件启动数据库
SQL> startup pfile='/u01/oracle/product/10.2.0/db_1/dbs/initORCL.ora';
ORACLE instance started.

Total System Global Area  608174080 bytes
Fixed Size            1268920 bytes
Variable Size          230687560 bytes
Database Buffers      373293056 bytes
Redo Buffers            2924544 bytes
Database mounted.
Database opened.

验证是使用pfile文件启动数据库
SQL> select value from v$parameter where name='spfile';

VALUE
--------------------------------------------------------------------------------

value值是空的,那么说明是使用pfile文件启动数据库

如果是使用spfile文件启动数据库,那么value值就是spfile文件的绝对路径

SQL> startup
ORACLE instance started.

Total System Global Area  608174080 bytes
Fixed Size            1268920 bytes
Variable Size          230687560 bytes
Database Buffers      373293056 bytes
Redo Buffers            2924544 bytes
Database mounted.
Database opened.
SQL> select value from v$parameter where name='spfile';

VALUE
--------------------------------------------------------------------------------
/u01/oracle/product/10.2.0/db_1/dbs/spfileORCL.ora


参数文件命名的格式:

spfile[ORACLE_SID].ora    --spfile文件的命名
init[ORACLE_SID].ora    --pfile文件的命名

oracle的参数:

ORCL.__db_cache_size=373293056
ORCL.__java_pool_size=33554432
ORCL.__large_pool_size=4194304
ORCL.__shared_pool_size=192937984
ORCL.__streams_pool_size=0
*.audit_file_dest='/u01/oracle/admin/ORCL/adump'
*.background_dump_dest='/u01/oracle/admin/ORCL/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/oracle/oradata/ORCL/control01.ctl','/u01/oracle/oradata/ORCL/control02.ctl','/u01/oracle/oradata/ORCL/control03.ctl'
*.core_dump_dest='/u01/oracle/admin/ORCL/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ORCL'
*.db_recovery_file_dest='/u01/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.job_queue_processes=10
*.local_listener='ORCL'
*.open_cursors=300
*.pga_aggregate_target=201326592
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=605028352
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/oracle/admin/ORCL/udump'