The backup and recovery parameters of the parameter file include initsid. ora (Text parameter file) pfile (Text parameter file), spfile (binary parameter file) Three pfiles and spfile can be converted to each other (copy ): create spfile = 'path' from pfile = 'path'; create pfile = 'path' from spfile = 'path'; when the database is started, the spfile or pfile is first opened, that is, the nomount state. Next, we will summarize RMAN's backup of parameter files and recovery of RMAN's backup of parameter files only for spfile files. One is manual backup and the other is automatic backup. Manual backup: RMAN> backup spfile; automatic backup: During full backup of the database and backup of key data files (system tablespace, parameter files along with control files are secretly backed up to another backup set. For example: backup datafile 1; or backup tablespace system; If the automatic backup function of the control file is enabled, the parameter file box control file will be automatically backed up when appropriate. Restoring the parameter file is to restore the backup parameter file to the original location. This recovery process does not require the support of redo logs. Damaged during instance startup: 1. If you use the system command to back up the parameter file, you can use the system command to back up the file to overwrite the parameter file in the original path. 2. If RMAN is used to back up a backup set, 1. Use RMAN to start the instance to the NOMOUNT state (nomount state cannot be started under SQL/PLUS, but it is allowed in RMAN) 2. Run the restore spfile command. (The backup types include restore spfile from autobackup and restore spfile from 'path'.) 3. Restart the instance.
RMAN> startup nomount; restore spfile from 'path'; startup force; --- start the instance with a real and restored parameter file -- If Automatic Backup is generated, the Database Name (db_name = Database Name) must be provided during restore) and the path of the quick recovery area (on the premise that quick recovery is enabled as the path) startup nomount; restore spfile from autobackup db_name = database name db_recovery_file_dest = 'path'; --- if it is an automatic backup parameter, in addition, the quick recovery zone is not started. The automatic backup path is saved in the $ oracle_home/dbs directory. During restoration, you must first specify the DBID of the database. RMAN> set dbid 123456; restore spfile from autobackup; -- If RMAN is used to RESTORE the catalog, connect to the target database and RESTORE the catalog RMAN> connect target/catalog user_rman/user_rman @ orcl; -- start NOMOUNT with the RMAN built-in parameter file, RESTORE the parameter file, and restart the instance RUN {startup nomount; restore spfile; startup force ;}
When the instance is running, it finds that the parameter file is corrupted and restores it to another path using the to clause. After restoring the file, the restore spfile is terminated TO 'new (temporary) path' from autobackup. Use System commands or manually copy the parameter files in the new path, overwrite the parameter file in the original path. Mv/New Path/spfiletestdb. ora $ oracle_home/dbs;