温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

create index ORA-00376 处理方法

发布时间:2020-08-05 07:54:16 来源:ITPUB博客 阅读:201 作者:darren__chan 栏目:关系型数据库

临时段reuse引起的异常,小记!

SQL> create index cwdtest.testidx1 on cwdtest.tab_level_2(FID) tablespace testidx;

create index cwdtest.testidx1 on cwdtest.tab_level_2(FID) tablespace testidx

                                         *

ERROR at line 1:

ORA-00376: file 3 cannot be read at this time

ORA-01110: data file 3: '/opt/app/oracle/oradata/orcl/testidx01.dbf'

alter system set db_block_checksum=false;

System altered.

select 'exec dbms_space_admin.segment_corrupt('''||tablespace_name||''','||relative_fno||','||HEADER_BLOCK||')'

  2      from dba_segments where SEGMENT_TYPE='TEMPORARY'and TABLESPACE_NAME = 'TESTIDX';

'EXECDBMS_SPACE_ADMIN.SEGMENT_CORRUPT('''||TABLESPACE_NAME||''','||RELATIVE_FNO|

--------------------------------------------------------------------------------

exec dbms_space_admin.segment_corrupt('TESTIDX',3,130)

SQL> SQL> exec dbms_space_admin.segment_corrupt('TESTIDX',3,130);

PL/SQL procedure successfully completed.

select 'exec dbms_space_admin.segment_drop_corrupt('''||tablespace_name||''','||relative_fno||','||HEADER_BLOCK||')'

  2      from dba_segments where SEGMENT_TYPE='TEMPORARY'and TABLESPACE_NAME = 'TESTIDX';

'EXECDBMS_SPACE_ADMIN.SEGMENT_DROP_CORRUPT('''||TABLESPACE_NAME||''','||RELATIVE

--------------------------------------------------------------------------------

exec dbms_space_admin.segment_drop_corrupt('TESTIDX',3,130)

SQL> exec dbms_space_admin.segment_drop_corrupt('TESTIDX',3,130);

PL/SQL procedure successfully completed.

select owner, segment_name, tablespace_name, relative_fno, HEADER_BLOCK

from dba_segments

where SEGMENT_TYPE='TEMPORARY'

  4  and TABLESPACE_NAME = 'TESTIDX';

no rows selected

SQL> exec SYS.DBMS_SPACE_ADMIN.TABLESPACE_REBUILD_BITMAPS('TESTIDX');

BEGIN SYS.DBMS_SPACE_ADMIN.TABLESPACE_REBUILD_BITMAPS('TESTIDX'); END;

*

ERROR at line 1:

ORA-00376: file 3 cannot be read at this time

ORA-01110: data file 3: '/opt/app/oracle/oradata/orcl/testidx01.dbf'

ORA-06512: at "SYS.DBMS_SPACE_ADMIN", line 120

ORA-06512: at line 1

SQL> SHOW PARAMETER db_block_checksum

NAME                                                   TYPE VALUE

------------------------------------ ----------- ------------------------------

db_block_checksum                          string              FALSE

SQL>  alter system set db_block_checksum=true;

System altered.

SELECT distinct(segment_name), owner, segment_type, partition_name FROM dba_extents

  2  WHERE  tablespace_name = 'TESTIDX';

no rows selected

SQL> create index cwdtest.testidx1 on cwdtest.tab_level_2(FID) tablespace testidx;

Index created.

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI