数据库管理员的快乐

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[email protected]:/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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
[email protected]:/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:

  • 查看 cfgtoollogs/dbca/ARCHBMS 目录下其他 log,翻看了一堆 log,没有什么发现。

  • 试试 sqlplus 启动空 instance。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
[email protected]:/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.

[email protected]> 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 相关的报错也让人摸不着头脑。

  • 查看 alert log,没有什么特别的信息。

  • 确认没有安装 grid。

  • Google 一下,google 和 metalink 上有几例类似的报错,跟我们这个报错不完全一致,没什么直接的帮助。不过通过搜索知道了真正的问题和报错信息 crs error 可能并没有什么关系。

  • 猜想会不会是空间空间导致一些莫名的问题,看一下系统空间 df -h,没问题。

  • 查看一下系统日志 /var/log/message 和 dmesg,没什么特殊的信息。

  • 尝试 trace 一下 sqlplus,strace -t sqlplus / as sysdba,没有什么发现。

  • 重启 server,没用。

  • 换一个 instance,create initAAA.ora 然后测试 startup nomount,同样报错。

  • 找了另外一台 server xxxx00dbx050, 创建 initAAA.ora 然后测试 startup nomount, 没有报错。

  • 怀疑是不是 db server 有什么问题, 尝试联系一下 INFRA team。

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


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


Comments: