fuzziebrain / docker-apex-stack

Utility scripts for creating an Oracle Application Express stack as a Docker container.
MIT License
97 stars 34 forks source link

Question: Login to sqlplus, sqldevweb and apex #32

Closed pralfafara closed 3 years ago

pralfafara commented 3 years ago

Hi Adrian,

I was able to connect to enterprise manager via SYS user, however, I'm trying to connect to sqlplus and sqldev web using the same user but I'm having trouble logging in. In sqlplus, it shows ORA-12547, while in sqldev web when I enter SYS as username and click next a 404 error occurs.

I read all the instructions and have been debugging the installation but I found no issues at all.

Any ideas what caused this?

Also, what is the workspace name created in APEX during the installation?

Awesome work btw!

fuzziebrain commented 3 years ago

Hi @psalfafara,

Thank you for your kind words. Here are the responses to your questions:

sqlplus (cli)

From the screenshot you provided, it looks like you had used docker exec to get a Bash session. If this is an XE container, by default, you will enter the session as root. Use either the option --user or the command su - to login as oracle. Next, set the environment variables: ORAENV_ASK=NO && ORACLE_SID=XE && . oraenv.

$ docker exec -it dastest202 bash
bash-4.2# su - oracle
Last login: Sat Dec 19 20:13:47 UTC 2020
[oracle@b618ad23d8e8 ~]$ ORAENV_ASK=NO && ORACLE_SID=XE && . oraenv
The Oracle base has been set to /opt/oracle
[oracle@b618ad23d8e8 ~]$ sqlplus / as sysdba

SQL*Plus: Release 18.0.0.0.0 - Production on Sat Dec 19 20:14:28 2020
Version 18.4.0.0.0

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

Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0

SQL>

sqldev web (http://localhost:50080/ords/sql-developer)

To access SQL Developer Web, the user/schema must be "REST-enabled". I briefly talked about this in this blog post. For example:

alter session set container = xepdb1;

create user demo identified by demo;

grant create session to demo;

exec ords_admin.enable_schema(p_schema => 'DEMO');

If you wish to have a use the Monitoring functions, grant the following roles to the user:

grant dba, pdb_dba to demo;

And if you wish the user to manage ORDS as well:

grant ords_administrator_role to demo;

Also, what is the workspace name created in APEX during the installation?

There is none, so you will need to create them. You can login to the Administration Services using this URL: http://localhost:50080/ords/apex_admin

The username and password were set using the configuration file used for the build.