Friday, August 07, 2009

ORA-31050: Access denied

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

After discovering two undocumented procedures in package DBMS_XDB in Oracle XE (10gR2), i was eager to try out a configuration of a secondary listening endpoint.
These two undocumented procedures, called DBMS_XDB.SetListenerEndpoint and DBMS_XDB.GetListenerEndpoint, are actually documented in the 11gR1 manual, so i guess they were added to the package when it was too late to be described in the manuals.
When i attempted to execute the following block as a normal user, i got the exception shown below:
begin
DBMS_XDB.SETLISTENERENDPOINT (
endpoint => DBMS_XDB.XDB_ENDPOINT_HTTP2,
host => NULL,
port => 8082,
protocol => DBMS_XDB.XDB_PROTOCOL_TCP);
end;
/

ORA-31050: Access denied
ORA-06512: at "XDB.DBMS_XDB", line 382
ORA-06512: at "XDB.DBMS_XDB", line 671
ORA-06512: at line 2
After connecting as SYS and executing the block again, i got my second listening endpoint up and running on port 8082.

Note that existing sessions won't pick up the new configuration until you refresh it.
Indeed i when executed the following block from an existing session as a normal user:
declare
l_host varchar2(255);
l_prot number;
l_port number;
begin
DBMS_XDB.GETLISTENERENDPOINT (
endpoint => DBMS_XDB.XDB_ENDPOINT_HTTP2,
host => l_host,
port => l_port,
protocol => l_prot);

dbms_output.put_line(l_host);
dbms_output.put_line(l_port);
dbms_output.put_line(l_prot);
end;
/
i only got null values.
As soon as i executed DBMS_XDB.CFG_REFRESH the new values took effect for that session.

According to the documentation for Oracle 11g, the second listening endpoint is most useful for implementing the HTTPS protocol. I configured a normal (secondary) HTTP port just to verify the possibility of connecting to a specific Apex box from remote using a non standard port.

See message translations for ORA-31050 and search additional resources.

No comments:

yes you can!

Two great ways to help us out with a minimal effort. Click on the Google Plus +1 button above or...
We appreciate your support!

latest articles