12c 应答方式安装数据库的一点补充already exists. Specify another SID

来源:互联网 发布:云物流软件 编辑:程序博客网 时间:2024/06/14 11:19
今天删除数据库时采用了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

全文完
0 0
原创粉丝点击