Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Dynamically generate sql for hot backup
Hi everybody,
I have this script
select 'alter tablespace ' || tablespace_name || ' begin backup; ' ,
'! cp ' || file_name || ' $ORA_HOT ', 'alter tablespace ' ||
tablespace_name || ' end backup
from dba_data_files
IT WILL PRODUCE THE FOLLOWING :
alter tablespace SYSTEM begin backup;
! cp /data1/oradata/eccp/system01.dbf $ORA_HOT
alter tablespace SYSTEM end backup;
alter tablespace RBS begin backup;
! cp /log1/eccp/rbs01.dbf $ORA_HOT
alter tablespace RBS end backup;
alter tablespace RBS begin backup;
! cp /log2/eccp/rbs02.dbf $ORA_HOT
alter tablespace RBS end backup;
alter tablespace USERS begin backup;
! cp /data1/oradata/eccp/users01.dbf $ORA_HOT
alter tablespace USERS end backup;
If you notice I have 2 datafiles for RBS tablespace.
Can anobody help my to achieve the following result:
alter tablespace RBS begin backup;
! cp /log1/eccp/rbs01.dbf $ORA_HOT
! cp /log2/eccp/rbs02.dbf $ORA_HOT
alter tablespace RBS end backup;
Dima Received on Mon Jan 22 2001 - 23:58:18 CST