11gr2 RAC靜默刪除、建立資料庫

panpong發表於2014-08-12

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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章