Database Reference
In-Depth Information
The
CONTAINER
Clause
When you create a new user, the
CONTAINER
clause differentiates the local user from the
common user. If you want to create a common user, make sure your current container is
CDB$ROOT
and use
CONTAINER = ALL
when issuing the
CREATE USER
statement. This is the
default if you're logged into
CDB$ROOT
.
If you want to create a local user in a PDB, set your current container to the PDB and
use the
CONTAINER = CURRENT
clause. This is the default if you're logged into a PDB.
When creating a common user the
DEFAULT TABLESPACE
,
TEMPORARY TABLESPACE
,
QUOTA
,
and
PROFILE
specified must exist in all the containers belonging to the CDB.
The Current Container
The current container is where the current session is running, and each session can have only
one current container at any point in time. It can be the root for common users or a PDB for
local and common users. Each container has a separate data dictionary, so the current con-
tainer data dictionary is used for privilege authorization and name resolution.
Chapter 14, “Oracle Security in CDBs and PDBs,” goes into greater detail
about users, roles, and privileges in CDBs and PDBs.
Establishing Connections to a CDB
This section describes using SQL*Plus to access the root of a CDB. You can connect to a
CDB by starting SQL*Plus with a connect string to the CDB, using the SQL*Plus
CONNECT
command if you're already logged on, or you can switch from a PDB to the
CDB$ROOT
by
using the
ALTER SESSION SET CONTAINER = CDB$ROOT
SQL statement.
Clients access the root through a database service that has the same name as the data-
base name. With the service name, you can access the
CDB$ROOT
using the easy connect
syntax or the net service name configured in the
tnsnames.ora
file. When you create a new
database using the DBCA, it creates a new listener service handler, and a service name is
created in the local
tnsnames.ora
file. Oracle Net Services must be configured for you to
connect to the
CDB$ROOT
using a net service name.
The
SESSIONS
initialization parameter limits the total number of sessions that may be
established in a CDB and its PDBs. If you reach the
SESSIONS
limit, you will not be able to
log on.
Connecting to a CDB Using SQL*Plus
In Exercise 12.1, we will establish connections to a CDB and its DBA-created PDBs. This
exercise assumes that you have created a CDB and PDBs on your local machine and that
the CDB has been started.
Search WWH ::
Custom Search