Loading...

We've detected that your browser language is Chinese. Would you like to visit our Chinese website? [ Dismiss ]
By: Emma

What Is ALTER SYSTEM ARCHIVE LOG

In Oracle, the ALTER SYSTEM ARCHIVE LOG command is used to manually control archive log operations. Depending on the option used, it can force the archiving of the current redo log, archive pending redo logs, or manage the archive process itself.

Even when automatic archiving is enabled, administrators may still need to manually archive logs before a backup, after recovery operations, or when resolving archive log gaps.

what is alter system archive log

Before using ALTER SYSTEM ARCHIVE LOG CURRENT or ALTER SYSTEM ARCHIVE LOG ALL, the database should be running in ARCHIVELOG mode, and the user must have SYSDBA or SYSOPER privileges.

You can verify the current archive mode with: SELECT LOG_MODE FROM V$DATABASE;  or  ARCHIVE LOG LIST;

Command Overview

The Oracle ALTER SYSTEM ARCHIVE LOG command supports several options, but CURRENT, ALL, and STOP are the most commonly discussed.

The table below summarizes their behavior and typical use cases:

Command Synchronous Triggers Switch RAC Scope Best For
ARCHIVE LOG CURRENT Y Y All nodes RMAN backup scripts
ARCHIVE LOG ALL Y N All threads Gap fill / post-recovery
ARCHIVE LOG STOP / / / Avoid — deprecated

ALTER SYSTEM ARCHIVE LOG CURRENT: Safe Choice for RMAN Backups

ALTER SYSTEM ARCHIVE LOG CURRENT is the standard choice for backup operations. When executed, it forces a log switch on the active redo log and archives it before returning control to the session.

This command is synchronous. Oracle waits until the archive file has been fully written to disk before the session continues. That behavior is what makes it reliable in backup scripts — you know the redo data is safely captured before the next step runs.

Syntax and RAC Behavior

In a standalone environment, the syntax is straightforward:

ALTER SYSTEM ARCHIVE LOG CURRENT;

In a Real Application Clusters (RAC) environment, running this command on one instance forces a log switch and archives logs across all threads on every active node. To target a specific instance, use the THREAD parameter:

-- Force archiving for redo thread 2

ALTER SYSTEM ARCHIVE LOG CURRENT THREAD 2;

ALTER SYSTEM ARCHIVE LOG CURRENT to get a specific instance

Why It Is Safer Than SWITCH LOGFILE

A common mistake in backup scripts is using ALTER SYSTEM SWITCH LOGFILE instead. While it triggers a log switch, it is asynchronous — Oracle returns control immediately, before the ARCn process has finished writing the archive file to disk.

If an RMAN job proceeds at that point, it may not find the expected file, causing errors like RMAN-06054 or ORA-00279. Some legacy scripts work around this with a SLEEP 60 pause, but that is not reliable. ALTER SYSTEM ARCHIVE LOG CURRENT eliminates the problem entirely by making Oracle wait for the archive to complete.

Oracle recommends running this command twice during a hot backup: once before the backup begins, and once after it completes. This ensures all redo generated during the backup window is included in the recovery set.

ALTER SYSTEM ARCHIVE LOG ALL: When Your Logs Have Fallen Behind

ALTER SYSTEM ARCHIVE LOG ALL archives all redo log groups that are full but have not yet been archived. Unlike ARCHIVE LOG CURRENT, it does not force a switch on the active log. Instead, it scans for logs in a filled state and triggers archiving across all enabled threads.

This makes it the right tool when the automatic archiver falls behind or hits a temporary interruption.

Key Difference From CURRENT

The distinction comes down to log switch behavior. ARCHIVE LOG CURRENT forces the database to switch to a new redo log immediately. ARCHIVE LOG ALL only processes logs that are already closed and waiting to be archived. If the active redo log is 50% full, this command leaves it untouched and works through the older completed logs only.

When to Use This Command

