Solved

oracle unix command

Posted on 2011-09-16
6
466 Views
Last Modified: 2012-05-12
what does this command do?

tar -cf - asm | (cd /u01/app/oracle/product/11.1/;tar -xf - )
0
Comment
Question by:it-rex
  • 3
  • 2
6 Comments
 
LVL 77

Accepted Solution

by:
arnold earned 500 total points
ID: 36551584
tar -cf - asm creates an archive from data in asm and pipes it to standard output
tar -f - means the results will be output via standard output
 -c create
| () means treat the items in perenthesis as a single command.
cd means change to the directory
-xf - means extract the data from a file in this case the -f - means from the standard input stream.

The end result is that the data in asm is copied as is into /u01/app/oracle/product/11.1/asm

man tar
0
 
LVL 11

Author Comment

by:it-rex
ID: 36554023
If I need more info about |() what is it called?
0
 
LVL 77

Expert Comment

by:arnold
ID: 36554537
what do you mean.
| pipe means pass the data to the next application.
in the case of () this means that the data is being passed to the group which as your example shows it runs commands prior to the application that actually gets the data.
i.e. items in parenthesis are treated as a group.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Expert Comment

by:tangchunfeng
ID: 36555831
same as

cp -R asm /u01/app/oracle/product/11.1/
0
 
LVL 77

Expert Comment

by:arnold
ID: 36556591
To slightly correct tangchunfeng, the cp will reflect the ownership of the copied files as those of the user running the copy while the tar | tar mechanism will maintain the original ownership/permissions.
i.e. tar | tar process is a mirror copy.
0
 
LVL 11

Author Closing Comment

by:it-rex
ID: 36559723
Great thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Determine Who is Runnig my Bash Shell Script 4 80
Queries 15 38
migration MS SQL database to Oracle 30 61
Oracle dataguard 5 31
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  â€¦
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question