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 9001 게시물 읽기
 News | Q&A | Columns | Tutorials | Devel | Files | Links
No. 9001
OCP 문제 - ADMIN 파트 (1)
작성자
정재익(advance)
작성일
2001-12-23 03:11
조회수
14,072

*---------------------------------------------------------------------------*

* 1. Overview of Oracle7 Architecture (4) *

* - Oracle7 구조의 개요 *

*---------------------------------------------------------------------------*

 

■Oracle Server Architecture (3가지)

Memory : SGA (Shared Pool, Database Buffer Cache, Redo Log Buffer)

Process : SMON, PMON, LGWR, DBWR

File : Datafiles, Redo Log Files, Control Files, Alert Files, Trace Files

 

■SGA (System Global Area. Shared Global Area라고도 함)

1) Shared Pool Area (Library Cache)

2) Data Buffer Cache

3) Redo Log Buffer

 

■Shared Pool

1) Shared SQL Areas

2) Data Dictionary Cache

 

■Database Buffer Cache

1) Accessing Data

① cache hit (logical read) : Memory 내에서 data read

② cache miss (physical read) : Memory 내에 없어서 datafile에서 data read

 

■Redo Log Buffer

- A circular buffer containing information about changes made to the database

1) Records all changes made to the database

2) Reconstructs changes made to the database and rollback segment entries

when recovery is required

3) Can be bypassed using the UNRECOVERABLE keyword in the CREATE TABLE and CREATE INDEX

4) Can be bypassed by the Oracle data loader

 

■Background Process ★★★

1) PMON

① Clean up abnormally terminated connections.

-> 비정상 종료된 connection을 clean up

② Rollback Uncommitted transactions.

③ Release locks held by a terminated process

-> 비정상종료시 lock을 해제 ★

④ Free SGA resources allocated to the failed process.

-> 장애가 난 process에 의해 할당된 SGA자원과 lock을 해제

 

- Cleans up abnormally terminated connections

- Rolls back uncommitted transactions

- Release locks held by a terminated process

- Frees SGA resources allocated to the failed process

- Restarts failed shared server and dispatcher process

2) SMON

① Performs automatic instance recovery

-> instance가 시작될 때 instance recovery 수행

② Reclaims space used by temporary segments no longer in use.

③ Merges continuous areas of free space in the datafiles.

-> 더이상 사용되지 않는 임시 segment를 지우고 datafile에서 연속적인 free space를

merge(Coalesce) ★

3) DBWR

- Database Buffer Cache의 변경 내용을 data file에 write

4) LGWR

- Redo Log Buffer의 내용을 online redo log file에 write

 

주) SMON,PMON,DBWR,LGWR cannot be controlled by modifying initializing parameters.

 

■User Process

1) Run the application and exchange SQL statements.

 

■Server Process (4장. 데이터 엑세스와 갱신에서 더 자세히 다룸)

1) Parse and execute SQL statements

2) Read data blocks from disk into the shared database of the SGA

3) Return the results of SQL statements to the user process

 

■Oracle Instance

SGA + Background process(SMON,PMON,DBWR,LGWR)

 

■Oracle Database

1) Data Files

2) Redo Log Files (Defaults = 2개)

3) Control Files (Defaults = 1개)

4) Parameter Files

 

■Redo Log Files ★

- Redo log files record all changes made to the database, and used for data recovery

1) Redo Log Files

- Written in a circular fashion

- Must be at least two redo log groups ★

2) Multiplexed Redo Log Files

- At least two redo log members per group, with each memeber on a different disk

- All members of a group of log files contain the same information and

are of the same size

- Group members are updated simultaneously

- Each group should contain the same number of members as other group

 

■Control Files ★★★

- A small binary file that describes the structure of the database

1) All necessary database files and log files are identified in the control file

2) The name of the database is stored in the control file

3) Required to mount, open, access the database ★

4) Synchronization (동기화) information needed for recovery is stored

inside the control file ★

5) The recommended configuration is a minimum of two control files on different disks

6) Available for writing by the Oracle Server whenever the database is open

 

■Parameter Files

1) To start an instance, Oracle must read a parameter file init.ora

2) SHARED_POOL_SIZE

- Shared SQL and PL/SQL statements

3) DB_BLOCK_SIZE

- A single data block and database buffer (2k, 4k, 8k ..)

4) DB_BLOCK BUFFER

- Number of database buffers

* total amount of space allocated for the database buffer cache in the SGA

= DB_BLOCK_SIZE * DB_BLOCK_BUFFER

5) LOG_BUFFER

- Number of bytes allocated for the redo log buffer

 

■Trace Files and the Alert File

1) Alert File

- Chronological log of messages and errors, which includes the following

. All internal errors, block corruption errors, and deadlock errors

. Administrative operations (DDL), and Server Manager statements

(STARTUP, SHUTDOWN, ARCHIVE LOG, and RECOVER)

. The values of all initialization parameters at the time the database

and the instance start

- Located in the destination specified by the BACKGROUND_DUMP_DEST parameter

2) Trace File

 

문) 다음 중 SGA에 있는 정보가 아닌 것은?

 

A. 사용자가 실행한 sql 문장에 대한 정보

B. 디스크에 있는 table 데이터들의 일부분

C. transaction의 변경정보

D. 사용자 session의 변수와 배열정보

 

정답 : D

-> A. shared pool

B. buffer cache

C. redo log buffer

 

문) 에러가 trace 파일에 쓰여지게 하려면 어떻게 해야 하는가? ★★★

 

A. System default이므로 아무런 일도 할 필요 없다.

B. SQL_TRACE를 TRUE로 해야한다.

C. SQL_TRACE를 TRUE로 하고 instance를 다시 start시켜야 한다.

 

정답 : B

-> 오라클메뉴얼 1-35

추적(trace) 파일

내부적인 오류를 서버나 백그라운드 프로세스가 감지하면 해당 정보는 관련 추적 파일에 기록된다.

추적파일은 백그라운드 프로세스가 정보를 기록하면 BACKGROUND_DUMP_DEST 파라미터에 저장된 위치에,

서버가 기록하면 USER_DUMP_DEST 파라미터가 지정한 곳에 각각 있게 된다.

SQL> ALTER SESSION SET sql_trace=TRUE;

 

문) If a redo log member becomes unavailable on the database, ★★★

 

A. The instance will fail.

B. The instance will continue to run, but media recovery is needed.

C. The database will continue to remain open, but instance recovery is needed.

D. The system will continue to function as normal.

 

정답 : A

-> a redo log member라고 했으므로 다른 멤버는 살아 있다는 얘기군요.

B번이 정답입니다. (콘트롤 파일은 하나가 날아가면 정지됩니다.)

그러나 답은 A로 되어있음.

 

문) REDO 로그를 커스텀화할 때 다음 전략들을 권장한다.

 

A. I/O 집중을 감소시키기 위해 REDO 로그 멤버들을 동일한 디스크에 저장한다.

B. LGWR 을 밤에만 실행시킨다.

C. I/O 집중을 감소시키기 위해 REDO 로그 멤버들을 다른 디스크에 저장한다.

D. DGWR 을 밤에만 실행시킨다.

 

정답 : C

 

문) The INIT.ORA parameter that indicates the size of each buffer

in the buffer cache is the ★★★

 

A. DB_BLOCK_BUFFERS

B. BUFFER_SIZE

C. DB_BLOCK_SIZE

D. ROLLBACK_SEGMENTS

 

정답 : C

-> 버퍼에 적재되는 buffer와 DB 블럭의 사이즈는 같다. (한 블럭씩 통째로 복사하니까)

 

문) 프로세스를 공유하는데 사용될 미리 분석된 SQL 문자들을 저장하는

SGA 컴포넌트는? ★★★

 

A. Buffer cache

B. Private SQL area

C. Redo log buffer

D. Library cache

E. Row cache

 

정답 : D

-> Library cache = Shared Pool Area

 

문) Which component of the system global area stores parsed SQL statements used for process

sharing? ★★★

 

A. Buffer cache

B. Private SQL area

C. Redo log buffer

D. Library cache

E. Row cache

 

정답 : D

-> B는 MTS 환경에서 사용되고 위에서는 그런 언급이 없음.

Shared SQL area를 구성하는 두가지 구성요소.

Library cache, row cache (Data dictionary cache)

Library cache는 parse된 SQL 문이 저장되어 있으므로 정답은 D

 

문) After a server process executes a SQL statement, which task occurs next?

 

A. The appropriate tool or application is run.

B. The SQL statement is parsed

C. The returned data is placed in the shared database buffer.

D. The result of the SQL statement are returned to the user.

 

정답 : D

-> 오라클메뉴얼 1-23

 

문) In which situation will the control file be accessed?

 

A. only when starting an instance in NOMOUNT mode

B. only when the database is being mounted

C. only when the database is open

D. to mount and open the database

 

정답 : D

-> 오라클메뉴얼 1-31

 

문) Which component stores the synchronization information needed for database recovery?

 

A. redo log files

B. control files

C. parameter file

D. trace file

 

정답 : B

-> 오라클메뉴얼 1-31

 

문) redo log file의 최소갯수는?

 

정답 : 2개

 

문) DB 생성시 control file default 개수는?

 

정답 : 1개

 

문) distributed transaction에서 failure를 resolve시키는 process는?

 

정답 : RECO

-> 오라클메뉴얼 1-19

-> RECO resolves failures involving a distributed transaction

 

문) 동일한 SQL 문장을 공유하기 위하여 SHARED SQL AREAS가 이용되는데

다음 동일한 SQL문장을 만족하기 위한 조건중 틀린 것은? ★

 

A. 참조되는 모든 OBJECT들이 동일해야 함

B. 이용되는 변수의 TYPE과 명이 동일해야 함

C. TEXT STRING의 UPPERCASE, LOWERCASE가 모두 동일해야 함

D. TEXT STRING에 이용된 SPACE도 동일해야 함

E. 특정값이 참조되었다면 참조된 값도 동일해야 함

F. 위의 모든 내용이 동일한 SQL문장을 만족하기 위한 조건임

 

정답 : F (답이 이상하다...)

-> 동일한 SQL문장을 만족하기 위해서는 보기 A-E까지의 모든 조건이

만족해야 한다. 따라서 WHERE절에서 특정값이 참조될 경우에는

참조되는 값을 변수로 지정하여 이용하여야 동일한 SQL문장으로

처리된다.

 

문) Oracle Instance를 설명한 것 중 가장 좋은 답은 ?

 

A. Consist of datafiles and redologfile

B. Consist of SGA and background processes

C. Consist of control files and parameter file

D. Consist of datafiles and background processes

 

정답 : B

 

문) 사용하지 않는 temporary segment 공간을 모아 주는 것을 무엇이라고 하는가?

그리고, 이러한 기능을 하는 수행하는 Oracle process의 이름은 무엇인가?

 

A. Deallocation, PMON

B. Coalescing, SMON

C. Allocation, RECO

D. Coalescing, PMON

E. Deallocation, CKPT

 

정답 : B

 

문) The background process that coalesces small blocks of free space

into larger blocks of free space is

 

A. DBWR

B. LGWR

C. SMON

D. PMON

E. LMON

 

정답 : C

 

문) Database 최초 생성시 옳은 것 3가지를 고르시오? ★★★

 

A. At least two redo log members per group, with each member on a different disk

B. There must be at least two redo log groups

C. There must be at least one control file

D. There must be at least two datafiles

E. default size of one member per group is 500KB

F. There must be at least two control files on different disks

 

정답 : B, C, E

-> A도 답이 되지 않을까?

 

문) BACKGROUND PROCESS와 SERVER PROCESS에 의하여 Trace가 실행

되기 위하여 선행되어야 할 조건은?

 

A. ALTER SESSION SET sql_trace TRUE; 명령으로만 가능하다.

B. initial parameter SQL_TRACE=TRUE를 set함으로써만 가능하다.

C. A와 B 2가지 모두 가능하다.

D. ALTER DATABASE SET sql_trace TRUE; 명령으로 가능하다.

 

정답 : C

-> 오라클메뉴얼 1-35

 

문) 필수적인 BACKGROUND PROCESS가 아닌 것은 ?

 

A. PMON

B. SMON

C. LGWR

D. ARCH

 

정답 : D

 

문) SERVER PROCESS의 역할은?

 

A. parse and execute SQL statement

B. read data block from disk into database buffer

C. return the results of SQL statement to user process

D.

E.

 

정답 : A, B, C

 

문) 다음 프로세스중 오라클 인스턴스 기동시에 반드시 작동되어져야 하는

필수 프로세스가 아닌 것은?

 

A. DBWR

B. LGWR

C. CKPT

D. PMON

 

정답 : C

-> BACKGROUND PROCESSES

DBWR, LGWR, SMON,PMON의 4개 프로세스는 오라클 인스턴스 기동시에

반드시 필요한 필수 프로세스임. 이들 프로세스는 초기화파라미터를

수정함으로써 제어할 수 없고, 이들 프로세스중 하나라도

실패하면 오라클 인스턴스는 작동되지 않으며 재기동해야 한다

 

문) 다음 프로세스중 TEMPORARY SEGMENT에 의하여 이미 사용되었으나 더 이상

사용되지 않는 공간에 대하여 재할당작업을 수행하는 프로세스는 어느것인가?

 

A. SMON

B. PMON

C. RECO

D. CKPT

 

정답 : A

-> BACKGROUND PROCESS

-> 개별 프로세스의 실패등에 관련된 일은 주로 PMON이 담당하고

시스템 전반에 관련된 일들은 SMON이 담당한다.

SMON은 자동 인스턴스복구수행, TEMPORARY SEGMENT에 의하여

이미 사용되었으나 더 이상 사용되지 않는 공간에 대하여 재할당

작업수행, 데이터파일의 자유공간에 대하여 연속적인 공간으로의

합병(Merge)등의 역할을 한다.

 

문) SQL문장이 수행될때 Server Process가 수행하는 다음의 단계중 보안의 체크는

어느단계에서 이루어 지는가?

 

A. Parse

B. Execute

C. Fetch

 

정답 : A

-> SERVER PROCESSES

Parse단계에서 Syntax Check, Security Access, Object Resulution,

Optimization등이 이루어진다. 이때 Parsing은 Shared SQL Area를 이용한다.

Execute단계에서는 Parse단계에서 만들어진 Parse Tree를 실제 데이터에

적용한다. 따라서 이때 Physical Read 또는 Change가 일어난다.

Fetch단계에서는 SQL문장이 SELECT문일 경우에 데이터를 USER에게 전달한다.

 

문) 다음은 SGA의 크기를 결정하는 파라미터들이다.

이중 초기화 파라미터파일을 이용하여 수정할 수 없는 파라미터는 무엇인가?

 

A. SHARED_POOL_SIZE

B. DB_BLOCK_SIZE

C. DB_BLOCK_BUFFERS

D. LOG_BUFFER

 

정답 : B

-> DB_BLOCK_SIZE는 DB 생성시에 주어져야 하며 일단 DB가 생성되고 나면

절대 수정할 수 없다. 이 값을 수정하려면 DB를 다시 생성하여야 한다.

이 파라미터의 DEFAULT값은 OS에 따라 다르다.

 

*---------------------------------------------------------------------------*

* 2. Start Up and Shut Down an Instance (3) *

* - 인스턴스 시작과 종료 *

*---------------------------------------------------------------------------*

 

■Authentication Method (3장. 데이터베이스 생성에서도 다룸)

1) Using OS Authentication

① Set up the user to be authenticated by the operation system

② Set REMOTE_LOGIN_PASSWORDFILE = NONE

③ CONNECT / AS sysdba

2) Using a Password File

① Create the password file using ORAPWD utility

② Set REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE

③ Grant SYSDBA or SYSOPER to database administrator through the database

④ CONNECT user AS SYSDBA or SYSOPER

 

■Starting Up an Instance

1) STARTUP NOMOUNT

① 새로운 DATABASE를 생성할 때 ★

② 다른 parameter file을 참조하여 Instance를 기동하고 싶을 때

- Is used to create the database

2) STARTUP MOUNT

① 대부분의 DBA 작업들 ★

(alter database ~ 로 시작하는 명령어들, backup, recovery, redo log file

추가/삭제 등)을 수행할 때

- Is used to alter the structure and modify control file flags

3) STARTUP OPEN

- makes the database available to all users

 

nomount : instance open / create database, create control file시 사용

mount : database mount / database 구조변경, recovery시

open : database open

 

■Mounting the Database

 

■Opening the Database

주) RESTRICTED SESSION to make the database available only to DBA users ★

cf) STARTUP RESTRICT MOUNT

 

■Restricted Session

1) ENABLE RESTRICTED SESSION

2) DISABLE RESTRICTED SESSION

 

■Shutting Down the Database

1) SHUTDOWN [NORMAL]

① 새로운 사용자의 access를 막고 기존에 접속된 사용자가 정상 종료할 때까지 기다렸다가 종료

② 종료시 checkpoint 발생

③ 종료방법으로 NORMAL이라 써주지 않아도 됨

2) SHUTDOWN IMMEDIATE

① 새로운 사용자의 access를 막고 현재 진행 중인 sql 문장은 강제로 종료시키며

commit 되지않은(uncommitted) transaction을 rollback시킴. ★

② 즉, 접속된 사용자의 session을 강제로 종료

③ 종료시 checkpoint 발생

3) SHUTDOWN ABORT

① 새로운 사용자의 access를 막고 현재 진행 중인 sql문장은 강제로 종료시키며 commit 되지않은

transaction을 rollback시키지 않음.

② IMMEDIATE와 마찬가지로 접속된 사용자의 session을 강제로 종료

③ 종료시 checkpoint 발생하지 않음

④ 이후에 다시 시작할 때는 instance recovery 필요

 

문) What method should the DBA use to prevent access to the database while dropping

and re-creating an index? ★★★

 

A. Enable restricted session to prevent users from accessing the database.

B. Shutdown the database with the abort option to prevent users from accessing the database.

C. Execute an alter database mount to prevent users from accessing the database.

D. Execute a connect internal to prevent users from accessing the database.

 

정답 : A

 

문) DATABASE를 SHUTDOWN 해야하는데 시간이 5분밖에 남지 않았다.

사용자들은 25명이 있는데 어떤 명령을 사용해야 하는가?

 

정답 : SHUTDOWN IMMEDIATE;

 

문) 정전이 발생하여 모든 유저들에게 작업을 종료할 것을 알렸으나 25 user가 아직 접속중이다.

시간이 5분 정도 남았다면 shutdown시 적절한 방법은? ★★★

 

A. SHUTDOWN NORMAL

B. SHUTDOWN IMMEDIATE

C. SHUTDOWN ABORT

 

정답 : C

-> 결론은 답이 C인 것 같다.

-> 이현일(best1@netian.com)

왜 두번째인고 하니 abort 옵션은 DB user의 커밋되지 않은 트랜잭션을 롤백시키지도 않고

단지 instance만 종료시키기 때문에 25의 유저가 DB에 접속된 상태에서 5분안에 DB를

shutdown 시킬려면 이 방법이 제일 빠르다. 하지만 다음 DB open시 인스턴스 복구를 필요로 하다.

immeditate옵션은 트랜잭션 작업 처리 중에 커밋되지 않은 것은 롤백이란 작업을 함.

그렇기 때문에 롤백 세그먼트에 롤백데이터를 만들기 때문에 abort보다는 시간이 더 걸린다.

-> 이경록(tunnel@hananet.com)

정답이 B가 되기 위해서는 모든 유저들이 5분내로 작업이 끝나야만 하는데 어떤 오래 걸리는

DML작업이 있다면 100% 확실한 건 C가 답이겠네요.

(예외없이 확실하게 5분 이내에 무슨 일이 있어도 종료할 수 있죠.)

-> 해설: Abort 가 맞는것 같습니다. 실제로 제가 시험볼때 나왔던 문제입니다.

 

immediate: 1. 현재 처리중은 SQL문을 처리하지 않는다.

2. commit하지 않은 트랜잭션=> rollback

3. 접속을 해제할 때까지 "기다리지 않는다"

4. database close, unmount 한 후 인스턴스 종료.

 

여기서 3번 때문에 좀 혼동되긴 하는데, 2, 4번등의 이유로 시간이 많이 소모될 요지가 충분한 것 같습니다.

따라서 더 빨리 shutdown할 수 있는 abort 옵션이 있는데, immediate가 답이 될 이유는 희박하죠.

게다가 문제에서 이미 유져들에게 종료할 것을 알린 상태라면..

 

