Oracle:alter tablespace add datafile xxxx
2014-01-13 16:51
SQL> col "TBS Name" for a8
SQL> run
1* select file_name,bytes/1024/1024 "MB",tablespace_name "TBS Name",status from dba_data_files
FILE_NAME MB TABLESPACE_NAME STATUS
---------------------------------------- ---------- ------------------------------ ---------
/u01/app/oradata/wuxian/users01.dbf 10 USERS AVAILABLE
/u01/app/oradata/wuxian/undotbs01.dbf 110 UNDOTBS1 AVAILABLE
/u01/app/oradata/wuxian/sysaux01.dbf 590 SYSAUX AVAILABLE
/u01/app/oradata/wuxian/system01.dbf 720 SYSTEM AVAILABLE
/u01/app/oradata/wuxian/example01.dbf 345.625 EXAMPLE AVAILABLE
/u01/app/oradata/wuxian/users02.dbf 10 USERS AVAILABLE
6 rows selected
SQL> alter tablespace users add datafile '/u01/app/oradata/wuxian/users02.dbf' size 30M;
Tablespace altered.
SQL> select file_name,bytes/1024/1024 "MB",tablespace_name "TBS Name",status from dba_data_files;
FILE_NAME MB TABLESPACE_NAME STATUS
---------------------------------------- ---------- ------------------------------ ---------
/u01/app/oradata/wuxian/users01.dbf 10 USERS AVAILABLE
/u01/app/oradata/wuxian/undotbs01.dbf 110 UNDOTBS1 AVAILABLE
/u01/app/oradata/wuxian/sysaux01.dbf 590 SYSAUX AVAILABLE
/u01/app/oradata/wuxian/system01.dbf 720 SYSTEM AVAILABLE
/u01/app/oradata/wuxian/example01.dbf 345.625 EXAMPLE AVAILABLE
/u01/app/oradata/wuxian/users02.dbf 30 USERS AVAILABLE
6 rows selected
SQL>