标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-00742 ORA-01110 ORA-01555 ORA-01578 ORA-01595 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (103)
- 数据库 (1,762)
- DB2 (22)
- MySQL (76)
- Oracle (1,604)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (24)
- ORA-xxxxx (166)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (15)
- ORACLE 21C (3)
- Oracle 23ai (8)
- Oracle ASM (69)
- Oracle Bug (8)
- Oracle RAC (54)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (588)
- Oracle安装升级 (97)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (85)
- PostgreSQL (30)
- pdu工具 (6)
- PostgreSQL恢复 (9)
- SQL Server (32)
- SQL Server恢复 (13)
- TimesTen (7)
- 达梦数据库 (3)
- 达梦恢复 (1)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (39)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (22)
-
最近发表
- 解决一次硬件恢复之后数据文件0kb的故障恢复case
- Error in invoking target ‘libasmclntsh19.ohso libasmperl19.ohso client_sharedlib’问题处理
- ORA-01171: datafile N going offline due to error advancing checkpoint
- linux环境oracle数据库被文件系统勒索加密为.babyk扩展名溯源
- ORA-600 ksvworkmsgalloc: bad reaper
- ORA-600 krccfl_chunk故障处理
- Oracle Recovery Tools恢复案例总结—202505
- ORA-600 kddummy_blkchk 数据库循环重启
- 记录一次asm disk加入到vg通过恢复直接open库的案例
- CHECKDB 发现了 N 个分配错误和 M 个一致性错误
- 达梦数据库dm.ctl文件异常恢复
- Oracle Recovery Tools修复ORA-00742、ORA-600 ktbair2: illegal inheritance故障
- 可能是 tempdb 空间用尽或某个系统表不一致故障处理
- 11.2.0.4库中遇到ORA-600 kcratr_nab_less_than_odr报错
- [MY-013183] [InnoDB] Assertion failure故障处理
- Oracle 19c 202504补丁(RUs+OJVM)-19.27
- Oracle Recovery Tools修复ORA-600 6101/kdxlin:psno out of range故障
- pdu完美支持金仓数据库恢复(KingbaseES)
- 虚拟机故障引起ORA-00310 ORA-00334故障处理
- pg创建gbk字符集库
分类目录归档:数据库
pg启动报invalid checkpoint record处理
pg库启动报PANIC: could not locate a valid checkpoint record错误
2025-03-09 10:59:10.365 EDT [73013] LOG: starting PostgreSQL 16.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit 2025-03-09 10:59:10.365 EDT [73013] LOG: listening on IPv4 address "0.0.0.0", port 5432 2025-03-09 10:59:10.365 EDT [73013] LOG: listening on IPv6 address "::", port 5432 2025-03-09 10:59:10.367 EDT [73013] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2025-03-09 10:59:10.401 EDT [73018] LOG: database system was interrupted; last known up at 2025-03-09 10:54:43 EDT 2025-03-09 10:59:11.506 EDT [73018] LOG: invalid checkpoint record 2025-03-09 10:59:11.508 EDT [73018] PANIC: could not locate a valid checkpoint record 2025-03-09 10:59:12.004 EDT [73013] LOG: startup process (PID 73018) was terminated by signal 6: Aborted 2025-03-09 10:59:12.004 EDT [73013] LOG: aborting startup due to startup process failure 2025-03-09 10:59:12.006 EDT [73013] LOG: database system is shut down
从报错信息中看,是有无法读取到有效的checkpoint记录导致,初步怀疑是wal异常,检查pg_wal目录,发现wal日志为空
[root@localhost pg_wal]# ls -ltr total 16388 drwx------ 2 postgres postgres 6 Mar 6 08:10 archive_status [root@localhost pg_wal]#
进一步检查系统操作命令rm删除wal日志命令
cd pg_wal rm -rf 0000000*
初步确认是由于wal日志被意外删除导致pg库无法启动,尝试重置wal,由于库不是干净关闭,无法直接重置成功
[postgres@localhost log]$ pg_resetwal $PGDATA The database server was not shut down cleanly. Resetting the write-ahead log might cause data to be lost. If you want to proceed anyway, use -f to force reset.
使用pg_resetwal -f强制重置
[postgres@localhost log]$ pg_resetwal -f $PGDATA Write-ahead log reset
尝试启动pg库成功
[postgres@localhost log]$ pg_ctl start waiting for server to start....2025-03-09 11:02:02.609 EDT [73088] LOG: redirecting log output to logging collector process 2025-03-09 11:02:02.609 EDT [73088] HINT: Future log output will appear in directory "log". done server started
2025-03-09 11:02:02.609 EDT [73088] LOG: starting PostgreSQL 16.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.3.1 20191121 (Red Hat 8.3.1-5), 64-bit 2025-03-09 11:02:02.609 EDT [73088] LOG: listening on IPv4 address "0.0.0.0", port 5432 2025-03-09 11:02:02.609 EDT [73088] LOG: listening on IPv6 address "::", port 5432 2025-03-09 11:02:02.610 EDT [73088] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432" 2025-03-09 11:02:02.645 EDT [73092] LOG: database system was shut down at 2025-03-09 11:01:53 EDT 2025-03-09 11:02:02.650 EDT [73088] LOG: database system is ready to accept connections
删除redo导致ORA-00313 ORA-00312故障处理
有客户由于误操作直接rm 删除了redo文件,导致数据库启动报ORA-00313 ORA-00312错
2025-03-07T14:49:16.325723+08:00 ALTER DATABASE OPEN 2025-03-07T14:50:00.124620+08:00 Ping without log force is disabled: instance mounted in exclusive mode. 2025-03-07T14:50:00.198907+08:00 Crash Recovery excluding pdb 2 which was cleanly closed. 2025-03-07T14:50:00.238450+08:00 Beginning crash recovery of 1 threads parallel recovery started with 15 processes Thread 1: Recovery starting at checkpoint rba (logseq 2966 block 74686), scn 0 2025-03-07T14:50:00.325246+08:00 Started redo scan 2025-03-07T14:50:00.341193+08:00 Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2681.trc: ORA-00313: open failed for members of log group 2 of thread 1 ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 2025-03-07T14:50:00.372632+08:00 Slave encountered ORA-10388 exception during crash recovery ………… 2025-03-07T14:50:00.385698+08:00 Slave encountered ORA-10388 exception during crash recovery 2025-03-07T14:50:00.388594+08:00 Aborting crash recovery due to error 313 2025-03-07T14:50:00.388739+08:00 Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2681.trc: ORA-00313: open failed for members of log group 2 of thread 1 ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 2025-03-07T14:50:00.389243+08:00 Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_2681.trc: ORA-00313: open failed for members of log group 2 of thread 1 ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log' ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 ORA-313 signalled during: ALTER DATABASE OPEN...
然后客户把历史的redo文件拷贝过来,尝试恢复数据库,报ORA-00314 ORA-00312错误
2025-03-07T15:07:30.784759+08:00 ALTER DATABASE OPEN Ping without log force is disabled: instance mounted in exclusive mode. 2025-03-07T15:07:30.808497+08:00 Crash Recovery excluding pdb 2 which was cleanly closed. 2025-03-07T15:07:30.838664+08:00 Beginning crash recovery of 1 threads parallel recovery started with 15 processes Thread 1: Recovery starting at checkpoint rba (logseq 2966 block 74686), scn 0 2025-03-07T15:07:30.897547+08:00 Started redo scan 2025-03-07T15:07:30.898222+08:00 Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_4106.trc: ORA-00314: log 2 of thread 1, expected sequence# 2966 doesn't match 1646 ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log' 2025-03-07T15:07:30.930089+08:00 Slave encountered ORA-10388 exception during crash recovery ………… 2025-03-07T15:07:30.940051+08:00 Slave encountered ORA-10388 exception during crash recovery 2025-03-07T15:07:30.942274+08:00 Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_mz00_4138.trc: ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/orcl/redo01.log' 2025-03-07T15:07:30.945509+08:00 Slave encountered ORA-10388 exception during crash recovery 2025-03-07T15:07:30.945512+08:00 Slave encountered ORA-10388 exception during crash recovery 2025-03-07T15:07:30.948369+08:00 Aborting crash recovery due to error 314 2025-03-07T15:07:30.948488+08:00 Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_4106.trc: ORA-00314: log 2 of thread 1, expected sequence# 2966 doesn't match 1646 ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log' 2025-03-07T15:07:30.949390+08:00 Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_4106.trc: ORA-00314: log 2 of thread 1, expected sequence# 2966 doesn't match 1646 ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log' ORA-314 signalled during: ALTER DATABASE OPEN...
使用Oracle数据库异常恢复检查脚本(Oracle Database Recovery Check)脚本收集信息之后数据文件头状态和所需要redo信息
数据库需要sequence#为2966的redo日志,但是当前已经被删除,基于当前情况,只能进行强制非一致性恢复,尝试强制打开库
SQL> recover database; ORA-00283: recovery session canceled due to errors ORA-00314: log 2 of thread 1, expected sequence# 2966 doesn't match 1646 ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/orcl/redo02.log' QL> select group#,status,sequence# from v$log; GROUP# STATUS SEQUENCE# ---------------- ---------------- ---------------- 1 UNUSED 0 3 CURRENT 2967 2 ACTIVE 2966 SQL> SQL> SQL> recover database until cancel; ORA-00279: change 163033183 generated at 03/07/2025 14:04:20 needed for thread 1 ORA-00289: suggestion : /u01/app/oracle/recovery_area/orcl/archivelog/2025_03_08/o1_mf_1_2966_%u_.arc ORA-00280: change 163033183 for thread 1 is in sequence #2966 Specify log: {<RET>=suggested | filename | AUTO | CANCEL} cancel 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: '/u01/app/oracle/oradata/orcl/system01.dbf' ORA-01112: media recovery not started SQL> alter database open resetlogs; Database altered.
运气不错,直接打开数据库成功,然后逻辑导出数据,完成此处恢复.这个让我想起来了一些类似案例:
Oracle 23ai rm redo*.log恢复
清空redo,导致ORA-27048: skgfifi: file header information is invalid
由于默认情况下oracle的redo文件扩展名是.log,然后被当做是不重要文件从而被清理导致数据库故障,在oracle服务器上清理数据之前建议查询v$datafile,v$logfile,v$tempfile,v$controlfile来确认是否是数据库文件
Navicat连接postgresql时出现column “datlastsysoid” does not exist错误解决
使用Navicat Premium 15访问PostgreSQL 16版本的库,报如下错误
ERROR: column "datlastsysoid" does not exist LINE 1: SELECT DISTINCT datlastsysoid FROM pg_database;
登录pg库查看
postgres=# SELECT DISTINCT datlastsysoid FROM pg_database; 2025-03-07 22:09:03.569 EST [62553] ERROR: column "datlastsysoid" does not exist at character 17 2025-03-07 22:09:03.569 EST [62553] STATEMENT: SELECT DISTINCT datlastsysoid FROM pg_database; ERROR: column "datlastsysoid" does not exist LINE 1: SELECT DISTINCT datlastsysoid FROM pg_database; ^ postgres=# \d pg_database; Table "pg_catalog.pg_database" Column | Type | Collation | Nullable | Default ----------------+-----------+-----------+----------+--------- oid | oid | | not null | datname | name | | not null | datdba | oid | | not null | encoding | integer | | not null | datlocprovider | "char" | | not null | datistemplate | boolean | | not null | datallowconn | boolean | | not null | datconnlimit | integer | | not null | datfrozenxid | xid | | not null | datminmxid | xid | | not null | dattablespace | oid | | not null | datcollate | text | C | not null | datctype | text | C | not null | daticulocale | text | C | | daticurules | text | C | | datcollversion | text | C | | datacl | aclitem[] | | | Indexes: "pg_database_oid_index" PRIMARY KEY, btree (oid), tablespace "pg_global" "pg_database_datname_index" UNIQUE CONSTRAINT, btree (datname), tablespace "pg_global" Tablespace: "pg_global"
确认没有了datlastsysoid列,通过查看文档确认从Postgres 15版本开始 pg_database表中删除了 datlastsysoid,但是可以通过查询dattablespace替代,使用二进制工具修改libcc.dll文件中的SELECT DISTINCT datlastsysoid部分语句为:SELECT DISTINCT dattablespace
然后重新启动Navicat,访问pg库正常

当然这个问题如果使用高版本的Navicat或者访问低版本的PostgreSQL库不会出现