Simulate and repair data block corruption in Oracle

Source: Internet
Author: User

In Oracle databases, we may experience a lot of data corruption and how it is important to recover data in the face of these situations. In many cases, recovery is extremely complex and requires careful, reckless operations and attempts that can result in permanent corruption of the database.
So I recommend that you make a data backup before you try to recover.

For important databases, it is advisable to consult a professional to avoid unnecessary data loss if the recovery steps and operational consequences are not determined.

This paper attempts to simulate and solve the problem of data block damage, and it is a kind of database damage recovery discussion

1. Inserting data

E:\oracle\ora92\bin>sqlplus "/As SYSDBA"
Sql*plus:release 9.2.0.4.0-production on Monday March 8 20:27:15 2004
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connect to:
Oracle9i Enterprise Edition Release 9.2.0.4.0-production
With the partitioning, OLAP and Oracle Data Mining options
Jserver Release 9.2.0.4.0-production
Sql> select name from V$datafile;
NAME
--------------------------------------------------------------------------------
E:\ORACLE\ORADATA\EYGLE\SYSTEM01. Dbf
E:\ORACLE\ORADATA\EYGLE\UNDOTBS01. Dbf
E:\ORACLE\ORADATA\EYGLE\EYGLE01. Dbf
Sql> Create tablespace block
2 datafile ' e:\oracle\oradata\eygle\block.dbf '
3 Size 1M
4 extent management Local;
The table space has been created.
sql> alter user eygle default tablespace block;
The user has changed.
sql> ALTER user Eygle Quota unlimited on block;
The user has changed.
Sql> Connect Eygle/eygle
is connected.
Sql> CREATE TABLE T as select * from Dba_users;
Table has been created.
sql> INSERT INTO T-select * from T;
8 lines have been created.
Sql>/
16 lines have been created.
Sql>/
32 lines have been created.
Sql>/
64 lines have been created.
Sql>/
128 lines have been created.
Sql>/
256 lines have been created.
Sql>/
512 lines have been created.
Sql>/
1024 lines have been created.
Sql>/
2048 lines have been created.
Sql>/
4096 lines have been created.
Sql>/
INSERT INTO t select * from t
*
ERROR is on line 1th:
ORA-01653: Table eygle.t cannot be extended through 8 (in table space block)
Sql> commit;
Submit completed.
Sql> alter system checkpoint;
The system has changed.
Sql> Select COUNT (*) from T;
COUNT (*)
----------
8192
Sql> Connect/as SYSDBA
is connected.
sql> shutdown Immediate
The database has been closed.
The database has been unloaded.
The ORACLE routine has been closed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.