Wednesday, October 12, 2016

Repairing standby database with datafile creation errors


Some new directories were created on the primary side and new datafiles were added in these directories.
Because creating same directories on the standby server was forgotten, file creations were failed on standby... Dataguard stopped with error :

ORA-01111: name for data file 195 is unknown - rename to correct file
ORA-01110: data file 195: '/oracle/app/oracle/product/10.2.0/dbs/UNNAMED00195'
ORA-01157: cannot identify/lock data file 195 - see DBWR trace file

In order to start dataguard;

Firstly create the missing directory(ies) on the standby machine; then on the standby database:

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER SYSTEM SET standby_file_management='MANUAL' SCOPE=BOTH;
ALTER DATABASE CREATE DATAFILE '$ORACLE_HOME/dbs/UNNAMED00195' as 'correct_path/datafile.dbf';
ALTER SYSTEM SET standby_file_management='AUTO' SCOPE=BOTH;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

No comments:

Post a Comment

How To Fix Hive – Partition Table Query Failed When Stored As Parquet

This article is about the bug in Hive filtering option, when the partition table query stored as parquet. Big data developers will help y...