Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can i solve my Problems????

Microsoft Windows [Version 10.0.19045.3930]
(c) Microsoft Corporation. All rights reserved.

C:\Apex_23_2\ords>Set Oracle_sid=orcl1

C:\Apex_23_2\ords>sqlplus

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Jan 24 22:59:59 2024
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.

Enter user-name: SYSTEM
Enter password:
Last Successful login time: Wed Jan 24 2024 22:58:34 +06:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

C:\Apex_23_2\ords>"C:\Program Files\Java\jdk-19\bin\java" -jar ords.war install
Warning: Support for executing: java -jar ords.war has been deprecated.
Please add ords to your PATH and use the ords command instead.
2024-01-24T17:00:28.397Z INFO Your configuration folder C:\Apex_23_2\ords is located in ORDS product folder. Oracle recommends to use a different configuration folder.

ORDS: Release 23.1 Production on Wed Jan 24 23:00:28 2024

Copyright (c) 2010, 2024, Oracle.

Configuration:
/C:/Apex_23_2/ords/

The configuration folder C:\Apex_23_2\ords does not contain any configuration files.

Oracle REST Data Services - Interactive Install

Enter a number to select the type of installation
[1] Install or upgrade ORDS in the database only
[2] Create or update a database pool and install/upgrade ORDS in the database
[3] Create or update a database pool only
Choose [2]:
Enter a number to select the database connection type to use
[1] Basic (host name, port, service name)
[2] TNS (TNS alias, TNS directory)
[3] Custom database URL
Choose [1]:
Enter the database host name [localhost]:
Enter the database listen port [1521]: 1522
Enter the database service name [orcl1]:
Provide database user name with administrator privileges.
Enter the administrator username: SYSTEM
Enter the database password for SYSTEM:
Connecting to database user: SYSTEM url: jdbc:oracle:thin:@//localhost:1522/orcl1

Retrieving information.
Enter the default tablespace for ORDS_METADATA and ORDS_PUBLIC_USER [SYSAUX]: APEX23
Enter the temporary tablespace for ORDS_METADATA and ORDS_PUBLIC_USER [TEMP]:
Enter a number to select additional feature(s) to enable:
[1] Database Actions (Enables all features)
[2] REST Enabled SQL and Database API
[3] REST Enabled SQL
[4] Database API
[5] None
Choose [1]:
Enter a number to configure and start ORDS in standalone mode
[1] Configure and start ORDS in standalone mode
[2] Skip
Choose [1]:
Enter a number to select the protocol
[1] HTTP
[2] HTTPS
Choose [1]:
Enter the HTTP port [8080]:
Enter the APEX static resources location: C:\Apex_23_2\ords\images
The setting named: db.connectionType was set to: basic in configuration: default
The setting named: db.hostname was set to: localhost in configuration: default
The setting named: db.port was set to: 1522 in configuration: default
The setting named: db.servicename was set to: orcl1 in configuration: default
The setting named: plsql.gateway.mode was set to: proxied in configuration: default
The setting named: db.username was set to: ORDS_PUBLIC_USER in configuration: default
The setting named: db.password was set to: ****** in configuration: default
The setting named: feature.sdw was set to: true in configuration: default
The global setting named: database.api.enabled was set to: true
The setting named: restEnabledSql.active was set to: true in configuration: default
The setting named: security.requestValidationFunction was set to: ords_util.authorize_plsql_gateway in configuration: default
The global setting named: standalone.http.port was set to: 8080
The global setting named: standalone.static.path was set to: /C:/Apex_23_2/ords/images/
The global setting named: standalone.static.context.path was set to: /i
The global setting named: standalone.context.path was set to: /ords
The global setting named: standalone.doc.root was set to: C:\Apex_23_2\ords\global\doc_root
2024-01-24T17:01:07.964Z INFO Installing Oracle REST Data Services version 23.1.3.r1371032 in NON_CDB
------------------------------------------------------------
Date : 24 Jan 2024 23:01:07
Release : Oracle REST Data Services 23.1.3.r1371032
Type : ORDS Install
Database : Oracle Database 19c Enterprise Edition
DB Version : 19.3.0.0.0
------------------------------------------------------------
Container Name: NON_CDB
Executing scripts for core
------------------------------------------------------------

[*** script: ords_prereq_env.sql]

INFO: Checking prerequisites for Oracle REST Data Services

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

INFO: Prerequisites verified.

2024-01-24T17:01:11.554Z INFO ... Verified database prerequisites
[*** script: ords_verify_tablespace.sql]

PL/SQL procedure successfully completed.

[*** script: ords_alter_session_script.sql]

PL/SQL procedure successfully completed.

[*** script: ords_create_rest_users.sql]

PL/SQL procedure successfully completed.

2024-01-24T17:01:20.296Z INFO ... Created Oracle REST Data Services proxy user
[*** script: ords_alter_session_script.sql]

PL/SQL procedure successfully completed.

[*** script: ords_create_schema.sql]
INFO: Creating schema for Oracle REST Data Services

PL/SQL procedure successfully completed.

INFO: Created schema ORDS_METADATA
2024-01-24T17:01:21.768Z INFO ... Created Oracle REST Data Services schema
[*** script: ords_grant_privs.sql]
INFO: Grant object and system privileges to ORDS owner
GRANT READ ON SYS.DBA_OBJECTS TO "ORDS_METADATA"

Error starting at line : 42 in command -
declare
type table_name_list is table of dba_tab_privs.table_name%TYPE;

