database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
ㆍOracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Oracle Tutorials 9243 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 9243
오라클 8i 데이터베이스 생성 방법
작성자
정재익(advance)
작성일
2002-01-05 11:24
조회수
12,696

The procedure of Oracle8i Database

 

원본출처 : http://sh.hanarotel.co.kr/~ggola/telecom/linux/create_db.htm

[b][color=BLUE]사전준비 : [/color][/b]
  parameter file and creation database scripts

[b][color=BLUE]준비List : [/color][/b]
  parameter file
           
         - initial parameter file for database creation
[color=005533]
최초 Database생성시 parameter

#
# this is initial parameter for just one time using when you create database
#
# system features
# CPU PIII (Intel) 800
# RAM 64M


#
# configuration file $ 2001.03.07 KS.JANG $ Copyleft ggola 2001
#

control_files  =  (/s01/ORACLE/NEWSVC/CON/controlNEWSVC01.ctl,
                   /s02/ORACLE/NEWSVC/CON/controlNEWSVC02.ctl)

background_dump_dest    = /app/oracle/admin/NEWSVC/bdump
core_dump_dest          = /app/oracle/admin/NEWSVC/cdump
user_dump_dest          = /app/oracle/admin/NEWSVC/udump

#log_archive_dest        = /a01/oracle/NEWSVC/arch/arch

db_block_size           = 4096
db_name                 = NEWSVC


rollback_segments               = (system)

db_files = 80

db_file_multiblock_read_count = 32 

#
# SGA size 
# DB 전용 서버의 경우 실제 memory * 1/3
#
db_block_buffers                 = 11500
shared_pool_size                 = 20971520 
log_buffer                       = 262144

log_checkpoint_interval = 1000000

processes = 50
dml_locks = 100

max_dump_file_size = 10000      # limit trace file size to 5 Meg each
              
# log_archive_start = TRUE      # if you want automatic archiving
global_names = TRUE             # this value 는 db link name으로 db name을 사용할 수 있도록 한다.
[/color]

         ( Database start시 기본 정보를 읽어올 control file location지정.
           각종 database log를 남길 destination 지정.
           앞으로 사용할 database block size결정. Database Creation시 최초 사용되며 이후에는 변경할 수 없다.
           즉, 이후 이값을 아무리 바꾸어도 사용되지 않는다. (bytes로 표시될 것이다)
           Database Name을 결정한다. 위 block size와 동일한 속성을 가진다. 나중에 이 이름을 바꾸고 싶은면 control file을 다시 만들어야 한다.
           필요하다면 archive log destination을 지정한다. 현재 구성하려는 이 시스템은 그럴 필요가 없을 것이다.
           이 부분은 공통사항으로 과거에는 config$SID.ora로 따로 빼서 사용하였으나 8i에서 통합하는 추세이므로 합치도록 하자)

           이 parameter는 최초 database 생성시만 사용할 것이다.
           비교적 작은 값들로 만들어질 이 parameter에서 우리는 database memory 구조인 SGA의 계산을 주시하자.
           일반적으로 Database 전용서버로 사용하는 시스템은 memory의 1/3을 사용하는것이 추천되지만 나는 이후
           Oracle9i Application Server를 사용할 것이므로 1/4로 잡는다.


           따라서 256 * 1/4인 64M를 할당하자.
           DB block buffer는 23M, Shared Pool은 40M, log buffer는 1M로 결정하였다.
           (주의. 모두 bytes단위로 표시될 것이나 db block buffer는 db block size * 개수로 정해진다)

         - initial parameter file for database after creation
[color=005533]
Database Creation후 계속 사용될 parameter

#
# this is initial parameter
# tune continuously
#
# system features
# CPU PIII (Intel) 800
# RAM 64M

#
# configuration file $ 2001.03.07 KS.JANG $ Copyleft ggola 2001
#

control_files  =  (/s01/ORACLE/NEWSVC/CON/controlNEWSVC01.ctl,
                   /s02/ORACLE/NEWSVC/CON/controlNEWSVC02.ctl)

background_dump_dest    = /app/oracle/admin/NEWSVC/bdump
core_dump_dest          = /app/oracle/admin/NEWSVC/cdump
user_dump_dest          = /app/oracle/admin/NEWSVC/udump

#log_archive_dest        = /a01/oracle/NEWSVC/arch/arch

