1.
- run
-
{
-
SQL "alter database datafile 6 offline";
-
SET NEWNAME FOR DATAFILE '/u01/app/oracle/product/10.2.0/oradata/orcl/tb/test01.dbf' to '/u01/app/oracle/product/10.2.0/oradata/orcl/tb/test02.dbf';
-
restore tablespace test;
-
switch datafile all;
-
recover teblespace test;
-
SQL "alter database datafile 6 online";
-
}
2.
- run
-
{
-
SQL "ALTER TABLESPACE test OFFLINE IMMEDIATE";
-
SET NEWNAME FOR DATAFILE '/u01/app/oracle/product/10.2.0/oradata/orcl/tb/test01.dbf' to '/u01/app/oracle/product/10.2.0/oradata/orcl/tb/test02.dbf';
-
restore tablespace test;
-
switch datafile all;
-
recover teblespace test;
-
SQL "ALTER TABLESPACE test ONLINE";
-
}
3.
- run
-
{
-
SQL "ALTER TABLESPACE test OFFLINE IMMEDIATE";
-
SET NEWNAME FOR DATAFILE '/u01/app/oracle/product/10.2.0/oradata/orcl/test1.dbf' to '/u01/app/oracle/product/10.2.0/oradata/orcl/tb/test01.dbf';
-
restore datafile 6;
-
switch datafile 6;
-
recover datafile 6;
-
SQL "ALTER TABLESPACE test ONLINE";
-
}
之前有看过资料,但是测试的时候出了一身汗,前2个都不成功,只有第3个成功!
offline tablespace,restore/switch/recover datafile,online tablespace。
mark!
阅读(811) | 评论(0) | 转发(1) |