Oracle 10g 의 archive mode

10g에서는 약간 parameter 값이 틀린데요.
ORA-32006,ORA-19905 이 에러 뜨면 8i, 9i 쓰시던 분들이 약간 당황하는 문제인데 알고 나면 별거 없지요.
==============================================================================================

1. 일단  LOG_ARCHIVE_START parameter 가 없어졌구요.
2. LOG_ARCHIVE_FORMAT 은 %s,%t,%r  형태가 되어야 합니다.
3. LOG_ARCHIVE_DEST 은 당연히 있어야 겠죠? 10개까지 지정할수 있습니다.
ex) *.LOG_ARCHIVE_DEST_1='LOCATION=C:\oracle10GDB\database\archive1'
     *.LOG_ARCHIVE_DEST_2='LOCATION=C:\oracle10GDB\database\archive2'

여기서 s,t, r의 의미는  %s log sequence number
                               %t thread number,
                               %r resetlogs 

Posted by pat98

2006. 10. 26. 22:54 여행

제주도 용두암.


급하게 댕겨온 1박2일 제주도 출장, 제주
공항 옆이라 시간이 좀 남아서 용두암 구경. 옛날엔 제주도 신혼여행 갔다온
사람들 보면 항상 이 장소에서 사진 찍었던데, 요즘도 제주도로 신혼여행을 ?
근데 용두암.. 용처럼 생기지 않았던데 -_-;
 
역시 제주도는 쉬러와야 제대로 즐길듯..
다음에 좀더 좋은 기회를 기약하며 안녕 ~~
Posted by pat98

Oracle 10g에서 vip 를 바꾸어보자.

vip 변경
=================================================================
ex)
srvctl stop database -d promise
srvctl stop nodeapps -n promise1
srvctl stop nodeapps -n promise2
crsctl stop crs (root user)

srvctl modify nodeapps -n mynode1 -A 138.2.166.152/255.255.255.0/lan1  (root user)

crsctl start crs (root user)
srvctl start nodeapps -n promise1
srvctl start nodeapps -n promise2
srvctl start database -d promise

================================================================
vip 이중화
================================================================
srvctl modify nodeapps -n mynode1 -A 138.2.166.152/255.255.255.0/lan1/lan2  (root user로) <- 요기 파란색부분이 중요함..(첫번째 놈,두번째 놈 순서대로)

MC/SG lancard failover 구성해 놓고 oracle에서 lancard failover 셋팅해 놓지 않으면 무용지물이라고 함.

ex)
srvctl stop database -d promise
srvctl stop nodeapps -n promise1
srvctl stop nodeapps -n promise2
crsctl stop crs (root user)

srvctl modify nodeapps -n mynode1 -A 138.2.166.152/255.255.255.0/lan1\lan2  (root user)
srvctl modify nodeapps -n mynode1 -A 138.2.166.153/255.255.255.0/lan1\lan2  (root user)

crsctl start crs (root user)
srvctl start nodeapps -n promise1
srvctl start nodeapps -n promise2
srvctl start database -d promise



Posted by pat98

