table shrink

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

table shrink

Arsalan

Sir

i can not shrink table, it give error so what will be cause ?

SQL>      alter table tt enable row movement;

Table altered.

SQL>      alter table tt shrink space cascade;
     alter table tt shrink space cascade
*
ERROR at line 1:
ORA-10663: Object has rowid based materialized views


SQL>      alter table tt disable row movement;

---------------------------------------------------------------
example -1

drop materialized view log on tt;
drop materialized view tt_mv;
drop table tt purge;
--------------------------------------------------

 create table tt (id number(23));

 create materialized view log on tt with rowid including new values;

 CREATE MATERIALIZED VIEW tt_mv
 REFRESH fast on demand
 WITH ROWID AS
 SELECT * FROM tt;

insert into tt values(1);
insert into tt values(1);
insert into tt values(1);
commit;

execute dbms_mview.refresh( list => 'tt_mv');


select count(*) from tt;
select count(*) from tt_mv;

     alter table tt enable row movement;
     alter table tt shrink space cascade;
     alter table tt disable row movement;
Reply | Threaded
Open this post in threaded view
|

Re: table shrink

ErmanArslansOracleBlog
Administrator
Check the following notes:

Ora-10663: Object Has Rowid Based Materialized Views (Doc ID 1291223.1)
Bug 14664641 - ALTER TABLE .. SHRINK SPACE against base table of join mview fails with ORA-10663 (Doc ID 14664641.8)