Wednesday, July 02, 2008

ORA-22929: invalid or missing directory name and ORA-06564: object Xyz does not exist

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

You can see this error when executing a command like:

ALTER TABLE IMP_BAD_BOXES
DEFAULT DIRECTORY 'IMPORT_DIR';

ORA-22929: invalid or missing directory name
The problem is in the single quotes surrounding the directory object name.
The same error is also returned when using a CREATE TABLE statement.

The correct syntax requires either double quotes for case sensitive names or no quotes at all for case insensitive names.
ALTER TABLE IMP_BAD_BOXES
DEFAULT DIRECTORY "Import_Dir";
or
ALTER TABLE IMP_BAD_BOXES
DEFAULT DIRECTORY import_dir;
The last statement is equivalent to :

ALTER TABLE IMP_BAD_BOXES
DEFAULT DIRECTORY "IMPORT_DIR";
Note that when using case sensitive names, if you mistype the name you'll get:
ORA-06564: object Import_Dir does not exist

See message translations for ORA-22929, ORA-06564 and search additional resources.

2 comments:

  1. I got this error message when trying to create a directory. Obviously makes no sense: of course the directory doesn't exist, because I'm trying to make it.

    The issue was that the name I was providing for the file was 2016_06. It doesn't seem to be happy with names that start with numbers. As soon as I changed it to DP_2016_06, it took it without complaint.

    ReplyDelete
  2. Thanks. You're correct about the directory not beginning with numbers. Misleading error message.

    ReplyDelete

I appreciate your comment however bear in mind that I might not have the time to reply soon.
Normally I do not reply to all comments but I am glad if you found something useful or if you learned something new, in that case I strongly encourage you to promote the article with the +1 google button.
Flavio