Home » RDBMS Server » Server Administration » clarification...!
clarification...! [message #126794] Wed, 06 July 2005 12:31 Go to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
hai all,

i have a scenario.i woukd like to create a table with integer,varchar and lob columns in the schema whose default tablespace is DATA.since the table has the lob column, what about the storage of that column..?will it be stored on the same DATA tablespace or in LOB tablespace..?is there any data dictionary available to get the tablespace_name of the columns of a table...?plz help out.

bala
Re: clarification...! [message #126796 is a reply to message #126794] Wed, 06 July 2005 12:38 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Your results may vary based on oracle version and default behavior. I am on 10.1.0.4 on winxp. But these are all questions you can answer easily on your own system by running a test and by checking the sql documentation.

MYDBA@ORCL > desc user_lobs;
 Name                                               Null?    Type
 -------------------------------------------------- -------- ----------------------------------

 TABLE_NAME                                                  VARCHAR2(30)
 COLUMN_NAME                                                 VARCHAR2(4000)
 SEGMENT_NAME                                                VARCHAR2(30)
 TABLESPACE_NAME                                             VARCHAR2(30)
 INDEX_NAME                                                  VARCHAR2(30)
 CHUNK                                                       NUMBER
 PCTVERSION                                                  NUMBER
 RETENTION                                                   NUMBER
 FREEPOOLS                                                   NUMBER
 CACHE                                                       VARCHAR2(10)
 LOGGING                                                     VARCHAR2(7)
 IN_ROW                                                      VARCHAR2(3)
 FORMAT                                                      VARCHAR2(15)
 PARTITIONED                                                 VARCHAR2(3)

MYDBA@ORCL > create table test(a number, b clob);

Table created.

MYDBA@ORCL > select table_name, tablespace_name from user_lobs;

TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
TEST                           USERS

1 row selected.

MYDBA@ORCL > select table_name, tablespace_name from user_tables where table_name = 'TEST';

TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
TEST                           USERS

1 row selected.

Re: clarification...! [message #126815 is a reply to message #126796] Wed, 06 July 2005 15:30 Go to previous messageGo to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
thanks a lot martin..!

in this case mentioned , what about the clob field ..?is it in users tablespace or in lob tablespace..?can u find it in ur machine as we are in 9.2.0.4.0 under linux...?

Re: clarification...! [message #126941 is a reply to message #126794] Thu, 07 July 2005 08:06 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
It is in the example above, look in user_lobs:

MYDBA@ORCL > create table test(a number, i_am_a_clob clob);

Table created.

MYDBA@ORCL > col column_name format a30
MYDBA@ORCL >  select table_name, column_name, tablespace_name from user_lobs;

TABLE_NAME                     COLUMN_NAME                    TABLESPACE_NAME
------------------------------ ------------------------------ ----------------------
TEST                           I_AM_A_CLOB                    USERS

1 row selected.

MYDBA@ORCL > drop table test;

Table dropped.

Re: clarification...! [message #126952 is a reply to message #126941] Thu, 07 July 2005 08:49 Go to previous messageGo to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
thanks a lot martin,

but why don't the clob field I_AM_A_CLOB get stored in the LOB tablespace instead USERS tablespace..?then what will be stored in LOB tablespace..?

Re: clarification...! [message #126966 is a reply to message #126794] Thu, 07 July 2005 10:10 Go to previous messageGo to next message
somnath1974
Messages: 15
Registered: July 2005
Junior Member
Hi,
You can store the LOB in another tablespace based on how you define your table. Please see below:



SQL> CREATE TABLE TEST
2 (NAME VARCHAR2(30),
3 CV CLOB)
4 TABLESPACE USER_DATA01
5 LOB(CV) STORE AS CV_LOB
6 (TABLESPACE MY_SAMPLE);

Table created.

Creates the table in USER_DATA01 TS but the LOB Is created on another TS MY_SAMPLE.

Regards,
Somnath
Re: clarification...! [message #126968 is a reply to message #126966] Thu, 07 July 2005 10:15 Go to previous messageGo to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
ok thanks a lot..! i got it..!

but , by default the lob field will be stored in which tablespace..?is it the tablespace that schema belongs to..?

shall we store the lob records in data tablespace and vice versa..?
Re: clarification...! [message #126969 is a reply to message #126968] Thu, 07 July 2005 10:36 Go to previous messageGo to next message
somnath1974
Messages: 15
Registered: July 2005
Junior Member
Hi,
If you do not explicitly declare the LOB object then it will store it in the default tablespace of the schema which is going to won the table.

I would feel that it is better to store LOB objects in a separate Tablespace.

Regards,
Somnath
Re: clarification...! [message #126977 is a reply to message #126969] Thu, 07 July 2005 11:22 Go to previous messageGo to next message
balavignesh
Messages: 180
Registered: March 2005
Senior Member
thanks a lot somnath..!

i got cleared...!
icon14.gif  Re: clarification...! [message #129134 is a reply to message #126977] Fri, 22 July 2005 02:04 Go to previous message
sunil_v_mishra
Messages: 506
Registered: March 2005
Senior Member
hi,

Thanks to all for having such a nice discussion on this issue.

from :- Sunilkumar
Previous Topic: tablespace parameter
Next Topic: unable to start oracle using w2k and 8i (OS Err 997)
Goto Forum:
  


Current Time: Fri Jan 10 08:12:28 CST 2025