There are three common scenarios where this command is the appropriate choice:

  • After an archiving failure: If the archive destination ran out of space and the archiver stalled, running this command after clearing space pushes all pending logs to disk.
  • Closing a Data Guard gap: If a standby database is missing redo data, running this on the primary ensures all filled logs are available for transport.
  • After instance recovery: Manually catching up on archiving after a recovery helps confirm the latest state is safely stored before resuming normal operations.

Expected Behavior: ORA-00271

If the database is already fully caught up, Oracle returns:

ORA-00271: no logs need archiving

This is a status notification, not an error. In a healthy environment, this response means the background archiver is working correctly and there is no backlog to clear.

Performance Note

Archiving multiple redo logs at once can place a short but heavy load on the I/O subsystem. Where possible, run this command during off-peak hours to avoid competing with user transactions for disk throughput.

ALTER SYSTEM ARCHIVE LOG STOP: Why This Deprecated Command Can Hang Your Database

ALTER SYSTEM ARCHIVE LOG STOP is a legacy command that has no place in modern database administration. In Oracle 9i and earlier, it was used alongside ARCHIVE LOG START to manually control the ARCn background processes. Oracle deprecated it in version 10g, and while the syntax may still execute on newer versions, the risks make it one to avoid.

Why It No Longer Works as Expected

Executing this command tells Oracle to stop the archiver processes from writing redo data to the archive destination. The database, however, keeps recording transactions in the online redo logs.

Once all redo log groups are full, Oracle has nowhere to write new changes. Because the database is still in ARCHIVELOG mode with archiving stopped, it suspends all activity and waits indefinitely. The only way out is to resume archiving or shut the instance down.

The Only Remaining Edge Case

The one scenario where a DBA might reach for this command is a severe emergency. If the archiver process is completely stuck and causing an I/O lockup at the system level, ARCHIVE LOG STOP can be used to kill the process immediately. This should be followed by a SHUTDOWN ABORT to prevent further instability.

The Correct Modern Alternative

To disable archiving, skip the STOP command entirely. The safe approach is to change the database logging mode directly:

SHUTDOWN IMMEDIATE;

STARTUP MOUNT;

ALTER DATABASE NOARCHIVELOG;

ALTER DATABASE OPEN;

ALTER SYSTEM ARCHIVE LOG STOP alternatives

This updates the control file and gracefully decommissions the background archiver processes, avoiding the risk of an unexpected hang.

Common Errors and How to Fix Them

Even in well-managed environments, archiving can occasionally trigger errors that block database activity. Knowing what each code means helps you resolve the issue quickly and get back to normal operations.

ORA-00257: Archiver Error — Connect as SYSDBA Only Until Freed

This is the most common archiving error. It occurs when the archive log destination, typically the Flash Recovery Area (FRA), runs out of space. Oracle responds by blocking non-administrative connections to prevent new redo from being generated when there is nowhere to save it.

To diagnose and resolve this:

  1. Check space usage in V$RECOVERY_FILE_DEST.
  2. Delete obsolete archive logs via RMAN: DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-1';
  3. If space remains tight, increase db_recovery_file_dest_size or configure a secondary archive destination.

ORA-00271: No Logs Need Archiving

This message appears when ALTER SYSTEM ARCHIVE LOG ALL runs but all filled redo logs have already been processed. No action is needed. It confirms that the archiver is current and there is no backlog to clear.

ORA-16038: Log Sequence Cannot Be Archived

This error points to an I/O failure or a configuration problem that prevents Oracle from writing to the archive destination. Common causes include:

  • Incorrect permissions on the archive directory
  • A disk or partition that has gone offline
  • An invalid path set in LOG_ARCHIVE_DEST_n

RMAN-06054 and ORA-00279

These errors typically appear when ALTER SYSTEM SWITCH LOGFILE is used inside an RMAN backup script. Because that command is asynchronous, RMAN may attempt to back up a log that has not finished archiving yet. Replacing it with ALTER SYSTEM ARCHIVE LOG CURRENT resolves the issue, as covered in the archive log synchronization section above.

