12c 應答方式安裝資料庫的一點補充already exists. Specify another SID

dbhelper發表於2015-03-05
今天刪除資料庫時採用了drop database語句,從新安裝時遇到錯誤:“The Oracle system identifier(SID) "cdb" already exists. Specify another SID.”,該錯誤是因為刪除時候沒有清理/etc/oratab檔案,該檔案中記錄了之前資料庫的啟動資訊。
手工清理這行資訊問題解決,下面還原操作過程

刪除可插拔資料庫
SYS@cdb > shutdown immediate;

SYS@cdb > startup mount restrict;

SYS@cdb > drop database;

重新建立可插拔資料庫
[oracle@snow response]$ dbca -silent -createDatabase -responseFile /home/oracle/orainst/12.1.0.1/database/response/cdb_pdb.rsp
Enter SYS user password:

Enter SYSTEM user password:

Enter PDBADMIN User Password:

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb.log" for further details.

檢視錯誤日誌提示沒刪除“乾淨”
[oracle@snow response]$ more /u01/app/oracle/cfgtoollogs/dbca/cdb.log

The Oracle system identifier(SID) "cdb" already exists. Specify another SID.

/ has enough space. Required space is 8260 MB , available space is 25210 MB.
File Validations Successful.


問題出現在/etc/oratab檔案中,看看裡面的內容還包含之前資料庫例項的啟動資訊。手動將其清除,再次嘗試安裝。
$ cat /etc/oratab |grep cdb
cdb:/u01/app/oracle/product/12.1.0.1/db_1:N

$ cat /etc/oratab | grep cdb
# cdb:/u01/app/oracle/product/12.1.0.1/db_1:N <==註釋掉

清除上述問題後重試成功
[oracle@snow response]$ dbca -silent -createDatabase -responseFile /home/oracle/orainst/12.1.0.1/database/response/cdb_pdb.rsp
Enter SYS user password:

Enter SYSTEM user password:

Enter PDBADMIN User Password:

Copying database files
1% complete
2% complete
8% complete
13% complete
19% complete
24% complete
27% complete
Creating and starting Oracle instance
29% complete
32% complete
33% complete
34% complete
38% complete
42% complete
43% complete
45% complete
Completing Database Creation
48% complete
51% complete
53% complete
62% complete
70% complete
72% complete
Creating Pluggable Databases
78% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb/cdb11.log" for further details.

[oracle@snow response]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.1.0 Production on Mon Mar 2 17:33:40 2015

Copyright (c) 1982, 2013, Oracle. All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SYS@cdb > show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO

全文完

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8494287/viewspace-1448853/,如需轉載,請註明出處,否則將追究法律責任。

相關文章