eg.
We want to copy the Oracle Home from source
Create the Oracle Home location on target (lxhyd02):
mkdir -p /data/oracle/product/10.2.0/db_1
On the source (lxhyd01):
cd /u01/oracle/product/10.2.0/db_1
tar cf - * | ssh lxhyd02.learning.com '(cd /data/oracle/product/10.2.0/db_1/; tar xf - )'
Check if files are being untarred on target:
[oracle@lxhyd02 data]$ cd /data/oracle/product/10.2.0/db_1
[oracle@lxhyd02 db_1]$ ls -tlr
total 240
drwxr-x--- 3 oracle dba 4096 Oct 25 20:38 jre
drwxr-x--- 7 oracle dba 4096 Oct 25 20:38 javavm
drwxr-x--- 3 oracle dba 4096 Oct 25 20:38 has
drwxr-x--- 3 oracle dba 4096 Oct 25 20:38 diagnostics
drwxr-x--- 3 oracle dba 4096 Oct 25 20:38 demo
drwxr-x--- 6 oracle dba 4096 Oct 25 20:38 crs
drwxr-x--- 4 oracle dba 4096 Oct 25 20:38 clone
drwxr-x--- 7 oracle dba 4096 Oct 25 20:38 assistants
drwxr-x--- 4 oracle dba 4096 Oct 25 20:49 jdbc
.....
.....
Advantages:
1) Faster that the two folds approach
2) Does not require disk space to store the tar/gzip files on source and target. Here, the tar files are created on the fly and immediately untarred on the target.
Limitations:
1) Speed would depend on the network bandwidth.
excellent tip, thanks a lot.
ReplyDeleteI believe in Linux you can use -z flag to compress the tar file. like
tar czf - * | ssh lxhyd02.learning.com '(cd /data/oracle/product/10.2.0/db_1/; tar xzf - )'
-Siddhu
Yes Siddhu, you are right. That option can also be used to compress it. Thanks for expressing your views.
ReplyDelete-Ritesh