Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • fkwoindex.sql /* Find FK without Index */ Oracle
  • Index Range Scan Oracle
  • Find Stale DR Physical Standby Oracle
  • Add new columns in dataframe Python/PySpark
  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • fkwoind.sql fkwoindex.sql Oracle
  • SQL Server Vs Oracle Architecture difference SQL Server
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • Jai Shree Ram PHP/MYSQL/Wordpress
  • Oracle Connections expire_time and firewall Oracle
  • How To Limit The Access To The Database So That Only One User Per Schema Are Connected (One Concurrent User Per Schema) Oracle
  • Transfer SQL Profiles from One database to other database. Oracle
  • TNSNAMES entries details Oracle
  • Privileges Required to Create Procedures and Functions that uses objects from other schema. Oracle
  • How to start CRS manually 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

  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • how to find OS block size Oracle
  • Find Stale DR Physical Standby Oracle
  • Find nth max and min. Oracle
  • Mutating Table Error while using database trigger Oracle
  • good note for shared pool tunnig Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • How to Make Trace Files Created by Oracle Readable by All Users ? Oracle
  • Pending Distributed Transations Oracle
  • Check SQL Server edition SQL Server
  • CPU speed on solaris Linux/Unix
  • proc.sql Oracle
  • ORACLE_SID in sqlplus Oracle
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql Oracle
  • Sequence Resetting Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme