In oracle, obj $. obj # and obj $. dataobj # are implemented through update _ NEXT_OBJECT.

Source: Internet
Author: User
Tags commit oracle database

In some special circumstances (such as ORA-00600 [15267], ORA-00600 [KKDLCOB-OBJN-EXISTS], Ora-600 [15260]), consider the need to move the object_id in dba_objects forward, this function is implemented through the test method.
Database version information
SQL> select * from v $ version;
 
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0-Prod
PL/SQL Release 10.2.0.4.0-Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0-Production
NLSRTL Version 10.2.0.4.0-Production
Analysis of obj and dataobj
SQL> select max (obj #), max (dataobj #) from obj $;
 
MAX (OBJ #) MAX (DATAOBJ #)
-----------------------
51887 51907
 
SQL> select name from obj $ where obj #= 51887;
 
NAME
------------------------------
T_DUL
 
SQL> select name from obj $ where dataobj #= 51907;
 
NAME
------------------------------
_ NEXT_OBJECT
 
SQL> select object_id, data_object_id from dba_objects where object_name = '_ NEXT_OBJECT ';
 
No rows selected
Why is no _ NEXT_OBJECT in dba_objects?
Because the _ NEXT_OBJECT record is skipped in the dba_objects view
_ Next_object


Test the change of obj and dataobj after creating a new table.
SQL> create table t_xff as select * from dual;
 
Table created.
 
SQL> select max (obj #), max (dataobj #) from obj $;
 
MAX (OBJ #) MAX (DATAOBJ #)
-----------------------
51898 51907
 
SQL> select name from obj $ where obj #= 51898;
 
NAME
------------------------------
T_XFF
 
SQL> select max (object_id), max (data_object_id) from dba_objects where object_name ='t _ XFF ';
 
MAX (OBJECT_ID) MAX (DATA_OBJECT_ID)
---------------------------------
51898 51898
Test shows that obj is increased, but dataobj is not necessarily increased (because dataobj itself is larger than obj, if obj> dataobj appears, it is an exception)

Test whether obj and dataobj will be skipped when the database is restarted.
--- Restart the database normally
SQL> SHUTDOWN IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP
ORACLE instance started.
 
Total System Global Area 260046848 bytes
Fixed Size 1266920 bytes
Variable Size 83888920 bytes
Database Buffers 171966464 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> select max (obj #), max (dataobj #) from obj $;
 
MAX (OBJ #) MAX (DATAOBJ #)
-----------------------
51898 51907
 
--- Force restart the database
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area 260046848 bytes
Fixed Size 1266920 bytes
Variable Size 83888920 bytes
Database Buffers 171966464 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> select max (obj #), max (dataobj #) from obj $;
 
MAX (OBJ #) MAX (DATAOBJ #)
-----------------------
51898 51907
This proves that obj and dataobj have not changed due to database restart.

Achieve obj checkpoint
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup restrict
ORACLE instance started.
 
Total System Global Area 260046848 bytes
Fixed Size 1266920 bytes
Variable Size 83888920 bytes
Database Buffers 171966464 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> update obj $ set dataobj # = 1000000 where name = '_ NEXT_OBJECT ';
 
1 row updated.
 
SQL> commit;
 
Commit complete.
 
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area 260046848 bytes
Fixed Size 1266920 bytes
Variable Size 83888920 bytes
Database Buffers 171966464 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
 
SQL> select max (obj #), max (dataobj #) from obj $;
 
MAX (OBJ #) MAX (DATAOBJ #)
-----------------------
51898 1000000
 
SQL> create table t_www_xifenfei_com as select * from dual;
 
Table created.
 
SQL> select max (obj #), max (dataobj #) from obj $;
 
MAX (OBJ #) MAX (DATAOBJ #)
-----------------------
1000000 1000010
 
SQL> select max (object_id), max (data_object_id) from dba_objects;
 
MAX (OBJECT_ID) MAX (DATA_OBJECT_ID)
---------------------------------
1000000 1000000
 
SQL> select object_name from dba_objects where object_id = 1000000;
 
OBJECT_NAME
----------------------------------------------------------------
T_WWW_XIFENFEI_COM
Update _ NEXT_OBJECT to realize the obj and dataobj hops (changed to 100 w)

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.