Question: What do
I do to manually create a cdb from the command line? I
know that Oracle recommends using DBCA to create a cdb, but
I need to do a manual create of a cdb. What are the
steps to manually create a cdb from the SQL*Plus command
prompt?
Answer: To manually create a cdb
you need to perform these steps.
1 - Parameter: Set the init.ora
parameter enable_pluggable_database=true.
2 - Create the database: You can
run the following create statement for a cdb, making sure to
include the "enable pluggable database" syntax:
CREATE DATABASE ZWC
MAXLOGFILES 16
MAXLOGMEMBERS 4
MAXDATAFILES
1024
MAXINSTANCES 1
MAXLOGHISTORY
680
CHARACTER SET ZHS16GBK
NATIONAL
CHARACTER SET AL16UTF16
DATAFILE
'/12cfile/ZWC/system01.dbf' SIZE 500M
EXTENT MANAGEMENT LOCAL
UNDO TABLESPACE undotbs1 DATAFILE
'/12cfile/ZWC/undotbs01.dbf' SIZE
800M
SYSAUX DATAFILE
'/12cfile/ZWC/sysaux01.dbf' SIZE
500M
DEFAULT TEMPORARY TABLESPACE TEMP
TEMPFILE
'/12cfile/ZWC/temp01.dbf' SIZE
500M
DEFAULT TABLESPACE USERS DATAFILE
'/12cfile/ZWC/users01.dbf' SIZE
50M
LOGFILE GROUP 1
('/12cfile/oraredo/ZWC/redo01a.rdo')
SIZE 50M,
GROUP 2
('/12cfile/oraredo/ZWC/redo02a.rdo')
SIZE 50M
USER sys IDENTIFIED BY oracle
USER system IDENTIFIED BY oracle
USER_DATA TABLESPACE userstbs
DATAFILE
'/12cfile/ZWC/userstbsp01.dbf'
SIZE 500M
ENABLE PLUGGABLE DATABASE
SEED FILE_NAME_CONVERT =
('/12cfile/ZWC','/12cfile/ZWC/pdbseed');
3 - Catalog: Run the catalog
script (catcdb.sql) after the create database statement. The Oracle
docs note:
"When you use the CREATE DATABASE
statement to create a CDB, you must complete additional
actions before you have an operational CDB.
These actions include building views
on the data dictionary tables and installing standard PL/SQL
packages in the root.
You perform these actions by running
the supplied "catcdb.sql" script."
Important Note: You must have have
the perl binaries in your path when you run catcdb.sql. Else
you will get the
ORA-01917 error.
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin/:$PATH
After doing this PATH change, you run catcdb.sql and then
you will be able to create the pluggable database
successfully.
|
|
|
Oracle Training from Don Burleson
The best on site
"Oracle
training classes" are just a phone call away! You can get personalized Oracle training by Donald Burleson, right at your shop!

|
|
|

|
|
Burleson is the American Team

Note:
This Oracle
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
Oracle forum.
Verify
experience!
Anyone
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
publish
their Oracle
qualifications.
Errata?
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
feedback. Just
e-mail:
and include the URL for the page.
Copyright © 1996 - 2020
All rights reserved by
Burleson
Oracle ®
is the registered trademark of Oracle Corporation.
|
|