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

문) Rollback segment에 Highwater mark가 실제 Data보다 높은곳에 설정되어 있다. ★★★

왜 그런가?

 

정답 :

 

문) TABLESPACE에 속한 DATAFILE의 이름과 크기등을 조회하는 뷰는?

 

정답 : DBA_DATA_FILES

 

문) Which of the following are components of a data block? (Choose two.) ★★★

 

A. Library cache

B. Row cache

C. Row directory

D. Fixed header

E. Pctincrease

 

정답 : C, D

-> A.B 모두 Shared SQL area의 구성요소이므로 답이 아닙니다.

오라클메뉴얼 7-19 : 헤더, 테이블디렉토리, 행 디렉토리, 사용하지 않은 공간, 행 데이터

고로 정답은 C, D (E는 extent관리에 나오죠)

 

 

문) EXTENT의 수를 보는 뷰는? ★★★

 

A. DBA_EXTENTS

B. DBA_FREE_SPACE

C. DBA_DATA_FILES

 

정답 : A

 

문) 어떤 table에서 Update는 거의 일어나지 않고 insert만 무진장 일어난다면

storage option을 어떻게 해주어야 하는가?

 

정답 : Lower PCTFREE

 

문) INSERT/DELETE는 거의 없고 UPDATE가 많이 발생할 때의 PCTFREE, PCTUSED의 설정은?

 

정답 : PCTFREE를 높게, PCTUSED 낮게한다

 

문) update는 거의 안일어나고 insert만 일어나면 storage parameter는 어떻게 조정해야 하는가?

 

A. PCTFREE 증가

B. PCTFREE 감소

C. PCTUSED 증가

D. PCTUSED 감소

 

정답 : B ? (C도 될 것 같은데...)

-> 문제와 보기가 정확하지 않음

 

문) tablespace의 free space fragmentation 현황을 볼 수 있는 data dictionary?

 

A. dba_free_space

B. dba_fragmentation

C. dba_free_status

 

정답 : A

 

문) Available space for row entries in a data block is determined by ★★★

 

A. DB_BLOCK_SIZE + header size - pctfree

B. DB_BLOCK_SIZE - header size - pctfree

C. DB_BLOCK_SIZE + header size - pctused

D. DB_BLOCK_SIZE - header size - pctused

 

정답 : B

-> pctfree와 pctused는 db block의 update와 insert때 free list에 등록되기

위한 파라미터라고 할 수 있습니다. insert를 위한 공간이 얼마나 남아있는가를

구하기 위한 것이라면 B가 맞겠군요.

 

문) 다음 중 row migration 현상을 해결하는 방법이 아닌 것은?

 

A. analyze 명령을 이용하여 문제가 되는 row를 삭제하고 다시 입력한다.

B. object에 대한 pctfree를 증가시킨다.

C. object를 export하고 삭제한 후 다시 import한다.

D. object에 대한 pctused를 증가시킨다.

 

정답 : D

 

문) Which two characteristics correctly describe extents? (Choose two) ★★★

 

A. Each segment in a database is created with at least one extent.

B. The first extent is called the "primary" extent.

C. Additional extents after the primary are called "subsequent" extents.

D. The OPTIMAL parameter pertains to all extents.

E. Frequent de-allocation of extents can lead to a fragmented tablespace.

 

정답 : A, E

-> 오라클메뉴얼 7-7

-> B. primary extent -> initial extent

C. subsequent extent -> incremental extents

D. optimal은 Rollback segment와 관계됨

 

문) If the space usage parameters are set to the default values,

which change could cause higher processing costs because blocks will be

considered free more often? ★

 

A. raising PCTUSED

B. lowering PCTUSED

C. raising PCTFREE

D. lowering PCTFREE

 

정답 : A

-> 오라클메뉴얼 7-29

-> Setting a Lower PCTUSED Value

. Reduces processing costs because blocks are not often free

. Increase unused space

Setting a Higher PCTUSED Value

. Increase processing costs because blocks may often become free

. Improves space usage

 

문) IF THE SPACE USAGE PARAMETERS ARE SET TO THE DEFAULT VALUES,

WHICH CHANGE COULD REDUCE THE CHAINING OF ROWS?

 

A. LOWERING PCTFREE

B. RAISING PCTFREE

C. LOWERING PCTUSED

D. RAISING PCTUSED

 

정답 : B

 

문) [control block space] migration을 줄일려면 어떻게 해야하나?

 

정답 : pctfree값을 크게 해준다.

 

문) backup을 받으려할 때 datafile의 정보를 보기위한 data dictionary 는?

 

정답 : DBA_DATA_FILES

 

문) row delete 시 high water mark는?

 

정답 : 안바뀐다.

high water mark 이전의 빈 block을 de-allocate 하기 위해서는

truncate를 하거나 export/import하는 수밖에 없다.

 

문) PCTFREE를 작게하면? (또는 크게하면?)

 

정답 : block 사용율이 높다. - 필요한 block 수 감소

row migration이 많다 - 비용 증가

 

문) PCTUSED를 크게하면? (또는 작게하면?)

 

정답 : block 사용율이 높다. - 필요한 block 수 감소

비용이 증가 - free list에 삭제/삽입이 자주 일어난다.

( )는 반대.

 

문) Block Space를 제어하는 parameter는 ?

 

A. INITRANS

B. INITIAL

C. PCTINCREASE

D. OPTIMAL

 

정답 : A

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

-> Block Space Utilization Parameters (4가지)

: PCTFREE, PCTUSED, INITRANS, MAXTRANS

 

문) 블록공간 사용하는 파라미터는?

 

A. INITRANS

B. PCTINCREASE

C. NEXTEXTENTS

 

정답 : A

-> 위와 동일한 문제다.

 

문) A high PCTUSED

 

A. 오라클로 하여금 블록을 FREELIST 위에 빈번하게 위치시키게 함으로써 성능 비용을 증가.

B. 오라클로 하여금 블록을 FREELIST 위에 뜸한 간격으로 위치시킴으로써 성능 비용을 증가시킨다.

C. 오라클로 하여금 블록을 FREELIST 위에 빈번하게 위치시키게 함으로써 성능 비용 감소.

D. 오라클로 하여금 브록을 FREELIST 위에 뜸한 간격으로 위치시키게 함으로써 성능 비용을 감소.

 

정답 : A

 

문) A low PCTUSED ★★★

 

A. Decreases performance on the database by requiring short,

frequent placement of the blocks on a freelist

B. Increases storage costs on the database by placing a block on the freelist

only when a great deal of block space is free

C. Decreases storage costs on the database by maximizing space usage in a data block

D. Increases performance on the database by forcing Oracle to populate the block

with rows frequently

 

정답 : C

 

문) To control the storage allocation of a table or index : (choose two) ★★★

 

A. Specify a low pctfree

B. Specify a high pctused

C. Specify a low maxextents

D. Specify a high minextents

E. Specify a low pctincrease

F. Specify a high maxextents

 

정답 : A, B -> 답은 C, E 로 되어있는데...

-> pctfree, pctused는 공간 제어 파라미터이며. 나머지는 스토리지 파라미터임

(롤백 세그먼트, 테이블스페이스 등 생성시 쓰임)

 

문) Chaining이 발생할 가능성이 높은 경우는 ? ★★

 

A. A long row that cannot fit into a single block

B. Use high value for PCTFREE

C. Use low value for PCTFREE

D. Many rows that fit into multi blocks.

 

정답 : A

-> 오라클메뉴얼 7-33 참조

-> Chaining

- A row that cannot fit into a single block is chained across multiple blocks.

- The initial row piece remains in the block where the row was first targeted.

- Each additional row piece fits into a chained block

Migration

- A row migrates when an update requires more space than is currently available

- Use a sufficiently high value for PCTFREE to avoid excessive row migration

 

문) PCTFREE를 낮게 했을 때 다음 중 옳은 것은? (2가지)

 

A. May require fewer blocks to store data

B. Increase the need to chain rows

C. The propensity of migration rising

D. Reserves more room for future updates

 

정답 : A, C

-> 오라클메뉴얼 7-27 참조

-> Setting a Lower PCTFREE parameter value

- Allows inserts to fill blocks more completely

- May require fewer blocks to store data

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

- Can cause row migration (when update)

 

문) PCTFREE를 높게 했을 때 다음 중 옳은 것은? (2가지)

 

A. Allows inserts to fill blocks more completely

B. Lowers processing costs because blocks will require reorganization

infrequently.

C. Reserves more room for future updates

D. Increasing the need to chain rows

 

정답 : B, C

-> 오라클메뉴얼 7-27 참조

-> Setting a Higher PCTFREE parameter value

- Reserves more room for future updates

- May require more blocks to store data

- Lowers processing costs because blocks will require reorganization infrequently

- Reduces the need to chain rows

 

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

* 8. Manage Rollback Segments (5) *

* - 롤백 세그먼트 관리 *

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

 

■Overview

- A Rollback Segment is a collection of extents that holds rollback data

for rollback transactions, read-consistency, and database recovery.

 

■Rollback Segments ★★★★★ (6장 데이터베이스 구조관리와 7장 스토리지 할당관리와 연관하여 설명)

- A rollback segment is a portion of the database that records data

before it is modified by transactions, allowing the changes to be rolled back

(undone) under certain circumstances.

- A transaction is a unit of work that causes changes to be made to the database,

or locks to be taken out on rows.

1) Characteristics of Rollback Segments ★★★

① Allow rollback for transaction or to savepoint in the event of operator mistake

② Provide for read consistency

③ Are used during database recovery

④ There is always a rollback segment called SYSTEM in the SYSTEM tablespace

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

2) Properties of Rollback Segments

① Store block information (file, block ID, data)

② Can be assigned a transaction automatically or explicitly

③ Can be forced to shrink by ALTER ROLLBACK SEGMENT <rbs> SHRINK TO <size> command.

④ Automatically shrink to OPTIMAL if extended.

3) Rollback Segment Storage Parameters

- INITIAL, NEXT, MINEXTENTS, MAXEXTENTS, OPTIMAL

주) PCTINCREASE는 사용안함

4) Optimal Parameters

① OPTIMAL specifies the optimal size of rollback segment in bytes.

② Oracle Server de-allocates extents when a rollback segment is larger than OPTIMAL

③ PCTINCREASE cannot be specified for rollback segments and always zero. (주)

④ MINEXTENTS must be at least two

⑤ MAXEXTENTS should never be set to UNLIMITED. (주)

⑥ OPTIMAL은 첫번째 MINEXTENTS 확장영역(extents)의 바이트합보다 커야하며 동일한 것이 이상적이다.

5) Rollback Segment의 종류

1) Private

- 반드시 ROLLBACK_SEGMENTS 파라미터에 기술해야 한다.

2) Public

- 여러 instance가 공유하여 쓸 수 있다.

- OPS환경에서 사용되는 특정 instance에 속하지 않는 rollback segment

- 보통 개인(private) 롤백세그먼트가 선호되나 Oracle paralle server 환경에서만 사용가능

3) Deffered

- SYSTEM tablespace 내에 만들어지며 tablespace가 offline이 될 때

transaction내의 rollback되지 않은 정보를 저장한다.

 

■shrink란?

- transaction이 길거나 큰 경우 rollback segment의 extent가 많아지면 다른 rollback segment가 사용할 수

있도록 extent를 de-allocate해야 한다.

이를 shrink라 하며 V$Rollstat의 shrink값이 1이면 shrink된 것이다.

 

■Create (public) Rollback Segment rollback_segment

Tablespace tablespace

Storage ( )

Optimal

integer(K/M) / null

 

■For rollback segments, the minimum and default value for MINEXTENTS is 2.

 

■Alter Rollback Segment rollback_segment

Online / Offline

Storage

Shrink

To integer (K/M)

 

■rollback segment 를 drop 시키기 위해서는 offline상태여야 한다.

rollback segment 를 monitor하기 위해 V$Rollstat View를 사용한다.

 

■SELECT n.name, round(100 * s.waits/s.gets ) "%Cont"

FROM V$ROLLNAME n, V$ROLLSTAT s

WHERE n.usn = s.usn;

 

- If the value is > 1%, add more rollback segments,

or consider using the SET TRANSACTION USE ROLLBACK SEGMENT command.

 

■Guideline in Determine the OPTIMAL Parameter

- for long running update transactions should have a high OPTIMAL size to avoid excessive allocation

and de-allocation of extents.

- for long-running queries : a large OPTIMAL size to avoid error "snapshot too old".

- for short-running update, queries : a small OPTIMAL size -> increase rollback segment caching

- Monitoring with V$ROLLSTAT

 

문) ROLLBACK SEGMENT 크기가 작은데 어떤 TABLE 의 전체 ROW 를 DELETE 하려고 한다.

어떻게 하면 되는가?

 

정답 : TRUNCATE 를 사용하면 된다.

 

문) rollback segment에 HWM이 실제 data보다 높은 곳에 설정되어 있는 이유?

 

A. rollback segment가 늘다가 줄어서

B. maxextents 수정해서

C. truncate 되어서

 

정답 : A?

 

문) ROLLBACK SEGMENT 가 너무 많이 할당되면 어떻게 되는가?

 

정답 : GROW UP 하다가 SHRUNK된다.

 

문) Rollback segment가 Maxtnets값에 도달할 때?

 