문) DB에 데이터 파일을 추가하기 위해 시작할 때 옳은 것은? ★★★

 

A. startup mount

B. startup restrict nomount pfile=init.ora

C. startup restrict mount pfile=init.ora

D. startup nomount

 

정답 : A

-> 추가는 즉 수정을 의미. 고로 mount (DBA 작업)

 

문) 많은 table과 space를 수정하려고 한다. 그 때 Startup option은? ★★

 

정답: mount

 

문) DATABASE 생성시 ORACLE SERVER의 상태는?

 

정답 : NOMOUNT

 

문) Your parameter file has an incorrect database name.

Using Server Manager, you are going to attempt to startup an instance

and open the database by issuing this command:

 

STARTUP OPEN PFILE = INITWORK.ORA

 

What will happen? ★

 

A. The database will be mounted with a restricted session.

B. The database will be dismounted and you will exit from Server Manager.

C. The database will be dismounted, but you will still be connected to an instance.

D. The database will be dismounted and no instance will be created.

 

정답 : C

-> 오라클메뉴얼 2-11

 

문) If you are connected to the database as a SYSDBA using Server Manager,

which command will start up an instance to allow only DBA access to

perform maintenance on an existing database?

 

A. STARTUP RESTRICT OPEN

B. STARTUP NOMOUNT PARALLEL

C. STARTUP MOUNT

D. STARTUP RESTRICT MOUNT

 

정답 : D

-> 오라클메뉴얼 2-17

-> SHUTDOWN -> NOMOUNT -> MOUNT -> OPEN

인스턴스 인스턴스에 인스턴스의

시작 대한 control file에

control file 기술된

오픈 모든 파일 오픈

 

문) initSID.ora의 db_name을 다른 이름으로 바꾸고 instance를 startup 하였다.

어느 단계에서 error가 발생할까?

 

A. MOUNT

B. OPEN

C. STARTUP

 

정답 : A

 

문) background process 중 하나인 PMON이 fail이 되었다.

이 때 어떤 옵션으로 종료해야 하나? ☎

 

A. NORMAL

B. ABORT

C. IMMEDIATE

 

정답 : B

 

문) 사용자를 배제하고 DBA만 접속하여 tablespace을 변경하고자 한다.

이에 해당되는 STARTUP MODE는?

 

A. STARTUP MOUNT

B. STARTUP NOMOUNT

C. STARTUP restrict open pfile = pfilename

 

정답 : C

-> A가 답이 되지 않을까?

 

문) Shutdown 단계중 uncommitted transaction을 rollback시키면서 shutdown 되는 단계는?

 

A. SHUTDOWN NORMAL

B. SHUTDOWN IMMEDIATE

C. SHUTDOWN ABORT

 

정답 : B

 

문) 건물에 곧 정전될 상황에서 System을 shutdown 해야하는데 15명의 사용자가

계속 접속을 하고 있을 경우 어떤 option으로 DB을 Shutdown 해야 하는가?

 

A. SHUTDOWN NORMAL

B. SHUTDOWN IMMEDIATE

C. SHUTDOWN ABORT

 

정답 : B

 

문) Power will disconnect on the machine running Oracle in two minutes.

How should the DBA shut down the instance?

 

A. shutdown normal

B. shutdown immediate

C. shutdown abort

D. shutdown force

E. shutdown recover

 

정답 : C

 

문) 당신은 DBA로서 DATABASE를 관리하고 있다.

어느날 정전이 될것이란 통보를 받고 DATABASE를 이용 중인 모든 사용자에게

정전이 될 시간 10분이전까지 하던 작업을 끝내고 세션을 끝내주기를 당부했다.

정전이 되기 5분전까지 아직 세션이 끝나지 않은 사용자들이 있다면

당신은 지금 DATABASE를 SHUPDOWN하기 위하여 다음 중 어느 MODE를 이용해야 하는가?

 

A. SHUTDOWN

B. SHUTDOWN NORMAL

C. SHUTDOWN IMMEDIATE

D. SHUTDOWN ABORT

 

정답 : C

-> 갑작스럽게 DATABASE가 다운되는 것이 아니므로 INSTANCE RECOVERY가 필요한

ABORT OPTION를 이용할 필요가 없다.

또한 사용자들이 있으므로 NORMAL OPTION으로는 모든 사용자들이

그들의 세션을 종료할 때까지 SHUTDOWN이 되지 않을것이다.

따라서 DATABASE를 안전하게 SHUPDOWN하기 위해서는 IMMIDIATE OPTION을 이용해야 한다.

 

문) 현재 사용하고 있는 데이터베이스를 원격 관리하고자 한다.

PASSWORD파일을 이용하여 DABATASE 인증을 받고자 할 때 다음 중 어떤 방법을

이용하여야 하는가?

 

A. CONNECT / AS SYSDBA명령으로 LOGIN한다.

B. REMOTE_LOGIN_PASSWORDFILE = SINGLE로 SET하여 이용한다.

C. ORACLE INTERNAL UTILITY ORAPWD를 이용하여 PASSWORD FILE을 생성한다.

D. ORACLE EXTERNAL UTILITY ORAPWD를 이용하여 PASSWORD FILE을 생성한다.

 

정답 : D

-> AUTHENTICATION METHODS 오라클메뉴얼 2-7

DATABASE를 원격관리하기 위해서는

OS인증을 이용하는 방법과 PASSWORD FILE을 이용하는 방법이 있다.

PASSWORD FILE을 이용하기 위해서는 다음의 절차가 필요하다

- ORACLE EXTERNAL UTILITY ORAPWD를 이용하여 PASSWORD FILE 생성

- REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE로 SETTING

- DATABASE 관리자에게 sysdba 또는 sysoper 권한을 부여

- CONNECT user AS sysdba 또는 sysoper을 이용하여 CONNECT

 

문) 오라클 인스턴스를 STARTING UP할 때 실행되지 않는 것을 모두 택하시오. ★

 

A. 백그라운드 프로세스를 기동한다.

B. 파라미터파일 init.ora를 읽는다.

C. CONTROL 파일을 읽는다.

D. TRACE와 ALERT 파일을 OPEN한다.

E. SGA를 할당한다.

 

정답 : C

-> STARTING UP AN INSTANCE 오라클메뉴얼 2-13

CONTROL 파일은 DATABASE를 MOUNT 하고 OPEN 할 때 사용되며

INSTANCE를 STARTING UP할 때는 사용되지 않는다.

파라미터 파일은 INSTANCE STARTING UP시 INSTANCE(백그라운드 프로세스등)의

정보를 알아내기 위하여, TRACE 및 ALERT파일은 INSTANCE 기동시 및 프로세스

오류시 LOG를 기록하기 위하여 OPEN된다.

 

문) Alert file에 저장되는 정보들 및 위치 ?

Trace file에 저장되는 정보들 및 위치 ?

 

정답 : 1. Alert(경고) file

- 내부적인 오류

- 불록훼손 오류

- 교착상태 오류

- 관리작업

- Server Manager 문장

- Database와 Instance시작시의 모든 초기화 파라미터 -> BACKGROUND_DUMP_DEST

2. Trace(추적) file

- 내부적인 오류를 Server나 Background Process가 감지하면 해당 정보는

관련 추적파일에 기록

.Server (USER_DUMP_DEST)

.Background process (BACKGROUND_DUMP_DEST)

 

문) FULL DATABASE MEDIA RECOVERY를 수행하며, DBA 엑세스만을 허용하고자 할 때

이용되어야 할 STARTUP MODE는?

 

A. STARTUP MOUNT

B. STARTUP NOMOUNT

C. STARTUP RESTRICT OPEN

D. STARTUP RESTRICT MOUNT

 

정답 : D

-> STARTING UP AN INSTANCE

INSTANCE RECOVERY를 수행하여야 할 때 MOUNT OPTION을 이용한다.

NOMOUNT OPTION은 DATABASE생성을 위하여 사용된다.

RESTRICT OPTION은 일반적인 사용자들이 DATABASE에 로그온하지 못하도록

할 때 이용된다.

 

 

*---------------------------------------------------------------------------*

* 3. Create a Database (3) *

* - 데이터베이스 생성 *

*---------------------------------------------------------------------------*

 

■Determining Tablespaces

1) Each tablespace consists of one or more operating system files

2) Can be brought online while the database is running

2) Except for the SYSTEM tablespace, tablespace can go offline, leaving the database running

3) Each object is in only one tablespace

 

■Parameter Files

1) DB_NAME

① Database identifier of eight character or less.

② Only Parameter that is required when creating a new database

2) CONTROL_FILES

① Names of the Control files

② init.ora

③ CONTROL_FILES = (control_file1, control_file2,…)

3) DB_BLOCK_SIZE

① Size in bytes of oracle database blocks. Default = 2k

② view with SQL> show parameter db_block_size

4) BACKGROUND_DUMP_DEST

- Location where background process trace files are written

- Background process에 이상이 발생할 때

trace dump file이 저장되는 디렉토리 패스 ( .trc 형태로 저장됨 )

5) USER_DUMP_DEST

- Location where user trace files are created

① USER PROCESS에 이상이 발생할 때 trace dump file에 저장되는 디렉토리 패스

( .trc 형태로 저장됨)

② backup control file이 저장되는 디렉토리

SQL>alter database backup controlfile to trace

6) LOG_BUFFER

- Number of bytes allocated to the redo log buffer in the SGA.

7) IFILE

- Name of another parameter file to be used at startup

8) LOG_ARCHIVE_START

- Enable or Disable automatic archiving if the database is in ARCHIVELOG mode.

9) LOG_ARCHIVE_DEST

- Location of archived log files are created

10) LOG_CHECKPOINT_INTERVAL

- To increase frequency of checkpoint

11) LOG_CHECKPOINT_TIMEOUT

- To initiate checkpoints periodically

 

■Starting the instance

- Database를 다시 생성할 때 반드시 STARTUP NOMOUNT로 INSTANCE를 START

 

■Adding a Control File

1) Shut down the database

2) Make a copy of the existing control file in a new location

3) Alter the parameter file to include the name of the new copy

4) Start up the database

 

■Creating a Password File

1) Create the password file using the ORAPWD utility

- ORAPWD FILE = orapw SID PASSWORD = secret ENTRIES = 30

2) Set REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE

3) Start Server Manager in line mode

- CONNECT / AS SYSDBA

- SHUTDOWN IMMEDIATE

