Hi ,
I will tell about copying our backup files from an ASM environment to another. Suppose there are two different server which are named TALIP1 and TALIP2. There is an ASM instance on these servers and we want to copy backup files located in ASM Diskgroup from TALIP1 to TALIP2. The steps will be as follows.
1- Logon to TALIP1 as oracle user and set following environment vaiables for ASM.
export ORACLE_HOME=/oracle/grid12c
export ORACLE_SID=+ASM
2- Create an oracle directory object on ASM directory containing our backup files.
sqlplus / as sysdba
SQL> create directory TALIP1 as ‘+RECO/talipdb/backupset/19_11_2021’;
3- Logon to TALIP2 as oracle user and set following environment vaiables for ASM.
export ORACLE_HOME=/oracle/grid12c
export ORACLE_SID=+ASM
4- Create a directory called 19_11_2021 under +RECO/talipdb/backupset
ASMCMD> cd +RECO/talipdb/backupset
ASMCMD mkdir 19_11_2021
5- Create an oracle directory object on ASM directory where we want to copy our backup files.
sqlplus / as sysdba
SQL> create directory TALIP2 as ‘+RECO/talipdb/backupset/19_11_2021’;
6- Logon to TALIP1 as oracle user and set following environment vaiables for ASM.
export ORACLE_HOME=/oracle/grid12c
export ORACLE_SID=+ASM
7- Create a database link to access from TALIP1 to TALIP2.
sqlplus / as sysdba
SQL> create database link TALIP2link connect to system identified by oracle using ‘TALIP2’;
8- Copy backup files one by one from TALIP1 to TALIP2.
SQL> exec dbms_file_transfer.put_file(‘TALIP1′,’users.260.778251563′,’TALIP2′,’users.260.778251563′,’TALIP2link’);
The usage of dbms_file_transfer.put_file procedure as follows.
dbms_file_transfer.put_file( SOURCE_DIRECTORY_OBJECT, SOURCE_FILE_NAME, DESTINATION_DIRECTORY_OBJECT, DESTINATION_FILE_NAME, DESTINATION_DATABASE )
Talip