上篇介绍了静默安装数据库软件,下面介绍静默创建数据库的方法。
1. 用DBCA根据种子数据库创建一个模板
(种子数据库就是源数据库,如果没有源数据库,可以用DBCA创建一个新的模版或编辑原有的模版)
2. 将Oracle DB安装盘里面response目录下的dbca.rsp拷贝到本机上
3. 修改dbca.rsp文件,将模板名和DB名添加进去
GDBNAME=
SID=
TEMPLATENAME= //改参数就是你建库的模版,该模版要存放在$ORACLE_HOME/assistants/dbca/templates
如果需要使用Oracle Enterprise Manager,则还需要修改以下参数如下:
EMCONFIGURATION="LOCAL"
SYSMANPASSWORD="password"
DBSNMPPASSWORD="password"
4. 执行以下命令使用DBCA根据模板创建新数据库
$./dbca -silent -createdatabase -responseFile /home/oracle/embed/dbca.rsp
也可以不是用rsp响应文件,直接是用模版静默安装
dbca -silent -createDatabase -templateName oraacc.dbt -gdbName oraacc -sid oraacc /
-sysDBAPassword oracleabcd -characterSet ZHS16GBK -nationalCharacterSet AL16UTF16
ASM:
dbca -silent -nodeList nodelist -configureASM -asmPassword asm_pwd [-diskList
disk_list] [-redundancy redundancy_option] [-diskGroupName dgname] [-diskString
disk_discovery_string] [-recoveryGroupName recovery_dgname] [-recoveryRedundancy
redundancy_option]
相关参数解释:
■ nodelist is a comma-delimited list of nodes and these are the nodes on which
you want to perform the ASM activities
■ asm_pwd is the password for the SYS account in the ASM instance
■ disk_list is a comma-delimited list of disks to be added to disk group
■ redundancy_option is NORMAL, HIGH, or EXTERNAL
■ dgname is either the name of an existing disk group, in which case the disk group
is mounted on all of the selected nodes, or dgname is the name of a new disk
group, in which case the disk group is created and started on all of the selected
nodes
■ disk_recovery_string identifies the location or identifier for the ASM-ready
disks
■ recovery_dgname is the name for a recovery disk group
5. 建议直接写.ora文件配置listener
6. 使用Netca配置listener的方法如下
(1) 将Oracle DB安装盘里面response目录下的netca.rsp拷贝到本机上
(2) 修改netca.rsp文件
INSTALL_TYPE=""custom""
LISTENER_NAMES={"LISTENER_EMBED"}
LISTENER_PROTOCOLS={"TCP;1521"}
LISTENER_START=""LISTENER_EMBED""
(3) 执行以下命令静默配置Listener
$./dbca -silent -responseFile /home/oracle/embed/netca.rsp