- STARTUP

4) Grant database administrators SYSDBA or SYSOPER

- GRANT SYSDBA TO system

5) FTP initSID.ora to remote client if you want to administer the database

from a single remote client

6) Start Server manager in screen mode from your remote client

주) To determine which users have been granted SYSDBA and SYSOPER system privileges

for a database, select from the V$PWFILE_USERS view ★

 

■Creating Additional Data Dictionary Views

- SVRMGR>@?/rdbms/admin/catalog

- catalog.sql : creates commonly used data dictionary views

- catproc.sql : Runs all scripts required for PL/SQL on the server.

 

■Data Dictionary Categories

1) USER_xxx

- Views accessible to any user, giving information on their own objects.

자기가 owner인 object에 대한 정보.

2) ALL_xxx

- Views accessible to any user, giving information on all objects accessible to a user.

자기가 owner인 object에 대한 정보 + access 권한이 있는 정보

3) DBA_xxx

- Views accessible only to DBA, giving information on any object definition in the database.

dba권한 가진것. (dba_free_space 에는 s가 안붙는다.)

 

문) 테이블 설정시 unrecoverable 생성하는 이점?

 

-> 두중에 답이 하나인데 헤갈림.

redo log file을 쓰지 않는다....라는 것을 답으로 선택했는데

뒤에 따라 오는 말이 약간은 부정적이라는 말이래서 헤갈렸음

 

문) 기존 테이블 스페이스를 read only모드로 두는 방법은?

 

A. Alter tablespace

B. Alter database

...

 

정답 :

 

문) 테이블 스페이스에서 사용할 수 있는 바이트를 보는 뷰는? ★★★

 

A. DBA_FREE_SPACE

B. DBA_TABLES

C. DBA_DATA_FILES

 

정답 : A ?

 

문) 다음중 os상에서 file을 생성하는 명령어를 모두 고르시오.

 

A. create table

B. create tablespace

C. create datafile

D. create control file

E. create database

F. create rollback segment

 

정답 : B, D, E

 

문) 오라클을 처음 설치하여 create database 명령을 수행하였으나 system

failure가 발생하여 shutdown을 시켜야만 했다. alert 기록을 참고하기 위해

해야하는 것은? ★★★

 

A. Add 'sql_trace = true' in parameter file.

B. Startup nomount and use alter system set sql_trace = true

C. You must insert background_dump_dest='path' in parameter file.

D. not need anything

 

정답 : D ?

-> A, B가 답이 되지 않을까?

B. alter session...

 

문) DB이름 변경후 어떻게 해야하나? ★★★

 

A. normal로 종료후 open옵션으로..

B. Alter database open..

C. Alter database로 mount+open..

 

정답 : B ?????

-> 정답은 C입니다. open이면 최종적으로 DB에 접속할 수 있는 일반적 상태까지 만들겠다는

얘기이므로 mount까지만 해주고 이름 바꾸고 open 해줘야 합니다.

 

문) TABLESPACE를 만들 때 MINEXTENTS를 5로 주었다.

이 TABLESPACE 에 A라는 TABLE 을 만들 때 MINEXTENT를 주지 않으면 어떻게 되는가?

 

정답 : TABLESPACE에서 지정한 MINEXTENT 값을 이용한다.

 

문) TRACE가 가능하게 하려면 어떻게 해야 하는가?

 

정답 : SQL_TRACE = TRUE 문장을 INITIAL PARAMETER FILE에 추가하고 INSTANCE를

SHUTDOWN/RESTART한다.

※ 특정 SESSION에 대해 TRACE FILE에 WRITING을 가능하게 하려면

ALTER SESSION SET SQL_TRACE TRUE; 명령을 사용.

 

문) datafile을 추가해야 했으나 ora-11??5 하는 더이상 데이터 파일을 추가할 수

없다는 에러가 발생했다. 가장 빨리 복구하는 방법은? ★★★

 

A. recreate control file

B. recreate database

C. remove datafiles of related each tablespace

D. resize extents.

 

정답 : A

-> 첨보는 기분이군요. 전혀 모르겠지만 적어도 B와 같은 과격한 방법은 쓰지 않을 테고

D도 별 상관없을 듯. 에러가 났다면 파일을 만들지 못했다는 얘기 아닌가요?

 

문) Which two of the following SQL scripts must be run as part of database creation? ★★★

 

A. utllockt.sql

B. catalog.sql

C. catalog6.sql

D. utlmontr.sql

E. utlestat.sql

F. catexp.sql

 

정답 : B, F

 

문) Create Tablespace로 크기가 2M인 Tablespace를 생성했는데,

INITIAL 1M, NEXT 1M인 TABLE이 만들어 질 것인가?

 

A. 만들어지지만 다음 EXTENT가 할당되지 않는다.

B. 만들어지지만 한개의 EXTENT만 더 늘어날 수 있다.

C. 만들어지지 않는다.

 

정답 : A

-> INITIAL EXTENT의 첫 블럭을 segment header block이 차지한다.

이 블럭에는 해당 segment에 관한 정보가 들어간다.

그러므로 initial = 1M , next 998k 로 테이블을 잡으시면

다음 extent도 할당이 된다. (DB BLOCK이 2K 인 경우)

 

문) Tablespace가 1M인 Tablespace에 INITIAL 1M인 TABLE이 만들어질 것인가?

 

A. 만들어지지만 다음 EXTENT가 할당되지 않는다.

B. 만들어지지만 한개의 EXTENT만 더 늘어날 수 있다.

C. 초기 익스텐트가 너무 크기 때문에 만들어지지 않는다.

D. 테이블스페이스에 할당되지 않기 때문에 만들어지지 않는다.

 

정답 : C 아니면 D

 

문) Which data dictionary object would you access to identify

which users have been granted SYSDBA and SYSOPER system privileges for a database?

 

A. DBA_DATA_FILES

B. USER_USERS

C. DBA_TABLESPACES

D. V$PWFILE_USERS

 

정답 : D

-> 오라클메뉴얼 3-61

 

문) Which segment type has the highest propensity for fragmentation?

 

A. data dictionary

B. application data

C. application interim

D. rollback

E. temporary

 

정답 : E

-> 오라클메뉴얼 3-13

 

문) You have multiple instances in a parallel server environment.

You have created a generic parameter file for all your databases.

When you create a new database, which parameter in the parameter file

should you modify to recognize the generic parameter file?

 

A. AUDIT_TRAIL

B. IFILE

C. CONTROL_FILES

D. COMPATIBLE

 

정답 : B

-> 오라클메뉴얼 3-29, 31

-> AUDIT_TRAIL : Enable or disable writing of rows to the audit trail

IFILE : Name of another parameter file to be used at startup

CONTROL_FILES : Names of the control files

COMPATIBLE : Version of the server this instance should be compatible with

 

문) parameter file의 comment 방법은? ★

 

정답 : #

-> 이 문제는 오라클 교재 p3-25에 보면 #으로 되어있고 또, oracle program이 있다면

설치해 보시고 거기에서 오라클 초기화 파일을 열어보시면 이해할 것임

이 기호의 사용 여부는 오라클이 처음 인스턴스 기동 될 때 구조를 초기화 parameter file을

읽어들여 SGA를 형성함. 여기서 이 파일의 편집에서 이 기호로 초기화 파일의

파라미터 앞을 막으면 그것은 오라클이 인식하지 않고 #이 기호가 없는 것은 그대로 오라클이

인식해서 오라클 구조를 형성시킴.

그리고 --부호는 본인도 잘 모르겠음. 기출문제에서 한 번 본 기억은 남.

 

문) 당신이 관리하는 DATABASE에 예약주문 시스템을 개발하여 이용 중이며

이 시스템을 위한 테이블스페이스는 APP_DATA, APP_INDEX이다.

다음 테이블스테이스 중 DATABASE가 작동중일 때 항상 OFFLINE으로

될 수 없는 것을 모두 고르시오.

 

A. SYSTEM

B. TEMP

C. ROLLBACK

D. APP_DATA

E. APP_INDEX

 

정답 : A

-> Determing Tablespaces

-> SYSTEM 테이블스페이스만이 항상 OFFLINE으로 될수 없다.

ROLLBACK 테이블스페이스는 현재 이용 중인 ROLLBACK SEGMENT가 없을때 OFFLINE이 가능하고,

TEMP 테이블스페이스는 현재 이용 중인 SORT 작업을 없을 때 OFFLINE이 가능하다.

 

문) control file에 저장되는 정보는?

 

정답 : DB_NAME, redo log file정보, datafile 정보, recovery에 필요한 동기화정보,

등등....(단, user/table에 관한 직접적인 정보는 없다.)

 

문) DBAs who are planning to administer a database remotely should use operating

system authentication.

원격으로 데이터베이스를 관리하고자 하는 DBA는 운영체제 인증을 사용해야 한다 ★★★

 

A. TRUE

B. FALSE

 

정답 : B

 

문) 현재 DB_BLOCK_SIZE = 2K 일 때 8K 로 변경하고자 한다면 어떻게 해야 하는가? ★★★

 

A. init.ora 파일의 DB_BLOCK_SIZE = 8K 을 변경 후 INSTANCE을 RESTART한다.

B. RECREATE CONTROL FILE

 

정답 : B

 

문) DATABASE을 RECREATE 하려고 한다면 DB가 어떤 MODE이어야 하는가? ★★★

 

A. STARTUP

B. STARTUP MOUNT

C. STARTUP NOMOUNT

 

정답 : C

-> 확인요

CREATE -> NOMOUNT

RECREATE -> MOUNT 가 아닐까?

-> 오라클은 startup nomount 상태에서 초기화 파일(parameter file)을 읽어 들여 SGA와 오라클

구조를 형성시킴.그리고 startup mount 상태에서 제어파일(control file)을 읽어들여 모든

테이블스페이스와 모든 로그파일의 DB에 mount됨. 그렇기 때문에 제어파일을 재생성

시키거나 DB를 생성시키기 위해서는 nomount모드가 정답임.

초기화 파일은 유닉스 운영체제이면는 vi, windows 체제라면는 메모장에서 편집함.

 

문) DB을 RECREATE 하지 않고 변경할 수 있는 Parameter을 3개 고르시오?

 

A. USER_DUMP_DEST

B. LOG_BUFFER

C. LOG_ARCHIVE_DEST

D. DB_BLOCK_SIZE

 

