Tablespace-Datafile-Tables ??? [message #160749] |
Tue, 28 February 2006 04:26 |
Atul P
Messages: 61 Registered: June 2003 Location: Mumbai-Jakarta
|
Member |
|
|
HI
I am not at all into DBA activties.
HOwever While reading through some scripts while new database installation and user creation etc came through few doubts.
1. When we create a TABLESPACE we define
Datafile, Size, Sotorage etc Parameters
2. When we create a USER we specify to which Tablespace the user
would belong to.
3. NOw while creating a Table again the TABLESPACE and Sotrage
Parameters are defined.
Doubt is While USER creation TABLESPACE already defined for same.
When making Tables in that User why do we need to do it again
for Individual Tables.
IN what aspects does it help.
If I do not do it then by default would the table belong
to the tablespace defined for that User ??
If yes then is it advisable.
Thks
Atul p
|
|
|
|
Re: Tablespace-Datafile-Tables ??? [message #160784 is a reply to message #160749] |
Tue, 28 February 2006 06:21 |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
>why do we need to do it again
for Individual Tables.
-One possible situation where you may want to do it is- when you are creating partitioned table--these tables can have their data in multiple tablespaces and in that case you may want to override the default setting.
|
|
|
|
Re: Tablespace-Datafile-Tables ??? [message #160953 is a reply to message #160886] |
Wed, 01 March 2006 02:35 |
hellcat
Messages: 84 Registered: January 2006 Location: Zug, Switzerland
|
Member |
|
|
if DEFAULT TABLESPACE is defined for a user then the user does not have to specify this tablespace in the create table statement (it will be created in that one), only if the user wants to create the object in a different one. if no DEFAULT TABLESPACE is defined then oracle creates the objects in the SYSTEM tablespace.
|
|
|
Re: Tablespace-Datafile-Tables ??? [message #160980 is a reply to message #160953] |
Wed, 01 March 2006 04:27 |
orausern
Messages: 826 Registered: December 2005
|
Senior Member |
|
|
Yes , in majority of cases , you do not need to specify the storage clause. However regarding the pctfree and pctused parameters, please note that, sometimes it is BETTER TO specify-it depends.
The concept is that, whatever you have specified at the tablespace level will be applied to the tables that you create. But sometimes you may need to override this default behaviour. For e.g. the pctfree is set to 10 percent at the tablespace level. But you are creating a table, which is not going to have many updates and therefore , you want to specify pctfree of 5 for that table. So in such cases you may use the pctfree clause when you define the table.
So in majority of cases , it is fine not to specify the storage and pctfree parameters..but in some cases where you need to have a different settting for a perticular table, you need to specify.
|
|
|