A. 필요하지 않은 공간 할당시

B. 장기 Transaction

C. Optimal 높을 때

D. Optimal 낮을 때

 

정답 :

 

문) ROLLBACK SEGMENTS에서 MAXEXTENTS를 증가시키는 이유?

 

정답 : LONG RUNNING TRANSACTION 처리를 위해서

 

문) ROLLBACK SEGMENTS에서 OPTIMAL이 SET되는 때는? ★★★

 

정답 : ROLLBACK SEGMENT가 CREATION 될 때

 

문) A read-consistent view of database data is ★★★

 

A. When data changes only when being read

B. Handled by rollback segments

C. When users execute the same query consistently

D. Not available in Oracle

 

정답 : B

 

문) rollback segment에서 optimal보다 HWM이 훨씬 크다면? (2 choice) ★★★

 

A. rollback segment allocated extents so much.

B. it will not shrink to the optimal size because of the HWM size.

C. you can use alter rollback command for it.

D. ...

 

정답 : B

 

문) Entries in a rollback segment are bound to a transaction by ★★★

 

A. Number of commits performed

B. Number of rollbacks performed

C. ROWID

D. System change number

 

정답 : D

 

문) Rollback segment shrinks can be avoided if ★★★

 

A. The optimal option is decreased.

B. The DBA manually performs all rollback segment shrinks.

C. Long-running transactions are assigned to larger rollback segments.

D. V$ROLLSTAT is monitored carefully.

 

정답 : C

 

문) How many rollback segments will be required

if the value set for TRANSACTIONS is 300 and

the value set for TRANSACTIONS_PER_ROLLBACK_SEGMENT is 4 ? ★★★

 

A. 25

B. 50

C. 75

D. 100

 

정답 : B (기존에 적힌 답) -> C

-> 정답 C가 맞습니다. 페이지 8-13 참조

 

문) When a rollback segment is created, its availability status is set to online. ★★★

 

A. TRUE

B. FALSE

 

정답 : B

 

문) 변경이 불가능한 storage parameter는? (2가지) ★★

 

정답 : INITIAL, MINEXTENTS

 

문) rollback segment의 주요 목적과 거리가 먼 것은? ★

 

A. transaction에 대한 rollback을 가능하게 한다.

B. 읽기 일관성(read consistency)을 제공한다.

C. database 복구 (recovery)에 사용된다.

D. index 생성시 SORT 하는 공간으로 사용한다.

 

정답 : D

-> D는 TEMPORARY SEGMENT이다.

 

문) 다음 중 rollback segment에만 사용할 수 있는 파라미터는?

 

A. optimal

B. initial

C. pctincrease

D. minextents

 

정답 : A

 

문) rollback segment에 적용할 수 있는 파라미터 중 제한사항을 받지 않는 것은? ★★★★

 

A. optimal

B. initial

C. pctincrease

D. minextents

 

정답 : C

-> C는 무조건 0입니다. 그러므로 C가 정답이겠네요.

A의 경우 auto shrink 되게 하기 위해서 지정해야 하며

보통 minextents보다 많거나 같게 지정하고 initial은 next와 같은 사이즈로 반드시,

minextents는 반드시 2 이상으로 지정해야죠.

 

문) 다음 중 rollback segment의 information을 볼 수 있는 data dictionary 를 고르시오.

 

A. dba_tables

B. dba_objects

C. v$database

D. dba_rollback_segs

 

정답 : D

 

문) rollback segment의 minextent 최소값?

 

정답 : 2개

 

문) Rollback segment에서 OPTIMAL의 정의?

 

정답 : Specifies the optimal size of a rollback segment in bytes

 

문) Examine the following statement and identify any errors. ★

 

A. create rollback segment RBS_01

B. tablespace ROLLBACK_SEGS

C. storage (initial 10M next 10M

D. minextents 5 maxextents 10

E. pctincrease 10

F. freelist groups 2);

G. There are no errors in this statement.

 

정답 : E !!!

-> rollback segment에서 각각의 extent는 모두 동일한 크기를 가져야만 하므로

pctincrease 0 으로 아마 기술도 하지 않을 것입니다.

-> freelist groups는 Parallel Server에서 다른 인스턴스가 사용한 개별적인 프리 리스트의 수를

나타내기 때문에 사용환경에 따라 다름.

OPS.multi-Threaded server,dedicate ,single-task, distributed ,symmetric, 등등

-> 답은 E 입니다.

메뉴얼의 내용을 그대로 옮기면,

"PCTINCREASE는 롤백세그멘트에 지정할 수 없다"

혼동될 수 있는 FREELIST / FREELIST GROUP은

또한 메뉴얼의 내용을 그대로 옮기면,

"FREELIST와 FREELIST GROUPS 파라미터는 테이블스페이스에 대해

기본값(DEFAULT)으로 지정될 수 없다" (주)

 

문) SELECT n.name, round(100*s.waits/s.gets) "%Cont"

FROM v$rollname n, v$rollstat s

WHERE n.usn = s.usn;

 

if the value > 1% 일 때 해결할 수 있는 방법은?

 

A. Increase the optimal size of your existing rollback segments

B. Add more rollback segments

C. Decrease the number of rollback segments

D. Nothing, this value is optimal

 

정답 : B

-> 오라클메뉴얼 8-23

-> Add more rollback segments, or consider using the

SET TRANSACTION USE ROLLBACK SEGMENT command

 

문) Which value is assigned to PCTINCREASE for rollback segments?

 

A. 0

B. 1

C. 2

D. a multiple of the NEXT value

 

정답 : A

-> 오라클메뉴얼 8-11

 

문) select (100*s.wait/s.gets)|| '%' from v$rollstat s

에서 value가 3% 라면 어떤 일을 해야하나?

 

정답 : rollback segment 수를 늘린다.

 

문) 대량의 batch job을 돌려야 할 때 rollback segment를 어떻개 해야 하는가?

 

정답 : rollback segment 크기를 늘린다.

 

문) TRANSACTION에 대한 사용자의 실수를 보전하고,

READ-CONSISTENCY를 보장하며,

DATABASE RECOVERY를 위한 자료를 갖고 있는 곳은 어디인가?

 

A. REDO LOG FILES

B. DATABASE BUFFER CACHE

C. REDO LOG BUFFER

D. ROLLBACK SEGMENTS

 

정답 : D

-> ROLLBACK SEGMENT는 TRANSACTION에 의하여 수정되기 전의 데이터를 기록하는

데이터베이스의 한 영역이다. 이것은 특정환경에서 수정된 자료를 ROLLED BACK하기 위함이다.

따라서 ROLLBACK SEGMENT는 사용자의 실수로 수정되어진 자료를 다시 ROLLED BACK함

으로써 원래자료로 복구할 수 있고, 이전 데이터를 갖고 있음으로 해서 다른

사용자들이 수정된 자료를 읽을 때 READ-CONSISTENCY를 제공하며,

DATABASE RECOVERY시에도 복구를 위하여 이용되어진다

 

문) ROLLBACK SEGMENT에 관한 다음 내용 중 틀린 것을 2개 골라라.

 

A. 확장(EXTEND)되어졌다면 자동적으로 OPTIMAL에 지정된 크기로 SHRINK되어진다

B. 특정 TRANSACTION을 수행할 때 특정 ROLLBACK SEGMENT에 ASSIGN시킬 수 있다

C. PCTINCREASE PARAMETER는 수정할 수 없으며 항상 100으로 고정된다

D. ROLLBACK SEGMENT는 순환적으로 쓰여지므로 모든 ROLLBACK SEGMENT는

그 SIZE가 같아야 한다

E. MAXEXTENTS PARAMETER를 UNLIMITED로 지정하면 DISK의 모든 공간을

다 써 버릴수 있기 때문에 절대 UNLIMITED로 지정해서는 안된다

 

정답 : C, D

-> A. OPTIMAL은 ROLLBACK SEGMENT의 최적크기를 지정하는 것으로

확장된 후에는 이 OPTIMAL의 크기로 SHRINK되어진다.

B. SET TRANSACTION USE ROLLBACK SEGMENT 명령으로 특정

ROLLBACK SEGMENT를 지정할 수 있다.

C. ROLLBACK SEGMENT에서의 PCTINTREASE는 지정할 수 없고

항상 0으로 고정된다.

D. ROLLBACK SEGMENT의 각각의 크기가 모두 같을 필요는 없다.

긴 트랜잭션인 경우에 특정 ROLLBACK SEGMENT만 크기를 크게하여

그 ROLLBACK SEGMENT를 이용하도록 지정할 수 있다.

E. MAXEXTENTS는 절대 UNLIMITED로 지정해서는 안된다

 

문) ROLLBACK SEGMENT에서 MINEXTENTS의 값은 DEFAULT로 얼마인가?

 

A. 0

B. 1

C. 2

D. 4

E. 10

 

정답 : C

-> ROLLBACK SEGMENT는 연속적이고 순환적으로 쓰여져야 하기 때문에

MINEXTENTS의 값이 최소한 2이상 되어야 한다. ROLLBACK

SEGMENT 생성시 또는 DATABASE가 FRAGMENT되어 있거나 특정

테이블의 데이터량 전체를 LOAD할 정도의 큰 ROLLBACK SEGMENT

를 원할 경우에 MINEXTENTS의 값을 2이상으로 증가시킬 수 있다.

※ PCTINCREASE ( = 0 )와 헤갈리지 않도록 주의!!!

 

문) lock을 monitor할 수 있는 utility는?

 

정답 : utlockt.sql

-> 어느 파트소속 문제인지 모름

 

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

* 9. Manage Table and Index Segments (5) *

* - 테이블 세그먼트와 인덱스 세그먼트 관리 *

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

- 6장 데이터베이스 구조관리에서 언급됨. (오라클메뉴얼 6-39)

 

■Table Features

- Holds user data, system data (data dictionary)

- the header block contains free list information and object extent information

- Can be created in parallel, UNRECOVERABLE (CREATE TABLE AS SELECT)

 

■Row Features

- no limit to the number of rows per table

- Rows can span multiple blocks, causing chained rows.

- stored contiguously in a variable length format or fixed length format

for CHAR and DATE columns

- Column length of 0 indicates a null field.

 

■Allocating Table Storage

- Storage Parameters

. Store the whole table in a single extent if possible

. use a high PCTINCREASE value if the table will grow significantly

. 사용하지 않은 공간의 확장영역(extents) 하나를 사용할 수 없으면 적절한

MINEXTENTS 값으로 작은 확장영역(extents)을 많이 생성한다.

- Space Utilization Parameter (7장 스토리지 할당관리에서 언급)

. Use a low PCTFREE if the rows will not be updated much

. Use a low PCTUSED if there will be extensive insert and delete activity

. PCTFREE plus PCTUSED cannot exceed 100%

 

■STORAGE parameter에서 INITIAL, MINEXTENTS는 바꿀수 없다. (주)

 

■새로운 extents를 강제로 할당

SQL>ALTER TABLE s_emp ALLOCATE EXTENT (SIZE 200K DATAFILE '/u02/Oracle/test/user1.dbf');

 

■The size of the NEXT extent to be dynamically allocated,

based on the size of the last extent and PCTINCREASE,

is not changed when an extent is manually added with the ALLOCATE EXTENT option.

 

■인덱스 세그먼트

- 테이블에 인덱스를 생성하면 인덱스 세그먼트는 인덱스 각각에 대해 생성된다.

인덱스 세그먼트는 테이블과 클러스터 데이터 세그먼트로부터 물리적으로 분리된 세그먼트이다.

- 특징

. 테이블이나 클러스터와 서로 독립적

. 각 인덱스는 자체의 storage parameter와 tablespace 지정할 수 있다.

. 병렬 / UNRECOVERABLE 생성 가능

. 최적화를 위해 분리된 tablespace에 저장해야 함

주) 오라클서버에 의해서 자동적으로 사용되거나 유지되는 것은 아님

 

■Bitmap Indexing ★★

- Tables are very large (millions of rows)

- Tables have low-cardinality (분포도 적은것)

- Queries have bitmap indexes on all columns that commonly appear in WHERE clauses.

- Queries have individual WHERE conditions that are satisfied by thousands of rows.

 

주) Bitmap Indexing은 release 7.3.3이상에서 사용가능, OLTP성 업무에는 사용하지 말것.

 

■When To Use Bitmap Indexing

- Queries involving

. Low-cardinality columns

. A combination of multiple WHERE conditions

. Each predicate involves a large number of rows.

- An alternative to concatenated indexes providing

. more efficient use of storage

. no dependency on column ordering

- If there is read-only or low-update activity

. Bitmapped indexes are expensive to update

 

■The absolute maximum number of columns in a comosite key index is 16.

 

■Creating Indexes Guideline

- Create table first, then create the index on the table. (주)

- If column values are stored in ascending, specify NOSORT option.

- When sorting, uses temporary segments and the sort space specified in SORT_AREA_SIZE

initialization parameter.

- Indexes can be created UNRECOVERABLE, so that no rollback or no redo log is generated.

- 테이블이 주로 읽기 전용이면 인덱스 사용이 더 효과적

 

주) Index Storage Parameter에서 PCTUSED는 사용 불가.

 

■인덱스 관리

- 높은 INTRANS 값

. 충분한 공간 보장 -> 오버헤드 감소

