Uncompress and extract tar.Z file issue

Does anybody could help me on how to properly and untar files in with tar.Z extension.
Looks like files where tar with gtar utility and compressed on top of it. (O/S AIX)
I used following method to uncompress and extract actual file and some files worked but large files (> 10 G) give me trouble
Here is my example:
uncompress data1.dbf.tar.Z
##This creates data1.dbf tar file
tar -xvf data1.dbf.tar
This gives me following message
x data1.dbf, -2594003015419476674 bytes, -5066412139491164 tape blocks
and creates 0 byte data1.dbf file

One would assume
firstly: this is not an Oracle problem
secondly: gtar has a -x switch, and man gtar would tell you all about it
thirdly: maybe the filesystem you are untarring to doesn't allow files greater than 2G.
Who can tell?
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Extracting tar.bz2 files.

    How can i extract tar.bz2 files?. zip, jar, tar can be extracted within java. But how tar.bz2?.

    Some tars have built-in knowledge of the bz2 (bunzip) compression format.
    Tar ("tape archive") is to package several files in one archive or to extract them. The archive files can be called "*.tar".

  • Extract *.tar.gz file, error tar: 0511-164 There is a media read or write b

    when try to:
    $gzip -dc /dbdump/patch/oraInventory_BK.tar.gz | tar xf /tmp/t
    tar: 0511-164 There is a media read or write block size error.
    how to unzip/ extract tar sucussfully?
    AIX box
    thanks

    Preferably Unix questions are answered by consulting man pages or an Unix forum.
    Your questions is 100 percent of topic here. Kindly stop posting Unix questions here.
    Sybrand Bakker
    Senior Oracle DBA

  • Extract tar.gz file

    Hi,
    I have a file with extension tar.gz and i need to extract it. I tried with GZIPInputStream class of java.util.zip package but could not do it. Below is the code snippet for the same. Please suggest the way we can handle this problem in Java.
    String filename = "C:\\TarFile\\Test.20110519_123033_00001.tar.gz";
                   final int BUFFER_SIZE = 2048;
                   try {
                        BufferedOutputStream dest = null;
                        FileInputStream fis = new FileInputStream(filename);
                        GZIPInputStream zis = new GZIPInputStream(new BufferedInputStream(fis));
                        int len;
                        FileOutputStream fos = new FileOutputStream("C:\\TarFile\\Test.20110519_123033_00001.tar");
                        dest = new BufferedOutputStream(fos, BUFFER_SIZE);
                        byte data[] = new byte[BUFFER_SIZE];
                        while ((len = zis.read()) != -1) {
                             //int count;
              // write the files to the disk
              dest.write(data, 0, len );
         //dest.flush();
         dest.close();
              zis.close();
    }catch(Exception e) {
    Thanks.

    By words "could not do it" , it should be very much clear that - i could not extract the file tar.gz completely. That is what the actual problem is. I understand people should have commonsense to understand it.
    Of course we understand it. What we don't understand is what happened instead. Exception? Data corruption? Nothing? Computer exploded?
    You aren't going to get anywhere here or indeed in life by making rude remarks about common sense to people who are trying to help you. You provided one binary digit of information. You needed to provide more. Would you accept that as a bug report from a user? or would you ask for some details?

  • How do I bulk upload documents using PowerShell and extract metadata from file name?

    I have a requirement to upload a bunch of documents into a document library. Based on the content type, the rules of updating the metadata is different...the one giving me trouble is to extract the metadata from the file name. If I have a file name like
    "part1_part2_part3.pdf" how do I extract part1, part2, part3 and tag each document being uploaded into SharePoint, using PowerShell? I have searched and have not been able to find anything to get me started.
    Has anyone done this before? Or is there a blog I can take a look at? Thanks
     

    You will have to write a PS script encompassing this logic.
    Read files from the folder using
    Get-Item cmdlet
    Determine the content type based on the path or filename.
    Split the file name to extract the tag names.
    If the metadata fields in the content type is a managed metadata field, check whether the term exists and set it.
    Updating SharePoint Managed Metadata Columns
    with PowerShell
    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

  • Cfspreadsheet and reading the xlsx files issue

    I am trying to process large excel files (65,000 rows) into the DB.  So I try to use the new cfspreadsheet tag to read in the files by 5000 rows at a time and then process the query into the tables.  The process is working fine when reading the (pre 2003 format "xls" files) but not when reading the new "xlsx" type of files.  The server is running out of memory trying to read those files for some reason.  Is this a known bug in ColdFusion 9.0??  Has anyone experiansed similar issues?
    Thanks

    if it's a POI issue (not likely, admittedly), of CF's
    usage thereof.
    If you check the POI archives, you should see a LOT of memory issues with large xlsx files. Usually related to how the file is processed. IIRC the standard way of loading a spreadsheet ie new XSSFWorkbook(name) just reads the whole file into memory in one shot. So with all the bloated xml and parsing going on it is very prone to OOM errors.
    For big files, they actually recommend using the event api instead, because of its lower footprint. I used it a couple months ago for a side project and it made a huge difference!  I did some basic profiling and the standard method (usermodel) was definitely more prone to big spikes in memory and oom errors. In contrast, memory usage with event api was far lower and more stable.
    Reason for bringing this all of this up ...? Well depending on how CF actually reads/loads spreadsheets internally, maybe the problem is a little bit of both .. ?  Just my $0.02
    -Leigh
    Message was edited by: -==cfSearching==-

  • AirPrint and pdf password protected file issue

    Hello
    I'm facing issue while printing pdf password protected file via Airprint.
    From my iPhone /iPad I can print without any issue to my HP dj 2540 almost everything except pdf password protected file.
    The same pdf file (protected with password) can be printed without any issue form any PC/laptop.
    Do anyone have any idea on how to solve this issue, please?
    Thanks
    regards
    Michele

    It seems that everyone asking this question have links from Grand Canyon University which will soon have over a 100,000 online students that all use ebooks that open just fine in Adobe Acrobat on their PCs BUT NOT on the mobile versions of Adobe Acrobat. Whatever allows this on PCs needs to be added to the mobile version soon.  We rely on our etextbooks that can ONLY be opened on the PC version of Acrobat.  That is ridiculous.  I can't believe with all the posts regarding password protected ebooks on this forum....that it hasn't been resolved.  No one can give you a link because the ebooks are on a website that needs a password.  We can save the books to our harddrives/dropbox...  I could send you a copy, but thats it.  Surely someone at Adobe knows what the hell is going on and can test the problem out themselves?

  • How to FTP file and extract the zip file automatically?

    Hi,
    My app needs to FTP another site and also automatically unzip the transferred file over the internet by user clicking on one button. Any experts? thanks.

    How do you open a can of beans before you take it out of the pantry?
    However I suppose your question only sounded stupid like that, you didn't really mean it that way. One problem is that you didn't mention which way the transfer was going. I assume you are asking about getting a file and unzipping it? Many of the FTP clients described in the article that jmennen referred to allow you to get an InputStream that allows you to read bytes from the server. You would take this InputStream and wrap it in a ZipInputStream. That way you could unzip the file as you transfer it from the server, rather than having to use a temporary file between the two steps.
    But if you really meant that you wanted the unzipping to take place on the server before you did the download, no, you can't do that.

  • Extracting .tar files

    I have the com.ice.tar package from http://www.trustice.com/java/tar/ and I have the code shown below compiling just fine. However, I need to extract .tar files and this code will only extract tar.gz files. Does anyone know what I need to change to my code to get it to extract .tar files? Thanks,
    import com.ice.tar.*;
    import javax.activation.*;
    import java.io.*;
    import java.util.zip.GZIPInputStream;
    public class untarFiles
    public static void main(String args[]) {
    try {
    untar("c:/Files/AnyFile.tar.gz",new File("c:/Files/"));
    catch(Exception e) {
    e.printStackTrace();
    System.out.println(e.getMessage());
    private static void untar(String tarFileName, File dest) throws IOException {
    //assuming the file you pass in is not a dir
    dest.mkdir();
    //create tar input stream from a .tar.gz file
    TarInputStream tin = new TarInputStream( new GZIPInputStream
    ( new FileInputStream(new File(tarFileName))));
    //get the first entry in the archive
    TarEntry tarEntry = tin.getNextEntry();
    while (tarEntry != null){//create a file with the same name as the tarEntry
    File destPath = new File(dest.toString() + File.separatorChar + tarEntry.getName());
    if(tarEntry.isDirectory()){
    destPath.mkdir();
    } else {
    FileOutputStream fout = new FileOutputStream(destPath);
    tin.copyEntryContents(fout);
    fout.close();
    tarEntry = tin.getNextEntry();
    tin.close();
    }

    hey ppl, i have the same assignment of extracting tar.Z files using java.
    I have the same trustice.com library com.ice.tar
    I've used basically the same code given in the previous post.
    It is givin me the followin exception when i try using tar.Z files :
    com.ice.tar.InvalidHeaderException: bad header in block 0 record 0, header magic is not 'ustar' or unix-style zeros, it is '-50112-51-424592-71', or (dec) -50, 112, -51, -42, 45, 92, -71
         at com.ice.tar.TarInputStream.getNextEntry(Unknown Source)
         at filterdialog.readTar(filterdialog.java:101)
         at filterdialog$1.actionPerformed(filterdialog.java:80)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at javax.swing.JComponent.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)

  • Automatically decompress *.tar.gz files to *.tar within Windows 2008 R2 Enterprise?

    Is it possible to have any and all *.tar.gz files that are dumped to a certain folder automatically decompressed/unzipped to *.tar in order to be processed by an sFTP job?  Thanks for any help you may be able to provide.

    Hi Señor SIEM,
    If you want to unzip files in powershell, this needs the thrid-party unzip application to run the powershell script, for more detailed information, please refer to this thread:
    powersell How to Unzip a file and copy it to specific location with 7zip?
    I hope this helps.

  • Extract the zip files

    Hi,
    I want to upload and extract the zip files. However I am able
    to upload the zip file but not able to unzip it after uploading. Is
    it possible in coldfusion mx 7. I know its possible in coldfusion
    8, but I need solution in version 7. Please let me know if there is
    any free components or third-party API's.
    Thanks!

    as you know cf mx 7 does not have a built-in zip
    functionality.
    you will have to install a zip application (i.e. 7zip, which
    is free) on
    your server and use cfexecute to run it and unzip your file.
    if you are on a shared hosting you are pretty much out of
    luck - look if
    your server has a pre-installed php or other script to manage
    zip
    archives...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • How can I read the bootstrap files and extract the fragment-URLs and fragment-numbers in plain text?

    How can I read the bootstrap files of any HDS Live stream and extract the fragment-URLs and fragment-numbers in plain text?
    Could it be that it is some kind of compressed format in the bootstrap? Can I uncompress it wirh  f4fpackager.exe? Could not find any download for f4fpackager.exe. I would prefere less code to do so. Is there something in Java of JavaScript, that can extract the fragment-numbers?
    Thank you!

    Doesn't sound too hard to me. Your class User (the convention says to capitalize class names) will have an ArrayList or Vector in it to represent the queue, and a method to store a Packet object into the List. An array or ArrayList or Vector will hold the 10 user objects. You will find the right user object from packet.user_id and call the method.
    Please try to write some code yourself. You won't learn anything from having someone else write it for you. Look at sample code using ArrayList and Vector, there's plenty out there. Post in the forum again if your code turns out not to behave.

  • Extract All Embedded Files in All Folders and Save Each? Copy/Paste from PDF to Word?

    I have most of what I need here, but I’m missing 2 important pieces. 
    #1)  I want to copy/paste from all PDF files in a folder and paste the copied data into a single Word file. 
    It works fine if I have ONLY Word docs in my folder.  When I have PDF files and Word files, the contents of the Word files are copied in fine, but the contents of the PDF files seem to come in as Chinese, and there is no Chinese in
    the PDF, so I have no idea where that’s coming from.
    #2)  I want to extract all embedded files (in all my Word files) and save the extracted/opened file into the folder.  Some embedded files are PDFs and some are Excel files.
    Here the code that I’m working with now.
    Sub Foo()
    Dim i As Long
    Dim MyName As String, MyPath As String
    Application.ScreenUpdating = False
    Documents.Add
    MyPath = "C:\Users\001\Desktop\Test\" ' <= change this as necessary
    MyName = Dir$(MyPath & "*.*") ' not *.* if you just want doc files
    On Error Resume Next
    Do While MyName <> ""
    If InStr(MyName, "~") = 0 Then
    Selection.InsertFile _
    FileName:="""" & MyPath & MyName & """", _
    ConfirmConversions:=False, Link:=False, _
    Attachment:=False
    Dim Myshape As InlineShape
    Dim IndexCount As Integer
    IndexCount = 1
    For Each Myshape In ActiveDocument.InlineShapes
    If Myshape.AlternativeText = PDFname Then
    ActiveDocument.InlineShapes(IndexCount).OLEFormat.Activate
    End If
    IndexCount = IndexCount + 1
    Next
    Selection.InsertBreak Type:=wdPageBreak
    End If
    On Error Resume Next
    Debug.Print MyName
    MyName = Dir ' gets the next doc file in the directory
    Loop
    End Sub
    If this has to be done using 2 Macros, that’s fine. 
    If I can do it in 1, that’s great too.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Hi ryguy72,
    >>When I have PDF files and Word files, the contents of the Word files are copied in fine, but the contents of the PDF files seem to come in as Chinese, and there is no Chinese in the PDF, so I have no idea where that’s coming from.<<
    Based on the code, you were insert the file via the code Selection.InsertFile. I am trying to reproduce this issue however failed. I suggest that you insert the PDF file manually to see whether this issue relative to the specific file. You can insert PDF
    file via Insert->Text->Object->Text from file.
    If this issue also could reproduced manually, I would suggest that you reopen a new thread in forum to narrow down whether this issue relative to the specific PDF file or Word application.
    >> I want to extract all embedded files (in all my Word files) and save the extracted/opened file into the folder.  Some embedded files are PDFs and some are Excel files.<<
    We can save the embedded spreadsheet via Excel object model. Here is an example that check the whether the inlineshape is an embedded workbook and save it to the disk for you reference:
    If Application.ActiveDocument.InlineShapes(1).OLEFormat.ClassType = "Excel.Sheet.12" Then
    Application.ActiveDocument.InlineShapes(1).OLEFormat.DoVerb xlPrimary
    Application.ActiveDocument.InlineShapes(1).OLEFormat.Object.SaveAs "C:\workbook1.xlsx"
    Application.ActiveDocument.InlineShapes(1).OLEFormat.Object.Close
    End If
    And since the Word object model doesn't provide API to save the embedded PDF, I would suggest that you get more effective response from PDF support forum to see whether it supports automation. If yes, we can export the PDF as embedded spreadsheet like code
    absolve.
    Hope it is helpful.
    Regards & Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Jar File for uncompress *.tar.Z-File

    hello,
    i'm locking for a jar -file to uncompress *.tar.Z files but i cant't found souch a jar file.
    do you know where i can download a jar-file wich suppose to extract a *.Z-Archiv? You do you know how i can extract a *.tar.Z-Archiv?
    Torsten

    hello,
    i'm locking for a jar -file to uncompress *.tar.Z files but i cant't found souch a jar file.
    do you know where i can download a jar-file wich suppose to extract a *.Z-Archiv? You do you know how i can extract a *.tar.Z-Archiv?
    Torsten

  • Extract A tar.gz file

    Ok guys,
    I have a program that extracts the contents of a tar.gz file. Right now it does extract one of the files and then throws an error:
    com.ice.tar.InvalidHeaderException: bad header in block 9 record 10, header magi
    c is not 'ustar' or unix-style zeros, it is '1141115144674854', or (dec) 114, 11
    1, 51, 44, 67, 48, 54
            at com.ice.tar.TarInputStream.getNextEntry(Unknown Source)
            at Extract_TAR_GZ_FILE.untar(Extract_TAR_GZ_FILE.java:37)
            at Extract_TAR_GZ_FILE.run(Extract_TAR_GZ_FILE.java:55)
            at Extract_TAR_GZ_FILE.main(Extract_TAR_GZ_FILE.java:67)
    bad header in block 9 record 10, header magic is not 'ustar' or unix-style zeros
    , it is '1141115144674854', or (dec) 114, 111, 51, 44, 67, 48, 54 The class that extracts the files:
    import java.io.*;
    import com.ice.tar.*;
    import javax.activation.*;
    import java.util.zip.GZIPInputStream;
    public class Extract_TAR_GZ_FILE {
         public static InputStream getInputStream(String tarFileName) throws Exception{
          if(tarFileName.substring(tarFileName.lastIndexOf(".") + 1, tarFileName.lastIndexOf(".") + 3).equalsIgnoreCase("gz")){
             System.out.println("Creating an GZIPInputStream for the file");
             return new GZIPInputStream(new FileInputStream(new File(tarFileName)));
          }else{
             System.out.println("Creating an InputStream for the file");
             return new FileInputStream(new File(tarFileName));
         private static void untar(InputStream in, String untarDir) throws IOException {
           System.out.println("Reading TarInputStream... (using classes from http://www.trustice.com/java/tar/)");
          TarInputStream tin = new TarInputStream(in);
          TarEntry tarEntry = tin.getNextEntry();
          if(new File(untarDir).exists()){
               while (tarEntry != null){
                  File destPath = new File(untarDir + File.separatorChar + tarEntry.getName());
                  System.out.println("Processing " + destPath.getAbsoluteFile());
                  if(!tarEntry.isDirectory()){
                     FileOutputStream fout = new FileOutputStream(destPath);
                     tin.copyEntryContents(fout);
                     fout.close();
                  }else{
                     destPath.mkdir();
                  tarEntry = tin.getNextEntry();
               tin.close();
          }else{
             System.out.println("That destination directory doesn't exist! " + untarDir);
         private void run(){
              try {               
                   String strSourceFile = "G:/source/BROKERH_20080303_A2008_S0039.TAR.GZ";
                   String strDest = "G:/source/Extracted Files";
                   InputStream in = getInputStream(strSourceFile);
                   untar(in, strDest);          
              }catch(Exception e) {
                   e.printStackTrace();          
                   System.out.println(e.getMessage());
         public static void main(String[] strArgs) throws IOException{
              new Extract_TAR_GZ_FILE().run();
    }The file I tested with can be found here:
    http://www.yourfilehost.com/media.php?cat=other&file=BROKERH_20080303_A2008_S0039.TAR.GZ
    Any help? Thanks a bunch.

    I fixed the problem. It was the ftp transfer of files program which wasn't set to BINARY mode. I edited that program and then rerun the above class and boom.. It worked.
    Thank you guys for responses.Great! Glad you got it working.
    ~

Maybe you are looking for