Oracle Database Management-Cold Backup Migration Frees Disk Space

The script code of cold backup migration to release disk space is as follows:

sqlplus / as sysdba
set lines 200
set pagesize 1000
set long 1000
select file#,name,bytes/1024/1024/1024 from v$datafile where name like ‘%/data/%’;

shutdown immediate;
startup nomount;
rman target /

backup as copy datafile 20 format ‘/data3/orcl00a1.dbf’;
backup as copy datafile 21 format ‘/data3/orcl00a2.dbf’;

switch datafile 20 to copy;
switch datafile 21 to copy;

list copy;
delete copy;

Guess you like

Origin blog.csdn.net/oradbm/article/details/108843670