1

    APEX_UTIL.SET_SECURITY_GROUP_ID( APEX_UTIL.FIND_SECURITY_GROUP_ID( p_workspace => 'teacher' ));

   apex_util.create_user(
   p_user_name => 'teacher',
   p_web_password => 'ChangeMe@1234',
   p_developer_privs => 'ADMIN:CREATE:DATA_LOADER:EDIT:HELP:MONITOR:SQL',
   p_email_address => 'test1@example.com',
   p_default_schema => 'teacher',
   p_change_password_on_first_use => 'N' );

   end;

Error report -
ORA-20001: Package variable g_security_group_id must be set.
ORA-06512: at "APEX_210100.WWV_FLOW_API", line 485
ORA-06512: at "APEX_210100.WWV_FLOW_API", line 520
ORA-06512: at "APEX_210100.WWV_FLOW_FND_USER_INT", line 1731
ORA-06512: at "APEX_210100.HTMLDB_UTIL", line enter code here  1245
ORA-06512: at line 5

does the Oracle Autonomous database allow developer to create apex workspace via the programming method? any API available? Does the OCI for Java SDK support the creation of APEX?

Joe
  • 2,500
  • 1
  • 14
  • 12
Jian
  • 21
  • 3
  • Thank you for the comments. I execute the plsql statement in the sql developer which has no oci-java-cloud plugin. – Jian Dec 13 '21 at 14:45

1 Answers1

4

To add workspaces to your APEX instance, please use the ADD_WORKSPACE procedure.

Example:

BEGIN
    APEX_INSTANCE_ADMIN.ADD_WORKSPACE (
        p_workspace_id       => 8675309,
        p_workspace          => 'MY_WORKSPACE',
        p_primary_schema     => 'SCOTT',
        p_additional_schemas => 'HR:OE' );
END;

To create APEX users on Autonomous Database, please note:

Application Express Administration Services and the Oracle Application Express development environment on Autonomous Database use Database Accounts authentication. This authentication method uses the database account user name and password to authenticate users.

Mónica Godoy
  • 351
  • 1
  • 8
  • BEGIN APEX_INSTANCE_ADMIN.ADD_WORKSPACE ( p_workspace => 'TEACHER', p_primary_schema => 'TEACHER'); END; – Jian Dec 10 '21 at 05:48
  • I am able to run the script above and "TEACHER" workspace can be created. I also create the TEACHER database user. But i can not sign-into the workspace with the TEACHER workspace name, TEACHER account along with the TEACHER database password. I am able to sign into the database action with the teacher account. – Jian Dec 10 '21 at 05:50
  • That is reason why i try to use apex_util.create_user to create apex user. – Jian Dec 10 '21 at 05:51
  • The APEX environment on Autonomous use Database Accounts Authentication. Please take a look at this useful blog post: https://blogs.oracle.com/apex/post/how-to-script-workspace-provisioning-on-oracle-autonomous-database – Mónica Godoy Dec 10 '21 at 13:38
  • I tried the steps in the blog, but does not work . did anyone in the community try to create a workspace in the ATP by using the plsql program not just the document? – Jian Dec 10 '21 at 14:21
  • Jian - That script works fine if you run it using an APEX app. I believe you wish to create those users programmatically. – Mónica Godoy Dec 13 '21 at 17:19
  • Thank for you the comment. I just try to execute the script in the sql developer or Autonomous database action. Can i do that? – Jian Dec 15 '21 at 12:20
  • Jian - At the moment is not possible to run it using Database Actions. – Mónica Godoy Dec 15 '21 at 17:11