Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Vivek’s egrep commands to trace problem. (on linux x86-64) Linux/Unix
  • Shuffle an array PHP/MYSQL/Wordpress
  • sbind.sql Find Bind variable from sql_id sqlid Oracle
  • sid_wise_sql.sql Further explaination Oracle
  • PHP code to add WordPress posts in bulk programmatically PHP/MYSQL/Wordpress
  • Nice Article about semaphores and init.ora Processes parameter relations Linux/Unix
  • good note for shared pool tunnig Oracle
  • Explain Plan Output 2 Oracle
  • To see mem usage and CPU usage system wide. Linux/Unix
  • RAC with RHEL4 and 11g Oracle
  • ENQ: KO – FAST OBJECT CHECKPOINT tips Oracle
  • Recovering lost SYS password Oracle
  • How to analyze statspack or AWR report. Oracle
  • Is It Recommended To Apply Patch Bundles When PSU Is Available? -ID 743554.1 Oracle
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle

ORA-8031 issue and solution if it is occuring due to truncate.

Posted on 07-Apr-2008 By Admin No Comments on ORA-8031 issue and solution if it is occuring due to truncate.

After doing further research on Oracle errors from metalink, I found following for ORA-8031.

CAUSE:

The data_object_id (seg/obj) stored in the block is different than the

data_object_id stored in the segment header.

EXPLAINATION:

The expected behavior can be that tables are being truncated while a query from

those tables is still in execution. Look if data_object_id is changing for the involved objects while queries are

being executed.

data_object_id is commonly changed by:

truncate table

alter index .. rebuild

alter table .. move

etc.

I manually checked for data_object_id for TRUN.ATS_CTI_EXT_CHECK and found that after each truncate the DATA_OBJECT_ID of this object is changed. So queries that are running at the time of truncate will receive this error.

Solution:

1. Stop the queries while truncate is going on for same table.

2. If above is not possible or difficult to implement, then replace “truncate” with “delete from”. This will result in segment fragmentation. At night time when no one is running query against this table, also plan to truncate it so its data structure will not be fragmented.

Metalink Reference: Note:268302.1

Oracle, SQL scripts

Post navigation

Previous Post: fdisk -l explaination about Primary-Logical-Extended Partitions
Next Post: good linux notes

Related Posts

  • Mutating Table Error while using database trigger Oracle
  • Roles and Stored Procs II Oracle
  • Committing distributed transaction using commit force Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • SQL Tracker by SID sqltrackerbysid.sql Oracle
  • Database link password in user_db_links Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • oracle 10g on linux Linux/Unix
  • handling filenname with space Linux/Unix
  • Wait.sql Oracle
  • TOP-N Sql to find Nth max or Top N rows Oracle
  • RMAN : Consistent Backup, Restore and Recovery using RMAN Oracle
  • PLSQL Table Syntax 1 Oracle
  • before_trunc.sql Before Truncate table needs to execute following: Oracle
  • move_arch_files.ksh Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme