Ora 27040 file create error unable to create file

I tried to export one schema using datapump in Enterprose linux enviornment , It shows following error [oracle@localhost ~]$ expdp test/test directory=my_test dumpfile=my_test.dmp nologfile=y Expor…

by Mohamed Azar on April 27, 2010

I tried to export one schema using datapump in Enterprose linux enviornment , It shows following error

[oracle@localhost ~]$ expdp test/test directory=my_test dumpfile=my_test.dmp nologfile=y

Export: Release 10.2.0.1.0 – Production on Tuesday, 27 April, 2010 20:16:00

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
With the Partitioning, OLAP and Data Mining options
ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file “/tmp/backup/my_test.dmp”
ORA-27040: file create error, unable to create file
Linux Error: 13: Permission denied

The above error for that partticular directory is for root user. Its not permissable directory for Oracle.So we need to give permission to oracle for particular directory.

[root@localhost tmp]# ls -ld backup/
drwxr-xr-x 2 root root  4096 Apr 27 18:01 backup/

[root@localhost ~]# cd /tmp
[root@localhost tmp]# chown -R oracle:oinstall backup/
[root@localhost tmp]# ls -ld backup/
drwxr-xr-x 2 oracle oinstall 4096 Apr 27 18:24 backup/

Now you can take backup using datapump 🙂

[oracle@localhost ~]$ expdp test/test directory=my_test dumpfile=my_test.dmp nologfile=y

Export: Release 10.2.0.1.0 – Production on Tuesday, 27 April, 2010 20:18:14

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

Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
With the Partitioning, OLAP and Data Mining options
Starting “TEST”.”SYS_EXPORT_SCHEMA_01″:  test/******** directory=my_test dumpfile=my_test.dmp nologfile=y
Estimate in progress using BLOCKS method…
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 64 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
. . exported “TEST”.”T”                                  7.812 KB      14 rows
Master table “TEST”.”SYS_EXPORT_SCHEMA_01″ successfully loaded/unloaded
******************************************************************************
Dump file set for TEST.SYS_EXPORT_SCHEMA_01 is:
/tmp/backup/my_test.dmp
Job “TEST”.”SYS_EXPORT_SCHEMA_01″ successfully completed at 20:18:26

Always check out the original article at http://www.oraclequirks.com for latest comments, fixes and updates.

It’s not the first time i write about the stack of errors returned by data pump operations and ORA-31641 in particular, however the error messages may vary slightly with the operating system. For instance the following error stack is returned on XE running on top of Ubuntu, whereas the previously linked page refers to an error condition occurring on XE for Windows.

expdp user/pwd directory=EXPDIR dumpfile=dump.dp tables=emp,dept nologfile=Y

ORA-39001: invalid argument value
ORA-39000: bad dump file specification
ORA-31641: unable to create dump file "/home/flavio/documents/dump.dp"
ORA-27040: file create error, unable to create file
Linux Error: 13: Permission denied

The problem is caused by the missing privileges of user oracle on the directory pointed to by EXPDIR.
EXPDIR is pointing to /home/flavio/documents.

ls -ld /home/flavio/documents

drwxr-xr-x 4 flavio flavio 4096 2009-04-10 19:00 /home/flavio/documents/

As you see the directory belongs to user flavio, group flavio, moreover no write privileges are granted other than to the directory owner. Now, as Oracle processes are running under the user oracle, in order to be able to dump a file in this directory we have two possibilities:

  1. to change the other group permissions on the directory i.e. by executing chmod o+w documents.
  2. to add user oracle to group flavio and grant write permissions on documents to group flavio by executing sudo usermod -a -G flavio oracle; chmod g+w documents.

Note that option #1 will work instantly while option #2 requires a db restart. If you do not restart the db, you will still get the permission denied error. In either case, the db user must have READ and WRITE permissions on EXPDIR or hold CREATE ANY DIRECTORY privilege.

Whether the optimal solution is either of the two options above it really depends on the application security requirements.
In the end may be it’s better to create a public directory where everybody can dump files freely or create a shared directory EXPDIR where only oracle can create files and users belonging to a datapump group can read them. This approach avoids tampering with the existing permissions on user’s private folders and it doesn’t require a db restart.

Final notes: while looking for the Optimal Flexible Architecture document, i realized that dpdump is nowhere to be found in the installation documents through version 11gR1. This directory is created at time of installation and it is an OFA directory, no matter what the books say or don’t. Directory object DATA_PUMP_DIR, which is the default directory for data pump operations, indeed maps to dpdump.
If i remember correctly in 10gR2 the directory object is automatically created at installation time whilst in 10gR1 you need to create it manually.

See message translations for ORA-27040 and search additional resources.

ORA-19870, ORA-19504 and ORA-27040 Errors in RMAN | Oracle Database

ORA-19870 ORA-19504 ORA-27040 Oracle Errors

While creating DR Site from my 2 Node RAC Primary, I was trying to restore the controlfile from the standby controlfile backup file which I had created from Primary database via RMAN prompt using the below mentioned command,

RMAN> backup current controlfile for standby format ‘/backup/stdb_cntl_%U.bkp’;

But after running the restore command, I got the below mentioned error,

$ rman target /

Recovery Manager: Release 11.2.0.4.0 — Production on Fri Oct 13 06:43:27 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: IFSPROD (not mounted)

RMAN> restore standby controlfile from ‘/home/oracle/stdb_cntl_ldsgu14m_1_1.bkp’;

Starting restore at 13-OCT-17

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=1982 device type=DISK

channel ORA_DISK_1: restoring control file

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of restore command at 10/13/2017 06:45:44

ORA-19870: error while restoring backup piece /home/oracle/stdb_cntl_ldsgu14m_1_1.bkp

ORA-19504: failed to create file «/data/drtesterp/control01.ctl»

ORA-27040: file create error, unable to create file

IBM AIX RISC System/6000 Error: 2: No such file or directory

Additional information: 1

Resolution:

Again if you check the complete error description, you’ll see «IBM AIX RISC System/6000 Error: 2: No such file or directory» which simply indicated that the directory where I was trying to restore the controlfile was

1. Either not created

2. Was not acessible — Privilege|permissions Issue

I checked for the reason and it was found that the directory was not available where I was trying to perform the restore. I created the same and provided the proper permissions to Oracle User. Once done, the restore was easily completed.

I hope this helps !!

Error: «ORA-01119,» «ORA-27040,» or «OSD-04002» when adding a datafile to a tablespace

calendar_today

Updated On:

Products

Data Loss Prevention Enforce

Issue/Introduction

When addiing a datafile to an existing tablespace, the following errors appear:

  • ORA-01119: error in creating database file
  • ORA-27040: file create error, unable to create file
  • OSD-04002: unable to open file

ERROR at line 1:
ORA-01119: error in creating database file
'D:ORACLEORADATAPROTECTLOB2_8.DBF'
ORA-27040: file create error, unable to create file
OSD-04002: unable to open file
O/S-Error: (OS 3) The system cannot find the path specified

Resolution

  • Ensure that the directory path exists or that you have spelled it correctly.
  • Ensure that the Protect user in the Oracle database has full permissions to create, access, and modify in that tablespace.

See Verify that the Protect database user has the correct privileges.

Feedback

thumb_up
Yes

thumb_down
No

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Ora 01031 insufficient privileges ошибка
  • Oracle error ora 12571 encountered
  • Ora 20001 ошибка
  • Ora 01017 invalid username password logon denied как исправить
  • Ora 20001 an error was encountered an

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии