小布老师Oracle 9i DBA Fundamentals I 视频讲座 29

create tablespace user_data
datafile '/home/oracle/oradata/orcl10g/userdata01.dbf' size 200m
autoextend on next 10m maxsize 500m;
select file_name,tablespace_name,autoextensible from dba_data_files;
alter database  datafile '/home/oracle/oradata/orcl10g/wenchuan1.dbf' autoextend on next 10m maxsize 100m;

alter tablespace wenchuan add datafile '/home/oracle/oradata/orcl10g/wenchuan2.dbf' size 20m autoextend on next 10m maxsize 100m;

 

select a.tablespace_name, a.bytes bytes_userd, b.largest, round(((a.bytes-b.bytes)/a.bytes)*100,2) percent_userd from ( select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a, ( select tablespace_name, sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name ) b where a.tablespace_name = b.tablespace_name order by ((a.bytes-b.bytes)/a.bytes) DESC;

~

你可能感兴趣的:(小布老师Oracle 9i DBA Fundamentals I 视频讲座 29)