1)静默删除数据库
[oracle@db1 database]$ dbca -h
dbca [-silent | -progressOnly | -customCreate] { } | { [ [options] ] -responseFile } [-continueOnNonFatalErrors ]
Please refer to the manual for details.
You can enter one of the following command:
Delete a database by specifying the following parameters:
-deleteDatabase
-sourceDB
[-sid ]
[-sysDBAUserName with SYSDBA privileges>
-sysDBAPassword ]
1.1准备response file
[root@db1 database]# vi dbca_deldb.rsp
[DELETEDATABASE]
SOURCEDB = "racdb"
SYSDBAUSERNAME = "sys"
SYSDBAPASSWORD = "oracle"
1.2执行dbca,静默删除数据库
[oracle@db1 database]$ dbca -silent -responseFile dbca_deldb.rsp
No command specified to perform. Please specify one of following commands:
createDatabase, createTemplateFromDB or createCloneTemplate
**如果responsefile配置如下:
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "deleteDatabase"
[DELETEDATABASE]
SOURCEDB = "racdb"
SYSDBAUSERNAME = "sys"
SYSDBAPASSWORD = "oracle"
应该可以成功执行!
[oracle@db1 database]$ dbca -silent -deleteDatabase -responseFile dbca_deldb.rsp
Connecting to database
9% complete
14% complete
19% complete
23% complete
28% complete
33% complete
38% complete
47% complete
Updating network configuration files
48% complete
52% complete
Deleting instances and datafiles
66% complete
80% complete
95% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/racdb.log" for further details.
[oracle@db1 database]$
2)静默创建数据库
[oracle@db2 ~]$ dbca -h
dbca [-silent | -progressOnly | -customCreate] { } | { [ [options] ] -responseFile } [-continueOnNonFatalErrors ]
Please refer to the manual for details.
2.1)准备response file
[oracle@db1 database]$ cat dbca_createdb.rsp
[GENERAL]
RESPONSEFILE_VERSION = "11.2.0"
OPERATION_TYPE = "createDatabase"
[CREATEDATABASE]
GDBNAME = "racdb"
RACONENODE = "false"
POLICYMANAGED = "false"
SID = "racdb"
NODELIST = "db1,db2" #注意格式,双引号中用逗号隔开;
TEMPLATENAME = "General_Purpose.dbc"
SYSPASSWORD = "oracle"
SYSTEMPASSWORD = "oracle"
SYSMANPASSWORD = "oracle"
DATAFILEDESTINATION = "+DATA"
RECOVERYAREADESTINATION = "+DATA"
STORAGETYPE="ASM"
DISKGROUPNAME = "DATA"
RECOVERYGROUPNAME = "DATA"
CHARACTERSET = "ZHS16GBK"
NATIONALCHARACTERSET = "AL16UTF16"
LISTENERS = "LISTENER LISTENER_SCAN1"
MEMORYPERCENTAGE = "50"
DATABASETYPE = "MULTIPURPOSE"
AUTOMATICMEMORYMANAGEMENT = "TRUE"
TOTALMEMORY = "800" #单位:MB
2.2执行dbca,静默创建数据库
[oracle@db1 database]$ dbca -silent -responseFile dbca_createdb.rsp
Copying database files
1% complete
3% complete
9% complete
15% complete
21% complete
27% complete
30% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
44% complete
45% complete
48% complete
50% complete
Creating cluster database views
52% complete
70% complete
Completing Database Creation
73% complete
76% complete
85% complete
94% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/racdb/racdb.log" for further details.
[oracle@db1 database]$
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/16976507/viewspace-1249935/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/16976507/viewspace-1249935/