- 높은 MAXTRANS 값

. 트랜잭션 공간을 위한 자유공간을 확보하려는 대기시간 줄어듬

주) Change to INITRANS apply to subsquent blocks only. (ALTER INDEX)

Change to MAXTRANS apply to all blocks.

 

문) INDEX 를 ANALYZE .... VALIDATE STRUCTURE; 명령으로 ANALYZE하면 결과는 어디에?

 

정답 : INDEX_STATS

-> 오라클메뉴얼 9-61

 

문) UNRECOVERABLE로 테이블을 생성하는 것은 무슨 뜻인가?

 

정답 : REDO LOG BUFFER 와의 I/O 가 발생하지 않음

-> 오라클메뉴얼 9-13

-> 테이블 생성이 redo log에 기록되지 않음

 

문) BLOCK에 대해 INITRANS의 값이 작을 경우 트랜잭션이 많아지면 어떻게 되는가?

 

정답 : FREE SPACE를 찾기 위해 BLOCK을 검색을 해야 하므로 TRANSACTION이 느려진다.

 

문) You create table without storage parameter.

what parameter will be used? ★★★

 

A. database parameter if it has a storage parameter.

B. object storage default parameter.

C. system tablespace storage parameter.

D. tablespace storage parameter what is in that object schema.

 

정답 : D

-> DBA가 답함

 

문) In which parameter would a higher value reduce the wait time

for free transaction space?

 

A. INITRANS

B. NEXT

C. PCTUSED

D. MAXEXTENTS

 

정답 : A (내용적으로는 MAXTRANS인 것 같은데)

-> 오라클메뉴얼 9-55

-> If many users are going to issue statements that will ultimately use the index,

a higher INITRANS will ensure enough space for their transaction entries, and

eliminate the overhead of creating new transaction entry space.

Also, a higher MAXTRANS will help ensure that no user has to wait for transaction

space to become free

 

문) When a CREATE TABLE command is issued with no storage options specified,

what storage options are used to create it? ★★★

 

A. The default options specified for the user in the tablespace.

B. The default options specified for the table in the tablespace.

C. The default options specified for the user in the database.

D. The default options specified for the table in the database.

 

정답 : B

 

문) If your tables will be growing significantly,

which STORAGE parameter could you increase to reduce the maintenance

of the table as it grows?

 

A. INITIAL

B. FREELIST

C. MAXEXTENTS

D. MINEXTENTS

E. PCTINCREASE

 

정답 : E

-> 오라클메뉴얼 9-11

-> PCTINCREASE is the rate of growth of each subsequent extent.

테이블이 상당히 커질 것이라면 PCTINCREASE 값을 크게 지정한다.

 

문) Index segment의 특징으로 맞는 것 3가지를 고르시오. ★★

 

A. Can be created UNRECOVERABLE

B. Typically smaller than the indexed table

C. Automatically used and maintained by the Oracle Server

D. Can be stored in separate tablespace

 

정답 : A, B, D

-> 오라클메뉴얼 9-27

 

문) 다음 중 STORAGE 구에 명시할 수 없는 것을 모두 골라라.

 

A. PCTFREE

B. INITIAL

C. NEXT

D. PCTUSED

E. PCTINCREASE

F. MINEXTENTS

 

정답 : A, D

-> STORAGE 구에 명시되는 것은 INITIAL, NEXT, PCTINCREASE,

MINEXTENTS, MAXEXTENTS등이다. SPACE 사용에 관한 PARAMETER

인 PCTFREE, PCTUSED등은 STORAGE 구의 부분이 아니다.

 

문) bitmap index에 관한 내용이 아닌것

 

A. table이 큰 경우

B. cardinality가 낮은 column

C. data warehouse에 적합하다

D. lead column에 제약이 있다.

 

정답 : D

 

문) 다음 중 BITMAP INDEXING을 이용하지 않아야 하는 경우는 어느 것인가?

 

A. 테이블이 매우 클 경우

B. 테이블이 LOW-CARDINALITY (분포도가 적음)를 가질 경우

C. INSERT, UPDATE활동이 잦은경우

D. STORAGE를 더 효과적으로 이용하고자 할 경우

 

정답 : C

-> BITMAP INDEXING은 QUERY를 효과적으로 하고, 기억장소를 효과적

으로 활용하고자 할 경우 이용된다. UPDATE시에는 그 비용이 비싸므로

주로 READ-ONLY 이거나 LOW-UPDATE 활동이 있을 경우 활용되어야 한다.

또한 QUERY가 낮은 분포도를 가진 COLUMN을 포함하거나, 여러개의

WHERE절의 조건을 가질경우, 또는 ROW의 개수가 매우 많을

경우에 효과적이다.

 

문) INDEX를 생성하는 내용 중 맞지 않는 것은 어느것인가?

 

A. TABLE의 내용이 이미 SORT되어 있다면 NOSORT 키워드를 이용하여 SORT를 생략할 수 있다

B. PARALLEL 키워드를 이용하여 병렬로 INDEX를 생성할 수 있다

C. UNRECOVERABLE 키워드를 이용하여 INDEX의 생성작업을 REDO LOG에 기록하지 않을 수 있다

D. INDEX 생성시 PCTUSED와 PCTFREE는 지정할 수 없다

 

정답 : D

-> INDEX 생성시 PCTUSED는 지정할 수 없으나 PCTFREE는 추가적인

INDEX 엔트리를 위한 공간을 확보해 두기 위하여 지정할 수 있다.

 

문) 많은 사용자가 INDEX를 이용하는 SQL문장을 사용함으로 인하여 INDEX에 대한

MAXTRANS값의 TRANSACTION ENTRY SPACE를 모두 이용 중이라면 어떤 현상이 일어나는가?

 

A. ORACLE SERVER는 ERROR MESSAGE를 반환하고 해당 SQL문장은 실행되지 않는다

B. 사용자는 TRANSACTION ENTRY SPACE가 FREE로 될 때까지 기다려야 한다

C. 새로운 TRANSACTION ENTRY SPACE를 추가로 할당받아 이용한다

D. ORACLE INSTANCE가 DOWN된다

 

정답 : B

-> INDEX에 대한 TRANSACTION ENTRY SPACE를 모두 사용했다면

TRANSACTION ENTRY SPACE가 FREE가 될 때까지 기다려야 한다.

따라서 사용자가 TRANSACTION ENTRY SPACE가 FREE가 될 때까지

기다리는 것을 방지하기 위해서는 충분한 MAXTRANS를 주어야 한다.

또한 새로운 TRANSACTION ENTRY SPACE를 생성하는 OVERHEAD

를 피하기 위해서는 충분한 INITRANS를 주어야 한다.

 

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

* 10. Manage Cluster Segments (2) *

* - 클러스터 세그먼트 관리 *

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

 

■Index Clusters

1) The tables in a cluster

- Have columns in common

- Are often used together

- Are stored in the same data blokcs

2) Advantage of Using Clusters

- Reduced disk I/O, because related rows are stored together in the same data blocks

- Improved access times for joins of clustered tables

- Reduces the amount of space needed for indexes

- The maximunm number of columns in a cluster key is 16.

- While clusters can increase query performance, they can reduce the performance of

inserts, updates, deletes, and full table scans.

 

■Managing Clusters

1) Cluster Table Candidates ★★★

- Primarily queried, and not frequently updated

- Contain redundant values within a column 한 열에 중복된 값이 많이 오는 테이블

- Often joined tables

2) Cluster Key

- Good Choice

. Containing a wide range of value 넓은 범위의 값을 갖고 있는 열

. Used in joins of multiple tables 복수개의 테이블 조인시 사용되는 열

- Bad Choice

. With few distinct values 구분값이 적은 열

. Frequently updated 빈번하게 갱신이 일어나는 열

- The cluster key cannot include a LONG or LONG RAW column.

 

■The cluster index differs from a table index in that 클러스터 인덱스가 테이블 인덱스와 다른 점

- NULL값을 갖는데도 클러스터 인덱스상에서 엔트리를 갖음

- Clustered data cannot be accessed without a cluster index ★

클러스터화된 데이터는 클러스터 인덱스 없이는 액세스 불가능

- The index must be created before data insertion. ★ 인덱스는 데이터 삽입전에 만들어져야 함

- Only one entry per index key 인덱스키당 오직 하나의 엔트리가 만들어짐

주) 클러스터 인덱스는 유일(Unique)할 수 없으며 LONG 이나 LONG RAW로 정의된 열을 포함할 수 없다.

 

■The SIZE parameter determines the maximum number of cluster keys that can be stored in a data

block.

 

■CREATE CLUSTER --> CREATE INDEX --> CREATE TABLE

 

■New values for the PCTFREE, PCTUSED, or SIZE parameters apply to all cluster

data_bolcks (including currently allocated blocks, and subsequently allocated blocks).

주) The storage parameters INITIAL and MINEXTENTS cannot be altered. ★★★

-> 앞장 Table storage parameter와 동일함

■Changes to INITRANS affect only subsequently added data blocks, ★★

Changes to MAXTRANS affect all data blocks. ★★

주) INITRANS와 MAXTRANS의 차이. Index segment와 동일함.

 

■You may want to drop a cluster index to change the storage parameters,

or locations of the cluster index.

However, you must re-create the cluster's index to access the data in the clustered tables.

 

■Advantages and Disadvantages of Index Clusters

- Provide faster access to multiple records with the same cluster key value

- Selects, updates and deletes are faster (주)

- Loading of tables is significantly slower (주)

- Not possible to load clustered tables without indexes (주)

(and the cluster index has to be updated for every new cluster key value).

새로운 클러스터 키값이 발생시마다 클러스터 인덱스는 갱신되어야 한다.

- Blocks potentially cannot stay in the SGA and have to be read several times

- 레코드를 어느 블록에 삽입해야할지 결정하기 위해 모든 레코드의 클러스터 인덱스를 읽어야 한다.

- Index clusters potentially save index space

인덱스 클러스터는 잠재적으로 인덱스공간을 절약한다.

- Direct loading is not possible (in SQL*LOADER)

 

■Hashing

- 데이터검색시 성능을 향상시키기 위하여 테이블 데이터를 저장하는 선택적인 방법

 

■Use Hashing when

- Tables generally do not vary in size 크기가 변화지 않는다.

- Optimizing query performance is a primary concern

- Queries are equality queries on the hashed columns. 동등질의

- The hash key is well distributed

주) To hash a table it must be clustered first.

A hash cluster must exist before creating a table to use the hashing algorithm.

 

■Hash Function

1) Can be applied to one column or a composite key.

2) Should provide the maximum distribution of rows among the hash values.

해쉬값으로 행들을 최대한 분산시킬 수 있어야 함

3) Attempts to minimize the number of undesired collisions.

충돌횟수를 최소화시키도록 시도해야 함

4) Can be user-defined. 사용자정의가 가능 (주)

 

■SIZE, HASHKEYS, and HASH IS parameters cannot be altered with the ALTER CLUSTER statement.

 

주) 해쉬클러스터 변경시 PCTUSED, PCTFREE, INITRANS는 새로운 블록에 대해서만 값을 명시

 

■To alter SIZE, HASHKEYS, HASH IS,

you must re-create the cluster and copy the data from the original cluster.

SIZE cannot be changed for a hash cluster.

 

■Advantage or Disadvantages of Hash Clusters ★★

- Hash clusters provide very fast access to a single record

주) 인덱스 클러스터와 동일하나 single 레코드라는 점에서 주의할 것.

- Loading tables is slightly slower -> 인덱스 클러스터와 동일

- Hash clusters can only be used for equality searches (column=constant) 동등검색에만 사용가능

- Direct table loading is not possible. -> 인덱스 클러스터와 동일

- 검색, 수정 및 삭제시 더 빠르다. (주)

- 단일 삽입은 보통 테이블보다 더 느리지 않다. (주)

- 블록들은 SGA에 머무를 수 없으며 따라서 여러번 읽어와야 한다.

- 저장공간이 초기에 미리 할당되므로 시간이 지남에 따라 레코드수가 너무 많이 증가되지 않아야만

해쉬클러스터가 효율이 좋다. (주)

- 해쉬함수가 적절히 분산되어 있지 않으면 잠재적인 오버플로우의 위험 존재함.

- 잠재적으로 인덱스공간을 절약함

- 같은 클러스터키값을 가진 레코드의 건수 및 크기가 일정치 않은 경우 보통 테이블보다 더 많은

공간이 필요할 가능성 있음.

 

문) clustering을 해야 하는 경우

 

정답 : 아래와 동일

 

문) CLUSTER를 하였을 경우 잇점은?

 

정답 : 1) 디스크의 I/O 를 줄인다.

2) 조인하기위한 엑세스 시간을 줄인다.

3) 인덱스에 필요한 공간을 줄인다.

 

문) Hash functions ★★★

 

A. Are defined by Oracle only

B. Are defined by the user only

C. Can be defined by both Oracle and the user

D. None of the above

 

정답 : B ? -> 답은 C로 되어있음.

-> 오라클메뉴얼 10-37

-> Can be user-defined

 

문) 다수의 table이 같은 block에 있다. 그리고 같은 index를 참조했다.

이런식으로 data가 존재하는 곳에 설정하기에 적합한 object는?

(문제는 정확하지 않지만 이와 비슷하다고 함) ★★

 

A. hash cluster

