maxsatula / ocp

Oracle Copy utility
GNU General Public License v2.0
13 stars 2 forks source link

Oracle directory is case sensitive #33

Closed jonheller1 closed 9 years ago

jonheller1 commented 9 years ago

The Oracle directory parameter must be in upper case or else the error "Failed to open an Oracle remote file for reading" is returned. It would be helpful if the parameter was case-insensitive, since the Oracle objects are case insensitive. Perhaps this only needs an UPPER(...) in a query.

maxsatula commented 9 years ago

There are multiple options to solve the issue.

  1. Always convert a directory argument to uppercase as suggested in the issue description, a sort of WHERE UPPER(:argument) = directory_name clause. Problem: if someone creates a lowercase directory in the database using quotation marks (for instance, CREATE DIRECTORY "lowercase_pump_dir" AS ...), there will be no way to reference it from ocp.
  2. Do case insensitive search of a directory in oracle, i.e. use something like WHERE UPPER(:argument) = UPPER(directory_name) AND rownum = 1. Problem: there is an ambiguity if multiple directories exist such as my_dir, My_DiR, and MY_DIR. And there would be no way to specify which one is actually needed.
  3. Do an Oracle SQL way: if a directory specified in quotation marks (for example, ocp /@mydb "my_dir":myfile.dmp myfile.dmp), then use as is, otherwise treat it as uppercase. This makes command line syntax a little bit more complicated, but it should cover all cases.
  4. Do not "fix" anything. Force end user to specify directory names with an appropriate case.
  5. Search case-sensitive first. If failed, then do case-insensitive.
maxsatula commented 9 years ago

Option 5 looks the most attractive.