Set Oracle9i to automatic archiving Mode

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.