Linux下静默创建Oracle数据库实例,CentOS7下静默创建Oracle数据库实例

前提是Oracle静默安装已经成功

1.先在安装/data/app/oracle/product/11.2.0/dbhome_1/assistants/dbca目录下的dbca.rsp文件复制到 /home/oracle(这个文件可以任意指定,建议使用此目录)
Linux下静默创建Oracle数据库实例,CentOS7下静默创建Oracle数据库实例_第1张图片
2.修改配置文件(就是刚刚复制到/home/oracle目录下的dbca.rsp文件)


RESPONSEFILE_VERSION = "11.2.0"  

OPERATION_TYPE = "createDatabase"  


[CREATEDATABASE]

GDBNAME = "dbs"  
SID = "dbs"  

SYSPASSWORD = "1234qwer"  #指定sys用户密码

SYSTEMPASSWORD = "1234qwer" #指定system用户密码

DATAFILEDESTINATION =/home/oracle/11201/dbs #指定数据文件存放的目录

CHARACTERSET = "ZHS16GBK"  #指定字符集

NATIONALCHARACTERSET= "AL16UTF16"  #指定国家字符集

DATABASETYPE = "OLTP"  #指定实例的类型

AUTOMATICMEMORYMANAGEMENT = "TRUE" #指定使用自动内存管理

TOTALMEMORY = "800"  #指定使用内存的大小,单位是MB

===============================================================================

根据以上的信息来找到文件内容,如下,直到找到TOTALMEMORY = "800"就OK了

#-----------------------------------------------------------------------------
# GENERAL section is required for all types of database creations.
#-----------------------------------------------------------------------------
[GENERAL]

#-----------------------------------------------------------------------------
# Name          : RESPONSEFILE_VERSION
# Datatype      : String
# Description   : Version of the database to create
# Valid values  : "11.1.0"
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
RESPONSEFILE_VERSION = "11.2.0"

#-----------------------------------------------------------------------------
# Name          : OPERATION_TYPE
# Datatype      : String
# Description   : Type of operation
# Valid values  : "createDatabase" \ "createTemplateFromDB" \ "createCloneTemplate" \ "deleteDatabase" \ "configureDatabase" \ "addInstance" (RAC-only) \ "deleteInstance" (RAC-only)
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
OPERATION_TYPE = "createDatabase"

#-----------------------*** End of GENERAL section ***------------------------

#-----------------------------------------------------------------------------
# CREATEDATABASE section is used when OPERATION_TYPE is defined as "createDatabase". 
#-----------------------------------------------------------------------------
[CREATEDATABASE]

#-----------------------------------------------------------------------------
# Name          : GDBNAME
# Datatype      : String
# Description   : Global database name of the database
# Valid values  : <db_name>.<db_domain> - when database domain isn't NULL
#                 <db_name>             - when database domain is NULL
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
GDBNAME = "dbs"

#-----------------------------------------------------------------------------
# Name          : CARDINALITY
# Datatype      : Number
# Description   : Specify Cardinality for create server pool operation
# Valid values  : any positive Integer value
# Default value : Number of qualified nodes on cluster
# Mandatory     : No [Required when a new serverpool need to be created]
#-----------------------------------------------------------------------------
#CARDINALITY = 

#-----------------------------------------------------------------------------
# Name          : SID
# Datatype      : String
# Description   : System identifier (SID) of the database
# Valid values  : Check Oracle11g Administrator's Guide
# Default value : <db_name> specified in GDBNAME
# Mandatory     : No
#-----------------------------------------------------------------------------
SID = "dbs"

#-----------------------------------------------------------------------------
# Name          : NODELIST
# Datatype      : String
# Description   : Comma-separated list of cluster nodes
# Valid values  : Cluster node names
# Default value : None
# Mandatory     : No (Yes for RAC database-centric database )
#-----------------------------------------------------------------------------
#NODELIST=

#-----------------------------------------------------------------------------
# Name          : TEMPLATENAME
# Datatype      : String
# Description   : Name of the template
# Valid values  : Template file name
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
# Name          : SYSPASSWORD
# Datatype      : String
# Description   : Password for SYS user
# Valid values  : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
SYSPASSWORD = "1234qwer"

#-----------------------------------------------------------------------------
# Name          : SYSTEMPASSWORD
# Datatype      : String
# Description   : Password for SYSTEM user
# Valid values  : Check Oracle11g Administrator's Guide
# Default value : None
# Mandatory     : Yes
#-----------------------------------------------------------------------------
SYSTEMPASSWORD = "1234qwer"


#-----------------------------------------------------------------------------
# Name          : DATAFILEDESTINATION 
# Datatype      : String
# Description   : Location of the data file's
# Valid values  : Directory for all the database files
# Default value : $ORACLE_BASE/oradata
# Mandatory     : No
#-----------------------------------------------------------------------------
DATAFILEDESTINATION =/home/oracle/11201/dbs


#-----------------------------------------------------------------------------
# Name          : CHARACTERSET
# Datatype      : String
# Description   : Character set of the database
# Valid values  : Check Oracle11g National Language Support Guide
# Default value : "US7ASCII"
# Mandatory     : NO
#-----------------------------------------------------------------------------
CHARACTERSET = "ZHS16GBK"

#-----------------------------------------------------------------------------
# Name          : NATIONALCHARACTERSET
# Datatype      : String
# Description   : National Character set of the database
# Valid values  : "UTF8" or "AL16UTF16". For details, check Oracle11g National Language Support Guide
# Default value : "AL16UTF16"
# Mandatory     : No
#-----------------------------------------------------------------------------
NATIONALCHARACTERSET= "AL16UTF16"

#-----------------------------------------------------------------------------
# Name          : REGISTERWITHDIRSERVICE
# Datatype      : Boolean
# Description   : Specifies whether to register with Directory Service.
# Valid values  : TRUE \ FALSE
# Default value : FALSE
# Mandatory     : No
#-----------------------------------------------------------------------------
#REGISTERWITHDIRSERVICE= TRUE

#-----------------------------------------------------------------------------
# Name          : DATABASETYPE
# Datatype      : String
# Description   : used for memory distribution when MEMORYPERCENTAGE specified
# Valid values  : MULTIPURPOSE|DATA_WAREHOUSING|OLTP
# Default value : MULTIPURPOSE
# Mandatory     : NO
#-----------------------------------------------------------------------------
DATABASETYPE = "OLTP"

#-----------------------------------------------------------------------------
# Name          : AUTOMATICMEMORYMANAGEMENT
# Datatype      : Boolean
# Description   : flag to indicate Automatic Memory Management is used
# Valid values  : TRUE/FALSE
# Default value : TRUE
# Mandatory     : NO
#-----------------------------------------------------------------------------
AUTOMATICMEMORYMANAGEMENT = "TRUE"

#-----------------------------------------------------------------------------
# Name          : TOTALMEMORY
# Datatype      : String
# Description   : total memory in MB to allocate to Oracle
# Valid values  : 
# Default value : 
# Mandatory     : NO
#-----------------------------------------------------------------------------
TOTALMEMORY = "800"


#-----------------------*** End of CREATEDATABASE section ***------------------------

最后执行这命令

dbca -silent -responseFile /home/oracle/dbca.rsp

完成结果如下:

Linux下静默创建Oracle数据库实例,CentOS7下静默创建Oracle数据库实例_第2张图片

你可能感兴趣的:(Linux)