블로그 이미지
redkite

카테고리

분류 전체보기 (291)
00.SI프로젝트 산출물 (0)
00.센터 운영 문서 (0)
01.DBMS ============.. (0)
01.오라클 (117)
01.MS-SQL (15)
01.MySQL (30)
01.PostgreSql (0)
01.DB튜닝 (28)
====================.. (0)
02.SERVER ==========.. (0)
02.서버-공통 (11)
02.서버-Linux (58)
02.서버-Unix (12)
02.서버-Windows (2)
====================.. (0)
03.APPLICATION =====.. (11)
====================.. (0)
04.ETC =============.. (0)
04.보안 (5)
====================.. (0)
05.개인자료 (1)
06.캠핑관련 (0)
07.OA관련 (1)
Total
Today
Yesterday

달력

« » 2024.5
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

공지사항

최근에 올라온 글


Script.zip


오라클 데이터베이스를 생성할 때 보통은 DBCA를 이용한다.
그러나 DBCA만 사용해 DB를 생성하다보면, DBCA를 사용할 수 없는 상황에는 당황하게 된다.


다음은 DBCA를 이용할 수 없는 경우 오라클 데이터베이스를 생성하는 절차다.

  1. SID, ORACLE_HOME 설정

    export ORACLE_SID=testdbexport ORACLE_HOME=/path/to/oracle/home

  2. 초기화 파라미터 파일 생성 (minimal)
    $ORACLE_HOME/dbs에 init<SID>.ora 파일을 만든다.

    control_files = (/path/to/control1.ctl,/path/to/control2.ctl,/path/to/control3.ctl)
    undo_management = AUTO
    undo_tablespace = UNDOTBS1
    db_name = test
    db_block_size = 8192
    sga_max_size = 1073741824 # 1GBsga_target = 1073741824 # 1GB

  3. 패스워드 파일 생성

    $ORACLE_HOME/bin/orapwd file=$ORACLE_HOME/dbs/pwd{sid}.ora password=oracle entries=5

  4. 인스턴스 기동

    $ sqlplus '/as sysdba'

    SQL> startup nomount

  5. CREATE DATABASE 문 실행

    create database test
    dblogfile group 1 ('/path/to/redo1.log') size 100M,
    group 2 ('/path/to/redo2.log') size 100M,
    group 3 ('/path/to/redo3.log') size 100M
    character set ko16ksc5601
    national character set al16utf16
    datafile '/path/to/system.dbf' size 500M autoextend on next 10M maxsize unlimited extent management local
    sysaux datafile '/path/to/sysaux.dbf' size 100M autoextend on next 10M maxsize unlimited
    undo tablespace undotbs1 datafile '/path/to/undotbs1.dbf' size 100M
    default temporary tablespace temp tempfile '/path/to/temp01.dbf' size 100M;

    CREATE DATABASE 문 Syntax는 다음과 같다.
    CREATE DATABASE [database name]
    [CONTROLFILE REUSE]
    [LOGFILE [GROUP integer] file specification]
    [MAXLOGFILES integer]
    [MAXLOGMEMBERS integer]
    [MAXLOGHISTORY integer]
    [MAXDATAFILES integer]
    [MAXINSTANCES integer]
    [ARCHIVELOG|NOARCHIVELOG]
    [CHARACTER SET charset]
    [NATIONAL CHARACTER SET charset]
    [DATAFILE filespec [autoextend]]
    [DEFAULT TEMPORARY TABLESPACE tablespace filespec]
    [UNDO TABLESPACE tablespace DATAFILE filespec]
    [SET TIME_ZONE [time_zone_region]];

  6. Data Dictionary View 생성 스크립트 실행

    $ORACLE_HOME/rdbms/admin/CATALOG.sql$ORACLE_HOME/rdbms/admin/CATPROC.sql

  7. SPFILE 생성

    SQL> create spfile from pfile;

  8. 추가 테이블스페이스 생성
  9. sys, system 계정 암호 변경

Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함