使用CREATE DATABASE创建数据库CDBDEV, Container Database。
在oracle用户下创建脚本
[oracle@ol8-19 ~]$ vi CrCDBDEV.sql
输入以下内容:
CREATE DATABASE cdbdev
USER sys identified by oracle
USER system identified by oracle
EXTENT MANAGEMENT LOCAL
DEFAULT TEMPORARY TABLESPACE temp
DEFAULT TABLESPACE users
UNDO TABLESPACE undotbs1
ENABLE PLUGGABLE DATABASE;
[oracle@ol8-19 ~]$ . oraenv
ORACLE_SID = [CDBDEV] ? CDBDEV
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0/dbhome_1
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@ol8-19 ~]$ cd $ORACLE_HOME/dbs
[oracle@ol8-19 dbs]$ cp init.ora initCDBDEV.ora
[oracle@ol8-19 dbs]$ vi initCDBDEV.ora
修改数据如下:
DB_CREATE_FILE_DEST='/u01/app/oracle/oradata'
ENABLE_PLUGGABLE_DATABASE=true
db_name='CDBDEV'
memory_target=1G
processes = 150
audit_file_dest='/u01/app/oracle/admin/CDBDEV/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
db_recovery_file_dest_size=2G
diagnostic_dest='/u01/app/oracle'
dispatchers='(PROTOCOL=TCP) (SERVICE=CDBDEVXDB)'
open_cursors=300
remote_login_passwordfile='EXCLUSIVE'
undo_tablespace='UNDOTBS1'
You may want to ensure that control files are created on separate physical
devices
control_files = ('/u01/app/oracle/oradata/ora_control01.ctl', '/u01/app/oracle/fast_recovery_area/ora_control02.ctl')
compatible ='19.0.0'
确认initCDBDEV.ora中,变量中的路径都存在,不存在需要使用mkdir -p 来创建。
[oracle@ol8-19 dbs]$ mkdir -p /u01/app/oracle/admin/CDBDEV/adump
[oracle@ol8-19 dbs]$ mkdir -p /u01/app/oracle/fast_recovery_area
sqlplus / as sysdba
shutdown immediate;
startup nomount
创建数据库
@/home/oracle/CrCDBDEV.sql
创建数据字典 3mins
@$ORACLE_HOME/rdbms/admin/catalog.sql
创建存储过程 30mins
@$ORACLE_HOME/rdbms/admin/catalog.sql
创建后,修改/etc/oratab
在末尾加入以下内容:
CDBDEV:/u01/app/oracle/product/19.0.0/dbhome_1:N
SQL> select name, cdb from v$database;
NAME CDB
--------- ---
CDBDEV YES
SQL> select name from v$datafile;
NAME
----------------------------------------------------------------------------------------------------
/u01/app/oracle/oradata/CDBDEV/datafile/o1_mf_system_kvbshwrc_.dbf
/u01/app/oracle/oradata/CDBDEV/F16FAB71608966ECE0538388A8C0A155/datafile/o1_mf_system_kvbshx3m_.dbf
/u01/app/oracle/oradata/CDBDEV/datafile/o1_mf_sysaux_kvbshyml_.dbf
/u01/app/oracle/oradata/CDBDEV/F16FAB71608966ECE0538388A8C0A155/datafile/o1_mf_sysaux_kvbshysz_.dbf
/u01/app/oracle/oradata/CDBDEV/datafile/o1_mf_undotbs1_kvbshz7j_.dbf
/u01/app/oracle/oradata/CDBDEV/datafile/o1_mf_users_kvbshz9t_.dbf
/u01/app/oracle/oradata/CDBDEV/F16FAB71608966ECE0538388A8C0A155/datafile/o1_mf_users_kvbshzj7_.dbf
SQL> select tablespace_name, contents from dba_tablespaces;
TABLESPACE_NAME CONTENTS
------------------------------ ---------------------
SYSTEM PERMANENT
SYSAUX PERMANENT
UNDOTBS1 UNDO
TEMP TEMPORARY
USERS PERMANENT
CREATE TABLE创建的数据库默认不带EM EXPRESS.
SQL> select dbms_xdb_config.gethttpsport() from dual;
DBMS_XDB_CONFIG.GETHTTPSPORT()
------------------------------
0
标签:Oracle19C,datafile,app,CREATE,oradata,oracle,CDBDEV,数据库,u01
From: https://www.cnblogs.com/slqleozhang/p/17025939.html