Huaiyao Jin

Huaiyao Jin

数据库管理员的快乐

前几天需要用dbca新建个空数据库,但是报错。

xxxx00dbx051@oracle:/oradata/archdb>dbca -silent \
> -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbName ARCHBMS \
> -sid ARCHBMS \
> -SysPassword xxxx \
> -SystemPassword xxxx \
> -emConfiguration NONE \
> -redoLogFileSize 1000 \
> -storageType FS \
> -datafileDestination "/oradata/archdb" \
> -characterSet AL32UTF8 \
> -nationalCharacterSet AL16UTF16 \
> -totalMemory 50000
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
   CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
   CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
   ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Copying database files
1% complete
2% complete
3% complete
DBCA Operation failed.
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ARCHBMS/ARCHBMS.log" for further details.

看一下 log:

xxxx00dbx051@oracle:/oradata/archdb>more "/opt/oracle/cfgtoollogs/dbca/ARCHBMS/ARCHBMS.log"
[ 2021-03-02 02:38:57.542 UTC ] Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 2%
[ 2021-03-02 02:38:58.955 UTC ] ORA-39510: CRS error performing start on instance 'ARCHBMS' on 'ARCHBMS'

[ 2021-03-02 02:38:58.955 UTC ] ORA-39510: CRS error performing start on instance 'ARCHBMS' on 'ARCHBMS'

DBCA_PROGRESS : 3%
[ 2021-03-02 02:38:58.957 UTC ] ORA-01034: ORACLE not available

[ 2021-03-02 02:38:58.958 UTC ] ORA-01034: ORACLE not available

[ 2021-03-02 02:39:04.262 UTC ] DBCA_PROGRESS : DBCA Operation failed.

从原点出发,报错信息 “CRS error performing start on instance”,这个报错让人很奇怪,印象中这个 db server 并没有装 oracle grid,为什么会报 crs error 呢?

接下来就是一顿troubleshooting:

xxxx00dbx051@oracle:/opt/oracle/database/12cR201/dbs>si

SQL*Plus: Release 12.2.0.1.0 Production on Tue Mar 2 02:55:43 2021
Copyright (c) 1982, 2016, Oracle.  All rights reserved.

Connected to an idle instance.

SYS@ECOMBMS> startup nomount;
ORA-39510: CRS error performing start on instance 'ECOMBMS' on 'ECOMBMS'
clsr_start_resource:260 status:254
clsrapi_start_db:start_asmdbs status:254
ORA-39510: CRS error performing start on instance 'ECOMBMS' on 'ECOMBMS'
clsr_start_resource2:500 clscrs_crsentitylist_first error clscrsret:11
clsr_start_resource2:900 exit status:254
clsr_start_resource:260 status:254
clsrapi_start_db:start_asmdbs status:254

同样报错,看来不是 dbca 的问题。回忆一下上礼拜还是可以用 sqlplus 的,唯一的变化似乎就是上周 server 响应很慢,有一堆 grep 进程占用大量 cpu,因为是测试环境,直接重启 server了。另外,sqlplus 比 dbca 多一些的 clsr_start_resource 相关的报错也让人摸不着头脑。

到这里就穷途末路了。研究了一个多小时了,感觉很疲惫,休息一下,和同事聊了一会儿,他随口说了一句,实在不行就重装 rdbms。柳暗花明,换个角度,直接绕开已有报错,不用重装,新装 /opt/oracle/database/12cR201_new,这次 dbca 不再报错,先去完成任务。

DBA 工作和其他工作一样也有很多琐事、重复的事,做着做着可能就麻木了,但是偶尔有一次需要绞尽脑汁地寻求解决问题的方法并且最后解决了问题,就会让人感到由衷的快乐,这些断断续续的快乐就能支持我们再前行一会儿、再精进一点。