정답 : A, B, C

-> DB_BLOCK_SIZE만 변경이 불가능하다는 것을 숙지

 

문) DBA 권한을 가진 Password file을 만들기 위한 방법은?

 

A. Use ORAPWD utility

B. Use OS authentication

C. Use OS password

 

정답 : A

 

문) Password File 내용을 볼 수 있는 View?

 

정답 : V$PWFILE_USERS

-> 오라클메뉴얼 3-61 참조

 

문) 일반사용자로서 DATABASE에 로그온했다.

다음의 SQL명령을 실행하였을 때 볼 수 있는 내용은 무엇인가?

 

SELECT *

FROM ALL_OBJECTS

WHERE OBJECT_TYPE = 'TABLE'

 

A. 로그온한 사용자가 볼 수 있는 권한을 가진 모든 테이블

B. 로그온한 사용자가 소유한 모든 테이블

C. DATABASE내에있는 모든 테이블

D. 일반사용자로 로그온 하였기 때문에 이 SQL문장을 실행할 수 없다

 

정답 : A

-> USER_xxx 뷰는 자신이 소유한 오브젝트에 대한 정보를 보여주며

모든 사용자에게 엑세스 가능한 뷰이다.

ALL_xxx 뷰는 사용자에게 엑세스가능한 모든 오브젝트에 대한

정보를 보여주며 모든 사용자에게 엑세스 가능한 뷰이다.

DBA_xxx 뷰는 DATABASE내에있는 모든 OBJECT에 대한 정보를

보여주며 DBA에게만 엑세스 가능한 뷰이다

 

문) Data dictionary view중 ALL_xxx 의 의미는?

 

A. Views accessible to any user, giving information on their own objects.

B. Views accessible to any user, giving information on all objects accessible to a user.

C. Views accessible only to DBA, giving information on any object definition on in the database.

 

정답 : B

 

문) Tablespace에 대한 설명 중 옳은 것 3가지를 고르시오? ★★★

 

A. Each tablespace consists of one or more operating system files

B. Tablespace can be brought online while the database is running

C. Each object can spawn multi tablespace.

D. The SYSTEM tablespace cannot be offlines while the database is running

E. Some tablespace containing active rollback segments can be offline

 

정답 : A, B, D (오라클 7.3 버젼에서는)

-> C가 답이 되기 위해서는 오라클 8의 partitioning기능을 이용할 때로 한정되어야 하며

object가 table로 바뀌어야만 합니다. A, B, D가 맞습니다.

-> 이 문제는 어디에서 본 건데 8 버젼 프로그램부터는 객체가 다중 테이블스페이스에 걸쳐

있다고 들은 것 같습니다.

 

문) 자기 자신에 관한 user 정보를 볼 수 있는 data dictionary view?

 

정답 : user_users

-> 오라클메뉴얼 3-75 참조

 

문) DATABASE 생성시 DEFAULT로 몇 개의 LOG GROUP과 각 GROUP당

몇 개의 LOG FILE MEMBER가 만들어 지는가?

 

A. 1개의 LOG GROUP, 각 GROUP당 1개의 LOG FILE MEMBER

B. 1개의 LOG GROUP, 각 GROUP당 2개의 LOG FILE MEMBER

C. 2개의 LOG GROUP, 각 GROUP당 1개의 LOG FILE MEMBER

D. 2개의 LOG GROUP, 각 GROUP당 2개의 LOG FILE MEMBER

 

정답 : C

-> DATABASE생성시 DEFAULT는 2개의 LOG GROUP, 각 GROUP당

1개의 LOG FILE MEMBER이다. 하지만 REDO LOG 자료의 손실을

방지하기 위하여 각 GROUP당 2개이상의 MEMBER를 가지도록

권장하고 1있다.

 

*---------------------------------------------------------------------------*

* 4. Accessing and Updating Data (3) *

* - 데이터 엑세스와 갱신 *

*---------------------------------------------------------------------------*

 

■User Request

All SQL statements are processed by the Server Process which gets the request

directly from the User Process. The Server Process uses three main phases of

processing : PARSE, EXECUTE, FETCH

 

■Server Process

1) Searches the LRU list

2) Looks for a free buffer

3) Moves dirty buffers to the dirty list

 

■PGA Characteristics ★

1) Stack space is memory allocated to hold session variables and arrays ★

2) User session data

3) Writeable and non-shared

주) 각 user마다 공유하지 않고 할당되는 Server Process에 관한 variable 등의 정보

 

■Processing SQL Statements

1) Parse

① Checks the syntax and the semantic

② Quries the data dictionary for object resolution, security privilege,

and the most effective path (known as the parse tree or execution plan)

③ Allocates a private SQL area for the statement

주) user's system privilege도 check함 ★

2) Execute

① Applies parse tree to data buffer

② Performs physical reads or logical reads and writes

③ Performs constraint checking

④ Changes data, if needed.

3) Fetch

① Retrieves rows of data for a SELECT statement

 

■Connecting to the instance

- Cursor Space is either in the Server Process PGA or a private area in the SGA

 

■The UPDATE Operation ★★★

1) Acquires data blocks into the database buffer cache

2) Acquires rollback blocks into the database buffer cache

3) Places exlusive row locks on rows that are about to change ★

4) Stores a record to identify before and after images in the redo log buffer

5) Save rollback data into a rollback segment block buffer

6) Applies changes to the data block buffer

주) 1) ~ 6)까지 순서대로 숙지해야 함

 

■Properties of the UPDATE Operation

1) A rollback segment is an object that is used to save rollback data.(before image)

2) The Oracle Server provides a read-consistent image of data for all readers.

 

■DBWR Process

1) Write all changed buffer to datafiles

2) Uses a LRU algorithm to keep most recently used blocks in memory

3) Defers writes for I/O optimization

 

■DBWR writes dirty buffers to disk when (구동시점) ★★★

1) The dirty list reaches a threshold length

2) A process scans a specified number of buffers in the LRU list without finding a free buffer

3) A time-out occurs(약 3초)

4) A DBWR checkpoint occurs.

 

문) update시 buffer에 빈공간이 없을 경우 가장 먼저 일어나는 것은?

 

정답 : dirty buffer를 DB에 기록

 

문) Update가 발생하여 프로세서가 release lock을 하고 redo log가 기록되고 있는

순간 시스템에 에러가 발생하였다면? ★★★

 

A. update data will rollbacked and SMON repair instance with rollback segment.

B. The redo log file will help repair.

C. Next startup will recover media recovery with archivelog file.

 

정답 : A

 

문) At which point in an UPDATE is the data change actually made in the datafile? ★★★

 

A. Parse step

B. Execution step

C. Commit step

D. Checkpoint step

 

정답 : D

 

문) Which event occurs first when an UPDATE statement is executed?

 

A. Changes are applied to the data block buffer.

B. Rollback data is saved into a rollback segment block buffer.

C. Exclusive row locks are placed on rows that are about to change

D. A record is stored to identify before and after images in the redo log buffer.

 

정답 : C

-> 오라클메뉴얼 4-19

-> C -> D -> B -> A

 

문) DATABASE에 변경이 생겼을 때 다음 3 buffer들이 write되는 순서는?

 

① redo log buffer

② DB buffer

③ rollback buffer

 

A. ① -> ② -> ③

B. ① -> ③ -> ②

C. ② -> ③ -> ①

D. ② -> ① -> ③

 

정답 : B

 

문) Which component holds a user's session variables and arrays?

 

A. SGA

B. PGA

C. Shared Pool

D. datafiles

 

정답 : B

-> 오라클메뉴얼 4-11

 

문) Which step in the processing of a SQL statement checks a user's system privileges?

 

A. parse

B. execute

C. fetch

 

정답 : A

-> 오라클메뉴얼 4-11

 

문) rollback block에는 어떤 정보가 담겨져 있나?

 

정답 : before image

 

문) redo log buffer에 저장되는 정보는?

 

정답 : all database changed information (before image, after image)

 

문) update 수행과정은?

 

정답 : data를 data buffer cache에 가져온다.

--> rollback 에 쓰일 부분을 획득한다.

--> 두 영역에 lock을 설정

--> redo log buffer에 before image, after image 기록

--> rollback 영역에 before image를 저장

--> data 영역 변경

 

문) DEDICATED SERVER 프로세스가 이용될 때

SESSION VARIABLE과 ARRAY가 저장되는 곳은 어디인가?

 

A. SHARED POOL

B. SGA

C. PGA

D. DATABASE BUFFER CACHE

 

정답 : C

-> 사용자가 오라클 DATABASE에 연결하고 세션을 설정하면 오라클서버에

의해서 PGA가 할당되며 이 PGA는 사용자나 서버 프로세스의 제어정보나

데이터를 가지는 영역이다.

따라서 사용자의 SESSION VARIABLE이나 ARRAY등은 PGA에 저장되어진다.

 

문) Object resolution이 발생하는 SQL문장 처리단계는 ?

 

A. FETCH

B. EXECUTE

C. PARSE

 

정답 : C

 

문) UPDATE문장이 실행될때의 과정중 CHANGE를 하려는 ROW 에

EXCLUSIVE ROW LOCKS이 주어진 직후 일어나는 EVENT는 무엇인가?

 

A. DATABASE BUFFER CHCHE내로 데이터 블록을 읽어들인다

B. DATA BLOCK BUFFER에 변경된 내용를 저장한다

C. ROLLBACK SEGMENT BLOCK BUFFER에 ROLLBACK DATA를 저장한다

D. REDO LOG BUFFER에 BEFORE와 AFTER IMAGE를 구분하기 위하여 저장한다

 

정답 : D

-> UPDATE 문장의 실행과정은 다음과 같다.(중요하므로 꼭 숙지)

변경하려는 ROW에 EXCLUSIVE ROW LOCK을 둔다

REDO LOG BUFFER에 BEFORE와 AFTER IMAGE를 구분하기 위하여 저장한다

ROLLBACK SEGMENT BLOCK BUFFER에 ROLLBACK DATA를 저장한다

DATA BLOCK BUFFER에 변경된 내용를 저장한다.

 

문) DBWR가 dirty buffer를 disk에 쓰는 시점은? (3가지)

 

A. The Dirty list reaches a threshold length

B. A commit occurs

C. A process scans a specified number of buffers in the LRU list

without finding a free buffer

D. A time-out occurs

E. A LGWR time-out occurs

 

정답 : A, C, D

 

문) DBWR이 항상 DIRTY BUFFERS를 DISK에 WRITE하는 경우가 아닌 것은?

 

A. DBWR CHECKPOINT가 발생했을 경우

B. TIME-OUT이 발생했을 경우

C. COMMIT이 발생했을 경우

D. 프로세스가 자유버퍼를 찾지 못하고 LRU LIST에서 특정수의 버퍼를 SCAN했을경우

 

정답 : C

-> DBWR이 DISK에 DIRTY BUFFER를 WRITE하는 경우는 다음과 같다.

1) DIRTY LIST가 THRESHOLD LENGTH에 도달하는 경우

2) DBWR CHECKPOINT가 발생했을 경우

3) TIME-OUT이 발생했을 경우

4) 프로세스가 자유버퍼를 찾기전에 LRU LIST에서 특정수의 버퍼를 SCAN했을경우

 

문) Flushing the dirty buffer write queue is most directly handled by

 

A. PMON

B. SMON

C. ARCH

D. RECO

E. DBWR

 

정답 : E

 

*---------------------------------------------------------------------------*

* 5. Manage Transaction Concurrency and Consistency (3) *

* - 트랜잭션 동시성과 일관성 관리 *

*---------------------------------------------------------------------------*

 

■Transaction End ?

1) Transaction committed

① A SQL COMMIT

② DCL, DDL (create, alter, drop, grant, revoke)

③ Normal exit from a user program

2) Transaction aborted

① ROLLBACK SQL

② User-requested termination (Ctrl + C )

③ Abnormal exit

④ Processor failure

⑤ Disk failure

 

■LGWR Process (구동시점) ★★★

- LGWR writes redo log buffer to redo log files when

① A commit occurs

② Redo log buffer pool becomes 1/3 full

③ DBWR completes cleaning the buffer blocks at a checkpoint (CKPT 발생시)

주) Checkpoint가 일어난 직후는 아님.

④ LGWR time-out occurs

 

■COMMIT Operation ★★

1) LGWR flushes the redo log buffer to the current log group ★

2) The user is notified that the transaction has been committed

3) Resource locks are released on data and rollback blocks

4) DBWR writes database blocks to disk

주) 순서 숙지할 것

 

■Log Switches

1) Log switch occurs when LGWR stops writing to one redo group and begins

writing to another

2) Log switch can be forced by a DBA

예) sqldba>ALTER SYSTEM SWITCH LOGFILE

3) Checkpoint automatically occurs at a log switch

4) Processing can continue as long as at least one member of a group is available

 

■Checkpoints (구동시점) ★★

- DBWR writes all dirty buffers in the database buffer cache to disk

① At every log switch

② LOG_CHECKPOINT_TIMEOUT

③ LOG_CHECKPOINT_INTERVAL

④ At Instance shutdown, unless the instance is aborted

⑤ DBA (ALTER SYSTEM CHECKPOINT)

⑥ Tablespace is taken offline while at least one of its files is online

 

■CKPT Process ★

1) Enabled by setting parameter. CHECKPOINT_PROCESS = TRUE

2) If enabled, the background process will take over LGWR's tasks of updating files

at a checkpoint. ★

3) Headers of datafiles and control files are updated at the end of a checkpoint

4) More frequent checkpoints will reduce the time necessary for recovering

from instance failure, at the possible expense of performance.

5) Improve the performance of database with many database files.

 

■ARCH Process

1) Copies redo log files to tape or disk for media failure recovery

2) Operates only when a log switch occurs

3) Is optional and is only needed when in ARCHIVELOG mode

4) May write to a tape drive or to a disk

 

문) OLTP 서버에서는 매초 COMMIT이 발생한다.

그런데 여러 트랜잭션이 동시에 WRITE되지 않는 이유는?

 

정답 : DEFERRED WRITE (쓰기지연)를 수행한다.

-> 하나의 block대신 batch에 의해 쓰게함으로써 물리적으로 oracle 서버블록을 메모리에서

디스크로 쓰는데 소요되는 I/O시간을 줄이기 위해 쓰기지연을 제공

 

문) log_checkpoint_interval과 리두로그 횟수가 같게 되었다.

무슨 일이 발생하는가? ★★★

 

A. ckpt will be write to control file.

B. ckpt will be write to redo log file.

C. synchronized writing.

 

정답 : A

-> 오라클메뉴얼 5-23

-> DBA의 답..확실치 않음.. B번 같은데...

-> 위 상황은 checkpoint가 발생하는 상황입니다.

데이터화일과 컨트롤 화일에 동기화 정보를 저장하게 됩니다.

이 때 CKPT가 있다면 CKPT가 없다면 LGWR가 이 동기화 정보를 저장하는 역할을 하게 됩니다.

 

문) 빈번한 checkpoint가 데이터에 미치는 효과는? (2가지)

 

A. 처리비용 증가

B. redo log file에 대한 쓰기 감소

C. 복구속도 증가

D. 디스크기록 감소

E. redo log buffer에 대한 쓰기 증가

 

정답 :

 

문) 디폴트로, 체크포인트는 다음 중 하나 만큼 흔히 발생한다. ★★★

 

A. Redo log switches

B. Update statements are issued against the database

C. The SYSTEM tablespace is accessed

D. SMON coalesces free space in a tablespace

 

정답 : A

 

문) 테이블 스페이스내의 파일에 어떠한 오류가 발생하여 query를 할 수 없게

되어 redo log file의 CKPT 기록이 되었는지 알수 없는 상황이다. 이 테이블

스페이스 내에는 테이블 인덱스가 저장되어 있고 이때 DBA가 가장 먼저 취

할 수 있는 가장 적당한 것은? ★★★

 

A. copy redo log file.

B. svrmgr모드에서 archive logfile을 이용한 복구.

C. svrmgr모드에서 shutdown abort.

D. copy control file.

 

정답 : B

 

문) Which of the following best supports the concept of transaction concurrency? ★★★

 

A. Read-only tablespaces

B. Locking mechanisms

C. Select statements issued by multiple users

D. Distributing redo log members over multiple disks

 

정답 : B

 

문) 언제 ARCH가 진행되는가?

 

정답 : archive mode 시 log switch가 일어날 때

 

문) LOG_CHECKPOINT_INTERVAL 무엇인가?

 

정답 : log file이 사용된 block의 수

이전 checkpoint가 발생한 이후 사용된 log buffer의 수가 interval에 기록된 수보다

커지면 checkpoint발생

 

문) 다음중 checkpoint 발생시 일어나는 event가 아닌 것은?

 

A. DBWR가 dirty buffer를 datafile에 기록

B. LGWR가 redo entry들을 redo log file에 기록

C. ARCH가 redo log file의 내용을 archive 위치로 기록

D. datafile header와 control file header가 변경됨

 

정답 : C

-> checkpoint와 ARCH 프로세스는 무관

 

문) Which background process allows for recovery of committed data

in the database buffer cache at the time of an instance failure? ★

 

A. DBWR

B. LGWR

C. ARCH

D. CKPT

 

정답 : B

-> 오라클메뉴얼 5-9

 

문) Commit이 발생했을 때 다음 중 옳은 것은?

 

A. Writes all changed buffers to datafiles

B. Defers writes for I/O optimization

C. DBWR writes dirty buffers to disk

D. LGWR flushes the redo log buffer to the current log group.

 

정답 : D

-> C. writes database blocks to disk

 

문) What happens when a user issues a COMMIT operation? ★

 

A. Resource locks are released on data and rollback blocks.

B. LGWR flushes the redo log buffer to the current log group.

C. Changes are applied to the data block buffer.

D. Rollback data is saved in a rollback block buffer.

 

정답 : B

-> 오라클메뉴얼 5-15

-> A도 되지 않을까?

 

문) 데이터베이스에서 발생하는 체크포인트의 개수를 줄이려면 어떻게 해야하나? ★★★

 

A. LOG_CHECKPOINT_INTERVAL 을 온라인 REDO 로그 크기의 절반으로 설정한다.

B. LOG_CHECKPOINT_INTERVAL 을 온라인 REDO 로그 크기의 두배 크기로 설정한다.

C. LOG_CHECKPOINT_TIMEOUT 을 온라인 REDO 로그 안에 있는 바이트의 개수로 설정한다.

D. LOG_CHECKPOINT_TIMEOUT 을 온라인 REDO 로그 안에 있는 바이트의 개수의 절반으로

설정한다

 

정답 : B

 

문) LGWR이 REDO LOG FILE에 REDO LOG BUFFER를 WRITE하는 경우가 아닌 것은? ★

 

A. LGWR TIME OUT 발생시

B. COMMT이 일어난 직후

C. CHECKPOINT가 일어난 직후

D. REDO LOG BUFFER POOL의 1/3이 찼을때

 

정답 : C

-> LGWR이 REDO LOG FILE에 REDO LOG BUFFER를 WRITE하는

경우는 다음과 같다.

1) COMMIT이 일어난 직후

2) REDO LOG BUFFER POOL의 1/3이 찼을때

3) CHECKPOINT에서 DBWR이 BUFFER BLOCK에 대한 CLEANING을 완료했을 경우

4) LGWR TIME OUT 발생시

 

문) CKPT PROCESS가 ENABLE되면

다음 중 어느 프로세스의 작업을 인계받아 CHECKPOINT시에

FILE을 UPDATE하는 작업을 하게 되는가? ★

 

A. LGWR

B. DBWR

C. ARCH

D. SMON

 

정답 : A

-> CKPT PROCESS는 OPTIONAL PROCESS이므로

반드시 오라클 인스턴스 기동시 필요한 프로세스는 아니다.

따라서 CKPT PROCESS가 ENABLE되어있지 않으면

LGWR이 그 기능을 대신하다가 CKPT PROCESS가 ENABLE되면

LGWR의 기능을 CKPT가 인계받아 작업을 하게된다.

CKPT PROCESS를 ENABLE하려면 초기화 파라미터 파일에서

CHECKPOINT_PROCESS = TRUE로 설정한다. DEFAULT는 FALSE이다.

 

문) Commit이 발생했을 때 다음 중 제일 먼저 수행하는 것은? ★

 

A. Writes all changed buffers to datafiles

B. Defers writes for I/O optimization

C DBWR write dirty buffers to disk

D. LGWR flushes the redo log buffer to the current log group.

 

정답 : D

