change in table space [message #64635] |
Wed, 16 February 2005 21:47 |
annu
Messages: 34 Registered: February 2002
|
Member |
|
|
i have a one user which store data in system table space area. now i would like to change this table space and want to store data in users table space area.My question is how can i change table space and data store in system area to users area and is it possiable that system area is resize again as its appropariate size along with data already store in it.
For that one already suggested me that i have to recreate user again and set there table spaces and recreate tables again in this table space area.
Is there any other solution.
i m using oracle 9i
and my table spaces are like follwing details.
system 495mb used 417.629
users 25mb used 4.563
temp 490mb used 489
any suggestions are appriciable..
regards
|
|
|
|
|
|
Re: change in table space [message #109285 is a reply to message #64635] |
Wed, 23 February 2005 09:09 |
dbalaji_oracle
Messages: 4 Registered: February 2005
|
Junior Member |
|
|
Hi ,
i have a one user which store data in system table space area.
sol:
SQL> select username,default_tablespace from dba_users
where default_tablespace ='SYSTEM' and username not like 'SYS%' ;
the above will tell u wgo are the users using system table space.
-----------------------
now i would like to change this table space and want to store data in users table space area.
SQL> alter user <username> default tablespace users ;
------------------------
My question is how can i change table space and data store in system area to users area and is it possiable that system area is resize again as its appropariate size along with data already store in it.
SQL>select table_name from dba_tables where owner='usename' and tablespace_name like 'SYS' ;
now u ll get a list of tables already created in system table space and u can move them to users tablespace .
SQL> alter table <tablename> move tablespace users ;
like wise if u find indexes them move them too .
SQL>select index_name,table_name from dba_indexeswhere tablespace_name like 'SYS%' and table_owner like 'username' ;
now u can rebuild indexes in the index table space
SQL> alter index <indexname> rebuild tablespace INDX;
HOE THIS WORKS .
with regards
DBAlaji
btw it is better to restrict a user from writing system table space like this
SQL> alter user <username> quota 0 on system ;
|
|
|