赞
踩
这个…不知道是镜像问题还是配置上有问题,Docker版的Oracle 11g在上次部署完之后已经出现了多次无法访问的情况(就是 registry.cn-hangzhou.aliyuncs.com/helowin/oracle_11g这个镜像),最后一次修复已经将连接数从150(默认)提升到8000,这次无法访问肯定不是连接数已满的问题。
遇事不要慌,先通过docker exec进入容器内部连接一下oracle数据库,看到的是
ORA-01034: ORACLE not available
这…难道是之前为了修改连接数直接关机导致日志无法归档么?
上网查了些资料,最终通过如下步骤解决的:
[oracle@e156e1b777f5 -]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 14 13:36:28 2021
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SQL> select * from v$log;
select × from v$log
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL> alter database open resetlogs;
alter database open resetlogs
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: O
Session ID: 0 Serial number: 0
要注意,这里使用resetlogs方式打开数据库对oracle进行恢复是存在风险的,如果日志文件没有损坏的情况下可以直接恢复就可以了,这次的情况比较麻烦,所以才想用这种方式进行。
SQL> shutdown immediate;
ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist
Linux-x86 64 Error: 2: No such file or directory
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1603411968 bytes
Fixed Size 2213776 bytes
Variable Size 1342179440 bytes
Database Buffers 251658240 bytes
Redo Buffers 7360512 bytes
Database mounted.
SQL> alter database open resetlogs;
alter database open resetlogs
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
这里又是一个ERROR,先不要管它继续下一步操作
如上图所示,通过v$log得知日志只记录到昨天(11月13日),还好不是生产环境的一天的时间还能够接受。
SQL> recover database until time '2021-11-13 00:00:00'
ORA-10879: error signaled in parallel recovery slave
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '/home/oracle/app/oracle/oradata/helowin/systeml.dbf'
嗯…没有头绪还是先“重启”吧
SOL> shutdown; ORA-01109: database not open Database dismounted. ORACLE instance shut down. SOL> startup ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1342179440 bytes Database Buffers 251658240 bytes Redo Buffers 7360512 bytes Database mounted. ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
这次连启动也报错,真是“一波未平一波又起”。
既然这样就手动redo一次吧。
执行完了之后再open resetlogs就可以了
SQL> alter database open resetlogs;
Database altered.
为了使操作完全生效决定重启了一下oracle
SQL> shutdown immedate; SP2-0717: illegal SHUTDOWN option SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SOL> startup; ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1342179440 bytes Database Buffers 251658240 bytes Redo Buffers 7360512 bytes Database mounted. Database opened.
这样就搞定了。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。