dbca $ORACLE_HOME/assistants/dbca/templates
needs a template file to create a database. These template can be found in
.
We will use here the default New_Database.dbt template file to create a container database named
UXOCDB
with one PDB on ASM storage with DATA and FRA diskgroups.
DBCA will install all database components when it is created as container database.
# Execute dbca with ASM option
[oracle]$ dbca -silent \
-createDatabase \
-templateName New_Database.dbt \
-gdbName UXOCDB \
-sid UXOCDB \
-SysPassword orasyspw \
-SystemPassword orasystempw \
-createAsContainerDatabase
true
\
-numberofPDBs 1 \
-pdbName UXOPDB \
-pdbAdminPassword orapdbadmpw \
-emConfiguration none \
-redoLogFileSize 100 \
-recoveryAreaDestination FRA \
-storageType ASM \
-asmsnmpPassword asmsnmppw \
-diskGroupName DATA \
-recoveryGroupName FRA \
-listeners LISTENER \
-registerWithDirService
false
\
-characterSet AL32UTF8 \
-nationalCharacterSet AL16UTF16 \
-databaseType MULTIPURPOSE \
-automaticMemoryManagement
true
\
-totalMemory 2048 \
-sampleSchema
true
\
-initparams audit_file_dest='
/u01/app/oracle/admin/UXOCDB/adump
' \
-initparams compatible='12.1.0' \
-initparams db_create_file_dest='+DATA' \
-initparams db_create_online_log_dest_1='+DATA' \
-initparams db_create_online_log_dest_2='+FRA' \
-initparams db_recovery_file_dest='+FRA' \
-initparams diagnostic_dest='
/u01/app/oracle
' \
-initparams parallel_max_servers=8 \
-initparams processes=400
Cleaning up failed steps
1% complete
Registering database with Oracle Restart
3% complete
Creating and starting Oracle instance
4% complete
6% complete
Creating database files
9% complete
Creating data dictionary views
10% complete
12% complete
14% complete
15% complete
16% complete
18% complete
Adding Oracle JVM
23% complete
28% complete
32% complete
34% complete
Adding Oracle Text
36% complete
37% complete
Adding Oracle Multimedia
38% complete
46% complete
Adding Oracle OLAP
50% complete
Adding Oracle Spatial
56% complete
Adding Oracle Label Security
62% complete
Adding Oracle Application Express
65% complete
68% complete
Adding Oracle Database Vault
75% complete
Creating cluster database views
81% complete
Completing Database Creation
82% complete
83% complete
84% complete
86% complete
89% complete
90% complete
Creating Pluggable Databases
92% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/UXOCDB/UXOCDB1.log" for further
##碰到一個問題,dbca -slient 不指定 LISTENERS ,結果出現一個問題,dbca 将listener.ora 的資訊 注冊到 tnsnames.ora
sample:
[Thread-20] [ 2017-03-20 17:17:09.681 GMT+08:00 ] [NetworkUtils.addTNSEntry:4582] addTNSEntry:name=centrprod
[Thread-20] [ 2017-03-20 17:17:09.682 GMT+08:00 ] [NetworkUtils.addTNSEntry:4583] addTNSEntry:addr=(ADDRESS=(PROTOCOL=TCP)(HOST=db)(PORT=15023))
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.4.123)(PORT=15021))
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.4.30)(PORT=15011))
在/etc/tnsnames.ora 顯示如下:
LISTENER_db=
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.4.123)(PORT = 15021))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.4.30)(PORT = 15011))
fixed:
1.在listener.ora 檔案 找到正确的listener.ora 如listener1
dbca -slient LISTENERS = listener1
2.template 參數說明
Examples on Silent operations of NETCA and DBCA in Oracle 12c
#-----------------------------------------------------------------------------
# Name : LISTENERS
# Datatype : String
# Description : Specifies list of listeners to register the database with.
# By default the database is configured for all the listeners specified in the
# $ORACLE_HOME/network/admin/listener.ora
# Valid values : The list should be comma separated like "listener1,listener2".
# Mandatory : NO
#-----------------------------------------------------------------------------
#LISTENERS = "listener1,listener2"
oracle@solaris112:~$ find $ORACLE_HOME -name *.rsp
/u01/app/oracle/product/12.1.0/dbhome_1/inventory/response/db_install.rsp
/u01/app/oracle/product/12.1.0/dbhome_1/inventory/response/oracle.server_EE.rsp
/u01/app/oracle/product/12.1.0/dbhome_1/assistants/netca/netca.rsp
/u01/app/oracle/product/12.1.0/dbhome_1/assistants/netca/netca_custom.rsp
/u01/app/oracle/product/12.1.0/dbhome_1/assistants/dbca/dbca.rsp
/u01/app/oracle/product/12.1.0/dbhome_1/network/install/netca_typ.rsp
/u01/app/oracle/product/12.1.0/dbhome_1/network/install/netca_clt.rsp
oracle@solaris112:~$ cat /u01/app/oracle/product/12.1.0/dbhome_1/assistants/netca/netca.rsp|grep -v ^$|grep -v ^#
[GENERAL]
RESPONSEFILE_VERSION="12.1"
CREATE_TYPE="CUSTOM"
[oracle.net.ca]
INSTALLED_COMPONENTS={"server","net8","javavm"}
INSTALL_TYPE=""typical""
LISTENER_NUMBER=1
LISTENER_NAMES={"LISTENER"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER""
NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"}
NSN_NUMBER=1
NSN_NAMES={"EXTPROC_CONNECTION_DATA"}
NSN_SERVICE={"PLSExtProc"}
NSN_PROTOCOLS={"TCP;HOSTNAME;1521"}
oracle@solaris112:~$ netca -silent -responsefile /u01/app/oracle/product/12.1.0/dbhome_1/assistants/netca/netca.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /u01/app/oracle/product/12.1.0/dbhome_1/assistants/netca/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Profile configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Listener configuration complete.
Oracle Net Services configuration successful. The exit code is 0
炊煙起了;夕陽下了;細雨來了
多調試,互動式程式設計體驗
記錄,獨立思考,對比
感謝轉載作者
修車
國産化
read and connect
匍匐前進,
講故事