一、dbs目下的文件简述
1、在$下有如下文件
[oracle@ocmserver dbs]$ ls -lh total 20M -rw-rw---- 1 oracle oinstall 1.6K Jun 23 22:09 hc_ocm.dat -rw-r----- 1 oracle oinstall 13K May 3 2001 initdw.ora -rw-r----- 1 oracle oinstall 8.2K Sep 11 1998 init.ora -rw-r----- 1 oracle oinstall 6.0M Jun 24 18:13 ora_control1 -rw-r----- 1 oracle oinstall 6.0M Jun 24 18:13 ora_control2 -rw-r----- 1 oracle oinstall 1.5K Jun 25 18:48 orapwocm -rw-r----- 1 oracle oinstall 7.1M Jun 25 22:50 snapcf_ocm.f -rw-r----- 1 oracle oinstall 2.5K Jun 29 14:18 spfileocm.ora [oracle@ocmserver dbs]$
2、hc_ocm.ddat文件
[oracle@ocmserver dbs]$ file hc_ocm.dat
hc_ocm.dat: data
[oracle@ocmserver dbs]$ strings hc_ocm.dat
DO NOT DELETE OR OVERWRITE THIS FILE!!!
[oracle@ocmserver dbs]$ more hc_ocm.dat
DO NOT DELETE OR OVERWRITE THIS FILE!!!
ocm
[oracle@ocmserver dbs]$
说明:这是一个data文件,文件命名格式为:hc_<SID>.dat。其内容就一句话:不要删除或覆盖此文件。
在官网有个简单的介绍:http://docs.oracle.com/cd/B19306_01/install.102/b14203/postinst.htm#RILIN1107
说是内存图文件(memory-mapped files)
If your RAC database is created on Oracle Cluster File System version 1 (OCFS1), and the memory-mapped files hc_*.dat (which typically reside in the path $ORACLE_HOME/dbs) are placed on an OCFS1 file system, then you must relocate the memory-mapped files to a standard local file system on each node of the cluster after installation. This is because OCFS1 is not a general purpose file system, and cannot hold these memory-mapped instance files.
3、initdw.ora文件
initdw.ora文件和init<SID>.ora内容及结构类似,且内容说明为:“Example INIT.ORA file for data-warehousing applications”。也就是说这是data-warehousing的一个模板配置文件。在ORACLE官方文档中有介绍为:http://docs.oracle.com/cd/B19306_01/server.102/b14237/initparams003.htm#i1124407
The name of the initialization parameter file varies depending on the operating system. For example, it can be in mixed case or lowercase, or it can have a logical name or a variation of the name init.ora. Also supplied is an initdw.ora file, which contains suggested parameter settings for data warehouses and data marts. The database administrator can choose a different filename for the initialization parameter file.
其中initdw.ora文件内容如下:
[oracle@ocmserver dbs]$ file initdw.ora initdw.ora: ASCII English text [oracle@ocmserver dbs]$ more initdw.ora #*********************************************************************** # Example INIT.ORA file for data-warehousing applications #*********************************************************************** # This file is provided by Oracle Corporation to help you customize # your RDBMS installation for your data warehousing or # business intelligence application. The primary purpose of this file # is to provide a starting point for parameter settings in a # data-warehouse. This file is designed for release 9.0. # # All of the parameters in this file and discussed in more detail # in the documentation. This file should be used for guidance # on the setting of parameters, not as a reference for parameters. # # 'Data warehousing' is an expansive term. In general, this parameter # file assumes that a data warehouse is characterized by: # - end-users execute only queries (rather than updates) # - end-user queries often examine large amounts of data # - data-loading and updating is managed in separate operations; # often, data-modifications occur during batch operations although # some data warehouses receive new data throughout the day # # Some parameter settings are generic to any data-warehouse application. # Other parameters depend upon the size of the data warehouse; different # settings are provided for these parameters, for the following categories # of data warehouses: # Category Size of raw data CPUs Memory # DEMO <1GB 1 128MB # SMALL <100GB 4 ~1GB # MEDIUM 100-500GB 4-12 4-10GB # LARGE >500GB 12-16+ >10GB # 'Raw data' refers to the size of the actual data, and does not # include index space or temp space. # # The uncommented parameters in this init.ora file are configured for # a 'demo' system. These parameters are suitable for using the 'Sales # History' Schema (a sample data warehouse schema, which is included # on the Oracle9i CD), which is used throughout Oracle's documentation # and training related to data warehousing. Most customers will be # able to install and run this schema on a single-CPU workstation. # # More detailed information on all parameters can be found in the # in the documentation. # # This parameter file provide initial guidelines for the configuration # parameters of a data warehouse. Using these guidelines, you should # be able to achieve good performance for a wide variety of data # warehouse applications. However, further tuning of these parameters # for a specific application may yield improved performance. # # INSTRUCTIONS: Edit this file and the other INIT files at your site, # either by using the values provided here or by providing your own. # If you are using Oracle Real Application Clusters, place an IFILE= # line into each instance-specific INIT file that points at this file. #*********************************************************************** # Database parameters #*********************************************************************** # Database blocks should be large in data warehouses. This improves # performance for operations involving large amounts of data. db_block_size = 8192 # For a large data warehouse, db_files should be set to a large value. #db_files = 1000 #*********************************************************************** # Memory parameters #*********************************************************************** # In a data warehouse, the majority of physical memory will be # allocated for the one of the following two purposes: # Runtime memory: used for sorting and hashing data during query processing # (governed by the parameter pga_aggregate_size) # Data caching: used to accelerate performance by avoid disk accesses # (governed by the parameter db_cache_size) # Additionally, a significant amount of memory may need to be allocated for: # Shared pool: used for storing shared memory constructs # (governed by the parameter shared_pool_size) # Large pool: used during parallel-execution processing # (governed by the parameter large_pool_size) # # Memory is managed globally. The DBA should first determine how much # memory is available for Oracle to use. Then, the DBA should choose # memory parameters so that pga_aggregate_size + db_cache_size + # shared_pool_size + large_pool_size is roughly equal to the amount # of memory available for the Oracle database. # # For example, suppose that a DBA is managing a small data mart. The # data mart server has 1GB of physical memory. The DBA has determined # that 500M of memory will be used by the operating system and other # applications, so that 500M is available for Oracle. # # The DBA may choose the following settings: # shared_pool_size = 50M # pga_aggregate_size = 200M # db_cache_size = 200M # large_pool_size = <default> # # The total memory utilization is 450M plus a system-determined value # for the large pool. # # The following sections discuss each of these memory-related # parameters in more detail. These examples assume that the data # warehouse server has 1GB, 8GB, and 16GB respectively for small, # medium, and large configurations. # Runtime memory (the memory used for sorting and hashing during query # execution) is automatically and globally managed when the # pga_aggregate_target parameter is set. For data warehouse workloads # which involve sorts and joins of large volumes of data, the # pga_aggregate_target should be set to a large value. # # pga_aggregate_target should, in general, be equal to 20-80% of the # available memory, depending on the workload. The values below assume # a mixed data-warehouse workload. # # This parameters (introduced in Oracle9i) replaces all of the # following parameters: hash_area_size, sort_area_size, # create_bitmap_area_size, and bitmap_merge_area_size pga_aggregate_target = 30M #DEMO #pga_aggregate_target = 200M #SMALL #pga_aggregate_target = 3000M #MEDIUM #pga_aggregate_target = 6000M #LARGE # The database cache is also a globally-managed portion of memory. The # database cache should be set to a large value for data warehouse # workloads which involves short-running queries and/or the access of # small tables and indexes. # # db_cache_size should, in general, be equal to 20-80% of the # available memory, depending on the workload. The values below assume # a mixed data-warehouse workload. # db_cache_size = 30M #DEMO #db_cache_size = 200M #SMALL #db_cache_size = 3000M #MEDIUM #db_cache_size = 6000M #LARGE # Shared pool size should be, in general, equal to 5-10% of the # available memory. Data warehouses typically do not require as much # memory for shared pool as OLTP systems. shared_pool_size = 20M #DEMO #shared_pool_size = 50M #SMALL #shared_pool_size = 400M #MEDIUM #shared_pool_size = 800M #LARGE # The default for large_pool_size should appropriate for most # environments. # # The Large Pool is used for several purposes. In a data warehouse the # majority of the space in the Large Pool will be used for # parallel-execution internal message buffers. The amount of memory # required by parallel-execution is proportional to the product of the # number of concurrent parallel-execution users and the square of the # number of CPU's. # # The documentation describes in detail how to estimate the default size # of the Large Pool, and the conditions under which this parameter # should be set explicitly. # # Here are some very general estimates on the amount of memory required # for the Large Pool based on the number of CPU's: # 4 cpus: 5M (with parallel_threads_per_cpu = 4) # 8 cpus: 5M (with parallel_threads_per_cpu = 2) # 8 cpus: 20M (with parallel_threads_per_cpu = 4) # 16 cpus: 20M (with parallel_threads_per_cpu = 2) # 32 cpus: 80M (with parallel_threads_per_cpu = 2) # # The Large Pool is only used for parallel-execution message buffers # when parallel_automatic_tuning is enabled. If # parallel_automatic_tuning is not utilitized, then parallel-execution # message buffers are stored in the shared pool, and the # shared_pool_size parameter should be adjusted appropriately. #*********************************************************************** # Parallel Execution parameters #*********************************************************************** # Parallel execution parameters were greatly simplified in Oracle8i. # Data warehouses developed on older releases of Oracle may use # different init.ora parameters. While these older parameters continue # to be supported, these parameters below are recommended for all new # data warehouses, and should be considered when upgrading data # warehouses from previous releases. # Setting parallel_automatic_tuning will result in the database # configuring itself to support parallel execution. parallel_automatic_tuning = true # This parameter determines the default number of parallel execution # processes. Typically, 2 parallel processes per CPU provides good # performance. However, for systems with a smaller number of CPUs or # for systems in which the IO subsystem is slow relative to the the # CPU's, more parallel processes may be desired and the value of this # parameter may be increased. parallel_threads_per_cpu = 4 #SMALL #parallel_threads_per_cpu = 2 or 4 #MEDIUM #parallel_threads_per_cpu = 2 #LARGE #*********************************************************************** # Optimizer and query parameters #*********************************************************************** # All data warehouses should use the cost-based optimizer. All basic # data warehouse performance features, such as star-query support, # hash joins, parallel execution, and bitmap indexes are only # accessible via the cost-based optimizer. optimizer_mode = choose # When using a star schema, set this parameter to true. star_transformation_enabled = true #*********************************************************************** # IO parameters #*********************************************************************** # Multiblock reads allow for the database to retrieve multiple # database blocks in a single IO. In general, a high multiblock read # count provides better performance, particularly for operations on # large volumes of data. Oracle supports IO's up to 1MB on many # platforms. Disk striping will also affect the value for multiblock # read count, since the stripe size should ideally be a multiple of # the IO size. # If you are gathering optimizer system statistics (see DBMSSTAT.SQL # for more information), then you should set this parameter to a high # value. #db_file_multiblock_read_count = 64 # If you are not gathering optimizer system statistics, then you # should set this parameter to a lower value. db_file_multiblock_read_count = 16 #*********************************************************************** # Materialized view parameters #*********************************************************************** # This parameter enables the use of materialized views for improved # query performance. query_rewrite_enabled = true # This parameter determines the degree to which Oralce enforces # integrity rules during query rewrite. In most data-warehouse # environment, 'trusted' is the appropriate setting. query_rewrite_integrity = trusted #*********************************************************************** # Compatibility #*********************************************************************** # When building a new application, both compatibility and # optimizer_features_enabled should be set to the current release to # take advantage of all new features. If you are upgrading an existing # application to Oracle9i, then you may want to consider setting one # or both of these parameters to an earlier release. #compatible = 9.0 #optimizer_features_enabled = 9.0 #*********************************************************************** # Other Parameters #*********************************************************************** # This section lists other parameters that, although not specific # to data warehousing, are required for any Oracle database. By # uncommenting these parameters, this parameter file can be used # as a complete stand-alone init.ora file. #db_name = MY_DB_NAME # Define at least two control files by default #control_files = (ora_control1, ora_control2) [oracle@ocmserver dbs]$
3、init.ora文件是标准的初始化文件
标准的pfile文件,当然pfile和spfile可以相互转化。无多介绍了。
[oracle@ocmserver dbs]$ more init.ora # # $Header: init.ora 06-aug-98.10:24:40 atsukerm Exp $ # # Copyright (c) 1991, 1997, 1998 by Oracle Corporation # NAME # init.ora # FUNCTION # NOTES # MODIFIED # atsukerm 08/06/98 - fix for 8.1. # hpiao 06/05/97 - fix for 803 # glavash 05/12/97 - add oracle_trace_enable comment # hpiao 04/22/97 - remove ifile=, events=, etc. # alingelb 09/19/94 - remove vms-specific stuff # dpawson 07/07/93 - add more comments regarded archive start # maporter 10/29/92 - Add vms_sga_use_gblpagfile=TRUE # jloaiza 03/07/92 - change ALPHA to BETA # danderso 02/26/92 - change db_block_cache_protect to _db_block_cache_p # ghallmar 02/03/92 - db_directory -> db_domain # maporter 01/12/92 - merge changes from branch 1.8.308.1 # maporter 12/21/91 - bug 76493: Add control_files parameter # wbridge 12/03/91 - use of %c in archive format is discouraged # ghallmar 12/02/91 - add global_names=true, db_directory=us.acme.com # thayes 11/27/91 - Change default for cache_clone # jloaiza 08/13/91 - merge changes from branch 1.7.100.1 # jloaiza 07/31/91 - add debug stuff # rlim 04/29/91 - removal of char_is_varchar2 # Bridge 03/12/91 - log_allocation no longer exists # Wijaya 02/05/91 - remove obsolete parameters # ############################################################################## # Example INIT.ORA file # # This file is provided by Oracle Corporation to help you customize # your RDBMS installation for your site. Important system parameters # are discussed, and example settings given. # # Some parameter settings are generic to any size installation. # For parameters that require different values in different size # installations, three scenarios have been provided: SMALL, MEDIUM # and LARGE. Any parameter that needs to be tuned according to # installation size will have three settings, each one commented # according to installation size. # # Use the following table to approximate the SGA size needed for the # three scenarious provided in this file: # # -------Installation/Database Size------ # SMALL MEDIUM LARGE # Block 2K 4500K 6800K 17000K # Size 4K 5500K 8800K 21000K # # To set up a database that multiple instances will be using, place # all instance-specific parameters in one file, and then have all # of these files point to a master file using the IFILE command. # This way, when you change a public # parameter, it will automatically change on all instances. This is # necessary, since all instances must run with the same value for many # parameters. For example, if you choose to use private rollback segments, # these must be specified in different files, but since all gc_* # parameters must be the same on all instances, they should be in one file. # # INSTRUCTIONS: Edit this file and the other INIT files it calls for # your site, either by using the values provided here or by providing # your own. Then place an IFILE= line into each instance-specific # INIT file that points at this file. # # NOTE: Parameter values suggested in this file are based on conservative # estimates for computer memory availability. You should adjust values upward # for modern machines. # # You may also consider using Database Configuration Assistant tool (DBCA) # to create INIT file and to size your initial set of tablespaces based # on the user input. ############################################################################### # replace DEFAULT with your database name db_name=DEFAULT db_files = 80 # SMALL # db_files = 400 # MEDIUM # db_files = 1500 # LARGE db_file_multiblock_read_count = 8 # SMALL # db_file_multiblock_read_count = 16 # MEDIUM # db_file_multiblock_read_count = 32 # LARGE db_block_buffers = 100 # SMALL # db_block_buffers = 550 # MEDIUM # db_block_buffers = 3200 # LARGE shared_pool_size = 3500000 # SMALL # shared_pool_size = 5000000 # MEDIUM # shared_pool_size = 9000000 # LARGE log_checkpoint_interval = 10000 processes = 50 # SMALL # processes = 100 # MEDIUM # processes = 200 # LARGE parallel_max_servers = 5 # SMALL # parallel_max_servers = 4 x (number of CPUs) # MEDIUM # parallel_max_servers = 4 x (number of CPUs) # LARGE log_buffer = 32768 # SMALL # log_buffer = 32768 # MEDIUM # log_buffer = 163840 # LARGE # audit_trail = true # if you want auditing # timed_statistics = true # if you want timed statistics max_dump_file_size = 10240 # limit trace file size to 5 Meg each # Uncommenting the line below will cause automatic archiving if archiving has # been enabled using ALTER DATABASE ARCHIVELOG. # log_archive_start = true # log_archive_dest = disk$rdbms:[oracle.archive] # log_archive_format = "T%TS%S.ARC" # If using private rollback segments, place lines of the following # form in each of your instance-specific init.ora files: # rollback_segments = (name1, name2) # If using public rollback segments, define how many # rollback segments each instance will pick up, using the formula # # of rollback segments = transactions / transactions_per_rollback_segment # In this example each instance will grab 40/5 = 8: # transactions = 40 # transactions_per_rollback_segment = 5 # Global Naming -- enforce that a dblink has same name as the db it connects to global_names = TRUE # Edit and uncomment the following line to provide the suffix that will be # appended to the db_name parameter (separated with a dot) and stored as the # global database name when a database is created. If your site uses # Internet Domain names for e-mail, then the part of your e-mail address after # the '@' is a good candidate for this parameter value. # db_domain = us.acme.com # global database name is db_name.db_domain # FOR DEVELOPMENT ONLY, ALWAYS TRY TO USE SYSTEM BACKING STORE # vms_sga_use_gblpagfil = TRUE # FOR BETA RELEASE ONLY. Enable debugging modes. Note that these can # adversely affect performance. On some non-VMS ports the db_block_cache_* # debugging modes have a severe effect on performance. #_db_block_cache_protect = true # memory protect buffers #event = "10210 trace name context forever, level 2" # data block checking #event = "10211 trace name context forever, level 2" # index block checking #event = "10235 trace name context forever, level 1" # memory heap checking #event = "10049 trace name context forever, level 2" # memory protect cursors # define parallel server (multi-instance) parameters #ifile = ora_system:initps.ora # define two control files by default control_files = (ora_control1, ora_control2) # Uncomment the following line if you wish to enable the Oracle Trace product # to trace server activity. This enables scheduling of server collections # from the Oracle Enterprise Manager Console. # Also, if the oracle_trace_collection_name parameter is non-null, # every session will write to the named collection, as well as enabling you # to schedule future collections from the console. # oracle_trace_enable = TRUE # Uncomment the following line, if you want to use some of the new 8.1 # features. Please remember that using them may require some downgrade # actions if you later decide to move back to 8.0. #compatible = 8.1.0 [oracle@ocmserver dbs]$
4、ora_control1 和ora_control2文件
记录control文件内容,用strings查看如下:
[oracle@ocmserver dbs]$ strings ora_control1 }|{z 0OCM 0OCM /opt/oracle/oradata/OCM/redo02.log /opt/oracle/oradata/OCM/redo01.log /opt/oracle/oradata/OCM/redo03.log /opt/oracle/oradata/OCM/example01.dbf /opt/oracle/oradata/OCM/undotbs01.dbf /opt/oracle/oradata/OCM/users01.dbf /opt/oracle/oradata/OCM/sysaux01.dbf /opt/oracle/oradata/OCM/system01.dbf SYSTEM SYSAUX USERS UNDOTBS1 EXAMPLE /opt/oracle/oradata/ocm/users01.dbf /opt/oracle/oradata/ocm/undotbs01.dbf /opt/oracle/oradata/ocm/users01.dbf UNNAMED_INSTANCE_1 [oracle@ocmserver dbs]$
5、orapwocm文件
1)记录SYS权限的密码文件
[oracle@ocmserver dbs]$ file orapwocm
orapwocm: data
[oracle@ocmserver dbs]$ strings orapwocm
][Z
ORACLE Remote Password file
INTERNAL
C40361FABB014836
202BA068705C585F
[oracle@ocmserver dbs]$
2)系统权限的小实验
SQL> show user
USER is "SYS"
SQL> show parameter remote_login
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
SQL> select status from v$instance;
STATUS
------------
OPEN
SQL> grant sysdba to jack;
Grant succeeded.
SQL> ! strings /opt/oracle/product/dbs/orapwocm
][Z
ORACLE Remote Password file
INTERNAL
C40361FABB014836
202BA068705C585F
JACK -----加入sysdba权限后,进入到密码文件orapwocm
F42110047CD76AF5
SQL> grant sysdba to jack;
Grant succeeded.
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE
JACK TRUE FALSE ----加入v$pwfile_users中删除
SQL>
SQL> revoke sysdba from jack;
Revoke succeeded.
SQL> ! strings /opt/oracle/product/dbs/orapwocm
][Z
ORACLE Remote Password file
INTERNAL
C40361FABB014836
202BA068705C585F
JACK ----没有删除
F42110047CD76AF5
SQL> revoke sysdba from jack;
Revoke succeeded.
SQL> select * from v$pwfile_users;
USERNAME SYSDB SYSOP
------------------------------ ----- -----
SYS TRUE TRUE ----已经从v$orapwocm_users中删除
SQL>
6、快照文件snapcf_ocm.f
要说的是,快照控制文件也是以文件的形式存在,在unix的home/dbs中,在windows home/database中。命名方式为:sncf<oracle_sid>.ora。 使用configure snapshot controlfile命令可以在任何时候更改快照控制文件名: configure snapshot controlfile name to '<loactionfile_name>';
7、spfile参数文件
[oracle@ocmserver dbs]$ file spfileocm.ora spfileocm.ora: data [oracle@ocmserver dbs]$ strings spfileocm.ora ocm.__db_cache_size=142606336 ocm.__java_pool_size=4194304 ocm.__large_pool_size=4194304 ocm.__shared_pool_size=62914560 ocm.__streams_pool_size=0 *.audit_file_dest='/opt/oracle/admin/ocm/adump' *.background_dump_dest='/opt/oracle/admin/ocm/bdump' *.compatible='10.2.0.1.0' *.control_files='/opt/oracle/oradata/ocm/control01.ctl','/opt/oracle/oradata/ocm/control02.ctl','/opt/oracle/oradata/ocm/control03.ctl'#Restore Controlfile *.core_dump_dest='/opt/oracle/admin/ocm/cdump' *.db_block_size=8192 *.db_domain='' *.db_file_multiblock_read_count=16 *.db_name='ocm' *.db_recovery_file_dest='/opt/oracle/flash_recovery_area' *.db_recovery_file_dest_size=2147483648 *.dispatchers='(PROTOCOL=TCP) (SERVICE=ocmXDB)' *.job_queue_processes=10 *.open_cursors=300 *.pga_aggregate_target=71303168 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=216006656 *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' *.user_dump_dest='/opt/oracle/admin/ocm/udump' [oracle@ocmserver dbs]$
8、锁文件lkOCM
这个文件主要是启动数据库后存在的锁定特定信息文件的作用,其内容主要有一行"DO NOT DELETE THIS FILE!"
[oracle@ocmserver dbs]$ file lkOCM lkOCM: ASCII text, with no line terminators [oracle@ocmserver dbs]$ strings lkOCM DO NOT DELETE THIS FILE! [oracle@ocmserver dbs]$ more lkOCM DO NOT DELETE THIS FILE! [oracle@ocmserver dbs]$
这个文件在关闭后,文件并被删除掉。
二、重点文件参数初探
1、pfile文件init<sid>.ora
这个文件内包括很多系统启动必须需要的参数,如db_block_size等其他常用文件。
SQL> show parameter spfile NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string /opt/oracle/product/dbs/spfileocm.ora SQL> create pfile from spfile; File created. SQL> ! ls -lh /opt/oracle/product/dbs total 20M -rw-rw---- 1 oracle oinstall 1.6K Jun 23 22:09 hc_ocm.dat -rw-r----- 1 oracle oinstall 13K May 3 2001 initdw.ora -rw-r--r-- 1 oracle oinstall 966 Jun 29 15:14 initocm.ora -rw-r----- 1 oracle oinstall 8.2K Sep 11 1998 init.ora -rw-rw---- 1 oracle oinstall 24 Jun 29 14:44 lkOCM -rw-r----- 1 oracle oinstall 6.0M Jun 24 18:13 ora_control1 -rw-r----- 1 oracle oinstall 6.0M Jun 24 18:13 ora_control2 -rw-r----- 1 oracle oinstall 1.5K Jun 29 15:02 orapwocm -rw-r----- 1 oracle oinstall 7.1M Jun 25 22:50 snapcf_ocm.f -rw-r----- 1 oracle oinstall 2.5K Jun 29 14:57 spfileocm.ora SQL> ! more /opt/oracle/product/dbs/initocm.ora ocm.__db_cache_size=142606336 ocm.__java_pool_size=4194304 ocm.__large_pool_size=4194304 ocm.__shared_pool_size=62914560 ocm.__streams_pool_size=0 *.audit_file_dest='/opt/oracle/admin/ocm/adump' *.background_dump_dest='/opt/oracle/admin/ocm/bdump' *.compatible='10.2.0.1.0' *.control_files='/opt/oracle/oradata/ocm/control01.ctl','/opt/oracle/oradata/ocm/control02.ctl','/opt/oracle/oradata/ocm/control03.ctl'#Restore Controlfile *.core_dump_dest='/opt/oracle/admin/ocm/cdump' *.db_block_size=8192 *.db_domain='' *.db_file_multiblock_read_count=16 *.db_name='ocm' *.db_recovery_file_dest='/opt/oracle/flash_recovery_area' *.db_recovery_file_dest_size=2147483648 *.dispatchers='(PROTOCOL=TCP) (SERVICE=ocmXDB)' *.job_queue_processes=10 *.open_cursors=300 *.pga_aggregate_target=71303168 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=216006656 *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' *.user_dump_dest='/opt/oracle/admin/ocm/udump' SQL>
这个文件内容里面包括很多其他必须使用的参数,但是和标准模板文件的内容有些不同。标准init.ora文件更加易懂和更加容易理解。而pfile从spfle转换过来,格式不太美观。
2、spfile参数文件spfile<sid>.ora
SQL> ! strings /opt/oracle/product/dbs/spfileocm.ora ocm.__db_cache_size=142606336 ocm.__java_pool_size=4194304 ocm.__large_pool_size=4194304 ocm.__shared_pool_size=62914560 ocm.__streams_pool_size=0 *.audit_file_dest='/opt/oracle/admin/ocm/adump' *.background_dump_dest='/opt/oracle/admin/ocm/bdump' *.compatible='10.2.0.1.0' *.control_files='/opt/oracle/oradata/ocm/control01.ctl','/opt/oracle/oradata/ocm/control02.ctl','/opt/oracle/oradata/ocm/control03.ctl'#Restore Controlfile *.core_dump_dest='/opt/oracle/admin/ocm/cdump' *.db_block_size=8192 *.db_domain='' *.db_file_multiblock_read_count=16 *.db_name='ocm' *.db_recovery_file_dest='/opt/oracle/flash_recovery_area' *.db_recovery_file_dest_size=2147483648 *.dispatchers='(PROTOCOL=TCP) (SERVICE=ocmXDB)' *.job_queue_processes=10 *.open_cursors=300 *.pga_aggregate_target=71303168 *.processes=150 *.remote_login_passwordfile='EXCLUSIVE' *.sga_target=216006656 *.undo_management='AUTO' *.undo_tablespace='UNDOTBS1' *.user_dump_dest='/opt/oracle/admin/ocm/udump' SQL>
3、控制文件备份ora_control1 & ora_control2
SQL> ! strings /opt/oracle/oradata/ocm/control01.ctl 现在控制文件内容大体如下 }|{z TAG20130625T225008 0#[? 0OCM 0OCM /opt/oracle/oradata/ocm/redo03.log /opt/oracle/oradata/ocm/redo02.log /opt/oracle/oradata/ocm/redo01.log /opt/oracle/oradata/ocm/example01.dbf /opt/oracle/oradata/ocm/users01.dbf /opt/oracle/oradata/ocm/sysaux01.dbf /opt/oracle/oradata/ocm/undotbs01.dbf /opt/oracle/oradata/ocm/system01.dbf /opt/oracle/oradata/ocm/temp01.dbf /opt/oracle/oradata/temp01.dbf /opt/oracle/oradata/ocm/redo03.log /opt/oracle/oradata/ocm/redo02.log /opt/oracle/oradata/ocm/redo01.log /opt/oracle/oradata/ocm/example01.dbf /opt/oracle/oradata/ocm/users01.dbf /opt/oracle/oradata/ocm/sysaux01.dbf /opt/oracle/oradata/ocm/undotbs01.dbf /opt/oracle/oradata/ocm/system01.dbf /opt/oracle/oradata/ocm/temp01.dbf /opt/oracle/oradata/temp01.dbf SYSTEM UNDOTBS1 SYSAUX USERS EXAMPLE TEMP SYSTEM UNDOTBS1 SYSAUX USERS EXAMPLE TEMP 2013-06-25T22:49:18 RMAN 2013-06-25T22:49:18 backup 2013-06-25T22:51:55 RMAN 2013-06-25T22:51:55 alter db 2013-06-25T22:49:18 RMAN 2013-06-25T22:49:18 backup 2013-06-25T22:51:55 RMAN 2013-06-25T22:51:55 alter db UNNAMED_INSTANCE_2 UNNAMED_INSTANCE_3 UNNAMED_INSTANCE_4 UNNAMED_INSTANCE_5 UNNAMED_INSTANCE_6 UNNAMED_INSTANCE_7 UNNAMED_INSTANCE_8 UNNAMED_INSTANCE_1 UNNAMED_INSTANCE_2 UNNAMED_INSTANCE_3 UNNAMED_INSTANCE_4 UNNAMED_INSTANCE_5 UNNAMED_INSTANCE_6 UNNAMED_INSTANCE_7 UNNAMED_INSTANCE_8 SQL> ! strings /opt/oracle/product/dbs/ora_control1 ora_control1文件和ora_control2文件类似 }|{z 0OCM 0OCM /opt/oracle/oradata/OCM/redo02.log /opt/oracle/oradata/OCM/redo01.log /opt/oracle/oradata/OCM/redo03.log /opt/oracle/oradata/OCM/example01.dbf /opt/oracle/oradata/OCM/undotbs01.dbf /opt/oracle/oradata/OCM/users01.dbf /opt/oracle/oradata/OCM/sysaux01.dbf /opt/oracle/oradata/OCM/system01.dbf SYSTEM SYSAUX USERS UNDOTBS1 EXAMPLE /opt/oracle/oradata/ocm/users01.dbf /opt/oracle/oradata/ocm/undotbs01.dbf /opt/oracle/oradata/ocm/users01.dbf UNNAMED_INSTANCE_1 SQL>
三、小结
在dbs下的目录都非常重要,但是需要详细的理解必须要加注更多是实验来证明。
在《循序渐进Oracle:数据库管理、优化与备份恢复》有比较深入的讲解pfile和spfile,可供参考。