Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: IO question
To select tablespace and data_file info you could use the following (logged
on as a dba, system , sys, internal) from sqlplus.
column tablespace_name format a20
column file_name format a50
select tablespace_name , file_name , round(bytes/1048576,2) "Size_MB"
from dba_data_files
order by tablespace_name
/
To find out where the indexes and tables are placed try:
column segment_type format a20
column tablespace_name format a20
Select owner , segment_type, tablespace_name, count(*) "Number" ,.
round(sum(bytes/1048576),2) "Size_MB"
from dba_segments
group by owner , segment_type, tablespace_name
order by owner , segment_type, tablespace_name
/
To create a new tablespace for the indexes use
create tablespace tablespace_name datafile 'full_file_path_and_file_name' size xxxxM, datafile 'full_file_path_and_file_name' size xxxxM,...
You won't need any down time for this but it would be advisable to do this at a quiet time.
Indexes can also be moved without a database outage using the below syntax (and in 8i+ you can force the move).
set heading off
set pagesize 0
set linesize 100
set feedback off
spool /tmp/move_indexes.sql
select 'ALTER INDEX '||owner||'.'||segment_name||chr(10)
||' STORAGE (INITIAL '||floor(bytes/1048576)+1||' NEXT ||'floor(bytes/10485760)+1||' PCTINCREASE 0 PCTFREE 5)'||chr(10)
||'REBUILD TABLESPACE index_tablespace;'
from dba_segments
where owner = upper('&owner')
and tablespace_name != 'index_tablespace'
and segment_type = 'INDEX'
/
spool off
Where index_tablespace_name is the tablespace you wish to move your indexes into.
Then just run the created file.
You can also move tables using an Alter table move ... syntax if they are in the wrong tablespace.
NO downtime should be required for any of these operations assuming you have the space for the new tablespace.
Hope this helps
Nathan
"Fergus" <sinhask_at_swbell.net> wrote in message
news:oIp28.8144$Lz3.3081275523_at_newssvr30.news.prodigy.com...
> see my 2c below
> >
>
>
>
>
>
>
>
>
> >> > by using scripts provided by the vendor...so I don't know much about how
> >The install of the database was done