Query whether Oracle runs based on pfile or spfile
A) Run sqlplus and show parameter pfile or show parameter spfile. The returned result shows the mode in which Oracle runs.
The connection and difference between pfile and spfile in Oracle:
Pfile: used for Oracle8i. It can also be used in Oracle9i. It exists in text form and can be modified in VI editor. The file format is initsid. ora;
Spfile: used for Oracle9i. It exists in the form of binary text and cannot be modified using the VI editor. The file format is spfilesid. ora. To modify the spfile, use the alter system set statement.
2. If Oracle runs in pfile format, perform the following steps:
A) Run VI $ ORACLE_HOME/dbs/initsid. ora to edit the initsid. ora file.
B) Search for the *. log_archive_dest and *. log_archive_start attributes.
These two attributes are used to set the directory for archiving logs and to start in archive mode when Oracle starts. If the initsid. ora file does not contain these two attributes, add the following content. If yes, modify the attributes as follows:
*. Log_archive_dest = ''/export/home/Oracle/arch''
*. Log_archive_start = true
It is best to choose different directories other than the Oracle application and data file storage directories, or even different hard disks, so that the speed and security will be better.
If you need to set the log file format, you can also specify the format, as shown in figure
*. Log_archive_format = ''% T _ % S _ % R. dbf''
3. Save initsid. ora
4. Run shutdown immediate to close the Oracle server.
5. Execute startup mount to start the Oracle server
6. Execute alter database archivelog;
7. If Oracle runs in spfile format, perform the following steps:
A) set the archive log directory
Alter system set log_archive_dest_1 = ''location =/export/home/Oracle/arch '';
B) set the archive mode to start.
Alter system set log_archive_start = true scope = spfile;
If you need to set the log file format, you can also specify the format, as shown in figure
Alter system set log_archive_format = ''% T _ % S _ % R. dbf'' scope = spfile;
8. Shutdown immediate again to shut down the Oracle server
9. Execute startup to start the Oracle server and automatically enter the archive mode. After each startup, it will automatically run in archive mode.