Sunteți pe pagina 1din 31

1

In d c n tro u tio to th O c e ra le S rv r e e T c n lo i eho g e s

CERTIFICATION OBJECTIVES
1.01 R ole 1.02 1.03 Position the O racle Product Fam ily Explain R elational Structures U nderstand the SQ Language L 1.04 Appreciate the D As B

Tw o-M inute D rill Self Test

Q A &

C hap ter 1 :

In trod uction to the O racle S erver Technolog ies

his chapter describes the entire O racle product fam ily, the concepts behind relational databases, the SQ language, and the role of the L database adm inistrator (D BA) in the IT environm ent. The content is not directly tested in the O P exam C ination, but it is assum know ed ledge that provides an essential background to the study of O racle database adm inistration. It also gives an idea of the scope of a D BAs w ork. The D is often expected to BA know everything about everything. W ell, that isnt possible but at least he/she should be aw are of the w hole environm ent and how the parts link together.

C opyright here for term of use. s

T h e O r a c le s e r v e r t e c h n o lo g ie s p r o d u c t s e t is m o r e t h a n a d a t a b a s e . T h e E n te r p r is e M a n a g e r . T a k e n t o g e t h e r , t h e s e a r e th e s e r v e r t e c h n o lo g ie s th a t e m e r g in g e n v ir o n m e n t f o r m a n a g in g t h e c o m p le t e IT e n v ir o n m e n t a n d f o r p r o v id in g r e s o u r c e s t o u s e r s o n d e m a n d . S u p p lie d w it h t h e s e r v e r t e c h n o lo g ie s a r e t h e d e v e lo p m e n t t o o ls : t h ir d -g e t o o ls . It is a ls o p o s s ib le t o w r it e s o f t w a r e in a w id e r a n g e o f t h ir d - p a r t y a p p lic a t io n d e v e lo p m e n t e n v ir in t e r n a t io n a l s t a n d a r d s f o r d a t a p r o c e s s in g , w h ic h m e a n s t h a t it is p e r f e c t ly p o s s ib le t o r u n t h ir d - p a p r o d u c ts o n th e O r a c le t e c h n o lo g y s ta c k . T h e f in a l p a r t o f t h e O r a c le p r o d u c t s e t is t h e a p p lic a t io n s , p r im a r ily t T h e s e a r e a p p lic a t io n s w r it t e n w it h t h e O r a c le d e v e lo p m e n t t o o ls a n d r u n n o r g a n iz a t io n f o r b u s in e s s d a t a p r o c e s s in g . T h e O r a c le d a t a b a s e is a r e la t io n a l d a t a b a s e m a n a g e m e n t s y s t e m ( R D B M w it h o b je c t e x t e n s io n s . D a t a t o b e m a n a g e d b y a n R D B M S s h o u ld b e n o r m a c o n v e rte d in t o t w o - d im e n s io n a l t a b le s . S tru c tu re d s e q u e l ) is an in t e r n a t io n a l sta n d a rd fo r m anag O r a c le D a ta b a se 11g o ffe rs an im p le m e n t a t io n w ith th e c u rre n t s ta n d a rd , w h ic h is S Q L -2 0 0 3 . fo u n d in A p p e n d ix B of th e S Q L R e fe re n c e , d o c u m e n ta tio n s e t. T h e D B A s jo b is t o a d m in is t e r t h e d a t a b a s e . B u t t h is t a u t o lo g ic a l d e f in it io a h u g e a m o u n t . T h e D B A h a s a p iv o t a l r o le in a n o r g a n iz a t io n s m a n a g e m e k n o w le d g e s t r u c t u r e ; h e /s h e w ill u s u a lly b e e x p e c t e d t o b e c o m p e t e n t in a l d e a lt w ith h e r e . T h is c h a p t e r c o n s is t s o f s u m m a r iz e d d e s c r ip t io n s o f t h e O r a c le p r o d u c t th e 2008 by The M raw ill C panies, Inc. C cG -H om lick

n o r m a liz a t io n o f d a t a in t o r e la t io n a l s t r u c t u r e s , t h e S Q L la n g u a g e , a n d t h e

P sitio th O cle Pro u o n e ra d ct F m a ily

CERTIFICATION OBJECTIVE 1.01

Position the Oracle Product Family


T h e r e a r e m a n y p r o d u c t s d e v e lo p e d a n d m a r k e t e d b y O r a c le C o r p o r a t s u b s t a n t ia lly . T h e c o r e p r o d u c t s c a n b e g r o u p e d a s f o llo w s : T h e s e r v e r t e c h n o lo g ie s
T h e O r a c le d a t a b a s e

The

O r a c le

A p p lic a t io n

S e rve r

T h e O r a c le E n t e r p r is e M a n a g e r

T h e d e v e lo p m e n t t o o ls
T h e la n g u a g e s T h e O r a c le D e v e lo p e r S u ite

T h e a p p lic a t io n s
O r a c le E - B u s in e s s S u it e O r a c le C o lla b o r a t io n S u it e

The Server Technologies

T h e re is a f a m ily of p ro d u c ts th a t m ake up t o g e t h e r , t h e y a im t o d e liv e r t h e c o m p o n e n t s o f O r a c le s G r id c o m p u t in g a r Oracle Corporations Grid offering is not always the same as the Grid defined by others. Oracle does tend to emphasize the server technology side of Grid computing.

T h e c o n c e p t u n d e r ly in g t h e G r id is v ir t u a liz a t io n : e n d u s e r s a s k f o r a s e r v t h e y n e it h e r k n o w n o r n e e d t o k n o w t h e s o u r c e o f t h a t s e r v ic e . T h e t h r e e s e r v e r t e c h n o lo g ie s t h a t O r a c le p r o v id e s t o h e lp d e liv e r t h e G r
T h e O r a c le D a t a b a s e S e r v e r

The

O r a c le

A p p lic a t io n

S e rve r

T h e O r a c le E n t e r p r is e M a n a g e r

C hap ter 1 :

In trod uction to the O racle S erver Technolog ies

T h e d a t a b a s e is t h e m a in c o n c e r n h e r e : it is t h e r e p o s it o r y f o r d a t a a n d t t h a t m a n a g e s a c c e s s t o t h e d a t a . T h e O r a c le A p p lic a t io n S e r v e r r u n s s o f t w a b e h a lf o f e n d u s e r s : it g e n e r a t e s t h e u s e r in t e r f a c e s in t h e f o r m o f w in d o w s u s e r s b r o w s e r s , a n d s u b m it s c a lls f o r d a t a r e t r ie v a l a n d m o d if ic a t io n t o t h e e x e c u t io n . T h e O r a c le E n t e r p r is e M a n a g e r is a n a d m in is t r a t io n t o o l f o r m o n m a n a g in g , a n d t u n in g t h e O r a c le p r o c e s s e s a n d a ls o ( t h r o u g h p lu g -in s ) m a p a rty p ro d u c ts .

The Oracle Database Server

C h a p te r 2 d e a ls w it h th e a r c h it e c t u r e of th e now , a ll th a t is n e c e s s a ry is to know th a t it lim it s on s iz e , and th a t is accessed by end to o ls and a p p lic a t io n s or in d ir e c t ly th ro u g h a s e rv e r. T h e c h o ic e b e t w e e n a t w o - t ie r c lie n t - s e r v e r a r c h it e c t u r e a n d a n a r c h it e c t d a t a b a s e : it c a n e x e c u t e S Q L in v o k e d b y c lie n t s o f t w a r e r u n n in g o n a P C lo b y a n a p p lic a t io n s e r v e r r u n n in g o n a m id d le -t ie r s e r v e r o n b e h a lf o f a r e m o

The Oracle Application Server

W it h t h e e m e r g e n c e o f t h e W e b a s t h e d e f a c t o s t a n d a r d p la t f o r m f o r d e liv e a p p lic a t io n s to end u se rs has com e th e need s e rv e r r e p la c e s th e c lie n t - s id e s o ftw a re t r a d it io it ru n s a p p lic a t io n s c e n t r a lly , p r e s e n tin g th e m in web b ro w s e rs . The a p p lic a t io n s m ake use of s e rv e rs . O r a c le A p p lic a t io n S e r v e r is a p la t f o r m f o r d e v e lo p in g , d e p lo y in g , a n d m a w e b a p p lic a t io n s . A w e b a p p lic a t io n c a n b e d e f in e d a s a n y a p p lic a t io n w it h u s e r s c o m m u n ic a t e v ia H T T P . W e b a p p lic a t io n s u s u a lly r u n in a t le a s t t h r e e d a t a b a s e t ie r m a n a g e s a c c e s s t o t h e d a t a , t h e c lie n t t ie r ( o f t e n im p le m e n t e c o m m u n ic a t io n s w it h t h e u s e r s , a n d a n a p p lic a t io n t ie r in t h e m id d le e x e c u S Q L c a lls t o t h e d a t a b a s e . W e b a p p lic a t io n s c a n b e d e v e lo p e d w it h a n u m b e r o f t e c h n o lo g ie s , p r e d o a m o n g w h ic h t o d a y is Ja v a . A p p lic a t io n s w r it t e n in Ja v a s h o u ld c o n f o r m t o t J2 E E ( Ja v a 2 E n t e r p r is e E d it io n ) s t a n d a r d , w h ic h d e f in e s h o w s u c h a p p lic a t io

P sitio th O cle Pro u o n e ra d ct F m a ily

s h o u ld b e p a c k a g e d a n d d e p lo y e d . J2 E E a n d r e la t e d s t a n d a r d s a r e c o n t r o lle M ic r o s y s t e m s a n d a c c e p t e d b y v ir t u a lly a ll s o f t w a r e d e v e lo p e r s . O r a c le A p p S e r v e r is a J2 E E - c o m p lia n t a p p lic a t io n s e r v e r . O r a c le s im p le m e n t a t io n o f t h s t a n d a r d s a llo w s f o r a u t o m a t ic lo a d b a la n c in g a n d f a u lt t o le r a n c e a c r o s s m a p p lic a t io n s e r v e r s o n m u lt ip le m a c h in e s t h o u g h J2 E E c lu s t e r in g . C lu s t e r in g v ir t u a liz e s t h e p r o v is io n o f t h e a p p lic a t io n s e r v ic e : u s e r s a s k f o r a n a p p lic a t w h ic h m ig h t b e a v a ila b le f r o m a n u m b e r o f lo c a t io n s , a n d t h e c lu s t e r w o r k s w h e r e a n y o n e s e s s io n o r r e q u e s t c a n b e s t b e s e r v ic e d . If o n e lo c a t io n f a ils w ill t a k e u p t h e lo a d , a n d m o r e r e s o u r c e s c a n b e m a d e a v a ila b le t o a n a p p l a s n e c e s s a r y . T h e a b ilit y t o s e p a r a t e t h e r e q u e s t f o r a s e r v ic e f r o m t h e lo c a p r o v is io n a n d t o a d d o r r e m o v e J2 E E s e r v e r s f r o m a c lu s t e r d y n a m ic a lly is a p a r t o f t h e O r a c le A p p lic a t io n S e r v e r s c o n t r ib u t io n t o t h e G r id . It is im p o r t a n t t o n o t e t h a t O r a c le s c o m m it m e n t t o in t e r n a t io n a l s t a n d a r is t o t a l. A p p lic a t io n s r u n n in g in t h e O r a c le A p p lic a t io n S e r v e r e n v ir o n m e n t c a n c o n n e c t t o a n y d a t a b a s e s f o r w h ic h t h e r e a r e Ja v a - c o m p lia n t d r iv e r s : it n o t n e c e s s a r y t o u s e a n O r a c le d a t a b a s e . A p p lic a t io n s d e v e lo p e d w it h t h e O A p p lic a t io n S e r v e r t o o lk it s c o u ld b e d e p lo y e d t o a t h ir d - p a r t y J2 E E - c o m p lia n a p p lic a t io n s e r v e r . H o w e v e r , t h e O r a c le p r o d u c t s e t is p a r t ic u la r ly p o w e r f u l o fte n b e th e b e s t c h o ic e . The s im p le s t p r o c e s s in g m odel of web a p p lic a t io m anages th e u ser in t e r f a c e , a m id d le tie r th a t s ta te m e n ts to th e d a ta t ie r , and a d a ta tie r th e n v ir o n m e n t , th e c lie n t tie r w ill be a b ro w s e r E x p lo r e r ) th a t h a n d le s lo c a l w in d o w m anagem en t r a c k s m o u s e m o v e m e n t s . T h e m id d le t ie r w ill b e a n O r a c le A p p lic a t io n S e r r u n n in g t h e s o f t w a r e ( p r o b a b ly w r it t e n in Ja v a ) t h a t is g e n e r a t in g t h e w in d o s e n t t o t h e c lie n t t ie r f o r d is p la y , a n d t h e S Q L s t a t e m e n t s s e n t t o t h e d a t a t e x e c u t io n . T h e d a t a t ie r w ill b e a n O r a c le s e r v e r : a n in s t a n c e a n d a d a t a b a s t h r e e - t ie r e n v ir o n m e n t , t h e r e a r e t w o t y p e s o f s e s s io n : e n d -u s e r s e s s io n s f r c lie n t t ie r t o t h e m id d le t ie r , a n d d a t a b a s e s e s s io n s f r o m t h e m id d le t ie r t o t ie r . T h e e n d -u s e r s e s s io n s w ill b e e s t a b lis h e d w it h H T T P . T h e d a t a b a s e s e s c lie n t - s e r v e r s e s s io n s c o n s is t in g o f a u s e r p r o c e s s a n d a s e r v e r p r o c e s s , a s t h e p r e c e d in g s e c t io n . It is p o s s ib le f o r a n a p p lic a t io n t o u s e a o n e - f o r - o n e m a p p in g o f e n d -u s e r t o d a t a b a s e s e s s io n : e a c h u s e r , f r o m h is / h e r b r o w s e r , w ill e s t a b lis h a s e s s io t h e a p p lic a t io n s e r v e r , a n d t h e a p p lic a t io n s e r v e r w ill t h e n e s t a b lis h a s e s s i t h e d a t a b a s e s e r v e r o n t h e u s e r s b e h a lf . H o w e v e r , t h is m o d e l h a s b e e n p r o b e v e r y in e f f ic ie n t w h e n c o m p a r e d t o t h e c o n n e c t io n p o o lin g m o d e l. W it h c

