In oracle, the type is TEMPORARY, and the name is file #. block # object reproduction and cleaning

Source: Internet
Author: User
Tags create index reserved oracle database sqlplus

You may notice in the use of the database that in some cases, some segment type is temporary, and the name is file#.block#. Here I reproduce the object by experimenting and give the cleanup method
Create a table space/user
sql> Create tablespace Test datafile
2 '/u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf '
3 size 128M autoextend on;

Tablespace created.

Sql> Create user CHF identified by Oracle;

User created.

Sql> Grant DBA to CHF;

Grant succeeded.
To create a mock object
This time through a number of column operations through a Index object to make it the temporary object we need
Sql> Conn Chf/oracle
Connected.
Sql> CREATE TABLE T_xifenfei tablespace test
2 AS SELECT * from Dba_objects;

Table created.

Sql> CREATE index Idx_t_xifenfei on T_xifenfei (object_id) tablespace test;

Index created.

Sql> Select Header_file,header_block from dba_segments
2 where segment_name= ' Idx_t_xifenfei ' and owner= ' CHF ';

Header_file Header_block
----------- ------------
5 267
Destroy Segment Header
This is reset to an empty block via DD, and Rman checks for bad blocks, proving that we handled the normal segment header of the index into an empty block.
Sql> select name from V$datafile where file#=5;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf

Sql> Conn/as SYSDBA
Connected.
sql> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

[Oracle@xffdbrh5 ~]$ DD If=/dev/zero
>of=/u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf
>bs=8192 count=1 seek=267 Conv=notrunc
1+0 Records in
1+0 Records out
8192 bytes (8.2 kB) copied, 0.000100548 seconds, 81.5 MB/s
[Oracle@xffdbrh5 ~]$ Sqlplus/as SYSDBA

Sql*plus:release 10.2.0.1.0-production on Mon Dec 21 16:30:56 2015

Copyright (c) 1982, +, Oracle. All rights reserved.

Connected to a idle instance.

Sql> Startup
ORACLE instance started.

Total System Global area 901775360 bytes
Fixed Size 2024944 bytes
Variable Size 138414608 bytes
Database buffers 759169024 bytes
Redo buffers 2166784 bytes
Database mounted.
Database opened.

[Oracle@xffdbrh5 ~]$ Rman Target/

Recovery manager:release 10.2.0.1.0-production on Mon Dec 21 16:33:00 2015

Copyright (c) 1982, +, Oracle. All rights reserved.

Connected to target database:ora10g (dbid=4205072872)

rman> Backup Validate check logical datafile 5;

Starting backup at 21-dec-15
Using target database control file instead of recovery catalog
Allocated Channel:ora_disk_1
Channel ora_disk_1:sid=144 Devtype=disk
Channel ora_disk_1:starting full datafile backupset
Channel ora_disk_1:specifying DataFile (s) in Backupset
Input datafile fno=00005 name=/u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf
Channel Ora_disk_1:backup set complete, elapsed time:00:00:01
Finished backup at 21-dec-15

Rman> exit


Recovery Manager complete.
[Oracle@xffdbrh5 ~]$ Sqlplus/as SYSDBA

Sql*plus:release 10.2.0.1.0-production on Mon Dec 21 16:33:50 2015

Copyright (c) 1982, +, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition release 10.2.0.1.0-64bit Production
With the partitioning, OLAP and Data Mining options

Sql> select * from V$database_block_corruption;

file# block# BLOCKS corruption_change# corruptio
---------- ---------- ---------- ------------------ ---------
5 267 1 0 All ZERO
Index Segment Header exception
Index exception, through rebuild reported ora-08103 error
sql> ALTER index CHF.IDX_T_XIFENFEI rebuild;
Alter INDEX CHF.IDX_T_XIFENFEI rebuild
*
ERROR at line 1:
Ora-08103:object no longer exists
Reproduce the Temporary object
By deleting index and then discovering our long-lost temporary type of object appears
sql> DROP Index Chf.idx_t_xifenfei;

Index dropped.

Sql> Col segment_name for A20
Sql> select Segment_name,segment_type from user_segments;

Segment_name Segment_type
-------------------- ------------------
T_xifenfei TABLE
5.267 Temporary
Clean up temporary objects
Sql> Conn/as SYSDBA
Connected.
sql> exec dbms_space_admin.segment_corrupt (' TEST ', 5,267);

Pl/sql procedure successfully completed.

sql> exec dbms_space_admin.segment_drop_corrupt (' TEST ', 5,267);

Pl/sql procedure successfully completed.

Sql> Select Segment_name,segment_type from dba_segments WHERE owner= ' CHF ';

Segment_name Segment_type
-------------------- ------------------
T_xifenfei TABLE
The experiment proves that when the header exception is segment and the object is deleted, an object of type temporary and file#.block# is found. We can handle this class of exception objects through the Dbms_space_admin package, Get them out of the database completely.

Contact: Mobile Phone (13429648788) QQ (107644445) QQ Advisory Cherish Division fly
Title: Http://www.xifenfei.com/2015/12/type for TemporaryName for File-block objects reproduce and clean. html

Related Article

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.