B. index cluster

C. segment cluster

D. extent cluster

 

정답: B

 

문) cluster 변경시 추가되는 data block에만 영향을 미치는 parameter는?

 

정답 : INITRANS

-> 오라클메뉴얼 10-27

-> Changes to INITRANS affect only subsequenly added data blocks.

Changes to MAXTRANS affect all data blocks.

 

문) hash cluster에서 hashkey = 40 일 때 몇 개의 hash key가 생성되는가?

 

정답 : 41개 (40이상의 최소의 솟수)

 

문) Which type of table may be a good candidate for clustering?

 

A. frequently updated

B. often joined

C. many unique values within a column

D. no common columns with other table

 

정답 : B

-> 오라클메뉴얼 10-9

 

문) A change in which clusters parameter will only apply to new blocks?

 

A. PCTFREE

B. SIZE

C. INITRANS

D. MAXTRANS

 

정답 : C

-> 오라클메뉴얼 10-27

 

문) Clustering tables is appropriate when

 

A. The tables in the cluster are frequently joined

B. The tables in the cluster are frequently updated

C. The tables in the cluster have fewer than 60 rows

D. The tables in the cluster have no primary key

 

정답 : A

-> 오라클메뉴얼 10-9

 

문) index cluster에 대한 설명이 아닌 것은? ★

 

A. index를 생성해야 data access가 가능하다.

B. 자주 join이 일어나는 table로 구성한다.

C. 공통 column을 갖는 table로 구성한다.

D. SIZE parameter는 block 크기를 결정한다.

 

정답 : D

-> SIZE parameter determines the maximum number of cluster keys

that can be stored in a data block.

 

문) CLUSTER를 ALTERING할 때 추가되는 DATA BLOCK에만 영향을 미치는 PARAMETER는 무엇인가?

 

A. INITRANS

B. MAXTRANS

C. PCTFREE

D. SIZE

E. INITIAL

F. MINEXTENTS

 

정답 : A

-> CLUSTER를 ALTERING할 때 PCTFREE, PCTUSED, SIZE, MAXTRANS 등은

모든 CLUSTER DATA BLOCK에 영향을 미치고,

INITRANS는 추가되는 DATA BLOCK에만 영향을 미친다.

INITIAL과 MINEXTENTS는 ALTERING될 수 없다.

 

문) TABLESPACE가 TS_USERS인 곳에서 JOB이라는 COLUMN을 이용하여 EMP_CLU라는 이름으로

HASH CLUSTER를 만들려고 한다.

50개정도의 HASH VALUE가 존재하고, 같은 HASH VALUE를 가지는 ROW를 저장하기 위해서는

약 400 BYTE가 필요하다고 할 때 처음 CLUSTER를 생성했을 때 CLUSTER가 가지게 되는

BLOCK수는 얼마인가? ★★★

(BLOCK SIZE가 2K 이고 한 BLOCK에서 사용가능한 DATA SPACE가 약 1800 BYTE가 된다고 가정한다)

 

A. 7

B. 9

C. 11

D. 13

 

정답 : D

-> 우선 각 BLOCK에 들어가는 HASH KEY의 수를 살펴보면

1800 (BLOCK당 사용가능한 BYTE수)/400(SIZE) = 4가 된다.

그리고 HASH KEYS는 51이 된다.

따라서 각 BLOCK당 4개의 HASH KEY가 들어가게 되고 필요한

HASH KEYS의 수는 51이 되므로 초기에 필요한 BLOCK의

수는 51/4 = 13이 된다.

 

문) SIZE와 HASHKEYS, INITIAL의 값을 주고 맞는 문장을 선택?

 

정답 : SIZE가 하나의 키에 대한 데이터의 크기임을 알아야 쉽게 풀수 있음

 

문) Hash Cluster를 만들 때, 올바른 명령어 형식은? (Size 100, Hashkey 50)?

 

A. CREATE CLUSTER cluster

SIZE 100

TABLESPACE tablespace

STORAGE storage_clause

HASHKEYS 50;

B. ....

 

정답 : A

-> 100M, 50M가 아님을 주의

 

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

* 11. Manage Constraints (3) *

* - 제약조건 관리 *

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

 

■Types of Integrity Constraints - 5개

1) NOT NULL

2) UNIQUE

3) CHECK

4) PRIMARY KEY

5) FOREIGN KEY

 

■Complex business rules can be enforced using datbase triggers. 복잡한 비즈니스 규칙

 

■Constraints can be defined

either as INLINE (Column Constraints) or as OUT-OF-LINE (Table Constraints).

 

■Not Null is converted to CHECK (column_name IS NOT NULL).

 

■Check Constraints cannot (but triggers can)

- Include a subquery

- Reference the pseudocolumns CURRVAL or NEXTVAL.

- Include the SYSDATE, UID, USER, or USERENV SQL function, because they vary over time.

 

■Primary Key Constraints

- unique

- rarely changed

- not null

- numeric

 

■Foreign Key Constraints

- Ensure that values in key columns exist

in a previously defined unique or primary key of another or same table

- Can have any number of foreign keys

- Can reference a primary key or unique constraint in the same table

- Cannot reference a remote table (다른 머신)

 

■Referencing Table (Detail Table), Referenced Table (Master Table), Self-Referential Constraint

 

■When inserting the first row of a table with a self-referencing foreign key (FK) constraint ★

- Insert the row with a NULL in the FK column

- Add or enable constraints after inserting the data

- Create the first few rows with a single INSERT statement

 

■The DELETE CASCADE option

- Automatically deletes the foreign key rows referencing a deleted master row

- Is specified when defining a foreign key constraint

 

■DBA_CONSTRAINTS to display the constraint information for the all tables system created.

 

■DBA_CONS_COLUMNS to display all columns on which constraints are defined.

 

■ALTER TABLE ... ENABLE .........EXCEPTIONS INTO ...

- identifies an existing exception table into which information about rows

that violate an enabled integrity constraint are placed.

 

■SQL>select rowid, id, dept_id from s_emp where rowid in (select row_id from exceptions);

- Delete or truncate old exceptions tables before enabling constraints.

 

문) EXCEPTION TABLE에 저장되는 것은?

 

A. ROW ID

B. SCN #

C. TABLESPACE NAME

D. BLOCK ID

 

정답 : A

-> 오라클메뉴얼 11-61

 

문) ordinality 가 0, N 인 두 테이블간의 외부키 관계가 나타내는 바는?

 

A. 관계가 필수적이며 일대 다수이다.

B. 관계가 옵션이며 일대 다수이다.

C. 관계가 필수적이며 일대일이다.

D. 관계가 옵션이며 일대일이다.

 

정답 : B

 

문) When revoking the REFERENCES privilege,

the DBA must use which option to ensure success? ★

 

A. with admin option

B. with grant option

C. cascade constraints

D. trailing nullcols

 

정답 : C

 

문) Which of the following statements are not true about primary keys? ★★★

 

A. A primary key cannot be NULL.

B. Each column value in a primary key must be unique.

C. Each column value in a primary key corresponds to a primary-key value in another table.

D. A primary key identifies the uniqueness of that row in the table.

E. An associated index is created with a primary key.

 

정답 : C

-> B는 unique key이므로 답은 C임

 

문) 다음 중 data 무결성을 유지하기 위한 방법이 아닌 것은?

 

A. primary key를 생성한다.

B. database trigger를 이용한다.

C. procedure나 function을 작성한다.

D. database link를 생성한다.

 

정답 : D

-> B. 데이터무결성을 지키기 위해서 트리거를 사용하는 경우도 있다. (오라클메뉴얼 11-9)

 

문) Which of the following constraints has an index associated with it? (Choose two.)

 

A. PRIMARY KEY

B. FOREIGN KEY

C. UNIQUE

D. NOT NULL

E. CHECK

 

정답 : A, C

 

문) Foreign Key 관련으로 error가 났다. 이것에 대한 내용을 보려면 어떤 것을 보아야 하는가? ★

 

A. DBA_CONSTRAINTS

B. USER_CONSTRAINTS

C. USER_CONSTRAINTS와 USER_CONS_COLUMNS의 JOIN

 

정답 : C

-> C번입니다.

USER_CONSTRAINTS는 그 유저스키마에 포함된 모든 오브젝트에 관한 constraints가 나열되고

USER_CONS_COLUMNS는 어떤 컬럼에 어떤 constraints가 연관되어 있는가에 대한 정보가 들어있습니다.

-> 액세스 가능한 테이블이냐, 어떤 한 유저 테이블이냐, 아니면 DB상의 모든 테이블이냐에 따라서 다르다.

액세스가능한 모든 테이블에 관한 제약조건은 ALL_CONSTRAINS,

한 유저에 대한 제약조건은 USER_CONSTRAINS,

모든 테이블의 제약조건은 DBA_CONSTRAINTS이다.

하지만 DBA_CONSTRAINTS는 DBA 권한을 가진 사용자만 볼 수 있다.

 

문) All data integrity needs are handled by using declarative integrity constraints. ★★★

 

A. TRUE

B. FALSE

 

정답 : A -> 답은 B로 되어있던데...-> B가 맞기도 하다. (체크가 빠져있으므로)

-> 데이터 무결성은 DB상의 데이터가 미리 정의한 일련의 제약조건 및 비즈니스 규칙을 준수하도록

오라클을 보장해 주기 때문이다. 오라클메뉴얼 11-7 참조.

 

문) The POSITION column in DBA_CONS_COLUMNS ★★★

 

A. Indicates the position of the constraint on disk

B. Relates to the hierarchical position of the table in the data model

C. Improves the scalability of the Oracle database

D. Identifies the position of the column in a composite index

 

정답 : D

 

문) 테이블을 DROP시 DROP되어지는 테이블의 PRIMARY 또는 UNIQUE KEY를 참조하는

REFERENTIAL INTEGRITY CONSTRAINT가 있을 경우 어떻게 하여야 하는가?

 

A. 관련되는 REFERENTIAL INTEGRITY CONSTRAINT를 먼저 DROP한 뒤 테이블을 DROP하여야 한다

B. DROP TABLE table_name 명령으로 그 테이블에 관련된 REFERENTIAL INTEGRITY CONSTRAINT는

모두 자동으로 DROP된다

C. CASCADE CONSTRAINTS 명령을 이용하여 관련된 REFERENTIAL INTEGRITY CONSTRAINT를

모두 DROP한다

D. DROP TABLE table_name 명령으로는 REFERENTIAL INTEGRITY CONSTRAINT를 DROP할 수 없다

 

정답 : C

-> 테이블을 DROP시 REFERENTIAL INTEGRITY CONSTRAINT가 있을 경우에는

CASCADE CONSTRAINTS OPTION을 추가하여 관련된 모든

REFERENTIAL INTEGRITY CONSTRAINT가 같이 DROP되도록 하여야 한다.

만일 이 옵션을 생략할 경우에는 ORACLE SERVER는 ERROR MESSAGE를 반환하고

테이블을 DROP하지 않는다.

 

문) Which command could you use to create a table with a foreign key

before creating the table containing the referenced key?

 

A. CREATE TABLE

B. CREATE SCHEMA

C. ALTER TABLE

D. NONE

 

정답 : B

-> 오라클메뉴얼 11-31

 

문) Which constraint is not recorded as a constraint in the data dictionary?

 

A. NULL

B. UNIQUE

C. PRIMARY KEY

D. CHECK

 

정답 : A

-> 오라클메뉴얼 11-21

 

문) primary key constraint 설명 중 틀린 것?

 

A. PK column의 값은 유일하다.

B. null 값을 허용한다.

C. index를 자동으로 생성해준다.

 

정답 : B

 

문) SELF-REFERENCING FOREIGN KEY를 갖는 Table에 row를 insert하는 방법이 아닌 것은?

 

A. FK column에 NULL 값을 갖는 행을 Insert한다.

B. data insert 후에 enable한다.

C. data insert 후에 enable하는 방법밖에 없다.

D. 단일 insert 문장을 사용하여 처음 몇 개의 항을 insert한다.

 

정답 : C

 

문) SELF-REFERENCING CONSTRAINT는 어떤 경우에 이용되는가?

 

A. FOREIGN KEY가 같은 테이블의 UNIQUE 또는 PRIMARY KEY를 참조할 때

B. FOREIGN KEY가 같은 테이블의 같은 FOREIGN KEY COLUMN을 참조할 때

C. FOREIGN KEY가 같은 테이블의 어떤 COLUMN이든지 참조할 필요가 있을 경우

D. FOREIGN KEY가 다른 테이블의 KEY COLUMN을 참조할 때

 

정답 : A

-> SELF-REFERENCING CONSTRAINT는 FOREIGN KEY가 같은 테이블의

UNIQUE 또는 PRIMARY KEY를 참조할 때 사용하게 된다.

예를 들어 사원번호와 해당사원의 매니저번호을 동시에 갖는 테이블에 필요할 때

매니저번호는 사원번호에 대해 SELF-REFERENCING CONSTRAINT를 설정하게 된다.

FOREIGN KEY CONSTRAINT는 반드시 UNIQUE 또는 PRIMARY KEY에 대해서만 참조가 가능한 것도

알아두어야 할 것이다.

 

문) PRIMARY KEY-FOREIGN KEY ...ERROR가 나고 있는데 어떻게 조회해야 하는가?

 

정답 : DBA_CONSTRAINTS 와 DBA_CONS_COLUMNS를 JOIN하여 조회한다.

 

문) 모든 테이블에 대한 CONSTRAINT의 NAME과 TYPE, STATUS를 모두 볼 수 있는 VIEW는 어느 것인가? ★★★

 

A. ALL_OBJECTS

B. DBA_CONSTRAINTS

C. DBA_CONS_COLUMNS

D. ALL_CONSTRAINTS

 

정답 : B

-> 설명이 부족하지 않나요? 유저인지 DBA인지...

-> 정답은 B입니다. 그리고 설명은 충분합니다. 왜냐하면 문제에

"모든" 이라는 말이 나오면 DBA_ 이고

"유저의" 란 말이 나오면 USER_ ,

"엑세스 할 수 있는" 은 ALL_ 이라는 접두사가 붙게 됩니다.

-> DBA_CONS_COLUMNS는 제약 조건 정의에서 모든 열(column)에 관한 정보이기 때문에

제약조건의 이름, type, status 등을 질의하기 위해서는 DBA_CONSTRAINTS는 질의함.

-> 오라클메뉴얼 11-65 참조

-> 먼저, USER_/ALL_/DBA_ 라는 Naming Convention을 아셔야 합니다.

1. USER_ : 해당 USER가 OWNER인 것만 보여줌.

2. ALL_ : 해당 USER가 OWNER가 아니어도 ACCESS할 수 있는 모든 OBJECT

를 보여줌. (즉, 자기소유 OBJECT + ACCESS 가능 OBJECT)

3. DBA_ : 모든 OBJECT 를 보여줌.

당연히 B,C 둘중의 하나이고, constraints의 type, status를 보여주는것은

"B"입니다.

 

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

* 12. Manage Users (4) *

* - 사용자 관리 *

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

 

■When a database user is creatd, a corresonding schema of the same name is created for that user.

 

■System resource limits (CPU, I/O, session, connect/idle time,Mem) is specified through profiles.

 

■SYSTEM is not the temporary or default tablespace for any user.

 

■DROP USER ... CASCADE

- drops all objects in the user's schema before dropping the user.

 

■A user that is currently connected to a database cannot be dropped.

 

■Helpful Data Dictionay Views for Monitoring Users

- ALL_USERS, DBA_USERS, USER_USERS, DBA_TS_QUOTAS, USER_TS_QUOTAS

 

■Killing a User Session

- ALTER SYSTEM KILL SESSION 'SESSION ID, SERIAL NUMBER'

 

■V$SESSION view to identify the session ID index and serial number of user session.

 

문) quotas을 지정하는 이유?

 

A. 동시 트랜잭션 수

B. 최대 트랜잭션 수

...

 

문) 현재 ACTIVE한 SESSION을 가진 USER를 DROP USER XXXX로 DROP 하면?

 

정답 : DROP 되지 않는다.

 

문) SYSTEM ID로 CONNECT 을 한 후 다른 SYSTEM_ID에 대해 SESSION KILL 명령을

수행하면 어떻게 되는가?

 

정답 : 해당 USER의 SESSION이 DISCONNECT된다.

 

문) CREATE USER를 수행한 후에 그 특성을 확인할 수 있는 data dictionary는? ★★★

 

A. DBA_USERS, DBA_TS_QUOTAS

B. DBA_USERS, DBA_TS_PRIVS

C. DBA_USERS, DBA_YS_PRIVS

D. DBA_USERS, DBA_SYS_PRIVS

 

정답 : A가 아닐까???

 

문) svrmgr에서 한 유저가 다음과 같이 유저를 생성했다면 옳은 것은? ★★★

svrmgr>create user lee identified by lee;

 

A. Lee has a SYSTEM as a tablespace.

B. He will use SYSTEM rollback segments.

C. He connect in user tablespace.

D. He cannot do anything.

 

정답 : A라고 하는데...모르겠음

-> 영어는 정말 짜증납니다. default tablespace가 system으로 잡힌다는 말이군요.

A가 정답입니다.

 

문) 시스템 유저로 svrmgr을 이용하여 다음과 같이 새로운 유저를 생성했을때

Lynn이 할 수 있는것은? ★★★

 

create user lynn identified by lynn

tablespace users

quota 10M on users;

connect lynn/lynn

 

A. Lynn can connect db and can create object;

B. Lynn can create object in users tablespace.

C. Lynn cannot connect db.

D. Lynn can connect db and access SYSTEM tablespace

 

정답 : C

-> connect db : connect role

create object : resource role

정답은 C (사실 저는 connect는 생기는 줄 알고 있었거든요. 책에서 본 기억이 있어서.

근데 직접 두들겨 보니까 아니네요)

 

문) SYS userid 에 대한 디폴트 패스워드는? ★★★

 

A. CHANGE_ON_INSTALL

B. NO_PASSWORD

C. MANAGER

D. ORACLE

E. NULL

 

정답 : A

-> 책에서 못 찾음

 

문) 패스워드 파일을 관리하는데 사용되는 패스워드를 변경하면

다음 어떤 것에 대한 패스워드가 변경 되는가? ★★★

 

A. SYSTEM

B. RPT_BATCH

C. CONNECT

D. internal

E. audit

 

정답 : D

-> 책에서 못 찾음

 

문) The database will not continue to allow users to access the database when ★★

 

A. The database is up and running

B. The AUD$ table has been filled and session is being audited.

C. Restricted session has been disabled.

D. Operating system authentication is being used.

 

정답 : B

 

문) Which of the following views contain data necessary to kill a user session? ★★

 

A. V$SYSSTAT

B. V$ROLLSTAT

C. V$QUEUE

D. V$SESSION

 

정답 : D

 

문) system 유저로 접속을 했을 때 다른 system 유저의 session을 kill session으로

죽일 수 있는가? ★★★

 

A. sys user는 가능

B. system user로는 다른 권한없이 가능

 

정답 :

 

문) A user can change which of the following parameters

with an ALTER USER statement? ★★

 

A. identified by

B. default tablespace

C. temporary tablespace

D. quota on

E. profile

F. default role

 

정답 : A

-> 오라클메뉴얼 12-19

-> 사용자들은 그들 자신의 암호를 변경할 수 있음.

 

문) 다음 중 user 생성시 지정할 수 없는 것은? ★★★

 

A. tablespace

B. tablespace 사용한계

C. system resource 사용한계를 지정한 profile

D. user의 [default] role

 

정답 : D

-> 오라클메뉴얼 12-9

 

문) User 관리하는 Dictionary는?

 

정답 : DBA_USERS, DBA_TS_QUOTAS

 

문) USER생성시 DATABASE AUTHENTICATION을 위하여 지정가능한 것이 아닌 것은?

 

A. DEFAULT TABLESPACE

B. TEMPORARY TABLESPACE

C. ROLLBACK TABLESPACE

D. TABLESPACE QUOTA

 

정답 : C

-> 오라클메뉴얼 12-9

-> USER 생성시 지정할 수 있는 AUTHENTICATION SPECIFICATION으로

DEFAULT TABLESPACE, TEMPORARY TABLESPACE, 각 TABLESPACE에 대한 TABLESPACE QUOTA,

그리고 PROFILE을 이용하여 SYSTEM RESOURCE LIMITS등이 있다.

ROLLBACK SEGMENT는 순환적으로 이용되므로 USER생성시 특정 ROLLBACK SEGMENT를 지정할 수

없고 대신 특정 TRANSACTION을 실행시는 SET TRANSACTION USER ROLLBACK SEGMENT xxx명령을

이용하여 특정 ROLLBACK SEGMENT를 지정할 수 있다.

 

문) create user jang identified by externally 의 의미는?

 

정답 : OS에 의해 인증된 user jang을 생성. 달리말하면 운영체제를 통하여 사용자 액세스 확인

 

문) USER 생성시 IDENTIFIED EXTERNALLY는 어떤 경우에 이용하는가?

 

A. PASSWORD FILE을 이용하여 USER ACCESS를 인정

B. 다른 시스템으로부터의 접근을 가능하게 함

C. OS를 통하여 USER ACCESS를 인정

D. PASSWORD없이 DATABASE 접근가능

 

정답 : C

-> 오라클메뉴얼 12-13

-> USER 생성시 IDENTIFIED EXTERNALLY구는 OS로부터 USER ACCESS를 인정받아

이용가능토록 하는 것이다.

 

문) USER와 SCHEMA에 관한 설명으로 맞는 것은?

 

A. USER를 생성한 후 다른이름으로 별도의 SCHEMA를 생성하여야 한다

B. USER를 생성한 후 같은이름으로 별도의 SCHEMA를 생성하여야 한다

C. USER를 생성하면 같은이름의 SCHEMA가 자동적으로 생성된다

D. USER를 생성한 후 INSTANCE를 다시 시작될 때 같은이름의 SCHEMA가 자동적으로 생성된다

 

정답 : C

-> USER가 생성되어질때 같은이름의 대응되는SCHEMA가 해당 USER를 위하여

자동적으로 생성되어진다.

 

문) DEFAULT TABLESPACE에 OBJECT를 생성하여 이용 중인 USER에 대하여

해당 DEFAULT TABLESPACE의 QUOTA를 0으로 ALTERING하였을 때 어떤 결과가 나타나는가?

 

A. 해당 USER는 DROP된다

B. 해당 USER가 DROP되지는 않지만 관련되는 모든 OBJECT는 삭제된다

C. USER가 OBJECT를 생성하여 이용중일때는 QUOTA를 O으로 ALTERING 할 수 없다

D. 해당 USER의 OBJECT는 그대로 남아있게 되지만 향후 새로운 SPACE를 할당받을 수는 없다

 

정답 : D

-> QUOTA가 일단 0으로 ASSIGN되면 해당 USER의 OBJECT는 REVOKE된 TABLESPACE에

그대로 남아있게 되지만 향후 새로운 SPACE를 할당받을 수는 없다

 

문) To find out how many database objects a user has created,

the DBA can query which dictionary view? ★★★

 

A. DBA_USERS

B. DBA_OBJECTS

C. DBA_TS_QUOTAS

D. DBA_TAB_PRIVS

 

정답 : B

 

문) User를 Drop시키고자 할 때 User에게 Data가 있을 경우 어떻게 되는가? ★★★

 

정답 :

 

문) Which line of the following statement will produce an error? ★★★

 

A. CREATE USER ops$ellison

B. IDENTIFIED EXTERNALLY

C. DEFAULT TABLESPACE users_01

D. IDLE_TIME = 3

E. DEFAULT ROLE connect;

F. There are no errors in this statement.

 

정답 : D

-> 오라클메뉴얼 12-13

 

문) USER SESSION을 KILL할 때 반드시 있어야 할 내용을 두가지 골라라

 

A. USER ID

B. USER PASSWORD

C. USER SESSION ID

D. USER PROCESS ID

E. USER SERIAL NUMBER

 

정답 : C,E

-> ALTER SYSTEM KILL SESSION 'integer1, integer2' 이며

여기서 integer1 - USER SESSION ID, integer2 - USER SERIAL NUMBER이 된다.

이러한 SID나 SERIAL NUMBER를 알기위해서는 V$SESSION VIEW를 참조하면 된다.

 

문) user와 schema의 관계?

 

A. user가 생성되면 schema가 같은 이름으로 생성된다.

B. user 생성후 다른 이름으로 별도의 schema를 생성해야 한다.

C. user 생성후 다음번 instance 시작시 자동으로 생성된다.

 

정답 : A

 

문) If you wanted to terminate a user's session, which two values must be included

in the KILL SESSION clause? (Choose two)

 

A. user name

B. user password

C. session ID index

D. serial number of user session

E. dba name

F. dba password

 

정답 : C, D

-> 오라클메뉴얼 12-37

 

문) What does a value of -1 in a user's tablespace quota indicate?

 

A. full

B. unlimited

C. default

D. undefined

 

정답 : B

-> 오라클메뉴얼 12-33

 

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

* 13. Manage Resource Usage (2) *

* - 리소스 사용도 관리 *

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

 

■Defining Profiles

- Session-level : enforced for each connection

. The current statement is rolled back

. COMMIT, ROLLBACK, or disconnect is allowed

. No further work can be accomplished in that session

 

- Call-level : while executing a SQL statement

. The processing of the statement is halted.

. The statement is rolled back

. The user's session remains connected.

 

■Profiles

- 여러 resource의 limit을 정의해 놓은 것이다.

Named sets of resource limits

- user들에게 할당된다 Assigned to uesrs

- 활성 또는 비활성화 할 수 있다.

Can be enabled or disabled (for the entire system)

- resource 관리를 단순화시킨다. simplify resource management

- user가 많은 대용량 system이나 회사 보안 규칙상 필요한 곳에서 유용하다.

useful in large multi-user systems

 

■system의 resource 종류

- CPU time

- I/O operation

- idle time

- connect time

- private SQL area/MTS only

- concurrent session

 

■Profile의 정보 검색 view

- dba_users

- user_resource_limits

- dba_profiles

- resource_cost

 

■Enable or disable the enforcement of resource limits by altering the RESOURCE_LIMIT

initialization paramter, or by using the ALTER SYSTEM command. (주) ALTER SYSTEM...

SVRMGR> ALTER SYSTEM SET RESOURCE_LIMIT = TRUE;

 

