ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 오라클
    SysAdmin 2011. 11. 9. 01:21
    -- 버전 확인
    select * from product_component_version

    -- 문자집합
    SQL> select * from nls_database_parameters where parameter like '%CHARACTERSET%';
    -- SQL> select userenv('language') from dual;
    KO16KSC5601
    한글 완성형 2350 한글 4888 한자 히라가나 카타카나 영문 기호
    가나다 순
    KO16MSWIN949
    일명 확장완성형(MS에서 windows 에 만들어 놓은 codepage)
    한글 KO16KSC5601 를 포함한 현대한글조합 가능 8822자 까지 표현
    8.0.6 ~
    (AL16UTF16)
    모든 글자를 2byte or 4byte로 표현
    UTF8
    UNICODE 3.0만을 지원
    ascii는 1byte, 그 외 유럽쪽은 2byte, 아시아는 3byte(CJK)
    한글 11172자 지원(고어도 지원) 및 가나다 순 정렬
    AL32UTF8 -- 9i ~
    새로운 데이타베이스 버전이 나올 수록 그 순간의 최신 버전의 유니코드를 지원
    9.0.x : Unicode 3.0 
    9.2.x : 3.1 
    10.1.x : 3.2 
    10.2.x : 4.0 

    NLS_LANG=AMERICAN_AMERICA.UTF8; export NLS_LANG
    /*
    set NLS_LANG=<로케일>.<캐릭터셋>
    set NLS_LANG=AMERICAN_AMERICA.KO16KSC5601
    한글 완성형(KSC5601): 한글 2350자, 한자 4880자, 히라카나(Hiragana)와 카타카나(katakana) 등
    set NLS_LANG=AMERICAN_AMERICA.KO16MSWIN949
    set NLS_LANG=KOREAN_KOREA.KO16KSC5601
    set NLS_LANG=KOREAN_KOREA.KO16MSWIN949
    */

    nvarchar2
    INSERT INTO ... VALUES(TO_NCHAR('Data')/* For Oracle 9 and greater */, N'Data',..);

    lengthb(convert(hangul_column,'UTF8','KO16KSC5601'))

    C:\app\{ID}\product\11.2.0\dbhome_1\deinstall\deinstall.bat


    imp할 때 'IMP-00008: 엑스포트 파일에 인식할 수 없는 명령이 있습니다' 오류가 발생한다
    set NLS_LANG=AMERICAN_AMERICA.KO16MSWIN949
    or set NLS_LANG=AMERICAN_AMERICA.KO16KSC5601

    -- tatget datebase 의 charter set 조회
    select value from nls_database_parameters where parameter='NLS_CHARACTERSET';

    -- 자동으로 USER 생성이 되지는 않는다.(Oracle Export Files; *.dmp)
    D:\backup>exp userid=scott/tiger@{TNS 이름} file=scott.dmp log=scott.log
    또는 D:\backup>exp userid=system/manager owner=scott file=scott.dmp

    D:\backup>exp userid=scott/tiger tables=(emp, dept) rows=n file=structure.dmp
    /*

    exp R3/R3@SIGN406 FILE='/data1/platon/0808008' GRANTS=Y INDEXES=Y ROWS=N CONSTRAINTS=Y TRIGGERS=Y COMPRESS=Y DIRECT=N CONSISTENT=N STATISTICS=ESTIMATE OWNER=R3

    */

    SQL> connect /as sysdba --  conn /as sysdba or system/manager
    연결되었습니다.
    SQL> drop user scott cascade;


    SQL> create user scott identified by tiger
    2 default tablespace users
    3 temporary tablespace temp
    4 quota 100m on users;

    SQL> grant connect, resource to scott;

    SQL> connect scott/tiger; --  conn scott/tiger; 

    SQL> drop table emp cascade constraint;

    D:\backup>imp userid=system/manager fromuser=scott touser=scott file=scott.dmp log=scott.log buffer=20000000
    /*


    imp system/manager file=scott.dmp indexfile=index.sql fromuser=scott touser=scott rows=n


    imp userid=system/manager fromuser=scott touser=scott file=scott.dmp log=scott.log buffer=20000000 ignore=y


    imp userid=system/manager fromuser=scott touser=scott file=scott.dmp log=scott.log buffer=20000000 show=y

    */


    D:\backup>imp scott/tiger tables=(emp) file=scott.dmp

    /*


    imp userid=scott2/tiger2 tables=(emp) file=scott.dmp log=nfpis2.log buffer=20000000 ignore=y statistics=none

    -- CREATE OR REPLACE VIEW scott2.emp AS SELECT * FROM scott.emp2;


    */

    D:\backup>imp userid=system/manager tables=(emp) file=scott.dmp fromuser=system touser=scott

    'public synonym'은 익스포트되지 않는다.

    Flashback Query

    to generate a set of tables that have foreign keys


    참조 사이트:


Designed by Tistory.