Search This Blog

Total Pageviews

Friday 1 December 2023

ORA-01139: RESETLOGS option only valid after an incomplete database recovery

ORA-01139: RESETLOGS option only valid after an incomplete database recovery




[oracle@wcp12cr2 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Fri Dec 1 05:41:46 2023

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




https://anuj-singh.blogspot.com/2021/10/rman-restore-database.html

Check the health of datafile !!! :)

set linesize 300 pagesize 100
col inst_id                      for 9999999                 heading 'Instance #'
col file_nr                      for 9999999                 heading 'File #'
col file_name                    for A70                     heading 'File name'
col checkpoint_change_nr         for 99999999999999          heading 'Checkpoint #'
col checkpoint_change_time       for A20                     heading 'Checkpoint time'
col last_change_nr               for 99999999999999          heading 'Last change #'
col SCNStatus for a15
SELECT
 fe.inst_id,
fe.CON_ID,  ---- for >12c
 fe.fenum file_nr,
 fn.fnnam file_name,
 TO_NUMBER (fe.fecps) checkpoint_change_nr,
 fe.fecpt checkpoint_change_time,
fe.fests last_change_nr,
NVL2(fe.fecps, '<-good ----------------------------------------------------------------------="" --------------------="" ----------------="" ---------------="" ----------="" --------="" -------="" ----="" -="" 03:27:07="" 05:41:46="" 0="" 10="" 11="" 12.1.0.1.0="" 12="" 12c="" 13="" 18="" 1982="" 1="" 2013="" 2023="" 2270166="" 2="" 3="" 4="" 5="" 64bit="" 65535="" 6="" 7="" 8="" 9="" advanced="" all="" analytics="" and="" application="" as="" below="" bitand="" by="" c="" change="" checkpoint="" con_id="" connected="" copyright="" database="" db="" dec="" decode="" ecover="" edition="" enterprise="" fe.fedup="" fe.fefnh="fn.fnnum" fe.fenum="" fe.fepax="0)" fe.festa="" fe.fetsn="" fe="" file="" fn.fnflg="" fn.fnfno="fe.fenum" fn.fnnam="" fn.fntyp="4" fn="" fri="" from="" ias_opss.dbf="" iasactivities.dbf="" iasjive.dbf="" iaswebcenter.dbf="" iau.dbf="" instance="" is="" kccfe="" kccfn="" last="" lus:="" max="" mds.dbf="" name="" not="" null="" ocs.dbf="" olap="" on="" online="" ood="" option="" options="" or="" oracle.="" oracle="" oradata="" orcl="" order="" partitioning="" production="" real="" recover="" release="" reserved.="" rights="" rows="" scn="" scnstatus="" selected.="" sql="" sqlplus="" status="" svctbl.dbf="" sysaux01.dbf="" sysdba="" system01.dbf="" system="" testing="" the="" this="" time="" to:="" to="" try="" undotbs01.dbf="" users01.dbf="" wcp12cr2="" webcenter_portlet.dbf="" where="" with="" x=""> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery




SQL> recover database until cancel;
Media recovery complete.


SQL> alter database open resetlogs;

Database altered.

Oracle DBA

anuj blog Archive