I. significance:
We know that the database has at least two sets of online log files, which are recycled.
The archive mode stores a copy of the file before the online log file is repeatedly reused (overwritten) to other locations, so that we keep all the modification log records of the database in history, it makes sense for database recovery.
Ii. Modify the archive Mode
First, you can use the following statement to view the existing database mode:
Select name, log_mode from v $ database;
You can also use the following statement
Archive log list; (This method requires the as sysdba)
To archive a non-archive database, follow these steps:
1. SQL> alter system set log_archive_dest_1 = 'location =/oracle/oracle10g/log/archive_log ';
This statement determines the path of the archived log. In fact, Oracle 10 Gb can generate multiple identical logs and store multiple locations to prevent unexpected logs.
For example, you can use the following statement to add another log location:
SQL> alter system set log_archive_dest_2 = 'location =/oracle/oracle10g/log2/archive_log ';
2. Shut down the database
SQL> shutdown immediate
3. Start the data mount status:
SQL> startup mount;
4. Change the database to archive mode:
SQL> alter database archivelog;
5. Open the database and query:
SQL> alter database open;
Modify the log file name format:
SQL> alter system set log_archive_max_processes = 5;
SQL> alter system set log_archive_format = "archive _ % t _ % s _ % r. log" scope = spfile;
After modification, you can check whether the log mode has been modified successfully!
In particular, you must modify the log_archive_start = true parameter in Oracle 9i to take effect. This parameter has been abolished in oracle 10g, so you do not need to set this parameter.
--------------------------------
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area 1258291200 bytes
Fixed Size 1978336 bytes
Variable Size 318771232 bytes
Database Buffers 922746880 bytes
Redo Buffers 14794752 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.