This discussion is archived
1 2 3 Previous Next 31 Replies Latest reply: Sep 10, 2013 1:16 PM by Mark Pura RSS

Weird expdp error - Unable to lock file.

Actitud Newbie
Currently Being Moderated
Hello.

I've followed all the required steps in order to start using expdp on a database.

0 - Set the sid name using ". oraenv"
1 - create user dpuser identified by dpuser;
2 - create or replace directory datapump AS '/u02/expdp/dbname';
3 - grant exp_full_database,connect, resource to dpuser;
4 - grant read, write on directory datapump to dpuser;

This is the content of the directory.

/u02/expdp/dbname> ls -la
drwxrwxr-x 3 oracle dba 4096 Apr 22 14:14 .
drwxrwxr-x 6 oracle dba 4096 Apr 22 09:12 ..

It's empty.

Then, i've tried to run the expdp for the whole database from that directory.

expdp dpuser/dpuser full=y DIRECTORY=datapump DUMPFILE=datapump:test.dmp logfile=datapump:test.log;

This is the error I got.

Export: Release 10.2.0.4.0 - 64bit Production on Wednesday, 22 April, 2009 14:18:32
Copyright (c) 2003, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "/u02/expdp/dbname/test.dmp"
ORA-27086: unable to lock file - already in use
Linux-x86_64 Error: 13: Permission denied
Additional information: 9
Additional information: 13

And finally, this is the directory again.

/u02/expdp/dbname> ls -la
drwxrwxr-x 3 oracle dba 4096 Apr 22 14:16 .
drwxrwxr-x 6 oracle dba 4096 Apr 22 09:12 ..
-rw-rw---- 1 oracle dba 4096 Apr 22 14:16 test.dmp
-rw-rw-r-- 1 oracle dba 592 Apr 22 14:16 test.log

ARGGGGGGGHHHHH!!!!.

Who is using the file? There wasn't any file there and I've just created the files (test.dmp and test.log)

Oracle should be more descriptive with the error messages :P

Thanks for any help you can provide me.
Alex.