public_pkg_list table_name_list := table_name_list(
'DBMS_ASSERT',
'DBMS_LOB',
'DBMS_OUTPUT',
'DBMS_SCHEDULER',
'DBMS_SQL',
'DBMS_SESSION',
'DBMS_UTILITY',
'DEFAULT_JOB_CLASS',
'HTP',
'OWA',
'WPG_DOCLOAD',
'UTL_SMTP'
);

public_view_list table_name_list := table_name_list(
'SESSION_PRIVS'
);

dba_view_list table_name_list := table_name_list(
'DBA_OBJECTS',
'DBA_ROLE_PRIVS',
'DBA_TAB_COLUMNS',
'DBA_USERS'
);

dba_view_list_optional table_name_list := table_name_list(
'DBA_REGISTRY'
);

c_public constant dba_tab_privs.grantee%TYPE := 'PUBLIC';
c_owner constant dba_tab_privs.owner%TYPE := 'SYS';
c_execute_priv constant dba_tab_privs.privilege%TYPE := 'EXECUTE';
c_select_priv constant dba_tab_privs.privilege%TYPE := 'SELECT';
c_read_priv constant dba_tab_privs.privilege%TYPE := 'READ';

c_grant constant varchar2(100) := 'GRANT ';
c_on_sys constant varchar2(100) := ' ON SYS.';

c_grant_execute constant varchar2(100):= c_grant || c_execute_priv || c_on_sys;
c_grant_select constant varchar2(100) := c_grant || c_select_priv || c_on_sys;
c_grant_read constant varchar2(100) := c_grant || c_read_priv || c_on_sys;

c_to_user constant varchar2(100) := ' TO ' || dbms_assert.enquote_name('ORDS_METADATA');
l_exists pls_integer := 0;

l_use_read boolean := TRUE;

not_authorized EXCEPTION;
PRAGMA EXCEPTION_INIT(not_authorized, -01031);

begin
-- Check if the PUBLIC privileges exist to execute the packages
for i in public_pkg_list.first .. public_pkg_list.last loop
begin
l_exists := 0;
select count(*) into l_exists from dba_tab_privs
where table_name = public_pkg_list(i) and privilege = c_execute_priv and grantee=c_public and owner=c_owner;

if l_exists = 0 then
sys.dbms_output.put_line(c_grant_execute || public_pkg_list(i) || c_to_user);
execute immediate c_grant_execute || public_pkg_list(i) || c_to_user;
end if;
end;
end loop;

if sys.dbms_db_version.VERSION = 11 then
l_use_read := FALSE;
elsif sys.dbms_db_version.VERSION = 12 then
select count(*) into l_exists from sys.dba_registry where COMP_ID='CATPROC' and VERSION like '12.1.0.1.%';
if l_exists > 0 then
-- For Oracle DB 12.1.0.1, grant SELECT privilege.
l_use_read := FALSE;
end if;
end if;

-- Check if the PUBLIC privileges exist to read/select the view
for i in public_view_list.first .. public_view_list.last loop
begin
l_exists := 0;
select count(*) into l_exists from dba_tab_privs
where table_name = public_view_list(i)
and (privilege = c_read_priv or privilege = c_select_priv)
and grantee=c_public and owner=c_owner;

if l_exists = 0 then
-- Grant privilege because the public read/select privilege is revoked.
if l_use_read then
-- 12.1.0.2 and later use the READ privilege
sys.dbms_output.put_line(c_grant_read || public_view_list(i) || c_to_user);
execute immediate c_grant_read || public_view_list(i) || c_to_user;
else
sys.dbms_output.put_line(c_grant_select || public_view_list(i) || c_to_user);
execute immediate c_grant_select || public_view_list(i) || c_to_user;
end if;
end if;
end;
end loop;

-- grant read or select on DBA views
for i in dba_view_list.first .. dba_view_list.last loop
if l_use_read then
-- 12.1.0.2 and later use the READ privilege
sys.dbms_output.put_line( c_grant_read || dba_view_list(i) || c_to_user);
execute immediate c_grant_read || dba_view_list(i) || c_to_user;
else
sys.dbms_output.put_line(c_grant_select || dba_view_list(i) || c_to_user);
execute immediate c_grant_select || dba_view_list(i) || c_to_user;
end if;
end loop;

-- grant read or select on DBA views (optional)
for i in dba_view_list_optional.first .. dba_view_list_optional.last loop
begin
if l_use_read then
-- 12.1.0.2 and later use the READ privilege
sys.dbms_output.put_line( c_grant_read || dba_view_list_optional(i) || c_to_user);
execute immediate c_grant_read || dba_view_list_optional(i) || c_to_user;
else
sys.dbms_output.put_line(c_grant_select || dba_view_list_optional(i) || c_to_user);
execute immediate c_grant_select || dba_view_list_optional(i) || c_to_user;
end if;
exception
when not_authorized then
sys.dbms_output.put_line( 'WARNING: SYS.' || dba_view_list_optional(i) || ' not authorized - use ords_installer_privileges.sql to update installer''s privileges.');
end;
end loop;

end;
Error report -
ORA-01031: insufficient privileges
ORA-06512: at line 110
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to perform a database operation without
the necessary privileges.
*Action: Ask your database administrator or designated security
administrator to grant you the necessary privileges
2024-01-24T17:01:23.420Z SEVERE Error executing script: ords_grant_privs.sql Error: ORA-01031: insufficient privileges
ORA-06512: at line 110

Refer to log file for details

C:\Apex_23_2\ords>

Comments
Post Details
Added on Jan 25 2024
3 comments
656 views