C hap ter 1 :

In trod uction to the O racle S erver Technolog ies

p o o lin g , t h e a p p lic a t io n s e r v e r e s t a b lis h e s a r e la t iv e ly s m a ll n u m b e r o f p e r s d a t a b a s e s e s s io n s a n d m a k e s t h e m a v a ila b le o n d e m a n d ( q u e u in g r e q u e s t a g a in s t th e a p p lic a t io n s e r v e r . F r o m t h e p o in t o f v ie w o f t h e d a t a b a s e , it m a k e s n o d if f e r e n c e w h e t h e r a s t a t e m e n t c o m e s f r o m a c lie n t - s id e p r o c e s s s u c h a s S Q L * P lu s o r M ic r o s o f t A fo rm e r c a s e , th e u s e r p ro c e s s a ll h a p p e n s o n o n e m a c h in e ; in t h e la t t e r , t h e u s e r p r o c e s s h a s b e e n d iv id e t w o t ie r s : a n a p p lic a t io n s t ie r t h a t g e n e r a t e s t h e u s e r in t e r f a c e a n d a c lie n t DBAs often find themselves pressed into service as Application Server administrators. Be prepared for this. There is a separate OCP curriculum for Application Server, for which it may well be worth studying.

Oracle Enterprise Manager


T h e in c r e a s in g s iz e a n d c o m s u r p r is in g : n o o n e e v e r s a id e a s ie r , a n d th e m a n a g e m e n t O r a c le E n t e r p r is e M a n a g e r
D a ta b a s e C o n tro l A p p l i c a t i o n S r G e ird C Co on nt r r ol l e v r to

p le x it y o f IT in s t a lla t io n s m a k e s m a n a g e m e t h a t m a n a g in g a p o w e r f u l e n v ir o n m e n t s h o u s ta ff m o r e p r o d u c tiv e . c o m e s in th r e e fo r m s :

O r a c le E n t e r p r is e M a n a g e r D a t a b a s e C o n t r o l is a g r a p h ic a l t o o l f o r m a n a o n e d a t a b a s e , w h ic h m a y b e a R e a l A p p lic a t io n C lu s t e r s ( R A C ) c lu s t e r e d d a th e y a r e m e n tio n e d h e r e b e c a u s e t h e y c a n b e m a n a g e d t h r o u g h t h e t o o l. D a t a b a s e C o n t r o l h a s f a c il s c h e d u le d jo b s s u c h a s b a c k u p o p e r a t io n s , a n d f o r r e p o r t in g a le r t c o n d it io n D a t a b a s e C o n t r o l p r o c e s s r u n n in g o n e a c h n o d e w h e r e t h e r e is a d a t a b a s e e a c h h a s a c o m p le t e p ic t u r e o f t h e s t a t e o f t h e R A C . O r a c le E n t e r p r is e M anager A p p lic a t io n S e rv e r C m a n a g in g one a p p lic a t io n s e rv e r in s ta n c e , or a te c h n o lo g y is dependent on th e v e r s io n . Up S e r v e r 1 0 g r e le a s e 2 , m u lt ip le a p p lic a t io n s e r v e r s w e r e m a n a g e d a s a f a r m

P sitio th O cle Pro u o n e ra d ct F m a ily

a m e t a d a t a r e p o s it o r y ( t y p ic a lly r e s id in g in a n O r a c le d a t a b a s e ) a s t h e c e n m a n a g e m e n t p o in t . T h is is a n e x c e lle n t m a n a g e m e n t m o d e l a n d o f f e r s s u p c a p a b ilit ie s f o r d e p lo y in g a n d m a in t a in in g a p p lic a t io n s , b u t it is p r o p r ie t a r y O r a c le . F r o m A p p lic a t io n S e r v e r 1 0 g r e le a s e 3 o n w a r d , t h e t e c h n o lo g y is b a B o t h D a t a b a s e C o n t r o l a n d A p p lic a t io n S e r v e r C o n t r o l c o n s is t o f a Ja v a p r r u n n in g o n t h e s e r v e r m a c h in e , w h ic h lis t e n s f o r H T T P a n d H T T P S c o n n e c t io r e q u e s t s . A d m in is t r a t o r s c o n n e c t t o t h e s e p r o c e s s e s f r o m a b r o w s e r . D a t a b C o n t r o l t h e n c o n n e c t s t o t h e lo c a l d a t a b a s e s e r v e r , a n d A p p lic a t io n S e r v e r c o n n e c t s t o t h e lo c a l a p p lic a t io n s e r v e r . A n a d v a n t a g e o f u s in g b r o w s e r a c c r e m o t e m a n a g e m e n t s h o u ld b e n o p r o b le m . M o s t , t h o u g h n a t u r a lly n o t a ll, p e r m it in c o m in g H T T P o r H T T P S c o n n e c t io n s t h r o u g h t h e ir f ir e w a lls . O r a c le E n t e r p r is e M a n a g e r G r id C o n t r o l g lo b a liz e s t h e m a n a g e m e n t e n v i A m a n a g e m e n t r e p o s it o r y ( r e s id in g in a n O r a c le d a t a b a s e ) a n d o n e o r m o r e m a n a g e m e n t s e r v e r s m a n a g e t h e c o m p le t e e n v ir o n m e n t : a ll t h e d a t a b a s e s a p p lic a t io n s e r v e r s , w h e r e v e r t h e y m a y b e . G r id C o n t r o l c a n a ls o m a n a g e t o r m a c h in e s , o n w h ic h t h e s e r v e r s r u n , a n d ( t h r o u g h p lu g - in s ) a w id e r a n g e p a r t y p r o d u c t s . E a c h m a n a g e d n o d e r u n s a n a g e n t p r o c e s s , w h ic h is r e s p o n m o n it o r in g t h e m a n a g e d t a r g e t s o n t h e n o d e : e x e c u t in g jo b s a g a in s t t h e m s t a t u s , a c t iv it y le v e ls , a n d a le r t c o n d it io n s b a c k t o t h e m a n a g e m e n t s e r v e r G r id C o n t r o l g iv e s a h o lis t ic v ie w o f t h e e n v ir o n m e n t , a n d if w e ll c o n f ig u r m a k e s a d m in is t r a t io n s t a ff fa r m o r e p r o d u c t iv e th a n w ith o u t . It b e c o m e s p o fo r o n e a d m in is t r a t o r to m a n a g e e ffe c tiv e ly h u n d r e d s o r t h o u s a n d s o f ta r g e c o m m u n ic a t io n s a r e o v e r H T T P o r H T T P S . P r o v id e d t h e c o r p o r a t e f ir e w a lls a c o n f ig u r e d t o p e r m it t h e s e p r o t o c o ls , it b e c o m e s p o s s ib le f o r t h e a d m in is t r a s t a f f t o c o n n e c t t o t h e m a n a g e m e n t s e r v e r s f r o m a n y lo c a t io n t h a t h a s a b r F u r t h e r m o r e , t h e c o m m u n ic a t io n s b e t w e e n t h e a g e n t s r u n n in g o n t h e v a r io a n d t h e m a n a g e m e n t s e r v e r ( s ) a r e a ls o H T T P o r H T T P S , s o a n o r g a n iz a t io n c o m p le t e e n v ir o n m e n t e v e n if s p r e a d o v e r m a n y g e o g r a p h ic a lly s e p a r a t e u s in g t h e In t e r n e t f o r in t e r - s it e c o m m u n ic a t io n s c a n b e m a n a g e d a s a w h o T h e c o r e f u n c t io n a lit y o f O r a c le E n t e r p r is e M a n a g e r ( O E M ) is a v a ila b le f o a d d it io n a l c h a r g e it is b u n d le d w it h t h e d a t a b a s e o r a p p lic a t io n s e r v e r lic e T h e r e a r e , h o w e v e r , a d d it io n a l p a c k s t h a t a r e s e p a r a t e ly lic e n s e d . T h e p a c k f o r t h e m o s t p a r t o f w iz a r d s t h a t m a k e t h e w o r k o f m o n it o r in g , t u n in g , a n d m a n a g e m e n t e a s ie r . S o m e D B A s m a k e e x t e n s iv e u s e o f O r a c le E n t e r p r is e M a n d r e ly o n t h e p a c k s . O t h e r s ( p e r h a p s t h e o ld e r o n e s ) s t ill p r e f e r t o w o r k w c o m m a n d - lin e u t ilit ie s s u c h a s S Q L * P lu s . T h e r e is lit t le d o u b t t h a t u s in g O r a E n t e r p r is e M a n a g e r c a n m a k e a D B A f a r m o r e p r o d u c t iv e , b u t it is b y n o m e c o m p u ls o r y .

C hap ter 1 :

In trod uction to the O racle S erver Technolog ies

Anything that can be donethe use of SQL for administration work with OEM can also be done through SQL extensively. It is vital to be familiar with statements. The OCP examinations test command-line techniques.

Grid Computing

C r it ic a l t o t h e c o n c e p t o f G r id c o m p u t in g is v ir t u a liz a t io n . T h is m e a n s t h a t a le v e ls t h e r e is a la y e r o f a b s t r a c t io n b e t w e e n w h a t is r e q u e s t e d a n d w h a t is In t h e O r a c le G r id e n v ir o n m e n t , e n d u s e r s a s k f o r a n a p p lic a t io n s e r v ic e a n t h e G r id w o r k o u t w h ic h c lu s t e r e d J2 E E a p p lic a t io n s e r v e r c a n b e s t p r o v id e A p p lic a t io n s e r v e r s a s k f o r d a t a b a s e s e r v ic e f r o m a n R A C d a t a b a s e a n d le t w o r k o u t f r o m w h ic h R A C in s t a n c e t h e d a t a s e r v ic e c a n b e s t b e p r o v id e d . W t h e G r id t h e r e is a m a p p in g o f p o s s ib le s e r v ic e s t o a v a ila b le s e r v ic e p r o v id e a lg o r it h m s f o r a s s ig n in g t h e w o r k lo a d a n d r e s o u r c e s a p p r o p r ia t e ly . T h e r e s t h a t e n d u s e r s h a v e n e it h e r t h e n e e d n o r t h e c a p a c it y t o k n o w f r o m w h e r e c o m p u t in g r e s o u r c e s a r e a c t u a lly b e in g p r o v id e d . T h e a n a lo g y o f t e n d r a w n d e liv e r y o f d o m e s t ic e le c t r ic it y : it is s u p p lie d o n d e m a n d , a n d t h e h o m e o w n o w a y o f t e llin g w h ic h p o w e r s t a t io n is c u r r e n t ly s u p p ly in g h im / h e r . T h e G r id is n o t e x c lu s iv e t o O r a c le . A t t h e p h y s ic a l le v e l, s o m e o p e r a t in g s y s t e m a n d h a r d w a r e v e n d o r s a r e p r o v id in g G r id - lik e c a p a b ilit ie s . T h e s e in c t h e a b ilit y t o p a r t it io n s e r v e r s in t o v ir t u a l m a c h in e s , a n d d y n a m ic a lly a d d o r e m o v e C P U (s ) a n d R A M fr o m th e v ir t u a l m a c h in e s a c c o r d in g t o d e m a n d . T is c o n c e p t u a lly s im ila r t o O r a c le s a p p r o a c h o f d y n a m ic a lly a s s ig n in g a p p lic s e r v e r a n d d a t a b a s e s e r v e r r e s o u r c e s t o lo g ic a l s e r v ic e s . T h e r e is n o r e a s o n a p p r o a c h e s c a n n o t b e c o m b in e d . B o th a r e w o r k in g t o w a r d th e s a m e g o a l a t o g e t h e r . T h e r e s u lt s h o u ld b e a n e n v ir o n m e n t w h e r e a d e q u a t e r e s o u r c e s a a v a ila b le o n d e m a n d , w it h o u t f a c in g t h e is s u e s o f e x c e s s c a p a c it y a t s o m e u n d e r p e r f o r m a n c e a t o t h e r s . It s h o u ld a ls o b e p o s s ib le t o d e s ig n a G r id e n v w it h n o s in g le p o in t o f f a ilu r e , t h u s a c h ie v in g t h e g o a l o f 1 0 0 p e r c e n t u p t im b e in g d e m a n d e d b y m a n y u s e r s .

The Development Tools and Languages


T h e O r a c le s e r v e r t e c h n o lo g ie s in c lu d e v a r io u s f a c ilit ie s f o r d e v e lo p in g a p p

P sitio th O cle Pro u o n e ra d ct F m a ily

W i t h i n t h e d a t a b a s e , i t i s p o s si b Sl eQ tL o u s e t h r e e l a n g u a g e s :
P L /S Q L Ja v a

A p p lic a t io n s r u n n in g e x t e r n a lly t o t h e d a t a b a s e c a n b e w r it t e n in a w id e O r a c le A p p lic a t io n S e r v e r . P r e d o m in a n t a m o n g t h e s e a r e


F o rm s R e p o rts X M L P u b lis h e r D is c o v e r e r

T h e r e is a ls o a w id e v a r ie t y o f t h ir d - p a r t y t o o ls a n d e n v ir o n m e n t s t h a t c a f o r d e v e lo p in g a p p lic a t io n s t h a t w ill c o n n e c t t o a n O r a c le d a t a b a s e ; in p a r t i .N E T f r o m M ic r o s o f t , f o r w h ic h O r a c le p r o v id e s a c o m p r e h e n s iv e d e v e lo p e r s

Languages Internal to the Database

T h e o n e la n g u a g e t h a t is u n a v o id a b le is S Q L . S Q L is u s e d f o r d a t a a c c e s s , b c a n n o t b e u s e d ju s t o n it s o w n f o r d e v e lo p in g c o m p le t e a p p lic a t io n s . It h a s f a c ilit ie s f o r d e v e lo p in g u s e r in t e r f a c e s , a n d it a ls o la c k s t h e p r o c e d u r a l s t r u n e e d e d f o r m a n ip u la t in g r o w s in d iv id u a lly . T h e o t h e r t w o la n g u a g e s a v a ila b t h e d a t a b a s e f ill t h e s e g a p s . T h e y a r e P L /S Q L a n d Ja v a . P L /S Q L is a 3 G L p r o t o O r a c le . It h a s t h e u s u a l p r o c e d u r a l c o n s t r u c t s ( s u c h a s c o n d it io n a l b r a n c b a s e d o n if - t h e n -e ls e a n d it e r a t iv e lo o p in g ) a n d f a c ilit ie s f o r u s e r in t e r f a c e d In t h e P L / S Q L c o d e , o n e c a n e m b e d c a lls t o S Q L . T h u s , a P L / S Q L a p p lic a t io n m ig h t u s e S Q L t o r e t r ie v e o n e o r m o r e r o w s f r o m t h e d a t a b a s e , t h e n p e r f o r a c t io n s b a s e d o n t h e ir c o n t e n t , a n d t h e n is s u e m o r e S Q L t o w r it e r o w s b a c k d a t a b a s e . Ja v a o f f e r s a s im ila r c a p a b ilit y t o e m b e d S Q L c a lls w it h in t h e Ja v a T h is is in d u s t r y - s t a n d a r d t e c h n o lo g y : a n y Ja v a p r o g r a m m e r s h o u ld b e a b le t h a t w ill w o r k w it h a n O r a c le d a t a b a s e ( o r in d e e d w it h a n y o t h e r Ja v a - c o m p d a t a b a s e .) A ll O r a c le D B A s m u s t b e f u lly c o m p e t e n t w it h S Q L a n d P L /S Q L . T h is is a s s K n o w le d g e of Ja v a is not assum ed and in d e e d f o r t h is is t h a t b e s p o k e Ja v a a p p lic a t io n s a r e n o w r a r e ly r u n w it h in t h e d a t a

10

C hapter 1:

Introduction to the O racle Server Technologies

E a r ly r e le a s e s o f O r a c le s a p p lic a t io n s e r v e r c o u ld n o t r u n s o m e o f t h e in d u s t a n d a r d Ja v a a p p lic a t io n c o m p o n e n t s , s u c h a s Ja v a s e r v le t s a n d E n t e r p r is e Ja v a B e a n s ( E JB s ) . T o g e t a r o u n d t h is s e r io u s d iv e r g e n c e f r o m s t a n d a r d s , O r im p le m e n t e d a Ja v a e n g in e w it h in t h e d a t a b a s e t h a t d id c o n f o r m t o t h e s t a H o w e v e r , f r o m O r a c le A p p lic a t io n S e r v e r r e le a s e 9 i, it h a s b e e n p o s s ib le t o s e r v le t s a n d E JB s w h e r e t h e y s h o u ld b e r u n : o n t h e a p p lic a t io n s e r v e r m id d B e c a u s e o f t h is , it is b e c o m in g le s s c o m m o n t o r u n Ja v a w it h in t h e d a t a b a s e S o m e O r a c le c o m p o n e n t s , s u c h a s In t e r m e d ia a n d T e x t , a r e w r it t e n in Ja v f o r t h is r e a s o n a D B A w ill u s u a lly n e e d t o e n a b le Ja v a in t h e d a t a b a s e , b u t h w ill n o t b e e x p e c t e d t o t u n e o r d e b u g t h e s e . T h e D B A is , h o w e v e r , lik e ly t o la r g e a m o u n t o f t im e t u n in g a n d d e b u g g in g S Q L a n d P L / S Q L . O r a c le s m o d e d iv is io n o f r e s p o n s ib ilit y h e r e is c le a r : t h e D B A id e n t if ie s c o d e w it h p r o b le m p a s s e s it t o t h e d e v e lo p e r s f o r f ix in g . B u t in m a n y c a s e s , t h e d e v e lo p e r s la c s k ills ( o r p e r h a p s t h e in c lin a t io n ) t o d o t h is a n d t h e D B A h a s t o f ill t h is r o le . w ill a ls o o f t e n b e c o m e a t e a c h e r : s p r e a d in g k n o w le d g e o f b e t t e r t e c h n iq u e t h e d e v e lo p e r s . All DBAs must be fully competent with SQL and with PL/SQL. Knowledge of Java and other languages is not usually required but is often helpful.

Languages External to the Database

O t h e r la n g u a g e s a r e a v a ila b le f o r d e v e lo p in g c lie n t - s e r v e r a p p lic a t io n s t h a t C a n d Ja v a , b u t it is p o s s ib le t o u s e m o s t o f t h e m a in s t r e a m 3 G L s . F o r m o s t lib r a r ie s t h a t le t c o d e w r it t e n in t h e s e la n g u a g e s c o n n e c t t o a n O r a c le d a t a A p p lic a t io n s w r it t e n in C o r o t h e r p r o c e d u r a l la n g u a g e s m a k e u s e o f t h e O lib r a r ie s t o e s t a b lis h s e s s io n s a g a in s t t h e d a t a b a s e s e r v e r . T h e s e lib r a r ie s a w ill b e s p e c if ic a lly w r it t e n f o r O r a c le , a n d w o u ld h a v e t o b e s u b s t a n t ia lly r e w r it t e n b e f o r e it c o u ld r u n a g a p r o b le m . O r a c le p r o v id e s d a t a b a s e c o n n e c t iv it y f o r b o t h t h ic k a n d t h in Ja v a A t h ic k Ja v a c lie n t is O r a c le a w a r e . It u s e s t h e s u p p lie d O C I c la s s lib r a r y t t o t h e d a t a b a s e . T h is m e a n s t h a t t h e a p p lic a t io n c a n m a k e u s e o f a ll t h e d a c a p a b ilit ie s , in c lu d in g f e a t u r e s t h a t a r e u n iq u e t o t h e O r a c le e n v ir o n m e n t . J c lie n t a p p lic a t io n s c a n e x p lo it t h e d a t a b a s e t o t h e f u ll. B u t t h e y c a n n e v e r w t h ir d - p a r t y p r o d u c t , a n d t h e y r e q u ir e t h e O C I c lie n t s o f t w a r e t o b e in s t a lle d

P sitio th O c o n e ra le P d ct F m ro u a ily

11

A t h in Ja v a c lie n t is n o t a w a r e o f t h e d a t a b a s e a g a in s t w h ic h it is r u n n in g w it h a v ir t u a l d a t a b a s e d e f in e d a c c o r d in g t o t h e Ja v a s t a n d a r d , a n d it le t s t w it h in w h ic h it is r u n n in g m a p t h is v ir t u a l d a t a b a s e o n t o t h e O r a c le d a t a b a s g iv e s t h e a p p lic a t io n p o r t a b ilit y a c r o s s d a t a b a s e v e r s io n s a n d p r o v id e r s : a c lie n t a p p lic a t io n c o u ld b e d e p lo y e d in a n o n - O r a c le e n v ir o n m e n t w it h o u t a c h a n g e s . B u t a n y O r a c le f e a t u r e s t h a t a r e n o t p a r t o f t h e Ja v a d a t a b a s e c o n s t a n d a r d w ill n o t b e a v a ila b le . T h e c h o ic e b e t w e e n t h ic k a n d t h in Ja v a c lie n t s s h o u ld b e m a d e b y a t e a m in f o r m e d in d iv id u a ls a n d in f lu e n c e d b y a n u m b e r o f f a c t o r s in c lu d in g p e r f o r s t a n d a r d s , a p p lic a t io n p o r t a b ilit y , p r o g r a m m e r p r o d u c t iv it y . O r a c le s JD e v e Ja v a a p p lic a t io n s .

Oracle Developer Suite

M a n y o r g a n iz a t io n s w ill n o t w a n t t o u s e a 3 G L t o d e v e lo p d a t a b a s e a p p lic a t O r a c le C o r p o r a t io n p r o v id e s r a p id a p p lic a t io n d e v e lo p m e n t t o o ls a s p a r t o f O r a c le D e v e lo p e r S u ite . T h e s e c a n m a k e p r o g r a m m e r s fa r m o r e p r o d u c t iv e t h e y w e r e w o r k in g w it h a 3 G L . L ik e t h e la n g u a g e s , a ll t h e s e a p p lic a t io n d e v s ta te m e n ts th a t a re s e n t to th e d a t a b a s e s e r v e r fo r e x e c u t io n . O r a c le F o r m s D e v e lo p e r b u ild s a p p lic a t io n s t h a t r u n o n a n O r a c le A p p lic a S e r v e r m id d le t ie r a n d d is p la y in a Ja v a a p p le t o n t h e u s e r s t e r m in a l. T h e e p o in t t o F o r m s a p p lic a t io n s is t h r o u g h a b r o w s e r . F o r m s a p p lic a t io n s a r e g e m u c h f a s t e r t o d e v e lo p t h a n a p p lic a t io n s w r it t e n in , s a y , Ja v a . A n a d v a n t a g u s e r s is t h a t t h e c lie n t - s id e in t e llig e n c e p r o v id e d b y t h e a p p le t m e a n s t h a t a p p lic a t io n s c a n h a v e a b e t t e r u s e r in t e r f a c e t h a n a p p lic a t io n s w it h u s e r in t g e n e r a t e d b y Ja v a s e r v le t s . S e r v le t a p p lic a t io n s a r e r e s t r ic t e d b y t h e lim it a H T M L t a g s , w h e r e a s t h e F o r m s a p p le t c a n g e n e r a t e a n y u s e r in t e r f a c e g a d g m a y b e r e q u ir e d . F o r e x a m p le , t h e r e is n o H T M L t a g f o r a r o llin g c o m b o b o x th e s e a r e n o p r o b le m fo r F o r m s . O r a c le R e p o r t s is a t o o l f o r g e n e r a t in g a n d f o r m a t t in g r e p o r t s , e it h e r o n d o r a c c o r d in g t o a s c h e d u le . C o m p le t e d r e p o r t s c a n b e c a c h e d f o r d is t r ib u t io w it h F o r m s , p r o g r a m m e r p r o d u c t iv it y c a n b e h ig h e r t h a n w h e n w o r k in g w it 3 G L . A n O r a c le R e p o r t s a p p lic a t io n d o e s im p o s e r e s t r ic t io n s o n t h e c lie n t m b e c a u s e o f t h e p o s s ib le o u tp u t fo r m a ts ; t h e s e a r e c o m m o n ly H T M L o r P D F . r e s t r ic t io n s c o m e f r o m t h e n e e d f o r t h e c lie n t t o b e a b le t o d is p la y t h e s e f o t h e n e e d f o r t h e d e v e lo p e r t o b e a w a r e o f t h e c lie n t s c a p a b ilit ie s . X M L P u b

12

C hapter 1:

Introduction to the O racle Server Technologies

a v o id s t h e s e is s u e s b y f o r m a t t in g a r e p o r t s o u t p u t a s X M L t a g s . A n y c lie n t r e q u e s t a n X M L P u b lis h e r r e p o r t a n d ( p r o v id e d it h a s a n X M L p a r s e r ) d i w ir e le s s p r o t o c o ls t o a n y d e v ic e , s u c h a s a c e llu la r t e le p h o n e . O r a c le D is c o v e r e r is a n e n d - u s e r t o o l f o r r e p o r t g e n e r a t io n . O r a c le R e p o r X M L P u b lis h e r n e e d a p r o g r a m m e r t o d e s ig n t h e r e p o r t . A w e ll- d e s ig n e d r e p c a n b e h ig h ly c u s t o m iz a b le b y t h e e n d u s e r t h r o u g h u s e o f p a r a m e t e r s s u p a t r e q u e s t t im e , b u t a p r o g r a m m e r is s t ill n e e d e d t o d e s ig n t h e r e p o r t d e f in O r a c le D is c o v e r e r e m p o w e r s e n d u s e r s t o d e v e lo p r e p o r t s t h e m s e lv e s . O n c m id d le t ie r , h a s b e e n a p p r o p r ia t e ly c o n f ig u r e d , n o m o r e p r o g r a m m e r in p u t is n e e d e d : t h e e n d u s f o r e n d u s e r s , w h ile f r e e in g u p p r o g r a m m in g s t a f f f o r r e a l d e v e lo p m e n t w o r

The Oracle Applications

The num ber of O r a c le a p p lic a t io n s p ro d u c ts y e a rs due to a la r g e num ber of c o rp o ra te p r e d o m in a n t . The O r a c le E - B u s in e s s S u it e is based a ro u n d an a c c o u n tin g e n g in e and O r a c le a u t o m a t io n t o o ls . T h e O r a c le E - B u s in e s s S u it e , b a s e d a r o u n d a c o r e o f f in a n c ia l a p p lic a t io n in c lu d e s f a c ilit ie s f o r a c c o u n t in g , h u m a n r e s o u r c e s , m a n u f a c t u r in g , c u s t o m r e la t io n s h ip m a n a g e m e n t , c u s t o m e r s e r v ic e s , a n d m u c h m o r e . A ll t h e c o m p s h a r e a c o m m o n d a t a m o d e l. T h e c u r r e n t r e le a s e h a s a u s e r in t e r fa c e w r itt w it h O r a c le D e v e lo p e r F o r m s a n d Ja v a , d e p e n d in g o n w h ic h t o o l is m o s t s u i f o r t h e v a r io u s m o d u le s a n d t h e e x p e c t e d u s e r s , r u n n in g o n O r a c le A p p lic a S e r v e r . T h e r e is a la r g e a m o u n t o f P L / S Q L in t h e d a t a b a s e t o e n a b le t h e b u f u n c t io n s . F u t u r e r e le a s e s w ill m e r g e t h e f u n c t io n a lit y o f o t h e r p r o d u c t s a c q r e c e n t ly ( s u c h a s t h e S ie b e l a n d P e o p le s o f t a p p lic a t io n s ) in t o a c o m m o n Ja v b a s e d in t e r f a c e . T h e O r a c le C o lla b o r a t io n S u it e in c lu d e s ( a m o n g o t h e r t h in g s ) s e r v e r s f o r e - m a il, d ia r y m a n a g e m e n t , v o ic e m a il a n d f a x , w e b c o n f e r e n c in g , a n d ( p e r h in t e g r a t io n b e t w e e n t h e v a r io u s c o m p o n e n t s . T h e a p p lic a t io n s r u n o n O r a c l in t e r f a c e f r o m b r o w s e r s o r m a d e a v a ila b le o n m o b ile w ir e le s s d e v ic e s , s u c h a s c e llu la r p h o n e s .

E p in x la R la n l e tio a S c re tru tu s

13

EXERCISE 1-1 Investigate DBMSs in Your Environment

T h is is a p a p e r - b a s e d e x e r c is e , w it h n o s p e c if ic s o lu t io n . Id e n t if y t h e a p p lic a t io n s , a p p lic a t io n s e r v e r s , a n d d a t a b a s e s u s e d in y o u r T h e n , c o n c e n t r a t in g o n t h e d a t a b a s e s , t r y t o g e t a f e e lin g f o r h o w b ig a n d b a r e . C o n s id e r t h e n u m b e r o f u s e r s , t h e v o la t ilit y o f t h e d a t a , a n d t h e d a t a v F in a lly , c o n s id e r h o w c r it ic a l t h e y a r e t o t h e o r g a n iz a t io n : h o w m u c h d o w n t d a t a lo s s c a n b e t o le r a t e d f o r e a c h a p p lic a t io n a n d d a t a b a s e ? Is it p o s s ib le f in a n c ia l f ig u r e o n t h is ? T h e r e s u lt o f t h is s t u d y s h o u ld g iv e a n id e a o f h o w c r it ic a l t h e D B A s r o le

CERTIFICATION OBJECTIVE 1.02

Explain Relational Structures

C r it ic a l t o a n u n d e r s t a n d in g o f S Q L is a n u n d e r s t a n d in g o f t h e r e la t io n a l p a a n d t h e a b ilit y t o n o r m a liz e d a t a in t o r e la t io n a l s t r u c t u r e s . N o r m a liz a t io n is o f s y s te m s a n a ly s t s , a s th e y m o d e l b u s in e s s d a t a in t o a fo r m s u ita b le fo r s t r e la t io n a l t a b le s . It is a s c ie n c e t h a t c a n b e s t u d ie d f o r y e a r s , a n d t h e r e a r e s c h o o ls o f t h o u g h t t h a t h a v e d e v e lo p e d t h e ir o w n m e t h o d s a n d n o t a t io n s .

Rows and Tables

U s in g t h e r e la t io n a l p a r a d ig m , d a t a is s t o r e d in t w o - d im e n s io n a l t a b le s . A t a c o n s is t s of a num ber of ro w s, each c o n s is t in g of th e ro w s have th e sam e c o lu m n s tru c tu re , th o u g som e c o lu m n s m ay have n o t h in g in th e m . An ex o n e s e m p lo y e e s , each e m p lo y e e b e in g re p re s e n te d be e m p lo y e e n u m b e r, nam e, and a code fo r A n y e m p lo y e e s n o t c u r r e n t ly a s s ig n e d t o a d e p a r t m e n t w o u ld h a v e t h a t c o l b la n k . A n o t h e r t a b le c o u ld r e p r e s e n t t h e d e p a r t m e n t s : o n e r o w p e r d e p a d e p a r t m e n t s n a m e .

14

C hapter 1:

Introduction to the O racle Server Technologies

A n o t e o n t e r m in o lo g y : w h a t O r a c le r e f e r s t o a s a t a b le m a y a ls o b e c a lle r e la t io n o r a n e n t it y . R o w s a r e s o m e t im e s c a lle d r e c o r d s o r t u p le s , a n d c o lu c a lle d a t t r ib u t e s o r f ie ld s . T h e n u m b e r o f r o w s in t h e t a b le is t h e c a r d in a lit y R e la t io n a l t a b le s c o n f o r m t o c e r t a in r u le s t h a t c o n s t r a in a n d d e f in e t h e d A t t h e c o lu m n le v e l, e a c h c o lu m n m u s t b e o f a c e r t a in d a t a t y p e , s u c h a s n d a t e - t im e , o r c h a r a c t e r . T h e c h a r a c t e r d a t a t y p e is t h e m o s t g e n e r a l, in t c a n a c c e p t a n y t h in g . A t t h e r o w le v e l, u s u a lly e a c h r o w m u s t h a v e s o m e u n id e n t if y in g c h a r a c t e r is t ic : t h is c o u ld b e t h e v a lu e o f o n e c o lu m n , s u c h a s t h e m p lo y e e n u m b e r a n d d e p a r t m e n t n u m b e r in t h e e x a m p le s ju s t g iv e n , t h a t b e r e p e a t e d in d if f e r e n t r o w s . T h e r e m a y a ls o b e r u le s t h a t d e f in e lin k s b e t t a b le s , s u c h a s a r u le t h a t e v e r y e m p lo y e e m u s t b e a s s ig n e d a d e p a r t m e n t c a n b e m a t c h e d t o a r o w in t h e d e p a r t m e n t s t a b le . F o llo w in g a r e e x a m p le s t a b u la t e d d a t a d e fin itio n s . D e p a r t m e n t s ta b le :


C o lu m n N a m e
D EPTN O DNAM E

D e s c r ip t io n

D a ta T y p e
N u m e r ic

Le n g th
2 14

D e p a rtm e n t n u m b e r

D e p a rtm e n t n a m e C h a ra c te r

E m p lo y e e s t a b le :
C o lu m n N a m e
EM PN O ENAM E D EPTN O

D e s c r ip t io n
E m p lo y e e n a m e

D a ta T y p e
C h a ra cte r N u m e r ic

Le n g th
4 10 2

E m p lo y e e n u m b e r N u m e r ic D e p a rtm e n t n u m b e r

T h e t a b le s c o u ld c o n t a in t h e r o w s s h o w n n e x t . D e p a rtm e n ts :
D EPTN O
10 20 30 40

DNAM E
A C C O U N T IN G RESEARCH SALES O P E R A T IO N S

E p in x la R la n l e tio a S c re tru tu s

15

E m p lo y e e s :
EM O PN
7369 7499 7521 7566 7654 7698 7782 7788

ENAM E
S M IT H ALLEN W ARD JO N E S M A R T IN BLAKE CLARK SCOTT

DP N ET O
20 30 30 20 30 30 10 20

L o o k in g a t t h e t a b le s , t h e t w o - d im e n s io n a l s t r u c t u r e is c le a r . E a c h r o w is le n g t h , e a c h c o lu m n is o f f ix e d le n g t h ( p a d d e d w it h s p a c e s w h e n n e c e s s a r y r o w s a r e d e lim it e d w it h a n e w lin e . T h e r o w s h a v e b e e n s t o r e d in c o d e o r d e w o u ld b e a m a t t e r o f c h a n c e , n o t d e s ig n ; r e la t io n a l t a b le s d o n o t im p o s e a n o r d e r in g o n t h e ir r o w s . D e p a r t m e n t n u m b e r 1 0 h a s o n e e m p lo y e e , a n d d e p n u m b e r 4 0 h a s n o n e . C h a n g e s t o d a t a a r e u s u a lly v e r y e f f ic ie n t w it h t h e r e m o d e l. N e w e m p lo y e e s c a n b e a p p e n d e d t o t h e e m p lo y e e s t a b le , o r t h e y c f r o m o n e d e p a r t m e n t t o a n o t h e r s im p ly b y c h a n g in g t h e D E P T N O v a lu e in t C o n s id e r a n a lt e r n a t iv e s t r u c t u r e , w h e r e t h e d a t a is s t o r e d a c c o r d in g t o t h ie r a r c h ic a l p a r a d ig m . T h e h ie r a r c h ic a l m o d e l w a s d e v e lo p e d b e fo r e t h e r e m o d e l, f o r t e c h n o lo g y r e a s o n s . In t h e e a r ly d a y s o f c o m p u t in g , s t o r a g e d e v t h e c a p a b ilit y f o r m a in t a in in g t h e m a n y s e p a r a t e f ile s t h a t w e r e n e e d e d f o r m a n y r e la t io n a l t a b le s . N o t e t h a t t h is p r o b le m is a v o id e d in t h e O r a c le d a t a a b s t r a c t in g t h e p h y s ic a l s t o r a g e ( f ile s ) f r o m t h e lo g ic a l s t o r a g e ( t a b le s ) ; t h e d ir e c t c o n n e c t io n b e t w e e n t a b le s a n d f ile s , a n d c e r t a in ly n o t a o n e - t o - o n e m In e f f e c t , m a n y t a b le s c a n b e s t o r e d in a v e r y f e w f ile s . A h ie r a r c h ic a l s t r u c t u r e s t o r e s a ll r e la t e d d a t a in o n e u n it . F o r e x a m p le , t e m p lo y e e s . T h e h ie r a r c h ic a l p a r a d ig m c a n b e v e r y f a s t a n d v e r y s p a c e e f f ic d a t a n e e d e d t o s a tis fy a q u e r y . T h e e m p lo y e e s a n d d e p a r t m e n t s lis t e d p r e v io u s ly c o u ld b e s t o r e d h ie r a r c h ic a lly a s f o llo w s :
1 0 ,A C C O U N T IN G ,7 7 8 2 ,C L A R K 2 0 ,R E S E A R C H ,7 3 6 9 ,S M IT H ,7 5 6 6 ,JO N E S ,7 7 8 8 ,S C O T T 3 0 , S A L E S , 7 4 9 9 , A L L E N , 7 5 2 1 , W A R 4D0, ,7O6 P5 E4 R, M T IR TNI N , 7 6 9 8 , B L A K E AA O S

16

C hapter 1:

Introduction to the O racle Server Technologies

In t h is e x a m p le la y o u t , t h e r o w s a n d c o lu m n s a r e o f v a r ia b le le n g t h . C o lu a r e d e lim it e d w it h a c o m m a , r o w s w it h a n e w lin e . D a t a r e t r ie v a l is t y p ic a lly v e r y e f f ic ie n t if t h e q u e r y c a n n a v ig a t e t h e h ie r a r c h y : if o n e k n o w s a n e m p l d e p a r t m e n t , t h e e m p lo y e e c a n b e f o u n d q u ic k ly . If o n e d o e s n t , t h e r e t r ie v a b e s lo w . C h a n g e s t o d a t a c a n b e a p r o b le m if t h e c h a n g e n e c e s s it a t e s m o v F o r e x a m p le , t o m o v e e m p lo y e e 7 5 6 6 , JO N E S , f r o m R E S E A R C H t o S A L E S w o b e c a u s e th e m o v e h a s to b e im p le m e n t e d a s a r e m o v a l f r o m o n e lin e a n d a n in s e r t io n in t o a n o t h e r . N t h a t in t h is e x a m p le , w h ile it is p o s s ib le t o h a v e a d e p a r t m e n t w it h n o e m p l ( t h e O P E R A T IO N S d e p a r t m e n t ) , it is a b s o lu t e ly im p o s s ib le t o h a v e a n e m p lo w ith o u t a d e p a r t m e n t : th e r e is n o w h e r e t o p u t h e r . T h e r e la t io n a l p a r a d ig m is h ig h ly e f f ic ie n t in m a n y r e s p e c t s f o r m a n y t y p d a t a , b u t it is n o t a p p r o p r ia t e f o r a ll a p p lic a t io n s . A s a g e n e r a l r u le , a r e la t io a n a ly s is s h o u ld b e t h e f ir s t a p p r o a c h t a k e n w h e n m o d e lin g a s y s t e m . O n ly in a p p r o p r ia t e s h o u ld o n e r e s o r t t o n o n - r e la t io n a l s t r u c t u r e s . A p p lic a t io n s w r e la t io n a l m o d e l h a s p r o v e n h ig h ly e f f e c t iv e in c lu d e v ir t u a lly a ll o n lin e t r a n s p r o c e s s in g ( O L T P ) s y s t e m s a n d d e c is io n s u p p o r t s y s t e m s ( D S S s ) . T h e r e la t i p a r a d ig m c a n b e d e m a n d in g in it s h a r d w a r e r e q u ir e m e n t s a n d in t h e s k ill n t o d e v e lo p a p p lic a t io n s a r o u n d it , b u t if t h e d a t a f it s , it h a s p r o v e d t o b e t h e v e r s a t ile m o d e l. T h e p r o b le m s a r is e f r o m t h e n e e d t o m a in t a in in d e x e s t h a v e r s a t ilit y o f a c c e s s o f m a in t a in t h e lin k s b e t w e e n t a b le s , a n d t h e s p a c e r e q o f m a in t a in in g m u lt ip le c o p ie s o f t h e in d e x e d d a t a in t h e in d e x e s t h e m s e lv e in t h e t a b le s in w h ic h t h e c o lu m n s r e s id e . N o n e t h e le s s , r e la t io n a l d e s ig n is c ir c u m s t a n c e s t h e o p t im a l m o d e l. A num ber of s o ftw a re p u b lis h e r s have p th a t c o n fo rm ( w ith v a r y in g d e g re e s of a c cu ra c is o n ly o n e . IB M w a s p e r h a p s t h e f ir s t c o m p a n y t o c o m m it m a jo r r e s o u r c e p o r t e d t o n o n - IB M p la t fo r m s fo r m a n y y e a r s . M ic r o s o ft s S Q L lim it e d b y t h e p la t f o r m s o n w h ic h it r u n s . O r a c le d a t a b a s e s , b y c o n t r a s t , r e le a s e . It m ay be O r a c le t h e e d g e in th e R D B M S m a r k e t p la c e . A n o te on t e r m in o lo g y : c o n f u s io n can a r is e w ith p e o p le u sed to w o r k in g w it h M ic r o s o ft p ro S e rv e r is a d a ta b a se b u t in th e M ic r o s o f t w o r ld r e f e r t o e it h e r .

E p in x la R la n l e tio a S c re tru tu s

17

Data Normalization

T h e p r o c e s s o f m o d e lin g d a t a in t o r e la t io n a l t a b le s is k n o w n a s n o r m a liz a t io T h e r e a r e c o m m o n ly s a id t o b e t h r e e le v e ls o f n o r m a liz a t io n : t h e f ir s t , s e c o a n d t h ir d n o r m a l f o r m s . T h e r e a r e h ig h e r le v e ls o f n o r m a liz a t io n : f o u r t h a n d n o r m a l f o r m s a r e w e ll d e f in e d , b u t a n y n o r m a l d a t a a n a ly s t ( a n d c e r t a in ly a n o r m a l h u m a n b e in g ) w ill n o t n e e d t o b e c o n c e r n e d w it h t h e m . It is p o s s ib l S Q L a p p lic a t io n t o a d d r e s s u n -n o r m a liz e d d a t a , b u t t h is w ill u s u a lly b e d r e a in e f f ic ie n t b e c a u s e t h a t is n o t w h a t t h e la n g u a g e is d e s ig n e d t o d o . In m o s t d a t a s t o r e d in a r e la t io n a l d a t a b a s e a n d a c c e s s e d w it h S Q L s h o u ld b e n o r m t h e t h ir d n o r m a l f o r m . A s a n e x a m p le o f n o r m a liz a t io n , c o n s id e r a t a b le c a lle d B O O K S s t o r in g d e b o o k s , a u t h o r s , a n d p u b lis h e r s , u s in g t h e IS B N n u m b e r a s t h e p r im a r y k e y . k e y is t h e o n e a t t r ib u t e t h a t c a n u n iq u e ly id e n t if y a r e c o r d . T h e s e a r e t w o t e n t r ie s :
IS B N
12345

T it le

A u th o rs

P u b lis h e r

O r a c l e 1 1 g S Q L F u n d a m e n t a Jlos h n W a t s o n , M c G r a w - H ill, S p e a r 1 E x a m G u id e R o o p e s h R a m k l a s sS t r e e t , S a n F r a n c i s c o , CA O r a c le 1 1 g N e w F e a t u r e s E x a m G u id e S a m A la p a t i M c G r a w - H ill, S p e a r S t r e e t , S a n F r a n c is c o , CA

67890

S t o r in g th e d a ta in t h is t a b le g iv e s r is e to s in s e r t io n a n o m a ly : it is im p o s s ib le to e n te r d e ta p u b lis h e d , becau se th e re w ill be no IS B N num Second, a book cannot be d e le t e d w it h o u t lo s a d e le t io n a n o m a ly . T h ir d , if a p u b lis h e r s addr t o u p d a t e t h e r o w s f o r e v e r y b o o k h e /s h e h a s p u b lis h e d : a n u p d a t e a n o m a l F u r t h e r m o r e , it w ill b e v e r y d if f ic u lt t o id e n t if y e v e r y b o o k w r it t e n b y o n e a u T h e f a c t t h a t a b o o k m a y h a v e s e v e r a l a u t h o r s m e a n s t h a t t h e a u t h o r f ie b e m u lt iv a lu e d , a n d a s e a r c h w ill h a v e t o s e a r c h a ll t h e v a lu e s . R e la t e d t o t t h e p r o b le m o f h a v in g t o r e s t r u c t u r e t h e t a b le o f a b o o k c o m e s a lo n g w it h m a u t h o r s t a n t h e o r ig in a l d e s ig n c a n h a n d le . A ls o , t h e s t o r a g e is v e r y in e f f ic i t o r e p lic a t io n o f a d d r e s s d e t a ils a c r o s s r o w s , a n d t h e p o s s ib ilit y o f e r r o r a s r e p e a t e d ly e n t e r e d is h ig h . N o r m a liz a t io n s h o u ld s o lv e a ll t h e s e is s u e s .

18

C hapter 1:

Introduction to the O racle Server Technologies

T h e f ir s t n o r m a l f o r m is t o r e m o v e t h e r e p e a t in g g r o u p s . In t h is c a s e , t A U T H O R S . T h e d a t a s t r u c t u r e s w ill n o w lo o k lik e t h is : BOOKS


IS B N
12345 67890

T it le

P u b lis h e r

O r a c le 1 1 g S Q L F u n d a m e n t a ls M c G r a w - H ill, S p e a r S t r e e t , 1 E x a m G u id e S a n F r a n c is c o , C A O r a c le 1 1 g N e w F e a t u r e s E x a m G u id e M c G r a w - H ill, S p e a r S t r e e t , S a n F r a n c is c o , C A

AUTHO RS
Nam e
Jo h n W a t s o n R o o p e s h R a m k la s s S a m A la p a t i

IS B N
12345 12345 67890

O n e r o w in t h e B O O K S t a b le is n o w lin k e d t o t w o r o w s in t h e A U T H O R S t a b le . T h is s o lv e s t h e in s e r t io n a n o m a ly ( t h e r e is n o r e a s o n n o t t o in s e r t a s u n p u b lis h e d a u t h o r s a s n e c e s s a r y ) , t h e r e t r ie v a l p r o b le m o f id e n t if y in g a l h e r n a m e ) , a n d t h e p r o b le m o f a f ix e d m a x im u m n u m b e r o f a u t h o r s f o r n e e d e d ). T h is is t h e f ir s t n o r m a l f o r m : n o r e p e a t in g g r o u p s . T h e s e c o n d n o r m a l f o r m r e m o v e s c o lu m n s f r o m t h e t a b le t h a t a r e n o t d e p u b lis h e r s a d d r e s s d e t a ils : t h e s e d e p e n d o n t h e p u b lis h e r , n o t t h e IS B N . T h e B O O K S t a b le a n d a n e w P U B L IS BOOKS


IS B N
12345 67890

T it le
O r a c le 1 1 g N e w F e a t u r e s E x a m G u id e

P u b lis h e r
M c G r a w - H ill M c G r a w - H ill

O r a c le 1 1 g O C P S Q L F u n d a m e n t a ls 1 E x a m G u id e

E p in R la n l x la e tio a S c re tru tu s

19

P U B L IS H E R S
Publisher
M c G r a w - H ill

Street
S p e a r S tre e t

City
S a n F r a n c is c o

State
C a lif o r n ia

A ll t h e b o o k s p u b lis h e d b y o n e p u b lis h e r w ill n o w p o in t t o a s in g le r e c o r d t h e a d d r e s s m a n y t im e s , a n d t h e c o n s e q u e n t u p d a t e a n o m a lie s a n d a ls m u lt ip le e n t r ie s . T h ir d n o r m a l f o r m r e m o v e s a ll c o lu m n s t h a t a r e in t e r d e p e n d e n t . In t h e P U B L IS H E R S ta b le , t h is m eans th e a d d re s s c o lu m c it y , and th e c it y can be in o n ly one s ta te ; c o u ld b e a c h ie v e d b y a d d in g a n a d d r e s s c o d e , p o in t in g t o a s e p a r a t e a d d r e P U B L IS H E R S


P u b lis h e r
M c G r a w - H ill

A d d re s s C o d e
123

ADDRESSES
A d d re s s C o d e
123

S tre e t
S p e a r S tre e t

C it y
S a n F r a n c is c o

S ta te
C a lifo r n ia

O n e c h a r a c t e r is t ic o f n o r m a liz e d d a t a t h a t s h o u ld b e e m p h a s iz e d n o w is t h e u n iq u e id e n t if ie r o f a r o w in a t a b le , e it h e r o n e c o lu m n o r a c o n c a t e n t a b le s h o u ld h a v e a p r im a r y k e y d e f in e d . N o t e t h a t t h e O r a c le d a t a b a s e d e v ia t e s f r o m t h is s t a n d a r d : it is p o s s ib le n o t a g o o d id e a , a n d s o m e o t h e r R D B M S s d o n o t p e r m it it . A f o r e ig n k e y is a c o lu m n ( o r a c o n c a t e n a t io n o f s e v e r a l c o lu m n s ) t h a t c a used to id e n t if y a r e la t e d ro w in a n o th e r t a b le . a p r im a r y key in a n o th e r t a b le . T h is is th e m a n y -to -o n e r e la tio n s h ip is a c o n n e c t io n b e tw e e n o n e t a b le r e f e r t o a s in g le r o w in a n o t h e r t a b le . T h is is s o m e t im e s c a lle d a p

20

C hapter 1:

Introduction to the O racle Server Technologies

r e la t io n s h ip : o n e p a r e n t c a n h a v e m a n y c h ild r e n . In t h e b o o k s e x a m p le s o f
T a b le
BOOKS AU TH O RS P U B L IS H E R S ADDRESSES

Keys
P r im a r y k e y : IS B N F o r e ig n k e y : P u b lis h e r P r im a r y k e y : N a m e + IS B N F o r e ig n k e y : IS B N P r im a r y k e y : P u b lis h e r F o r e ig n k e y : A d d r e s s c o d e P r im a r y k e y : A d d r e s s c o d e

T h e s e k e y s d e f in e r e la t io n s h ip s s u c h a s t h a t o n e b o o k c a n h a v e s e v e r a l a T h e r e a r e v a r io u s s t a n d a r d s f o r d o c u m e n t in g n o r m a liz e d d a t a s t r u c t u r e s b y d if f e r e n t o r g a n iz a t io n s a s s t r u c t u r e d f o r m a l m e t h o d s . G e n e r a lly s p e a k in d o e s n t m a t te r w h ic h m e th o d o n e u s e s a s lo n g e v e r y o n e r e a d in g t h e d o c u m u n d e r s t a n d s it . P a r t o f t h e d o c u m e n t a t io n w ill a lw a y s in c lu d e a lis t in g o f t h e t h a t m a k e u p e a c h e n t it y ( a ls o k n o w n a s t h e c o lu m n s t h a t m a k e u p e a c h t a a n e n t it y - r e la t io n s h ip d ia g r a m r e p r e s e n t in g g r a p h ic a lly t h e f o r e ig n - t o - p r im a c o n n e c t io n s . A w id e ly u s e d s t a n d a r d is t h a t p r im a r y k e y s c o lu m n s s h o u ld b w it h a h a s h ( # ) ; f o r e ig n k e y c o lu m n s w it h a b a c k s la s h ( \ ) ; m a n d a t o r y c o lu m c a n n o t b e le f t e m p t y ) w it h a n a s t e r is k ( * ) ; o p t io n a l c o lu m n s w it h a lo w e r c a s b o o k s t a b le s c a n n o w b e d e s c r ib e d a s f o llo w s : T a b le B O O K S #* o \* IS B N T itle P u b lis h e r P r im a r y k e y , r e q u ir e d O p t io n a l F o r e ig n k e y , lin k t o t h e P U B L IS H E R S t a b le

T a b le A U T H O R S #* #o \ N am e IS B N

T o g e t h e r w it h t h e IS B N , t h e p r im a r y k e y P a r t o f t h e p r im a r y k e y , a n d a f o r e ig n k e y t o t h e s o m e a u t h o r s m a y n o t y e t b e p u b lis h e d

E p in x la R la n l e tio a S c re tru tu s

21

T a b le P U B L IS H E R S #* \o P u b lis h e r A d d re s s c o d e P r im a r y k e y f o r e ig n k e y , lin k t o t h e A D D R E S S E S t a b le

T a b le A D D R E S S E S #* o o o A d d re s s c o d e S tre e t C it y S ta te

P r im a r y k e y

T h e s e c o n d n e c e s s a r y p a r t o f d o c u m e n t in g t h e n o r m a liz e d d a t a m o d e l is e n t it y - r e la t io n s h ip d ia g r a m ( E R D ) . T h is r e p r e s e n t s t h e c o n n e c t io n s b e t w e e n g r a p h ic a lly . T h e r e a r e d if f e r e n t s t a n d a r d s f o r t h e s e ; F ig u r e 1 - 1 s h o w s t h e e r e la t io n s h ip d ia g r a m f o r t h e b o o k s e x a m p le u s in g a v e r y s im p le n o t a t io n lim t o s h o w in g t h e d ir e c t io n o f t h e o n e - t o - m a n y r e la t io n s h ip s . It c a n b e s e e n t h B O O K c a n h a v e m u lt ip le A U T H O R S , o n e P U B L IS H E R c a n p u b lis h m a n y b o o k a n d s o o n . M o r e c o m p le x n o t a t io n s c a n b e u s e d t o s h o w w h e t h e r t h e lin k is o r o p t io n a l, in f o r m a t io n w h ic h w ill m a t c h t h a t g iv e n in t h e t a b le c o lu m n s lis p r e v io u s ly . T h is is a v e r y s im p le e x a m p le o f n o r m a liz a t io n a n d is n o t in f a c t c o m p le t e a u t h o r w e r e t o w r it e s e v e r a l b o o k s , t h is w o u ld r e q u ir e m u lt ip le v a lu e s in t h c o lu m n o f t h e A U T H O R S t a b le . T h a t w o u ld b e a r e p e a t in g g r o u p , w h ic h w o u h a v e t o b e r e m o v e d b e c a u s e r e p e a t in g g r o u p s b r e a k t h e r u le f o r f ir s t n o r m m a jo r e x e r c is e w it h d a t a n o r m a liz a t io n is e n s u r in g t h a t t h e s t r u c t u r e s c a n h p o s s ib ilit ie s . T a b le s in a r e a l- w o r ld a p p lic a t io n m a y h a v e h u n d r e d s o f c o lu m d o z e n s o f f o r e ig n k e y s . Errors in relational analysis can be disastrous for an application. It is very difficult (and expensive) to correct any errors later. By contrast, errors made during the programming stage of development can usually be fixed comparatively quickly and cheaply.
F U E1 IG R -1

re tio s ip la n h s
A T OS UH R

A e tity la n h d g m s o in b s o e -m n n n -re tio s ip ia ra , h w g a ic n -to a y

B OS O K

P B IS E S U L HR

A DESS D RSE

22

C hapter 1:

Introduction to the O racle Server Technologies

CERTIFICATION OBJECTIVE 1.03

Understand the SQL Language


S Q L is d e f in e d , d e v e lo p e d , a n d c o n t r o lle d b y in t e r n a t io n a l b o d ie s . C o r p o r a tio n does not have to c o n fo rm to The la n g u a g e its e lf can be th o u g h t as c o m m a n d s ) , b u t in p r a c t ic e S Q L c o d in g c a n b e p h e n o m e n a lly c o m W h a t f o llo w a r e t h e s ix t e e n S Q L c o m m a n d s , s e p a r a t e d in t o c o m
SELECT IN S E R T UPDATE D ELETE M ERGE

O r a c le th e S b e in g p lic a t e d . m o n ly u s

T h e D a t a D e f i n i t i o n L a n g aCg Re E (AD T DE L ) c o m m a n d s : u
ALTER DROP RENAM E TRUN CATE CO M M ENT

T h e D a t a C o n t r o l L a n g u gGe R (AD NC TL ) c o m m a n d s : a
REVOKE

T h e T r a n s a c t i o n C o n t r o l L a gCu Oa M eM (I T C L ) c o m m a n d s : n g
RO LLBAC K S A V E P O IN T

U d rsta d th ne n e S LL n u g Q a ga e

23

S Q L is a s e t - o r ie n t e d la n g u a g e , w h e r e a s m o s t 3 G L s a r e p r o c e d u r a l la n g u P r o g r a m m e r s w o r k i n g i n p r o c e d u r a l l a n g u oa w e as t s ap et ci mf ye . w Phr a tg rt ao m dm e wr si t hw od g i o o la n g u a g e say w hat th d o t o a g r o u p ( a s e t ) o f r o w s , a n d le t t h e d a t a b a s e w o r k o u t h o w t o d o it t o P r o c e d u r a l la n g u a g e s a r e u s u a lly le s s e f f ic ie n t t h a n s e t -o r ie n t e d la n g u a g m a n a g in g d a t a , b o t h a s r e g a r d s d e v e lo p m e n t a n d a s r e g a r d s e x e c u t io n . A u p d a t in g t h e m o n e b y o n e w ill in v o lv e m a n y lin e s o f c o d e , w h e r e a s S Q L m ig h t d o t h e w h o le o p e r a t io n w it h o n e c o m m a n d : p r o g r a m m e r p r o d u c t iv it y in c r e a s e s . D u r in g p r o g r a m e x e c u t p r o c e d u r a l c o d e g iv e s t h e d a t a b a s e n o o p t io n s ; it m u s t r u n t h e c o d e a s it h w r it t e n . W it h S Q L , t h e p r o g r a m m e r s t a t e s w h a t h e /s h e w a n t s t o d o , b u t n o t d o it : t h e d a t a b a s e h a s t h e f r e e d o m t o w o r k o u t h o w b e s t t o c a r r y o u t t h e o T h is w ill u s u a lly g iv e b e t t e r r e s u lt s . W h e r e S Q L f a ils is t h a t it is p u r e ly a d a t a a c c e s s la n g u a g e . M o s t a p p lic a t i w ill n e e d p r o c e d u r a l c o n s t r u c t s , s u c h a s f lo w c o n t r o l: c o n d it io n a l b r a n c h in g it e r a t io n . T h e y w ill a ls o u s u a lly n e e d s c r e e n c o n t r o l, u s e r in t e r f a c e f a c ilit ie s v a r ia b le s . S Q L h a s n o n e o f t h e s e . S Q L is a s e t -o r ie n t e d la n g u a g e c a p a b le o o n e w ill t h e r e f o r e n e e d a p r o c e d u r a l la n g u a g e t h a t c a n in v o k e S Q L c a lls . It is t h e r e f o r e n e c e s s a r y f o r w o r k w ith a p r o c e d u r a l la n g u a g e . C o n s id e r a n a p p lic a t io n th a t p r o m p ts a u s e r fo r a n a m e , r e t r ie v e s a ll th e w ith th a t n a m e fr o m a t a b le , p r o m p t s th e u s e r t o c h o o s e o n e o f t h e m , a n d d e le t e s t h e c h o s e n p e r s o n . T h e p r o c e d u r a l la n g u a g e w ill d r a w a s c r e e n a n d a p r o m p t f o r a n a m e . T h e u s e r w ill e n t e r t h e n a m e . T h e p r o c e d u r a l la n g u a g c o n s t r u c t a S Q L S E L E C T s t a t e m e n t u s in g t h e n a m e a n d s u b m it t h e s t a t e m e t h r o u g h a d a t a b a s e s e s s io n t o t h e d a t a b a s e s e r v e r f o r e x e c u t io n . T h e s e r v e r e t u r n a s e t o f r o w s ( a ll t h e p e o p le w it h t h a t n a m e ) t o t h e p r o c e d u r a l la n g u w h ic h w ill f o r m a t t h e s e t f o r d is p la y t o t h e u s e r , a n d p r o m p t h e r t o c h o o s e m o r e ) o f t h e m . T h e id e n t if ie r f o r t h e c h o s e n p e r s o n ( o r p e o p le ) w ill t h e n b e t o c o n s t r u c t a S Q L D E L E T E s t a t e m e n t f o r t h e s e r v e r t o e x e c u t e . If t h e id e n t is a u n iq u e id e n t if ie r ( t h e p r im a r y k e y ) , t h e n t h e s e t o f r o w s t o b e d e le t e d w s e t o f ju s t o n e r o w ; if t h e id e n t if ie r is n o n u n iq u e , t h e n t h e s e t s e le c t e d f o r d w o u ld b e la r g e r . T h e p r o c e d u r a l c o d e w ill k n o w n o t h in g a b o u t t h e lik e ly s iz e s e t s r e t r ie v e d o r d e le t e d , a n d t h e p r o g r a m m e r w ill n o t k n o w w h e t h e r t h e r o t o b e d e le t e d w e r e lo c a t e d b y s c a n n in g t h e e n t ir e t a b le , o r b y d ir e c t a c c e s s s e a r c h in g a n in d e x .

24

C hapter 1:

Introduction to the O racle Server Technologies

CERTIFICATION OBJECTIVE 1.04

Appreciate the DBAs Role

D a t a b a s e a d m in is t r a t o r is o f t e n n o t a v e r y p r e c is e ly d e f in e d jo b . In m a n y o r g a n iz a t io n s , e n d u s e r s e x p e c t t h e D B A t o b e a n e x p e r t o n a ll a s p e c t s o f t e n v ir o n m e n t . If t h e d a t a b a s e c r a s h e s , t h e y c a ll t h e D B A . F a ir e n o u g h . B u t t m a y a ls o c a ll h e r if t h e n e t w o r k f a ils , if t h e s e r v e r s c r a s h , o r if t h e a p p lic a t io b u g . S o m e D B A s b e lie v e t h a t e n d u s e r s w ill c a ll t h e m if t h e p lu m b in g g e t s b P e r h a p s t h is is b e c a u s e v ir t u a lly a n y f a ilu r e in t h e IT e n v ir o n m e n t r e s u lt s in b e in g u n a b le t o u s e t h e d a t a b a s e , s o t h e D B A is t h e n a t u r a l f ir s t p o in t o f c o A p a r t f r o m t h e s e e x c e s s iv e e x p e c t a t io n s , t h e D B A is o f t e n t h e o n ly p e r s o t h e IT m a n a g e m e n t s t r u c t u r e w h o h a s a h o lis t ic v ie w o f t h e e n v ir o n m e n t . O E n t e r p r is e M a n a g e r G r id C o n t r o l is a t o o l s p e c if ic a lly in t e n d e d t o a id t h e D B t h is : it p r e s e n t s a c o m p le t e p ic t u r e o f t h e p e r f o r m a n c e a n d a v a ila b ilit y o f a d a t a b a s e s , a p p lic a t io n s e r v e r s , a n d s e r v e r m a c h in e s in t h e o r g a n iz a t io n . A t h e D B A s jo b is t o id e n t if y w h e r e in a c o m p le x in f o r m a t io n t e c h n o lo g y e n v i a f a ilu r e o r a p e r f o r m a n c e is s u e h a s o c c u r r e d , a n d w o r k w it h t h e a p p r o p r ia t g r o u p t o f ix it . D u t ie s m o r e s p e c if ic a lly r e la t e d t o d a t a b a s e a d m in is t r a t io n i
S iz in g a p p lic a tio n s a n d s e r v e r h a r d w a r e

A c c u ra te fo re c a s ts o f th e n e ce ssa ry m a in m e m o ry , d is k space, and CPU a p p lic a t io n s w ill ru n w e ll w ith o u t d e m a n d in im p o r t a n t p a r t o f m a in t a in in g p e r f o r m a n c e w it h o u t u s in g e x c e s s iv e b

O r a c le s o f t w a r e in s t a lla t io n a n d m a in t e n a n c e

T h is is a n o n - t r iv ia l t a s k in o r g a n iz a t io n s w it h m a n y s e r v e r s . S o f t w a r e in s t a lla t io n s m u s t b e k e t o - d a t e w it h c r it ic a l p a t c h e s ( f o r s e c u r it y , f o r in s t a n c e ) , a n d m a in t e n a p a t c h e s s h o u ld b e a p p lie d a s t h e y a r e is s u e d , b u t b e f o r e a n y s u c h u p d o n e t o liv e s y s t e m s , t h e D B A m u s t e n s u r e t h a t it is a d e q u a t e ly t e s t e T h e r e w ill u s u a lly b e m a n y w a y s t o c o n f ig u th e p h y s ic a l s to ra g e of a d a ta b a s e , som e of th e p e rfo rm a n c e of th e sy ste m and its m a w a re of th e im p a c t of d iffe r e n t sto ra g e s tru ta p e sy ste m s.

D a t a b a s e p h y s ic a l d e s ig n

M o n it o r in g a n d t u n in g p e r f o r m a n c e

T h is is a c o n t in u o u s a c t iv it y f o r p r o d u c t io n s y s t e m s . A g o o d D B A w ill b e a b le t o a n t ic ip a t e p e r f o r m a n c is s u e s a n d f ix t h e m b e f o r e t h e y a r is e .

A p c te th p re ia e D A R le B s o

25

A s s is t in g d e v e lo p e r s w it h a p p lic a t io n d e s ig n a n d t u n in g S Q L

Som e D B s p e n d e ig h t h o u r s a d a y t u n in g S Q L . P e r h a p s t h is s h o u ld b e t h e w o r k p r o g r a m m e r s , b u t a t t h e v e r y le a s t t h e D B A m u s t id e n t if y t h e p r o b le m t h e y s h o u ld b e a d d r e s s in g .

L ia is in g w it h v e n d o r s , e n d u s e r s , d e v e lo p e r s , s e n io r m a n a g e m e n t , a n d

o t h e r s u p p o r t g r o u p s A s t h e t e c h n ic ia n w it h t h e m o s t c o m p le t e p ic t c o o r d in a t in g p la n n in g a n d a c t io n b y a ll p a r t ie s in v o lv e d in t h e IT e n v ir
B a c k u p , re s to re , a n d re c o v e ry

P e r h a p s th e m o s t im p o r t a n t p a r t o f t h e jo b . T h e D B A m u s t e s t a b lis h r o u t in e s t h a t w ill e n s u r e t h a t a g r e e d t a r g f o r u p t im e a n d d a t a lo s s ( p e r h a p s a s d e m a n d in g a s 1 0 0 p e r c e n t a n d r e s p e c t iv e ly ) c a n b e m e t in t h e f a c e o f a n y p o s s ib le p r o b le m . T h e r e to th e a g re e d ta rg e ts .

U s e r a n d s e c u r it y m a n a g e m e n t

A n o t h e r c r it ic a l p a r t o f t h e jo b . A s w it u p t im e a n d d a t a lo s s , t h e r e is n o r ig h t a n d w r o n g in s e c u r it y o n ly c o p r o c e d u r e s t h a t w ill e n s u r e c o n f o r m a n c e , a n d m o n it o r t h e ir e f f e c t iv e n e s s .

Som e DBAs b e lie v e th a t th e y a re d o in g t h e ir a re th e re . T h e re is a c e r t a in am ount of tru th a la r g e e x te n t s u p p o rt w o rk , and if th e w o rk p r o a c t iv e p la n n in g and p r e v e n tiv e m a in t e n a n c e , th u se rs to re p o rt a p r o b le m . U s u a lly t h is id e a l c of tim e w ill be spent w o r k in g r e a c tiv e ly w ith s o lv e is s u e s . T h e w id e s c o p e o f t h e D B A r o le r e q u ir e s c o n t in u a l s t u d y a n d p e r s o n a l d e v e lo p m e n t , s t u d y o f t h e O r a c le d a t a b a s e it s e lf a n d a ls o o f r e la t e d t e c h n k n o w le d g e . T h is c a n b e t h e m o s t r e w a r d in g p a r t o f t h e jo b .

CERTIFICATION SUMMARY

T h is c h a p t e r s u m m a r iz e d s o m e o f t h e k n o w le d g e t h a t is a s s u m e d b e f o r e b e O r a c le d a t a b a s e in t h e O r a c le p r o d u c t f a m ily , t h e p r in c ip le s o f r e la t io n a l d a a p p lic a t io n d e v e lo p m e n t t o o ls . F in a lly , it c o n s id e r s t h e D B A s r o le in t h e IT

26

C hapter 1:

Introduction to the O racle Server Technologies

TW -M O INUTE DRILL
Position the Oracle Product Family

T h e O r a c le d a t a b a s e s t o r e s a n d m a n a g e s a c c e s s t o u s e r d a t a . T h e O r a c le A p p lic a t io n S e r v e r r u n s a p p lic a t io n s t h a t c o n n e c t u s e r s t o d a ta b a se .

O r a c le E n t e r p r is e M a n a g e r is a t o o l f o r m a n a g in g d a t a b a s e s , a p p lic a t i s e r v e r s , a n d if d e s ir e d , t h e e n t ir e c o m p u t in g e n v ir o n m e n t .

L a n g u a g e s b u ilt in t o t h e d a t a b a s e f o r a p p lic a t io n d e v e lo p m e n t a r e S Q P L /S Q L , a n d Ja v a .

Explain Relational Structures


D a t a m u s t b e n o r m a liz e d in t o t w o - d im e n s io n a l t a b le s . T a b le s a r e lin k e d t h r o u g h p r im a r y a n d f o r e ig n k e y s . E n t it y - r e la t io n s h ip d ia g r a m s r e p r e s e n t t h e t a b le s g r a p h ic a lly .

Understand the SQL Language


S Q L is a s e t - o r ie n t e d la n g u a g e . T h e D D L c o m m a n d s a re C R E A T E , A L T E R , D R O P , R E N A M E , T R U N C A T E , and CO M M ENT. T h e D C L c o m m a n d s a re G R A N T a n d R E V O K E . T h e T C L c o m m a n d s a r e C O M M IT , R O L L B A C K , a n d S A V E P O IN T .

T h e D M L c o m m a n d s a r e S E L E C T , IN S E R T , U P D A T E , D E L E T E , a n d M E R G

Appreciate the DBAs Role


S iz in g a p p lic a t io n s a n d s e r v e r h a r d w a r e . O r a c le s o ft w a r e in s ta lla t io n a n d m a in t e n a n c e . D a t a b a s e p h y s ic a l d e s ig n . M o n it o r in g a n d t u n in g p e r f o r m a n c e . A s s is t in g d e v e lo p e r s w it h a p p lic a t io n d e s ig n a n d t u n in g S Q L . L ia is in g w it h v e n d o r s , e n d u s e r s , d e v e lo p e r s , s e n io r m a n a g e m e n t , a n su p p o rt g ro u p s. B a c k u p , re s to re , a n d re c o v e ry . U s e r a n d s e c u r ity m a n a g e m e n t.

S elf Test

27

SELF TEST
Position the Oracle Product Family
1. A. B. C. D. E. 2.

W h ic h o f t h e s e la n g u a g e s c a n r u n w it h in t h e d a t a b a s e ? ( C h o o s e a ll c o r r e c t a n s w C Ja v a P L /S Q L SQL A n y o t h e r la n g u a g e , if it is lin k e d w it h t h e O C I lib r a r ie s

In a w e b a p p lic a t io n , o n w h ic h t ie r d o e s t h e a p p lic a t io n s o f t w a r e r u n ? ( C h o o s e t h A . In t h e w e b b r o w s e r o n t h e c lie n t t ie r B . O n t h e m id d le t ie r C . W it h in a Ja v a - e n a b le d d a t a b a s e

Explain Relational Structures


3.

F o r w h a t d a t a s t o r a g e p a r a d ig m m u s t d a t a b e n o r m a liz e d ? ( C h o o s e t h e b e s t a n s A . H ie r a r c h ic a l d a t a b a s e s B . N e tw o rk d a ta b a s e s C . O b je c t - o r ie n t e d d a t a b a s e s D . R e la t io n a l d a t a b a s e s A B C D W h a t t y p e o f r e la t io n s h ip s h o u ld b e a v o id e d w h e n n o r m a liz in g d a t a ? ( C h o o s e t h . O n e -to -m a n y . M a n y -to -o n e . M a n y -to -m a n y . O n e -to -o n e

4.

Understand the SQL Language


5. SQ L cannot do e v e r y t h in g . W hat a n s w e rs .) A . U s e r in t e r f a c e d e s ig n B . B r a n c h in g s tr u c tu r e s s u c h a s IF ...T H E N ...E L S E C . O p e r a t io n s th a t a ffe c t m a n y r o w s a t o n c e D . T a b le c r e a t io n a n d d e le t io n

f u n c t io n

28
6.

C hapter 1:

Introduction to the O racle Server Technologies

W h ic h o f t h e s e is n o t a S Q L c o m m a n d ? ( C h o o s e t h e b e s t a n s w e r .) A. M ERGE B. UPSERT C. COM M ENT D . S A V E P O IN T E . A ll th e a b o v e a r e S Q L c o m m a n d s

Appreciate the DBAs Role


7. W ith re g a rd to e n s u r in g th a t d a ta w ill not w h a t w o u ld n o t n o r m a lly b e p a r t o f t h e D B A s d u t ie s ? ( C h o o s e t h e b e s t a n s w e r s .) A . D e s ig n in g b a c k u p r o u t in e s B . S e t t in g u p d is k m ir r o r in g C . C r e a t in g a n d d r o p p in g d a t a b a s e o b je c t s D . T e s t in g r e s t o r e a n d r e c o v e r y s t r a t e g ie s

LAB Q UESTIO N
A n o v ic e D B A n e e d s a s y s t e m o n w h ic h t o s t u d y t h e O r a c le d a t a b a s e , a n d t o p r a c t ic e t h w ill h a v e
A m a c h i n e w i t h a g r a p h i c s m o n i t o r , 1 G TBh e A M t, aabn ad s e 1 1B g f ir ne se t ad l ilsa kt i o p a sc oe f t w a r e , o n D R Da 5 G sn

d o w n lo a d e d

T h e S Q L D e v e lo p e r s o ft w a r e A n IP a d d r e s s : e it h e r f ix e d , D H C P , o r lo o p b a c k A n o p e r a t i n g s y s t e m s u ch a A cWc ei ns d ot w st hXeP Oo rr a Lc ilne u dx a t a b a s e s s o If p e r m it t e d , a n a c c o u n t o n M e t a lin k

d o c u m e n ta tio n A s s e m b le t h e s e it e m s .

Lb a As e nwr

29

SELF TEST ANSW ERS


Position the Oracle Product Family
1. B , C , a n d D . S Q L , P L / S Q L , a n d Ja v a a r e im p le m e n t e d in t e r n a lly t o t h e d a t a b a s e . A is w r o n g b e c a u s e C is n o t a v a ila b le in t e r n a lly ( t h o u g h w it h O C I, it c a n o f c o u r w r it in g u s e r p r o c e s s e s t h a t r u n e x t e r n a lly t o t h e d a t a b a s e .

2. B . I n a t h r e e - t i e r w e b a p p l i c a t i o n , t h e a p p l i c a t i o n s o f t w a r e r e s i d e s o n t h e m i d d l e t A is w r o n g b e c a u s e t h e c lie n t t ie r m a n a g e s o n ly t h e u s e r in t e r f a c e . C is w r o n g

Explain Relational Structures


3.

D . N o r m a liz a t io n is t h e p r o c e s s o f c o n v e r t in g d a t a t o t w o - d im e n s io n a l r e la t io n a l t a A , B , a n d C . H ie r a r c h ic a l, n e t w o r k , a n d o b je c t - o r ie n t e d d a t a b a s e s d o n o t im p le m n o r m a liz e d d a t a s t r u c t u r e s . C . M a n y - t o - m a n y r e la t io n s h ip s s h o u ld b e r e s o lv e d in t o o n e - t o - m a n y r e la t io n s h ip s i n s e r t i n g a n o t h e r e n t i t y b e t w e e n t h e t w o . A , B , a n d D . T h e s e a r e a ll a c c e p t a b le in t h e t h ir d n o r m a l f o r m m o d e l.

4.

Understand the SQL Language


5. 6.

A a n d B . S Q L h a s n o f a c ilit ie s f o r u s e r in t e r f a c e d e s ig n o r f o r f lo w c o n t r o l. C is w r o n g b e c a u s e o p e r a t io n s s u c h a s t h is a r e in h e r e n t in S Q L s s e t o r ie n t a t io n

B . T h e U P S E R T c o m m a n d d o e s n o t e x is t t h o u g h s o m e d e v e lo p e r s r e f e r t o a M E R o p e r a tio n a s a n U P S E R T A , C , D , a n d E . M E R G E , C O M M E N T , a n d S A V E P O IN T a r e a ll S Q L c o m m a n d s .

A p p r e c ia te th e D B A s R o le
7. B . D is k a d m in is t r a t io n is u s u a lly t h e r e s p o n s ib ilit y o f t h e s y s t e m a d m in is t r a t o r s , n d a t a b a s e a d m in is t r a t o r . A , C , a n d D . T h e s e a r e ty p ic a lly a ll p a r t o f th e D B A s w o r k .

LAB ANSWER
H a v in g a s s e m b le d t h e n e c e s s a r y it e m s , y o u a r e r e a d y t o p r o c e e d w it h y o u r s t u d ie s . E n jo

This page intentionally left blank

S-ar putea să vă placă și