{"id":162319,"date":"2012-12-12T12:09:03","date_gmt":"2012-12-12T08:09:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=162319"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=162319","title":{"rendered":"<span class=\"post_title\">\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u0442\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0432 Oracle \u2014 LOB \u0441\u0435\u0433\u043c\u0435\u043d\u0442<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0430\u043b\u0435\u0440\u0442-\u043b\u043e\u0433\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0411\u0414, \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:   <\/p>\n<blockquote><p>Corrupt block relative dba: 0x0724c078 (file 28, block 2408568)<br \/>   Fractured block found during backing up datafile<br \/>   Reread of blocknum=2408568, file=E:\\ORACLE\\ORADATA\\XXX\\XXX_BLOB16.DBF. found same corrupt data  <\/p><\/blockquote>\n<p>  \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0441\u043b\u043e\u0436\u043d\u044f\u043b\u043e\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u0431\u044d\u043a\u0430\u043f\u043e\u0432 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0443 \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.<\/p>\n<p>  <a name=\"habracut\"><\/a><br \/>  RMAN \u0443\u043f\u0438\u0440\u0430\u043b\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u0438 \u043d\u0438 \u0432 \u043a\u0430\u043a\u0443\u044e \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0431\u044d\u043a\u0430\u043f\u0438\u0442\u044c \u0431\u0430\u0437\u0443.<br \/>  \u041d\u0430\u0447\u0430\u043b\u0441\u044f \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0437\u0431\u043e\u0440 \u043f\u043e\u043b\u0435\u0442\u043e\u0432, \u0438 \u0432\u044b\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a \u0447\u0435\u043c\u0443 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a:  <\/p>\n<pre><code class=\"sql\">SELECT owner, segment_name, segment_type  FROM dba_extents  WHERE file_id = 28  AND 2408568 BETWEEN block_id AND block_id + blocks - 1;  OWNER ---------------------------- SEGMENT_NAME ---------------------------- SEGMENT_TYPE ------------------ DOC_USER SYS_LOB0000075021C00003$$ LOBSEGMENT <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0431\u044b\u043b\u043e \u0432\u044b\u044f\u0441\u043d\u0435\u043d\u043e \u043a \u043a\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u043b\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0439 LOB \u0441\u0435\u0433\u043c\u0435\u043d\u0442:  <\/p>\n<pre><code class=\"sql\">SELECT table_name, column_name  \t\t  FROM dba_lobs  \t\t WHERE owner='DOC_USER' \t\t   AND segment_name='SYS_LOB0000075021C00003$$';  TABLE_NAME ------------------- COLUMN_NAME ------------------- DOC_LARGE_PIC BINARY_DATA <\/code><\/pre>\n<p>  DBMS_REPAIR \u2014 \u043d\u0435 \u0441\u043c\u043e\u0433 \u043f\u0440\u043e\u044f\u0441\u043d\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u0432\u0432\u0438\u0434\u0443 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 LOB \u043f\u043e\u043b\u044f\u043c\u0438.<\/p>\n<p>  \u041d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0440\u0430\u0445 \u0441\u0435\u0442\u0438 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0441\u0443\u0442\u044c \u0435\u0433\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:  <\/p>\n<ul>\n<li> 1. \u041f\u043e\u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e \u043f\u0435\u0440\u0435\u0431\u0440\u0430\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/li>\n<li> 2. \u041f\u0440\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0438 \u0432 \u0437\u0430\u043f\u0438\u0441\u044c, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0435\u0439\u0441\u044f \u043a \u0431\u0438\u0442\u043e\u043c\u0443 \u0431\u043b\u043e\u043a\u0443 \u0432\u044b\u0434\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0435 ROWID.<\/li>\n<\/ul>\n<pre><code class=\"sql\">set serverout on \t\texec dbms_output.enable(100000); \t\tdeclare \t\t error_1578 exception; \t\t pragma exception_init(error_1578,-1578); \t\t n number; \t\t cnt number:=0; \t\t badcnt number:=0; \t\tbegin \t\t  for cursor_lob in \t\t        (select rowid r, BINARY_DATA L from DOC_USER.DOC_LARGE_PIC) \t\t  loop \t\t    begin \t\t      n:=dbms_lob.instr(cursor_lob.L,hextoraw('AA25889911'),1,999999) ; \t\t    exception \t\t     when error_1578 then \t\t       dbms_output.put_line('Got ORA-1578 reading LOB at '||cursor_lob.R); \t\t       badcnt:=badcnt+1; \t\t    end; \t\t    cnt:=cnt+1;  \t\t  end loop; \t\t  dbms_output.put_line('Scanned '||cnt||' rows - saw '||badcnt||' errors'); \t\tend; \t\t\/ <\/code><\/pre>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u043b \u0434\u0432\u0435 \u0434\u0432\u0435 \u0437\u0430\u043f\u0438\u0441\u0438:<\/p>\n<pre><code class=\"sql\">Got ORA-1578 reading LOB at AAASUNAAQAAPf7hAAY Got ORA-1578 reading LOB at AAASUNAAQAAPf7hAAp <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043d\u0435\u0445\u0438\u0442\u0440\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u044b PRIMARY KEY \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u044b\u043b\u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u0442\u0435\u0440\u0442\u044b.<\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0432\u043e\u0442 \u043e\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u2014 \u043d\u043e RMAN \u0443\u043f\u043e\u0440\u043d\u043e \u043d\u0435 \u0445\u043e\u0442\u0435\u043b \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0443\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u0432 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438.<br \/>  \u0417\u0430\u043f\u0440\u043e\u0441 \u0432 V$DATABASE_BLOCK_CORRUPTION \u0438 RMAN VALIDATE DATAFILE \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u043b\u0438 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0431\u043b\u043e\u043a\u0438 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u0435\u0436\u043d\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<p>  \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438 \u0437\u0430\u0431\u0438\u0432\u0430\u0442\u044c \u0435\u0435 \u043f\u043e\u0434 \u0437\u0430\u0432\u044f\u0437\u043a\u0443 \u0432\u0441\u0435\u0433\u043e \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c ALTER TABLE XXX SHRINK SPACE.<\/p>\n<pre><code class=\"sql\">ALTER TABLE DOC_USER.DOC_LARGE_PIC ENABLE ROW MOVEMENT; ALTER TABLE DOC_USER.DOC_LARGE_PIC SHRINK SPACE CASCADE; <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 RMAN&#8217;\u043e\u043c:  <\/p>\n<pre><code class=\"sql\">RMAN VALIDATE DATAFILE 28; <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 V$DATABASE_BLOCK_CORRUPTION \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043a\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u044b\u043c.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u0431\u0430\u0437\u0430 \u0431\u044b\u043b\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0430 RMAN&#8217;\u043e\u043c \u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0431\u044b\u043b\u0438 \u0432\u044b\u0434\u0435\u0440\u043d\u0443\u0442\u044b \u0438\u0437 \u0440\u0435\u043f\u043b\u0438\u043a\u0438. \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/162319\/\"> http:\/\/habrahabr.ru\/post\/162319\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0412 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432 \u0430\u043b\u0435\u0440\u0442-\u043b\u043e\u0433\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0411\u0414, \u043d\u0430\u0447\u0430\u043b\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:   <\/p>\n<blockquote><p>Corrupt block relative dba: 0x0724c078 (file 28, block 2408568)<br \/>   Fractured block found during backing up datafile<br \/>   Reread of blocknum=2408568, file=E:\\ORACLE\\ORADATA\\XXX\\XXX_BLOB16.DBF. found same corrupt data  <\/p><\/blockquote>\n<p>  \u0421\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043e\u0441\u043b\u043e\u0436\u043d\u044f\u043b\u043e\u0441\u044c \u0442\u0435\u043c, \u0447\u0442\u043e \u0431\u044d\u043a\u0430\u043f\u043e\u0432 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043d\u0435 \u0431\u044b\u043b\u043e.<br \/>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0432\u044b\u0445\u043e\u0434\u0443 \u0438\u0437 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-162319","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162319","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=162319"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/162319\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162319"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162319"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162319"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}