ORA-20001 is a most common error that occur when we first configure Application Express for PDF/report printing.
Error is displayed as follows:
ORA-20001: The printing engine could not be reached because either the URL specified is incorrect or a proxy URL needs to be specified.
Actually this happens due to security related enhancement done in Oracle Database 11g release 1.
Now starting with Oracle Database 11g, by default, the ability to interact with network services is disabled in Oracle Database.
If you want to enable it for certain host or user then you need to use the new DBMS_NETWORK_ACL_ADMIN package to grant connect privileges to them.
So here too we need to grant connect privilege to APEX_030200 apex database user as follows:
DECLARE
ACL_PATH VARCHAR2(4000);
ACL_ID RAW(16);
BEGIN
SELECT ACL INTO ACL_PATH FROM DBA_NETWORK_ACLS
WHERE HOST = ‘*’ AND LOWER_PORT IS NULL AND UPPER_PORT IS NULL;
SELECT SYS_OP_R2O(extractValue(P.RES, ‘/Resource/XMLRef’)) INTO ACL_ID
FROM XDB.XDB$ACL A, PATH_VIEW P
WHERE extractValue(P.RES, ‘/Resource/XMLRef’) = REF(A) AND
EQUALS_PATH(P.RES, ACL_PATH) = 1;
DBMS_XDBZ.ValidateACL(ACL_ID);
IF DBMS_NETWORK_ACL_ADMIN.CHECK_PRIVILEGE(ACL_PATH, ‘APEX_030200‘,
‘connect’) IS NULL THEN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(ACL_PATH,
‘APEX_030200‘, TRUE, ‘connect’);
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL(’power_users.xml’,
‘ACL that lets power users to connect to everywhere’,
‘APEX_030200′, TRUE, ‘connect’);
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(’power_users.xml’,'*’);
END;
COMMIT;
Please refer Oracle Documentation page for more details.
I have simply replaced FLOWS_030100 with APEX_030200.
Thing to Notice: Starting Application Express 3.2.0.00.27, the Application Express Database user is prefix APEX_ instead of FLOWS_.
Hope this post will help others!
1 response so far ↓
1 HBradshaw // Jun 22, 2009 at 4:31 pm
Hello:
I’m new to APEX and I’m not a DBA. I need to run this procedure in order to do PDF printing.
Is this a procedure what already exists and I run an EXEC on it?
How do I go about actually running the above code?
Can I copy and paste it into SQL Developer and just run it? Is it supposed to be run against a certain schema?
Can you tell me how to execute this?
Thanks.
Leave a Comment