Solved

oracle unix command

Posted on 2011-09-16
6
469 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 78

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 78

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:tangchunfeng
ID: 36555831
same as

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
awk sed variable in file 3 98
best datatype for oracle table email creation 8 78
error in my cursor 5 50
What are the limitations of input parameters in oracle ? 5 67
Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

749 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