LAST ORA-1578 RECOVERY METHOD

제품 : ORACLE SERVER
작성날짜 : 2002-04-12
LAST ORA-1578 RECOVERY METHOD
=============================
Purpose
Ora-1578 error 에 대한 조치 방법에 대해 이해하도록 합니다.
Problem Description
일반적으로
ORA-1578 : ORACLE data block corrupted (file # num,block # num)
은 해당 objects를 drop하고 recreate하여 처리할 수 있읍니다.
하지만, backup이 안되어 있거나 되어 있더라도 시점에 문제가 생기면,
당황할 수 밖에 없습니다.
Solution Description
이 자료에서는 손상된 db block만을 제외한 다른 block들을 recover하는
방법을 알려 드립니다.
1. 손상된 table과 똑같은 spec의 new table생성
2. 아래의 pl/sql 실행
** This program uses a cursor to select the ROWID from INDEX
** for the corrupted table. And insert the all of the normal rows
** into the new table.
DECLARE
CURSOR c1 is
SELECT ROWID FROM corrupted_table
WHERE indexed_column > smallest_value_of_the_indexes
AND SUBSTR(ROWID,1,8) != '000005DA';
/* Here,the value of '000005DA' is displayed in decimal
when ORA-1578 error happens. */
rowid_value CHAR(18);
count_value NUMBER;
BEGIN
OPEN c1;
FOR i IN 1..total_number_of_the_rows_from_corrupted_table LOOP
FETCH c1 INTO rowid_value;
EXIT WHEN c1%NOTFOUND;     
INSERT INTO new_table
SELECT * FROM corrupted_table WHERE ROWID = rowid_value;
count_value := count_value + 1;
IF count_value = 10000 THEN /* Let's think commit per 10000 rows */
COMMIT;
count_value := 0;
END-IF;
END LOOP;
CLOSE c1;
END;
3. new table의 data건수등 확인후에 기존 table을 다른 이름으로
rename한 후 new table을 original table name으로 rename
SQL> rename corrupted_table to table_save;
SQL> rename new_table to corrupted_table;
4. 필요한 index생성이나 constraint enable
5. 손상된 row에 대한 내용은,
최소한 primary key나 indexed columns에 대한 내용을
SQL> spool chk.log
SQL> select rowid,indexed_column1,indexed_column2,indexed_column3...
from corrupted_table
where indexed_column1 > smallest_value_of_the_index;
SQL> spool off
를 통하여 chk.log에 저장후,
SQL> select count(*) from corrupted_table;
혹은 table export등을 통하여 확인된 rowid의 block number를 비교하여
보면 됩니다.
주의사항은 여기에서 ora-1578과 동반되는 block number는 decimal이니,
hexa로 환산해야 합니다.

you did not try to recover the datafile until get syncronyns with the controlfile ?
RECOVER
RECOVER {general | managed | END BACKUP}
where the general clause has the following syntax:
[AUTOMATIC] [FROM location]
{ {full_database_recovery | partial_database_recovery |LOGFILE filename}
[ {TEST | ALLOW integer CORRUPTION } [TEST | ALLOW integer CORRUPTION ]...]
|CONTINUE [DEFAULT]|CANCEL}
where the full_database_recovery clause has the following syntax:
[STANDBY] DATABASE
[ {UNTIL {CANCEL | TIME date | CHANGE integer} | USING BACKUP CONTROLFILE}
[UNTIL {CANCEL | TIME date | CHANGE integer} | USING BACKUP CONTROLFILE]...]
where the partial_database_recovery clause has the following syntax:
{TABLESPACE tablespace [, tablespace]... | DATAFILE datafilename [, datafilename]...
| STANDBY
{TABLESPACE tablespace [, tablespace]... | DATAFILE datafilename [, datafilename]...}
UNTIL [CONSISTENT] [WITH] CONTROLFILE }
where the managed clause has the following syntax:
MANAGED STANDBY DATABASE
[ {NODELAY | [TIMEOUT] integer | CANCEL [IMMEDIATE] [NOWAIT]}
| [DISCONNECT [FROM SESSION] ] [FINISH [NOWAIT] ] ]
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1010523
Joel P�rez

Similar Messages

  • BLOCK CORRUPTION (ORACLE8 에서 ORA-1578 조치방법)

    제품 : ORACLE SERVER
    작성날짜 : 2002-04-26
    BLOCK CORRUPTION (ORACLE8 에서 ORA-1578 조치방법)
    ================================================
    PURPOSE
    본 bulletin 에서는 Oracle8 에서의 data block corruption error
    (ORA-1578) 에 대해서 조치방법을 알아본다.
    BACKGROUND
    ORA-1578 은 data block 에 corruption 이 생긴 경우에 발생한다.
    이 error 는 corruption 이 발생한 곳의 file number 와 block
    number 를 알려준다.
    본 bulletin 에서는 file number 를 'f', block number 를 'b' 로
    지칭하기로 한다. ORA-1578 과 함께 return 되는 file number는
    relative file number 가 아닌 absolute file number 를 의미한다.
    (Oracle8 에서 새롭게 소개된 relative file number 에 대해서는 본
    bulletin 의 6번 항목에서 다루도록 한다.)
    RESOLUTION
    1. 최선의 해결책은 backup 받아둔 file 을 restore 한 후
    recover 작업을 하는 것이다. 이 작업을 위해서는 archive
    log mode 로 운영 중이어야 한다.
    dba_data_files 또는 v$datafile 과 ORA-1578 error 에서
    return 된 absolute file number 를 이용하여 corruption이
    발생한 datafile 의 이름을 알아낼 수 있다.
    Oracle8 에서는, dba_data_files 에 absolute file number
    (file_id) 와 함께 relative file number (relative_fno) 를
    가지고 있다.
    v$datafile 에는 아직 absolute file number (file#) 만을 가진다.
    backup 을 restore 하기 전에 hardware 의 문제를 fix 해야 할
    필요가 있을 수 있다. 만약 corruption 이 disk 불량에 의해
    발생하였다면, backup 받아둔 datafile 을 문제가 없는 disk 에
    restore 하고, startup mount 한 후, 새로운 위치로 datafile
    rename 을 하고 recover 한다.
    만약 해당 datafile 이 system tablespace 에 속하지 않는다면
    offline tablespace recovery 도 가능하다.
    2. backup datafile 을 restore 하고 recover 하지 않을 것이라면
    우선, 어떤 object 에서 corruption 이 발생하였는지 확인해야
    한다.
    다음의 SQL 문을 이용한다.
    SELECT owner, segment_name, segment_type, relative_fno
    FROM dba_extents
    WHERE file_id = f
    AND b BETWEEN block_id AND block_id + blocks - 1 ;
    3. 해당 segment 가 non-data dictionary index라면, 해당 index를
    drop 한 후 재생성한다.
    4. 해당 segment 가 table 이라면, corruption 이 발생한 block 의
    data 는 소실된 것이다.
    5. 만약 해당 table 에 대한 최근의 export dump file이 존재한다면,
    해당 table 을 drop 한 후 import 함으로써 복구할 수 있다.
    최근의 export dump file 이 없거나 이를 export 받을 수 있는
    최근의 backup 이 없다면 다음과 같은 방법을 이용할 수 있다.
    6. corruption 이 발생한 non-clustered table 에서 corrupted
    block 을 access 하지 않고 나머지 data 들을 select 할 수
    있도록 ROWID 를 이용할 수 있다. non-clustered table의 모든
    row 들은 해당 row 의 물리적인 주소를 가리키는 고유한 ROWID를
    갖는다(해당 row가 여러 block에 조각이 나 있다면 첫번째 조각에
    대한 주소). clustered table 인 경우에는 서로 다른 table 의
    data 들이 같은 block 에 존재할 수 있으며, 같은 ROWID 를 가질
    수 있다.
    Oracle 은 index 를 구성하기 위하여 내부적으로 ROWID 를 사용한다.
    따라서 where 절에 ROWID 를 사용하여 select 하면 강제로 range
    scan 를 할 수 있다.
    Oracle8 에서는 이를 위하여 ROWID hint 를 사용할 필요가
    없어졌다.
    ROWID 를 이용하여 table 로부터 data 를 추출하기
    예제로써 ACCT_NO, PERSON, WEEKNO 등의 column 으로 구성된
    SCOTT user의 EXAMPLE 이라는 table 이 있다고 가정한다.
    이때, ORA-1578 "ORACLE data block corrupted (file # 5,
    block # 2) 가
    발생하였다고 가정하자.
    ROWID in Oracle8 :
    Oracle8 에서의 ROWID 는 'OOOOOOFFFBBBBBBSSS' format 을 가진다.
    OOOOOO = data object number
    Oracle7 의 object_id 와는 별도로 segment 의 id 를 갖는다.
    dba_objects 의 data_object_id 에서 확인가능
    FFF = relative file number
    BBBBBB = block number
    SSS = row number
    Oracle8에서의 ROWID 는 absolute file number 가 아닌 relative
    file number 를 갖는다는 점에 주목해야 한다.
    relative file number 는 tablespace 에 대해 상대적이며
    (tablespace마다 첫번째, 두번째, 세번째 datafile 을 가질 수
    있음을 의미) absolute file number 는 전체 database 내에서
    고유하다. 두개의 서로다른 file 들이 동일한 relative file
    number를 가질 수 있다.
    만약 EXAMPLE table 에서 ACCT_NO, ROWID 를 select하면 다음과
    같은 결과가 나올 수 있다.
    ACCT_NO ROWID
    12345 AAAAh3AAGAAACJAAAA
    19283 AAAAh3AAGAAACJAAAB
    22345 AAAAh4AAFAAAAADAAA
    60372 AAAAh4AAFAAAAADAAB
    33456 AAAAh5AAEAAAAIuAAA
    29473 AAAAh5AAEAAAAIuAAB
    이러한 format 을 extended ROWID character format 이라고
    지칭한다.
    extended ROWID 는 number 이므로 substr 함수를 이용하여
    extended ROWID 로부터 일부를 떼어낼 수 없다.
    ROWID 를 생성하기 위해서는 모든 component 를 알아야 한다.
    그런다음, DBMS_ROWID package 의 function 을 이용하여 ROWID 를
    생성할 수 있다.
    function rowid_create(rowid_type IN number,
    object_number IN number,
    relative_fno IN number,
    block_number IN number,
    row_number IN number)
    return rowid;
    pragma RESTRICT_REFERENCES(rowid_create,WNDS,RNDS,WNPS,RNPS);
    -- rowid_type - type (restricted=0/extended=1)
    -- object_number - data object number
    (rowid_object_undefined for )
    -- restricted
    -- relative_fno - relative file number
    -- block_number - block number in this file
    -- file_number - file number in this block
    corruption 이 발생한 block 의 data object number 를 알기
    위해서는 dba_objects 를 조회한다.
    SELECT data_object_id FROM dba_objects
    WHERE owner = 'SCOTT'
    AND object_name = 'EXAMPLE' ;
    DATA_OBJECT_ID
    2168
    우리는 이미, 위에서 사용한 다음의 SQL 에 의해서 relative file
    number 를 알고 있다.
    SELECT owner, segment_name, segment_type, relative_fno
    FROM dba_extents
    WHERE file_id = 5
    AND 2 BETWEEN block_id AND block_id + blocks - 1 ;
    OWNER SEGMENT_NAME SEGMENT_TYPE RELATIVE_F
    SCOTT EXAMPLE TABLE 5
    corruption 이 발생한 block 이 2이므로, block# 2 이전의 access
    가능한 마지막 ROWID 는 block# 1 에 존재한다. 그리고 block# 2
    이후의 access 가능한 첫 ROWID 는 block# 3에 존재한다. block
    안에 몇개의 row number 가 존재할 지 모르므로 row number 0 을
    이용한다.
    이제 corrupted block 이전의 ROWID 와 이후의 ROWID 를 생성할
    준비가 끝났다.
    corrupted block 이전의 ROWID :
    SELECT DBMS_ROWID.ROWID_CREATE(1,2168,5,1,0) FROM example ;
    DBMS_ROWID.ROWID_C
    AAAAh4AAFAAAAABAAA
    corrupted block 이후의 ROWID :
    SELECT DBMS_ROWID.ROWID_CREATE(1,2168,5,3,0) FROM example ;
    DBMS_ROWID.ROWID_C
    AAAAh4AAFAAAAADAAA
    다음으로, EXAMPLE table 과 같은 spec 으로 table 을 하나 만든다.
    CREATE TABLE temp AS SELECT * FROM example WHERE 1=2;
    그리고 corrupted block 이외의 block 에서 data 를 추출하여
    insert 한다.
    INSERT INTO temp SELECT * FROM example
    WHERE ROWID <= 'AAAAh4AAFAAAAABAAA';
    INSERT INTO temp SELECT * FROM example
    WHERE ROWID >= 'AAAAh4AAFAAAAADAAA';
    이후 원본 table 을 drop 하고, TEMP 를 rename 한다.
    7. 만약 data dictionary 에 속하는 table, index 또는 rollback
    segment에 corrupted block 이 발생하였다면 Oracle Support 의
    지원을 받는다.
    8. 일반적으로, ORA-1578 은 hardware 의 문제때문에 유발된다.
    하지만 만약에 ORA-600[3374] 가 발생한다면 memory 상에서
    corruption 이 발생한 경우이다.
    이 경우 database 를 restartup 하면 문제가 해결될 수 있다.
    Reference Documents
    --------------------

    Hello,
    Please check the link i posted.
    Example: Detecting Corruption
    The CHECK_OBJECT procedure checks the specified object, and populates the repair table with information about corruptions and repair directives. You can optionally specify a range, partition name, or subpartition name when you want to check a portion of an object.
    Validation consists of checking all blocks in the object that have not previously been marked corrupt. For each block, the transaction and data layer portions are checked for self consistency. During CHECK_OBJECT, if a block is encountered that has a corrupt buffer cache header, then that block is skipped.
    The following is an example of executing the CHECK_OBJECT procedure for the scott.dept table.
    SET SERVEROUTPUT ON
    DECLARE num_corrupt INT;
    BEGIN
    num_corrupt := 0;
    DBMS_REPAIR.CHECK_OBJECT (
    SCHEMA_NAME => 'SCOTT',
    OBJECT_NAME => 'DEPT',
    REPAIR_TABLE_NAME => 'REPAIR_TABLE',
    CORRUPT_COUNT => num_corrupt);
    DBMS_OUTPUT.PUT_LINE('number corrupt: ' || TO_CHAR (num_corrupt));
    END;
    SQL*Plus outputs the following line, indicating one corruption:
    number corrupt: 1

  • ORACLE 8에서의 ORA-1578 조치 방법(UPDATE)

    제품 : ORACLE SERVER
    작성날짜 : 2003-06-12
    Oracle 8에서의 ORA-1578(Data Block Corruption) 조치 방법
    <사전에 알아두어야 할 사항>
    # Oracle 8의 ROWID
    1. FORMAT : OOOOOOFFFBBBBBBSSS
    * OOOOOO - data object number 로서 물리적인 segment의 id를 의미
    * FFF - row가 위치한 datafile의 relative datafile number
    * BBBBBB - file 내에서의 block id
    * SSS - block 내에서의 row의 sequence number
    2. 각 구성 요소는 64진법으로 표기되어 진다.
    3. DBMS_ROWID Package는 ROWID를 10진법으로 변환하는 FUNCTION과 ROWID를
    생성하는 FUNCTION을 포함하고 있다.( 자세한 내용은 BULLETIN 11366 참조)
    # DBA_OBJECTS에서 OBJECT_ID와 DATA_OBJECT_ID
    Oracle 8에서는 DBA_OBJECTS 안에 physical segment id를 의미하는
    data_object_id column을 가지고 있다. 이 column의 값은 ROWID의 object id
    를 구성하는데 사용된다.
    이 column은 대부분 object_id 값과 동일하나 partitioned table과
    clustered table안에서는 다를 수 있다.
    Partitioned table에서는 partition이 다른 tablespace로 이동하였을 경
    우 object_id는 예전과 동일하나 data_object_id는 달라 진다.
    Clustered table에서는 반대로 data_object_id는 동일하나 object_id가 다
    른 경우가 발생한다.
    (자세한 내용은 Bulletin 11604 참조)
    # RELATIVE DATAFILE NUMBER
    8.x 의 relative datafile number는 특정 tablespace 내에서만 고유하다.
    따라서 서로 다른 두개의 tablespace에 속한 datafile들이 동일한 relative
    datafile number를 가질 수 있다.
    8.x 에서는 tablespace 당 최대 1023개의 datafile을 사용. 전체 database 의
    datafile 갯수가 1023개를 넘기 전까지는 file_id와 relative_fno는 동일한
    값을 갖음.
    # ROWID 생성
    DBMS_ROWID Package의 DBMS_ROWID.ROWID_CREATE Function사용.
    Syntax : Function dbms_rowid.rowid_create( rowid_type in number,
    object_number in number,
    relative_fno in number,
                   block_number in number,
                   row_number in number ) return rowid;
    SQL> select dbms_rowid.rowid_create(1,10116,4,5948,0) CREATE_ROWID
    from dual;
    CREATE_ROWID
    AAACeEAAEAAABc8AAA
    < 해결 방법 >
    1. HARDWARE 문제가 있다면 이를 먼저 해결한다.
    2. DATA DICTIONARY 의 INDEX나 TABLE이 손상되었다면 FULL BACKUP으로부터 복구.
    3. NON-DICTIONARY OBJECT일 경우
    # INDEX가 손상된 경우: INDEX를 REBUILD하면 된다.
    # TABLE이 손상된 경우:
    * EXPORT BACKUP이 있다면 손상된 TABLE을 DROP하고 IMPORT.
    * ARCHIVE MODE라면 해당 DATAFILE을 RESTORE하고 RECOVERY.
    * 만약 BACKUP이 전혀 없다면 ROWID를 이용하여 손상된 BLOCK을 제외한
    나머지 BLOCK의 ROW들만을 추출한다.
    이것은 반드시 INDEX가 생성된 TABLE에 한해서만 적용 가능하다.
    4. 손상된 BLOCK을 제외한 나머지 BLOCK의 ROW들을 추출하는 방법.
    ERROR MESSAGE :
    ORA-1578 "ORACLE data block corrupted (file # 4, block # 1562)
    - file# 4는 absolute datafile number 임.
    STEP 1 : 어떤 OBJECT에서 발생하였는가를 파악
    SELECT owner, segment_name, segment_type , relative_fno, partition_name
    FROM dba_extents
    WHERE file_id = 4 AND
    1562 BETWEEN block_id AND ( block_id + (blocks - 1)) ;
    OWNER SEGMENT_NAME SEGMENT_TYPE RELATIVE_FNO PARTITION_NAME
    SCOTT EMP TABLE 4
    * RELATIVE_FNO 확인
    * PARTITIONED TABLE인지 확인
    STEP 2 : DATA_OBJECT_ID를 추출
    SELECT DATA_OBJECT_ID
    FROM dba_objects
    WHERE owner = 'SCOTT' AND object_name = 'EMP'
    [  AND  partition_name = *EMP_PART_2*  ] ;
    DATA_OBJECT_ID
    7033
    * [ ] 안의 내용은 partitioned table일 경우에 추가되는 조건임.
    STEP 3 : ROWID 생성
    생성해야할 ROWID는 BLOCK 1562 와 BLOCK 1563의 각 첫 번째 ROWID들이다.
    STEP 1,2에서 다음과 같은 정보를 얻었다.
    OBJECT_NUMBER = 7033, RELATIVE_FNO= 4 , BLOCK-_NUMBER=1562
    각 BLOCK의 ROW SEQUENCE NUMBER는 0 부터 시작하므로 ROWID는 다음과 같이 생성할 수 있다.
    SQL> SELECT DBMS_ROWID.ROWID_CREATE(1,7033,4,1562,0) FROM DUAL;
    DBMS_ROWID.ROWID_C
    AAABt5AAEAAAAYaAAA
    SQL> SELECT DBMS_ROWID.ROWID_CREATE(1,7033,4,1563,0) FROM DUAL;
    DBMS_ROWID.ROWID_C
    AAABt5AAEAAAAYbAAA
    # 위 부분에서 기존의 BULLETIN(11340)은 잘못 되어 있다.
    즉 기존의 BULLETIN에서는 BLOCK 1561 과 BLOCK 1563의 첫 번째
    ROWID를 구해서 ROW를 추출하였다. 그러나 이렇게하면 BLOCK 1561의 ROW 들
    이 누락되는 현상이 발생하게 된다. 그러므로 이러한 현상을 방지하기 위해서
    는 BLOCK 1561의 첫 번째 ROWID가 아닌 BLOCK 1562의 첫번째 ROWID를 구해야
    한다.
    STEP 4 : ROW 추출
    * 먼저 TEMPORARY TABLE을 만든다
    SQL> CREATE TABLE TEMP AS SELECT * FROM EMP WHERE 1=2;
    * 손상된 BLOCK 1562의 첫 번째 ROWID보다 작은 ROWID를 가진 ROW 추출
    SQL>INSERT INTO TEMP
    SELECT * FROM EMP
    WHERE EMPNO > 0 AND ROWID < 'AAABt5AAEAAAAYaAAA' ;
    * 손상된 BLOCK 1562의 마지막 ROWID보다 큰 ROWID를 가진 ROW 추출
    SQL>INSERT INTO TEMP
    SELECT * FROM EMP
    WHERE EMPNO > 0 AND ROWID >= 'AAABt5AAEAAAAYbAAA' ;
    * 기존의 TABLE을 DROP하고 TEMP TABLE을 RENAME한다.
    위 INSERT시 WHERE 조건에 EMPNO > 0을 추가한 이유는 INDEX
    에 의한 RANGE SCAN을 반드시 수행하도록 하기 위해서이다.
    기존의 BULLETIN은 이 부분을 또한 간과하였다.
    즉 WHERE 절에 ROWID만을 기술했을 경우 TABLE을 FULL SCAN하
    지 않고 RANGE SCAN을 하기 위해서는 반드시 TABLE이
    ANALYZE되어 있어야만 한다. TABLE이 ANALYZE되어 있지 않으
    면 FULL SCAN을 하게 된다.
    아래는 각각에 대한 EXECUTION PLAN이다.
    TABLE ANALYZE를 하지 않은 상태
    CASE 1 ) ROWID로 QUERY
    SQL>select *
    from imsiemp
    where rowid < 'AAABwSAAEAAABGhAAJ';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 TABLE ACCESS (FULL) OF 'IMSIEMP'
    CASE 2 ) INDEX COLUMN & ROWID로 QUERY
    SQL> select *
    from imsiemp
    where empno < 10 and rowid < 'AAABwSAAEAAABGhAAJ'
    Execution Plan
         0 SELECT STATEMENT Optimizer=CHOOSE
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'IMSIEMP'
         2 1 INDEX (RANGE SCAN) OF 'SYS_C003247' (UNIQUE)
    TABLE ANALYZE가 수행된 상태
    CASE 1) ROWID로 QUERY
    SQL> select * from imsiemp where rowid < 'AAABwSAAEAAABGhAAJ'
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=36 Card=500 Bytes=19000)
    1 0 TABLE ACCESS (BY ROWID RANGE) OF 'IMSIEMP' (Cost=36 Card=500 Bytes=19000)
    CASE 2 ) INDEX COLUMN & ROWID로 QUERY
    SQL> select *
    from imsiemp
    where empno < 10 and rowid < 'AAABwSAAEAAABGhAAJ';
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=1 Bytes=38)
    1 0 TABLE ACCESS (BY INDEX ROWID) OF 'IMSIEMP' (Cost=3 Card=1Bytes=38)
    2 1 INDEX (RANGE SCAN) OF 'SYS_C003247' (UNIQUE) (Cost=2 Card=1)

    Let me give the details..
    I1) I have installed 10.2.0.2 patch which is available in the service marketplace.
    i have jus applied the patch after installing the oracle 10.2 software and its showing
    10.2.0.2 in my status.
    2) My kernel version is 239 (SAP R/3 4.7)
    3) The env variables are give beolow.
    DBMS_TYPE=ORA
    DBS_ORA_SCHEMA=SAPR3
    dbs_ora_tnsname=DEE
    NLS_LANG=AMERICAN_AMERICA.WE8DEC
    NUMBER_OF_PROCESSORS=8
    ORACLE_HOME=D:\ORACLE\DEE\102
    ORACLE_SID=DEE
    OS=Windows_NT
    Path=C:\Perl\bin\;D:\oracle\DEE\102\jre\1.4.2\bin\client;D:\oracle\DEE\102\jre\1
    .4.2\bin;C:\Program Files\EMC\PowerPath\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDO
    WS\System32\Wbem;C:\Program Files\Dell\SysMgt\RAC5;C:\Program Files\Dell\SysMgt\
    oma\bin;C:\Program Files\Dell\SysMgt\oma\oldiags\bin;C:\Program Files\EMC\Navisp
    here CLI;C:\Program Files\Resource Kit\;D:\Oracle92\Opatch;D:\Oracle92\Opatch;d:
    \oracle\DEE\102;D:\usr\sap\DEE\sys\exe\run;D:\Oracle\DEE\102\BIN;d:\oracle92;d:\
    oracle92\bin;D:\usr\sap\DEE\sys\exe\run;
    SAPARCH=E:\oracle\DEE\saparch
    SAPBACKUP=E:\oracle\DEE\sapbackup
    SAPCHECK=E:\oracle\DEE\sapcheck
    SAPDATA_HOME=E:\oracle\DEE
    SAPEXE=D:\usr\sap\DEE\SYS\exe\run
    SAPLOCALHOST=awnts151
    SAPREORG=E:\oracle\DEE\sapreorg
    SAPTRACE=E:\oracle\DEE\saptrace
    SAPTRANSHOST=AWNTS151
    TNS_ADMIN=D:\usr\sap\DEE\sys\profile\ORACLE
    USERDNSDOMAIN=AUDCO9.AILVALVES.COM
    USERDOMAIN=AUDCO9
    USERNAME=deeadm
    USERPROFILE=C:\Documents and Settings\deeadm
    USE_KIT=OFF
    4) Since there is no application server i have not installed oracle client.
    5) Kernel version is 640.
    Please help.
    Thanks and regards,
    siddhartha.

  • ORA-01610: recovery using the BACKUP CONTROLFILE option must be done

    Hello All,
    I have an instance on my LAB server. To explore more avenues in cloning a DB I did the following.
    1. On my Oracle 10g Instance I fired an large query which would take atleast an hour to execute.
    2. Opened another session and executed shu ABORT to shutdown the above instance abruptly.
    3. Took backup of datafiles, archive logs and redologs [ prior to shu abort, I had issued ALTER DATABASE BACKUP CONTROLFILE TO TRACE]
    Restoration steps:
    NOMOUNT with pfile edited to hold the name of the new DB_NAME
    Create control file script edited to reflect the new paths of datafile and redologs.
    MOunted succesfully.
    ALTER DATABASE OPEN RESETLOGS;
    ERROR at line 1:
    ORA-01194: file 1 needs more recovery to be consistent
    ORA-01110: data file 1:
    'F:\ORACLE\COLD_BACKUP_TRIAL\SET2\DATAFILE\DUPLISYSTEM_553LC8QX_.DBF'
    SQL> recover datafile 'F:\ORACLE\COLD_BACKUP_TRIAL\SET2\DATAFILE\DUPLISYSTEM_553LC8QX_.DBF';
    ORA-00283: recovery session canceled due to errors
    ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
    SQL> recover database using backup controlfile;
    ORA-00279: change 2962256 generated at 09/03/2009 12:06:49 needed for thread 1
    ORA-00289: suggestion :
    F:\ORACLE\COLD_BACKUP_TRIAL\SET2\FLASH_RECOVERY_AREA\DUPLI\ARCHIVELOG\2009_09_23
    \O1_MF_1_2_%U_.ARC
    ORA-00280: change 2962256 for thread 1 is in sequence #2
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    F:\oracle\cold_backup_trial\SET2\ONLINELOG_BK\O1_MF_3_553LGCH3_.log
    ORA-00342: archived log does not have expected resetlogs SCN 2933995
    ORA-00334: archived log:
    'F:\ORACLE\COLD_BACKUP_TRIAL\SET2\ONLINELOG_BK\O1_MF_3_553LGCH3_.LOG'
    I didn't find the file it was suggesting so I tried many combinations of providing the right recovery file name :-- All the latest Archive logs and Redologs in my backup.
    Still the recovery is not successful. Please let me know how can I recover my DATABASE.
    Many thanks in advance.
    Regards,
    Valli

    Greetings,
    If I understood, you basically have a copy of a primary database and the redo log archives of this pretty same database, you have backed up the control file of this primary database, edited it pointing all paths of your datafiles to the new location but renaming the instance name.
    I am assuming that you have edited the first line of your control file to something like "CREATE CONTROLFILE SET DATABASE "DB02" RESETLOGS ARCHIVELOG", in this case are you sure that the redolog archives have not loose the sequence? In this case it will ask more and more archives and it will never end, take a look at the date and time of the thread that your instance is asking for recovery. Is your instance a production database? If it is NOT production and you are SURE that the database is completely recovered and is asking for redolog files that does not even exist you can try to add the ALLOWRESETLOGS_CORRUPTION=TRUE to your init.ora and open the db... This solution is not recommended and you should never use it on production instances... take this hint as a LAST effort to bring your db online.
    Regards,
    Bruno Carvalho

  • BLOCK CORRUPTION (ORA-1578) 처리 (ORACLE 8I NEW FEATURE)

    제품 : ORACLE SERVER
    작성날짜 : 2002-05-31
    BLOCK CORRUPTION (ORA-1578) 처리 (ORACLE 8I NEW FEATURE)
    ========================================================
    PURPOSE
    Block Corruption의 처리 방안에 대해 알아본다.
    Problem Description
    block corruption 시 10210, 10211,10231 의 event 를 사용해서
    해당 block 을 skip 할 수도 있지만 V8.1 이상에서는
    dbms_repair.fix_corrupt_blocks ,
    dbms_repair.skip_corrupt_block 를 이용하여
    corrupt가 발생한 block을 detect하고 skip, 또는 repair해주는 방안이
    제시되고 있다.
    Workaround
    Solution Description
    - 먼저 detecting 을 위해 db_block_checking =true 를 init.ora 에 set
    - dbms_repair 의 package 를 사용하는데 이 package 는 dbmsrpr.sql,
    prvtrpr.plb를 수행한다 .
    - sys 로 접속하여 package 를 실행한다.
    다음의 예제를 살펴보자
    T1 테이블에 corrupt 된 block 이 있다고 가정한다.
    SQL> desc t1
    Name Null? Type
    COL1 NOT NULL NUMBER(38)
    COL2 CHAR(512)
    SQL> analyze table t1 validate structure;
    analyze table t1 validate structure
    ERROR at line 1:
    ORA-01498: block check failure - see trace file
    이때 ANALYZE로 부터 발생된 trace file 에 corrupt 된 block 에 3 row 의
    (nrows = 3) data 가 있음을 알수 있다고 가정하자.
    DBMS_REPAIR.ADMIN_TABLES (repair and orphan key)
    ================================================
    ADMIN_TABLES 은 table 을 위한 repair table과,인덱스를 위한 orphan key
    tables을 제공한다.
    SQL> @adminCreate
    SQL> connect sys/change_on_install
    Connected.
    SQL>
    SQL> -- Repair Table
    SQL>
    SQL> declare
    2 begin
    3 -- Create repair table
    4 dbms_repair.admin_tables (
    5 -- table_name => 'REPAIR_TABLE',
    6 table_type => dbms_repair.repair_table,
    7 action => dbms_repair.create_action,
    8 tablespace => 'USERS'); -- default TS of SYS if not specified
    9 end;
    10 /
    PL/SQL procedure successfully completed.
    SQL> select owner, object_name, object_type
    2 from dba_objects
    3 where object_name like '%REPAIR_TABLE';
    OWNER OBJECT_NAME OBJECT_TYPE
    SYS DBA_REPAIR_TABLE VIEW
    SYS REPAIR_TABLE TABLE
    SQL>
    SQL> -- Orphan Key Table
    SQL>
    SQL> declare
    2 begin
    3 -- Create orphan key table
    4 dbms_repair.admin_tables (
    5 table_type => dbms_repair.orphan_table,
    6 action => dbms_repair.create_action,
    7 tablespace => 'USERS'); -- default TS of SYS if not specified
    8 end;
    9 /
    PL/SQL procedure successfully completed.
    SQL> select owner, object_name, object_type
    2 from dba_objects
    3 where object_name like '%ORPHAN_KEY_TABLE';
    OWNER OBJECT_NAME OBJECT_TYPE
    SYS DBA_ORPHAN_KEY_TABLE VIEW
    SYS ORPHAN_KEY_TABLE TABLE
    DBMS_REPAIR.CHECK_OBJECT
    =========================
    CHECK_OBJECT procedure 는 기술된 object를 check 하고, repair 를 위한 정보를 수집하기 위함이다.
    SQL> @checkObject
    SQL> set serveroutput on
    SQL>
    SQL> declare
    2 rpr_count int;
    3 begin
    4 rpr_count := 0;
    5 dbms_repair.check_object (
    6 schema_name => 'SYSTEM',
    7 object_name => 'T1',
    8 repair_table_name => 'REPAIR_TABLE',
    9 corrupt_count => rpr_count);
    10 dbms_output.put_line('repair count: ' || to_char(rpr_count));
    11 end;
    12 /
    repair count: 1
    PL/SQL procedure successfully completed.
    SQL> desc repair_table
    Name Null? Type
    OBJECT_ID NOT NULL NUMBER
    TABLESPACE_ID NOT NULL NUMBER
    RELATIVE_FILE_ID NOT NULL NUMBER
    BLOCK_ID NOT NULL NUMBER
    CORRUPT_TYPE NOT NULL NUMBER
    SCHEMA_NAME NOT NULL VARCHAR2(30)
    OBJECT_NAME NOT NULL VARCHAR2(30)
    BASEOBJECT_NAME VARCHAR2(30)
    PARTITION_NAME VARCHAR2(30)
    CORRUPT_DESCRIPTION VARCHAR2(2000)
    REPAIR_DESCRIPTION VARCHAR2(200)
    MARKED_CORRUPT NOT NULL VARCHAR2(10)
    CHECK_TIMESTAMP NOT NULL DATE
    FIX_TIMESTAMP DATE
    REFORMAT_TIMESTAMP DATE
    SQL> select object_name, block_id, corrupt_type, marked_corrupt,
    2 corrupt_description, repair_description
    3 from repair_table;
    OBJECT_NAME BLOCK_ID CORRUPT_TYPE MARKED_COR
    CORRUPT_DESCRIPTION
    REPAIR_DESCRIPTION
    T1 3 1 FALSE
    kdbchk: row locked by non-existent transaction
    table=0 slot=0
    lockid=32 ktbbhitc=1
    mark block software corrupt
    Data Extraction
    ===============
    repair table에 의하면 file 6 ,block 3 에 corrupt 이 났음을 알수 있다
    그러나 아직 이 block 은 corrupt 로 mark 되어 있지 않으므로 필요 data 를
    추출하여야 한다.
    1. ALTER SYSTEM DUMP (nrows = 3) 에 의해 block안에 있는 row수를 결정한다.
    2. corrupt object를 select 하여 가능한 정보를 추출한다.
    SQL> -- The following query can be used to salvage data from a corrupt block.
    SQL> -- Creating a temporary table facilitates data insertion.
    SQL> create table temp_t1 as
    2 select * from system.t1
    3 where dbms_rowid.rowid_block_number(rowid) = 3
    4 and dbms_rowid.rowid_to_absolute_fno (rowid, 'SYSTEM','T1') = 6;
    Table created.
    SQL> select col1 from temp_t1;
    COL1
    2
    3
    DBMS_REPAIR.FIX_CORRUPT_BLOCKS (ORA-1578)
    ============================================
    FIX_CORRUPT_BLOCKS procedure는 repair table 의 정보를 이용하여 corrupt
    blocks 을 fix 한다
    그러나 아직 full table scan 시 여전히 error 가 발생한다
    SQL> declare
    2 fix_count int;
    3 begin
    4 fix_count := 0;
    5 dbms_repair.fix_corrupt_blocks (
    6 schema_name => 'SYSTEM',
    7 object_name => 'T1',
    8 object_type => dbms_repair.table_object,
    9 repair_table_name => 'REPAIR_TABLE',
    10 fix_count => fix_count);
    11 dbms_output.put_line('fix count: ' || to_char(fix_count));
    12 end;
    13 /
    fix count: 1
    PL/SQL procedure successfully completed.
    SQL> select object_name, block_id, marked_corrupt
    2 from repair_table;
    OBJECT_NAME BLOCK_ID MARKED_COR
    T1 3 TRUE
    SQL> select * from system.t1;
    select * from system.t1
    ERROR at line 1:
    ORA-01578: ORACLE data block corrupted (file # 6, block # 3)
    ORA-01110: data file 6: '/tmp/ts_corrupt.dbf'
    DBMS_REPAIR.DUMP_ORPHAN_KEYS
    ==============================
    DUMP_ORPHAN_KEYS는 corrupt data 에 해당하는 index 를 나타내 준다
    SQL> select index_name from dba_indexes
    2 where table_name in (select distinct object_name from repair_table);
    INDEX_NAME
    T1_PK
    SQL> @dumpOrphanKeys
    SQL> set serveroutput on
    SQL>
    SQL> declare
    2 key_count int;
    3 begin
    4 key_count := 0;
    5 dbms_repair.dump_orphan_keys (
    6 schema_name => 'SYSTEM',
    7 object_name => 'T1_PK',
    8 object_type => dbms_repair.index_object,
    9 repair_table_name => 'REPAIR_TABLE',
    10 orphan_table_name => 'ORPHAN_KEY_TABLE',
    11 key_count => key_count);
    12 dbms_output.put_line('orphan key count: ' || to_char(key_count));
    13 end;
    14 /
    orphan key count: 3
    PL/SQL procedure successfully completed.
    SQL> desc orphan_key_table
    Name Null? Type
    SCHEMA_NAME NOT NULL VARCHAR2(30)
    INDEX_NAME NOT NULL VARCHAR2(30)
    IPART_NAME VARCHAR2(30)
    INDEX_ID NOT NULL NUMBER
    TABLE_NAME NOT NULL VARCHAR2(30)
    PART_NAME VARCHAR2(30)
    TABLE_ID NOT NULL NUMBER
    KEYROWID NOT NULL ROWID
    KEY NOT NULL ROWID
    DUMP_TIMESTAMP NOT NULL DATE
    SQL> select index_name, count(*) from orphan_key_table
    2 group by index_name;
    INDEX_NAME COUNT(*)
    T1_PK 3
    Note: orphan key table의 index 는 다시 rebuild 되어야 한다.
    DBMS_REPAIR.SKIP_CORRUPT_BLOCKS
    ===============================
    SKIP_CORRUPT_BLOCKS 은 table 과 index 의 corrupt block 을 skip 하는 것을 enable/disable 을 실시한다.
    Suggestion: SKIP_CORRUPT_BLOCKS 가 enabled되면 orphan key table의 모든
    index 는 모두 rebuild 되어야 한다. ( all index associated with object
    if DUMP_ORPHAN_KEYS was omitted).
    SQL> @skipCorruptBlocks
    SQL> declare
    2 begin
    3 dbms_repair.skip_corrupt_blocks (
    4 schema_name => 'SYSTEM',
    5 object_name => 'T1',
    6 object_type => dbms_repair.table_object,
    7 flags => dbms_repair.skip_flag);
    8 end;
    9 /
    PL/SQL procedure successfully completed.
    SQL> select table_name, skip_corrupt from dba_tables
    2 where table_name = 'T1';
    TABLE_NAME SKIP_COR
    T1 ENABLED
    SQL> -- rows in corrupt block skipped, no errors on full table scan
    SQL> select * from system.t1;
    COL1 COL2
    4 dddd
    5 eeee
    --> Notice the pk index has not yet been corrected.
    SQL> insert into system.t1 values (1,'aaaa');
    insert into system.t1 values (1,'aaaa')
    SQL> select * from system.t1 where col1 = 1;
    no rows selected
    DBMS_REPAIR.REBUILD_FREELISTS
    ===============================
    REBUILD_FREELISTS rebuilds freelists for the specified object.
    SQL> declare
    2 begin
    3 dbms_repair.rebuild_freelists (
    4 schema_name => 'SYSTEM',
    5 object_name => 'T1',
    6 object_type => dbms_repair.table_object);
    7 end;
    8 /
    PL/SQL procedure successfully completed.
    Rebuild Index
    =============
    Note: Every index identified in the orphan key table should be rebuilt to
    ensure consistent results.
    SQL> alter index system.t1_pk rebuild online;
    Index altered.
    SQL> insert into system.t1 values (1, 'aaaa');
    1 row created.
    SQL> select * from system.t1;
    COL1 COL2
    4 dddd
    5 eeee
    1 aaaa
    Reference Document
    ------------------

    Try look to alert<SID>.log file for full error report (you could paste it here).
    Also from alert log you could get real values for db_block_buffers and shared_pool_size parameters that used during instance startup.

  • Which one is the Best Backup and Recovery Method in your point of view?

    Friends,
    Currently we are taking hot backup with archive mode.
    we have backup script to copy the datafile and we will copy the archive files in a separate folder.
    alter tablespace system begin backup;
    host cp /u01/app/oracle/oradata/livedb/system.dbf /u02/online_backup
    alter tablespace system end backup;
    like the above script we will copy all the other data files.
    then in the test environment. we will copy the datafile and archive file.
    we will be recovering by using the below statement.
    sql>recover database until cancel using backup controlfile.
    currently no problem in backup and recovery.
    What i want is......
    is there any other sophisticated and safe way to take a backup and restore it to another server?
    if yes, can anybody point out the steps or link.
    I have heard about......
    DataGuard
    RMAN
    EXP/IMP
    but i never used the above.
    Thanks
    sathyguy

    DataGuard
    RMAN
    EXP/IMP ...
    The only real backup/recovery method here is RMAN, Oracle's integrated backup/recovery tool, which I prefer. As an example for a fully functional RMAN command see 'backup database plus archivelog delete all input'. This statement provides a complete hot database backup including archivelogs and deletes at the successful end all archivelogs in all destinations . Compare this statement with all the steps necessary to do the same job manually. Don't worry you have many ways to finetune your backup.
    For more informations there's a quick start guide:
    http://download-uk.oracle.com/docs/cd/B19306_01/backup.102/b14193/toc.htm
    Dataguard is a high availibility tool, which provides a kind of backup in terms of having a logical or physical standby database. When primary side fails you can switch to this standby database. Such a constellation does not mean, database backups are no longer necessary.
    Export/Import is a logical backup, still often used to recover from human errors (you accidentally dropped a table for example). Don't use it as a replacement for physical backups, especially hot backups,in case of media failures you always will have loss of data, because changes made afterwards the export are not captured.
    Once again I recommend you seriously should consider RMAN.
    Werner

  • ORA-00283: recovery session canceled due to errors

    Dear All,
    I have standby database in which STANDBY_FILE_MANAGEMENT was MANUAL. I have shrink undo table-space in primary database. After 2 days I tried to recover standby database. I got following error.
    ORA-00283: recovery session canceled due to errors
    ORA-01274: cannot add data file '/home/app/oracle/oradata/OMNDB/undotbs01.dbf'
    - file could not be created
    I am unable to shrink undo table-space in standby database as I did in primary database as it is not open.
    please anyone help me to get clarify this issue.
    In Standby_
    SQL> select name from v$datafile;
    NAME
    /home/app/oracle/oradata/OMNDB/system01.dbf
    /home/app/oracle/oradata/OMNDB/undotbs01.dbf
    /home/app/oracle/oradata/OMNDB/sysaux01.dbf
    /home/app/oracle/oradata/OMNDB/MY_oms_ts01.dbf
    /home/app/oracle/oradata/OMNDB/nologging_ts01.dbf

    Thank you CKPT for reply.
    this is the output when MRP
    SQL> recover standby database;
    ORA-00283: recovery session canceled due to errors
    ORA-01111: name for data file 2 is unknown - rename to correct file
    ORA-01110: data file 2: '/home/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00002'
    ORA-01157: cannot identify/lock data file 2 - see DBWR trace file
    ORA-01111: name for data file 2 is unknown - rename to correct file
    ORA-01110: data file 2: '/home/app/oracle/product/10.2.0/db_1/dbs/UNNAMED00002'
    this is in the alert log
    ORA-1112 signalled during: ALTER DATABASE RECOVER CANCEL ...
    Tue Jan 29 09:17:53 2013
    db_recovery_file_dest_size of 10240 MB is 0.00% used. This is a
    user-specified limit on the amount of space that will be used by this
    database for recovery-related files, and does not reflect the amount of
    space available in the underlying filesystem or ASM diskgroup.
    Tue Jan 29 10:29:57 2013
    ALTER DATABASE RECOVER standby database
    Tue Jan 29 10:29:57 2013
    Media Recovery Start
    Managed Standby Recovery not using Real Time Apply
    Tue Jan 29 10:29:57 2013
    Media Recovery failed with error 1111
    ORA-283 signalled during: ALTER DATABASE RECOVER standby database ...

  • ORA-00283: recovery session canceled due to errors. Help me.

    Something appears to be wrong with my control file backup. Upon
    moving the backed up files to my "test" machine, I place them in the
    data directory, and rename my control file backup to the correct name
    and run this procedure:
    - I start the instance
    - I mount the database
    - I issue a recover database
    I then receive the following error:
    ORA-00283: recovery session canceled due to errors
    ORA-01610: recovery using the BACKUP CONTROLFILE option must be done
    Does anyone have any thoughts around this?

    Hi,
    Have you taken backup of control file?
    (alter database backup controlfile to trace)
    Does the path of datafiles on test machine is same as that of production machine from where you have copied files?
    Steps:
    1> startup nomount
    2> copy create controlfile command from tracefile
    If paths are different change them.
    3> recover database until cancel using backup controlfile
    It will ask archive logs path, specify path.
    Press cancel after you have applied all archivelogs.
    4> alter database open resetlogs
    5> add tempfile in database.

  • DATA BLOCK CORRUPTION : ORA-1578 해결 방법

    제품 : ORACLE SERVER
    작성날짜 : 2005-08-18
    DATA BLOCK CORRUPTION : ORA-1578 해결 방법
    =========================================
    모든 오라클 데이타 블럭은 sequence 번호(seq)와 incarnation 번호(inc)를
    갖고 있다. ORA-1578 에러는 seq=0 이고 inc <> 0 (새로운 블럭이 아님)일 때
    발생한다. ORA-1578 에러는 ORA-600[3339] 에러와 함께 발생하곤 한다.
    ORA-1578 에러가 발생하면 corruption이 발생한 화일 번호와 블럭 번호를
    알려준다. 여기서는 이 때의 화일번호를 f, 블럭번호를 b 라고 부르기로 한다.
    <해결 방법>
    1) 우선 해야 할 일은 어떠한 오브젝트가 corrupt 되었는가를 알아내는 것이다.
    다음의 스크립트를 이용하면 알 수 있다.
    SQL>select segment_name, segment_type
    from dba_extents
    where file_id = f and
    b between block_id and block_id + blocks - 1;
    2) 만약 해당 세그먼트가 인덱스이면 drop 시키고 다시 생성하면 된다.
    3) 만약 해당 세그먼트가 테이블이면 corrupt된 블럭의 데이타는 손상된 것이다.
    4) 만약 해당 테이블이 들어있는 export 화일이 있다면 손상된 테이블을 drop
    시키고 import 받는 것이 제일 간단한 방법이다. 하지만, 만약 export 받은
    화일이 없거나 backup해 놓은 화일도 없다면 해당 테이블에 인덱스가 생성되어
    있는 경우에 한해서 다음의 방법을 사용해서 복구를 하도록 한다.
    5) 해당 테이블에 대한 인덱스가 생성되어 있다면 이를 이용해서 corrupt된
    블럭을 피해갈 수 있다. 이 방법은 다음과 같다.
    - empno, ename, deptno 를 컬럼으로 가지는 emp 테이블이 corrupt 되었다고
    가정하자. 그리고, empno 컬럼에 인덱스가 생성되어 있다고 하자. 클러스터화
    되지 않은 모든 테이블은 Unique한 rowid를 가진다.
    rowid를 varchar2/hexadecimal 형식으로 표현하려면 rowidtochar 함수를 이용
    한다.
    SQL> select rowidtochar(rowid) from emp;
    rowid는 총 18자로 block address(8자), dot(1자), row address(4자),
    dot(1자), file address(4자)로 구성되어 있다.
    SQL> select empno, rowid
    from emp
    where empno > 0
    위의 스크립트를 실행시키면 다음과 같은 결과를 얻게 된다.
    EMPNO ROWID
    100 00000003.0000.0006
    101 00000003.0001.0006
    102 00000003.0002.0006
    103 00000003.0003.0006
    500 00000004.0000.000A
    501 00000004.0001.000A
    755 0000001A.0005.000A
    756 0000001A.000C.000A
    만약 인덱스가 character 컬럼에 대한 것이었다면 위의 query 문장을 다음과 같
    이 바꿀 수 있다.
    SQL> select empno, rowid
    from emp
    where empno > '';
    예를 들어 다음과 같은 에러 메시지가 떨어졌다고 하자.
    01578, 00000, "ORACLE data block corrupted (file # 10, block # 4)
    그러면, 다음의 스크립트를 사용하여 손상된 블럭에 있는 employee 에 대한
    empno를 구할 수 있다.
    SQL> select empno from emp
    where empno > 0
    and rowidtochar(rowid) like '00000004.%.000A';
    EMPNO ROWID
    500 00000004.0000.000A
    501 00000004.0001.000A
    이제 emp 테이블과 같은 구조를 갖는 새로운 테이블을 만든다.
    SQL> create table temp
    as select * from emp
    where 1 = 2;
    그런 다음 손상된 부분을 피해서 새로운 테이블에 손상된 테이블의 데이타를
    추가한다.
    SQL> insert into temp select * from emp where empno < 500;
    SQL> insert into temp select * from emp where empno > 501;
    손상된 테이블을 drop 시키고 temp 테이블의 이름을 emp로 변경한다.
    그리고, 백업된 자료나 문서 자료를 통하여 손상된 부분에 대한 정보를 추가한다.
    6) 손상된 블럭에 여러 개의 row가 존재하고 있다면 다음의 방법을 이용한다.
    SQL> create table empnos as
    select empno from emp
    where empno > 0
    and rowidtochar(rowid) not like '00000004.%.000A';
    이 스크립트를 이용하면 손상된 block에 포함되지 않는 empno들을 알 수 있다.
    다음의 스크립트를 계속 실행시켜 복구를 한다.
    SQL> create table temp as select * from emp where 1 = 2;
    SQL> insert into temp
    select emp.empno, emp.ename, emp.deptno
    from emp, empnos
    where emp.empno > 0
    and emp.empno = empnos.empno;
    7) 만약 Data Dictionary의 table이나 index에서 손상된 block이 발생했다면
    지원을 요청해야 한다.

    Hi,
    Take a look in the following Metalink Notes:
    - DBMS_REPAIR example - Doc ID: NOTE:68013.1
    - Handling Oracle Block Corruptions in Oracle7/8/8i/9i/10g - Doc ID: NOTE:28814.
    - Prevention, Detection and Repair of Database Corruption - Doc ID: NOTE:76375.1
    Cheers,
    Francisco Munoz Alvarez
    http://www.oraclenz.com

  • ORA-01172: Recovery of thread 1 stuck at...

    My db got corrupted, and I'm having the following issue when opening it:
    ORA-01172: recovery of thread 1 stuck at block 31823 of file 2
    ORA-01151: use media recovery to recover block, restore backup if neededI did the following... but am now stuck. I accidentally entered a newline when I was supposed to specify the log file (I guess?). Any help would be great. Thanks!
    SQL> recover database until cancel;
    ORA-00279: change 12390169168251 generated at 06/26/2012 09:41:48 needed for
    thread 1
    ORA-00289: suggestion :
    C:\APP\GRExxxxxxx\FLASH_RECOVERY_AREA\MYDB\ARCHIVELOG\2012_06_27\O1_MF_1_1
    27_%U_.ARC
    ORA-00280: change 12390169168251 for thread 1 is in sequence #127
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    ORA-00308: cannot open archived log
    'C:\APP\GRExxxxxxx\FLASH_RECOVERY_AREA\MYDB\ARCHIVELOG\2012_06_27\O1_MF_1_
    127_%U_.ARC'
    ORA-27041: unable to open file
    OSD-04002: unable to open file
    O/S-Error: (OS 2) The system cannot find the file specified.
    ORA-10879: error signaled in parallel recovery slave
    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: 'C:\APP\GRExxxxxxx\ORADATA\MYDB\SYSTEM01.DBF'

    Hi,
    speicfy the logs as it requested to complete the recovery (it might ask you for online redo based on you crash/scn), if you are not left over with any archives with recovery then you cancel the recover and open the database with
    reset logs
    - Pavan Kumar N

  • ORA-01172: recovery of thread 1 stuck at block 1340 of file 2

    Database Version: Oracle 10G rel 10.02
    OS:- Windows XP SP2.
    Scenario:- Trying to open the database .
    Error:-
    SQL> startup open;
    ORACLE instance started.
    Total System Global Area 272629760 bytes
    Fixed Size 1248476 bytes
    Variable Size 100664100 bytes
    Database Buffers 163577856 bytes
    Redo Buffers 7139328 bytes
    Database mounted.
    ORA-01172: recovery of thread 1 stuck at block 1340 of file 2
    ORA-01151: use media recovery to recover block, restore backup if needed
    Please advise.

    SQL> select name,status,enabled from v$datafile where file#=2;
    NAME
    STATUS ENABLED
    D:\ORADATA\ORCL\UNDOTBS01.DBF
    ONLINE READ WRITE

  • ORA-19906: recovery target incarnation changed during recovery

    Hi All,
    I am doing a simple clone from hot backup(copy files,create control file ,recovery etc..)
    After control file creation, when i fire recovery and supply an archive log , i am getting below error ,please note RMAN is nowhere in picture in may case. I referred some notes but none of these seem to be relevant, any clues:
    SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL;
    ORA-00279: change 4762493 generated at 10/06/2011 21:00:05 needed for thread 1
    ORA-00289: suggestion :
    /u01/app/oracle/flash_recovery_area/OTMPRS/archivelog/2011_10_07/o1_mf_1_278_%u_
    .arc
    ORA-00280: change 4762493 for thread 1 is in sequence #278
    Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
    /home/oracle/o1_mf_1_278_78wqrfsx_.arc
    ORA-00283: recovery session canceled due to errors
    ORA-19906: recovery target incarnation changed during recovery

    796808 wrote:
    SQL> select INCARNATION#, RESETLOGS_TIME from V$DATABASE_INCARNATION order by RESETLOGS_TIME ;
    INCARNATION# RESETLOGS
    1 15-SEP-11
    2 03-OCT-11I suggest u you to clone the database using the active duplicate command which runs on 11g. It requires no rman backup and very simple to create the clone . check the below link for active clonning ...
    http://www.orafaq.com/node/2383
    Hope this help you
    --neeraj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Toshiba Recovery method - Which set up is the best

    I have purchased a new lap top and on set up it is asking me to select a recovery method. Options are
    - Recover to out- of -box-state (System Recovery Options are included)
    - Recover without changing the hard drive partitions
    - Recover to a custom size partition
    Which is the best option to select?
    I am thinking that the custom would be the best once I have made my recovery discs after full set up but want to be sure.
    Can anyone help?
    Thanks smilee

    Hi
    - *Recover to out-of-box-state (System Recovery Options are included)*
    This Option sets your notebook back, to the Factory default status. The partitions will be deleted and created again, as they have been on the first boot.
    Note: All data will be lost and HDD Recovery Option will still be available, if you want to recover your notebook again.
    - *Recover without changing the hard drive partitions*
    All data on the first partition will be lost and HDD Recovery Option will be still available, if you want to recover your notebook again.
    - *Recover to a custom size partition*
    All data on the HDD will be lost and HDD Recovery Option will not be available anymore, if you want to recover your notebook again. Be sure to have a recovery DVD created for the future
    Here the FAQ
    http://aps2.toshiba-tro.de/kb0/HTD1303440001R01.htm

  • ORA 1578 error

    Hi to all
    when i am running DB13 for check database it is getting terminated. In system log it is giving ORA 1578 oracle block corrupted. when i go to brtools to run
    command
    brbackup -w only_dbv -c -t online it is giving error username and password not found
    let me of the possible solution.
    Thanks & regards
    saurabh

    Login as root
    switch to ora<SID>,then execute the command
    brbackup -u / -c force -w only_dbv -p init<SID>.sap -m ALL
    Then you will not get this username and password not found.
    Make sure that in your init<SID>.sap the back up type is specified as ONLINE or copy your init<SID>.sap to init<SID>.1.sap and change the type of backup to ONLINE in this file and use this as profile file in the command.
    e.g. brbackup -u / -c force -w only_dbv -p init<SID>.1.sap -m ALL
    Also see help block corrupted in PRD: how truncate a table?

  • ORA-1578 encountered when generating server alert SMG-3503

    In my system, the oracle version is 10.2.0.1.0
    In the alert file I found below errors:
    Mon Sep 12 18:48:33 2011
    ORA-1578 encountered when generating server alert SMG-3503
    ORA-1578 encountered when generating server alert SMG-4121
    ORA-1578 encountered when generating server alert SMG-4121
    Mon Sep 12 18:53:44 2011
    ORA-1578 encountered when generating server alert SMG-4121
    ORA-1578 encountered when generating server alert SMG-4121
    Mon Sep 12 18:58:40 2011
    ORA-1578 encountered when generating server alert SMG-3503
    ORA-1578 encountered when generating server alert SMG-4121
    ORA-1578 encountered when generating server alert SMG-4121
    Mon Sep 12 19:03:47 2011
    ORA-1578 encountered when generating server alert SMG-4121
    ORA-1578 encountered when generating server alert SMG-4121
    Is the error will impact the database or application system?
    What is the cause and solution of this error?

    Hi,
    please post the output of
    select * from V$DATABASE_BLOCK_CORRUPTION; Do you have a standby for this database?
    Edited by: Rodriguez on 02.02.2012 23:08

