Skip to main content

ORA-23515: Materialized Views and/or Their Indices Exist in the Tablespace

 

ORA-23515: Materialized Views and/or Their Indices Exist in the Tablespace


While dropping any Tablespace, you might get the errror 

ORA-23515: Materialized Views and/or Their Indices Exist in the Tablespace

This is due to the fact that the tablespace contains the indexes or Materialized views

You may use the following queries to find out which materialized views and/or which indeces of materialized view container tables are on the tablespace you intend to drop.

Once these objects are found you can move the tables, rebuild indeces in other tablespace.

 select s.sowner MV_OWNER, s.tname MV_NAME, p.name TABLESPACE
  from sys.obj$ o, sys.tab$ t, sys.user$ u, sys.snap$ s , sys.ts$ p
  where t.ts#=p.ts# and p.name='<tablespace_name>'
  and t.obj#=o.obj# and o.owner#=u.user# and u.name=s.sowner and o.name=s.tname
  order by 1,2;

select o.owner, o.object_name index_name, o.object_type, sq.mv_owner,sq.mv_name,sq.tablespace
  from dba_objects o,
  (select i.obj#,s.sowner MV_OWNER, s.tname MV_NAME, p.name TABLESPACE
  from sys.obj$ o, sys.tab$ t, sys.ind$ i, sys.user$ u, sys.snap$ s,sys.ts$ p where i.ts#=p.ts# and p.name='<tablespace_name>'
  and i.bo#=t.obj# and t.obj#=o.obj# and o.owner#=u.user# and u.name=s.sowner and o.name=s.tname ) sq
  where sq.obj#=o.object_id
  order by 1,2,3;

 

An example output listing mviews and their owner where the container table of the mview is on the tablespace <tablespace_name>
 

SQL>  select s.sowner MV_OWNER, s.tname MV_NAME, p.name TABLESPACE
  2    from sys.obj$ o, sys.tab$ t, sys.user$ u, sys.snap$ s , sys.ts$ p
  3    where t.ts#=p.ts# and p.name='<tablespace_name>'
  4    and t.obj#=o.obj# and o.owner#=u.user# and u.name=s.sowner and o.name=s.tname
  5    order by 1,2;

MV_OWNER                       MV_NAME                        TABLESPACE
------------------------------ ------------------------------ ------------------------------
<user_name>                    TEST_MV                        <tablespace_name>
<user_name>                    CUST_MV                        <tablespace_name>

An example output listing indeces of mviews container tables, where the index is on tablespace <tablespace_name>

SQL> select o.owner, o.object_name index_name, o.object_type, sq.mv_owner,sq.mv_name,sq.tablespace
  2    from dba_objects o,
  3    (select i.obj#,s.sowner MV_OWNER, s.tname MV_NAME, p.name TABLESPACE
  4    from sys.obj$ o, sys.tab$ t, sys.ind$ i, sys.user$ u, sys.snap$ s,sys.ts$ p where i.ts#=p.ts# and p.name='<tablespace_name>'
  5    and i.bo#=t.obj# and t.obj#=o.obj# and o.owner#=u.user# and u.name=s.sowner and o.name=s.tname ) sq
  6    where sq.obj#=o.object_id
  7    order by 1,2,3;

OWNER      INDEX_NAME                     OBJECT_TYPE         MV_OWNER                       MV_NAME                         TABLESPACE
---------- ------------------------------ ------------------- ------------------------------ ------------------------------ ------------------------------
<user_name>  I_SNAP$_TEST_MV                INDEX              <user_name>                             TEST_MV                        <tablespace_name>
<user_name>  I_SNAP$_CUST_MV                INDEX              <user_name>                             CUST_MV                        <tablespace_name>

YOU MAY DELETE THE OBJECTS or MOVE Them to other tablespaces and then try the delete Tablespace command

Comments

Popular posts from this blog

12.1.0 Grid Installation on Solaris 11.3 fails with ASM failed to start

Issue Description  We faced one issue, while installing the GI 12.1.0.1.0 on Solaris 11.3  ASM failed to start. Check /u01/app/grid/cfgtoollogs/asmca/asmca-201202PM061908.log for details. 2020/12/02 18:19:17 CLSRSC-184: Configuration of ASM failed 2020/12/02 18:19:17 CLSRSC-258: Failed to configure and start ASM Died at /u01/app/12.1.0/grid_1/crs/install/crsinstall.pm line 1976. The command '/u01/app/12.1.0/grid_1/perl/bin/perl -I/u01/app/12.1.0/grid_1/perl/lib -I/u01/app/12.1.0/grid_1/crs/install /u01/app/12.1.0/grid_1/crs/install/rootcrs.pl ' execution failed This error is coming during root.sh execution on primary node. After checking the asmca logs, the error seen is as below: ========================== [main] [ 2020-12-02 17:00:49.575 AST ] [UsmcaLogger.logException:156] SEVERE:method oracle.sysman.assistants.usmca.backend.USMInstance:configureLocalASM [main] [ 2020-12-02 17:00:49.575 AST ] [UsmcaLogger.logException:157] ORA-27122: unable to protect memory [main] [ 2020-1...

Health Check Script

Oracle Database Health Check Script Run this script has sysdba user or any user having DBA Role Change the spool file patch to correct directory. In this example it is set to  /export/home/oraprod/ $ cat Health_Check_Script.sql set pagesize 1100 SET MARKUP HTML ON SPOOL ON spool /export/home/oraprod/health_check_new.html set feedback off set linesize 200; set pages 50 set lines 1000 set pages 70 set heading on PROMPT================================================================ prompt PROMPT PROMPT Daily_Monitoring Checkup Report prompt ================================================================================================================================================= PROMPT REPORT DATE select to_char(sysdate,'DD-MON-YYYY:HH:MI:SS') "Report Run Date" from dual; prompt DATABASE NAME PROMPT ============== select instance_name,host_name,version,status from gv$instance ,v$database a; PROMPT DATABASE INFO PROMPT =============...

12.2 Stage area creation fails with startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java: No such file or directory

 12.2 Stage area creation fails with startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java: No such file or directory While creating the stage area for 12.2 Installation, we face issue while running the buildstage.sh ....startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java: No such file or directory Solution:  Please go to the path provided in the error log and check if the java is working fine with below command: java -version Generally this java is having some issues.   Install the jre 7 or jre 8 and copy the the jre at the same path by renaming old folder. It should work fine.  Now if your run the build command again, it should succeed.  Running command: /u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jre/Linux_x64/1.6.0/bin/java -classpath /u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jlib/emocmutl.jar:/u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jlib/ewt-3_4_22.jar:/u01/soft/ebs/startCD/Disk1/rapidwiz/bin/../jlib/share-1_1_18.jar:/u01/soft/ebs/star...