1. Create a directory to save the backup
Mkdir/u01/oracle/oradata/archive
Chown-R oracle/u01/oracle/oradata/archive
2. Switch to an oracle user
Sqlplus/nolog
Connect/as sysdba
3. Set the target address of the archived log
Check whether the database is in archive Mode
SQL> select log_mode from v $ database;
LOG_MODE
------------------------
NOARCHIVELOG
SQL> show parameter 'Log _ archive_dest_1'
NAME TYPE VALUE
-----------------------------------------------------------------------------
Log_archive_dest_1 string
Log_archive_dest_10 string
Log_archive_dest_11 string
Log_archive_dest_12 string
Log_archive_dest_13 string
Log_archive_dest_14 string
Log_archive_dest_15 string
Log_archive_dest_16 string
Log_archive_dest_17 string
Log_archive_dest_18 string
Log_archive_dest_19 string
SQL> alter system set log_archive_dest_1 = 'location =/u01/oracle/oradata/archive 'scope = spfile;
System altered.
SQL> show parameter log_archive_format;
NAME TYPE VALUE
-----------------------------------------------------------------------------
Log_archive_format string % t _ % s _ % r. dbf
-- Set the log file name format to take effect after the database is restarted
Alter system set log_archive_dest_1 = 'location =/u01/oracle/oradata/archive 'scope = spfile;
SQL> System altered.
4. Shut down the database
SQL> shutdown immediate;
5. Start and load the database
SQL> startup mount;
6. Switch the database to archive mode.
SQL> alter database archivelog;
SQL> select log_mode from v $ database;
LOG_MODE
------------------------
ARCHIVELOG
7. Open the database
SQL> alter database open;
8. Switch logs and force Archiving
SQL> alter system switch logfile;
9. SQL> select archiver from v $ instance;
ARCHIVER
--------------
STARTED
-- View the path of the generated archive file
SQL> select name from v $ archived_log;
NAME
--------------------------------------------------------------------------------
/U01/oracle/oradata/archive/arch_50d8fe87_109762534602_37.log
The author's "big-point column"