Wednesday, January 28, 2015

Mangaing Oracle Tablespace

select name from v$tablespace; select name from v$datafile; create tablespace mytbs datafile 'd:\oracle\mytbs01.dbf' size 100m; select ts#,name from v$tablespace; select ts#,name from v$datafile; alter tablespace mytbs add datafile 'd:\oracle\mytbs02.dbf' size 100m alter tablespace mytbs drop datafile 'd:\oradata\mytbs02.df'; desc dba_tabplespaces; select tablespace_name,status from dba_tablespaces; alter database datafile 'd:\oradata\mytbs01.dbf' resize 10m; desc v$datafile; select name,bytes/1024/1024 from v$datafile; alter tablespace mytbs read only; alter tablespace mytbs read write; alter tablespace mytbs force logging; alter tablespace mytbs nologging; alter tablespace mytbs rename to yourtbs; select name from v$tablespace; alter tablespace yourtbs rename to mytbs; drop tablespace mytbs including contents and datafiles;

No comments:

Post a Comment