标签云
asm 恢复 asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2662 ORA-600 2663 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)
- 操作系统 (100)
- 数据库 (1,598)
- DB2 (22)
- MySQL (70)
- Oracle (1,463)
- Data Guard (49)
- EXADATA (7)
- GoldenGate (21)
- ORA-xxxxx (158)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (13)
- ORACLE 21C (3)
- Oracle ASM (65)
- Oracle Bug (7)
- Oracle RAC (47)
- Oracle 安全 (6)
- Oracle 开发 (27)
- Oracle 监听 (27)
- Oracle备份恢复 (530)
- Oracle安装升级 (84)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (75)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (36)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (19)
-
最近发表
- PostgreSQL解析wal日志之—walminer
- Oracle 19c/21c最新patch信息-202404
- PostgreSQL恢复系列:pg_filedump批量处理
- PostgreSQL部分主要字典信息
- PostgreSQL恢复系列:pg_filedump恢复字典构造
- PostgreSQL 16 源码安装
- ORA-00742 ORA-00312 恢复
- 数据库open成功后报ORA-00353 ORA-00354错误引起的一系列问题(本质ntfs文件系统异常)
- ORA-600 ktsiseginfo1故障
- ORA-00600: internal error code, arguments: [16703], [1403], [4] 原因
- 最近遇到几起ORA-600 16703故障(tab$被清空),请引起重视
- ORA-600 2662快速恢复之Patch scn工具
- TNS-12518: TNS:listener could not hand off client connection
- ora.storage无法启动报ORA-12514故障处理
- 断电引起文件scn异常数据库恢复
- ORA-16188: LOG_ARCHIVE_CONFIG settings inconsistent with previously started instance
- .[hudsonL@cock.li].mkp勒索加密数据库完美恢复
- 模拟带库实现rman远程备份
- 又一例:ORA-600 kclchkblk_4和2662故障
- Oracle误删除数据文件恢复
标签归档:SEGMENT_TYPE TEMPORARY
type为TEMPORARY,name为file#.block#对象重现和清理
在数据库的使用中你可能注意到了,在某些情况下,可能出现某些segment的type为TEMPORARY,名字为file#.block#的格式的对象.这里我通过试验重现该对象并且给出清理方法
创建表空间/用户
SQL> create tablespace test datafile 2 '/u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf' 3 size 128M autoextend on; Tablespace created. SQL> create user chf identified by oracle; User created. SQL> grant dba to chf; Grant succeeded.
创建模拟对象
本次通过一个index对象经过一些列操作使其变为我们需要的TEMPORARY对象
SQL> conn chf/oracle Connected. SQL> create table t_xifenfei tablespace test 2 as select * from dba_objects; Table created. SQL> create index idx_t_xifenfei on t_xifenfei(object_id) tablespace test; Index created. SQL> select header_file,header_block from DBA_SEGMENTS 2 where segment_name='IDX_T_XIFENFEI' AND OWNER='CHF'; HEADER_FILE HEADER_BLOCK ----------- ------------ 5 267
破坏segment header
这里通过dd 把该block重置为空块,然后rman检查坏块,证明我们处理正常把index的segment header弄成了空块
SQL> select name from v$datafile where file#=5; NAME -------------------------------------------------------------------------------- /u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf SQL> conn / as sysdba Connected. SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. [oracle@xffdbrh5 ~]$ dd if=/dev/zero >of=/u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf >bs=8192 count=1 seek=267 conv=notrunc 1+0 records in 1+0 records out 8192 bytes (8.2 kB) copied, 0.000100548 seconds, 81.5 MB/s [oracle@xffdbrh5 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 21 16:30:56 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 901775360 bytes Fixed Size 2024944 bytes Variable Size 138414608 bytes Database Buffers 759169024 bytes Redo Buffers 2166784 bytes Database mounted. Database opened. [oracle@xffdbrh5 ~]$ rman target / Recovery Manager: Release 10.2.0.1.0 - Production on Mon Dec 21 16:33:00 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. connected to target database: ORA10G (DBID=4205072872) RMAN> backup validate check logical datafile 5; Starting backup at 21-DEC-15 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=144 devtype=DISK channel ORA_DISK_1: starting full datafile backupset channel ORA_DISK_1: specifying datafile(s) in backupset input datafile fno=00005 name=/u01/app/oracle/oracle/product/10.2.0/db_1/oradata/ora10g/test01.dbf channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 21-DEC-15 RMAN> exit Recovery Manager complete. [oracle@xffdbrh5 ~]$ sqlplus / as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on Mon Dec 21 16:33:50 2015 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production With the Partitioning, OLAP and Data Mining options SQL> select * from V$DATABASE_BLOCK_CORRUPTION ; FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO ---------- ---------- ---------- ------------------ --------- 5 267 1 0 ALL ZERO
index segment header异常
index异常后,通过rebuild报ora-08103错误
SQL> alter index chf.idx_t_xifenfei rebuild; alter index chf.idx_t_xifenfei rebuild * ERROR at line 1: ORA-08103: object no longer exists
重现TEMPORARY对象
通过删除index,然后发现了我们久违的TEMPORARY类型的对象出现
SQL> drop index chf.idx_t_xifenfei; Index dropped. SQL> col SEGMENT_NAME for a20 SQL> select segment_name,segment_type from user_segments; SEGMENT_NAME SEGMENT_TYPE -------------------- ------------------ T_XIFENFEI TABLE 5.267 TEMPORARY
清理TEMPORARY对象
SQL> CONN / AS SYSDBA Connected. SQL> exec dbms_space_admin.segment_corrupt('TEST',5,267); PL/SQL procedure successfully completed. SQL> exec dbms_space_admin.segment_drop_corrupt('TEST',5,267); PL/SQL procedure successfully completed. SQL> select segment_name,segment_type from DBA_SEGMENTS WHERE OWNER='CHF'; SEGMENT_NAME SEGMENT_TYPE -------------------- ------------------ T_XIFENFEI TABLE
通过试验证明:当segment header异常,并且删除该对象,就会出现type为TEMPORARY,名字为file#.block#的格式的对象.我们可以通过dbms_space_admin包处理该类异常对象,让他们彻底从数据库中清除掉