-> 오라클메뉴얼 4-21 참조

 

문) LOG_CHECKPOINT_INTERVAL로 checkpoint를 발생했을때

LGWR의 performance를 줄여 주는 역할을 하는 background process는?

 

A. SMON

B. PMON

C. DBWR

D. LGWR

E. CKPT

 

정답 : E

 

문) Checkpoint가 자주 발생시 결과는? (2가지) ★

 

A. higher processing costs

B. fewer writes to the redo log files

C. faster recovery rates

D. less writes to disk

E. more writes to the redo log buffer

 

정답 : C, E ? -> A, C

-> 오라클메뉴얼 5-23

-> 자주 체크포인트를 쓰게 되면 성능은 좀 떨어지지만 인스턴스 실패시 복구에 드는

시간을 줄일 수 있다.

 

문) A라는 사용자가 다음 문장을 실행하였다.

 

1. TABLE_A의 A ROW에 대한 UPDATE문장

2. TABLE_B의 CREATION

3. COMMIT 실행

 

B라는 사용자가 TABLE_A에 대한 SELECT권한이 있다고 가정할 때

TABLE_A의 A ROW에 대한 변경사항을 가장 빨리 볼 수 있는 것은

언제인가?

 

A. 1번 - 2번사이

B. 2번 - 3번사이

C. 3번이후

D. 변경사항을 볼수 없다

 

정답 : B

-> READ CONSISTENCY에 따라 수정 중인 자료는 COMMIT된 후에

다른 사용자들이 볼 수 있게 된다. 모든 DDL은 실행될 때 자동으로

COMMIT이 일어나므로 위의 문제에서는 TABLE_B의 CREATION시

COMMIT이 자동으로 일어난다는 것을 알 수 있다.

 

*---------------------------------------------------------------------------*

* 6. Manage The Database Structure (5) *

* - 데이터베이스 구조 관리 *

*---------------------------------------------------------------------------*

 

■Space Allocation

1) Space is allocated when an object is created and later when it grows

오브젝트가 생성되었을 때와 크기가 증가될 때 공간이 할당된다.

2) Space is allocated in sets of contiguous database blocks called extents

확장영역(extents)이라고 하는 연속된 데이터베이스블록의 집합에 공간이 할당된다.

3) Tablespace owns datafiles

한 테이블스페이스는 여러개의 데이터파일들을 포함한다.

4) Space-using database object is stored within a single tablespaces

for the lifetime of the object

한 공간을 사용하는 데이터베이스 오브젝트는 하나의 테이블스페이스에 저장된다.

 

■SYSTEM Tablespace

1) Required in all database for database operation ★

2) Contains data dictionary information, definitions of stored procedures,

packages, and database triggers

2) Contains the SYSTEM rollback segment

3) Can contain user data (주)

 

■Creating a tablespace Guideline

1) The value for the INITIAL and NEXT are rounded up to the next multiple of

the data block size as determined by the initialization parameter DB_BLOCK_SIZE.

2) The first block of the INITIAL extent is considered the segment header block.

 

■Creating a Tablespace

1) INITIAL

- first extent to be allocated to the object (k,m)

2) NEXT

- next extent to be allocated to the object (k,m)

3) MINEXTENTS

- total number of extents allocated when the segment is created. (2개)

4) MAXEXTENTS

- total number of extents, including the first,

that the Oracle Server can allocate for the object (121개)

5) PCTINCREASE

- next * ( 1 + pctincrease / 100) ★

 

■Altering a Tablespace

1) ONLINE / OFFLINE

2) NORMAL

- performs a checkpoint for all datafiles in the tablespace

3) TEMPORARY ★

- performs a checkpoint for just the online datafiles in the tablespace

4) IMMEDIATE ★

- does not ensure that tablespace files are available and

does not perform a checkpoint

 

■Dropping a Tablespace

- A tablespace that still contains data cannot be dropped without the INCLUDING CONTENTS option. (주)

1) INCLUDING CONTENTS

- drop all the contents of the tablespace

2) CASCADE CONSTRAINTS

- 삭제된 테이블스페이스에 있는 테이블의 기본키와 유일한(unique)키를 참조하는

테이블스페이스의 외부 테이블의 모든 참조무결성 제약조건을 삭제

 

■Segments : Database objects

- A set of one or more extents that contains all the data for a specific type of

logical storage structure within tablespace

- Cannot span tablespaces (주)

- Storage parameters for temporary segments always use the default storage parameters set for

the associated tablespace

- Can never be set explicitly.

1) 종류

① Rollback segment

② Data segment

③ Index segment

④ Temporay segment

⑤ Bootstrap segment

주) System segment는 없다.

 

■Rollback Segments ★★★★ (8장. Manage Rollback Segments에서 더 자세히 다룸)

- A portion of the database that records data before it is modified by transactions,

allowing the changes to be rolled back (undone)

- A circular object cf. redo log file - in a circular fashion

1) 특성

① Read consistency ★

② Used during database recovery ★

③ Can record data changed in any tablespace except for the SYSTEM rollback segment

④ Can record changes for multiple transaction

⑤ At least one extra rollback segment is needed if multiple tablespaces are used

 

문) PCTINCREASE의 변경시 적용은?

 

정답 : 새로운 OBJECT 에게 적용된다. 즉, 다음 테이블 형성시 적용됨

 

문) Autoextend on 옵션을 주고 생성된 tablespace의 테이블에 많은 데이터

insert가 있어 데이터 파일이 maxsize에 도달하였다.

당신이 할 수 있는 가장 신속한 조치는? ★★★

 

A. alter tablespace 명령을 이용하여 해당 테이블스페이스 파일의 크기를 늘림

B. alter database명령을 이용하여 테이블스페이스를 resize 해줘야 한다.

C. alter tablespace의 pctincrease를 늘려줘야 한다.

D. maxextents를 늘려줘야 한다.

E. database를 재생성해야 한다.

 

정답 : A

-> 오라클메뉴얼 6-29

 

문) Tablespace의 pctincrease를 10으로 늘렸을 경우 그 tablespace 안에 있는

Table들은 어떤 영향을 받는가? ★★★

 

A. Table에서 PCTINCREASE 값이 0이었던 table들만 pctincrease값이 변화

B. 모든 tablespace안의 table들의 pctincrease값이 변화

C. oracle system default로만 적용됨.

D. 변화 없음.

 

정답 : D

-> 그 테이블 스페이스에 새로 추가되는 테이블에만 적용됩니다.

 

문) To determine the storage allocation for temporary segments,

the DBA can access which of the following views? ★★★

 

A. DBA_TEMP_SEGMENTS

B. DBA_TABLES

C. DBA_SEGMENTS

D. DBA_TEMP_TABLES

 

정답 : C

 

문) 다음 중 tablespace에 대한 설명으로 틀린 것은?

 

A. tablespace에 사용 중인 rollback segment가 있으면

offline, read-only로 변경할 수 있다.

B. system tablespace에는 system rollback segment가 있다.

C. system tablespace에는 사용자 데이터를 저장할 수 없다.

D. system tablespace는 모든 database에 필요하다.

 

정답 : C

 

문) Tabespace 삭제에 대한 설명 중 틀린 것은?

 

A. 데이터가 남아있는 tablespace는 삭제할 수 없다.

B. tablespace가 삭제되면 그 안에 있는 데이터는 더이상 database에 남아있지 않다.

C. drop 명령 후 OS 상에서 datafile을 삭제해야만 한다.

D. tablespace가 삭제되면 control file에 있는 file pointer만 삭제되고

실제 datafile은 제거되지 않는다.

 

정답 : A

 

문) Which keyword(s) would you include in an ALTER TABLESPACE SQL command

to ensure a checkpoint is not performed?

 

A. NORMAL

B. TEMPORARY

C. IMMEDIATE

D. OFFLINE

E. END BACKUP

 

정답 : C

-> 오라클메뉴얼 6-21

 

문) Which structure of the logical database must exist for the database to run?

 

A. SYSTEM Tablespace

B. DATA Tablespace

C. INDEX Tablespace

 

정답 : A

-> 오라클메뉴얼 6-7

 

문) sort 전용으로 SMON에 의해 coalsce되는 segment는?

 

정답 : temporary segment

 

문) 가장 많은 fragment을 발생하는 segment는?

 

정답 : temporary segment

-> data segment = 0에 가까움 > index , rollback

 

문) rollback segment에 대해서

- optimal parameter에 대해

- 한 transaction에 할당되는 rollback segment의 개수는?

- pctincrease 값은?

- MINEXTENTS의 최소값은?

 

정답 : - optimal에 정해준 size 이상 rollback segment extent가 할당될 때

size만큼 de-allocate된다.

- only one

- 0

- 2

 

문) SPACE ALLOCATION 에 대한 설명으로 옳은것은? (2가지)

 

A. Space is allocated when an object is created and later when it grows

B. Datafile owns tablespaces

C. Space is allocated in sets of contiguous database blocks called extents

D. Space-using database object is stored within multiple tablespaces

for the lifetime of the object

 

정답 : A, C

-> 오라클메뉴얼 6-5 참조

-> B. Tablespace owns datafiles

D. Space-using database object is stored within a single tablespaces

for the lifetime of the object

 

문) SYSTEM 테이블스페이스에 대한 설명중 잘못된 것은?

 

A. DATABASE가 운영되기 위하여 반드시 존재해야 한다

B. SYSTEM ROLLBACK SEGMENT를 포함할 수도 있고 안할 수도 있다

C. USER DATA를 포함할 수도 있고 안할 수도 있다

D. DATA DICTIONARY정보, STORED PROCEDURE등을 포함한다

 

정답 : B

-> 시스템 테이블스페이스는 SYSTEM이라 불리는 ROLLBACK

SEGMENT를 항상 가지고 있다.

 

문) USER_DATA tablespace with an INITIAL extent of 50K 로 생성을 했다면

USER_DATA tablespace 안에 temp라는 table를 생성시 INITIAL parameter를

생략했다면 어떤 값으로 설정이 되겠는가?

 

정답 : USER_DATA tablespace에서 설정한 50K가 설정된다.

 

문) create table (

id number(3) primary key,

name varchar2(30),

initial 20K,

next 20K,

pctincrease 50 )

 

위와같이 Table이 생성되었고, db_block_size가 2K 일경우 세번째

extent의 size는 ?

 

A. 10K

B. 20K

C. 30K

