问题
I can't execute following statement-
DECLARE
lo_req UTL_HTTP.req;
lo_resp UTL_HTTP.resp;
BEGIN
UTL_HTTP.SET_WALLET ('file: C:\app\wallet','abcd@1234');
lo_req := UTL_HTTP.begin_request('https://wordpress.org/');
lo_resp := UTL_HTTP.get_response(lo_req);
dbms_output.put_line(lo_resp.status_code);
UTL_HTTP.end_response(lo_resp);
END;
My wallet path is C:\app\wallet and password is abcd@1234.
When execute this code, display following error:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1130
ORA-28759: failure to open file
How can I solve that?
回答1:
The documentation for UTL_HTTP.SET_WALLET() has two things to say about the path:
- The format is like this on Windows
file:c:\WINNT\Profiles\username\WALLETS
- The wallet path must be accessible from the database server.
Clearly your code fails the first point, as you have a space between the file
keyword and the drive letter.
Perhaps the second point applies too: is that a drive on your database server?
回答2:
You need to add privileges for the appropriate user or group for your cwallet.sso and ewallet.p12 files.Privileges may not be present if you have used orakpi utility.
For Windows,
1.Select the file, right-click, and select Properties.
2.Select the Security tab and click Change Permissions.
3.Click Add > Locations, and select the appropriate location.
4.In the Select User or Group field, type ora_dba.Click the Check names button to verify that the ora_dba group exists.
5.Click OK and the Permission Entry dialog box displays.
6.Select the Allow check box next to Full Control and click OK.
7.In the Advanced Security dialog box click Apply.
8.Click OK to exit the dialogs.
来源:https://stackoverflow.com/questions/26697841/oracle-error-ora-28759-failure-to-open-file-when-requesting-utl-http-package