임펠리테리는 개성이 별루 없어서 그의 플레이는 그다지 좋아 하지는 않는데, 이 곡은 언제 들어도 좋은거 같다.
1988년 작이니 거의 20년이 다 되어가네.

    Posted by pat98

    2006. 10. 20. 08:39 오라클

    오라클 삭제하기



    Unix 에서는 rm 으로 삭제하면 simple 하게 없어지지만, windows 는 지워도 registry에 정보가 남아서 Uninstaller로 지운후 다시 설치 해도 설치가 안되는 경우가 종종 있죠? 이렇게 하면 99% 깨끗하게 지워짐니다. windows 에서 재설치 때문에 고민하시는 분들 이렇게 한번 해 보세요.
    =====================================================================================================

    WIndows NT, 2003 의 경우
    1. 시작-> 실행-> regedit을 기동하여
      HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE 폴더 전체를 삭제한다.
    2. HKEY_LOCAL_MACHINE\SOFTWARE\odbc 를 삭제한다.
    3. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ 에서 oracle로
      시작되는 폴더들을 삭제한다.
    4. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\
      Application\ 에서 oracle로 시작되는 폴더들을 삭제한다.
    5. regedit을 종료한다.
    6. 설정-> 제어판 -> 시스템을 실행하여 환경 tab에서
    7. autoexec.bat 화일에서 %ORACLE_HOME%\bin과 JRE path를 remove한다.
    8. <system_drive>: \Winnt\Profiles\All Users\시작메뉴\Programs\Oracle
      폴더를 삭제한다.
    9. <system_drive>: \Program Files\Oracle 폴더를 삭제한다.
    10. 시스템을 재기동시킨다.
    11. Oracle Home directory를 삭제한다.
        (HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_HOME 에서 확인 가능).

    * CWI32.DLL 파일 삭제가 안될경우에는 재부팅시 F8 누르고 안전모드로 부팅해서 삭제하면 된다.

    Posted by pat98

    2006. 10. 17. 09:08 오라클

    export & import matrix


    오라클 export & import 를 할때, 어떤 버전끼리 되는지 고민되는 때가 있는데, 이에 대한 문서를 보면 도움이 된다..

    [Metalink 문서번호 132904.1]

    PURPOSE
    -------
    This article describes several issues related with the compatibility of the
    different versions of the Oracle EXPORT and IMPORT utilities.


    SCOPE & APPLICATION
    -------------------
    The article is intended for users of the Oracle7, Oracle8, Oracle8i,
    Oracle9i, and Oracle10g databases who wish to use the EXPORT and IMPORT
    utilities to export data from an Oracle database release x and import
    this data into an Oracle database release y.  The article gives information
    which version of the utility to use when performing the export and import,
    and how to prepare the Oracle data dictionary before exporting the data.
    For the transportable tablespaces export/import, see:
    Note 291024.1 "Compatibility and New Features when Transporting Tablespaces
    with Export and Import"


    SUMMARY
    -------
    1. Export the data with the Export utility of the lowest database version
      involved.

    2. Import the data with the Import utility of the target database.

    3. Running an Oracle7 Export utility against an Oracle9i database is not
      supported.


    COMPATIBILITY MATRIX FOR EXPORT & IMPORT BETWEEN DIFFERENT ORACLE VERSIONS
    --------------------------------------------------------------------------

    Introduction.
    -------------

    With the Oracle EXPORT and IMPORT utilities you can transfer data objects
    between Oracle databases, even if they reside on platforms with different
    hardware and software configurations.

    The Oracle EXPORT utility extracts the object definitions and table data
    from an Oracle database and stores them in an Oracle binary-format export
    dump file located typically on disk or tape.  The files can then be
    transferred using FTP or physically transported (in the case of tape)
    to a different site.  When transferring the export dump file over a network,
    the file has to be transmitted in binary mode.  Transmitting export files in
    character mode (ASCII) causes errors when the file is imported, resulting
    most likely in: IMP-9 or IMP-10, followed by IMP-0.

    The Oracle IMPORT utility reads the object definitions and table data
    from the export dump file and then inserts the information into the Oracle
    database.

    Starting with Oracle10g Release 1 (10.1.0.x) we have introduced the new
    Export DataPump (expdp) and Import DataPump (impdp) utilities.  Export
    dumpfiles created with Export DataPump can only be read by Import DataPump.
    And export dumpfiles created with the original Export utility cannot be read
    by the Import DataPump client.


    Data Dictionary Views.
    ----------------------

    Before using the EXPORT or IMPORT utility, the Data Dictionary has to be
    prepared with the views that are needed by these utilities.  This can be done
    by running the script:

      UNIX   : SQL> @$ORACLE_HOME/rdbms/admin/catexp.sql

      Windows: SQL> @%ORACLE_HOME%\rdbms\admin\catexp.sql

    This script CATEXP.SQL has to be run by the user SYS.  The script is called
    automatically by the CATALOG.SQL script.  Both scripts CATEXP.SQL and
    CATALOG.SQL need to be run only once on a database.  Normally, you never
    need to run it again before you perform an export or import (the errors
    EXP-24 or IMP-23 indicate that the views are not correct anymore).

    The script CATEXP.SQL performs the following tasks to prepare the database
    for an export and/or import:

    - create the required export and import views in the data dictionary;
    - create the EXP_FULL_DATABASE role and the IMP_FULL_DATABASE role;
    - assign all necessary privileges to the EXP_FULL_DATABASE role and the
      IMP_FULL_DATABASE role;
    - assign EXP_FULL_DATABASE and IMP_FULL_DATABASE to the DBA role;
    - update table sys.props$ with the version of the export and import views
      (see the notes at the end of the article).

    When creating an Oracle7 export file from an Oracle8/8i database by running
    the Oracle7 EXPORT utility against the Oracle8/8i server (see details below),
    the user SYS must have run the CATEXP7.SQL script on the Oracle8/8i database:

      UNIX   : SQL> @$ORACLE_HOME/rdbms/admin/catexp7.sql

      Windows: SQL> @%ORACLE_HOME%\rdbms\admin\catexp7.sql

    This script creates the export views that make the database look, to EXPORT,
    like an Oracle7 release database.  This means that the views will not see any
    new Oracle8/8i specific objects, so the export file can be imported
    without problems in the Oracle7 database.

    Keep in mind that both the scripts CATEXP.SQL and CATEXP7.SQL only need to
    be run once: CATEXP.SQL creates the exu8% views which are used by the
    Oracle8/8i/9i/10g EXPORT utilities, and CATEXP7.SQL creates the exu7% views
    which are used by the Oracle7 EXPORT utilities.
    So if both scripts have been run by SYS, you do not need to run them again.

    The procedure mentioned above, also applies for creating an Oracle6 export
    dump file from an Oracle7 database.  In this case the user SYS must have run
    the CATEXP6.SQL script on the Oracle7 database.

    Note that running an Oracle7 Export utility against Oracle9i database is not
    supported: in a downgrade scenario, we only support one functional release
    back. This also means that running an Oracle8 Export utility against an
    Oracle10g database is not supported (currently, it is only supported to run
    the Oracle8i 8.1.7 export utility or higher against the Oracle10g database).


    Database Migration to Oracle9i / Oracle10g with a full database export/import.
    ------------------------------------------------------------------------------

    If the database is migrated to Oracle9i or Oracle10g, there is a limitation
    regarding a direct upgrade with a full database export and a full database
    import.  This *only* applies to the FULL mode (FULL=Y) of the database
    import from an export dump file created in FULL mode.
    It remains possible to:
    - import data in USER mode (FROMUSER=... TOUSER=...)
    - import data in TABLE mode (FROMUSER=... TABLES=...)
    - export and import data in TABLESPACE mode (TRANSPORT_TABLESPACE=Y)
    Note that an import client is technically capable to read export dump files
    created by EXPORT release 5.1.22 and higher (up to same version).
    This migration limitation is related to the available upgrade paths
    as described in the Migration manual. The main reason for only supporting
    a direct migration from the terminal release of a major version (like 8.1.7
    for Oracle8i), to a new major version (like 9.2.0 for Oracle9i) is the fact
    that this terminal release was the latest release. I.e.:
    - for Oracle7, the release 7.3.4. is the latest released version,
    - for Oracle8, the release 8.0.6. is the latest released version,
    - for Oracle8i, the release 8.1.7. is the latest released version.
    Any known problems (and in particular data dictionary related issues)
    that were identified in the earlier versions of the major release
    (like 8.1.5 and 8.1.6) are very likely fixed in the latest release (8.1.7)
    or with the latest patchset for that release (8.1.7.4.0).
    See also sections 'Basic Compatibility' and 'Limitations' below for details.

    1. Migration to Oracle9i release 2 - 9.2.0.x :
      -------------------------------------------
      Direct migration with a full database export and full database import
      is only supported if the source database is:
      - Oracle7 : 7.3.4
      - Oracle8 : 8.0.6
      - Oracle8i: 8.1.7
      - Oracle9i: 9.0.1

    2. Migration to Oracle10g release 1 - 10.1.0.x :
      ---------------------------------------------
      Direct migration with a full database export and full database import
      is only supported if the source database is:
      - Oracle8 : 8.0.6
      - Oracle8i: 8.1.7
      - Oracle9i: 9.0.1 or 9.2.0

    3. Migration to Oracle10g release 2 - 10.2.0.x :
      ---------------------------------------------
      Note that you must first apply the specified minimum patch release
      (or any higher patch release) !
      Direct migration with a full database export and full database import
      is only supported if the source database is:
      - Oracle8i :  8.1.7.4
      - Oracle9i :  9.0.1.4 (or higher) or 9.2.0.4 (or higher)
      - Oracle10g: 10.1.0.2 (or higher)

    Examples:
    1. From 8.1.7.4 to 9.2.0.7: Full database export with the 8.1.7.4 export
      utility, and full database import with the 9.2.0.7 import utility is
      a supported migration method.

    2. From 8.0.5.0 to 10.1.0.2: Full database export with the 8.0.5.0 export
      utility, and full database import with the 10.1.0.2 import utility is
      *NOT* a supported migration method.
      Possible alternatives:
      a. First upgrade the 8.0.5.0 database to 8.0.6.0, apply latest patchset
         8.0.6.3 and afterwards you can migrate with a full database export
         with the 8.0.6.3 export utility, and a full database import with the
         10.1.0.2 import utility.
      b. Or do a full database export with the 8.0.5.0 export utility,
         pre-create the users in the Oracle10g datatabase, and do a schema level
         import with the 10.1.0.2 import utility.

    3. From 9.2.0.1 to 10.2.0.1: First apply the 9.2.0.4 patchset (or any higher
      patchset release, such as 9.2.0.7). Full database export with the 9.2.0.4
      export utility (resp. 9.2.0.7), and full database import with the 10.2.0.1
      import utility is a supported migration method.


    Basic Compatibility.
    --------------------

    Definition Source database = the database where the data is exported from.
    Definition Target database = the database where the data is imported into.

    1) Always use a version of the EXPORT utility that is equal to the
      lowest version of either the source or the target database.
      This means:
      a) When creating an export dump file for an import into a higher release
         database (e.g.: from Oracle8i to Oracle9i), use a version of the
         EXPORT utility that is equal to the version of the source database
         (= lowest version = Oracle8i in this case).
         The export fails if you use a higher release export version.
         For example, if you use the export 9.0.1 utility the export data
         from an 8.1.7 database, you will get the errors:
            EXP-56 Oracle error 942 encountered
            ORA-942 table or view does not exist
            EXP-0 Export terminated unsuccessfully
         Solution: use the lowest release export utility (8.1.7 in this case).
      b) When creating an export dump file for an import into a lower release
         database (e.g.: from Oracle9i to Oracle8i), use a version of
         the EXPORT utility that is equal to the version of the target database
         (= lowest version = Oracle8i in this case).
         (1) When creating an Oracle6 export file from an Oracle7 database by
             running the Oracle6 EXPORT utility against the Oracle7 server,
             the user SYS must first run the CATEXP6.SQL script on the Oracle7
             database. This script creates the export views that make the
             database look, to EXPORT, like an Oracle6 release database.
         (2) When creating an Oracle7 export file from an Oracle8/8i database
             by running the Oracle7 EXPORT utility against the Oracle8/8i
             server, the user SYS must first run the CATEXP7.SQL script on the
             Oracle8/8i database. This script creates the export views that
             make the database look, to EXPORT, like an Oracle7 release
             database.
         (3) When creating an Oracle8/8i export file from an Oracle9i database
             by running the Oracle8/8i EXPORT utility against the Oracle9i
             server, you do not have to take any special steps. I.e., you do
             not need to run the 8i version of catexp.sql against the 9i database.
             You only need to run the 8i exp executable against the 9i database.
             Be aware that several Oracle9i specific features are not
             supported/exported (e.g. no LOBs and objects are exported when
             using DIRECT=YES).  See the "Oracle9i Database Utilities" manual
             for a complete list of these restrictions).
    2) With some patchsets the data dictionary export views are also changed.
      As a result it will not be possible to run this patched Export utility
      against an unpatched database. Therefore the same basic rule also applies
      to the patchset release: Export the data with the Export utility of the
      lowest database version involved.
      Example: an export with 9.2.0.5 export client from a 9.2.0.1 database can
      give the errors:
         EXP-00008: ORACLE error 942 encountered
         ORA-00942: table or view does not exist
         EXP-00024: Export views not installed, please notify your DBA
         EXP-00000: Export terminated unsuccessfully
      To successfully export from a 9.2.0.1 database (select status, version,
      comp_id from dba_registry;) that is located in a 9.2.0.1 $ORACLE_HOME
      (select * from v$version;), use the 9.2.0.1 export utility, and not
      the 9.2.0.2 or higher export utility.
      Or an export with 9.2.0.6 export client from a 9.2.0.5 database will give
      the following errors on the export a partitioned table with a subpartition
      template:
         EXP-00056: ORACLE error 6550 encountered
         ORA-06550: line 1, column 48:
         PLS-00302: component 'CHECK_MATCH_TEMPLATE' must be declared
         ORA-06550: line 1, column 14:
         PL/SQL: Statement ignored
      Solution: use the 9.2.0.5 export client if your intention is to import
      back into a 9.2.0.5 or any higher release database.
    3) Always use a version of the IMPORT utility that is equal to the
      version of the target database.


    Limitations.
    ------------

    The following limitations apply to the EXPORT and IMPORT utilities (see
    details in the matrix below):

    1. Oracle export dump files can only be read by the Oracle IMPORT utility
      because these dump files are stored in a special Oracle-binary format.
    2. Every export dump file is importable into all future major, patch, and
      maintenance releases of Oracle.
    3. The export dump files cannot be read by IMPORT utilities of previous
      maintenance releases and versions.  So, a version 10gR2 (10.2.0.x) export
      dump file cannot be imported by a version 10gR1 (10.1.0.x) IMPORT utility
      (possible errors: ORA-2248), and a version 9 export dump file cannot be
      imported by a version 8i IMPORT utility (possible errors: IMP-10 and
      IMP-21), and a version 8 export dump file cannot be imported by a
      version 7 IMPORT utility (possible errors: IMP-69 and IMP-21).
      In all these cases, the import will terminate with the error IMP-0
      "Import terminated unsuccessfully".
    4. IMPORT can read export dump files created by EXPORT release 5.1.22 and
      higher (up to same version).
    5. IMPORT cannot read export dump files created by the EXPORT utility of a
      higher maintenance releases or versions.  So, a release 8.1 export dump
      file cannot be imported by a release 8.0 IMPORT utility, and a
      version 8 export dump file cannot be imported by a version 7 IMPORT utility.
    6. The Oracle6 (or earlier) EXPORT utility cannot be used against an Oracle8
      or Oracle8i or higher release database.
    7. Whenever a lower version EXPORT utility runs with a higher version of the
      Oracle Server, any categories of database objects that did not exist
      in the lower version are excluded from the export.  For example,
      partitioned tables are not exported by the version 7 EXPORT utility.
      If you need to move a version 8 partitioned table to a version 7 database,
      then first reorganize the table into a non-partitioned table.


    Matrix 1: Which EXPORT utility to use when importing into an Oracle8
             or a lower database release
             (always use IMPORT utility of the target database):


    Remarks:
    1) IMPORT can read export dump files created by EXPORT release 5.1.22 and
      higher (up to same version).
    2) An Oracle5 or Oracle6 export dump and an Oracle7 IMPORT:
      see the Oracle Utilities Manual, Chapter 2 "Import" for special
      considerations to keep in mind.
    3) To export from Oracle7 for import into an Oracle6 database: user SYS
      must run script CATEXP6.SQL on the Oracle7 database first (this script
      needs to be run only once to have the version6 views been created).
    4) To export from Oracle8, Oracle8i for import into an Oracle7 database:
      user SYS must run script CATEXP7.SQL on the Oracle8/8i database first
      (this script needs to be run only once in order to create the version7
      views).
    5) Only the terminal Oracle8 release (8.0.6) was supported against an
      Oracle9i database: to export from Oracle9i and import into 8.0.6,
      use the Oracle8 export utility.


    Matrix 2: Which EXPORT utility to use when importing into an Oracle8
             or a higher database release
             (always use IMPORT utility of the target database):

    Remarks:
    1) IMPORT can read export dump files created by EXPORT release 5.1.22 and
      higher (up to same version).
    2) An Oracle5 or Oracle6 export dump and an Oracle7 IMPORT:
      see the Oracle Utilities Manual, Chapter 2 "Import" for special
      considerations to keep in mind.
    3) To export from Oracle7 for import into an Oracle6 database: user SYS
      must run script CATEXP6.SQL on the Oracle7 database first (this script
      needs to be run only once to have the version6 views been created).
    4) To export from Oracle8, Oracle8i for import into an Oracle7 database:
      user SYS must run script CATEXP7.SQL on the Oracle8/8i database first
      (this script needs to be run only once in order to create the version7
      views).
    5) Only the terminal Oracle8 release (8.0.6) was supported against an
      Oracle9i database: to export from Oracle9i and import into 8.0.6,
      use the Oracle8 export utility.


    Matrix 2: Which EXPORT utility to use when importing into an Oracle8
             or a higher database release
             (always use IMPORT utility of the target database):

    Posted by pat98


    파이란 볼때는 되게 슬펐었는데, 이상하게 영화에 푹 빠지지 못했는지 별로 슬픈 생각이 안들었다.
    감정이 많이 메말랐나?
    Posted by pat98

    2006. 10. 14. 22:10 아무거나

    박민규의 '핑퐁'


    결혼식을 2탕이나 갔다왔다가 (헉 지겨워), 가을은 독서의 계절이라. 돌아오는 길에 서적에 들러서 사온
    박민규의 '핑퐁'
    표지만 보면 만화책일것 같은 느낌이 든다.(실제로도 핑퐁이라는 일본만화책도 있음).아직 다 읽지는 못했는데, 문체도 마음에 들고 나름대로 재미도 있다. 뭐 맨날 왕따 당하는 중학교 3학년 소년이 인류를 대표해 탁구시합에 나간다는 내용..좀 뜬금없긴 한데 결코 가볍지는 않다.
    작가가 마음에 들어서 이전 작품인 '삼미슈퍼스타즈의 마지막 팬클럽' 도 온라인 서점에 주문해 놓았다.
    Posted by pat98

    부모님 살아 계실 때 꼭 해드려야 할 45가지 라는 책의 review 를 읽다가 발견한 한컷
    Posted by pat98

    2006. 10. 9. 21:26 오라클

    10g 휴지통 기능




    10g 부터 휴지통 기능이 생겼다. 뭐 원도우 바탕화면 휴지통이랑 같다고 생각하면 된다. 해당 객체를 삭제시 바로 안 없어지고 휴지통에 들어가 계신다. 필요할 때 뒤져서 쓰면 되는 것이다.
    나름대로 필요한 기능인거 같기도 하고, 쓰잘때기 없는 기능 같기도 하고..
    근데 아직도 10g에 익숙하지 않은 사람들이 많아 불편해 하는 기능인거 같다. (조회해 보면 table 이름이 막 지저분하게 나오니깐 안 좋아하는거 같다. ㅋ)

    그럼 일단 휴지통 기능을 enable/disable 하는 방법은..

    * 10g Release1 의 경우
    - 아래와 같은 쿼리로 "_recyclebin" parameter 가 어찌 셋팅되어 있는지 조회한다.

    SQL>  SELECT a.ksppinm, b.ksppstvl, b.ksppstdf
    FROM x$ksppi a, x$ksppcv b WHERE a.indx = b.indx AND a.ksppinm like '%recycle%'
    ORDER BY a.ksppinm;

    값이 true 이면 false 로 만들어 버리자.

    SQL> ALTER SYSTEM SET "_recyclebin"=FALSE SCOPE = BOTH;

    * 10g Release2 의 경우
    - R2는 default 값이 ON 이므로 OFF 로 만들어 버린다.

    SQL> ALTER SESSION SET recyclebin = OFF;
    SQL> ALTER SYSTEM SET recyclebin = OFF;

    ==================================================================================
    휴지통: drop된 DB객체들을 아래의 상황이전까지 보유한다.
    - purge명령으로 영구히 삭제
    - undrop명령으로 drop된 객체를 복구
    - 테이블스페이스내 (휴지통의) 공간이 부족할때
    - 테이블스페이스가 extend될때

    * 휴지통에 들어있는 객체들 보기
    user_recyclebin
    dba_recyclebin

    * 휴지통 비우기
    SQL> purge recyclebin;             사용자의 휴지통 비우기
    SQL> purge dba_recyclebin;      휴지통내의 모든 놈들 비우기
    SQL> purge tablespace users;   users테이블스페이스의 휴지통 비우기
    *purge table "휴지통내의 이름"    휴지통의 하나의 객체만 제거시


    * 휴지통의 객체 복구
    SQL> flashback table 휴지통내의 이름 to before drop;

    * 휴지통에 넣지 않고 drop
    SQL> drop table 테이블명 purge;


    * 만일 휴지통에 들어있는 객체에 대해 drop을 수행하면 아래와 같은 에러를 뱉는다.
    SQL> drop table "BIN$biebYQhZRLmp9LlnMAD1VQ==$0";
    drop table "BIN$biebYQhZRLmp9LlnMAD1VQ==$0"
              *
    1행에 오류:
    ORA-38301: 휴지통에 있는 객체에 대해 DDL/DML을 수행할 수 없음

    [실전연습]
    SQL> create table aa(aa integer);
    SQL> drop table aa;
    SQL> select * from tab;
    TNAME                                    TABTYPE         CLUSTERID
    ---------------------------------------- -------------- ----------
    BIN$biebYQhZRLmp9LlnMAD1VQ==$0           TABLE

    SQL> show recyclebin
    ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
    ---------------- ------------------------------ ------------ -------------------
    AA               BIN$biebYQhZRLmp9LlnMAD1VQ==$0 TABLE        2004-11-23:18:13:00

    SQL> purge recyclebin;
    SQL> show recyclebin
    SQL> select * from tab;

    선택된 레코드가 없습니다.


    휴지통에 존재하는 객체를 제거
    SQL> show recyclebin
    ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
    ---------------- ------------------------------ ------------ -------------------
    AA               BIN$dm+wnjtVQye0d09bCvzHbw==$0 TABLE        2004-11-23:18:34:16

    SQL> purge table "BIN$dm+wnjtVQye0d09bCvzHbw==$0";
    테이블이 지워졌습니다.


    휴지통내의 객체 복구
    SQL> show recyclebin
    ORIGINAL NAME    RECYCLEBIN NAME                OBJECT TYPE  DROP TIME
    ---------------- ------------------------------ ------------ -------------------
    AA               BIN$VPaE9OG4Qwa+KC0MesYKqw==$0 TABLE        2004-11-23:18:49:00

    SQL> flashback table "BIN$VPaE9OG4Qwa+KC0MesYKqw==$0" to before drop;
    플래시백이 완료되었습니다.

    SQL> select * from tab;
    TNAME                                    TABTYPE         CLUSTERID
    ---------------------------------------- -------------- ----------
    AA                                       TABLE

    Posted by pat98

    12-18 17:03
    Flag Counter
    Yesterday
    Today
    Total

    글 보관함

    최근에 올라온 글

    달력

     « |  » 2024.12
    1 2 3 4 5 6 7
    8 9 10 11 12 13 14
    15 16 17 18 19 20 21
    22 23 24 25 26 27 28
    29 30 31

    최근에 달린 댓글