SQL adaptation guide for Oracle Database 11, 12 / Installation (Runtime Configuration) |
If you are tasked with installing and configuring the database, here is a list of steps to be taken:
Connect as system user with:
$ sqlplus / AS SYSDBA
and execute the following SQL command to create the db user:
CREATE USER appadmin IDENTIFIED BY password;
Grant privileges to the application administrator user:
GRANT CONNECT, RESOURCE, UNLIMITED TABLESPACE TO appadmin;
Connect as system user with:
$ sqlplus / AS SYSDBA
and create a pluggable database and its PDB administrator user. This is a basic PDB creation example using Oracle Managed Files, consider planing the PDB creation with the person in charge of Oracle database administration:
CREATE PLUGGABLE DATABASE mypdb ADMIN USER pdbadmin IDENTIFIED BY password ROLES = (DBA) DEFAULT TABLESPACE mypdb_01 DATAFILE 'path_01' SIZE 250M AUTOEXTEND ON ;
For now the PDB is only mounted, it must be opened for regular usage:
ALTER PLUGGABLE DATABASE mypdb OPEN;
tnsname = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = mypdb) ) )
CREATE OR REPLACE TRIGGER open_pdbs AFTER STARTUP ON DATABASE BEGIN EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN'; END open_pdbs; /
Re-connect as PDB administrator and create a user dedicated to application tables administration:
CONNECT pdbadmin/password@localhost/mypdb CREATE USER appadmin IDENTIFIED BY password; GRANT CONNECT, RESOURCE, UNLIMITED TABLESPACE TO appadmin;
See Using the default temporary table emulation for more details.
See Using the global temporary table emulation for more details.
For more details about temporay table emulations, see Temporary tables.
$ sqlplus appadmin/password@tnsname