select 'alter tablespace ' || tablespace_name || ' begin backup;' || chr(13) || chr(10) || 'host cp ''' || file_name || '''' || chr(13) || chr(10) || '''/home/oracle/' || substr(file_name,instr(file_name,'/',-1)+1) || '''' || chr(13) || chr(10) || 'alter tablespace ' || tablespace_name || ' end backup;' from dba_DATA_files
'ALTERTABLESPACE'||TABLESPACE_NAME||'BEGINBACKUP;'||CHR(13)||CHR(10)||'HOSTCP''' -------------------------------------------------------------------------------- alter tablespace USERS begin backup; host cp '/u01/app/oracle/oradata/sztech1/users01.dbf' '/home/oracle/users01.dbf' alter tablespace USERS end backup;
alter tablespace UNDOTBS1 begin backup; host cp '/u01/app/oracle/oradata/sztech1/undotbs01.dbf' '/home/oracle/undotbs01.dbf' alter tablespace UNDOTBS1 end backup;
alter tablespace SYSAUX begin backup; host cp '/u01/app/oracle/oradata/sztech1/sysaux01.dbf' '/home/oracle/sysaux01.dbf' alter tablespace SYSAUX end backup;
alter tablespace SYSTEM begin backup; host cp '/u01/app/oracle/oradata/sztech1/system01.dbf' '/home/oracle/system01.dbf' alter tablespace SYSTEM end backup;
alter tablespace EXAMPLE begin backup; host cp '/u01/app/oracle/oradata/sztech1/example01.dbf' '/home/oracle/example01.dbf' alter tablespace EXAMPLE end backup;
SQL>
|