D. 40K

 

정답 : C

-> Next Extent = Next * (1 + new pctincrease / 100)

= 20K * (1+ 50/100) = 30K

 

문) SEGMENT를 분리하여야 하는 이유로서 타당하지 않은 것은?

 

A. 각각 다른 BACKUP의 필요에 따라서

B. 질의에 대한 응답속도를 빠르게 하기 위하여

C. 엑세스할 필요가 각각 다른 경우에 대하여

D. 각각 다른 LIFE SPAN을 가지는 경우에 대하여

 

정답 : B

-> 단순히 속도를 위하여 SEGMENT를 분리해서는 안된다.

BACKUP의 필요가 다르거나, 엑세스 필요가 다르거나,

서로다른 LIFE SPAN을 가지는 경우에 SEGMENT를 분리한다.

 

문) Rollback segment의 주요 목적은? ★★

 

A. Read consistency 제공

B. Allow users to roll back a transaction

C. Are used during database recovery

D. Are used to recovery Instance failure

 

정답 : A, B, C

-> C도 답임. 그리고 D는 인스턴스 실패 복구시 더 빠른 인스턴스 기동을 위해서 활성 redo

log로부터 모든 트랜잭션 활동을 roll-forward 하고 roll-forward 작업의 일환으로

rollback segment entry를 재구축함.(backup P 9-5) 고로 답이 아닌 것 같음.

-> D는 안된다. Instance는 복구대상이 아니다.

 

문) Rollback segment의 설명이 아닌 것은? ★★★

 

A. 읽기 일관성, recovery에 필요하다

B. optimal parameter는 할당되었던 영역을 자동적으로 회수한다.

C. MINEXTENTS는 최소한 2이상이다.

D. 특정 transaction에 rollback segment를 지정할 수 없다.

 

정답 : D

 

문) Rollback segment을 drop하기 위하여 먼저 해야할 일?

 

정답 : Rollback segment을 offline 해야 함

 

문) Rollback segments의 MAXEXTENTS를 키워 줘야 하는 경우

 

정답 : 긴 transaction이 생길 경우

 

문) Tablespace의 Storage parameter 설정을 하고 난 후 table을 새로 생성할 때

Storage parameter를 설정하지 않았으면 Table의 Storage parameter 설정은 어떻게 되나?

 

정답 : Tablespace storage parameter를 따른다.

 

*---------------------------------------------------------------------------*

* 7. Manage Storage Allocation (5) *

* - 스토리지 할당관리 *

*---------------------------------------------------------------------------*

■스토리지 파라미터

- INITIAL

- NEXT

- MAXEXTENTS

- MINEXTENTS

- PCTINCREASE

- OPTIMAL

- FREELISTS

 

■블록공간활용 파라미터

- PCTFREE

- PCTUSED

- INTRANS

- MAXTRANS

 

■Extent

1) Extents are allocated when

① Segment is created (INITIAL EXTENT)

② Segment grows (NEXT EXTENT)

③ Table or cluster is altered to allocate extents.

 

2) Extents are de-allocated when

① Segment or cluster is dropped.

② Segment or cluster is truncated.

③ Segment is larger than optimal and contains free extents (for rollback segment only)

 

■Controlling Extent Allocation

- Rules of Precedence

1) Any storage parameter specified at the object level overrides 우선한다

the corresponding option set at the tablespace level

2) When storage parameters are not explicitly set at the object level,

they default to those at the tablespace level

3) When storage parameters are not explicitly set at the tablespace level,

the Oracle Server system defaults apply

4) If storage parameters are altered,

the new options apply only to the extents not yet allocated

5) The OPTIMAL command is only specified for rollback segments ★

6) FREELISTS and FREELIST GROUPS parameters cannot be specified for tablespace defaults.

 

■확장영역(extents) 할당제어

주) INITIAL과 MINEXTENTS는 변경할 수 없다.

- INITIAL

- NEXT

- MAXEXTENTS 최소값 : 1

주) Rollback segment나 Dictionary Table은 이 옵션을 사용해선 안된다.

- MINEXTENTS

기본값은 1개. Rollback segment를 2개의 확장영역(extents)을 갖는다.

- PCTINCREASE 기본값은 50%

주) Rollback segment는 이 파라미터를 사용할 수 없음.

 

■Properties of Database Blocks

1) DB_BLOCK_SIZE determines the size of each database buffer in the SGA.

2) Database blocks are also known as logical blocks and Oracle Server blocks.

3) Once the database is created, the parameter DB_BLOCK_SIZE cannot be changed.

 

■Database Blocks

1) Header

- Contains general block information, such as the block address, and the segment type.

2) Free space

- Available for inserts or updates of rows, or for additional transaction entries.

3) Row data

- Stores table or index data.

※ 기타 Table directory, Row directory가 있다. Database Block이 아닌 것을 고르는 문제

 

■Controlling Space Usage

1) PCTFREE

- Reserved for future updates. Default 10%

2) PCTUSED

- Becomes a candidate for row insertion when its used space falls below PCTUSED.

Default 40%

3) INITRANS

- 한 개의 block를 handing 할 수 있는 transaction 개수

(default 1, minimum 1, maximum 255)

4) MAXTRANS

- Maximum number of transactions that can access the block concurrently

(maximum 255)

If the block's free space has been used, transactions will have to wait

for access to the block

 

■Setting a Lower PCTFREE parameter value ★★

1) Allows inserts to fill blocks more completely

2) May require fewer blocks to store data

3) Can increase processing costs if the Oracle Server must frequently reorganize blocks

4) Can cause row migration (when update)

 

■Setting a Higher PCTFREE parameter value ★★

1) Reserves more room for future updates

2) May require more blocks to store data

3) Lowers processing costs because blocks will require reorganization infrequently

4) Reduces the need to chain rows

 

■Setting a Lower PCTUSED value ★

1) Reduces processing costs because blocks are not often free

2) Increase unused space

 

■Setting a Higher PCTUSED value ★

1) Increase processing costs because blocks may often become free

2) Improves space usage

 

주) PCTFREE, PCTUSED 관계 완벽히 숙지할 것. 헤갈림 ★★★★

 

■Chaining

1) A row that cannot fit into a single block is chained across multiple blocks

2) The initial row piece remains in the block where the row was first targeted

3) Each additional row piece fits into a chained block

 

■Migration

1) A migrated row is moved in its entirety from its original block to a chained block.

The row header remains in the block where the row was initially created.

2) A row migrates when an update requires more space than is currently available on the block

3) Use a sufficiently high value for PCTFREE to avoid excessive row migration.

 

■Chaining and Migration

1) Row Chaining and Row Migration

- Chaining occurs with large rows when all of the data for a row in a table

cannot fit in the same block.

The data for row is stored in a chain of data blocks.

- Migration occurs if a row in a data block is updated so that the overall row length

increase and the block's free space has been completely filled.

The data for the row is migrated to a new data block, assuming the entire row can

fit in a new block.

2) Effect on Performance

- I/O performance is decreased when reading a chained or migrated row

- The Orcle Server must scan more than one data block to retrieve the information for the row

3) Resolve Row Migration

- ANALYZE command

- Alter PCTFREE for the object

- Export, drop, and import the object

4) The ANALYZE command stores rowid and other infromation into table CHAINED_ROWS.

 

■Display Extent and Segment Information

- Query the data dictionary views to see how many extents have been allocated and

how many segments exist

1) USER/DBA_EXTENTS

2) USER/DBA_FREE_SPACE

3) USER/DBA_SEGMENTS

4) DBA_TABLESPACES

5) DBA_DATA_FILES

 

■De-allocation of Unused Space

- Within a segment, the high water mark indicates the amount of unused space.

If you delete rows, the high water mark is not moved.

1) Space below the high water mark cannnot be de-allocated

2) The high water mark can by found by using the package procedure DBMS_SPACE.UNUSED_SPACE.

3) If a segment is completely empty, space can be released

by using the SQL command TRUNCATE DROP STROAGE.

- Use the ALTER TABLE command to de-allocate unused space

-> ALTER TABLE ... DEALLOCATE UNUSED ....

 

■Coalescing Free Space

- Oracle 7.3 이상. tablespace segment 를 연속된 block으로 병합.

1) ALTER TABLESPACE with the COALESCE clause.

2) DBA_FREE_SPACE_COALESCED

 

■Validating Structure

- Verify the integrity of the structure of an index, table, or cluster

 

■Monitoring Space Utilization

 

문) analyze table... compute statistics를 한달 전에 하였고 다시 최근에

실행후 확인해 보니...index entry was considerably dropped.

How can you do? ★★★

 

A. remove index because it is not need any more.

B. rebuild index

C. you don't need rebuild

D. increase the maxextents parameter.

 

정답 : B

-> DBA의 답변... 그러나 확실한 것은 아님...

-> 항목이 엄청나게 줄어들었다는 이야기인가요. compute statistics한 자료가 있으면

cost based 하에서는 이 자료를 중심으로 실행계획을 만들죠.

제 생각에는 rebuild index해주고 analyze도 다시 해야 하지 않을까 생각합니다.

 

문) 하이워터 마크가 실제보다 높은 이유는? ★★★

 

A. 증가하다가 줄어들어서

B. truncate되어서

C. 삭제되어서

 

정답 : A ?

 

문) high-water-mark를 줄이는 방법?

 

정답: drop, truncate (보기에는 뭐가나왔는지 기억이 안남)

 

문) INITRANS를 높게 설정한 이유?

 

A. 사용가능한 공간을 찾아야하기 때문에 트랜잭션의 속도가 느려질 수 있다.

B. 트랜잭션이 부분적으로 채워진 데이터 목록을 사용하기 위해 대기해야 합니다.

...

 

정답 :

[Top]
No.
제목
작성자
작성일
조회
9004OCP 문제 - ADMIN 파트 (4)
정재익
2001-12-23
7934
9003OCP 문제 - ADMIN 파트 (2)
정재익
2001-12-23
12644
9002OCP 문제 - Admin 파트 (3)
정재익
2001-12-23
6726
9001OCP 문제 - ADMIN 파트 (1)
정재익
2001-12-23
14072
9000Oracle Library Cache and Dictionary Cache
정재익
2001-12-23
5637
8913Oracle Performance Tuning SQL Scripts
정재익
2001-12-14
6856
8909Oracle System Documentation
정재익
2001-12-14
5656
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.052초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다