■Changes to a profile do not affect current sessions. Changes are use in subsequent sessions only.

주) (다음 접속부터 효력발생)

 

■Profile Characteristics

- Profile assignments do not affect current sessions

- The ALTER USER privilege is needed to assign a profile to a user.

- Profiles can be assigned only to users, and not to roles or other profiles. (주)

If you do not assign a profile when creating a user,

the user is automatically assigned the default profile.

주) Default 프로파일은 삭제할 수 없다.

 

■When a profile is dropped this change applies to subsequently created sessions only, and

not to current sessions. The DEFAULT profile cannot be dropped.

 

■Viewing Profile Information Data Dictionary

- DBA_USERS, USER_RESOURCE_LIMITS, DBA_PROFILES, RESOURCE_COST

 

문) PROFILE에 지정된 값을 수정하려면?

 

A. ALTER PROFILE 명령어 사용

B. SYSTEM RESTARTUP

C. ALTER SYSTEM 명령어 사용

D. ALTER DATABASE 명령어 사용

 

정답 : A

-> 오라클메뉴얼 13-21

 

문) If the DBA wishes to use resource costs to limit resource usage,

the first thing she must do is ★★★

 

A. Change the value of RESOURCE_LIMIT to TRUE.

B. Change the value of composite_limit in the user profile to zero.

C. Change the value of composite_limit in the DEFAULT profile to zero.

D. Change the value of the resource costs for the resources to be limited.

 

정답 : A

 

문) On database creation,

the value of the CONNECT_TIME parameter in the DEFAULT profile is ★★★

 

A. 1

B. 10

C. 300

D. unlimited

E. None, the DEFAULT profile hasn't been created yet.

 

정답 : D

-> 오라클메뉴얼 13-25

-> 초기에 모르는 기본값은 제한되어(unlimited)있지 않다.

 

문) 다음중 System Resource Limit에 속하지 않는 것은?

 

A. CPU time

B. concurrent session

C. transaction

D. connect/idle time

E. block read

 

정답 : C

 

문) RESOURCE LIMIT에 해당하는 것들? ★★★

 

정답 : (CPU TIME, CONNECT TIME, BLOCK READ(I/O OPERATIONS), SESSION, IDLE TIME,

SESSION, MEMORY SPACE) -> 앞 쪽의 세가지만 나왔음.

 

문) A resource cost is ★★★

 

A. A monetary cost for using a database resource

B. A monetary cost for using a privilege

C. An integer value representing the importance of the resource

D. An integer value representing the dollar cost for using the resource

 

정답 : C

 

문) A high resource cost indicates ★★★

 

A. A less expensive resource

B. A lower amount of resource used per minute

C. A more expensive resource

D. A higher amount of resource used per minute

 

정답 : C

 

문) profile은 무엇인가?

 

정답 : user에게 할당된 system resource limit를 설정해놓은 list

(system resource에 관해 공부할것!)

 

문) 다음중 COMPOSITE LIMIT를 이용하기 위하여 WEIGHTED SUM을 계산하는데

이용되는 항목이 아닌 것은?

 

A. PRIVATE_SGA

B. LOGICAL_READS_PER_SESSION

C. CPU_PER_SESSION

D. IDLE_TIME

 

정답 : D

-> COMPOSITE LIMIT는 4가지의 RESOURCE LIMIT에 대한 WEIGHTED SUM을 이용하여

SYSTEM RESOURCE의 사용을 제한할 수 있도록 한다.

4가지의 RESOURCE LIMIT는 다음과 같다.

PRIVATE_SGA, LOGICAL_READS_PER_SESSION, CPU_PER_SESSION, CONNECT_TIME

 

문) 시스템 성능을 저하시키는 요인으로 developer들이 idle로 계속 접속해 있는 문제가 꼽혔다.

그래서 5분동안 idle이면 자동으로 접속해제되게 하려면? ★★★

 

A. ALTER USER 명령 이용

B. ROLE을 수정

C. PROFILE을 수정

 

정답 : C

 

문) 다음중 PROFILE 정보를 볼 수 있는 VIEW가 아닌것은?

 

A. DBA_USERS

B. USER_RESOURCE_LIMITS

C. DBA_SYS_PRIVS

D. RESOURCE_COST

 

정답 : C

-> PROFILE에 관계된 DATA DICTIONARY VIEW는 다음과 같다.

- DBA_USERS

- USER_RESOURCE_LIMITS

- DBA_PROFILES

- RESOURCE_COST

 

문) PROFILE에 관계된 다음 내용중 틀린 것을 두개 골라라 ★★

 

A. SESSION-LEVEL LIMIT가 초과되면 COMMIT 작업은 허용되지 않는다

B. CALL-LEVEL LIMIT가 초과되어도 USER SESSION은 그대로 유지된다

C. PROFILE을 ENABLE 또는 DISABLE하려면 RESOURCE_LIMIT 초기화 PARAMETER를 이용하여야만 한다

D. DATABASE가 만들어질 때 DEFAULT PROFILE이 만들어지며 이 PROFILE은 DROP되어질 수 없다

 

정답 : A, C

-> SESSION-LEVEL LIMIT가 초과되면 현재의 STATEMENT는 ROLLBACK되며

COMMIT, ROLLBACK, DISCONNECT 작업만이 허용된다.

CALL-LEVEL LIMIT가 초과되면 현재의 STATEMENT는 ROLLBACK되며

USER의 SESSION은 그대로 유지된다.

PROFILE을 ENABLE 또는 DISABLE하는 방법에는 RESOURCE_LIMIT 초기화 PARAMETER를

이용하는 방법과 ALTER SYSTEM COMMAND를 이용하는 방법 2가지가 있다.

 

문) If the database could not be shut down, which command could you use to

enable or disable enforcement of resource limits for an existing user

during her current session?

 

A. ALTER USER

B. ALTER SYSTEM

C. UPDATE SYSTEM

D. CREATE USER

 

정답 : B

-> 오라클메뉴얼 13-11

 

문) 다음 중 profile에 포함하는 resource 항목이 아닌 것은?

 

A. cpu time

B. idle time

C. connect time

D. shared pool 사용율

 

정답 : D

 

문) Which goal relates to profiles?

 

A. controlling which objects users can access

B. controlling the use of system resources

C. controlling who has access to the database

D. controlling disk space used by database users

 

정답 : B

-> 오라클메뉴얼 13-5

 

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

* 14. Manage Database Access (5) *

* - 데이터베이스 엑세스 관리 *

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

 

■Types of System Privileges

- Create a session, Create a user

- Create a table, Update rows in any table or view in any schema, Select any table

- Create a table, Create a sequence in one's own schema

 

■GRANT ... TO ... WITH ADMIN OPTION ★★★

- allows the grantee to grant the system privilege or role to other users or roles.

-> 결국은 다 준다.

주) profile은 user에게만 할당. 다른 role이나 프로파일이 아닌.

 

■List the system privilege view : DBA_SYS_PRIVS

 

■Object Privileges : particular action on specific table, view, sequence, stored procedure

- SELECT, UPDATE, INSERT, ALTER, DELETE, TRUNCATE, EXECUTE, INDEX, FOREIGN KEY

 

■GRANT ... ON ... TO ... WITH GRANT OPTION ★★★

- allows the grantee to grant the object privileges to OPTION other users or roles.

A privilege WITH GRANT OPTION cannot be granted to roles.

주) WITH GRANT OPTION 권한으로 ROLE 부여할 수 없다.

 

■To grant privileges on an object, the object must be in your own schema or you must have been

granted the object privileges WITH GRANT OPTION.

 

■ View all object privileges : DBA_TAB_PRIVS(objects), DBA_COL_PRIVS(columns)

 

문) where is log sequence number stored in?

 

정답 : control file, 각 datafile header

 

문) system privilege와 object privilege의 차이점?

 

정답 : system privilege - create, drop ...

object privilege - insert, delete, update, alter

 

문) 어떤 유저에게 update와 같은 객체권한을 with grant option으로 주었다.

나중에 이것을 회수하고 싶지만 update(컬럼1)은 그대로 유지하고 싶다.

옳은것은? ★★★

 

A. use a revoke... except option

B. if the user grant this role to another then this will not be revoke.

C. you can do it to use command 2 times.

 

정답 : C

 

문) Privileges granted with the GRANT OPTION cannot be given to other users.

 

A. TRUE

B. FALSE

 

정답 : B

 

문) DBA가 scott라는 USER에게 CREATE TABLE의 권한을 부여하려고 한다.

이때 scott USER가 john이라는 USER에게 CREATE TABLE의 권한을 재부여할 수 있도록

하고자 할 때의 문장으로 맞는 것은?

 

A. GRANT CREATE TABLE TO scott WITH GRANT OPTION

B. GRANT CREATE TABLE TO scott WITH ADMIN OPTION

C. GRANT CREATE TABLE TO scott

D. GRANT CREATE TABLE TO PUBLIC

 

정답 : B

-> CREATE TABLE PRIVILEGE는 특정 OBJECT에 관계된 PRIVILEGE가 아니므로 SYSTEM PRIVILEGE이다.

그리고 다른 USER에게 자신이 부여받은 권한을 재 부여할수 있도록

할 때 SYSTEM PRIVILEGE의 경우에는 WITH ADMIN OPTION을,

OBJECT PRIVILEGE의 경우에는 WITH GRANT OPTION을 이용한다.

 

문) USER A가 USER B에게 TABLE_A 테이블에 대한 ALTER 권한을 부여하였고

다시 USER B가 USER C에게 TABLE_A에 대한 ALTER 권한을 부여하였다고 가정하자.

이때 USER A가 USER B에 대하여 TABLE_A 테이블에 대한 ALTER 권한을 REVOKE하였다고

할 때 USER C의 TABLE_A 테이블에 대한 ALTER 권한은 어떻게 되는가?

 

A. USER C의 TABLE_A테이블에 대한 ALTER 권한은 여전히 유효하다

B. USER C의 TABLE_A테이블에 대한 ALTER 권한도 같이 REVOKE된다

C. USER A는 USER B의 TABLE_A테이블에 대한 ALTER 권한을 REVOKE할 수 없다

D. USER B가 USER C에 대하여 TABLE_A 테이블에 대한 ALTER 권한을 REVOKE해야만

USER C의 권한이 REVOKE된다

 

정답 : B

-> WITH GRANT OPTION을 이용하여 OBJECT PRIVILEGE를 REVOKING 할 때에는

CASCADING EFFECT가 발생한다. 즉 상위의 USER에게 부여한 OBJECT PRIVILEGE를 REVOKE하면

그 USER가 하위 USER에게 부여했던 모든 OBJECT PRIVILEGE도 같이 REVOKE된다.

 

문) 다음 중 틀린 것을 모두 고르시오. ★

 

A. system 권한은 user나 role에게 부여될 수 있다.

B. with admin option으로 부여하면 회수할 때도 이 옵션을 명시해야 한다.

C. 어떤 권한이던지 받은 권한에 대해서 줄 수 있다.

D. create session, alter user 등은 system 권한에 속한다.

 

정답 : B, C

-> with admin option에서의 권한 회수는 cascade한 영향력이 없다.

revoke에는 with admin option이 없다. 받을 때 with admin option으로

받아야 받은 권한을 줄 수 있다.

 

문) 다음 중 틀린 것을 모두 고르시오. ★★

 

A. system user는 모든 table에 대한 권한을 다른 user에게 부여할 수 있다.

B. 특정 컬럼에 대해서만 권한을 제한하여 부여할 수 있다.

C. role은 with grant option으로 부여될 수 없다.

D. with grant option의 회수는 그 권한을 가진 user에게 cascade한 영향을

미친다.

 

정답 : A

-> with admin option - system 권한, 권한 회수는 cascade한 영향력이 없다.

with grant option - object 권한, 권한 회수는 cascade한 영향력이 있다.

-> A가 답인데 D는 말자체가 너무 이상해서. 암튼 D는 답은 아닐 거 같군요.(맞는 말 같아서)

 

문) Which action requires an object privilege?

 

A. creating a table

B. creating a user

C. creating a foreign key

D. creating a session

 

정답 : C

 

문) Which data dictionary view would you access to list all the system privileges

granted to roles and users?

 

A. USER_TAB_PRIVS

B. V$PWFILE_USERS

C. DBA_SYS_PRIVS

D. DBA_TAB_PRIVS

 

정답 : C

 

문) A USER가 SELECT, UPDATE하고 B USER가 SELECT, 다시 A USER가 CREATE TABLE...,

다시 A USER가 SELECT, B USER가 SELECT하면 보이는 것은 무엇인가?

 

정답 : A USER가 두번째 SELECT 한 데이터

 

문) 어떤 유저에게 select같은 객체권한을 with grant option으로 주었다.

나중에 이것을 회수하고 싶지만 select는 그대로 유지하고 싶을때 옳은것은? ★★★

 

정답 : 일단 모두 회수한 후에 select만 with grant option없이 grant한다.

 

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

* 15. Manage Roles (4) *

* - Role 관리 *

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

 

■Role Characteristics

- Can consist of both system and object privileges

- Are not owned by anyone; not in any schema (어느 누구의 소유도 아님) ★

- May be granted to any user or role, except to itself (even indirectly)

※ 주의할 사항

- Description of roles are stored in the data dictionary

 

