|
制造逻辑坏块的办法:
- SQL> conn / as sysdba
- Connected.
- SQL> create tablespace tbslogical datafile size 5M nologging;
- Tablespace created.
- SQL> conn hr/oracle_4U
- Connected.
- SQL> create table tlogical ( a number , b varchar2(20)) tablespace tbslogical;
- Table created.
- SQL> insert into tlogical values (123456,'ABCDEF') ;
- 1 row created.
- SQL> commit;
- Commit complete.
- SQL> select a, b , rowid, dbms_rowid.rowid_block_number(rowid) from tlogical;
- A B ROWID
- ---------- -------------------- ------------------
- DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
- ------------------------------------
- 123456 ABCDEF AAATyeAAGAAAACEAAA
- 132
- SQL> insert into tlogical select * from tlogical;
- 1 row created.
- SQL> commit;
- Commit complete.
- SQL> select a, b , rowid, dbms_rowid.rowid_block_number(rowid) from tlogical;
- A B ROWID
- ---------- -------------------- ------------------
- DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
- ------------------------------------
- 123456 ABCDEF AAATyeAAGAAAACEAAA
- 132
- 123456 ABCDEF AAATyeAAGAAAACEAAB
- 132
- SQL> insert /*+ append */ into tlogical select * from tlogical;
- 2 rows created.
- SQL> commit;
- Commit complete.
- SQL> select a, b , rowid, dbms_rowid.rowid_block_number(rowid) from tlogical;
- A B ROWID
- ---------- -------------------- ------------------
- DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
- ------------------------------------
- 123456 ABCDEF AAATyeAAGAAAACEAAA
- 132
- 123456 ABCDEF AAATyeAAGAAAACEAAB
- 132
- 123456 ABCDEF AAATyeAAGAAAACIAAA
- 136
- A B ROWID
- ---------- -------------------- ------------------
- DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
- ------------------------------------
- 123456 ABCDEF AAATyeAAGAAAACIAAB
- 136
- SQL>
复制代码 以上说明,直接路径加载在高水位线之后:
- select * from dba_extents e where e.owner='HR'
- and e.segment_name='TLOGICAL';
复制代码 | OWNER | SEGMENT_NAME | PARTITION_NAME | SEGMENT_TYPE | TABLESPACE_NAME | EXTENT_ID | FILE_ID | BLOCK_ID | BYTES | BLOCKS | RELATIVE_FNO | 1 | HR | TLOGICAL | | TABLE | TBSLOGICAL | 0 | 6 | 128 | 65536 | 8 | 6 | 2 | HR | TLOGICAL | | TABLE | TBSLOGICAL | 1 | 6 | 136 | 65536 | 8 | 6 |
- SQL> conn / as sysdba
- Connected.
- SQL> alter tablespace tbslogical offline immediate;
- Tablespace altered.
- SQL> alter tablespace tbslogical online;
- alter tablespace tbslogical online
- *
- ERROR at line 1:
- ORA-01113: file 6 needs media recovery
- ORA-01110: data file 6: '+DATA/orcl/datafile/tbslogical.267.982351183'
- SQL> alter database create datafile '+DATA/orcl/datafile/tbslogical.267.982351183' as new;
- Database altered.
- SQL> recover datafile 6;
- Media recovery complete.
- SQL> alter tablespace tbslogical online;
- Tablespace altered.
- SQL> conn hr/oracle_4U
- Connected.
- SQL> select * from tlogical ;
- ERROR:
- ORA-01578: ORACLE data block corrupted (file # 6, block # 136)
- ORA-01110: data file 6: '+DATA/orcl/datafile/tbslogical.268.982352119'
- ORA-26040: Data block was loaded using the NOLOGGING option
- no rows selected
复制代码
Support Workbench打包(IPS),打出了ADR的一部分:
进一步检查逻辑坏块:
- RMAN> backup validate check logical datafile 6;
- Starting backup at 24-JUL-18
- allocated channel: ORA_SBT_TAPE_1
- channel ORA_SBT_TAPE_1: SID=207 device type=SBT_TAPE
- channel ORA_SBT_TAPE_1: Oracle Secure Backup
- allocated channel: ORA_SBT_TAPE_2
- channel ORA_SBT_TAPE_2: SID=77 device type=SBT_TAPE
- channel ORA_SBT_TAPE_2: Oracle Secure Backup
- channel ORA_SBT_TAPE_1: starting full datafile backup set
- channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
- input datafile file number=00006 name=+DATA/orcl/datafile/tbslogical.268.982352119
- channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:01
- List of Datafiles
- =================
- File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
- ---- ------ -------------- ------------ --------------- ----------
- 6 OK 1 504 640 4085368
- File Name: +DATA/orcl/datafile/tbslogical.268.982352119
- Block Type Blocks Failing Blocks Processed
- ---------- -------------- ----------------
- Data 0 5
- Index 0 0
- Other 0 131
- Finished backup at 24-JUL-18
- RMAN>
复制代码- select * from v$database_block_corruption;
复制代码 | FILE# | BLOCK# | BLOCKS | CORRUPTION_CHANGE# | CORRUPTION_TYPE | 1 | 6 | 136 | 1 | 4077248 | NOLOGGING |
MOS视频和补丁的下载:
https://www.botangdb.com/forum.php?mod=viewthread&tid=1070&highlight=MOS
- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch apply -connectString orcl::: -connectString rcat:::
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jul_24_2018_21_29_29/apply2018-07-24_21-29-29下午_1.log
- 补丁程序只应在 '-all_nodes' 模式下应用/回退。
- 将 RAC 模式转换为 '-all_nodes' 模式。
- Applying interim patch '13906496' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'
- Verifying environment and performing prerequisite checks...
- All checks passed.
- 提供电子邮件地址以用于接收有关安全问题的通知, 安装 Oracle Configuration Manager 并启动它。如果您使用 My Oracle
- Support 电子邮件地址/用户名, 操作将更简单。
- 有关详细信息, 请访问 http://www.oracle.com/support/policies.html。
- 电子邮件地址/用户名:
- 尚未提供电子邮件地址以接收有关安全问题的通知。
- 是否不希望收到有关安全问题 (是 [Y], 否 [N]) [N] 的通知: Y
- Backing up files...
- 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
- 正在数据库 'rcat' 上安装和启用联机补丁程序 'bug13906496.pch'。
- Verifying the update...
- Patch 13906496 successfully applied
- Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jul_24_2018_21_29_29/apply2018-07-24_21-29-29下午_1.log
- OPatch succeeded.
- [oracle@station90 online]$
复制代码- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch rollback -id 13906496 -connectString orcl::: -connectString rcat:::
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jul_24_2018_21_31_21/rollback2018-07-24_21-31-21下午_1.log
- RollbackSession 从 OH '/u01/app/oracle/product/11.2.0/dbhome_1' 回退中间补丁程序 '13906496'
- 补丁程序只应在 '-all_nodes' 模式下应用/回退。
- 将 RAC 模式转换为 '-all_nodes' 模式。
- 正在为组件 oracle.rdbms, 11.2.0.3.0 打补丁...
- The patch will be removed from database instances.
- 正在数据库 'rcat' 上禁用和删除联机补丁程序 'bug13906496.pch'
- RollbackSession 从产品清单中删除中间补丁程序 '13906496'
- Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/13906496_Jul_24_2018_21_31_21/rollback2018-07-24_21-31-21下午_1.log
- OPatch succeeded.
- [oracle@station90 online]$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
- Oracle 中间补丁程序安装程序版本 11.2.0.3.6
- 版权所有 (c) 2013, Oracle Corporation。保留所有权利。
- Oracle Home : /u01/app/oracle/product/11.2.0/dbhome_1
- Central Inventory : /u01/app/oraInventory
- from : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc
- OPatch version : 11.2.0.3.6
- OUI version : 11.2.0.3.0
- Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2018-07-24_21-31-32下午_1.log
- Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2018-07-24_21-31-32下午.txt
- --------------------------------------------------------------------------------
- 已安装的顶级产品 (1):
- Oracle Database 11g 11.2.0.3.0
- 此 Oracle 主目录中已安装 1 个产品。
- 此 Oracle 主目录中未安装任何中间补丁程序。
- --------------------------------------------------------------------------------
- OPatch succeeded.
- [oracle@station90 online]$
复制代码
|
|