db_block_size           = 4096
db_name                 = NEWSVC

#
# initialize rollbase segment list
#
rollback_segments                 = (r01,r02,r03,r04)

#
# resource limit parameters
#
db_files                         = 80
open_cursors                     = 20
db_file_multiblock_read_count    = 32                                 # MAX  
processes                        = 50                                 # SMALL
dml_locks                        = 100                                # SMALL
# db_block_lru_latches             = 1      # recommand 는 cpu * 2 이지만 현 PC는 1개이므로 default 사용
# db_block_checkpoint_batch        = 16                               # Obsoleted V8.1.3
# db_file_simultaneous_writes      = 16                               # Obsoleted V8.1.3
# sequence_cache_entries           = 10                               # Obsoleted V8.1.3
# sequence_cache_hash_buckets      = 10                               # Obsoleted V8.1.3

#
# SGA size 
# DB 전용 서버의 경우 실제 memory * 1/3 이 추천된다.
#
db_block_buffers                 = 11500                              # 10000 * 4096 = 40M
shared_pool_size                 = 20971520                           # NORMAL = 20M
log_buffer                       = 262144                             # NORMAL = 256K

#
# redo log parameters
log_checkpoint_interval          = 1000000000                         # 사용하지 않기 위해 일부러 크게
log_checkpoints_to_alert         = TRUE                               # write log checkpoint to alert log
# log_files                        = 40                               # Obsoleted V8.1.3 
# CPU * 2 for Oracle7 ~ 8.1.3
# log_simultaneous_copies          = 8                                # Obsoleted V8.1.3
# log_small_entry_max_size         = 80                               # Obsoleted V8.1.3

#
# audit and tracing parameters
#
# audit_trail                      = TRUE  # if you want auditing
timed_statistics                 = TRUE    # if you want timed statistics
                                           # if you want to avoide server overhead, make 'FALSE' 
max_dump_file_size               = 10000   # limit trace file size to 5 Meg each 
                                           # this value is based on system blocks
              
#
# archive log parameters
# if you want automatic archiving, specify the belows parameters
# log_archive_start              = TRUE    # if you want automatic archiving
# log_archive_format             = NEWSVC_%s.dbf

# cleanup_rollback_entries         = 40                               # Obsoleted V8.1.3

#
# sort area parameters
#
sort_area_size                   = 262144
sort_area_retained_size          = 131072
# sort_direct_writes               = auto                             # Obsoleted V8.1.3
# sort_write_buffers               = 5                                # Obsoleted V8.1.3
# sort_write_buffer_size           = 131072                           # Obsoleted V8.1.3 

#
#distributed database parameters
#
# open_links                       = 10                               # default value '4' 사용
# distributed_lock_timeout         = 120                              # Obsoleted V8.1.3
# distributed_transactions         = 40
global_names                     = TRUE    # db link를 global_name과 똑같이 사용할 수 있으려면...
remote_os_authent                = TRUE

#
#
#  PL/SQL support parameters
#  specify writable directory list by oracle application users
#  This parameter has to include user_dump_dest
#
utl_file_dir                     = /app/oracle/admin/NEWSVC/udump
utl_file_dir                     = /app/oracle/admin/NEWSVC/util
utl_file_dir                     = /app/oracle/admin/NEWSVC/work


#
# for job processing parameters
#
job_queue_processes              = 2
job_queue_interval               = 120


#
#if set to TRUE, the optimizer prunes(or skips) unnecessary table accesses in a partition view
#
partition_view_enabled           = TRUE

#
#  PQO Parallel Query Option parameters
#
# parallel_max_servers             = 20
# parallel_min_servers             = 8
# parallel_min_percent             = 0
# parallel_min_message_pool                                           # Obsoleted V8.1.3
               
#
# parameters using default value
#
# transactions                     = 150
# enqueue_resources                = 100

# spin_count                       = 3000                             # Obsoleted V8.1.3

#
# if you want to set Mult Thread Serve
#
# mts_dispatchers="ipc,1"
# mts_max_dispatchers=10
# mts_servers=1
# mts_max_servers=10
# mts_service=NEWSVC
# mts_listener_address="(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))"
[/color]
           이제 진정한 parameter를 설정해 보자.
           세부 사항은 직접 file을 참조할 수 있도록.
           
[b][color=BLUE]  create database scripts[/color][/b]
         1. database creation script
