Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

How to Recover Undo Datafile ?

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarKiran Dalvi
  • 12 Sep, 2023
  • 0 Comments
  • 1 Min Read

How to Recover Undo Datafile ?

How to Recover Undo Datafile ?

 
To recover undo Datafile Follow the steps given below :
  1. Change the undo_management parameter to manual.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    SQL>
    show
    parameter undo_managementNAME TYPE VALUE
    --------------------------- ----------- ----------------------------
    undo_management string AUTO
     
    SQL>
    alter
     system set undo_management=manual scope=spfile;
    System altered.
      
    SQL>
    startup
     force
    Database mounted.
    ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
    ORA-01110: data file 2:
    'C:\ORACLE\PRODUCT\19c\ORADATA\PRIM\UNDOTBS01.DBF'
      
    SQL>
    show
     parameter undo_management
      
    NAME                                 TYPE        VALUE
    ------------------------------------ ----------- -------------------
    undo_management                      string      MANUAL
  1. Drop the datafile and open the database:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
SQL>
alter
 database datafile 'C:\ORACLE\product\19c\oradata\prim\undotbs01.dbf'
offline drop;
Database altered.
  
SQL>
alter
 database open;
Database altered.
  
SQL>
select
 file#, status, name
from
 v$datafile;
 
     FILE# STATUS  NAME
---------- ------- -------------------------------------------------
 
         1 SYSTEM  C:\ORACLE\product\19c\oradata\prim\system01.dbf
         2 offline C:\ORACLE\product\19c\oradata\prim\undotbs01.dbf
         3 ONLINE  C:\ORACLE\product\19c\oradata\prim\sysaux01.dbf
         4 ONLINE  C:\ORACLE\product\19c\oradata\prim\users01.dbf
  1. Drop the undo tablespace and create new one:
1
2
3
4
5
6
7
8
9
10
11
SQL>
drop
 tablespace undotbs1 including contents;
Tablespace dropped.
  
SQL>
create
 undo tablespace undotbs2 datafile
'C:\ORACLE\product\19c\oradata\prim\undotbs02.dbf' size 100m;
Tablespace created.
SQL>
4. Change the new undo_tablespace parameter to AUTO and reboot the database:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
SQL>
alter
 system set undo_management=auto scope=spfile;
System altered.
  
SQL>
alter
 system set undo_tablespace=undotbs2 scope=spfile;
System altered.
  
SQL>
startup
 force
Database mounted.
Database opened.
SQL>

Hope it Helps!