datafile相关(add、rename、drop)

时间:2023-03-09 19:04:53
datafile相关(add、rename、drop)

--case 1 add
14:25:04 FPYJ(150_9)@test> alter tablespace fpyj_data02 add datafile '/oradata02/test/test/fpuj_data011.dbf' size 10m autoextend on;

Tablespace altered.

--case 2 rename
14:26:51 SYS(150_11)@test> alter tablespace fpyj_data02 offline;

Tablespace altered.

[oracle@Oracle11g test]$ pwd
/oradata02/test/test

[oracle@Oracle11g test]$ cp fpuj_data011.dbf fpuj_data0111.dbf

14:28:28 SYS(150_11)@test> alter tablespace fpyj_data02 rename datafile '/oradata02/test/test/fpuj_data011.dbf' to '/oradata02/test/test/fpuj_data0111.dbf';

Tablespace altered.

Elapsed: 00:00:00.04
14:29:23 SYS(150_11)@test> alter tablespace fpyj_data02 online;

Tablespace altered.

--case 3 drop
14:29:47 SYS(150_11)@test> alter tablespace fpyj_data02 drop datafile '/oradata02/test/test/fpuj_data0111.dbf';

Tablespace altered.