[color=005533]
-- 최초 Database Creation시 Sample ---
-- Database Creation including System and Redo log file --- 

--#
--#  this is a test for building a database from existing
--#  datafiles (users, system, rbs, tools, temp).
--#  svrmgrl login
--#  Oracle O/S login 후 svrmgrl을 통해서 이 스크립트를 실행한다.
--#

spool crdb1NEWSVC.lst

connect internal

startup nomount pfile=/app/oracle/admin/NEWSVC/pfile/initNEWSVC_0.ora
create database "NEWSVC"
     datafile
         '/u01/ORACLE/NEWSVC/SYS/systemNEWSVC01.dbf' size 200M
     logfile
         ('/s01/ORACLE/NEWSVC/REDO/redoNEWSVC01a.log',
          '/s02/ORACLE/NEWSVC/REDO/redoNEWSVC01b.log')  size 5M,
         ('/s02/ORACLE/NEWSVC/REDO/redoNEWSVC02a.log',
          '/s01/ORACLE/NEWSVC/REDO/redoNEWSVC02b.log')  size 5M ;
disconnect
spool off


-- archive log mode를 원한다면
-- 최초 생성시에는 archivelog mode로 생성되지 않으므로
-- parameter에서 archive dest는 지정되면 안된다.
-- log_archive_dest       = /........ archive dest/arch 에대한 조정이 필요하다.

-- 예를 들어
-- log_archive_dest       = /a01/ORACLE/NEWSVC/arch/arch 이 부분은
-- # log_archive_dest      = /a01/ORACLE/NEWSVC/arch/arch 이렇게 '#'으로 막아놓고 작업을 한다.
[/color]
         2. needed tablespace and rollback segment creation
[color=005533]
-- Default tablespace and rollback segment 생성
-- RBS, temp, tools, users, rollback segment


spool crdb2NEWSVC.lst

connect internal

-- default tablespace 생성
-- 이후로 만들어지는 datafile들은 모두 file sysetm이 직절히 분산되어 있다는 가정하에
-- 만들어 질 것이다.

create tablespace RBS1 datafile
    '/u01/ORACLE/NEWSVC/SYS/rbsNEWSVC01.dbf' size 209715200
    default storage ( initial 1M next 1M minextents 2 maxextents 512 pctincrease 0 ) ;

create tablespace temp datafile
    '/u02/ORACLE/NEWSVC/SYS/tempNEWSVC01.dbf' size 104857600
    default storage (initial 1M next 1M) temporary ;

create tablespace tools datafile
    '/u02/ORACLE/NEWSVC/SYS/toolsNEWSVC01.dbf' size 50M
    default storage (initial 256K next 256K pctincrease 0) ; 

create tablespace users datafile
    '/u02/ORACLE/NEWSVC/SYS/usersNEWSVC01.dbf' size 50M
    default storage (initial 256K next 256K pctincrease 0) ;


-- rollback segment 생성 --

create rollback segment r01 tablespace RBS1
       storage ( initial 512K  next 512K minextents 10 maxextents 505 optimal 10M  ) ;
create rollback segment r02 tablespace RBS1
       storage ( initial 512K  next 512K minextents 10 maxextents 505 optimal 10M ) ;
create rollback segment r03 tablespace RBS1
       storage ( initial 512K  next 512K minextents 10 maxextents 505 optimal 10M ) ;
create rollback segment r04 tablespace RBS1 
       storage ( initial 512K  next 512K minextents 10 maxextents 505 optimal 10M ) ;

spool off
[/color]
         3. dynamic performance view creation
[color=005533]
-- run added scripts

spool crdb3NEWSVC.lst
set echo off
@/app/oracle/product/8.1.7/rdbms/admin/catalog
set echo off
@/app/oracle/product/8.1.7/rdbms/admin/catproc
set echo off
@/app/oracle/product/8.1.7/rdbms/admin/caths
set echo off
@/app/oracle/product/8.1.7/rdbms/admin/catrep
set echo off
@/app/oracle/product/8.1.7/rdbms/admin/catexp
set echo off
@/app/oracle/product/8.1.7/rdbms/admin/catexp7


set echo off
@/app/oracle/product/8.1.7/ord/admin/ordinst
set echo off
@/app/oracle/product/8.1.7/ord/im/admin/iminst.sql

