Skip to content

Creating Users

Create a new database schema and APEX workspace in one command:

Terminal window
local-26ai.sh create-user movies

This will:

  • Create a new schema with the given name
  • Store the schema password in the .env file
  • Save the connection in SQLcl’s connection store
  • Add all necessary development grants
  • Give access to datapump directories
  • Create an APEX workspace with convenient settings
  • Optimize workspace settings like session length, max emails and REST messages and password lifetime

If you only need a database schema without an APEX workspace:

Terminal window
local-26ai.sh create-user myschema --skip-workspace

Add --compress to enable Advanced Compression (included in Oracle Database Free) on the new schema’s tablespace from the start. Every table and index created afterwards is stored compressed automatically — advanced row compression for tables, advanced index compression for B-tree indexes — keeping the schema’s disk footprint smaller as it grows.

Terminal window
local-26ai.sh create-user movies --compress
# Combine with other flags as needed:
local-26ai.sh create-user myschema --skip-workspace --compress

Useful for testing installation scripts multiple times:

Terminal window
local-26ai.sh clear-schema movies
# Asks for confirmation before proceeding

To skip the confirmation prompt (useful for automation), use the -y flag:

Terminal window
local-26ai.sh clear-schema movies -y

Completely remove a schema and all its objects. This also drops the schema’s dedicated tablespace and its datafile, so the disk space is reclaimed instead of being left behind as an orphan:

Terminal window
local-26ai.sh drop-user movies
# Asks for confirmation before proceeding

To skip the confirmation prompt (useful for automation), use the -y flag:

Terminal window
local-26ai.sh drop-user movies -y

All created users are automatically stored in SQLcl’s connection store:

Terminal window
# Connect using the stored connection
sql -name local-26ai-movies
# Connect to sys user
sql -name local-26ai-sys

You will also find the connections in the VS Code SQL Developer extension. You might need to refresh the connections list after creating a new user.

Use these connection details for other development tools:

  • Host: localhost
  • Port: 1521
  • Service: FREEPDB1
  • Username: Your schema name
  • Password: The <NAME>_USER_PASSWORD value in the .env file