问题
I created a directory using SQLPlus console but I cant find it on file system. Here is the command I used:
SQL> create directory secfile as ’/opt/oracle’;
Directory created.
I have looked in my Oracle home directory(C:\Program Files (x86)\Oracle
) but there is no 'images' folder.
Where should I look for it?
I'm using Oracle 11g Data Base(installed on my C drive) and I need this directory to store pictures which I will be further storing in the data base. I was following a tutorial about storing pictures on OracleDB in which ’/opt/oracle’ patch were used for that directory.
回答1:
You have things the wrong way around. You need to create a directory in the operating system, and then create an Oracle directory object using the full path to the operating system directory. The Oracle create directory
command only creates a data dictionary object, it does not itself do anything on your server's file system. And you can't use a relative path.
Well, you can create them in either order, but the operating system directory has to have been created by the time you try to use the Oracle one, so to me it makes more sense to create that first.
回答2:
The CREATE DIRECTORY
command does not create a directory on your server's disc. It creates a directory object in your Oracle database which serves as a "pointer" (if you will) to a directory on your disc, and until some code running in your database (for example, some PL/SQL code) tries to use the directory object the database will not know or care if the directory actually exists on the disc. YOU have to create the disc directory, using either Windows Explorer or the Windows command line.
Best of luck.
来源:https://stackoverflow.com/questions/26557278/cant-find-directory-created-by-using-sqlplus-console