ARCHIVELOG Mode

This article is based on Oracle Database 10g on Unix system. Initially, fresh database operates in NOARCHIEVELOG mode: redo logs get overwritten and recovery capabilities are limited. Switching to ARCHIEVELOG causes the redo logs to be archieved in specified location(s). Archieve log locations must already exist.

Current status:

SELECT log_mode FROM v$database;
Switching from NOARCHIVELOG to ARCHIVELOG - 1 archive log location:

ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='' SCOPE=BOTH;

ALTER SYSTEM SET LOG_ARCHIVE_DEST='/u01/arch_log_1' SCOPE=BOTH;

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
Getting back to NOARCHIVELOG:

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE NOARCHIVELOG;
ALTER DATABASE OPEN;
Switching from NOARCHIVELOG to ARCHIVELOG - 2 archive log locations:

ALTER SYSTEM SET LOG_ARCHIVE_DEST='/u01/arch_log_1' SCOPE=BOTH;
ALTER SYSTEM SET LOG_ARCHIVE_DUPLEX_DEST='/u01/arch_log_2' SCOPE=BOTH;

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
Getting back to NOARCHIVELOG:

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE NOARCHIVELOG;
ALTER DATABASE OPEN;
Switching from NOARCHIVELOG to ARCHIVELOG - 1 to 10 archive log locations:

/* remove previous parameter values */
ALTER SYSTEM RESET LOG_ARCHIVE_DEST SCOPE=SPFILE SID='*';
ALTER SYSTEM RESET LOG_ARCHIVE_DUPLEX_DEST SCOPE=SPFILE SID='*';
/* previous values removed */

ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=/u01/arch_log_1' SCOPE=SPFILE;
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='LOCATION=/u01/arch_log_2' SCOPE=SPFILE;
ALTER SYSTEM SET LOG_ARCHIVE_DEST_3='LOCATION=/u01/arch_log_3' SCOPE=SPFILE;

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
Getting back to NOARCHIVELOG:

/* remove previous parameter values */
ALTER SYSTEM RESET LOG_ARCHIVE_DEST_1 SCOPE=SPFILE SID='*';
ALTER SYSTEM RESET LOG_ARCHIVE_DEST_2 SCOPE=SPFILE SID='*';
ALTER SYSTEM RESET LOG_ARCHIVE_DEST_3 SCOPE=SPFILE SID='*';
/* previous values removed */

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE NOARCHIVELOG;
ALTER DATABASE OPEN;
Other initialization parameters you need to know about

Max # of ARCn processes:

LOG_ARCHIVE_MAX_PROCESSES
Minimal number of locations, where redo logs must be archived successfully (default is 1):

LOG_ARCHIVE_MIN_SUCCEED_DEST

你可能感兴趣的:(hive)