■Benefits of Roles

- Reduced granting of privileges

- Dynamic privilege management

- Selective availability of privileges

- Performance

 

■Enable a role with the SET ROLE command.

SVRMGR> SET ROLE ALL EXCEPT acct_pay;

 

■Establish a default role for a user with the ALTER USER command.

ALTER USER ... DEFAULT ROLE ...

- You cannot set default role with CREATE USER.

※ 주의할 사항

 

■Displaying Role Information : DBA_SYS_PRIVS, DBA_ROLES

 

■OSOPER and OSDBA : OS 인증을 통해서..(connect internal)

- OS로 login한 유저의 그룹이 oper인경우 OSOPER, dba인경우 OSDBA이나 잘 구분 안함.

- OSDBA : all system privilege with the WITH ADMIN OPTION and the OSOPER role

only the OSDBA role permits CREAE DATABASE and time-based recovery

 

■SYSOPER and SYSDBA : 패스워드 파일을 통한 인증 ★

 

■Setting Up Operating System Role Management

- Set initialization parameter OS_ROLES to TRUE

 

문) Role은 누구의 소유인가?

 

정답 : 아무도 아님 (보기에는 none이라고 나왔다고 함)

 

문) 나는 DB 내부는 전혀 Handling을 안한다.

그러나 startup, shutdown, backup은 한다. 그렇다면 나의 권한은? ★

 

A. OSDBA

B. OSOPER

C. SYSDBA

D. SYSOPER

 

정답 : B

 

문) 어떤 유저가 있는데 이 사람은 startup, shutdown, 그리고 OS Backup 만 주로 한다.

그리고, 이 유저는 table 조회 등은 하지 않습니다. 이때 부여해야 하는 권한은 ?

 

정답 : OSOPER인것 같음. ?

 

문) The creator of a role is granted the use of the role WITH ADMIN OPTION.

 

A. TRUE

B. FALSE

 

정답 : A

 

문) 오라클이 적재되어있는 unix의 administrator가 데이터베이스를 startup

shutdown의 임무만 있고 다른 테이블을 쿼리할 필요가 없을 때 그가 가질 수 있는

적절한 role은?

 

A. sysoper

B. sysdba

C. osoper

D. osdba

 

정답 : A ?

 

문) 내가 테이블을 만들고 이 테이블의 검색 권한을 롤에 줄수 있는가?

 

A. 만들어 진다.

B. sys user만 된다.

C. 롤의 소유자만 가능하다.

 

정답 : A

-> 오브젝트에 대한 권한은 생성자가 지닙니다.

 

문) 내가 어떤 table을 내 스키마 안에 create했다. 이 table을 select 하는 권한을

test_role에 줄 수있는가?

 

A. 만들어진다.

B. sys user라야만 권한을 줄 수 있다.

C. test_role을 소유한 user가 권한을 줄 수 있다.

 

정답 : A

 

문) USER A가 ROLL_A, ROLL_B, ROLL_C를 DEFAULT ROLL로서 권한을 부여받고 있다.

현재 SESSION에서 SET ROLL명령으로 ROLL_C를 부여하였을때 어떤 현상이 일어나는가?

 

A. USER A는 ROLL_A, ROLL_B, ROLL_C 의 모든 권한을 부여받는다

B. USER A는 ROLL_A, ROLL_B의 권한만 그대로 유지한다

C. USER A는 ROLL_C의 권한만 부여받는다

D. SET ROLL명령으로 ROLL_C의 권한을 지정할 수 없다

 

정답 : C

-> SET ROLL명령은 SET ROLL명령시에 지정된 ROLL만 ENABLE하고,

이미 지정되어 있던 다른 ROLL들은 DISABLE한다.

 

문) ROLL에 관한 설명으로 맞지 않는 것은?

 

A. USER나 ROLL에게 부여될 수 있지만 자신에게는 부여될 수 없다

B. PASSWORD를 포함할 수도 안할 수도 있다

C. DEFAULT ROLL은 USER 생성시 또는 ALTERING시 지정할 수 있다

D. ROLL B가 ROLL A에게 GRANT하였다면 ROLL A는 ROLL B를 GRANT할 수 없다

 

정답 : C

-> CREATE USER명령으로는 DEFAULT ROLL을 지정할 수 없다.

ALTER USER명령으로 DEFAULT ROLL이 지정가능하다.

 

문) Which characteristic relates to a role?

 

A. always requires a password

B. owned by a schema

C. may be granted to itself

D. eases privilege management

 

정답 : D

-> 오라클메뉴얼 15-5

 

문) 오라클 패스워드 인증을 사용하여 데이터베이스에 대한 관리 작업을 하기 위해

DBA는 다음과 같은 두 가지 특권을 갖고 있어야 한다. 이 두가지 특권은? ★★★

 

A. sysdba or sysoper

B. osdba or osoper

C. CONNECT or RESOURCE

D. restricted session or create session

 

정답 : A

-> SYSOPER and SYSDBA : 패스워드 파일을 통한 인증

 

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

* 16. Audit The Database (2) *

* - 데이터베이스 감사 *

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

 

■Auditing

- 의심되는 활동을 조사하고, 모니터하여, 자료를 수집하는 것을 의미.

- auditing는 statement audit, privilege audit, object audit의 3가지 관점에서

할 수 있으며, 감시된 모든 정보는 audit trail에 저장됨.

 

■Auditing Operations 종류

- Statement auditing (문장감사) : 어떤 statement가 사용되었나?

- Privilege auditing (권한감사): system privilege

- Object auditing (오브젝트감사)

- system auditing에는 create, drop (table, index, cluster, ...)이 있고

object auditing에는 insert, delete, update, 등이 있다.

주) 오브젝트감사옵션의 기본값에 대한 어떠한 추후의 변경은 기존의 모든 오브젝트의

감사옵션에 반영되지 않을 것이다.

 

■Create database triggers to perform value-based auditing.

 

■Audit 대상 Object

1) table

2) view

3) sequence

4) package

5) 독립된 stored procedure / function

주) 패키지상의 프로시저는 개별적으로 감사대상이 될 수 없다.

 

■Enabling Auditing

- initialization file의 AUDIT_TRAIL parameter 값을 설정. (AUDIT_TRAIL = value)

. value 가 DB 혹은 TRUE : sys.aud$ 에 기록됨

. value 가 OS 이면 : OS상에 ~~~~.aud 파일이 생김.

. value 가 NONE 혹은 FALSE : disables auditing.

 

■Audit Events Always Audited : alert~~.log 에 쌓임.

- Instance Startup

- Instance Shutdown

- Connections to database with administration privileges

 

■For all auditing, limit the scope by:

- Auditing successful and unsuccessful execution of the specific SQL statement

- Collecting audit information BY SESSION(non DDL) or BY ACCESS(DDL statement). ★

 

■Auditing is not carried out if you use CONNECT INTERNAL, or if you connect as 'sys' user.

 

■Query DBA_STMT_AUDIT_OPTS , DBA_PRIV_AUDIT_OPTS : OPTION이 어떻게 설정되어 있는지...

DBA_OBJ_AUDIT_OPTS, USER_OBJ_AUDIT_OPTS

 

■There are over 80 distinct system privileges that can be audited.

 

■Object audit options are always set for all users of the database. These options cannot

be set for a specific list of users.

Assign default auditing options to all subsequently created objects.(ALL_DEF_AUDIT_OPTS)

 

■The Audit Trail : USER_AUDIT_TRAIL, DBA_AUDIT_TRAIL

: stores the records generated by statement, privilege, and object auditing.

The audit trail is the SYS.AUD$ data dictionary table. ★

- The user who executed the statement

- The action code that indicates the type of statement executed or privilege used.

- The objects referenced in the statement

- The data and time the statement was issued.

 

■Truncating the Audti Trail

- Truncate SYS.AUD$ using the TRUNCATE command ( SQL> TRUNCATE TABLE sys.aud$;)

 

문) developer들이 개발 중 자주 CREATE/ALTER/DROP을 수행한다.

이때 Audit를 하고자 할 때 가장 적당한 방법은? ★★★

 

A. access 단위로 audit

B. each user들의 CREATE/ALTER/DROP에 대해 audit

C. 모든 user들의 CREATE/ALTER/DROP에 대해 audit

 

정답 : A

 

문) SYS.AUD$가 OPERATION SYSTEM에 WRITE 되어졌다. DB로 저장하고자 하려면?

 

정답 : NEW DESTINATION을 설정하여.....한다.

 

문) 개발자가 CREATE, DROP, UPDATE 자주 할 때 가장 적합한 감사 방법? ★★★

 

A. 전체 권한에 대해 감사

B. 해당 권한에 대해서만 감사

 

정답 :

->

 

문) When auditing instance startup, the audit records are placed in ★★★

 

A. SYS.AUD$

B. DBA_AUDIT_TRAIL

C. ARCHIVE_DUMP_DEST

D. AUDIT_TRAIL_DEST

 

정답 : D

-> 답이 A가 아님을 주의할 것!

 

문) COLLECTION AUDIT INFORMATION에 관한 문제에서 DDL statement를 주고 보기에

'BY SESSION', 'BY ACCESS'외에 보기가 3개 더 나왔다고 함.

 

정답 : BY ACCESS라고 함

 

문) 어떤 Develpor들이 있는데 이 들은 create, drop, alter table의 작업을 무진장 한다.

이때 어떤 auditing을 해주어야 하는가? ★★★

 

정답 : Objec Auditing

-> System Auditing이 맞지 않나?

 

문) 다음과 같이 audit를 설정했을 때 틀린 것을 고르시오. ★★★

 

SQL>audit alter, select, rename on [default] ;

 

A. table이 생성된다면 그 table에 실행되는 select, alter, rename 문장이 audit될 것이다.

B. view가 생성된다면 그 view에 대해 실행되는 select 문만 audit될 것이다.

C. sequence가 생성된다면 그 sequence에 대해 실행되는 alter, select 문만 audit될 것이다.

D. snapshot이 생성된다면 그 snapshot에 대해 실행되는 select 문만 audit될 것이다.

E. 독립형 stored procedure, function 또는 package가 생성된다면 그것에 대해 실행되는

rename 문장만 audit된다.

 

정답 : B

 

문) 현재의 INSTANCE가 AUDITING을 하지 않고 있다.

DBA가 DATABASE를 AUDITING 가능하도록 하고자 할 때 어떻게 하여야 하는가?

 

A. INITIALIZATION PARAMETER를 수정하면 바로 AUDITING이 가능해진다

B. INITIALIZATION PARAMETER를 수정하고 INSTANCE를 SHUTDOWN, RESTART시켜야 한다

C. SET AUDIT TRAIL명령을 이용하면 바로 AUDITING이 가능해진다

D. SET AUDIT TRAIL명령을 이용한후 INSTANCE를 SHUTDOWN, RESTART시켜야 한다

 

정답 : B

-> AUDIT_TRAIL내용을 변경하려면 반드시 INITIALIZATION PARAMETER

를 수정하여야 한다. 이때 수정된 값의 효과를 가지려면 INSTANCE를

SHUTDOWN, RESTART하여야 한다.

이때 AUDIT_TRAIL의 값을 DB로 하면 SYS.AUD$로 AUDIT RECORD

가 기록이 되고, OS로 하면 모든 AUDIT RECORD를 OPERATING

SYSTEM AUDIT TRAIL로 기록을 하게된다. AUDITING을 하지 않으려면

NONE를 선택한다.

 

문) STATEMENT AUDITING시 AUDIT_TRAIL의 값을 DB로 지정하였다면

AUDITING된 레코드들은 어느 DATA DICTIONARY에서 조회해 볼 수 있는가?

 

A. DBA_STMT_AUDIT_OPTS

B. DBA_PRIV_AUDIT_OPTS

C. SYS.AUD$

D. V$AUDIT_TRAIL

 

정답 : C

-> STATEMENT AUDITING, PRIVILEGE AUDITING, OBJECT AUDITING등

모든 경우의 AUDITING시 초기화 PARAMETER AUDIT_TRAIL = DB로

지정이 되어 있다면 AUDITING되는 모든 RECORD들은 AUDIT TRAIL

TABLE인 SYS.AUD$에 저장된다.

 

문) AUDIT DELETE, ALTER, SELECT, RENAME ON DEFAULT라는 문장을 실행하였다.

이때 SNAPSHOT에 관련되어 AUDITING되는 OPTION을 모두 골라라.

 

A. DELETE

B. ALTER

C. SELECT

D. RENAME

 

정답 : C

-> SNAPSHOT에 관련된 OBJECT AUDITING OPTION은 SELECT뿐이다.

TABLE, VIEW, SEQUENCE등 다른 OBJECT에 관련된 AUDITING

OPTION도 숙지해 두어야 할 것임

 

문) Audit trail information is stored in

 

A. SYS.SOURCE$

B. SYS.AUD$

C. DBA_SOURCE

D. DBA_AUDIT_TRAIL

 

정답 : B

 

문) audit 정보가 저장되는 data dictionary table은?

 

정답 : SYS.AUD$

 

문) AUDIT_TRAIL은 어디에 기록되는가?

 

정답 : SYS.AUD$

 

문) Which auditing option can be used to check that backups are performed

at the scheduled times? ★★★

 

A. SYSTEM

