dbms_compression.get_compression_ratio fails with ORA-01422

(Doc ID 1944907.1)

Last updated on JULY 06, 2017

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.

Symptoms

While running dbms_compression.get_compression_ratio you may get this error: ORA-01422

When you enable errorstack on ORA-01422,the below statement is seen as problematic one:

ORA-01422: exact fetch returns more than requested number of rows
----- Current SQL Statement for this session (sql_id=cc01vsm45maab) -----

SELECT OBJECT_ID FROM ALL_OBJECTS WHERE OWNER = :B2 AND OBJECT_NAME = :B1 AND SUBOBJECT_NAME IS NULL

If bind values are put in the above query, two objects with the same name can be seen as:

SQL> SELECT OBJECT_ID FROM ALL_OBJECTS WHERE OWNER = 'A'AND OBJECT_NAME = 'B' AND SUBOBJECT_NAME IS NULL;


OBJECT_ID
----------
16902
89791

 

SQL> SELECT object_name,OBJECT_ID,object_type FROM ALL_OBJECTS WHERE OWNER = 'A'AND OBJECT_NAME = 'B' AND SUBOBJECT_NAME IS NULL;

OBJECT_NAME OBJECT_ID OBJECT_TYPE
------------------------------ ---------- -------------------
PS_BU_ITEMS_CONFIG 16902 TABLE
PS_BU_ITEMS_CONFIG 89791 INDEX

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms