本文记录如何静默创建数据库,可以使用静默文件可以选择无响应文件安装
1 编辑创建数据库的响应文件:
dbca.rsp
ESPONSEFILE_VERSION = "10.0.0"
OPERATION_TYPE = "createDatabase"
GDBNAME = "kbbi.RAC"
SID = "kbbi"
TEMPLATENAME = "kbbi.dbt"
SYSPASSWORD = "kbbi123"
SYSTEMPASSWORD = "kbbi123"
DATAFILEDESTINATION ="/opt/app/oracle/oradata"
RECOVERYAREADESTINATION="/opt/app/oracle/flash_recovery_area"
STORAGETYPE=FS
CHARACTERSET = "ZHS16GBK"
DATABASETYPE = "OLTP"
MEMORYPERCENTAGE = "40"
SCRIPTDESTINATION ="/opt/app/oracle/admin/kbbi/scripts"
EMCONFIGURATION="LOCAL"
2 也可以执行如下命令直接不使用响应文件来创建数据库:
oracle@RAC:/home/oracle/10201_database>dbca -silent -createDatabase \
> -templateName /home/oracle/10201_database/New_Database.dbt \ --这个是必须指定的创建数据库的模板。
> -gdbName kbbi \
> -sid kbbi \
> -sysPassword system123 \
> -systempassword system123 \
> -datafileDestination /opt/app/oracle/oradata \
> -storageType FS \
> -characterSet zhs16gbk \
> -memoryPercentage 60 \
> -recoveryAreaDestination /opt/app/oracle/flash_recovery_area \
> -databaseType MULTIPURPOSE
Creating and starting Oracle instance
1% complete
4% complete
Creating database files
8% complete
Creating data dictionary views
9% complete
10% complete
12% complete
13% complete
14% complete
15% complete
17% complete
18% complete
20% complete
21% complete
Adding Oracle JVM
22% complete
28% complete
34% complete
40% complete
42% complete
Adding Oracle Data Mining
43% complete
44% complete
46% complete
Adding Oracle Text
47% complete
49% complete
50% complete
Adding Oracle XML DB
52% complete
53% complete
54% complete
58% complete
Adding Oracle Intermedia
59% complete
60% complete
71% complete
Adding Oracle OLAP
72% complete
73% complete
74% complete
75% complete
Adding Oracle Spatial
76% complete
77% complete
78% complete
83% complete
Adding Enterprise Manager Repository
84% complete
86% complete
88% complete
Completing Database Creation
89% complete
90% complete
91% complete
95% complete
99% complete
100% complete
Look at the log file "/opt/app/oracle/10.2/db/cfgtoollogs/dbca/kbbi/kbbi.log" for further details.
进行登录测试:
oracle@RAC:/home/oracle/10201_database>sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Nov 7 23:01:44 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL>
SQL>
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options