Move LOB to new tablespace but still visible in old... [message #321853] |
Wed, 21 May 2008 10:10  |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
Hello all,
I just finished moving some LOB columns from an old tablespace to a new one using the following command:
ALTER TABLE <schema_name.table_name> MOVE LOB(<column_name>) STORE AS (TABLESPACE <tablespace_name>);
They were successfully moved. HOWEVER, when I queried to check the dba_tab_columns view, I found that they were still listed in the old tablespace. Now why would this happen?
Thanks.
|
|
|
|
Re: Move LOB to new tablespace but still visible in old... [message #321858 is a reply to message #321854] |
Wed, 21 May 2008 10:31   |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
I did query the dba_tab_columns view and joined it with the dba_tables view. That is what you probably wanted to know. Well here are the commands:
ALTER TABLE CTMS.DOCUMENT MOVE LOB(BLOB_CONTENT) STORE AS (TABLESPACE CTMSLOB01);
Table altered.
select c.owner, c.table_name, c.column_name, c.data_type, t.tablespace_name
from dba_tab_columns c, dba_tables t
where c.data_type IN ('LOB','CLOB','BLOB')
and t.tablespace_name LIKE '%DAT%'
and c.table_name = t.table_name
and c.owner = t.owner;
OWNER TABLE_NAME COLUMN_NAME DATA_TYP TABLESPACE_NAME
------- ---------- ------------ --------- ---------------
CTMS DOCUMENT BLOB_CONTENT BLOB CTMSDAT01
|
|
|
|
|
|
Re: Move LOB to new tablespace but still visible in old... [message #321870 is a reply to message #321869] |
Wed, 21 May 2008 11:08   |
shaseeb
Messages: 113 Registered: April 2007 Location: Madison, WI
|
Senior Member |
|
|
Well, there is no segment_name column in dba_tablespaces. But I think this query might do the trick.
select l.segment_name, sum(bytes)
from dba_lobs l, dba_data_files d
where l.tablespace_name = d.tablespace_name
and l.owner = 'CTMS'
and l.tablespace_name = 'CTMSLOB01'
group by l.segment_name;
SEGMENT_NAME SUM(BYTES)
------------------------------ ----------
SYS_LOB0000055620C00005$$ 2147483648
SYS_LOB0000366688C00005$$ 2147483648
|
|
|
|
|