Hello Readers, You are here because you faced ORA-00257: Archiver error. Connect AS SYSDBA only until resolved error ? Lets come to point ->
ORA-00257: Archiver error. Connect AS SYSDBA only until resolved error means archiver process is stuck because of various reasons due to which redo logs are not available for further transaction as database is in archive log mode and all redo logs requires archiving. And your database is in temporary still state.
Environment Details –
OS Version – Linux 7.8
DB Version – 19.8 (19)
Type – Test environment
SQL> select name,open_mode,database_role,log_mode from v$database;
NAME OPEN_MODE DATABASE_ROLE LOG_MODE
-------------------- -------------------- ---------------- ----------
ORACLEDB READ WRITE PRIMARY ARCHIVELOG
SQL>
SQL> select GROUP#,SEQUENCE#,BYTES,MEMBERS,ARCHIVE,STATUS from v$log;
GROUP# SEQUENCE# BYTES MEMBERS ARC STATUS
------ --------- --------- ------- --- --------
1 25 209715200 2 NO CURRENT
2 23 209715200 2 NO INACTIVE
3 24 209715200 2 NO INACTIVE
SQL>
There are various reason which cause this error-
- One of the common issue here is archive destination of your database is 100% full.
- The mount point/disk group assigned to archive destination or FRA is dismounted due to OS issue/Storage issue.
- If db_recovery_file_dest_size is set to small value.
- Human Error – Sometimes location doesn’t have permission or we set to location which doesn’t exists.
What Happens when ORA-00257: Archiver error. Connect AS SYSDBA only until resolved Error occurs
Lets us understand what end user see and understand there pain as well. So when a normal user try to connect to the database which is already in archiver error (ORA-00257: Archiver error. Connect AS SYSDBA only until resolved ) state then they directory receive the error –
ORA-00257: Archiver error. Connect AS SYSDBA only until resolved on the screen.
SQL> conn dbsnmp/oracledbworld
ERROR:
ORA-00257: Archiver error. Connect AS SYSDBA only until resolved.
Warning: You are no longer connected to ORACLE.
SQL>
You might be wondering what happens to the user which is already connected to the oracle database. In this case if they trying to do a DML, it will stuck and will not come out. For example here I am just trying to insert 30k record here again which is stuck and didn’t came out.
SQL> conn system/oracledbworld
connected.
SQL> create table oracledbworld2 as select * from oracledbworld;
Table created.
SQL> insert into oracledbworld select * from oracledbworld2;
29965 rows created.
SQL> /
How to Check archive log location
Either you can fire archive log list or check your log_archive_dest_n to see what location is assigned
SQL> select name,open_mode,database_role,log_mode,force_logging from v$database;
NAME OPEN_MODE DATABASE_ROLE LOG_MODE FORCE_LOGGING
--------- ------------ ---------------- ------------ ----------------
ORACLEDB READ WRITE PRIMARY ARCHIVELOG YES
SQL>
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 18
Next log sequence to archive 20
Current log sequence 20
SQL>
When you see USE_DB_RECOVERY_FILE_DEST, that means you have enabled FRA location for your archive destination. So here you have to check for db_recover_file_dest to get the diskgroup name / location where Oracle is dumping the archive log files.
SQL> show parameter db_recover_file_dest
What are Different Ways to Understand if there is ORA-00257: Archiver error. Connect AS SYSDBA only until resolved Error
There are different ways to understand what is there issue. Usually end user doesn’t understand the ORA- code and they will rush to you with a Problem statement as -> DB is running slow or I am not able to login to the database.
Check the Alert Log First –
Always check alert log of the database to understand what is the problem here –
I have set the log_archive_dest_1 to a location which doesn’t exists to reproduce ORA-00257: Archiver error. Connect AS SYSDBA only until resolved Error. So alert log clearly suggest that
ORA-19504: failed to create file %s
ORA-27040: file create error, unable to create file
Linux-x86-64 Error: 13: Permission denied.
In middle of the alert – “ORACLE Instance oracledb, archival error, archiver continuing”
At 4th Last line you might seen the error – “All online logs need archiving”
Check Space availability –
Once you rule out that there is no human error, and the archive log location exists Now you should check if mount point/ disk group has enough free space available, if it is available for writing and you can access it.
If your database is on ASM, then you can use following query – Check for free_mb/usable file mb and state column against your diskgroup name.
SQL> select name,state,free_mb,usable_file_mb,total_mb from v$asm_diskgroup;
If your database is on filesystem, then you can use following OS command –
For linux, sun solaris -
$df -kh
For AIX -
$df -gt
If case you have FRA been used for archive destination then we have additional query to identify space available and how much is allocated to it.
SQL> select name, space_limit as Total_size ,space_used as Used,SPACE_RECLAIMABLE as reclaimable ,NUMBER_OF_FILES as "number" from V$RECOVERY_FILE_DEST;
NAME TOTAL_SIZE USED RECLAIMABLE number
---------------------------------- ---------- ---------- ----------- ----------
/u01/app/oracle/fast_recovery_area 10485760 872185344 68794880 25
SQL> Select file_type, percent_space_used as used,percent_space_reclaimable as reclaimable,number_of_files as "number" from v$recovery_area_usage;
FILE_TYPE USED RECLAIMABLE number
----------------------- ---------- ----------- ----------
CONTROL FILE 100.94 0 1
REDO LOG 6000 0 3
ARCHIVED LOG 1900.78 452.02 18
BACKUP PIECE 306.09 204.06 3
IMAGE COPY 0 0 0
FLASHBACK LOG 0 0 0
FOREIGN ARCHIVED LOG 0 0 0
AUXILIARY DATAFILE COPY 0 0 0
8 rows selected.
You can look at sessions and event to understand what is happening in the database.
If you see there are 3 sessions, SID 237 is my session Rest two sessions are application session and when we look at the event of those two application session it clearly suggest session is waiting for log file switch (archiving needed).
select sid,serial#,event,sql_id from v$session where username is not null and status='ACTIVE';
SID SERIAL# EVENT SQL_ID
--- ---------- ---------------------------------------- -------------
237 59305 SQL*Net message from client 7wcvjx08mf9r6
271 46870 log file switch (archiving needed) 7zq6pjtwy552p
276 18737 log file switch (archiving needed) a5fasv0jz2mx2
How to Resolve ORA-00257: Archiver error. Connect AS SYSDBA only until resolved error
It’s always better to know the environment before firing any command. Archive deletion can be destructive for DR setup or Goldengate Setup.
Solution 1
Check if you have DR database and it’s in sync based on that take a call of clearing the archive until sequence. You can use following command on RMAN prompt.
delete archivelog until sequence <sequence> thread <thread no>;
Solution 2
You can change destination to a location which has enough space.
SQL>archive log list
SQL>show parameter log_archive_dest_1
(or whichever you are using it, usually we use dest_1)
Say your diskgroup +ARCH is full and +DATA has lot of space then you can fire
SQL> alter system set log_archive_dest_1='location=+DATA reopen';
You might be wondering why reopen. So since your archive location was full. There are chances if you clear the space on OS level and archiver process still remain stuck. Hence we gave reopen option here.
Solution 3
Other reason could be your db_recovery_file_dest_size is set to lower size. Sometimes we have FRA enabled for archivelog. And we have enough space available on the diskgroup/ filesystem level.
archive log list;
show parameter db_recovery_file_dest_size
alter system set db_recovery_file_dest_size=<greater size then current value please make note of filesystem/diskgroup freespace as well>
example -
Initially it was 20G
alter system set db_recovery_file_dest_size=100G sid='*';
Reference – archive Document 2014425.1
ora-00257: archiver error. connect as sysdba only until resolved.
Error While Connecting db through SQL Developer…
Cause
The archiver process of the oracle database received an error while trying to archive a redo log. The most likely cause of this message is that the destination device is out of space to store the redo log file.
Solution
To resolve this issue, contact the DBA to clear archive log directory and make some room for redo log creation. Once the issue gets resolved, test the connection and run the task.
This command will show you where your archivelogs are being written to:
SQL> show parameter log_archive_dest
NAME TYPE VALUE
———————————— ———— ——————————
log_archive_dest string /u01/archivelog/orcl/
If the ‘log_archive_dest’ parameter is empty then you are most likely using a ‘db_recovery_file_dest’ to store your archivelogs. You can run the below command to see that location.
SQL> show parameter recovery
NAME TYPE VALUE
———————————— ———— ——————————
db_recovery_file_dest string /u01/fast_recovery_area
db_recovery_file_dest_size big integer 100G
You will see at least these two parameters if you’re on Oracle 10g, 11g, or 12c. The first parameter ‘db_recovery_file_dest’ is where your archivelogs will be written to and the second parameter is how much space you are 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 of you don’t specify a specific location.
SQL> archive log list;
Now, note thatyou can find archive destinations if you are using a destination of USE_DB_RECOVERY_FILE_DEST by:
SQL> show parameter db_recovery_file_dest;
find out what value is being used for db_recovery_file_dest_size, use:
SQL> SELECT * FROM V$RECOVERY_FILE_DEST;
You may find that the SPACE_USED is the same as SPACE_LIMIT,
It is important to note that within step five of the ORA-00257 resolution, you may also encounter ORA-16020 in the LOG_ARCHIVE_MIN_SUCCEED_DEST, and you should use the proper archivelog path and use (keeping in mind that you may need to take extra measures if you are using Flash Recovery Area as you will receive more errors if you attempt to use LOG_ARCHIVE_DEST):
SQL>alter system set LOG_ARCHIVE_DEST_.. = ‘location=/archivelogpath reopen’;
The last step in resolving ORA-00257 is to change the logs for verification using:
SQL> alter system switch logfile;
According to the alert log, my db_recovery_file_dest was full and need to increase its size.
If you have enough space on underlying file system then simply increase the size of db_recovery_file_dest_szie otherwise first increase the size of the storage then modify this parameter.
SQL> show parameter db_recover
NAME TYPE VALUE
———————————— ———— ——————————
db_recovery_file_dest string /u01/app/oracle/fast_recovery_
area
db_recovery_file_dest_size big integer 4500M
SQL> alter system set db_recovery_file_dest_size=5G;
System altered.
Now you can invoke sqlplus
$sqlplus /nolog
SQL>conn / as sysdba
SQL> archive log list;
Check the Archive destination and delete all the logs
SQL> shutdown immediate
SQL> startup mount
SQL> alter database noarchivelog;
SQL> alter database open;
SQL> archive log list;
You should purge the archived logs with RMAN:
RMAN>delete archivelog all;
RMAN> crosscheck archivelog all;
RMAN> DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
SQL> SELECT * FROM V$RECOVERY_FILE_DEST;
SQL> select * from V$RECOVERY_AREA_USAGE;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 10 DAYS;
CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7days;
RMAN> delete obsolete;
CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
RMAN> show all;
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7days;
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
RMAN> Delete archivelog all completed before ‘SYSDATE-1’;
SQL> archive log list;
SQL> SELECT * FROM V$RECOVERY_FILE_DEST;
SQL> select * from V$RECOVERY_AREA_USAGE;
SQL> select * from v$flash_recovery_area_usage;
January 27, 2020
Sometimes you can get ” ora-00257: archiver error. connect as sysdba only until resolved ” error, while connecting to Oracle database.
ORA-00257: archiver error. connect as sysdba only until resolved
Details of error are as follows.
ORA-00257: archiver error. Connect internal only, until freed 00257, 00000, "Archiver error. Connect AS SYSDBA only until resolved." // *Cause: The archiver process received an error while trying to archive // a redo log. If the problem is not resolved soon, the database // will stop executing transactions. The most likely cause of this // message is that the destination device is out of space to store the // redo log file. Another possible cause is that a destination marked // as MANDATORY has failed. // *Action: Check the alert log and trace files for detailed error // information.
ORA-00257 archiver error. connect as sysdba
Here is output of Alertlog
Errors in file /u01/app/oracle/diag/rdbms/MSD/MSD/trace/MSD_tt00_12641.trc: ORA-19809: limit exceeded for recovery files ORA-19804: cannot reclaim 53477376 bytes disk space from 107374182400 bytes limit 2020-01-27T13:45:36.261480+03:00 Errors in file /u01/app/oracle/diag/rdbms/MSD/MSD/trace/MSD_tt00_12641.trc: ORA-19815: WARNING: db_recovery_file_dest_size of 107374182400 bytes is 100.00% used, and has 0 remaining bytes available. 2020-01-27T13:45:36.261565+03:00 ************************************************************************ You have following choices to free up space from recovery area: 1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard, then consider changing RMAN ARCHIVELOG DELETION POLICY. 2. Back up files to tertiary device such as tape using RMAN BACKUP RECOVERY AREA command. 3. Add disk space and increase db_recovery_file_dest_size parameter to reflect the new space. 4. Delete unnecessary files using RMAN DELETE command. If an operating system command was used to delete files, then use RMAN CROSSCHECK and DELETE EXPIRED commands. ************************************************************************ 2020-01-27T13:45:36.262505+03:00 Errors in file /u01/app/oracle/diag/rdbms/MSD/MSD/trace/MSD_tt00_12641.trc: ORA-19809: limit exceeded for recovery files ORA-19804: cannot reclaim 53477376 bytes disk space from 107374182400 bytes limit
Archiver error connect as sysdba
If you got this ORA-00257: archiver error, it means Archivelog and Redolog file destination disk is out of space to store these files.
You have 2 option to solve this problem.
Firstly, connect RMAN and Delete Old archivelogs if you have already backed up them Or you don’t need their backups.
Use delete archivelog command to delete Archivelogs, you can delete them until time sysdate -1 ( Keep Last 1 day Archivelog, delete older than 1 day ) or sysdate-1/8 ( Keep Last 3 hours Archivelogs, delete older than 3 hours ) according to your need.
delete noprompt force archivelog until time 'sysdate -1';
[MSD]/home/oracle $ rman target /
Recovery Manager: Release 18.0.0.0.0 - Production on Mon Jan 27 13:58:09 2020
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle and/or its affiliates. All rights reserved.
connected to target database: MSD (DBID=1475860412)
RMAN> delete noprompt force archivelog until time 'sysdate -1';
If you cannot delete archivelogs, then you need to increase the size of either Recovery_dest_size or Log_archive_dest_size as follows.
Connected to: Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production Version 18.3.0.0.0 SQL> show parameter recovery NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string +DATA db_recovery_file_dest_size big integer 100G recovery_parallelism integer 0 remote_recovery_file_dest string SQL> SQL> SQL> alter system set db_recovery_file_dest_size=200G scope=both sid='*'; System altered.
Problem will be solved.
Do you want to learn Oracle Database for Beginners, then Click and read the following articles.
Oracle Database Tutorials for Beginners ( Junior Oracle DBA )
2,624 views last month, 1 views today
About Mehmet Salih Deveci
I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA, Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].- -Oracle DBA, SQL Server DBA, APPS DBA, Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için [email protected] a mail atabilirsiniz.
Recently, one of the Oracle users complained that the database was unusable and received the error below
Check #1: Are we physically out of space?
When the host is out of space on the drive/device where the FRA has been set, it can produce this error. We run Oracle on Windows. So, it could be
- Shadow Copy
- Orphaned files not referenced by the database
- Extraneous non-database files
- Archivelog files no longer needed after being backed up (DELETE INPUT option)
I looked at the space situation and it looked good (PowerShell command is from the dbatools module and allows you to get this server space info. from your own host)
PS C:WINDOWSsystem32> Get-DbaDiskSpace -com MyHostName | Format-Table Server Name Label SizeInGB FreeInGB PercentFree BlockSize ------ ---- ----- -------- -------- ----------- --------- MyHostName C: OS 99.9 64.02 64.08 4096 MyHostName D: DATA 500 89.78 17.96 4096
Check #2: The Alert Log
Next, I looked at the alert log and saw the problem and the solution was offered right there:
Thu Apr 18 20:15:03 2019 Errors in file D:ORACLEdiagrdbmsMyInstanceMyInstancetraceMyInstance_arc7_4596.trc: ORA-19809: limite dépassée pour les fichiers de récupération ORA-19804: impossible de récupérer un espace disque de 45032960 octets de la limite 268435456000 ARC7: Error 19809 Creating archive log file to '\MyHostNameORAFRA$MyInstanceARCHIVELOG2019_04_18O1_MF_1_518897_%U_.ARC' Thu Apr 18 20:15:03 2019 Errors in file D:ORACLEdiagrdbmsMyInstanceMyInstancetraceMyInstance_arc8_4576.trc: ORA-19815: AVERTISSEMENT : db_recovery_file_dest_size octets sur 268435456000 sont utilisés (100.00%) ; il reste 0 octets disponibles. Thu Apr 18 20:15:03 2019 ************************************************************************ You have following choices to free up space from recovery area: 1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard, then consider changing RMAN ARCHIVELOG DELETION POLICY. 2. Back up files to tertiary device such as tape using RMAN BACKUP RECOVERY AREA command. 3. Add disk space and increase db_recovery_file_dest_size parameter to reflect the new space. 4. Delete unnecessary files using RMAN DELETE command. If an operating system command was used to delete files, then use RMAN CROSSCHECK and DELETE EXPIRED commands. ************************************************************************ Thu Apr 18 20:15:04 2019 Errors in file D:ORACLEdiagrdbmsMyInstanceMyInstancetraceMyInstance_arc8_4576.trc: ORA-19809: limite dépassée pour les fichiers de récupération ORA-19804: impossible de récupérer un espace disque de 45032960 octets de la limite 268435456000 ARC8: Error 19809 Creating archive log file to '\MyHostNameORAFRA$MyInstanceARCHIVELOG2019_04_18O1_MF_1_518897_%U_.ARC' Thu Apr 18 20:15:05 2019 Errors in file D:ORACLEdiagrdbmsMyInstanceMyInstancetraceMyInstance_arc9_4572.trc: ORA-19815: AVERTISSEMENT : db_recovery_file_dest_size octets sur 268435456000 sont utilisés (100.00%) ; il reste 0 octets disponibles. Thu Apr 18 20:15:05 2019 ************************************************************************ You have following choices to free up space from recovery area:
Sorry, the messages are in French. I did a Google Translate to English below
Thu Apr 18 20:15:03 2019 Errors in file D: ORACLE diag rdbms MyInstance MyInstance trace MyInstance_arc7_4596.trc: ORA-19809: Exceeded limit for recovery files ORA-19804: Unable to recover disk space of 45032960 bytes from limit 268435456000 ARC7: Error 19809 Creating archive log file to '\ MyHostName ORAFRA $ MyInstance ARCHIVELOG 2019_04_18 O1_MF_1_518897_% U_.ARC' Thu Apr 18 20:15:03 2019 Errors in file D: ORACLE diag rdbms MyInstance MyInstance trace MyInstance_arc8_4576.trc: ORA-19815: WARNING: db_recovery_file_dest_size bytes on 268435456000 are used (100.00%); there are 0 bytes left. Thu Apr 18 20:15:03 2019 ************************************************** ********************** You have to choose from the following areas: 1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard, then consider changing RMAN ARCHIVELOG DELETION POLICY. 2. Back up files to tertiary device such as tape using RMAN BACKUP RECOVERY AREA command. 3. Add disk space and increase db_recovery_file_dest_size parameter reflect the new space. 4. Delete unnecessary files using RMAN DELETE command. If an operating RMAN CROSSCHECK and system DELETE EXPIRED commands. ************************************************** ********************** Thu Apr 18 20:15:04 2019 Errors in file D: ORACLE diag rdbms MyInstance MyInstance trace MyInstance_arc8_4576.trc: ORA-19809: Exceeded limit for recovery files ORA-19804: Unable to recover disk space of 45032960 bytes from limit 268435456000 ARC8: Error 19809 Creating archive log file to '\ MyHostName ORAFRA $ MyInstance ARCHIVELOG 2019_04_18 O1_MF_1_518897_% U_.ARC' Thu Apr 18 20:15:05 2019 Errors in file D: ORACLE diag rdbms MyInstance MyInstance trace MyInstance_arc9_4572.trc: ORA-19815: WARNING: db_recovery_file_dest_size bytes on 268435456000 are used (100.00%); there are 0 bytes left. Thu Apr 18 20:15:05 2019 ************************************************** ********************** You have to choose from the following areas:<span id="mce_SELREST_start" style="overflow:hidden;line-height:0;"></span>
Check #3: Check the space allocated to DB_RECOVERY_FILE_DEST_SIZE
Basically it is saying that the “BACKUP RECOVERY AREA” is full. Although there is ample diskspace, the parameter DB_RECOVERY_FILE_DEST_SIZE determines how much space Oracle can use for database recovery related activities.
To check the space allocated to DB_RECOVERY_FILE_DEST_SIZE you could use one of the following options
SQL*Plus
SHOW PARAMETER DB_RECOVERY_FILE_DEST_SIZE
SQL> show parameter db_recovery_file_dest_size NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest_size big integer 250G
SQL:
This also shows you the current usage as opposed to just the setting with SQL*Plus above
select name, floor(space_limit / 1024 / 1024) "Size MB",ceil(space_used/ 1024 / 1024) "Used MB" from v$recovery_file_dest;
As can be seen, I have it set to 250GB and most of it is used:
NAME | Size MB | Used MB |
\MyHostNameOrafra$ | 256000 | 255991 |
Check #4: Are backups succeeding?
Check your backup history to make sure Archived Redo Log File backups are successful. If the backups are failing then the Oracle Flash Recovery Area (FRA) may get full. Run archive log backups using the standard procedure you use in your shop. To check if backups are failing you can use this SQL (I am not the author, original source unknown)
Run in SQL*Plus. Substitute &NUMBER_OF_DAYS and tweak WHERE clause as necessary
set lines 220 set pages 1000 col cf for 9,999 col df for 9,999 col elapsed_seconds for 999999999 heading "ELAPSED|SECONDS" col i0 for 9,999 col i1 for 9,999 col l for 9,999 col output_gb for 9,999,999.00 heading "OUTPUT|GB" col session_recid for 999999 heading "SESSION|RECID" col session_stamp for 99999999999 heading "SESSION|STAMP" col status for a10 trunc col time_taken_display for a10 heading "TIME|TAKEN" col output_instance for 9999 heading "OUT|INST" SELECT vi.HOST_NAME, vi.INSTANCE_NAME, J.SESSION_RECID, J.SESSION_STAMP, TO_CHAR (J.START_TIME, 'yyyy-mm-dd hh24:mi:ss') START_TIME, TO_CHAR (J.END_TIME, 'yyyy-mm-dd hh24:mi:ss') END_TIME, (J.OUTPUT_BYTES / 1024.0 / 1024.0 / 1024.0) OUTPUT_GB, J.STATUS, J.INPUT_TYPE, /* CASE WHEN TO_CHAR (J.START_TIME, 'd') = 1 THEN 'Monday' WHEN TO_CHAR (J.START_TIME, 'd') = 2 THEN 'Tuesday' WHEN TO_CHAR (J.START_TIME, 'd') = 3 THEN 'Wednesday' WHEN TO_CHAR (J.START_TIME, 'd') = 4 THEN 'Thursday' WHEN TO_CHAR (J.START_TIME, 'd') = 5 THEN 'Friday' WHEN TO_CHAR (J.START_TIME, 'd') = 6 THEN 'Saturday' WHEN TO_CHAR (J.START_TIME, 'd') = 7 THEN 'Sunday' END DOW, */ J.ELAPSED_SECONDS, J.TIME_TAKEN_DISPLAY --X.CF, --X.DF, --X.I0, --X.I1, --X.L, --RO.INST_ID OUTPUT_INSTANCE FROM v$instance vi, V$RMAN_BACKUP_JOB_DETAILS J LEFT OUTER JOIN ( SELECT D.SESSION_RECID, D.SESSION_STAMP, SUM ( CASE WHEN D.CONTROLFILE_INCLUDED = 'YES' THEN D.PIECES ELSE 0 END) CF, SUM ( CASE WHEN D.CONTROLFILE_INCLUDED = 'NO' AND D.BACKUP_TYPE || D.INCREMENTAL_LEVEL = 'D' THEN D.PIECES ELSE 0 END) DF, SUM ( CASE WHEN D.BACKUP_TYPE || D.INCREMENTAL_LEVEL = 'D0' THEN D.PIECES ELSE 0 END) I0, SUM ( CASE WHEN D.BACKUP_TYPE || D.INCREMENTAL_LEVEL = 'I1' THEN D.PIECES ELSE 0 END) I1, SUM (CASE WHEN D.BACKUP_TYPE = 'L' THEN D.PIECES ELSE 0 END) L FROM V$BACKUP_SET_DETAILS D JOIN V$BACKUP_SET S ON S.SET_STAMP = D.SET_STAMP AND S.SET_COUNT = D.SET_COUNT WHERE S.INPUT_FILE_SCAN_ONLY = 'NO' GROUP BY D.SESSION_RECID, D.SESSION_STAMP) X ON X.SESSION_RECID = J.SESSION_RECID AND X.SESSION_STAMP = J.SESSION_STAMP LEFT OUTER JOIN ( SELECT O.SESSION_RECID, O.SESSION_STAMP, MIN (INST_ID) INST_ID FROM GV$RMAN_OUTPUT O GROUP BY O.SESSION_RECID, O.SESSION_STAMP) RO ON RO.SESSION_RECID = J.SESSION_RECID AND RO.SESSION_STAMP = J.SESSION_STAMP WHERE J.START_TIME > SYSDATE - &NUMBER_OF_DAYS --AND J.STATUS = 'FAILED' --AND J.INPUT_TYPE = 'DB INCR' --trunc(sysdate) -- --ORDER BY TIME_TAKEN_DISPLAY desc; ORDER BY start_time desc;
Solutions:
If disk cleanup is necessary, do so. If backups are failing, remedy the situation and get a successful archive log backup. If FRA is too small, increase the size.
In my case today, the solution to the problem is offered in the alert log itself:
You have following choices to free up space from recovery area: 1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard, then consider changing RMAN ARCHIVELOG DELETION POLICY. 2. Back up files to tertiary device such as tape using RMAN BACKUP RECOVERY AREA command. 3. Add disk space and increase db_recovery_file_dest_size parameter to reflect the new space. 4. Delete unnecessary files using RMAN DELETE command. If an operating system command was used to delete files, then use RMAN CROSSCHECK and DELETE EXPIRED commands.
I chose to increase the space for DB_RECOVERY_FILE_DEST_SIZE as we are going through other problems with Backup.
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=300G SCOPE=BOTH; System altered.
Alternate solutions
You could move the archive log files to a different drive/folder where there is space and recatalog them using the command below by pointing to the directory the archive logs were moved to and then crosscheck/delete expired (shown later).
catalog start with '/path/to/directory/';
If you know that certain archive log files were already backed up, you could remove them to make room as shown in this post:
How to delete archive logs already archived to backup device?
Run this in RMAN (and change to disk if you are not using sbt_tape)
--Get the list archive logs already backed up atleast once list archivelog all backed up 1 times to sbt_tape; --Then remove them if any were returned by the above run { DELETE ARCHIVELOG LIKE '%' BACKED UP 1 TIMES TO DEVICE TYPE SBT_TAPE; }
Alternatively, you could first backup the archive log files if you can and then remove them from the recovery area. If you are unable to backup for whatever reason, the archive log files can be physically moved to another location for safekeeping (and recatalog later when you move back) and update the RMAN catalog. You need to check the location pointed to by “db_recovery_file_dest”
SELECT * FROM V$PARAMETER WHERE NAME = 'db_recovery_file_dest'
..physically move the archive log files and update RMAN catalog to reflect the freed-up space in the recovery area.
crosscheck archivelog all; delete expired archivelog all;
The problem is resolved for now!
ORA-00257 is one of the commonest error in Oracle DBA life. He/She often has to deal with it.Oracle Database almost got frozen because of it and all transaction get stopped .Let us see how to deal with ORA-00257 error
Error Message
ORA-00257: archiver error. Connect internal only, until freed.
As per The oerr ORA-00257 error means
ORA-00257: archiver error. Connect internal only, until freed. Cause: The archiver process received an error while trying to archive a redo log. If the problem is not resolved soon, the database will stop executing transactions. The most likely cause of this message is the destination device is out of space to store the redo log file.
Action: Check the archiver trace file for a detailed description of the problem. Also, verify that the device specified in the initialization parameter archive_log_dest is set up properly for archiving.
Where do you see this error message
1) You will see below type of error message pertaining in alert log
Following is some if the information from the alert log:
Errors in file u01oracleproduct11.2.0diagrdbmsTESTtesttracetest_arc1_1010.trc: ORA-19815: WARNING: db_recovery_file_dest_size of 21474836480 bytes is 100.00% used, and has 0 remaining bytes available.Wed jan 21 02:44:02 2016 ************************************************************************ You have following choices to free up space from flash recovery area: 1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard, then consider changing RMAN ARCHIVELOG DELETION POLICY. 2. Back up files to tertiary device such as tape using RMAN BACKUP RECOVERY AREA command. 3. Add disk space and increase db_recovery_file_dest_size parameter to reflect the new space. 4. Delete unnecessary files using RMAN DELETE command. If an operating system command was used to delete files, then use RMAN CROSSCHECK and DELETE EXPIRED commands. ************************************************************************ ARC1: Failed to archive thread 1 sequence 1459 (1809) ARCH: Archival stopped, error occurred. Will continue retrying Wed jan 21 02:44:02 2016 Errors in file u01oracleproduct11.2.0diagrdbmsTESTtesttracetest_arc1_1010.trc ORA-16038: log 3 sequence# 1459 cannot be archived ORA-19809: limit exceeded for recovery files ORA-00312: online log 3 thread 1: 'u01oracleoradataTESTredo03.LOG'
2) If you try to login with non sysdba user, you will the below error message
sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 - Production on Copyright (c) 1982, 2008, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> conn apps/apps ERROR: ORA-00257: archiver error. Connect internal only, until freed. Warning: You are no longer connected to ORACLE. SQL
3) If you try to login with sysdba user and check the wait event for the session , you will find session waiting log archive switch event
Why ORA-00257 error occurs
This error happens as the target location for archive log is either full or not available. The Oracle ARCH background process is responsible for taking the redo logs from the online redo log file system and writing them to the flat file is not able to write to the filesystem
How to resolve ORA-00257 errors
1) First of all we should find the archive log destination for the database
sqlplus / as sysdba SQL> archive log list;
you can also find archive destinations by either USE_DB_RECOVERY_FILE_DEST
SQL> show parameter db_recovery_file_dest;
Also get the size of the db_recovery_file_dest
show parameter db_recovery_file_dest_size;
2) The next step in resolving ORA-00257 is to find out what value is being used for db_recovery_file_dest_size, use:
SQL> SELECT * FROM V$RECOVERY_FILE_DEST;
You may find that the SPACE_USED is the same as SPACE_LIMIT, if this is the case, to resolve ORA-00257 should be remedied by moving the archive logs to some other destination.
SQL> SELECT * FROM V$RECOVERY_FILE_DEST; NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES +FLASH 21474836480 21474836480 212428800 200
3) We can have many solutions in these situation
a) Increase the size of db_recovery_file_dest if you have space available in Oracle ASM or filesystem whatever you are using
alter system set db_recovery_file_dest_size=40g;
b) We can delete the archive log which have been already backed up
rman target / delete archivelog UNTIL TIME = 'SYSDATE-1' backed up 1 times to sbt_tape;rman target / RMAN>delete archivelog until time 'SYSDATE-3'; or, RMAN>delete archivelog all; or delete archivelog UNTIL TIME = 'SYSDATE-1.5' backed up 1 times to sbt_tape;
c) If you have not taken the backup,then it is advise to take backup and then delete the archive log files
rman target /run { allocate channel d1 type disk; backup archivelog all delete input format '/u11/ora/arch_%d_%u_%s'; release channel d1; }
d) Sometimes old backup piece ,flashback logs may be occupying space in the db_recovery_file_dest, you check the content of db_recovery_file_dest
SQL>Select file_type, percent_space_used as used,percent_space_reclaimable as reclaimable, number_of_files as "number" from v$flash_recovery_area_usage;FILE_TYPE USED RECLAIMABLE number ------------ ---------- ----------- ---------- CONTROLFILE 0 0 0 ONLINELOG 0 0 0 ARCHIVELOG 4.77 0 2 BACKUPPIECE 56.80 0 10 IMAGECOPY 0 0 0 FLASHBACKLOG 11.68 11.49 63
Sometimes old guaranteed restore point might be present, Dropping will release the space.
Flashback Database explained and limitation
how to Flashback when we have dataguard
Top 10 Useful Queries for Flashback Database
e) If we dont need archive log , then simply deleting will also serve the purpose
rman target / DELETE NOPROMPT ARCHIVELOG ALL;
Other useful command in this case
LIST COPY OF ARCHIVELOG ALL COMPLETED AFTER 'SYSDATE-1'; DELETE NOPROMPT BACKUP COMPLETED BEFORE 'SYSDATE-4'; LIST COPY OF ARCHIVELOG UNTIL TIME = 'SYSDATE-18'; BACKUP ARCHIVELOG COMPLETION TIME BETWEEN 'SYSDATE-28' AND 'SYSDATE-7';
Important Note
Please dont delete archive log file manually from the filesystem, it will not update control file and it will not clear the issue. Then you have do crosscheck all in rman and delete obsolete and expired
f) We can specify alternate path for archiving
Archiving is automatically performed to the alternate dest2
log_archive_dest_1='LOCATION=use_db_recovery_file_dest NOREOPEN ALTERNATE=LOG_ARCHIVE_DEST_2' log_archive_dest_2='LOCATION=/other_dest_for_archiving' log_archive_dest_state_1='enable' log_archive_dest_state_2='alternate' db_recovery_file_dest='/u01/app/oradata/flash_recovery_area' db_recovery_file_dest_size=200G
4) Once space is available in db_recovery_file_dest, Please check the system by doing alter system switch logfile
alter system switch logfile; system alerted
Also try connecting with non sysdba user to make sure ,issue is resolved
sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 - Production on Copyright (c) 1982, 2008, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> conn apps/apps connected SQL>
It is advisable to take regular backup of archive log and delete them. We should put a monitoring script to keep a check on the flash recovery area space.
Related Articles
ORA-00936 missing expression
ORA-01017: invalid username/password; logon denied
ORA-29913 with external tables
ora-00904 invalid identifier
ORA-00001 unique constraint violated
ORA-01111 in MRP
How to find archive log history
RMAN-06059: expected archived log not found, lost of archived log compromises recoverability
A scheduler job which is refreshing materialized views threw an error ORA-00257 in the alert log like this:
ORA-12012: error on auto execute of job 78450
ORA-00257: archiver error. Connect internal only, until freed.
...
Rationale on ORA-00257
The first action we should take is to check all the archived log destinations LOG_ARCHIVE_DEST_n or DB_RECOVERY_FILE_DEST to make sure they have enough space. If they are in good conditions, the possible causes could be from the remote database that is connected by local database links for refreshing local materialized views. Either local or remote database could cause the error, you should release some space to make the database move.
Solutions to ORA-00257
1. Remove ALL Archived Logs in RMAN
If you’re in an urgent situation, you can delete all archived logs without asking anything.
$ rman target /
...
RMAN> delete noprompt archivelog all;
This RMAN command will delete all archived logs without prompting you the confirmation. That is to say, we keep none of online archived logs.
2. Remove Some Archived Logs in RMAN
The following command will keep archived logs only latest 3 days.
RMAN> delete archivelog until time 'sysdate - 3';
The following command will keep archived logs only 1 hour.
RMAN> delete archivelog until time 'sysdate - 1/24';
The following command will keep archived logs only 5 minutes.
RMAN> delete archivelog until time 'sysdate - 5/1440';
3. Remove Some Archived Logs at OS-level
Sometimes, you might be not able to access RMAN in the first place, to free up the space of archived log destinations manually, you can refer to following steps in order to solve ORA-00257.
Find Candidates
List and make sure all the target files are available to move or delete.
For example, we’d like to keep the files newer than 7 days. The following Unix command find will list 7 and 7+ days old files.
$ cd /path/to/archived_log_destination
$ find . -mtime +6 -exec ls -l {} ;
Please make sure the listed file are allowed to be moved or deleted. Furthermore, you should make sure the standby databases have received or applied the archived logs.
Remove Files
Remove all the target files.
$ find . -mtime +6 -exec rm {} ;
So far, the database is not aware of the resulting free space that you just did on OS-level. So we need to notify the database.
Connect RMAN
Connect to the backup database.
$ rman target / catalog sys/password@backupdb
Find Expired Archive Logs
Notify RMAN to check the current status of all archived log files.
RMAN> crosscheck archivelog all;
RMAN will mark the deleted backups as EXPIRED, but their records are not removed from the catalog automatically, this is because some DBA might move these backups back to the original destination at a later time. Their status will be back to AVAILABLE again.
Now, the database knows that the space is freed up, it should be no more ORA-00257. If the database is still unresponsive, you can decide to delete these records.
Delete Expired Archive Logs
Delete the records of non-existent archived log files from the catalog.
RMAN> delete expired archivelog all;
Same procedure can apply to the following error: How to Resolve ORA-19809 Limit Exceeded for Recovery Files