How Do I Do If Error Code ORA-01113 Is Displayed Because the Oracle Database Fails to be Connected
Question
How do I do if error code ORA-01113 is displayed because the Oracle database fails to be connected?
Symptom
After you log in to the database as the sysdba user and run the alter database open command, the message "ORA-01113: file * needs media recovery" is displayed. However, the database file exists.
> sqlplus / as sysdba
SQL>alter database open
ERROR at line 1:
ORA-01113: file * needs media recovery
ORA-01110: data file *: 'xxx.dbf'
Answer
- HA system
- Log in to the active server.
- Run the hares -state Netlsnr -sys $(hostname) command as the root user to check whether the command output is online. Ensure that the Netlsnr resource is online.
- Run the following commands to log in to the Oracle database:
# su - oracle > sqlplus commonuser/eSight database password as sysdba;
- After the login is successful, run the following commands to restore the data files:
SQL> recover database; SQL> exit
- Run the hares -offline Oracle -sys $(hostname) command as the root user to bring the Oracle resource offline, and then run the hares -online Oracle -sys $(hostname) command to bring the Oracle resource online.
- Single-node system
- Run the following commands to log in to the Oracle database:
# su - oracle > sqlplus / as sysdba;
- After the login is successful, run the following commands to restore the data files:
SQL> recover database;
- Run the following commands to restart the database:
SQL> shutdown immediate SQL> startup SQL> exit
- Run the following commands to log in to the Oracle database: