BLOG ARTICLE 분류 전체보기 | 226 ARTICLE FOUND

  1. 2009.06.26 DataBase 생성 수동
  2. 2009.06.26 ora-01990 에러
  3. 2009.06.12 ini 파일 분석 Java Class
  4. 2009.06.11 테이블 데이터 강제 삭제 SQL
  5. 2009.06.11 Aqua Data Studio 한글 셋팅법

1. export ORACLE_SID= ORA92
2. sqlplus '/ as sysdba'
sql> startup nomount
3. Create Database <- 첨부화일 cdb.sql
4. User Tablespace 생성
5. sql>@$ORACLE_HOME/rdbms/admin/catalog.sql
   sql>@$ORACLE_HOME/rdbms/admin/catproc.sql
6. $sqlplus system/mamager
  sql>@$ORACLE_HOME/sqlplus/admin/pupbld.sql
7. shutdown
8. $sqlplus '/ as sysdba'
AND


init_SID.ora 파일 ($ORACLE_HOME/dbs 밑에 있음) 의 remote_login_passwordfile='EXCLUSIVE'이것을 comment 처리 하면 정상작동
AND

import java.util.*;
import java.io.*;

public class IniProperties {
    private Properties globalProperties;
    private Map<String,Properties> properties;

    enum ParseState {
        NORMAL,
        ESCAPE,
        ESC_CRNL,
        COMMENT
    }

    public IniProperties() {
        globalProperties = new Properties();
        properties = new HashMap<String,Properties>();
    }

    /**
     * Load ini as properties from input stream.
     */
    public void load(InputStream in) throws IOException {
        int bufSize = 4096;
        byte[] buffer = new byte[bufSize];
        int n = in.read(buffer, 0, bufSize);

        ParseState state = ParseState.NORMAL;
        boolean section_open = false;
        String current_section = null;
        String key = null, value = null;
        StringBuilder sb = new StringBuilder();
        while (n >= 0) {
            for (int i = 0; i < n; i++) {
                char c = (char) buffer[i];

                if (state == ParseState.COMMENT) { // comment, skip to end of line
                    if ((c == '\r') ||(c == '\n')) {
                        state = ParseState.NORMAL;
                    }
                    else {
                        continue;
                    }
                }

                if (state == ParseState.ESCAPE) {
                    sb.append(c);
                    if (c == '\r') {
                        // if the EOL is \r\n, \ escapes both chars
                        state = ParseState.ESC_CRNL;
                    }
                    else {
                        state = ParseState.NORMAL;
                    }
                    continue;
                }

                switch (c) {
                    case '[': // start section
                        sb = new StringBuilder();
                        section_open = true;
                        break;
                   
                    case ']': // end section
                        if (section_open) {
                            current_section = sb.toString().trim();
                            sb = new StringBuilder();
                            properties.put(current_section, new Properties());
                            section_open = false;
                        }
                        else {
                            sb.append(c);
                        }
                        break;

                    case '\\': // escape char, take the next char as is
                        state = ParseState.ESCAPE;
                        break;

                    case '#':
                    case ';':
                        state = ParseState.COMMENT;
                        break;

                    case '=': // assignment operator
                    case ':':
                        if (key == null) {
                            key = sb.toString().trim();
                            sb = new StringBuilder();
                        }
                        else {
                            sb.append(c);
                        }
                        break;

                    case '\r':
                    case '\n':
                        if ((state == ParseState.ESC_CRNL) && (c == '\n')) {
                            sb.append(c);
                            state = ParseState.NORMAL;
                        }
                        else {
                            if (sb.length() > 0) {
                                value = sb.toString().trim();
                                sb = new StringBuilder();
                       
                                if (key != null) {
                                    if (current_section == null) {
                                        this.setProperty(key, value);
                                    }
                                    else {
                                        this.setProperty(current_section, key, value);
                                    }
                                }
                            }
                            key = null;
                            value = null;
                        }
                        break;

                    default:
                        sb.append(c);
                }
            }
            n = in.read(buffer, 0, bufSize);
        }
    }

    /**
     * Get global property by name.
     */
    public String getProperty(String name) {
        return globalProperties.getProperty(name);
    }

