1. Set the archive mode to 1. sqlarchiveloglist; # Check whether the archive mode is 2sqlaltersystemsetlog_archive_starttruescopespfile; # enable active archiving; # Set the archive path to s.
1. set archive mode to 1. SQL archive log list; # Check whether archive mode is supported. 2. SQL alter system set log_archive_start = true scope = spfile; # enable active archiving SQL alter system set log_archive_dest = 'location =/oracle/ora9/oradata/arch 'scope = spfile; # set the archiving path s
1. Archive Mode
1 SQL> archive log list; # Check whether the archive mode is used. 2 SQL> alter system set log_archive_start = true scope = spfile; # enable active archiving SQL> alter system set log_archive_dest = 'location =/oracle/ora9/oradata/arch 'scope = spfile; # set the archiving path SQL> alter system set log_archive_dest_1 = 'location =/oracle/ora9/oradata/arch1' scope = spfile; SQL> alter system set log_archive_dest_2 = 'location =/oracle/ora9/oradata/arch2' scope = spfile; # If the file is archived to two locations, you can use the preceding method to implement SQL> alter system set log_archive_format = 'arch _ % d _ % t _ % r _ % s. log' # Set the archive diary style 3 SQL> shutdown immediate; 4 SQL> startup mount; # Open the control file, do not open the data file 5 SQL> alter database archivelog; # Switch the database to archive mode 6 SQL> alter database open; # open the data file 7 SQL> archive log list; # Check whether the database is in archive Mode 8 to check whether the database is in archivelog mode and the archiving process is running SQL> select log_mode from v $ database; SQL> select archiver from v $ instance; 9 log switch SQL> alter system switch logfile; 10 this log switch writes archive to two destination locations, 1, that is, in step 2,/oracle/ora9/oradata/arch1 and/oracle/ora9/oradata/arch1. To confirm the directory, run the following query in oracle: SQL> select name from v $ archived_log; then check the listed files in the operating system.
2. Set non-archive Mode
1 SQL> archive log list; # Check whether the archive mode is used. 2 SQL> alter system set log_archive_start = false scope = spfile; # disable automatic archiving. 3 SQL> shutdown immediate; 4 SQL> startup mount; # open the control file, do not open the data file 5 SQL> alter database noarchivelog; # Switch the database to non-archive mode 6 SQL> alter database open; # Open the data file 7 SQL> archive log list; # the data file is in non-archive mode.
3. Archive commands
Archive log stop; archive log start; archive log list; show parameters log_archive_start; show parameters log_archive_max_process; # alter system set log_archive_max_process = 5; # change the number of archiving processes to 5 select * from v $ bgprocess; # Check the background process