dstrack / Document-AI-Scanner

Oracle APEX App for OCI Document Understanding AI
BSD 2-Clause "Simplified" License
3 stars 1 forks source link

grant execute dbms_cloud to #FLOW_OWNER# #2

Open charanssv opened 5 months ago

charanssv commented 5 months ago

Hi,

I started learning APEX and I want to install document AI scanner application and I'm running into this error "grant execute dbms_cloud to #FLOW_OWNER#;".

I'm assuming flow_owner means apex user. is that correct? I did execute this on my ATP

GRANT EXECUTE ON DBMS_CLOUD TO APEX_230200.

installed the application into XX_APEX schema and I granted execute on dbms_cloud to that user as well.

Please help.

Thanks

dstrack commented 5 months ago

Hello, APEX_230200 is not the proper choice. Use the schema name that is using to run the application. Click on the Application icon, click on 'Edit Application Definition', click on 'Security', click on 'Database Session'. There you will see the 'Parsing Schema'. It is one of the 'Workspace to schema assignments' that can be managed with the APEX Administration.

charanssv commented 5 months ago

Hi, Thanks for explaining this to me. Appreciate your help but even after executing that grant to the parsing schema, I'm still getting that error. I was able to call dbms_cloud package with in my apex workspace using sql commands as you can see in the attached doc. I'm trying to learn all the OCI AI services using your app. Please help.

Thanks ai_documnt_scan_app_error.docx

dstrack commented 5 months ago

Hi, Im glad to help you with your problem. As stated on page 26 of the "Document AI Scanner App - Application Guide" you have to connect to the database with an SYS or ADMIN account.

  1. Connect to the database using an SYS or ADMIN account. You can establish this connection through the Oracle "SQL Developer" application using the credentials that can be downloaded from the Database Connection menu in the Oracle Cloud Console on the page where you manage your Autonomous Database details. Alternatively, you can launch an SQL Console on that page by selecting Database Actions (unless you have switched to a VCN network).
  2. Log in as an ADMIN user to have the privilege to grant privileges to other users or schemas.
  3. Next, execute the following statements after replacing "" with the name of your application schema:

GRANT EXECUTE ON CTXSYS.CTX_DDL TO WKSP_PVAPEX; GRANT EXECUTE ON SYS.DBMS_LOCK TO WKSP_PVAPEX; GRANT EXECUTE ON DBMS_CLOUD TO WKSP_PVAPEX;

thank you for giving me the chance to improve the documentation. Regards, Dirk

charanssv commented 5 months ago

Hi Dirk,

Thanks for getting back to me. I have executed these grants from my ATP admin account. I have uploaded doc earlier that shows I was able to execute a script that creates cloud credential from SQL command windows within my workspace with parsing schema as "WKSP_PVAPEX". Still the install of supporting objects is failing. not sure why.

Cheers, Prasad

charanssv commented 5 months ago

ai_documnt_scan_app_error_1.docx

dstrack commented 5 months ago

Hi Prasad, assuming that you still hang on the preinstallation checks like you reported earlier, here is an sql statement that should deliver 3 rows in the SQL Console of the APEX Workspace. Similar statements are executed by the reinstallation checks. Select the Schema WKSP_PVAPEX and then paste and execute the following:

SELECT FROM ALL_TAB_PRIVS WHERE TABLE_NAME = 'CTX_DDL' AND TABLE_SCHEMA = 'CTXSYS' AND GRANTEE IN (SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA'), 'PUBLIC') AND PRIVILEGE = 'EXECUTE' UNION ALL SELECT FROM ALL_TAB_PRIVS WHERE TABLE_NAME = 'DBMS_LOCK' AND TABLE_SCHEMA = 'SYS' AND GRANTEE IN (SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA'), 'PUBLIC') AND PRIVILEGE = 'EXECUTE' UNION ALL SELECT * FROM ALL_TAB_PRIVS WHERE TABLE_NAME = 'DBMS_CLOUD' AND TABLE_SCHEMA = 'C##CLOUD$SERVICE' AND GRANTEE IN (SYS_CONTEXT('USERENV', 'CURRENT_SCHEMA'), 'PUBLIC') AND PRIVILEGE = 'EXECUTE';

dstrack commented 5 months ago

Instead of installing the supporting Object with the APEX Installer, you can execute the installation files in the order shown in Document_Scan_Ai_install.sql in you SQLDeveloper.