    /**
     * Set global property.
     */
    public void setProperty(String name, String value) {
        globalProperties.setProperty(name, value);
    }

    /**
     * Return iterator of global properties.
     */
    @SuppressWarnings("unchecked")
    public Iterator<String> properties() {
        return new IteratorFromEnumeration<String>(
                   (Enumeration<String>)globalProperties.propertyNames());
    }

    /**
     * Get property value for specified section and name. Returns null
     * if section or property does not exist.
     */
    public String getProperty(String section, String name) {
        Properties p = properties.get(section);
        return p == null ? null : p.getProperty(name);
    }

    /**
     * Set property value for specified section and name. Creates section
     * if not existing.
     */
    public void setProperty(String section, String name, String value) {
        Properties p = properties.get(section);
        if (p == null) {
            properties.put(section, new Properties());
        }
        p.setProperty(name, value);
    }

    /**
     * Return property iterator for specified section. Returns null if
     * specified section does not exist.
     */
    @SuppressWarnings("unchecked")
    public Iterator<String> properties(String section) {
        Properties p = properties.get(section);
        if (p == null) {
            return null;
        }
        return new IteratorFromEnumeration<String>(
                   (Enumeration<String>)p.propertyNames());
    }

    /**
     * Return iterator of names of section.
     */
    public Iterator<String> sections() {
        return properties.keySet().iterator();
    }

    /**
     * Dumps properties to output stream.
     */
    public void dump(PrintStream out) throws IOException {
        // Global properties
        Iterator<String> props = this.properties();
        while (props.hasNext()) {
            String name = props.next();
            out.printf("%s = %s\n", name, dumpEscape(getProperty(name)));
        }

        // sections
        Iterator<String> sections = this.sections();
        while (sections.hasNext()) {
            String section = sections.next();
            out.printf("\n[%s]\n", section);
            props = this.properties(section);
            while (props.hasNext()) {
                String name = props.next();
                out.printf("%s = %s\n", name, dumpEscape(getProperty(section, name)));
            }
        }
    }

    private static String dumpEscape(String s) {
        return s.replaceAll("\\\\", "\\\\\\\\")
                .replaceAll(";", "\\\\;")
                .replaceAll("#", "\\\\#")
                .replaceAll("(\r?\n|\r)", "\\\\$1");
    }

    // private class used to coerce Enumerator to Iterator.
    private static class IteratorFromEnumeration<E> implements Iterator {
        private Enumeration<E> e;

        public IteratorFromEnumeration(Enumeration<E> e) {
            this.e = e;
        }

        public boolean hasNext() {
            return e.hasMoreElements();
        }

        public E next() {
            return e.nextElement();
        }

        public void remove() {
            throw new UnsupportedOperationException("Can't change underlying enumeration");
        }
    }
}


===========================================================================

사용법 :

java.io.FileInputStream fis = new java.io.FileInputStream
          (new java.io.File( 파일경로+파일명 ));
       iniProp.load(fis);

String strVFormat=iniProp.getProperty("VALIDITY","Format");

AND

truncate table 테이블명;
AND

설정

Aqua Data Studio를 실행하면 UI의 일부 및 데이터베이스 환경에 따라 결과 값의 한글이 깨지는 현상이 발생할 수 있다. 각각에 대한 적절한 설정 방법은 다음과 같다.

Server Properties

Grid 또는 Text Results 에서 칼럼의 한글 데이터가 깨지는 경우 서버 속성을 다음 두가지 값 중 하나를 적용하면 된다.

  • Driver Param: 드라이버 파라미터의 값으로 "?CHARSET=eucksc"를 입력한다.
  • Charset: Character set의 값으로 eucksc를 선택한다.

위 화면은 두가지를 모두 적용한 예이다.

Options

메뉴에서 File → Options → General을 선택한 후 그림과 같이 Appearance 부분의 Look and Feel과 Font 설정을 변경하도록 한다. 그림의 설정만 적용되는 것은 아니므로 취향에 맞게 수정하도록 한다. 이 설정으로 메인 화면 및 Editing 윈도우를 포함하여 전체 범위에 대하여 한글이 적용된다.

 


AND