connect system/manager
@/app/oracle/product/8.1.7/rdbms/admin/catdbsyn.sql

spool off
[/color]
            -- 이 단계에서 아마도 몇가지 중복되는 oracle error가 표시될 것이다.
            -- 그러나 그 내용들은 'does not exist'라는 것으로 신경을 쓰지 않아도 된다.
         4. symbolic link creation and archive apply and help install
[color=005533]
-- 부가적인 작업 procedure

-- Database shutdown
SVRMGRL> shutdown

-- 실제 database initial parameter를 위한 symbolic link 생성
-- O/S 상에서 실행
-- 이제 Database의 startup and shutdown시 아래의 parameter를 이용한다
[NEWSVC:DB]/app/oracle/admin/NEWSVC/pfile> cd $ORACLE_HOME/dbs
[NEWSVC:DB]/app/oracle/product/8.1.7/dbs> ln -s /app/oracle/admin/NEWSVC/pfile/initNEWSVC.ora ./

-- Database Start
SVRMGRL> startup


-- 최초 생성시에는 archivelog mode로 생성되지 않았지만, 
-- 이제 archivelog mode가 DB 운영 전략이라면 ..

1) initNEWSVC.ora에서 다음과같이 수정한다
# log_archive_dest       = /a01/ORACLE/NEWSVC/arch/arch 최초 막아 놓았던 (#)이 부분을 풀어서?
log_archive_dest        = /a01/ORACLE/NEWSVC/arch/arch

2) SERVER Manager 상에서 archivelog mode로 전환한다 (최초에 수동 작업이 필요하다)
SVRMGR> connect internal
SVRMGR> alter database archivelog ;
SVRMGR> archive log list
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /a01/ORACLE/NEWSVC/arch/arch
Oldest online log sequence     0
Next log sequence to archive   1
Current log sequence           1 

3) parameter file을 수정했으므로 이제 Database를 내리고 올릴 때 자동으로
   archive log mode로 운영될 것이다.
SVRMGR> connect internal
SVRMGR> shutdown
Database closed.
Database dismounted.
SVRMGR> startup


-- 자 여기까지 함으로써 우리는 Database 생성을 정상적으로 끝낼수 있었다.

-- 다음은 그외 추가적으로 할 수 있는 작업이다.
-- help file install
-- O/S 상에서 실행

[NEWSVC:DB]/app/oracle/admin/NEWSVC/work> export SYSTEM_PASS=system/manager

[NEWSVC:DB]/app/oracle/admin/NEWSVC/work> helpins
[/color]
            -- script를 열어서 지시대로 차례 차례 진행하라.
         5. pupbld.sql(product, user profile creation) and scott user and demo sample creation
[color=005533]
--- 필요자원 생성 및 Sample scott user, data 생성 ---

-- sqlplus system/manager login후 이 script를 실행시키라.
@/app/oracle/product/8.1.7/sqlplus/admin/pupbld.sql

create user scott identified by tiger
       default tablespace users
       temporary tablespace temp;

grant connect,resource to scott;

connect scott/tiger
@/app/oracle/product/8.1.7/sqlplus/demo/demobld.sql
[/color]
            -- system/manager로 sqlplus login후 이 script를 실행하라

자 모든 준비가 끝났다...
이제 database를 잘 만들어 보자...
database creation scripts를 차례대로 실행 시키면서 각 script의 지시에 따라 작업을 진행하면 여러분은...
드디어 바라고 바랐던 Oracle Database를 만나게 될 것이다.

그럼 그동안 수고 하셨고
다음번엔 Oracle9iAS를 install할때 만납시다.
[Top]
No.
제목
작성자
작성일
조회
9247MIDDLEWARE:Tuxedo-Oracle connection과 관련된 정보
정재익
2002-01-05
7239
9246IBM RS/6000 AIX 4.3.2 장비에서 Oracle V8.1.6 Install시 확인할 system patch 는?
정재익
2002-01-05
5197
9244리스너가 말을 듣지 않아요.
정재익
2002-01-05
5714
9243오라클 8i 데이터베이스 생성 방법
정재익
2002-01-05
12696
9242오라클 8i 인스톨
정재익
2002-01-05
6342
9238SQL, SQL*Plus (II)
정재익
2002-01-05
12472
9237SQL* SQL*Plus (I)
정재익
2002-01-05
21458
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.018초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다