The parameter files used in oracle startup are generally in the following situations:
1. Single Instance 1.1 is started by default:
In non-rac environments, the parameter files of oracle databases are stored in the $ ORACLE_HOME/dbs directory by default. The order in which oracle automatically searches for parameter files is
Spfile $ ORACLE_SID.ora-> spfile. ora-> init $ ORACLE_SID.ora
1.2 manually specify parameter files
You can also manually start non-default pfile and spfile files.
Startup pfile =/u01/oracle/dbs/myinit. ora
If you want to start a non-default spfile file, we recommend that you use the following method:
Pfile startup
Startup pfile =/u01/oracle/dbs/spf_init.ora
Use the SPFILE parameter in the pfile file to specify the position of the spfile file.
Cat/u01/oracle/dbs/spf_init.ora
SPFILE =/u01/oracle/dbs/test_spfile.ora
1.3 parameter files used in ASM and bare Devices
If you use a bare device or ASM to store spfile files, the general practice is
Modify the default pfile
Vi $ ORACLE_HOME/dbs/init $ ORACLE_SID.ora
Spfile = '+ Data/TYOLAP/spfile $ ORACLE_SID.ora'
2 RAC Environment
In the oracle rac environment, the situation is a little complicated. pfile startup is similar to that of a single instance. Each instance has its own pfile file. When spfile is started, it is generally recommended that spfile files be stored in shared storage.
2.1 Sqlplus start 2.1.1 shared storage is a bare device or ASM
If the shared storage is a bare device, we recommend that you use the pfile connection method in the official documentation. Bare devices are common in the oracle 10g rac version. The method is as follows:
1. Start with the default pfile file of each instance
$ ORACLE_HOME/dbs/init $ ORACLE_SID.ora
2. Point the pfile to the shared SPFILE.
SPFILE = '/dev/vx/rdsk/vg_zw_data1/lv_zw_spfile'
If you use ASM to place the spfile file, point the SPFILE parameter to the path in ASM.
SPFILE = '+ disk_group_name/dbunique_name/spfiledbname. ora'
2.2 Srvctl start 2.2.1 parameters are not configured in OCR,
It is started with sqlplus and found in the default directory.
[oracle@dtydb5 ~]$ srvctl config database -d ms4adb -aDatabase unique name: ms4adbDatabase name: ms4adbOracle home: /oracle/app/oracle/product/11.2.0/db_1Oracle user: oracleSpfile: +DATA/ms4adb/spfiletest.oraDomain: Start options: openStop options: immediateDatabase role: PRIMARYManagement policy: AUTOMATICServer pools: ms4adbDatabase instances: ms4adb1,ms4adb2,ms4adb3Disk Groups: DATAMount point paths: Services: Type: RACDatabase is enabledDatabase is administrator managed
2. The parameter file uses the configuration in the default path.
sys@TYOLAP3(dtydb5)> show parameterpfileNAME TYPE VALUEspfile string +DATA/tyolap/spfile/spfilety.ora
2.2.2 configure the location of the parameter file
If the parameter file is changed, the parameter file is used, that is, the parameter file configured in OCR is used first.
First, modify the spfile file in OCR.
srvctl modify database -d ms4adb -p'+DATA/ms4adb/spfiletest.ora' [oracle@dtydb5 ~]$ srvctl start database -dMS4ADB sys@MS4ADB3(dtydb5)> show parameterspfile NAME TYPE VALUE---------------------------------------------------------- ------------------------------spfile string +DATA/ms4adb/spfiletest.ora
2.2.3 the parameter file configured in OCR does not exist
An error is reported during startup, and the error is not found in the $ ORACLE_HOME/dbs directory.
[oracle@dtydb5 ~]$ srvctl modify database -d ms4adb -p'+DATA/ms4adb/spfilems4adb_bak.ora'[oracle@dtydb5 ~]$ srvctl stop database -dms4adb[oracle@dtydb5 ~]$ srvctl start database -dms4adbPRCR-1079 : Failed to start resourceora.ms4adb.dbCRS-5017: The resource action"ora.ms4adb.db start" encountered the following error:ORA-01078: failure in processing systemparametersORA-01565: error in identifying file'+DATA/ms4adb/spfilems4adb_bak.ora'
In short: If srvctl is used for startup, the configuration file queried by srvctl is preferentially used. If the configuration file is incorrect, it cannot be started normally. If the configuration file is null, search from the default path (currently I have not found the method to change the pfile parameter back to the null value)