Creating Users
Create User and Workspace
Section titled “Create User and Workspace”Create a new database schema and APEX workspace in one command:
local-26ai.sh create-user moviesThe command does the following:
- Creates a schema with the name that you give
- Stores the schema password in the
.envfile - Saves the connection in the connection store of SQLcl
- Adds the development grants
- Gives access to the datapump directories
- Creates an APEX workspace
- Sets the workspace settings for session length, maximum emails, REST messages, and password lifetime
Create Schema Only
Section titled “Create Schema Only”If you only need a database schema without an APEX workspace:
local-26ai.sh create-user myschema --skip-workspaceCreate a Compressed Schema
Section titled “Create a Compressed Schema”Add --compress to enable Advanced Compression on the tablespace of the new schema. Oracle Database Free includes this feature.
The database then compresses every table and index that you create later. Tables get advanced row compression. B-tree indexes get advanced index compression. The schema uses less disk space as it grows.
local-26ai.sh create-user movies --compress# Combine with other flags as needed:local-26ai.sh create-user myschema --skip-workspace --compressClear a Schema
Section titled “Clear a Schema”Drop all objects in a schema and keep the schema itself. Use this command when you test an install script many times:
local-26ai.sh clear-schema movies# Asks for confirmation before proceedingTo skip the confirmation prompt, use the -y flag. Use this flag in scripts and CI jobs:
local-26ai.sh clear-schema movies -yDrop a Schema
Section titled “Drop a Schema”Drop a schema and all its objects. The command also drops the tablespace of the schema and its datafile. The database returns the disk space to the operating system, so no orphan file stays behind:
local-26ai.sh drop-user movies# Asks for confirmation before proceedingTo skip the confirmation prompt, use the -y flag. Use this flag in scripts and CI jobs:
local-26ai.sh drop-user movies -yDatabase Access
Section titled “Database Access”SQLcl and SQL Developer Access
Section titled “SQLcl and SQL Developer Access”create-user stores every new user in the connection store of SQLcl:
# Connect using the stored connectionsql -name local-26ai-movies
# Connect to sys usersql -name local-26ai-sysThe connections also appear in the VS Code SQL Developer extension. After you create a user, refresh the connection list.
Other Development Tools
Section titled “Other Development Tools”Use these connection details for other development tools:
- Host: localhost
- Port: 1521
- Service: FREEPDB1
- Username: Your schema name
- Password: The
<NAME>_USER_PASSWORDvalue in the.envfile