[Database fault description]
Today, I will introduce an error solution for the database. This error usually occurs after an abnormal power failure. The error content is "system01.dbf needs more recovery to maintain consistency". In this case, how should the database be repaired so that the database can be used normally? Today, I will give you a brief review of how to fix this error.
1. Check the database while backing up
2. Try to hang and repair the database
3. Parse the database file and verify the data
4. Export the database data
【Data Recovery Case】
A database of a certain company reported an error due to an abnormal power failure, and the database could not be opened and could not be used.
We first use the DBV command to check whether the database file is complete,
After inspection, it was found that the data block (Data) of the SYSAUX01.DBF file failed to detect 39 pages, the index page (Index) failed to detect 32 pages, and the data in other locations was normal. It can be seen that there are bad blocks in SYSAUX01.DBF.
Then we created a new os and tried to suspend the database to confirm the error.
We use the recover database command to use online logs for media recovery.
SQL> recover database;ORA-00283: ??????????ORA-01618: ?? BACKUP CONTROLFILE ????????
The control file of the database has been modified, and the control file needs to be used to restore the database
Due to the loss of the archive log, use the cancel parameter for incomplete recovery.
Execute the alter database open command again to open the database.
Query the instance status of the opened database, and the error "ora 00600" is reported. When querying other locations, some errors with the same content are also found.
Check the warning log, and track the file to check the internal error code;
part of the warning log is as follows:
ORA-00600: internal error code, arguments: , , , , , , , , , , , Non-fatal internal error happenned while SMON was doing logging scn->time mapping.
Try to use expdp/exp tool to export the database; but the export fails.
It can be seen from the above that the recovery of the database is no longer possible. The bottom layer is analyzed, the data file is parsed, and the user object is obtained. We wrote a tool to parse DBF for data acquisition and successfully acquired database data.
Create a database, create a user in the database, allocate a table space for the user, unlock the user and authorize. Then, the channel data is bridged, and the resolved user objects are migrated to the database.
Finally, use the toad for oracle tool to verify the data.
Use exp or expdp to export all objects under the zxfg user. In this example, use exp to export data. The command is as follows:
exp system/abc file=C:\test\dump\zxfg.dmp log=C:\test\dump\zxfg.log owner=zxfg
finally successfully exported the database file, and the database was restored successfully.