Skip to Main Content
  • Questions
  • changing default tablespace of LOB in a partitioned table

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, palanisamy.

Asked: March 12, 2018 - 9:58 am UTC

Last updated: September 30, 2022 - 4:20 am UTC

Version: 11g

Viewed 10K+ times! This question is

You Asked

Hi,

I want to move a Partitioned table having LOB to a different tablespace,

I have moved all data,indexes and partitions, and set the default tablespace for table and indexes
every thing is moved/changed except for the default tablespace of the LOB,
i was not able to find the proper command, can you please help with this?

and Connor said...

SQL> create table t (pk number primary key, x clob)
  2  lob (x ) store as ( tablespace largets )
  3      partition by range (pk)
  4      interval (1)
  5      (partition p1 values less than (2)
  6      );

Table created.

SQL>
SQL> insert into t values (1,rpad('x',32000,'x'));

1 row created.

SQL> insert into t values (2,rpad('x',32000,'x'));

1 row created.

SQL> insert into t values (3,rpad('x',32000,'x'));

1 row created.

SQL>
SQL> select table_name, partition_name, tablespace_name
  2  from user_lob_partitions
  3  order by partition_position;

TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME
------------------------------ ------------------------------ ------------------------
T                              P1                             LARGETS
T                              SYS_P16751                     LARGETS
T                              SYS_P16754                     LARGETS

3 rows selected.

SQL>
SQL> alter table t modify default attributes lob (x ) ( tablespace users );

Table altered.

SQL>
SQL> insert into t values (4,rpad('x',32000,'x'));

1 row created.

SQL>
SQL> select table_name, partition_name, tablespace_name
  2  from user_lob_partitions
  3  order by partition_position;

TABLE_NAME                     PARTITION_NAME                 TABLESPACE_NAME
------------------------------ ------------------------------ ------------------------
T                              P1                             LARGETS
T                              SYS_P16751                     LARGETS
T                              SYS_P16754                     LARGETS
T                              SYS_P16757                     USERS

4 rows selected.

SQL>
SQL>
SQL>
SQL>


Rating

  (2 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Default Tablespace Change For Non-Partitioned Table

Serhat, September 29, 2022 - 8:18 am UTC

Thank you for clear explaination.

Would you show how to change default tablespace of LOB in a non-partitioned table, also?
Connor McDonald
September 30, 2022 - 4:20 am UTC

SQL> create table t (pk number primary key, x clob)
  2      lob (x ) store as ( tablespace largets )
  3  /

Table created.

Non-partitioned LOB columns

Ayhan Orbay, September 29, 2022 - 8:19 am UTC

Hi,

Can we change the default tablespace of non-partitioned lob columns?

Thanks.
Connor McDonald
September 30, 2022 - 4:20 am UTC

SQL> create table t (pk number primary key, x clob)
  2      lob (x ) store as ( tablespace largets )
  3  /

Table created.

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database