Edited by: Actitud on Apr 22, 2009 5:36 PM
  • 1. Re: Weird expdp error - Unable to lock file.
    Dean Gagne Expert
    Currently Being Moderated
    Hi,

    This looks strange to me. You create your directory as:

    2 - create or replace directory datapump AS '/u02/expdp/dbname';

    and expdp prints out the error that it is trying to write here:

    ORA-31641: unable to create dump file "/project/AS_DB_exports/hydrogen/asuadev1/test.dmp"

    I always specify my dumpfile as;

    dumpfile=test.dmp

    I think your syntax is correct, but can you try removing the directory: from the dumpfile name.

    Dean
  • 2. Re: Weird expdp error - Unable to lock file.
    Actitud Newbie
    Currently Being Moderated
    Jeje. Rigth.

    Actually this is the error...

    ORA-31641: unable to create dump file "/u02/expdp/dbname/test.dmp"

    Forgot to change that path :D

    Thanks for noticed.
    Alex.
  • 3. Re: Weird expdp error - Unable to lock file.
    Actitud Newbie
    Currently Being Moderated
    BTW, I tried to remove the path from the dumpfile parameter today, and it didn't worked.

    Thanks.
    Alex.
  • 4. Re: Weird expdp error - Unable to lock file.
    695939 Newbie
    Currently Being Moderated
    Are you, by chance, running in a RAC environment?

    John
  • 5. Re: Weird expdp error - Unable to lock file.
    Actitud Newbie
    Currently Being Moderated
    Nop. No RAC.

    HP Linux, ASM and nothing else.

    Thanks.
    Alex.
  • 6. Re: Weird expdp error - Unable to lock file.
    OrionNet Guru
    Currently Being Moderated
    hello,

    can you try followign post its output. I take user have full priv to export full database.
    expdp dpuser/dpuser full=y DIRECTORY=DATAPUMP DUMPFILE=test.dmp logfile=test.log
    Regards
  • 7. Re: Weird expdp error - Unable to lock file.
    Actitud Newbie
    Currently Being Moderated
    Same issue.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORA-39001: invalid argument value
    ORA-39000: bad dump file specification
    ORA-31641: unable to create dump file "/u02/expdp/dbname/test.dmp"
    ORA-27086: unable to lock file - already in use
    Linux-x86_64 Error: 13: Permission denied
    Additional information: 9
    Additional information: 13

    Thanks.
    Alex.
  • 8. Re: Weird expdp error - Unable to lock file.
    OrionNet Guru
    Currently Being Moderated
    Alex,

    Seem you have to delete test.dmp from the directory or change the dumpfile and try again.
    delete this dumpfile test.dmp from  the directory "/u02/expdp/dbname"
    
    rm /u02/expdp/dbname/test.dmp
    Regards

    Edited by: OrionNet on Apr 22, 2009 5:18 PM
  • 9. Re: Weird expdp error - Unable to lock file.
    Actitud Newbie
    Currently Being Moderated
    OrionNet .

    I've tried that as well with no success. The directory is empty.

    Thanks.
    Alex.
  • 10. Re: Weird expdp error - Unable to lock file.
    OrionNet Guru
    Currently Being Moderated
    Alex,

    You can create file in this directory and no issue with OS user privs. Are you logged in as Oracle OS user or some other user? Also can you give following privs to this directory to user
    Grant read, write on directory DATAPUMP to dpuser; -- I know you already did but can you confirm in the views you have those privs in place or not.
    Regards

    Edited by: OrionNet on Apr 22, 2009 6:15 PM
  • 11. Re: Weird expdp error - Unable to lock file.
    Actitud Newbie
    Currently Being Moderated
    Hello.
    Yes. I ran it before and now again.

    SQL> Grant read, write on directory DATAPUMP to dpuser;

    Grant succeeded.

    SQL> select GRANTEE,TABLE_NAME,PRIVILEGE from user_tab_privs where table_name = 'DATAPUMP';

    GRANTEE TABLE_NAME PRIVILEGE
    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    DPUSER DATAPUMP READ
    DPUSER DATAPUMP WRITE


    Then, I tried the expdp command with the same issue.

    hydrogen@/u02/expdp/dbname> ls -lta
    drwxrwxrwx 3 oracle dba 4096 Apr 23 07:39 .
    drwxrwxr-x 6 oracle dba 4096 Apr 22 09:12 ..
    hydrogen@/u02/expdp/dbname> expdp dpuser/dpuser full=y DIRECTORY=DATAPUMP DUMPFILE=test.dmp logfile=test.log

    Export: Release 10.2.0.4.0 - 64bit Production on Thursday, 23 April, 2009 7:42:48

    Copyright (c) 2003, 2007, Oracle. All rights reserved.

    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    ORA-39001: invalid argument value
    ORA-39000: bad dump file specification
    ORA-31641: unable to create dump file "/u02/expdp/dbname/test.dmp"
    ORA-27086: unable to lock file - already in use *<<< WHAT IS THIS???!!! The file wasn't there so nobody was using it.*
    Linux-x86_64 Error: 13: Permission denied
    Additional information: 9
    Additional information: 13


    hydrogen@/u02/expdp/dbname> ls -la
    drwxrwxrwx 3 oracle dba 4096 Apr 23 07:40 .
    drwxrwxr-x 6 oracle dba 4096 Apr 22 09:12 ..
    -rw-rw---- 1 oracle dba 4096 Apr 23 07:40 test.dmp They are here so, I'm able to write.
    -rw-rw-r-- 1 oracle dba 590 Apr 23 07:40 test.log


    Thanks.
    Alex.
  • 12. Re: Weird expdp error - Unable to lock file.
    OrionNet Guru
    Currently Being Moderated
    Alex,

    Must be issue wth permssions. can you try just export a table and not full=Y, see if you run into similar issue
    expdp username/**** DIRECTORY=DATAPUMP tables=mytable dumpfile=mytable.dmp log=mytable.log
    Regards
  • 13. Re: Weird expdp error - Unable to lock file.
    695939 Newbie
    Currently Being Moderated
    Is the "/u02/expdp/dbname" directory you're using in any way used by any ASM disk groups on your system?

    Can you retry the export using a directory object for another disk/directory that is accessible to the oracle server but is not being using by ASM disk groups?

    John
  • 14. Re: Weird expdp error - Unable to lock file.
    26741 Oracle ACE
    Currently Being Moderated
    DIRECTORY=datapump DUMPFILE=datapump:test.dmp
    If you specify DIRECTORY on the command-line, don't repeat it in the DUMPFILE name.

    So, specify
    DIRECTORY=datapump DUMPFILE=test.dmp 
1 2 3 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points