Qual sistema operacional ???
Windows ou Linux ???
Se for Windows, é simples, use o OCOPY da própria Oracle que funciona muito bem…
Se for Linux, eu uso este script :
set pages 0
set lines 1000
Spool backup.txt
Select comando
From (
Select '00' ordem, tablespace_name, 'Alter tablespace ' || tablespace_name || ' begin backup;' comando
From dba_tablespaces
Where contents = 'PERMANENT'
Union
Select '02' ordem, tablespace_name, 'Alter tablespace ' || tablespace_name || ' end backup;' comando
From dba_tablespaces
Where contents = 'PERMANENT'
Union
Select '01' ordem, a.tablespace_name, '!scp ' || file_name || ' ://bkp/' comando
From dba_data_files a,
dba_tablespaces b
Where a.tablespace_name = b.tablespace_name
and b.contents = 'PERMANENT'
Union
Select '04' ordem, a.tablespace_name, '!scp ' || file_name || ' ://bkp/' comando
From dba_data_files a,
dba_tablespaces b
Where a.tablespace_name = b.tablespace_name
and b.contents 'PERMANENT'
Union
Select '10' ordem, 'zzz' tablespace_name, '!scp ' || name || ' ://bkp/' comando
From v$controlfile
Union
Select '11' ordem, 'zzz' tablespace_name, '!scp ' || member || ' ://bkp/' comando
From v$logfile
Union
Select '12' ordem, 'zzz' tablespace_name, '!scp ' || name || ' ://bkp/' comando
From v$tempfile
Union
Select '80' ordem, 'zzz' tablespace_name, 'Archive Log Current;' comando From dual
Union
Select '91' ordem, 'zzz' tablespace_name, 'Alter System Switch Logfile;' comando From dual
Union
Select '99' ordem, 'zzz' tablespace_name, 'Exit;' comando From dual
)
Order by tablespace_name, ordem
;
Spool execucao.txt
@backup.txt
Spool off
set pages 50