使用DBCA以非互動(靜默)方式建立資料庫
通過執行dbca -h | -help來查看協助選項
[Oracle@jyrac1 ~]$ dbca -help
dbca [-silent | -progressOnly | -customCreate] { } | { [ [options] ] -responseFile } [-continueOnNonFatalErrors ]
Please refer to the manual for details.
You can enter one of the following command:
建立資料庫的參數如下:
Create a database by specifying the following parameters:
-createDatabase
-templateName 現有模板的名稱
[-cloneTemplate]
-gdbName 全域資料庫名
[-policyManaged | -adminManaged ]
[-createServerPool ]
[-force ]
-serverPoolName
-[cardinality ]
[-sid ] 資料庫系統標識符
[-sysPassword ]
[-systemPassword ]
[-emConfiguration
-dbsnmpPassword
-sysmanPassword
[-hostUserName
-hostUserPassword
-backupSchedule ]
[-smtpServer
-emailAddress ]
[-centralAgent ]]
[-disableSecurityConfiguration
[-datafileDestination 所有資料檔案的目標位置 | -datafileNames ]
[-redoLogFileSize ]
[-recoveryAreaDestination ]
[-datafileJarLocation ] 資料檔案 jar 的位置, 只用於複製資料庫的建立
[-storageType < FS | ASM >
[-asmsnmpPassword ]
-diskGroupName
-recoveryGroupName
[-characterSet ] 資料庫的字元集
[-nationalCharacterSet ] 資料庫的國家字元集
[-registerWithDirService
-dirServiceUserName 目錄服務的使用者名稱
-dirServicePassword 目錄服務的口令
-walletPassword ]
[-listeners ] 監聽程式列表, 該列表用於配置具有如下對象的資料庫
[-variablesFile ]] 用於模板中成對變數和值的檔案名稱
[-variables ]
[-initParams ]
[-memoryPercentage ]
[-automaticMemoryManagement ]
[-totalMemory ]
[-databaseType ]]
Configure a database by specifying the following parameters:
-configureDatabase
-sourceDB
[-sysDBAUserName
-sysDBAPassword ]
[-registerWithDirService|-unregisterWithDirService|-regenerateDBPassword
-dirServiceUserName
-dirServicePassword
-walletPassword ]
[-disableSecurityConfiguration
[-enableSecurityConfiguration
[-emConfiguration
-dbsnmpPassword
-symanPassword
[-hostUserName
-hostUserPassword
-backupSchedule ]
[-smtpServer
-emailAddress ]
[-centralAgent ]]
使用現有資料庫建立模板的參數如下:
Create a template from an existing database by specifying the following parameters:
-createTemplateFromDB
-sourceDB ::> < 服務採用 :: 格式
-templateName 新的模板名
-sysDBAUserName 具有SYSDBA許可權的使用者名稱
-sysDBAPassword 具有SYSDBA許可權的使用者名稱的口令
[-maintainFileLocations ]
使用現有資料庫建立複製模板的參數如下:
Create a clone template from an existing database by specifying the following parameters:
-createCloneTemplate
-sourceSID 來源資料庫 sid
-templateName 新的模板名
[-sysDBAUserName 具有SYSDBA許可權的使用者名稱
-sysDBAPassword ] 具有SYSDBA許可權的使用者名稱的口令
[-maintainFileLocations ]
[-datafileJarLocation ] 存放壓縮格式資料檔案的目錄
Generate scripts to create database by specifying the following parameters:
-generateScripts
-templateName
-gdbName
[-scriptDest ]
通過指定以下參數來刪除資料庫
Delete a database by specifying the following parameters:
-deleteDatabase
-sourceDB
[-sysDBAUserName
-sysDBAPassword ]
使用silent模式可以通過資料庫建立模析和通過模板來建立資料庫
通過模板來建立資料庫
[oracle@jyrac1 ~]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbname ora11g -sid ora11g -responseFile NO_VALUE -characterSet AL32UTF8 -memoryPercentage 30 -emConfiguration LOCAL
Enter SYS user password:
Enter SYSTEM user password:
Enter DBSNMP user password:
Enter SYSMAN user password:
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ora11g/ora11g.log" for further details.
[oracle@jyrac1 ~]$ cat /u01/app/oracle/cfgtoollogs/dbca/ora11g/ora11g.log
Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 3%
DBCA_PROGRESS : 11%
DBCA_PROGRESS : 18%
DBCA_PROGRESS : 26%
DBCA_PROGRESS : 37%
Creating and starting Oracle instance
DBCA_PROGRESS : 40%
DBCA_PROGRESS : 45%
DBCA_PROGRESS : 50%
DBCA_PROGRESS : 55%
DBCA_PROGRESS : 56%
DBCA_PROGRESS : 60%
DBCA_PROGRESS : 62%
Completing Database Creation
DBCA_PROGRESS : 66%
DBCA_PROGRESS : 70%
DBCA_PROGRESS : 73%
DBCA_PROGRESS : 85%
DBCA_PROGRESS : 96%
DBCA_PROGRESS : 100%
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/ora11g.
Database Information:
Global Database Name:ora11g
System Identifier(SID):ora11gThe Database Control URL is https://jyrac1:5500/em
Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted. The encryption key has been placed in the file: /u01/app/oracle/11.2.0/db/jyrac1_ora11g/sysman/config/emkey.ora. Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.