This post has been updated from the original content here.
The ORA-00257 error is a very common Oracle database error. The error is basically trying to tell us that we have run out of logical or physical space on our ASM diskgroup, mount, local disk, or db_recovery_file_dest location where our archivelogs are being stored.
When this issue crops up it usually prevents all connections to the database except for admin level access to allow for the DBA to fix the problem. Usually this is easily resolved in most cases and the below steps outline exactly how to fix the problem.
The first step is to determine where the archivelogs are being stored. Once we know the location we will be able to confirm if this is a logical or physical space shortage.
To find out where our archivelogs are being stored let’s log into SQLPLUS and run a few commands.
Note: Depending on configuration, there could be multiple destinations for archivelogs, each one will need to be checked if there are more than one destination set.
From the first command we run here, we can see that the archiver is indeed enabled and the archivelog destination for this particular database is being derived from another parameter called db_recovery_file_dest.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 8190
Next log sequence to archive 8192
Current log sequence 8192
When we look at the db_recovery_file dest parameter we see that the archivelogs are being written to the +RECO diskgroup and the size of that space is 20TB. This means it can hold up to 20TB of space before filling up.
SQL> show parameter db_recovery_file
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string +RECO
db_recovery_file_dest_size big integer 20T
In this particular database we can see that the value of the log_archive_dest parameter is empty because we are using the db_recovery_file_dest parameter to state where the logs are being stored.
SQL> show parameter log_archive_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string
If we were using a regular filesystem location on a local disk or mount it might look something like the below.
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u02/oracle/db01/archivelogs/
Oldest online log sequence 8190
Next log sequence to archive 8192
Current log sequence 8192
SQL> show parameter db_recovery_file
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u02/oracle/db01/archivelogs/
db_recovery_file_dest_size big integer 20T
You will see at least these two parameters on Oracle 10g, 11g, 12c, or 19c. The first parameter ‘db_recovery_file_dest’ is where our archivelogs will be written to and the second parameter is how much logical space we’re allocating for not only those files, though also other files like backups, redo logs, controlfile snapshots, and a few other files that could be created here by default if we don’t specify a specific location.
SQL> show parameter log_archive_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string /u02/oracle/db01/archivelogs/
So now that we know the location(s) of our archivelogs we can now check to see if it’s a logical or physical space issue. For physical this is easy enough as the diskgroup, disk, or mount point where the archivelogs are being stored would be at 100% capacity.
Physical – If it’s a physical issue, we can take one of the below steps to fix the issue
- Add more space to the mount where the logs are going.
- Take a backup of the logs via RMAN and have it delete input. (Note: If your backups are going to the same place your archivelogs are going, we will need to take a backup on a different mount point/drive.)
- Move the archivelog location to another mount/drive/location temporarily while you do one of the above.
- Delete the archivelogs if we don’t need the ability to restore the database. This could be useful for a dev instance that is refreshed nightly or something similar.
Anyone of the above three will clear the error and allow users to log into the database again almost instantly.
Logical – If it’s a logical issue we simply need to take one of the below actions.
- increase the db_recovery_file_dest_size to a larger size to allow for more archivelogs to be written to the archivelog location. (Note: Be sure to check the underlying disk/mount point before increasing this parameter to ensure there is proper space on the disk/mount.)
- As with the physical issue, simply take an RMAN backup of the logs and have it delete input to clear space.
- Change the db_recovery_file_dest or log_archive_dest to another location that has space
- Delete the archivelogs if they are not needed for recovery
I would recommend using rman for either the backup or delete methods as this will keep your catalog of backups up to date and clean. Also just to point out, that we if we need to ever recover this database we should be taking regular scheduled RMAN backups with a retention policy that also include archivelogs to help keep the archivelog location free for writing of more logs.
Please comment below if this helped you fix your ORA-00257: archiver error. Connect internal only, until freed issue. If you require more help please contact us to speak with a certified Oracle DBA support expert.