3 About Creating a Database
Starting with Oracle Database 12c Release 1, you can use the Oracle Multitenant option to configure and manage a multitenant environment. The multitenant architecture enables an Oracle Database to function as a multitenant container database (CDB) that includes zero, one, or many customer-created pluggable databases (PDBs). A PDB is a portable collection of schemas, schema objects, and nonschema objects.
This chapter describes the following:
3.1 Prerequisites for Database Creation
Before you can create a database, the following prerequisites must be met:
3.2 About Creating a Non-CDB
A non-CDB is the traditional type of an Oracle database, which was supported in Oracle Database releases before 12c.
A non-CDB still exists in Oracle Database 12c Release 2.
You can create a non-CDB either automatically or manually. Oracle recommends that you use the automatic creation procedure outlined in the “Creating a Database Automatically” section. Instructions on how to create a traditional database manually are given in the “Creating a Database Manually” section.
This section describes the following topics:
3.2.1 Creating a Database Automatically
Complete the following steps to create a database automatically:
Unless specified otherwise, $ORACINST.INSTALL.P.SUPER
generates and enters a batch job which:
-
Calls
INSTALL.P.DBA
. -
Creates the
system
andsysaux
tablespace. -
Creates the default permanent tablespace, temporary tablespace, and undo tablespace.
-
Creates the log files.
-
Initializes the database.
-
Runs
CATALOG.SQL
. -
Runs
CATPROC.SQL
. -
Installs the tables for online help messages.
-
Installs the
DEMO
tables. -
Changes the system passwords if necessary.
-
Calls the verification procedure.
When $ORACINST.INSTALL.P.SUPER
has completed, you should have an initialized, ready-to-use database, and a running Oracle Database instance. The results of the job are listed in the file, L.
sid
.INSSUP.SYSOUT
, where sid
is the system ID of the database that you just installed.
3.2.2 Creating a Database Manually
Oracle recommends that you use the automatic creation procedure outlined in "Creating a Database Automatically". The manual creation procedure performs the same steps as the automatic creation procedure. However, when you create a database manually, you can perform the steps at your own pace, and also choose which of the optional steps to perform, omit, or perform later.
This section describes the following topics:
3.2.2.1 Creating Parameter Files for a Non-CDB
Create the parameter files for the new database as follows:
3.2.2.2 Creating the Database
After generating the DBA files, you must create the database. This section describes the procedure for creating the database:
3.2.2.2.1 About Modifying the Initialization File for a Non-CDB
Determine if you want to make any changes to parameters in the distributed initialization file, sid
.DBS.INIT.ORA
(where sid
is the system ID for the database). The SGA parameters may need to be adjusted to reflect memory limitations and the maximum number of users who can access the Oracle Database instance at one time. Use a BS2000 editor to make the modifications.
See Also:
Oracle Database Reference for more information about the initialization parameters
3.2.2.2.2 About Modifying the ORAENV File for a Non-CDB
Modify the environment definition file, sid
.P.ORAENV
, according to your specific requirements. Remember that a number of variables are evaluated during startup only. If you modify such a variable in the ORAENV
file later on, then you may have to wait for the next startup for the changes to take effect.
Do not explicitly set the environment variable NLS_LANG
when you run Oracle supplied SQL scripts.
3.2.2.2.3 About Using SQL*Plus to Create the Database
Remember that you must call the applicable sid
.P.ORAENV
procedure before calling SQL*Plus. To execute SQL*Plus, enter the following commands:
/START-EXECUTABLE (*LINK(ORALOAD),SQLPLUS)
* /NOLOG
SQL> CONNECT / AS SYSDBA
SQL> STARTUP NOMOUNT [PFILE=filename]
-
/NOLOG
omits being prompted for user name and password. -
CONNECT
gives you a connection to an idle instance. -
The last statement starts the Oracle Database instance.
If you want to use your own copy of the initialization file (sid
.DBS.INIT.ORA
), then use the PFILE=
filename
option, as illustrated in the previous command.
The following statement creates database and log files:
SQL> CREATE DATABASE...;
Note:
If you get an error before the first SQL>
prompt, then it may be caused by either a missing ORAENV
file (or ORASID
not set in the ORAENV
file), or sometimes by an address space conflict. For example, the address range you assigned to the kernel memory pool (KNL_BASE
) could be occupied by a subsystem.
3.2.2.3 About Installing Data Dictionary Views
Run the scripts necessary to build data dictionary views, synonyms, and PL/SQL packages. Run the following commands:
SQL> SPOOL filename
SQL> SET TERMOUT OFF
SQL> $ORACLE_HOME/rdbms/admin/catalog.sql
SQL> $ORACLE_HOME/rdbms/admin/catproc.sql
3.2.2.4 About Installing Online Help Messages
To install the Online Help facility, enter the following command:
/CALL-PROCEDURE $ORACINST.INSTALL.P.HELP,(
sid
[,SYSTEMPW=systempw])
3.2.2.5 About Installing Demo Tables
To install demo tables, enter the following:
/CALL-PROCEDURE $ORACINST.INSTALL.P.DEMO,(
sid
[,SYSTEMPW=systempw])
3.2.2.6 About Installing Sample Schemas
To install sample schemas, enter the following:
/CALL-PROCEDURE $ORACINST.INSTALL.P.SAMPLES,(
sid
[,SYSTEMPW=systempw] [,SYSPW=syspw])
The procedure INSTALL.P.SAMPLES
installs the human resources (HR), order entry (OE), info exchange (IX), and sales history (SH) sample schemas with the default passwords. Product media (PM) is not supported.
3.2.2.7 About Verifying Database Creation
To verify if the demonstration database was correctly created, enter the following:
/CALL-PROCEDURE $ORACINST.INSTALL.P.VERIFY,(
sid
[,SYSTEMPW=systempw])
If the demonstration database was correctly created, then you see messages like the following displayed on the screen:
*SCOTT'S TABLE EMP IS INSTALLED
3.2.2.8 About Installing Oracle Text
Installing Oracle Text is summarized in the "Oracle Text" chapter of this book.
3.2.2.9 About Installing Java
Installing Java is summarized in the "Java in the Database" chapter of this book.
3.3 About Creating a Multitenant Container Database
A multitenant container database (CDB) is a single physical database that contains zero, one, or many user-created pluggable databases. A pluggable database (PDB) is a portable collection of schemas, schema objects, and nonschema objects that appears to an Oracle Net client as a non-CDB. A non-CDB is a traditional Oracle database that cannot contain PDBs.
Starting with Oracle Database 12c Release 1, you can create a multitenant container database (CDB).
The topics in this section describe how to create a CDB manually on Fujitsu BS2000. As creating a CDB involves Perl scripts, you must perform some steps in the POSIX environment. Perl is supported only in the POSIX environment of BS2000.
The following topics are discussed:
See Also:
Oracle Database Administrator’s Guide for more information about creating a CDB3.3.1 Creating Parameter Files for a CDB
Create the parameter files for the new database as follows:
3.3.2 About Creating a CDB
The procedure to create a multitenant container database (CDB) is discussed in the following topics:
3.3.2.1 About Modifying the Initialization File for a CDB
Determine if you want to make any changes to the parameters in the initialization file, sid
.DBS.INIT.ORA
(where sid
is the system ID for the database). The SGA parameters may need to be adjusted to reflect memory limitations and the maximum number of users who can access the Oracle Database instance at one time. Use a BS2000 editor to make the modifications.
To create a CDB, set the value for the ENABLE_PLUGGABLE_DATABASE
initialization parameter in the sid.DBS.INIT.ORA
file as follows:
ENABLE_PLUGGABLE_DATABASE=TRUE
See Also:
Oracle Database Reference for an explanation of initialization parameters
3.3.2.2 About Modifying the ORAENV File for a CDB
Modify the environment definition file, sid
.P.ORAENV
, according to your specific requirements. Remember that a number of variables are evaluated during startup only. If you modify such a variable in the ORAENV
file later on, then you may have to wait for the next startup for the changes to take effect.
Do not explicitly set the environment variable NLS_LANG
when you run Oracle supplied SQL scripts.