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.

Restore Missing Datafile In Standby Database Oracle 12c

Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
Breadcrumb Abstract Shape
  • User AvatarKiran Dalvi
  • 28 Sep, 2023
  • 0 Comments
  • 2 Mins Read

Restore Missing Datafile In Standby Database Oracle 12c

Restore Missing Datafile In Standby Database Oracle 12c
Check status of primary and standby database:
1
2
3
4
5
6
7
8
9
10
11
12
13
@PRIMARY
 
SQL> select DB_UNIQUE_NAME,OPEN_MODE,DATABASE_ROLE from v$database;
 
DB_UNIQUE_NAME OPEN_MODE DATABASE_ROLE
------------------------------ -------------------- ----------------
PRIM READ WRITE PRIMARY
@ STANDBY
SQL> select name,OPEN_MODE,DATABASE_ROLE from v$database;
 
NAME OPEN_MODE DATABASE_ROLE
--------- -------------------- ----------------
STANDBY READ ONLY WITH APPLY PHYSICAL STANDBY

PLEASE NOTE : All activities need to be done on standby database.

 

 

1. CANCEL THE RECOVERY( STANDBY)
1
2
SQL> recover managed standby database cancel;
Media recovery complete.
2 . START STANDBY IN MOUNT STAGE( IF IN READ-ONLY MODE):
1
2
3
4
5
6
7
8
9
10
11
12
13
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
 
Total System Global Area 1.3935E+10 bytes
Fixed Size 6002112 bytes
Variable Size 4630514240 bytes
Database Buffers 9193914368 bytes
Redo Buffers 104153088 bytes
Database mounted.
3. RESTORE THE DATAFILE ( STANDBY)
SYNTAX – RESTORE DATAFILE < FILE_ID> FROM SERVICE < PRIMARY DB SERVICE NAME >
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
rman target /
 
Recovery Manager: Release 12.1.0.1.0 - Production on Tue Oct 18 18:04:15 2016
 
Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
 
connected to target database: STANDBY (DBID=599956155, not open)
 
RMAN> restore datafile 4 from service PRIM;
 
Starting restore at 18-OCT-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=705 device type=DISK
 
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: using network backup set from service PRIM
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to /archive/PRIM/PRIM/users01.dbf
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 18-OCT-16
4. START THE RECOVERY ( STANDBY)
1
2
SQL> recover managed standby database using current logfile disconnect from session;
Media recovery complete.
5. CANCEL RECOVERY AND START DATABASE.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
SQL> recover managed standby database cancel;
Media recovery complete.
SQL> shutdown immediate;
ORA-01109: database not open
 
 
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area 1.3935E+10 bytes
Fixed Size 6002112 bytes
Variable Size 4630514240 bytes
Database Buffers 9193914368 bytes
Redo Buffers 104153088 bytes
Database mounted.
Database opened.
6 . START THE RECOVERY AGAIN:
1
2
3
4
5
6
7
8
9
10
11
SQL> recover managed standby database using current logfile disconnect from session;
Media recovery complete.
Now all datafiles are online :
SQL> select file_name from dba_data_files;
 
FILE_NAME
--------------------------------------------------------------------------------
/archive/PRIM/PRIM/system01.dbf
/archive/PRIM/PRIM/sysaux01.dbf
/archive/PRIM/PRIM/undotbs01.dbf
/archive/PRIM/PRIM/users01.dbf

Hope it Helps!