B. ALTER/MANAGE TABLESPACE

C. ALTER ANY PROCEDURE

D. EXECUTE

 

정답 : B

-> 오라클메뉴얼 16-25

-> 메뉴얼에 구체적인 설명은 없고 똑같은 문제만 있다.

 

문) Which object auditing option can be used to monitor sequences?

 

A. DELETE

B. SELECT

C. UPDATE

D. INDEX

E. LOCK

 

정답 : B

-> 오라클메뉴얼 16-33

-> Select가 답이 될 확률이 제일 높다.

 

문) Which data dictionary objects stores the records generated by

statement, privilege and object auditing?

 

A. V$PWFILE_USERS

B. SYS.AUD$

C. USER_OBJ_AUDIT_OPTS

D. DBA_PRIV_AUDIT_OPTS

 

정답 : B

 

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

* 17. Specify National Language Support Behavior () *

* - 기타 *

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

 

문) default NLS는?

 

정답 : US7ASCII

 

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

* 18. Advanced Architecture () *

* - 향상된 아키텍쳐 *

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

 

문) Which application might benefit from the Parallel Query option?

 

A. decision support systems

B. reporting application processing small amounts of data

C. systems requiring infrequent loading

D. departmentalized applications

E. online transaction processing with partitioned data

 

정답 : A

-> 오라클메뉴얼 18-55

 

문) Which task would benefit most from the use of a dedicated server?

 

A. to achieve load balancing

B. to submit batch jobs

C. to increase the number of possible users

D. to reduce the number of processes running against an instance

 

정답 : B

-> 오라클메뉴얼 18-15

 

문) PARALLEL SERVER OPTION의 특징이 아닌 것은?

 

A. 모든 INSTANCE는 각각 자신의 REDO LOG FILE을 가지고 있으며

다른 INSTANCE의 REDO LOG FILE을 읽을수 있다

B. 모든 INSTANCE는 같은 DATAFILE 및 CONTROL FILE을 공유한다

C. 하나의 NODE에서 FAILURE가 되면 모든 데이터에 대한 접근은 불가능하게 된다

D. 추가의 HARDWARE가 필요해질 수 있다

 

정답 : C

-> PARALLEL SERVER OPTION에서는 하나의 NODE에서의 FAILURE는

모든 사용자에 대하여 모든 데이터에 대한 접근을 못하도록 하지는 않는다.

따라서 FAILURE되지않은 NODE에서 DATABASE는 계속 이용가능하다.

 

문) 다음중 MULTI-THREADED SERVER의 이용에 대한 설명중 틀린 것은?

 

A. USER SESSION DATA는 SGA에 저장된다

B. 사용가능한 사용자의 수를 증가시킬 수 있다

C. 메모리 이용과 시스템의 OVERHEAD를 줄일 수 있다

D. 주로 BATCH JOB등에 이용된다

 

정답 : D

-> DEDICATED SERVER환경에서 하나의 USER가 하나의 SERVER

PROCESS를 독점하던 것과는 달리 MULTI-THREADED SERVER환경은

여러 USER가 여러 SERVER PROCESS를 공유하는 개념이다.

따라서 많은 USER가 사용가능해지고 메모리 및 시스템 OVERHEAD를 줄일수 있다.

BATCH JOB은 특정 USER가 SERVER PROCESS를 독점하여 계속 이용하는 것이

바람직하기 때문에 DEDICATED SERVER를 이용하는것이 바람직하다.

 

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

* 19. SQL*Loader (2) *

* - SQL 로더 *

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

 

■SQL*Loader

- requires two types of input : the data to be loaded, and a control file describing the data.

 

■Control File Contents

- Names of the data files

- Format of the data files

- Character set

- Data types

- Data field delimiters

- Tables and columns to load

 

■SQL*Loader Files (3가지)

1) Log file

2) Bad file

3) Discard file

 

■Conventional Path Loading ★

- Competes with all other Oracle 7 processes for database resources

- Slower than the direct path

- Builds an array of rows to be inserted into the database

- INSERT SQL statement to place rows into tables

 

■Direct Path Loading ★

- Highly optimized

- Faster than the conventional path

- Can load into unclustered tables

- Builds Oracle 7 blocks to be inserted directly into the database

- Does not use SQL statement to place rows into tables

- Few calls to the Oracle 7 Server ★

- Uses space management

 

■Direct Path Loading

- Does not generates SQL statement

- Does not use a bind array

- Locks tables and indexes only once

- Bypasses the SGA buffer cache

- Does not write redo log entries when in NOARCHIVELOG mode

주) In direct path loading, indexes are created after the data is loaded.

 

■Cause of Unsuccessful Loads

- SQL*Loader ran out of space for the index

- Data was not in the order specified

- The instance failed during the load

- Duplicate keys were found in a unique index : USER_INDEXES, ALL_INDEXES, DBA_INDEXES

 

■Control File

1) Describes the data to be loaded

2) Specifies the tables in the database to be loaded ★

3) Describes the interdependency between the data and the columns within the tables

 

■Log File

- While loading the data, SQL*Loader keeps statistics about the load in a log file

- Contents

1) Errors found during parsing of the control file are stored in the log file

2) Detailed information about the load is stored in the log file ★

 

■Bad File

- SQL*Loader places rejected records into a bad file

- Reasons Records are Rejected

1) Invalid Input Format

2) Invalid Row

3) Non-Unique Key Value

4) A Null Required Field

 

문) In which of the following operations does the direct path load use the SGA?

 

A. Obtaining data blocks for writes

B. Adjusting the highwatermark

C. Updating the indexes

D. Verifying integrity constraints

 

정답 : B

 

문) SQL*Loader의 Conventional Loading 중 열을 지정하는 곳은?

 

정답 : 전 command line 이라고 했는데 틀렸음.

 

문) CONVENTIONAL PATH를 이용할때 DATA FILE형식을 지정하는 FILE은?

 

정답 : CONTROL FILE

 

문) SQL*LOADER사용시 대상 데이터의 DATATYPE이 저장되는 파일은?

 

정답 : CONTROL FILE

 

문) Which SQL*Loader file holds detailed information about the load?

 

정답 : LOG FILE

-> 오라클메뉴얼 19-47

 

문) Which SQL*Loader file specifies the tables in the database to be loaded?

 

정답 : CONTROL FILE

 

문) Which SQL*Loader file describes how to load the data?

 

A. LOG

B. BAD

C. CONTROL

D. PARFILE

 

정답 : C

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

 

문) SQL*LOADER를 사용해서 DATA를 LOAD할 때,

COMPILE시 생기는 ERROR가 저장되는 FILE은?

 

A. CONTROL FILE

B. LOG FILE

C. BAD FILE

D. DISCARD FILE

 

정답 : B

 

문) SQL*Loader를 이용해 대량의 Data를 insert할 때 constraint를 off 시켰다가,

inster가 끝난 후 자동으로 on 시킬때 reject된 (error가 발생한) row들은 어디에 저장되어 있는가?

 

정답 : BAD File

 

문) Which characteristic applies to Direct Path Loading?

 

A. builds an array of rows to be inserted into database

B. uses the INSERT SQL statement to place rows into tables

C. cannot load into unclustered tables

D. uses very few calls to the Oracle7 Server

 

정답 : D

-> 오라클메뉴얼 19-13 참조

 

문) SQL*Loader execution parameters can be located in which of the following locations? ★★★

(Choose three)

 

A. Datafile

B. Control file

C. Command line

D. Discard file

E. Parameter file

 

정답 : A, B, C -> 답은 B, C, E 로 되어있음.

-> 오라클메뉴얼 19-8 그림참조 -> 그림참조하면 A, B, D가 맞는 것 같은데 아니라고 함.

-> A, B, C가 되겠네요. D는 insert 작업이 잘못되어 안들어간 파일이 들어가는 파일이고(?) E는

init.ora 파일을 말하는 것임.

-> SQL*LOADER 프로그램은 DB에 데이터를 입력시키는 오라클사의 응용프로그램이다.

로더 파일로 컨트롤 파일(control file), 데이터 파일, 로그 파일(log file), 배드 파일(bad file),

디스카드 파일(discard file) 등이 있다.

여기서 control file은 데이터 파일을 DB상에 적재하기 위한 파일 타입, 어떤 구조로 테이블에

적재될 것인지, 어떤 조건으로 적재될 것인지 등이 기술되고

데이터 파일은 말 그대로 데이터베이스에 적재될 데이터를 기술해 놓았으며,

로그파일은 자동적으로 생성되면 로더되는 상황이 시간과 함께 기술된다.

배드 파일은 말 그대로 부적당한 데이터로 DB에 적재되지 못하는 파일이다. 그리고

디스카드파일은 control file에서 만든 조건에 맞지 않은 데이터를 디스카드 파일로 만든다.

-> D는 절대 답이 아니다.

 

문) SQL*Loader can update existing rows of data in a table. ★★★

 

A. TRUE

B. FALSE

 

정답 : F

 

문) If a discard file is produced by SQL*Loader,

in what format will the data in the file be? ★★★

 

A. Fixed width

B. Variable width

C. Comma delimited

D. The same as in the input file

 

정답 : D

 

문) Which of the following will improve performance on a data load? ★★

 

A. Creating triggers before the load

B. Enabling primary-key constraints before the load

C. Specifying DIRECT=TRUE in the control file

D. Running the load across a database link

 

정답 : C

-> 오라클메뉴얼

-> 처음에는 control file이라고 해서 DB가 mount될 때 읽히는 파일을 생각했었는데

다시 생각해보니 sql*loader에서 쓰이는 control file이겠군요.

direct = true로 설정하면 다른 프로세스와 경쟁하지 않으므로

보다 빠른 시간에 insert가 가능합니다.

SQL*LOADER에 대해서 나와있는 부분을 살펴보십시오.

 

문) A table index should be rebuilt after running a conventional path data load. ★★★

 

A. TRUE

B. FALSE

 

정답 : F

 

문) Indexes left in the direct path state after a data load must be rebuilt.

 

A. TRUE

B. FALSE

 

정답 : A

 

문) After running SQL*Loader with the conventional path,

which file contains records that could not be loaded due to violating integrity constraints?

 

A. parameter file

B. bad file

C. discard file

D. log file

 

정답 : B

-> 오라클메뉴얼 19-53

-> Bad File Reasons Records are Rejected

1) Invalid Input Format

2) Invalid Row

3) Non-Unique Key Value

4) A Null Required Field

 

문) CONSTRAINTS를 DISBLE후 LOADER를 실행하고 다시 ENABLE시킬때 EXCEPTION이 발생하는

데이터가 저장되는 곳은?

 

정답 : LOG FILE

 

문) SQL*Loader에서 NOT NULL COLUMN에 NULL값을 입력하고자 하여 REJECT된 RECORD는

다음 중 어느 파일에 저장되는가?

 

A. BAD FILE

B. CONTROL FILE

C. DISCARD FILE

D. LOG FILE

 

정답 : A

-> SQL*Loader에서 자료의 값이 잘못된 경우,

예를 들어 잘못된 입력 FORMAT, 잘못된 ROW, UNIQUE KEY FAILURE, NOT NULL값 FAILURE 등의

경우에는 BAD FILE이 저장된다.

WHERE 절에서 걸러진 데이터는 DISCARD FILE에 저장된다.

 

문) SQL*Loader에서 CONTROL FILE에 대한 설명으로 틀린 것은?

 

A. LOAD 되어질 DATA를 기술한다

B. UPPER, LOWER CASE등의 FORMAT에 상관없이 기술한다

C. COMMENT는 DOUBLE DASHES로 시작한다

D. OPTION구를 지정할 수 있으며 LOAD DATA구 다음에 기술한다

 

정답 : D

-> CONTROL 파일은 LOAD 되어질 데이터에 대한 정보를 기술하는 파일이다.

따라서 파일에서의 데이터와 테이블에서의 COLUMN과의 관계를 정의한다.

이 파일은 COMMENT, OPTION, LOAD COMMAND등의 세가지 형태의 COMMAND로 구성되는데

반드시 COMMENT와 OPTION은 LOAD 문보다 앞에 와야 한다.

 

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

* 20. IMPORT / EXPORT *

* *

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

 

문) 다음 중 export에 대한 설명으로 틀린 것을 고르시오.

 

A. 전체 database를 export 할 수 있다.

B. 각 user별로 export 할 수 있다.

C. 특정 user의 table 단위로도 export 할 수 있다.

D. 특정 tablespace 단위로도 가능하다.

 

정답 : D

 

문) object 생성 문장에서 나는 오류를 무시하기 위한 import 옵션은?

 

A. show

B. ignore

C. inctype

D. parfile

 

정답 : B

[Top]
No.
제목
작성자
작성일
조회
9021Pro*C 란? (I)
정재익
2001-12-25
8202
9020오라클 8i Admin 한글 교본
정재익
2001-12-25
4928
9004OCP 문제 - ADMIN 파트 (4)
정재익
2001-12-23
7923
9003OCP 문제 - ADMIN 파트 (2)
정재익
2001-12-23
12631
9002OCP 문제 - Admin 파트 (3)
정재익
2001-12-23
6714
9001OCP 문제 - ADMIN 파트 (1)
정재익
2001-12-23
14057
9000Oracle Library Cache and Dictionary Cache
정재익
2001-12-23
5629
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.051초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다