SQL adaptation guide For Oracle Database 9.2, 10.x, 11.x, 12x / 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;
The TEMPTABS tablespace must be created as permanent tablespace, and when using a PDB, it must be created in the context of the PDB. When not using a PDB database, execute the CREATE TABLESPACE command with the appadmin user:
CREATE TABLESPACE temptabs DATAFILE 'file-path' SIZE 1M AUTOEXTEND ON; -- Give privileges on temptabs tablespace to other users ALTER USER dbuser QUOTA UNLIMITED ON TEMPTABS;
CREATE USER temptabs IDENTIFIED BY pswd;
For more details about temporay table emulations, see Temporary tables.
sqlplus appadmin/password@tnsname
Convert Informix® data types to Oracle data types. See issue data type Conversion Tables for more details.