How i2Backup Automates Oracle Archive Log Protection

Managing archive logs manually keeps your Oracle environment recoverable, but it also introduces risk. A full archive destination triggers ORA-00257 and blocks user connections. A missed log gap leaves your Data Guard standby out of sync. And if archiving stalls during a backup window, your RMAN job may fail without warning. These are not edge cases — they are the everyday realities of running Oracle in production.

A dedicated backup solution removes much of that operational burden. i2Backup is an enterprise backup platform built to protect Oracle environments with minimal manual intervention.

Key Features of i2Backup

  • Real-Time and Scheduled Database Backup: i2Backup captures redo logs and archive logs continuously, supporting near-zero RPO for Oracle databases. It handles both standalone instances and cluster environments, including RAC and ADG, and supports point-in-time recovery from any captured log position without requiring a full database restore.
  • Automated Backup Workflows: Once configured, i2Backup runs backup tasks on a set schedule — hourly, daily, or at any interval that fits your maintenance window. There is no need to manually trigger archiving or monitor whether logs have been picked up. The platform handles scheduling, cleanup, and retention automatically.
  • Smart Retention and Storage Management: Outdated backups are removed automatically based on retention policies you define. This keeps your archive destination from filling up — one of the most common triggers for ORA-00257 in production environments. i2Backup supports a wide range of storage targets, including local disk, NAS, tape libraries, and object storage.
  • Secure and Tamper-Proof Backups: Data transmission and storage are protected with AES and SM4 encryption. Write-once-read-many (WORM) compliant storage prevents backups from being modified or deleted after creation, which is important for environments with compliance requirements.
  • Centralized Monitoring and Alerts: A web-based console gives visibility into backup task status, log capture progress, and any failures in real time. Email and SMS alerts notify administrators immediately if a job fails, so issues are caught before they affect recovery objectives.

For environments that need continuous protection rather than scheduled backups, i2CDP replicates data changes at the byte level in real time, reducing RPO to near zero. For high availability and automatic failover between Oracle instances, i2Availability provides real-time replication with sub-second switchover — keeping production running even when the primary environment fails.

Together, these solutions cover the full spectrum of Oracle data protection, from routine archive log management to site-level disaster recovery. And you can click the button to get free trail of solutions mentioned above.

FREE Trial for 60-Day

Conclusion

The three archive log commands covered in this guide serve different purposes, and using the wrong one at the wrong time has real consequences. ARCHIVE LOG CURRENT is the reliable choice for backup scripts because it waits for archiving to complete before returning control. ARCHIVE LOG ALL is the right tool when logs have fallen behind and need to be caught up manually. ARCHIVE LOG STOP should be left alone in almost every situation — its behavior in modern Oracle is unpredictable enough to bring a database to a halt.

For day-to-day operations, pairing these commands with a solid understanding of common errors like ORA-00257 and ORA-16038 will help you resolve issues quickly before they affect users.

That said, manual archive log management only goes so far. If your Oracle environment runs in production, automating backup schedules, retention policies, and log capture through a solution like i2Backup by Info2soft reduces the risk of human error and keeps your recovery objectives within reach — without relying on someone remembering to run a command at the right time.

Emma is the bridge between complex engineering and the people who need it. As a content creator at Info2Soft, she spends her days translating "tech-speak" into clear, actionable stories about data resilience. She’s not just documenting software; she's uncovering how data replication and recovery actually change the way businesses run.

More Related Articles

Table of Contents:
Stay Updated on Latest Tips
Subscribe to our newsletter for the latest insights, news, exclusive content. You can unsubscribe at any time.
Subscribe
Ready to Enhance Business Data Security?
Start a 60-day free trial or view demo to see how Info2soft protects enterprise data.
{{ country.name }}
Please fill out the form and submit it, our customer service representative will contact you soon.
By submitting this form, I confirm that I have read and agree to the Privacy Notice.
{{ isSubmitting ? 'Submitting...' : 'Submit' }}