Please advise. This SQLPlus call:
SQL > @dba_files_all
...is not working.
SP2-0310: unable to open file "dba_files_all.sql"
How can I resolve the error?
Please advise. This SQLPlus call:
SQL > @dba_files_all
...is not working.
SP2-0310: unable to open file "dba_files_all.sql"
How can I resolve the error?
You need to provide the path of the file as string.
Put the path in double quotes and it will work.
For example:
@"C:\Users\Arpan Saini\Zions R2\Reports Statements and Notices\Patch\08312017_Patch_16.2.3.17\DB Scripts\snsp.sql";
I encountered this error when attempting to execute a file in the same folder as the calling function. In my example, this process:
The issue in my situation was that the folder name in which it failed included a character (#
) that was valid for a Windows file name, but confusing to SQL Developer.
Note that
SQL> @some_file.sql
means that sql app you are using will look for that using "absolute path" so if you want to use "relative path" use following format [add ?]
SQL> @?some_file.sql
else, use "full path" with first command.
All the answers so far imply that absolute paths are required. That aren't. Relative paths in sql is pretty universal in sql tools. Sometimes, you have to configure a lost default configuration such as in the case of SQLDeveloper as explained in this answer: https://stackoverflow.com/a/24003529/442968
I just run into same error when I was trying to unlock oe schema. While reading the error, I realized that when I run the following line:
>SQL @?/demo/schema/order_entry/oe_main.sql
The error returned a completely different path
SP2-0310: unable to open file "C:/app/USER/product/18.0.0/dbhomeXE/demo/schema/order_entry/oe_main.sql"
Thus I copied my sql file to the path specified by the error and everything worked. I recommend that you do the same. Check the path in the error and adjust accordingly.
Use absolute path or run sqlplus command from a shell/dos that points to the path of the script. Also, to use a masterscript, refer to subscripts with @@.