Maybe you are looking for

  • Problem with acrobat 9 when validating text fields

    Hello I've been using a script to provide feedback for my English Students. The correct input turns the backgroundcolor to green, an incorrect one turns it to red. This script has been working fine for many years including Acrobat Reader 8, but versi

  • How to use DOMParser from an Applet / Or, how to parse XML from an Applet?

    Hey, As stating in the subject line, I wonder how to do it without getting an �Access Denied� error. I would like to parse a XML file that has external DTD pointing to a SYSTEM location. Yes, I can change it to a public location. However, in either w

  • Message Mapping Logical Problem

    Hi there I have an issue with my message mapping. My source structure looks like this. IDOC -Seg1 ---Element1 ---Element2 ---Seg2 ElementA ElementB Ok so I have to map the IDOC to a flat file. Seg 1 is the Header and Seg2 is the Details. For each fla

  • How to run Aplet under Servlet?

    Hi! I'am using servletrunner. I have servlet which is in C:JSKD2.0\examples\. Where should I put the *.class (this is aplet) and how to finish this code to run the aplet? out.println("<HTML>\n"+ "<HEAD>\n"+ " <TITLE>Testing...</TITLE>\n"+ "</HEAD>\n"

  • AxAcroPDF throws unhandled exception on click of TAB

    I am using VB and call the method AxAcroPDF.loadfile. File loads into the viewer in the form and just after the load if I click TAB, I get the below error and VB6 just closes.