Upload
nravi39763
View
222
Download
0
Embed Size (px)
Citation preview
8/20/2019 Managing User Content.ppt
1/63
IBM PureData System
for Analytics(Formerly known as, IBM Netezza)
-Ravi
http://www.etraining.guru/http://www.etraining.guru/
8/20/2019 Managing User Content.ppt
2/63
CREATE DATABASE
8/20/2019 Managing User Content.ppt
3/63
Default Database: SYSTEM
Default Database Template: MASTERDB
In !ete""a #orl$% DATABASE&CATA'(
Startin* in +,-,.% !ete""a supports t/e ability to $efine multiple sc/emas #it/in eac/ $atabase
In pre0ious releases 1i,e,% before +,-,.)% t/e !ete""a system supporte$ one $efault sc/ema per $atabase,
T/e $efault an$ only sc/ema matc/e$ t/e name of t/e $atabase user #/o create$ t/e $atabase
Enale Multi!le s"#ema su!!ort$
0i 2n"2$ata2post*res3l,conf
4ariable: enablesc/ema$boc/ec5
-: Sin*le sc/ema
6: Enables multiple sc/ema support in limite$ mo$e,
You #ill *et a #arnin*% if a 3uery references an in0ali$ sc/ema
7: Enables support for multiple sc/emas, 8sers can create% alter% set% an$ $rop sc/emas,
If a 3uery references an in0ali$ sc/ema% t/e 3uery returns an error
8/20/2019 Managing User Content.ppt
4/63
%ynta&$CREATE DATABASE name
9 IT; < 9 DE=A8'T C;ARACTER SET c/arset <
9 DE=A8'T C;ARACTER SET c/arset C(''ATI(! collation <
9 C(''ECT ;IST(RY 9 (! > (== < <
9 REP'ICATI(! SET name <
Create a $atabase% optionally a$$in* it to t/e specifie$ replication set,
E&am!le$SYSTEM1ADMI!)&? create $atabase trainin*$b@
CREATE DATABASE
%'%EM()*MIN+ l 'ist of $atabases DATABASE > (!ER
MASTERDB > ADMI!
SYSTEM > ADMI!
TRAI!I!DB > ADMI!
1. ro#s)
8/20/2019 Managing User Content.ppt
5/63
%'%EM()*MIN+&? c trainin*$bYou are no# connecte$ to $atabase trainin*$b
R)ININ/*B()*MIN+ select obi$% $atabase from 0$atabase@ (BID > DATABASE
7 > MASTERDB 6 > SYSTEM
7F+7G7 > TRAI!I!DB
1. ro#s)
R)ININ/*B()*MIN+ 30nz@netezza 12341456 n"stats type $atabase
DB I$ DB !ame Create Date (#ner I$ !um Tables !um 4ie#s !um Acti0e 8sers
6 SYSTEM 7-6766-+ -F:.G:-. F-- - - +
7 MASTERDB 7-6766-+ -F:.G:-. F-- - - -
7F+7G7 TRAI!I!DB 7-6H-676 -6:HG:F+ F-- 6 - -
)ny i7ea, w#ere t#is newly "reate7 7ataase store78 (In %9: 7isks (or+ Netezza #ost 7isks8+
2n"2$ata2base2$atabase obect i$?
8/20/2019 Managing User Content.ppt
6/63
/en #e create a $atabase% t/e system automatically creates . sc/emas:
I!=(RMATI(!SC;EMA
DE=I!ITI(!SC;EMA
(#ner Sc/ema?
I!=(RMATI(!SC;EMA J DE=I!ITI(!SC;EMA are use$ by t/e system to /ol$ information
about system obects an$ 0ie#s% but t/ey are not accessible by users,
T/e o#ner sc/ema is t/e $efault sc/ema
A $atabase name can be a maKimum of 67L bytes
Any user #/o is t/e o#ner of a $atabase automatically /as full pri0ile*es to all t/e obects in t/e$atabase,
Similarly% for systems t/at support multiple sc/emas in a $atabase% t/e sc/ema o#nerautomatically /as full pri0ile*es to all t/e obects in t/e sc/ema,
SET CATA'( $atabase name?
SET SC;EMA sc/ema name?
8/20/2019 Managing User Content.ppt
7/63
You can mana*e !ete""a $atabases usin*:
16) !SN'
17) !ete""a Performance Portal1.) !"A$min tool
1H) eb A$min Interface
1F) Data Connecti0ity applications li5e (DBC% DBC% an$ ('EDB, EK: A*inity or5benc/
8/20/2019 Managing User Content.ppt
8/63
CREATE TAB'E
8/20/2019 Managing User Content.ppt
9/63
%ynta&$
CREATE 9 TEMP(RARY > TEMP < TAB'E tablename
1 columnname type 9 9 constraintname < columnconstraint 9 constraintc/aracteristics < < 9% ,,, <
9 9 constraintname < tableconstraint 9 constraintc/aracteristics < < 9% ,,, <
) 9 DISTRIB8TE (! 1 column 9% ,,,< ) < 9 (RA!IE (! O 1 column 9% ,,,< ) > !(!E < 9 R( SEC8RITY <
Q
E&am!le$
TRAI!I!DB1ADMI!)&? $t!o relations foun$,
TRAI!I!DB1ADMI!)&? create table t6 1c6 int% c7 int) $istribute on ran$om@
CREATE TAB'E
TRAI!I!DB1ADMI!)&? $t
'ist of relations
!ame > Type > (#ner
T6 > TAB'E > ADMI!
16 ro#)
/en you create a table% it $oesnt consume any space on $ataslices
Space in $ataslices #ill be allocate$ only #/en you insert ro#s,
8/20/2019 Managing User Content.ppt
10/63
E&tent size$ . MB
Eac/ eKtent is $i0i$e$ into 7H67LB pa*es 1also calle$ bloc5)
)"tion Item$ 'o*in to !ADMI! an$ #atc/ space *ettin* allocate$ t/e moment you insert ro#s in a table
8/20/2019 Managing User Content.ppt
11/63
C/ec5point TimeU
Test our learnin*s:
16) Create a ne# $atabase
17) =in$ out its obect ID1.) Create a table 18sin* /as/2ran$om $istribution), C/ec5 if any space allocation t/rou*/ !ADMI
1H) Insert a ne# ro#, !o# c/ec5 space allocation t/rou*/ !ADMI!
1F) Insert anot/er ro#, !o# c/ec5 space allocation t/rou*/ !ADMI!
8/20/2019 Managing User Content.ppt
12/63
!ETEA DATATYPES
8/20/2019 Managing User Content.ppt
13/63
;#at is a *ataty!e8
A $atatype represents a set of 0alues
Eac/ column can /a0e only one $atatype, You cant miK $atatypes #it/ a column
8/20/2019 Managing User Content.ppt
14/63
1. )!!ro&imate numeri" 7ata ty!es$
Dont use =loatin* point $ata types for $istribution columns% oin columns% or for columns t/at re3uiremat/ematical operations suc/ as S8M an$ A4
!ete""a cant run a fast /as/ oin on a floatin* point $ata type% but instea$ must run a slo#er sort an$
mer*e oin
8/20/2019 Managing User Content.ppt
15/63
4. =#ara"ter %tring 7ata ty!es$
To $etermine t/e optimal c/aracter $ata type% use t/e belo# 3uery:
SE'ECT MAV 1 'E!T;1TRIM1columnname)))% A4 1'E!T; 1TRIM 1columnname))) =R(M tablename@
If MAV1'E!T;) ? C;AR && ? C;AR instea$ of 4ARC;AR
If A4 len*t/ 7 C;AR && ? use 4ARC;AR instea$ of C;AR
8/20/2019 Managing User Content.ppt
16/63
>. Boolean 7ata ty!es$
You can use follo#in* #or$s to specify booleans:WTrue or falseW(n or off WX- or X6
Wtrue or XfalseWXt or XfWXon or XoffWXyes or Xno
!e0er use a Boolean $ata type for $istribution columns
8/20/2019 Managing User Content.ppt
17/63
2. em!oral 7ata ty!es$
8/20/2019 Managing User Content.ppt
18/63
?. Binary 7ata ty!es$
!ete""a supports t#o types of binary $ata types:
8/20/2019 Managing User Content.ppt
19/63
!ete""a Internal Data Types
!ete""a reser0es belo# column names as internal $ata types:
8/20/2019 Managing User Content.ppt
20/63
Ro# Si"e
=or e0ery ro# of e0ery table% t/ere is a 7Hbyte fiKe$ o0er/ea$ of t/e ro#i$% createKi$% an$ $eleteKi$,
If you /a0e any nullable columns% a null 0ector is re3uire$ an$ it is !2L bytes #/ere ! is t/e number
of columns in t/e recor$, T/e system roun$s up t/e si"e of t/is /ea$er to a multiple of H bytes,
In a$$ition% t/e system a$$s a recor$ /ea$er of H bytes if any of t/e follo#in* is true:WColumn of type 4ARC;ARWColumn of type C;AR #/ere t/e len*t/ is *reater t/an 6G 1store$ internally as 4ARC;AR)WColumn of type !C;ARWColumn of type !4ARC;AR
T/e only time a recor$ $oes not contain a /ea$er is if all t/e columns are $efine$ as !(T !8''%
t/ere are no c/aracter $ata types lar*er t/an 6G bytes% an$ no 0ariable c/aracter $ata types
8/20/2019 Managing User Content.ppt
21/63
Data types $escription
8/20/2019 Managing User Content.ppt
22/63
SY!(!YMS
8/20/2019 Managing User Content.ppt
23/63
An alternati0e #ay of referencin* tables% 0ie#s% or functions
Allo#s us to create easily type$ names for lon* obect names
You can use follo#in* synonym comman$s:
Create Synonym
Drop Synonym
Alter Synonym
rant Synonym
Re0o5e Synonym
%ynta&$ %'%EM()*MIN+ / create synonymComman$: CREATE SY!(!YM
Description: Creates a ne# synonym
SyntaK:
CREATE SY!(!YM name =(R refname
E&am!le$ %'%EM()*MIN+ create synonym ss5e#stu$ent for s5e#,,stu$ent@CREATE SY!(!YM
8/20/2019 Managing User Content.ppt
24/63
o 7is!lay synonyms$ %'%EM()*MIN+ $y 'ist of relations
!ame > Type > (#ner
SSEST8DE!T > SY!(!YM > ADMI!
16 ro#)
%'%EM()*MIN+ alter synonym ss5e#stu$ent rename to sstu$ents5e#@ A'TER SY!(!YM
%'%EM()*MIN+ alter synonym sstu$ents5e# o#ner to RA@
A'TER SY!(!YM%'%EM()*MIN+ $y 'ist of relations
!ame > Type > (#ner
SST8DE!TSE > SY!(!YM > RA
16 ro#)
%'%EM()*MIN+ $rop synonym sstu$ents5e#SYSTEM1ADMI!)? @
DR(P SY!(!YM
%'%EM()*MIN+ $y!o relations foun$,
%'%EM()*MIN+
8/20/2019 Managing User Content.ppt
25/63
4IES
8/20/2019 Managing User Content.ppt
26/63
A 0ie# is simply t/e representation of a SN' statement t/at is store$ in memory so t/at it can be easily reuse
=or eKample: If #e fre3uently issue t/e follo#in* 3uery:
SE'ECT stu$ent,si$% stu$ent,sname% mar5s,per from stu$ent% mar5s #/ere stu$ent,si$ & mar5s,si$@
e can create /ere a 0ie# as belo#:
CREATE 4IE 0stu$entmar5s AS SE'ECT stu$ent,si$% stu$ent,sname% mar5s,per from stu$ent% mar5s
;ERE stu$ent,si$ & mar5s,si$@
=rom neKt time on#ar$s% #e can simply select from 0ie# as belo#:
SE'ECT =R(M 0stu$entmar5s@
%ynta&$SYSTEM1ADMI!)&? / create 0ie#
Comman$: CREATE 4IE
Description: Constructs a 0irtual table
SyntaK:CREATE 4IE 0ie# AS SE'ECT 3uery
Creates a ne# 0ie#,
CREATE (R REP'ACE 4IE 0ie# AS SE'ECT 3uery
Creates a ne# 0ie# or replaces an eKistin* 0ie#,
8/20/2019 Managing User Content.ppt
27/63
Materiali"e$ 4ie#s
8/20/2019 Managing User Content.ppt
28/63
Sorte$% Proecte$% an$ Materiali"e$ 1SPM) 0ie#s
Proects subset of tables columns% $oes sort% an$ stores on $is5
%ynta&$SYSTEM1ADMI!)&? / create materiali"e$ 0ie#
Comman$: CREATE MATERIA'IED 4IE
Description: Creates a ne# materiali"e$ 0ie#
SyntaK:
CREATE MATERIA'IED 4IE 0ie# AS SE'ECT column 9% ,,,< =R(M table 9 (RDER BY column 9% ,,,< <
Creates a ne# materiali"e$ 0ie#,
CREATE (R REP'ACE MATERIA'IED 4IE 0ie# AS SE'ECT column 9% ,,,<
=R(M table 9 (RDER BY column 9% ,,,< <
Creates a ne# materiali"e$ 0ie# or replaces an eKistin* materiali"e$ 0ie#,
SPM 0ie#s are use$ to impro0e 3uery performance si*nificantly
If selecte$ column eKists in materiali"e$ 0ie#% optimi"er selects t/e $ata from materiali"e$ 0ie#
instea$ of *oin* t/rou*/ base table
8/20/2019 Managing User Content.ppt
29/63
=e# Restrictions:
(nly one base table in t/e =R(M clause
!o ;ERE clause !o eKpressions are allo#e$ in materiali"e$ 0ie# columns
(nly user table as base table for SPM 0ie#, Dont specifiy CBT% system table% etc as base table
/en you insert a ne# recor$ in base table% same #ill be inserte$ into materiali"e$ 0ie# table as #ell,
So% as time *oes on% #e #ill be /a0in* unsorte$ recor$s *ettin* appen$e$ to materiali"e$ 0ie# table at t/e en$
So% #e s/oul$ perio$ically manually refres/ SPM 0ie# by suspen$in* an$ refres/in* it,
A'TER 4IE MST8DE!TSE MATERIA'IE RE=ERES;@
SE1ADMI!)&? create materiali"e$ 0ie# mstu$ents5e# as select SID% S!AME from stu$ent or$er by si$@
CREATE MATERIA'IED 4IE
SE1ADMI!)&? $m
'ist of relations
!ame > Type > (#ner > STATE
MST8DE!TSE > MATERIA'IED 4IE > ADMI! > ACTI4E
16 ro#)
Settin* Referes/ T/res/ol$: SET SYSTEM DE=A8'T MATERIA'IE T;RES;('D T( number?
8/20/2019 Managing User Content.ppt
30/63
/en you use A'TER 4IES (! MATERIA'IE RE=RES;: T/e system refres/es all suspen$e$ 0ie#s% an$
all nonsuspen$e$ 0ie#s #/ose unsorte$ $ata /as eKcee$e$ t/e refres/ t/res/ol$,
Settin* Refres/ T/res/ol$: SET SYSTEM DE=A8'T MATERIA'IE T;RES;('D T( number?
T/e T;RES;('D specifies t/e Z of unsorte$ $ata in t/e materiali"e$ 0ie#, Default: 7-
You can set t/res/ol$ from 6 to [[,
/ A'TER 4IE
8/20/2019 Managing User Content.ppt
31/63
!"bac5up comman$ ust bac5s up SPM 0ie# $efinition% not t/e SPM 0ie#specific $ata
!"restore automatically creates2populates materiali"e$ 0ie#s from base tables unless t/e SPM 0ie# is in
suspen$ state,
one maps for (RDER BY columns in materiali"e$ 0ie#s are create$,
Best Practices:
8se most fre3uently use$ an$ most fre3uently restricte$ columns
E0en t/ou*/ you can /a0e more t/an one materiali"e$ 0ie# on a table% restrict t/is number
'imit columns in materiali"e$ 0ie#s to as less as possible
8/20/2019 Managing User Content.ppt
32/63
System 4ie#s
8/20/2019 Managing User Content.ppt
33/63
T/ere are ! number of catalo* 0ie#s in !ete""a, 'ets loo5 at fe# of t/em /ere:
vview$ To 5no# #/at are a0ailable 0ie#s in t/e !ete""a
v7ataase$ All $atabases information
vuser$ About users information in t/e !ete""a system
vtale$ 'ist of tables, Bot/ system tables J Mana*ement Tables
RA4I1ADMI!)&? select obi$% tablename from 0table #/ere tablename&\C8ST(MER\@ (BID > TAB'E!AME
7.G.FH > C8ST(MER
16 ro#)
vrelation"olumn$ Table2column mappin*RA4I1ADMI!)&? select (BID% !AME% ATT!AME from 0relationcolumn #/ere obi$&7.G.FH@
(BID > !AME > ATT!AME
7.G.FH > C8ST(MER > C.
7.G.FH > C8ST(MER > C7
7.G.FH > C8ST(MER > C6
1. ro#s)
8/20/2019 Managing User Content.ppt
34/63
voAe"ts$ 'ists $ifferent obects li5e tables% 0ie#s% functions% etc
vrystat$ currently runnin* 3ueries statistics
vry#ist$ ;istory of #/at /as been run
vaggregate$ Returns a list of all $efine$ a**re*ates
v7ataty!e$ all system $atatypes
vfun"tion$ All $efine$ functions
vgrou!$ 'ist of all *roups
vsysteminfo$ System information suc/ as systemstatus% 0ersion info% etc
vin7e&: 'ist of all user in$eKes vo!erator$ 'ist of all $efine$ operators
vrelation"olumn7ef$ Returns a list of all attributes of a relation t/at /as $efine$ $efaults
8/20/2019 Managing User Content.ppt
35/63
vseuen"e$ Returns a list of all $efine$ se3uences
vtalein7e&$ Returns a list of all user table in$eKes
vuser$ Returns a list of all users 1$u)
vusergrou!s$ Returns a list of all *roups of #/ic/ t/e user is a member
vgrou!users$ list of all users of a *roup
vsysgrou!!riv$ Returns a list of all $efine$ *roup pri0ile*es, 1$p* *roupname)
vsysin7e&$ Returns a list of all system in$eKes 1$Si)
vsys!riv: Returns a list of all user pri0ile*es, 1$p user?)
vsystale: Returns a list of all system tables, 1$St)
vsysuser!riv: list permissions *rante$ to a user, 1$pu user?)
vsysview: Returns a list of all system 0ie#s, 1$S0)
8/20/2019 Managing User Content.ppt
36/63
8/20/2019 Managing User Content.ppt
37/63
8SERS R(8PS PRI4I'EES
8/20/2019 Managing User Content.ppt
38/63
!ete""a Database 8sers
To access t/e !ete""a $atabase% users must /a0e !ete""a $atabase user accounts
Remember% no nee$ for any (S le0el useri$sU
/en a user accesses !ete""a $atabases% !ete""a $etermines t/e access pri0ile*es to $atabase obectsan$ t/e a$ministrati0e permissions to 0arious tas5s an$ capabilities
Create 8ser EKample:
8/20/2019 Managing User Content.ppt
39/63
Create 8ser 1SyntaK)
8/20/2019 Managing User Content.ppt
40/63
;#y "anCt I "reate an user like t#is8
Yes% users are *lobal obects an$ a *lobal obect 1$atabase) alrea$y /as t/e same name
8/20/2019 Managing User Content.ppt
41/63
!ete""a Database roups
roups are $esi*ne$ to allo# a$ministrators to *roup users by $epartment or functionality
By $efault% t/ere is a pre$efine$ *roup calle$ P8B'IC, As users are create$ t/ey are automatically a$$e$
To t/e *roup P8B'IC,
8sers cannot be remo0e$ from t/e *roup public% or $rop t/e *roup public,
8sers can be members of many *roups@ /o#e0er% *roups cannot be members of ot/er *roups,
roups% users% an$ $atabases s/are a common name space so *roup% user an$ $atabase names
must be uni3ue,
=or eKample: You cannot /a0e a *roup name RA4I% a user name RA4I% an$ a $atabase name RA4I
Dow 7o you 7is!lay list of grou!s8
8/20/2019 Managing User Content.ppt
42/63
roups Creation 1SyntaK)
8/20/2019 Managing User Content.ppt
43/63
CREATE R(8P28SER 1EKamplesU)
8/20/2019 Managing User Content.ppt
44/63
CREATE R(8P28SER 1EKamplesU)
CREATE R(8P28SER 1E l U)
8/20/2019 Managing User Content.ppt
45/63
CREATE R(8P28SER 1EKamplesU)
D f lt U & P d
8/20/2019 Managing User Content.ppt
46/63
n"1n"): 'inuK user% not eKpose$ to !PS client users
a$min1pass#or$): !PS $atabase superuser for t/e !PS /ost soft#are% #it/ full accessto all system functions an$ obects at all times
root1!ete""a): 'inuK superuser #/ic/ pro0i$es system root lo*in
Default Users & Passwords
T/e $efault $atabase *roup is calle$ !uli", All users are automatically assi*ne$ asmembers of t/e public *roup, You cannot $elete t/e public *roup% or remo0e users from
it,
P i il
8/20/2019 Managing User Content.ppt
47/63
Privileges
!ete""a /as t#o types of pri0ile*es:
16) (bect Pri0ile*es
17) A$ministrati0e Pri0ile*es
(bect pri0ile*es apply to in$i0i$ual obect instances, A$ministrati0e pri0ile*es apply to t/e system as
a #/ole,
ist of Ae"t 9rivileges$
)ort$ Allo#s t/e user to abort sessions, i,e,% you can use nzsession comman$
)ll$ Allo#s t/e user to /a0e all t/e obect pri0ile*es
)lter$ Allo#s t/e user to mo$ify t/e obect attributes
*elete$ Allo#s t/e user to $elete table ro#s
*ro!$ Allo#s t/e user to $rop all obects
E&e"ute$ Allo#s t/e user to eKecute 8D=s an$ 8DAs in SN' 3ueries/en%tats$ Allo#s t/e user to *enerate statistics on tables2$atabases
/room$ Allo#s t/e user to run R((M TAB'E comman$
Insert$ Allo#s t/e user to insert ro#s into a table
Pri ileges
8/20/2019 Managing User Content.ppt
48/63
ist$ Allo#s t/e user to $isplay an obect name
%ele"t$ Allo#s t/e user to select 1or 3uery) ro#s #it/in a table
run"ate$ Allo#s t/e user to $elete all ro#s from a table
:!7ate$ Allo#s t/e user to mo$ify table ro#s
ist of )7ministrator 9rivileges$
Ba"ku!$ Allo#s t/e user to perform bac5ups, T/e user can run nza"ku! comman$
0=reate5 )ggregate$ Allo#s t/e user to create user$efine$ a**re*ates 18DAs) an$ to operateon
eKistin* 8DAs,0=reate5 *ataase$ Allo#s t/e user to create a $atabases
0=reate5 E&ternal ale$ Allo#s t/e user to create eKternal tables, Permissions to operate oneKistin* tables is controlle$ by obect pri0ile*es,
0=reate5 Fun"tion$ Allo#s t/e user to create user$efine$ functions 18D=s) an$ to operate oneKistin* 8D=s,
0=reate5 /rou!$ Allo#s t/e user to create *roups, Permissions to operate on eKistin* *roups iscontrolle$ by obect pri0ile*es
Privileges
Privileges
8/20/2019 Managing User Content.ppt
49/63
0=reate5 In7e&$ =or system use only, 8ser cannot create in$eKes
0=reate5 irary$ Allo#s t/e user to create user$efine$ s/are$ libraries,
0=reate5 Materialize7 Giew$ Allo#s t/e user to create Materiali"e$ 0ie#s
0=reate5 9ro"e7ure$ Allo#s t/e user to create store$ proce$ures
0=reate5 %euen"e$ Allo#s t/e user to create se3uences
0=reate5 %ynonym$ Allo#s t/e user to create synonyms
0=reate5 ale$ Allo#s t/e user to create tables
0=reate5 em! ale$ Allo#s t/e user to create temporary tables
0=reate5 :ser$ Allo#s t/e user to create users
0=reate5 Giew$ Allo#s t/e user to create 0ie#s
0Manage5 Dar7ware$ Allo#s t/e user to $o t/e follo#in* /ar$#arerelate$ operations: 4ie#/ar$#are status% mana*e SP8s% mana*e topolo*y an$ mirrorin*% an$ run $ia*nostic tests, T/e
user can run nz7s an$ nz#w comman$s
Privileges
Privileges
8/20/2019 Managing User Content.ppt
50/63
0Manage5 %e"urity$ Allo#s t/e user to run comman$s an$ operations t/at relate to /istory$atabases suc/ as creatin* an$ cleanin* up /istory $atabases
0Manage5 %ystem$ Allo#s t/e user to $o mana*ement operations, =or eKample: n"system%n"state% n"stats% an$ n"session priority
restore$ Allo#s t/e user to restore t/e system, can run nzrestore comman$
:nfen"e$ Allo#s t/e user to create an unfence$ user$efine$ function 18D=) or user$efine$a**re*ate18D=)
Privileges
Grant Syntax
8/20/2019 Managing User Content.ppt
51/63
Grant Syntax
Grant Example (Obj t P i il !
8/20/2019 Managing User Content.ppt
52/63
Grant Example (Objet Privilege!
Grant Example ("d i P i il !
8/20/2019 Managing User Content.ppt
53/63
Grant Example ("dmin Privilege!
#E$O%E Syntax
8/20/2019 Managing User Content.ppt
54/63
#E$O%E Syntax
8/20/2019 Managing User Content.ppt
55/63
SN' IDE!TI=IERS
Types of I$entifiers
8/20/2019 Managing User Content.ppt
56/63
Types of I$entifiers
T/ere are 7 types of I$entifiers in !ete""a
W Re*ular I$entifiers
W Are caseinsensiti0e
W Are con0erte$ to $efault system case
W =or eKample: Sales an$ SA'ES are t/e e3ui0alent
W Delimite$ I$entifiers
W Are enclose$ in $ouble3uotation mar5s
W Are casesensiti0e
W Are not con0erte$ to $efault system case
W =or eKample: Sales] an$ SA'ES] are $ifferent
Types of I$entifiers 1Re*ular I$entifier EKample)
8/20/2019 Managing User Content.ppt
57/63
Types of I$entifiers 1Re*ular I$entifier EKample)
Types of I$entifiers 1Delimite$ I$entifier EKample)
8/20/2019 Managing User Content.ppt
58/63
Types of I$entifiers 1Delimite$ I$entifier EKample)
8/20/2019 Managing User Content.ppt
59/63
SEN8E!CE
8/20/2019 Managing User Content.ppt
60/63
/at is a se3uence^
A se3uence is a name$ obect in a $atabase t/at can be use$ to *enerate uni3ue numbers
A se3uence may be byteint% smallint% inte*er% bi*int
You can use se3uence 0alues #/ere0er you #oul$ use numeric 0alues
You can create% alter% an$ $rop name$ se3uences
SyntaK:
CREATE SEN8E!CE se3uencename AS $atatype
9options?
8/20/2019 Managing User Content.ppt
61/63
8/20/2019 Managing User Content.ppt
62/63
Se3uences $o not support cross $atabase access@ you cannot obtain a se3uence 0aluefrom a se3uence $efine$ in a $ifferent $atabase,
8/20/2019 Managing User Content.ppt
63/63
Nuestions^