Sunteți pe pagina 1din 105

http://rainbowonnet.blogspot.com/2007/03/oracle-interview-questions-and-answers_8500.

html
What are the components of physical database structure of Oracle database?
racle database is comprised o" three t#pes o" "iles. ne or more data"iles$ two are more redo log
"iles$ and one or more control "iles.
What are the components of logical database structure of Oracle database?
%here are tablespaces and databases schema ob&ects.
What is a tablespace?
' database is divided into (ogical )torage *nit called tablespaces. ' tablespace is used to
grouped related logical structures together.
What is SYSTEM tablespace and when is it created?
+ver# racle database contains a tablespace named ),)%+-$ which is automaticall# created
when the database is created. %he ),)%+- tablespace alwa#s contains the data dictionar# tables
"or the entire database.
Explain the relationship among database, tablespace and data file ?
+ach databases logicall# divided into one or more tablespaces one or more data "iles are
e.plicitl# created "or each tablespace.
What is schema?
' schema is collection o" database objects o" a user.
What are Schema Obects?
)chema ob&ects are the logical structures that directl# re"er to the database/s data. )chema
ob&ects include tables$ views$ sequences$ s#non#ms$ inde.es$ clusters$ database triggers$
procedures$ "unctions pac0ages and database lin0s.
!an obects of the same schema reside in different tablespaces?
,es.
!an a tablespace hold obects from different schemes?
,es.
What is Oracle table?
' table is the basic unit o" data storage in an racle database. %he tables o" a database hold all
o" the user accessible data. %able data is stored in rows and columns.
What is an Oracle "iew?
' view is a virtual table. +ver# view has a quer# attached to it. 1%he quer# is a )+(+2%
statement that identi"ies the columns and rows o" the table1s3 the view uses.3
What is #artial $ac%up ?
' 4artial 5ac0up is an# operating system bac0up short o" a "ull bac0up$ ta0en while the
database is open or shut down.
What is Mirrored on&line 'edo (og ?
' mirrored on-line redo log consists o" copies o" on-line redo log "iles ph#sicall# located on
separate dis0s$ changes made to one member o" the group are made to all members
What is )ull $ac%up ?
' "ull bac0up is an operating s#stem bac0up o" all data "iles$ on-line redo log "iles and control
"ile that constitute 6'2(+ database and the parameter.
!an a *iew based on another *iew ?
,es.
!an a Tablespace hold obects from different Schemes ?
,es.
!an obects of the same Schema reside in different tablespace ?
7
,es.
What is the use of !ontrol )ile ?
8hen an instance o" an 6'2(+ database is started$ its control "ile is used to identi"# the
database and redo log "iles that must be opened "or database operation to proceed. 9t is also used
in database recovery.
+o *iew contain +ata ?
:iews do not contain or store data.
What are the 'eferential actions supported by )O'E,-. /EY integrity constraint ?
*4;'%+ and ;+(+%+ 6estrict - ' re"erential integrit# rule that disallows the update or
deletion o" re"erenced data. ;+(+%+ 2ascade - 8hen a re"erenced row is deleted all associated
dependent rows are deleted.
What are the type of Synonyms?
%here are two t#pes o" )#non#ms 4rivate and 4ublic.
What is a 'edo (og ?
%he set o" 6edo (og "iles ,);'%+$*9;$*)+6 or *)+6+<: SQL "unctions$ or the pseudo
columns (+:+( or 68<*-.
What is an ,ndex Segment ?
+ach 9nde. has an 9nde. segment that stores all o" its data.
Explain the relationship among +atabase, Tablespace and +ata file?
+ach databases logicall# divided into one or more tablespaces one or more data "iles are
e.plicitl# created "or each tablespace
What are the different type of Segments ?
;ata )egment$ 9nde. )egment$ 6ollbac0 )egment and %emporar# )egment.
What are !lusters ?
2lusters are groups o" one or more tables ph#sicall# stores together to share common columns
and are o"ten used together.
What is an ,ntegrity !onstrains ?
'n integrit# constraint is a declarative wa# to de"ine a business rule "or a column o" a table.
What is an ,ndex ?
'n 9nde. is an optional structure associated with a table to have direct access to rows$ which can
be created to increase the per"ormance o" data retrieval. 9nde. can be created on one or more
columns o" a table.
What is an Extent ?
'n +.tent is a speci"ic number o" contiguous data bloc0s$ obtained in a single allocation$ and
used to store a speci"ic t#pe o" in"ormation.
What is a *iew ?
' view is a virtual table. +ver# view has a =uer# attached to it. 1%he =uer# is a )+(+2%
statement that identi"ies the columns and rows o" the table1s3 the view uses.3
What is Table ?
' table is the basic unit o" data storage in an 6'2(+ database. %he tables o" a database hold
all o" the user accessible data. %able data is stored in rows and columns.
!an a "iew based on another "iew?
,es.
What are the ad"antages of "iews?
- 4rovide an additional level o" table securit#$ b# restricting access to a predetermined set o"
rows and columns o" a table.
2
- >ide data comple.it#.
- )impli"# commands "or the user.
- 4resent the data in a di""erent perspective "rom that o" the base table.
- )tore comple. queries.
What is an Oracle se0uence?
' sequence generates a serial list o" unique numbers "or numerical columns o" a database/s
tables.
What is a synonym?
' s#non#m is an alias "or a table$ view$ sequence or program unit.
What are the types of synonyms?
%here are two t#pes o" s#non#ms private and public.
What is a pri"ate synonym?
nl# its owner can access a private s#non#m.
What is a public synonym?
'n# database user can access a public s#non#m.
What are synonyms used for?
- -as0 the real name and owner o" an ob&ect.
- 4rovide public access to an ob&ect
- 4rovide location transparenc# "or tables$ views or program units o" a remote database.
- )impli"# the SQL statements "or database users.
What is an Oracle index?
'n inde. is an optional structure associated with a table to have direct access to rows$ which can
be created to increase the per"ormance o" data retrieval. 9nde. can be created on one or more
columns o" a table.
1ow are the index updates?
9nde.es are automaticall# maintained and used b# racle. 2hanges to table data are
automaticall# incorporated into all relevant inde.es.
What is a Tablespace?
' database is divided into (ogical )torage *nit called tablespace. ' tablespace is used to
grouped related logical structures together
What is 'ollbac% Segment ?
' ;atabase contains one or more 6ollbac0 )egments to temporaril# store ?undo@ in"ormation.
What are the !haracteristics of Data Files ?
' data "ile can be associated with onl# one database. nce created a data "ile can/t change siAe.
ne or more data "iles "orm a logical unit o" database storage called a tablespace.
1ow to define +ata $loc% si2e ?
' data bloc0 siAe is speci"ied "or each ORACLE database when the database is created. '
database users and allocated "ree database space in 6'2(+ data bloc0s. 5loc0 siAe is speci"ied
in 9<9%.6' "ile and can/t be changed latter.
What does a !ontrol file !ontain ?
' 2ontrol "ile records the ph#sical structure o" the database. 9t contains the "ollowing
in"ormation.
;atabase <ame
<ames and locations o" a database/s "iles and redolog "iles.
%ime stamp o" database creation.
What is difference between 3.,43E constraint and #',M5'Y /EY constraint ?
3
' column de"ined as *<9=*+ can contain <ulls while a column de"ined as 469-'6, B+,
can/t contain <ulls.
What is ,ndex Cluster ?
' 2luster with an inde. on the 2luster Be#
When does a Transaction end ?
8hen it is committed or 6ollbac0ed.
What is the effect of setting the "alue 65((7'OWS8 for O#T,M,9E'7-O5( parameter
of the 5(TE' SESS,O. command ? What are the factors that affect O#T,M,9E' in
choosing an Optimi2ation approach ?
'nswer %he 4%9-9C+6_-;+ initialiAation parameter )tatistics in the ;ata ;ictionar# the
4%9-9C+6_D'( parameter o" the '(%+6 )+))9< command hints in the statement.
What is the effect of setting the "alue 6!1OOSE8 for O#T,M,9E'7-O5(, parameter of
the 5(TE' SESS,O. !ommand ?
%he ptimiAer chooses 2ost_based approach and optimiAes with the goal o" best throughput i"
statistics "or atleast one o" the tables accessed b# the )=( statement e.ist in the data dictionar#.
therwise the 4%9-9C+6 chooses 6*(+_based approach.
1ow does one create a new database? :for +$5;
ne can create and modi"# racle databases using the racle ?dbca@ 1;atabase 2on"iguration
'ssistant3 utilit#. %he dbca utilit# is located in the E6'2(+_>-+/bin director#. %he racle
*niversal 9nstaller 1oui3 normall# starts it a"ter installing the database server so"tware.
ne can also create databases manuall# using scripts. %his option$ however$ is "alling out o"
"ashion$ as it is quite involved and error prone. (oo0 at this e.ample "or creating and racle Fi
database:
2<<+2% ),) ') ),);5'
'(%+6 SYSTEM )+% ;5_26+'%+_G9(+_;+)%H//u07/oradata//I
'(%+6 ),)%+- )+% ;5_26+'%+_<(9<+_(D_;+)%_7H//u02/oradata//I
'(%+6 ),)%+- )+% ;5_26+'%+_<(9<+_(D_;+)%_2H//u03/oradata//I
26+'%+ ;'%'5')+I
What database bloc% si2e should , use? :for +$5;
racle recommends that #our database bloc0 siAe match$ or be multiples o" #our operating
s#stem bloc0 siAe. ne can use smaller bloc0 siAes$ but the per"ormance cost is signi"icant. ,our
choice should depend on the t#pe o" application #ou are running. 9" #ou have man# small
transactions as with (%4$ use a smaller bloc0 siAe. 8ith "ewer but larger transactions$ as with a
;)) application$ use a larger bloc0 siAe. 9" #ou are using a volume manager$ consider #our
?operating system bloc0 siAe@ to be 8B. %his is because volume manager products use 8B
bloc0s 1and this is not con"igurable3.
What are the different approaches used by Optimi2er in choosing an execution plan ?
6ule-based and 2ost-based.
What does 'O(($5!/ do ?
6((5'2B retracts an# o" the changes resulting "rom the )=( statements in the transaction.
1ow does one coalesce free space ? :for +$5;
)-< coalesces "ree space 1e.tents3 into larger$ contiguous e.tents ever# 2 hours and even
then$ onl# "or a short period o" time.
)-< will not coalesce "ree space i" a tablespace/s de"ault storage parameter ?pctincrease@ is
set to 0. 8ith racle 7.3 one can manuall# coalesce a tablespace using the '(%+6
%'5(+)4'2+ ... 2'(+)2+I command$ until then use:
J
)=(K alter session set events Limmediate trace name coalesce level n/I
8here Ln/ is the tablespace number #ou get "rom )+(+2% %)M$ <'-+ G6- ),).%)EI
,ou can get status in"ormation about this process b# selecting "rom the
),).;5'_G6++_)4'2+_2'(+)2+; dictionar# view.
1ow does one pre"ent tablespace fragmentation? :for +$5;
'lwa#s set 42%9<26+')+ to 0 or 700.
5iAarre values "or 42%9<26+')+ will contribute to "ragmentation. Gor e.ample i" #ou set
42%9<26+')+ to 7 #ou will see that #our e.tents are going to have weird and wac0# siAes:
700B$ 700B$ 707B$ 702B$ etc. )uch e.tents o" biAarre siAe are rarel# re-used in their entiret#.
42%9<26+')+ o" 0 or 700 gives #ou nice round e.tent siAes that can easil# be reused. +.g..
700B$ 700B$ 200B$ J00B$ etc.
*se the same e.tent siAe "or all the segments in a given tablespace. (ocall# -anaged tablespaces
1available "rom 8i onwards3 with uni"orm e.tent siAes virtuall# eliminates an# tablespace
"ragmentation. <ote that the number o" e.tents per segment does not cause an# per"ormance
issue an#more$ unless the# run into thousands and thousands where additional 9/ ma# be
required to "etch the additional bloc0s where e.tent maps o" the segment are stored.
Where can one find the high water mar% for a table? :for +$5;
%here is no single s#stem table$ which contains the high water mar0 1>8-3 "or a table. '
table/s >8- can be calculated using the results "rom the "ollowing SQL statements:
)+(+2% 5(2B)
G6- ;5'_)+D-+<%)
8>+6+ 8<+6H*44+61owner3 '<; )+D-+<%_<'-+ H *44+61table3I
'<'(,C+ %'5(+ owner.table +)%9-'%+ )%'%9)%92)I
)+(+2% +-4%,_5(2B)
G6- ;5'_%'5(+)
8>+6+ 8<+6H*44+61owner3 '<; )+D-+<%_<'-+ H *44+61table3I
%hus$ the tables/ >8- H 1quer# result 73 - 1quer# result 23 - 7
<%+: ,ou can also use the ;5-)_)4'2+ pac0age and calculate the >8- H
%%'(_5(2B) - *<*)+;_5(2B) - 7.
What is !OST&based approach to optimi2ation ?
2onsidering available access paths and determining the most e""icient e.ecution plan based on
statistics in the data dictionar# "or the tables accessed b# the statement and their associated
clusters and inde.es.
What does !OMM,T do ?
2--9% ma0es permanent the changes resulting "rom all )=( statements in the transaction.
%he changes made b# the )=( statements o" a transaction become visible to other user sessions
transactions that start onl# a"ter transaction is committed.
1ow are extents allocated to a segment? :for +$5;
racle8 and above rounds o"" e.tents to a multiple o" 5 bloc0s when more than 5 bloc0s are
requested. 9" one requests 7NB or 2 bloc0s 1assuming a 8B bloc0 siAe3$ racle doesn/t round it
up to 5 bloc0s$ but it allocates 2 bloc0s or 7NB as requested. 9" one as0s "or 8 bloc0s$ racle will
round it up to 70 bloc0s.
)pace allocation also depends upon the siAe o" contiguous "ree space available. 9" one as0s "or 8
bloc0s and racle "inds a contiguous "ree space that is e.actl# 8 bloc0s$ it would give it #ou. 9" it
were F bloc0s$ racle would also give it to #ou. 2learl# racle doesn/t alwa#s round e.tents to a
multiple o" 5 bloc0s.
5
%he e.ception to this rule is locall# managed tablespaces. 9" a tablespace is created with local
e.tent management and the e.tent siAe is NJB$ then racle allocates NJB or 8 bloc0s assuming
8B-bloc0 siAe. racle doesn/t round it up to the multiple o" 5 when a tablespace is locall#
managed.
!an one rename a database user :schema;? :for +$5;
<o$ this is listed as +nhancement 6equest 758508. 8or0around:
;o a user-level e.port o" user '
create new user 5
9mport s#stem/manager "romuserH' touserH5
;rop user '
+efine Transaction ?
' %ransaction is a logical unit o" wor0 that comprises one or more SQL statements e.ecuted b#
a single user.
What is 'ead&Only Transaction ?
' 6ead-nl# transaction ensures that the results o" each quer# e.ecuted in the transaction are
consistant with respect to the same point in time.
What is a deadloc% ? Explain <
%wo processes wating to update the rows o" a table which are loc0ed b# the other process then
deadloc0 arises. 9n a database environment this will o"ten happen because o" not issuing proper
row loc0 commands. 4oor design o" "ront-end application ma# cause this situation and the
per"ormance o" server will reduce drasticall#.
%hese loc0s will be released automaticall# when a commit/rollbac0 operation per"ormed or an#
one o" this processes being 0illed e.ternall#.
What is a Schema ?
%he set o" ob&ects owned b# user account is called the schema.
What is a cluster /ey ?
%he related columns o" the tables are called the cluster 0e#. %he cluster 0e# is inde.ed using a
cluster inde. and its value is stored onl# once "or multiple tables in the cluster.
What is #arallel Server ?
-ultiple instances accessing the same database 1nl# 9n -ulti-24* environments3
What are the basic element of $ase configuration of an oracle Database ?
9t consists o"
one or more data "iles.
one or more control "iles.
two or more redo log iles.
%he ;atabase contains
multiple users/schemas
one or more rollbac0 segments
one or more tablespaces
;ata dictionar# tables
*ser ob&ects 1table$inde.es$views etc.$3
%he server that access the database consists o"
)D' 1;atabase bu""er$ ;ictionar# 2ache 5u""ers$ 6edo log bu""ers$ )hared )=( pool3
)-< 1System -<ito3
4-< 14rocess -<itor3
(D86 1(oD 8rite3
N
;586 1;ata 5ase 8rite3
'62> 1'62>iver3
2B4% 12hec0 4oint3
6+2
;ispatcher
*ser 4rocess with associated 4D)
What is clusters ?
Droup o" tables ph#sicall# stored together because the# share common columns and are o"ten
used together is called 2luster.
What is an ,ndex ? 1ow it is implemented in Oracle +atabase ?
'n inde. is a database structure used b# the server to have direct access o" a row in a table. 'n
inde. is automaticall# created when a unique o" primar# 0e# constraint clause is speci"ied in
create table comman 1:er 7.03
What is a +atabase instance ? Explain
' database instance 1)erver3 is a set o" memor# structure and bac0ground processes that access a
set o" database "iles.
%he process can be shared b# all users. %he memor# structure that are used to store most queried
data "rom database. %his helps up to improve database per"ormance b# decreasing the amount o"
9/ per"ormed against data ile.
What is the use of 5.5(Y9E command ?
%o per"orm one o" these "unction on an inde.$table$ or cluster:
- %o collect statistics about ob&ect used b# the optimiAer and store them in the data dictionar#.
- %o delete statistics about the ob&ect used b# ob&ect "rom the data dictionar#.
- %o validate the structure o" the ob&ect.
- %o identi"# migrated and chained rows o" the table or cluster.
What is default tablespace ?
%he %ablespace to contain schema ob&ects created without speci"#ing a tablespace name.
What are the system resources that can be controlled through #rofile ?
%he number o" concurrent sessions the user can establish the 24* processing time available to
the user/s session the 24* processing time available to a single call to 6'2(+ made b# a )=(
statement the amount o" logical 9/ available to the user/s session the amout o" logical 9/
available to a single call to 6'2(+ made b# a )=( statement the allowed amount o" idle time
"or the user/s session the allowed amount o" connect time "or the user/s session.
What is Tablespace 4uota ?
%he collective amount o" dis! space available to the ob&ects in a schema on a particular
tablespace.
What are the different (e"els of 5uditing ?
)tatement 'uditing$ 4rivilege 'uditing and b&ect 'uditing.
What is Statement 5uditing ?
)tatement auditing is the auditing o" the power"ul s#stem privileges without regard to
speci"icall# named ob&ects.
What are the database administrators utilities a"ailable ?
)=( O ;5' - %his allows ;5' to monitor and control an 6'2(+ database. )=( O (oader - 9t
loads data "rom standard operating system "iles 1Glat "iles3 into 6'2(+ database tables.
+.port 1+P43 and 9mport 1imp3 utilities allow #ou to move e.isting data in 6'2(+ "ormat to
and "rom 6'2(+ database.
7
1ow can you enable automatic archi"ing ?
)hut the database
5ac0up the database
-odi"#/9nclude (D_'62>9:+_)%'6%_%6*+ in init.ora "ile.
)tart up the database.
What are roles? 1ow can we implement roles ?
6oles are the easiest wa# to grant and manage common privileges needed b# di""erent groups o"
database users. 2reating roles and assigning provides to roles. 'ssign each role to group o" users.
%his will simpli"# the &ob o" assigning privileges to individual users.
What are 'oles ?
6oles are named groups o" related privileges that are granted to users or other roles.
What are the use of 'oles ?
6+;*2+; D6'<%9<D G 469:9(+D+) - 6ather than e.plicitl# granting the same set o"
privileges to man# users a database administrator can grant the privileges "or a group o" related
users granted to a role and then grant onl# the role to each member o" the group.
;,<'-92 469:9(+D+ -'<'D+-+<% - 8hen the privileges o" a group must change$ onl#
the privileges o" the role need to be modi"ied. %he securit# domains o" all users granted the
group/s role automaticall# re"lect the changes made to the role.
)+(+2%9:+ ':'9('59(9%, G 469:9(+D+) - %he roles granted to a user can be
selectivel# enable 1available "or use3 or disabled 1not available "or use3. %his allows speci"ic
control o" a user/s privileges in an# given situation.
'44(92'%9< '8'6+<+)) - ' database application can be designed to automaticall#
enable and disable selective roles when a user attempts to use the application.
What is #ri"ilege 5uditing ?
4rivilege auditing is the auditing o" the use o" power"ul s#stem privileges without regard to
speci"icall# named ob&ects.
What is Obect 5uditing ?
b&ect auditing is the auditing o" accesses to speci"ic schema ob&ects without regard to user.
What is 5uditing ?
-onitoring o" user access to aid in the investigation o" database use.
1ow does one see the uptime for a database? :for +$5 ;
(oo0 at the "ollowing )=( quer#:
)+(+2% to_char 1startup_time$/;;--<-,,,, >>2J: -9: ))/3 ?;5 )tartup %ime@
G6- s#s.v_EinstanceI
-arco 5ergman provided the "ollowing alternative solution:
)+(+2% to_char 1logon_time$/;# dd -on >>2J: -9: ))/3 ?;5 )tartup %ime@
G6- s#s.v_Esession
8>+6+ )idH7 /O this is pmon O/
/
*sers still running on racle 7 can tr# one o" the "ollowing queries:
2olumn )%'6%+; "ormat a78 head L)%'6%*4 %9-+/
)elect 2.9<)%'<2+$
to_date 1Q*(.:'(*+$ LQ/3
RR to_char 1"loor 1)+2.:'(*+/3N003$ L0F/3
RR L:/
-- RR )ubstr 1to_char 1mod 1)+2.:'(*+/N0$ N03$ L0F/3$ 2$ 23
8
RR )ubstr 1to_char 1"loor 1mod 1)+2.:'(*+/N0$ N033$ L0F/3$ 2$ 23
RR L./
RR )ubstr 1to_char 1mod 1)+2.:'(*+$ N03$ L0F/3$ 2$ 23 )%'6%+;
"rom ),).:_E9<)%'<2+ Q*($
),).:_E9<)%'<2+ )+2$
),).:_E%>6+'; 2
8here Q*(.B+, li0e LSQ*(9'<S/
and )+2.B+, li0e LS)+2<;S/I
)elect to_date 1Q*(.:'(*+$ LQ/3
RR to_char 1to_date 1)+2.:'(*+$ L)))))/3$ L >>2J:-9:))/3 )%'6%+;
"rom ),).:_E9<)%'<2+ Q*($
),).:_E9<)%'<2+ )+2
where Q*(.B+, li0e LSQ*(9'<S/
and )+2.B+, li0e LS)+2<;S/I
select to_char 1to_date 1Q*(.:'(*+$ LQ/3 T 1)+2.:'(*+/8NJ003$ -6eturn a ;'%+
/;;--<-,, >>2J:-9:))/3 )%'6%+;
"rom :E9<)%'<2+ Q*($
:E9<)%'<2+ )+2
where Q*(.B+, li0e LSQ*(9'<S/
and )+2.B+, li0e LS)+2<;S/I
Where are my TEM#),(ES, , don=t see them in *>+5T5),(E or +$57+5T57),(E?
:for +$5;
%emp"iles$ unli0e normal data"iles$ are not listed in vEdata"ile or dba_data_"iles. 9nstead quer#
vEtemp"ile or dba_temp_"iles:
)+(+2% O G6- vEtemp"ileI
)+(+2% O G6- dba_temp_"ilesI
1ow do , find used?free space in a TEM#O'5'Y tablespace? :for +$5 ;
*nli0e normal tablespaces$ true temporar# tablespace in"ormation is not listed in
;5'_G6++_)4'2+. 9nstead use the :E%+-4_)4'2+_>+';+6 view:
)+(+2% tablespace_name$ )*- 1b#tes used3$ )*- 1b#tes "ree3
G6- :Etemp_space_header
D6*4 5, tablespace_nameI
What is a profile ?
+ach database user is assigned a 4ro"ile that speci"ies limitations on various s#stem resources
available to the user.
1ow will you enforce security using stored procedures?
;on/t grant user access directl# to tables within the application. 9nstead grant the abilit# to
access the procedures that access the tables. 8hen procedure e.ecuted it will e.ecute the
privilege o" procedures owner. *sers cannot access tables e.cept via the procedure.
1ow can one see who is using a temporary segment? :for +$5 ;
Gor ever# user using temporar# space$ there is an entr# in ),).:E_(2B with t#pe L%)/.
'll temporar# segments are named L"""".bbbb/ where L""""/ is the "ile it is in and Lbbbb/ is "irst
bloc0 o" the segment. 9" #our temporar# tablespace is set to %+-46'6,$ all sorts are done in
one large temporar# segment. Gor usage stats$ see ),).:_E)6%_)+D-+<%
Grom racle 8.0$ one can &ust quer# ),).vEsort_usage. (oo0 at these e.amples:
select s.username$ u.@*)+6@$ u.tablespace$ u.contents$ u.e.tents$ u.bloc0s
F
"rom s#s.v_Esession s$ s#s.v_Esort_usage u
where s.addr H u.session_addr
/
select s.osuser$ s.process$ s.username$ s.serialM$
)um 1u.bloc0s3Ovp.value/702J sort_siAe
"rom s#s.v_Esession s$ s#s.v_Esort_usage u$ s#s.v_Eparameter :4
where s.saddr H u.session_addr
and vp.name H Ldb_bloc0_siAe/
and s.osuser li0e LU7/
group b# s.osuser$ s.process$ s.username$ s.serialM$ vp.value
/
1ow does one get the "iew definition of fixed "iews?tables?
=uer# vE"i.ed_view_de"inition. +.ample: )+(+2% O G6- vE"i.ed_view_de"inition 8>+6+
view_nameH/:E)+))9</I
What are the dictionary tables used to monitor a database spaces ?
;5'_G6++_)4'2+
;5'_)+D-+<%)
;5'_;'%'_G9(+).
1ow can we specify the 5rchi"ed log file name format and destination?
5# setting the "ollowing values in init.ora "ile. (D_'62>9:+_G6-'% H arch S)/s/%/tarc
1S) - (og sequence number and is Aero le"t paded$ Ss - (og sequence number not padded. S% -
%hread number le"-Aero-paded and St - %hread number not padded3. %he "ile name created is
arch 0007 are i" S) is used. (D_'62>9:+_;+)% H path.
What is user 5ccount in Oracle database?
'n user account is not a ph#sical structure in ;atabase but it is having important relationship to
the ob&ects in the database and will be having certain privileges.
When will the data in the snapshot log be used?
8e must be able to create a a"ter row trigger on table 1i.e.$ it should be not be alread# available3
'"ter giving table privileges. 8e cannot speci"# snapshot log name because oracle uses the name
o" the master table in the name o" the database objects that support its snapshot log. %he
master table name should be less than or equal to 23 characters. 1%he table name created will be
-(D)_tablename$ and trigger name will be %(D) name3.
What dynamic data replication?
*pdating or 9nserting records in remote database through database triggers. 9t ma# "ail i" remote
database is having an# problem.
What is Two&#hase !ommit ?
%wo-phase commit is mechanism that guarantees a distributed transaction either commits on all
involved nodes or rolls bac0 on all involved nodes to maintain data consistenc# across the global
distributed database. 9t has two phase$ a 4repare 4hase and a 2ommit 4hase.
1ow can you Enforce 'eferential ,ntegrity in snapshots ?
%ime the re"erences to occur when master tables are not in use. 4e"orm the re"erence the
manuall# immdiatel# loc0ing the master tables. 8e can &oin tables in snopshots b# creating a
comple. snapshots that will based on the master tables.
What is a SQL @ .ET?
)=( O<+% is 6'2(+/s mechanism "or inter"acing with the communication protocols used b#
the networ0s that "acilitate distributed processing and distributed databases. 9t is used in 2lint-
70
Server and )erver-)erver communications.
What is a S.5#S1OT ?
)napshots are read-onl# copies o" a master table located on a remote node which is periodicall#
re"reshed to re"lect changes made to the master table.
What is the mechanism pro"ided by O'5!(E for table replication ?
)napshots and )<'4)>% (Ds
What is snapshots?
)napshot is an ob&ect used to d#namicall# replicate data between distribute database at speci"ied
time intervals. 9n ver 7.0 the# are read onl#.
What are the "arious type of snapshots?
)imple and 2omple..
+escribe two phases of Two&phase commit ?
4repare phase - %he global coordinator 1initiating node3 as0 a participants to prepare 1to promise
to commit or rollbac0 the transaction$ even i" there is a "ailure3 2ommit - 4hase - 9" all
participants respond to the coordinator that the# are prepared$ the coordinator as0s all nodes to
commit the transaction$ i" all participants cannot prepare$ the coordinator as0s all nodes to roll
bac0 the transaction.
What is snapshot log ?
9t is a table that maintains a record o" modi"ications to the master table in a snapshot. 9t is stored
in the same database as master table and is onl# available "or simple snapshots. 9t should be
created be"ore creating snapshots.
What are the benefits of distributed options in databases?
;atabase on other servers can be updated and those transactions can be grouped together with
others in a logical unit.
;atabase uses a two phase commit.
What are the options a"ailable to refresh snapshots ?
2-4(+%+ - %ables are completel# regenerated using the snapshots quer# and the master
tables ever# time the snapshot re"erenced.
G')% - 9" simple snapshot used then a snapshot log can be used to send the changes to the
snapshot tables.
G62+ - ;e"ault value. 9" possible it per"orms a G')% re"reshI therwise it will per"orm a
complete re"resh.
What is a S.5#S1OT (O- ?
' snapshot log is a table in the master database that is associated with the master table.
6'2(+ uses a snapshot log to trac0 the rows that have been updated in the master table.
)napshot logs are used in updating the snapshots based on the master table.
What is +istributed database ?
' distributed database is a networ0 o" databases managed b# multiple database servers that
appears to a user as single logical database. %he data o" all databases in the distributed database
can be simultaneousl# accessed and modi"ied.
1ow can we reduce the networ% traffic?
- 6eplication o" data in distributed environment.
- *sing snapshots to replicate data.
- *sing remote procedure calls.
+ifferentiate simple and complex, snapshots ?
- ' simple snapshot is based on a quer# that does not contains D6*4 5, clauses$ 2<<+2%
77
5, clauses$ Q9<s$ sub-quer# or snashot o" operations.
- ' comple. snapshots contain atleast an# one o" the above.
What are the $uilt&ins used for sending #arameters to forms?
,ou can pass parameter values to a "orm when an application e.ecutes the call_"orm$ <ew_"orm$
pen_"orm or 6un_product.
!an you ha"e more than one content can"as "iew attached with a window?
,es. +ach window #ou create must have atleast one content canvas view assigned to it. ,ou can
also create a window that has manipulated content canvas view. 't run time onl# one o" the
content canvas views assign to a window is displa#ed at a time.
,s the 5fter report trigger fired if the report execution fails?
,es.
+oes a $efore form trigger fire when the parameter form is suppressed?
,es.
What is S-5?
%he )#stem Dlobal 'rea in an Oracle database is the area in memor# to "acilitate the trans"er
o" in"ormation between users. 9t holds the most recentl# requested structural in"ormation
between users. 9t holds the most recentl# requested structural in"ormation about the database.
%he structure is database bu""ers$ dictionar# cache$ redo log bu""er and shared pool area.
What is a shared pool?
%he data dictionar# cache is stored in an area in )D' called the shared pool. %his will allow
sharing o" parsed SQL statements among concurrent users.
What is mean by #rogram -lobal 5rea :#-5;?
9t is area in memor# that is used b# a single racle user process.
What is a data segment?
;ata segment are the ph#sical areas within a database bloc0 in which the data associated with
tables and cl"sters are stored.
What are the factors causing the reparsing of S4( statements in S-5?
;ue to insu""icient shared pool siAe.
Monitor the ratio o" the reloads ta0es place while e.ecuting )=( statements. 9" the ratio is
greater than 7 then increase the )>'6+;_4(_)9C+.
What are clusters?
2lusters are groups o" one or more tables ph#sicall# stores together to share common columns
and are o"ten used together.
What is cluster %ey?
%he related columns o" the tables in a cluster are called the cluster 0e#.
+o a "iew contain data?
:iews do not contain or store data.
What is user 5ccount in Oracle database?
' user account is not a ph#sical structure in database but it is having important relationship to
the ob&ects in the database and will be having certain privileges.
1ow will you enforce security using stored procedures?
;on/t grant user access directl# to tables within the application. 9nstead grant the abilit# to
access the procedures that access the tables. 8hen procedure e.ecuted it will e.ecute the
privilege o" procedures owner. *sers cannot access tables e.cept via the procedure.
What are the dictionary tables used to monitor a database space?
;5'_G6++_)4'2+
72
;5'_)+D-+<%)
;5'_;'%'_G9(+).
!an a property clause itself be based on a property clause?
,es
,f a parameter is used in a 0uery without being pre"iously defined, what diff< exist between<
report A<B and A<C when the 0uery is applied?
8hile both reports 2.0 and 2.5 create the parameter$ report 2.5 gives a message that a bind
parameter has been created.
What are the sql clauses supported in the lin% property sheet?
8here start with having.
What is trigger associated with the timer?
8hen-timer-e.pired.
What are the trigger associated with image items?
8hen-image-activated "ires when the operators double clic0s on an image itemwhen-image-
pressed "ires when an operator clic0s or double clic0s on an image item
What are the different windows e"ents acti"ated at runtimes?
8hen_window_activated
8hen_window_closed
8hen_window_deactivated
8hen_window_resiAed
8ithin this triggers$ #ou can e.amine the built in system variable s#stem. event_window to
determine the name o" the window "or which the trigger "ired.
When do you use data parameter type?
8hen the value o" a data parameter being passed to a called product is alwa#s the name o" the
record group de"ined in the current "orm. ;ata parameters are used to pass data to products
invo0ed with the run_product built-in subprogram.
What is difference between open7form and call7form?
when one "orm invo0es another "orm b# e.ecuting open_"orm the "irst "orm remains displa#ed$
and operators can navigate between the "orms as desired. when one "orm invo0es another "orm
b# e.ecuting call_"orm$ the called "orm is modal with respect to the calling "orm. %hat is$ an#
windows that belong to the calling "orm are disabled$ and operators cannot navigate to them until
the# "irst e.it the called "orm.
What is new7form built&in?
8hen one "orm invo0es another "orm b# e.ecuting new_"orm oracle "orm e.its the "irst "orm
and releases its memor# be"ore loading the new "orm calling new "orm completel# replace the
"irst with the second. 9" there are changes pending in the "irst "orm$ the operator will be prompted
to save them be"ore the new "orm is loaded.
What is the 6(O* of *alidation8 #roperty of an item? What is the use of it?
8hen (: "or :alidation is set to %rue$ racle Gorms compares the current value o" the te.t
item to the values in the "irst column displa#ed in the (:. 8henever the validation event
occurs. 9" the value in the te.t item matches one o" the values in the "irst column o" the (:$
validation succeeds$ the (: is not displa#ed$ and processing continues normall#. 9" the value in
the te.t item does not match one o" the values in the "irst column o" the (:$ racle Gorms
displa#s the (: and uses the te.t item value as the search criteria to automaticall# reduce the
list.
What is the diff< when )lex mode is mode on and when it is off?
73
8hen "le. mode is on$ reports automaticall# resiAes the parent when the child is resiAed.
What is the diff< when confine mode is on and when it is off?
8hen con"ine mode is on$ an ob&ect cannot be moved outside its parent in the la#out.
What are "isual attributes?
:isual attributes are the ont$ color$ pattern proprieties that #ou set "or "orm and menu ob&ects
that appear in #our application inter"ace.
Which of the two "iews should obects according to possession?
view b# structure.
What are the two types of "iews a"ailable in the obect na"igator:specific to report A<C;?
:iew b# structure and view b# t#pe .
What are the "bx controls?
:b. control provide a simple method o" building and enhancing user inter"aces. %he controls can
use to obtain user inputs and displa# program outputs.vb. control where originall# develop as
e.tensions "or the ms vis"al basic environments and include such items as sliders$ rides and
0nobs.
What is the use of transactional triggers?
*sing transactional triggers we can control or modi"# the de"ault "unctionalit# o" the oracle
"orms.
1ow do you create a new session while open a new form?
*sing open_"orm built-in setting the session option +.. pen_"orm1L)toc0s L$active$ session3.
when invo0e the multiple "orms with open "orm and call_"orm in the same application$ state
whether the "ollowing are true/Galse
What are the ways to monitor the performance of the report?
*se reports pro"ile e.ecutable statement. *se )=( trace "acilit#.
,f two groups are not lin%ed in the data model editor, What is the hierarchy between them?
%wo group that is above are the le"t most ran0 higher than the group that is to right or below it.
5n open form can not be execute the call7form procedure if you chain of called forms has
been initiated by another open form?
%rue
Explain about hori2ontal, *ertical tool bar can"as "iews?
%ool bar canvas views are used to create tool bars "or individual windows. >oriAontal tool bars
are displa# at the top o" a window$ &ust under its men" bar. :ertical %ool bars are displa#ed
along the le"t side o" a window
What is the purpose of the product order option in the column property sheet?
%o speci"# the order o" individual group evaluation in a cross products.
What is the use of image72oom built&in?
%o manipulate images in image items.
1ow do you reference a parameter indirectly?
%o indirectl# re"erence a parameter use the <'-+ 9<$ 24, Lbuilt-ins to indirectl# set and
re"erence the parameters value/ +.ample name_in 1Lcapital parameter m# param/3$ 2op#
1L)*6+)>/$/4arameter m#_param/3
What is a timer?
%imer is an ?internal time cloc0@ that #ou can programmaticall# create to per"orm an action each
time the times.
What are the two phases of bloc% coordination?
%here are two phases o" bloc0 coordination: the clear phase and the population phase. ;uring$
7J
the clear phase$ racle Gorms navigates internall# to the detail bloc0 and "lushes the obsolete
detail records. ;uring the population phase$ racle Gorms issues a )+(+2% statement to
repopulate the detail bloc0 with detail records associated with the new master record. %hese
operations are accomplished through the e.ecution o" triggers.
What are Most !ommon types of !omplex master&detail relationships?
%here are three most common t#pes o" comple. master-detail relationships:
master with dependent details
master with independent details
detail with two masters
What is a text list?
%he te.t list st#le list item appears as a rectangular bo. which displa#s the "i.ed number o"
values. 8hen the te.t list contains values that can not be displa#ed$ a vertical scroll bar appears$
allowing the operator to view and select undispla#ed values.
What is term?
%he term is terminal deinition ile that describes the terminal "orm which #ou are using
r20run.
What is use of term?
%he term "ile which 0e# is correspond to which oracle report "unctions.
What is pop list?
%he pop list st#le list item appears initiall# as a single "ield 1similar to a te.t item "ield3. 8hen
the operator selects the list icon$ a list o" available choices appears.
What is the maximum no of chars the parameter can store?
%he ma.imum no o" chars the parameter can store is onl# valid "or char parameters$ which can
be upto NJB. <o parameters de"ault to 235#tes and ;ate parameter de"ault to 75#tes.
What are the default extensions of the files created by library module?
%he de"ault ile e#tensions indicate the librar# module t#pe and storage "ormat .pll - pl/sql
librar# module binar#
What are the !oordination #roperties in a Master&+etail relationship?
%he coordination properties are
;e"erred
'uto-=uer#
%hese 4roperties determine when the population phase o" bloc0
coordination should occur.
1ow do you display console on a window ?
%he console includes the status line and message line$ and is displa#ed at the bottom o" the
window to which it is assigned.%o speci"# that the console should be displa#ed$ set the console
$indo$ "orm propert# to the name o" an# window in the "orm. %o include the console$ set
console window to <ull.
What are the different #arameter types?
%e.t 4arameters;ata 4arameters
State any three mouse e"ents system "ariables?
System.mouse_button_pressed)#stem.mouse_button_shi"t
What are the types of calculated columns a"ailable?
)ummar#$ Gormula$ 4laceholder column.
Explain about stac%ed can"as "iews?
)tac0ed canvas view is displa#ed in a window on top o"$ or ?stac0ed@ on the content canvas view
75
assigned to that same window. )tac0ed canvas views obscure some part o" the underl#ing
content canvas view$ and or o"ten shown and hidden programmaticall#.
1ow does one do off&line database bac%ups? :for +$5 ;
)hut down the database "rom sqlplus or server manager. 5ac0up all "iles to secondar# storage
1eg. tapes3. +nsure that #ou bac0up all data "iles$ all control "iles and all log iles. 8hen
completed$ restart #our database.
;o the "ollowing queries to get a list o" all "iles that needs to be bac0ed up:
select name "rom s#s.v_Edata"ileI
select member "rom s#s.v_Elog"ileI
select name "rom s#s.v_Econtrol"ileI
)ometimes racle ta0es "orever to shutdown with the ?immediate@ option. 's wor0around to
this problem$ shutdown using these commands:
alter s#stem chec0pointI
shutdown abort
startup restrict
shutdown immediate
<ote that i" #ou database is in '62>9:+(D mode$ one can still use archived log "iles to roll
"orward "rom an o""-line bac0up. 9" #ou cannot ta0e #our database down "or a cold 1o""-line3
bac0up at a convenient time$ switch #our database into '62>9:+(D mode and per"orm hot
1on-line3 bac0ups.
What is the difference between S1OW7E+,TO' and E+,T7TEDT,TEM?
)how editor is the generic built-in which accepts an# editor name and ta0es some input string
and returns modi"ied output string. 8hereas the edit_te.titem built-in needs the input "ocus to be
in the te.t item be"ore the built-in is e.ecuted.
What are the built&ins that are used to 5ttach an (O* programmatically to an item?
set_item_propert#
get_item_propert#
1b# setting the (:_<'-+ propert#3
1ow does one do on&line database backups? :for +$5 ;
+ach tablespace that needs to be bac0ed-up must be switched into bac0up mode be"ore cop#ing
the "iles out to secondar# storage 1tapes3. (oo0 at this simple e.ample.
'(%+6 %'5(+)4'2+ .#A 5+D9< 5'2B*4I
V cp .#"Gile7 /bac0up;ir/
'(%+6 %'5(+)4'2+ .#A +<; 5'2B*4I
9t is better to bac0up tablespace "or tablespace than to put all tablespaces in bac0up mode.
5ac0ing them up separatel# incurs less overhead. 8hen done$ remember to bac0up #our control
"iles. (oo0 at this e.ample:
'(%+6 ),)%+- )89%2> (DG9(+I -- Gorce log switch to update control "ile headers
'(%+6 ;'%'5')+ 5'2B*4 2<%6(G9(+ % L/bac0up;ir/control.db"/I
<%+: ;o not run on-line bac0ups during pea0 processing periods. racle will write complete
database bloc0s instead o" the normal deltas to redo log "iles while in bac0up mode. %his will
lead to e.cessive database archiving and even database "reeAes.
1ow does one bac%up a database using 'M5.? :for +$5 ;
%he biggest advantage o" 6-'< is that it onl# bac0up used space in the database. 6man doesn/t
put tablespaces in bac0up mode$ saving on redo generation overhead. 6-'< will re-read
database bloc0s until it gets a consistent image o" it. (oo0 at this simple bac0up e.ample.
7N
rman target s#s/OOO nocatalog
run W
allocate channel t7 t#pe dis0I
bac0up
"ormat L/app/oracle/db_bac0up/Sd_tSt_sSs_pSp/
1 database 3I
release channel t7I
X
+.ample 6-'< restore:
rman target s#s/OOO nocatalog
run W
allocate channel t7 t#pe dis0I
M set until time L'ug 07 2000 :57/I
restore tablespace usersI
recover tablespace usersI
release channel t7I
X
%he e.amples above are e.tremel# simplistic and onl# use"ul "or illustrating basic concepts. 5#
de"ault racle uses the database control"iles to store in"ormation about bac0ups. <ormall# one
would rather setup a 6-'< catalog database to store 6-'< metadata in. 6ead the racle
5ac0up and 6ecover# Duide be"ore implementing an# 6-'< bac0ups.
<ote: 6-'< cannot write image copies directl# to tape. ne needs to use a third-part# media
manager that integrates with 6-'< to bac0up directl# to tape. 'lternativel# one can bac0up to
dis0 and then manuall# cop# the bac0ups to tape.
What are the different file extensions that are created by oracle reports?
6ep "ile and 6d" "ile.
What is strip sources generate options?
6emoves the source code "rom the librar# "ile and generates a librar# "iles that contains onl#
pcode. %he resulting "ile can be used "or "inal deplo#ment$ but can not be subsequentl# edited in
the designer.e.. "J5gen moduleHold_lib.pll useridHscott/tiger strip_source ,+) output_"ile
1ow does one put a database into 5'!1,*E(O- mode? :for +$5 ;
%he main reason "or running in archivelog mode is that one can provide 2J-hour availabilit# and
guarantee complete data recoverabilit#. 9t is also necessar# to enable '62>9:+(D mode
be"ore one can start to use on-line database bac0ups. %o enable '62>9:+(D mode$ simpl#
change #our database startup command script$ and bounce the database:
)=(4(*)K connect s#s as s#sdba
)=(4(*)K startup mount e.clusiveI
)=(4(*)K alter database archivelogI
)=(4(*)K archive log startI
)=(4(*)K alter database openI
<%+7: 6emember to ta0e a baseline database bac0up right a"ter enabling archivelog mode.
8ithout it one would not be able to recover. 'lso$ implement an archivelog bac0up to prevent
the archive log director# "rom "illing-up.
<%+2: '62>9:+(D mode was introduced with racle :N$ and is essential "or database
point-in-time recover#. 'rchiving can be used in combination with on-line and o""-line database
bac0ups.
77
<%+3: ,ou ma# want to set the "ollowing 9<9%.6' parameters when enabling
'62>9:+(D mode: log_archive_startH%6*+$ log_archive_destH... and
log_archive_"ormatH...
<%+J: ,ou can change the archive log destination o" a database on-line with the '62>9:+
(D )%'6% % Ldirector#/I statement. %his statement is o"ten used to switch archiving
between a set o" directories.
<%+5: 8hen running racle 6eal 'pplication )erver 16'23$ #ou need to shut down all nodes
be"ore changing the database to '62>9:+(D mode.
What is the basic data structure that is re0uired for creating an (O*?
6ecord Droup.
1ow does one bac%up archi"ed log files? :for +$5 ;
ne can bac0up archived log "iles using 6-'< or an# operating s#stem bac0up utilit#.
6emember to delete "iles a"ter bac0ing them up to prevent the archive log director# "rom "illing
up. 9" the archive log director# becomes "ull$ #our database will hangV (oo0 at this simple
6-'< bac0up script:
6-'<K run W
2K allocate channel dev7 t#pe dis0I
3K bac0up
JK "ormat L/app/oracle/arch_bac0up/log_tSt_sSs_pSp/
5K 1archivelog all delete input3I
NK release channel dev7I
7K X
+oes Oracle write to data files in begin?hot bac%up mode? :for +$5 ;
racle will stop updating "ile headers$ but will continue to write data to the database "iles even i"
a tablespace is in bac0up mode.
9n bac0up mode$ racle will write out complete changed bloc0s to the redo log "iles. <ormall#
onl# deltas 1changes3 are logged to the redo logs. %his is done to enable reconstruction o" a bloc0
i" onl# hal" o" it was bac0ed up 1split bloc0s3. 5ecause o" this$ one should notice increased log
activit# and archiving during on-line bac0ups.
http://rainbowonnet.blogspot.com/2007/03/oracle-interview-questions-and-answers_20J0.html
What is the Maximum allowed length of 'ecord group !olumn?
6ecord group column names cannot e.ceed 30 characters.
Which parameter can be used to set read le"el consistency across multiple 0ueries?
6ead onl#
What are the different types of 'ecord -roups?
=uer# 6ecord Droups
<on=uer# 6ecord Droups
)tate 6ecord Droups
)rom which designation is it preferred to send the output to the printed?
4reviewer
What are difference between post database commit and post&form commit?
4ost-"orm commit "ires once during the post and commit transactions process$ a"ter the database
commit occurs. %he post-"orm-commit trigger "ires a"ter inserts$ updates and deletes have been
posted to the database but be"ore the transactions have been "inaliAed in the issuing the
command. %he post-database-commit trigger "ires a"ter oracle "orms issues the commit to
78
"inaliAed transactions.
What are the different display styles of list items?
4op_list%e.t_list2ombo bo.
Which of the abo"e methods is the faster method?
per"orming the calculation in the quer# is "aster.
With which function of summary item is the compute at options re0uired?
percentage o" total "unctions.
What are parameters?
4arameters provide a simple mechanism "or de"ining and setting the valueso" inputs that are
required b# a "orm at startup. Gorm parameters are variables o" t#pe char$number$date that #ou
de"ine at design time.
What are the three types of user exits a"ailable ?
racle 4recompiler e.its$ racle call inter"ace$ <onracle user e.its.
1ow many windows in a form can ha"e console?
nl# one window in a "orm can displa# the console$ and #ou cannot change the console
assignment at runtime.
What is an administrati"e :pri"ileged; user? :for +$5 ;
Oracle %&As and operators t#picall# use administrative accounts to manage the database and
database instance. 'n administrative account is a user that is granted ),)4+6 or ),);5'
privileges. ),);5' and ),)4+6 allow access to a database instance even i" it is not running.
2ontrol o" these privileges is managed outside o" the database via password "iles and special
operating system groups. %his password "ile is created with the orapwd utilit#.
What are the two repeating frame always associated with matrix obect?
ne down repeating "rame below one across repeating "rame.
What are the master&detail triggers?
n-2hec0_delete_mastern_clear_detailsn_populate_details
1ow does one connect to an administrati"e user? :for +$5 ;
9" an administrative user belongs to the ?dba@ group on 'ni#$ or the ?6'_;5'@
16'_sid_;5'3 group on <%$ he/she can connect li0e this:
connect / as s#sdba
<o password is required. %his is equivalent to the desupported ?connect internal@ method.
' password is required "or ?non-secure@ administrative access. %hese passwords are stored in
password "iles. 6emote connections via <et8 are classi"ied as non-secure. (oo0 at this e.ample:
connect s#s/password as s#sdba
1ow does one create a password file? :for +$5 ;
%he racle 4assword Gile 1E6'2(+_>-+/dbs/orapw or orapw)9;3 stores passwords "or
users with administrative privileges. ne needs to create a password "iles be"ore remote
administrators 1li0e +-3 will be allowed to connect.
Gollow this procedure to create a new password "ile:
. (og in as the Oracle sot$are owner
. 6uncommand: orapwd "ileHE6'2(+_>-+/dbs/orapwE6'2(+_)9;
passwordHm#passwd
. )hutdown the database 1)=(4(*)K )>*%;8< 9--+;9'%+3
. +dit the 9<9%.6' "ile and ensure 6+-%+_(D9<_4'))86;G9(+He.clusive is set.
. )tartup the database 1)=(4(*)K )%'6%*43
<%+: %he orapwd utilit# presents a sec"rity ris! in that it receives a password "rom the
7F
command line. %his password is visible in the process table o" man# systems. 'dministrators
needs to be aware o" thisV
,s it possible to modify an external 0uery in a report which contains it?
<o.
+oes a grouping done for obects in the layout editor affect the grouping done in the data
model editor?
<o.
1ow does one add users to a password file? :for +$5 ;
ne can select "rom the ),).:_E48G9(+_*)+6) view to see which users are listed in the
password "ile. <ew users can be added to the password "ile b# granting them ),);5' or
),)4+6 privileges$ or b# using the orapwd utilit#. D6'<% ),);5' % scottI
,f a brea% order is set on a column would it affect columns which are under the column?
<o
Why are O#S> accounts a security ris% in a client?server en"ironment? :for +$5 ;
9" #ou allow people to log in with 4)E accounts "rom 8indows 8or0stations$ #ou cannot be
sure who the# reall# are. 8ith terminals$ #ou can rel# on operating s#stem passwords$ with
8indows$ #ou cannot.
9" #ou set 6+-%+_)_'*%>+<%H%6*+ in #our init.ora "ile$ racle assumes that the
remote ) has authenticated the user. 9" 6+-%+_)_'*%>+<% is set to G'()+
1recommended3$ remote users will be unable to connect without a password. 9;+<%9G9+;
+P%+6<'((, will onl# be in e""ect "rom the local host. 'lso$ i" #ou are using ?4)E@ as #our
pre"i.$ #ou will be able to log on locall# with or without a password$ regardless o" whether #ou
have identi"ied #our 9; with a password or de"ined it to be 9;+<%9G9+; +P%+6<'((,.
+o user parameters appear in the data modal editor in A<C?
<o
!an you pass data parameters to forms?
<o
,s it possible to lin% two groups inside a cross products after the cross products group has
been created?
no
What are the different modals of windows?
-odalless windows
-odal windows
What are modal windows?
-odal windows are usuall# used as dialogs$ and have restricted "unctionalit# compared to
modelless windows. n some plat"orms "or e.ample operators cannot resiAe$ scroll or iconi"# a
modal window.
What are the different default triggers created when Master +eletes #roperty is set to .on&
isolated?
-aster ;eletes 4ropert# 6esulting %riggers
----------------------------------------------------
<on-9solated1the de"ault3 n-2hec0-;elete--aster
n-2lear-;etails
n-4opulate-;etails
What are the different default triggers created when Master +eletes #roperty is set to
isolated?
20
-aster ;eletes 4ropert# 6esulting %riggers
---------------------------------------------------
9solated n-2lear-;etails
n-4opulate-;etails
What are the different default triggers created when Master +eletes #roperty is set to
!ascade?
-aster ;eletes 4ropert# 6esulting %riggers
---------------------------------------------------
2ascading n-2lear-;etails
n-4opulate-;etails
4re-delete
What is the diff< bet< setting up of parameters in reports A<B reportsA<C?
(:s can be attached to parameters in the reports 2.5 parameter "orm.
What are the difference between lo" E list item?
(ov is a propert# where as list item is an item. ' list item can have onl# one column$ lov can
have one or more columns
What is the ad"antage of the library?
(ibraries provide a convenient means o" storing client-side program units and sharing them
among multiple applications. nce #ou create a librar#$ #ou can attach it to an# other "orm$
menu$ or librar# modules. 8hen #ou can call librar# program units "rom triggers men" items
commands and user named routine$ #ou write in the modules to which #ou have attach the
librar#. 8hen a librar# attaches another librar#$ program units in the "irst librar# can re"erence
program units in the attached librar#. (ibrar# support d#namic loading-that is librar# program
units are loaded into an application onl# when needed. %his can signi"icantl# reduce the run-time
memor# requirements o" applications.
What is lexical reference? 1ow can it be created?
(e.ical re"erence is place_holder "or te.t that can be embedded in a s(l statements. ' le.ical
re"erence can be created using U be"ore the column or parameter name.
What is system<coordination7operation?
9t represents the coordination causing event that occur on the master bloc0 in master-detail
relation.
What is synchroni2e?
9t is a terminal screen with the internal state o" the "orm. )t "pdates the screen displa# to re"lect
the in"ormation that oracle "orms has in its internal representation o" the screen.
What use of command line parameter cmd file?
9t is a command line argument that allows #ou to speci"# a "ile that contain a set o" arguments "or
r20run.
What is a Text7io #ac%age?
9t allows #ou to read and write in"ormation to a "ile in the ile system.
What is forms7++(?
9ssues d#namic )ql statements at run time$ including server side pl/)=l and ;;(
1ow is lin% tool operation different bet< reports A E A<C?
9n 6eports 2.0 the lin0 tool has to be selected and then two "ields to be lin0ed are selected and
the lin0 is automaticall# created. 9n 2.5 the "irst "ield is selected and the lin0 tool is then used to
lin0 the "irst "ield to the second "ield.
What are the different styles of acti"ation of ole Obects?
27
9n place activation+.ternal activation
1ow do you reference a #arameter?
9n 4l/S(l$ ,ou can re"erence and set the values o" "orm parameters using bind variables s#nta..
+.. 4'6'-+%+6 name H ? or :bloc0.item H 4'6'-+%+6 4arameter name
What is the difference between obect embedding E lin%ing in Oracle forms?
9n racle "orms$ +mbedded ob&ects become part o" the "orm module$ and lin0ed ob&ects are
re"erences "rom a "orm module to a lin0ed source "ile.
.ame of the functions used to get?set can"as properties?
Det_view_propert#$ )et_view_propert#
What are the built&ins that are used for setting the (O* properties at runtime?
get_lov_propert#
set_lov_propert#
What are the built&ins used for processing rows?
Det_group_row_count1"unction3
Det_group_selection_count1"unction3
Det_group_selection1"unction3
6eset_group_selection1procedure3
)et_group_selection1procedure3
*nset_group_selection1procedure3
What are built&ins used for #rocessing rows?
D+%_D6*4_68_2*<%1"unction3
D+%_D6*4_)+(+2%9<_2*<%1"unction3
D+%_D6*4_)+(+2%9<1"unction3
6+)+%_D6*4_)+(+2%9<1procedure3
)+%_D6*4_)+(+2%9<1procedure3
*<)+%_D6*4_)+(+2%9<1procedure3
What are the built&in used for getting cell "alues?
Det_group_char_cell1"unction3
Det_groupcell1"unction3
Det_group_number_cell1"unction3
What are the built&ins used for -etting cell "alues?
D+%_D6*4_2>'6_2+(( 1"unction3
D+%_D6*42+((1"unction3
D+%_D6*4_<*-5+%_2+((1"unction3
5tleast how many set of data must a data model ha"e before a data model can be base on
it?
Gour
To execute row from being displayed that still use column in the row which property can be
used?
Gormat trigger.
What are different types of modules a"ailable in oracle form?
Gorm module - a collection o" ob&ects and code routines -enu modules - a collection o" menus
and menu item commands that together ma0e up an application menu librar# module - a
collection o" user named procedures$ "unctions and pac0ages that can be called "rom other
modules in the application
What is the remo"e on exit property?
22
Gor a modelless window$ it determines whether oracle "orms hides the window automaticall#
when the operators navigates to an item in the another window.
What is W1E.&Database&record trigger?
Gires when oracle "orms "irst mar0s a record as an insert or an update. %he trigger "ires as soon as
oracle "orms determines through validation that the record should be processed b# the ne.t post
or commit as an insert or update. c generall# occurs onl# when the operators modi"ies the "irst
item in the record$ and a"ter the operator attempts to navigate out o" the item.
What is a difference between pre&select and pre&0uery?
Gires during the e.ecute quer# and count quer# processing a"ter oracle "orms constructs the
select statement to be issued$ but be"ore the statement is actuall# issued. %he pre-quer# trigger
"ires &ust be"ore oracle "orms issues the select statement to the database a"ter the operator as
de"ine the e.ample records b# entering the quer# criteria in enter quer# mode.4re-quer# trigger
"ires be"ore pre-select trigger.
What are built&ins associated with timers?
"ind_timercreate_timerdelete_timer
What are the built&ins used for finding obect ,+ functions?
Gind_group1"unction3
Gind_column1"unction3
What are the built&ins used for finding Obect ,+ function?
G9<;_D6*41"unction3
G9<;_2(*-<1"unction3
5ny attempt to na"igate programmatically to disabled form in a call7form stac% is
allowed?
Galse
3se the 5dd7group7row procedure to add a row to a static record group F< true or false?
Galse
What third party tools can be used with Oracle E$3? 'M5.? :for +$5;
%he "ollowing -edia Management Sot$are :endors have integrated their media management
so"tware pac0ages with racle 6ecover# -anager and racle7 +nterprise 5ac0up *tilit#. %he
-edia -anagement :endors will provide "irst line tec*nical s"pport "or the integrated
bac0up/recover solutions.
:eritas <et5ac0up
+-2 ;ata -anager 1+;-3
>4 -<95ac0 99
95-/s %ivoli )torage -anager - "ormerl# ';)-
(egato <etwor0er
-anage9% 5ac0up and 6ecover#
)terling Sot$ares )'-):'le.andria - "ormerl# "rom )pectralogic
)un )olstice 5ac0up
Why and when should one tune? :for +$5;
ne o" the biggest responsibilities o" a ;5' is to ensure that the racle database is tuned
properl#. %he racle 6;5-) is highl# tunable and allows the database to be monitored and
ad&usted to increase its per"ormance. ne should do per"ormance tuning "or the "ollowing
reasons:
%he speed o" computing might be wasting valuable human time 1users waiting "or response3I
+nable #our s#stem to 0eep-up with the speed business is conductedI and ptimiAe hardware
23
usage to save mone# 1companies are spending millions on hardware3. 'lthough this G'= is not
overl# concerned with hardware issues$ one needs to remember than #ou cannot tune a 5uic0
into a Gerrari.
1ow can a brea% order be created on a column in an existing group? What are the "arious
sub e"ents a mouse double clic% e"ent in"ol"es?
5# dragging the column outside the group.
What is the use of place holder column? What are the "arious sub e"ents a mouse double
clic% e"ent in"ol"es?
' placeholder column is used to hold calculated values at a speci"ied place rather than allowing
is to appear in the actual row where it has to appear.
What is the use of hidden column? What are the "arious sub e"ents a mouse double clic%
e"ent in"ol"es?
' hidden column is used to when a column has to embed into boilerplate te.t.
What database aspects should be monitored? :for +$5;
ne should implement a monitoring s#stem to constantl# monitor the "ollowing aspects o" a
database. 8riting custom scripts$ implementing racle/s +nterprise -anager$ or bu#ing a third-
part# monitoring product can achieve this. 9" an alarm is triggered$ the s#stem should
automaticall# noti"# the ;5' 1e-mail$ page$ etc.3 to ta0e appropriate action.
9n"rastructure availabilit#:
. 9s the database up and responding to requests
. 're the listeners up and responding to requests
. 're the racle <ames and (;'4 Servers up and responding to requests
. 're the 8eb (isteners up and responding to requests
%hings that can cause service outages:
. 9s the archive log destination "illing upY
. b&ects getting close to their ma. e.tents
. *ser and process limits reached
%hings that can cause bad per"ormance:
)ee question ?8hat tuning indicators can one useY@.
Where should the tuning effort be directed? :for +$5;
2onsider the "ollowing areas "or tuning. %he order in which steps are listed needs to be
maintained to prevent tuning side e""ects. Gor e.ample$ it is no good increasing the bu""er cache
i" #ou can reduce 9/ b# rewriting a )=( statement. %atabase %esign 1i" it/s not too late3:
4oor s#stem per"ormance usuall# results "rom a poor database design. ne should generall#
normaliAe to the 3<G. )elective denormaliAation can provide valuable per"ormance
improvements. 8hen designing$ alwa#s 0eep the ?data access path@ in mind. 'lso loo0 at
proper data partitioning$ data replication$ aggregation tables "or decision support s#stems$ etc.
'pplication %uning:
+.perience showed that appro.imatel# 80S o" all racle system perormance problems are
resolved b# coding optimal )=(. 'lso consider proper scheduling o" batch tas0s a"ter pea0
wor0ing hours.
-emor# %uning:
4roperl# siAe #our database bu""ers 1shared pool$ bu""er cache$ log bu""er$ etc3 b# loo0ing at #our
bu""er hit ratios. 4in large ob&ects into memor# to prevent "requent reloads.
;is0 9/ %uning:
%atabase iles needs to be properl# siAed and placed to provide ma.imum dis0 subs#stem
2J
throughput. 'lso loo0 "or "requent dis0 sorts$ "ull table scans$ missing inde.es$ row chaining$
data "ragmentation$ etc
+liminate ;atabase 2ontention:
)tud# database loc0s$ latches and wait events care"ull# and eliminate where possible. %une the
Operating System:
-onitor and tune operating s#stem 24*$ 9/ and memor# utiliAation. Gor more in"ormation$ read
the related racle G'= dealing with #our speci"ic operating s#stem.
What are the "arious sub e"ents a mouse double clic% e"ent in"ol"es? What are the "arious
sub e"ents a mouse double clic% e"ent in"ol"es?
;ouble clic0ing the mouse consists o" the mouse down$ mouse up$ mouse clic0$ mouse down U
mouse up events.
What are the default parameter that appear at run time in the parameter screen? What
are the "arious sub e"ents a mouse double clic% e"ent in"ol"es?
;est#pe and ;esname.
What are the built&ins used for !reating and deleting groups?
26+'%+-D6*4 1"unction3
26+'%+_D6*4_G6-_=*+6,1"unction3
;+(+%+_D6*41procedure3
What are different types of can"as "iews?
2ontent canvas views
)tac0ed canvas views
>oriAontal toolbar
vertical toolbar.
What are the different types of +elete details we can establish in Master&+etails?
2ascade
9solate
<on-isolate
What is relation between the window and can"as "iews?
2anvas views are the bac0 ground ob&ects on which #ou place the inter"ace items 1%e.t items3$
chec0 bo.es$ radio groups etc.$3 and boilerplate ob&ects 1bo.es$ lines$ images etc.$3 that operators
interact with us the# run #our "orm . +ach canvas views displa#ed in a window.
What is a 3ser7exit?
2alls the user e.it named in the user_e.it_string. 9nvo0es a 3Dl program b# name which has
been properl# lin0ed into #our current oracle "orms e.ecutable.
1ow is it possible to select generate a select set for the 0uery in the 0uery property sheet?
5# using the tables/columns button and then speci"#ing the table and the column names.
1ow can "alues be passed bet< precompiler exits E Oracle call interface?
5# using the statement +P+29'GD+% U +P+29'G4*%.
1ow can a s0uare be drawn in the layout editor of the report writer?
5# using the rectangle tool while pressing the 12onstraint3 0e#.
1ow can a text file be attached to a report while creating in the report writer?
5# using the lin0 "ile propert# in the la#out boiler plate propert# sheet.
1ow can , message to passed to the user from reports?
5# using )68.-+))'D+ "unction.
+oes one need to drop? truncate obects before importing? :for +$5;
5e"ore one import rows into alread# populated tables$ one needs to truncate or drop these tables
25
to get rid o" the old data. 9" not$ the new data will be appended to the e.isting tables. ne must
alwa#s ;64 e.isting )equences be"ore re-importing. 9" the sequences are not dropped$ the#
will generate numbers inconsistent with the rest o" the database. <ote: 9t is also advisable to drop
inde.es be"ore importing to speed up the import process. 9nde.es can easil# be recreated a"ter the
data was success"ull# imported.
1ow can a button be used in a report to gi"e a drill down facility?
5# setting the action associated with button to +.ecute pl/sql option and using the
)68.6un_report "unction.
!an one import?export between different "ersions of Oracle? :for +$5;
;i""erent versions o" the import utilit# is upwards compatible. %his means that one can ta0e an
e.port "ile created "rom an old e.port version$ and import it using a later version o" the import
utilit#. %his is quite an e""ective wa# o" upgrading a database "rom one release o" racle to the
ne.t.
racle also ships some previous cate.pP.sql scripts that can be e.ecuted as user ),) enabling
older imp/e.p versions to wor0 1"or bac0wards compatibilit#3. Gor e.ample$ one can run
E6'2(+_>-+/rdbms/admin/cate.p7.sql on an racle 8 database to allow the racle 7.3
e.p/imp utilities to run against an racle 8 database.
What are different types of images?
5oiler plate images9mage 9tems
!an one export to multiple files?? !an one beat the 3nix A -ig limit? :for +$5;
Grom racle8i$ the e.port utilit# supports multiple output "iles. %his "eature enables large
e.ports to be divided into "iles whose siAes will not e.ceed an# operating s#stem limits
1G9(+)9C+H parameter3. 8hen importing "rom multi-"ile e.port #ou must provide the same
"ilenames in the same sequence in the G9(+H parameter. (oo0 at this e.ample:
e.p )2%%/%9D+6 G9(+H;:ZG7.dmp$+:ZG2.dmp G9(+)9C+H70m (DHscott.log
*se the "ollowing technique i" #ou use an racle version prior to 8i:
2reate a compressed e.port on the "l#. ;epending on the t#pe o" data$ #ou probabl# can e.port
up to 70 gigab#tes to a single "ile. %his e.ample uses gAip. 9t o""ers the best compression 9 0now
o"$ but #ou can also substitute it with Aip$ compress or whatever.
M create a named pipe
m0nod e.p.pipe p
M read the pipe - output to Aip "ile in the bac0ground
gAip [K scott.e.p.gA U
M "eed the pipe
e.p useridHscott/tiger "ileHe.p.pipe ...
What is bind reference and how can it be created?
5ind re"erence are used to replace the single value in sql$ pl/sql statements a bind re"erence can
be created using a 1:3 be"ore a column or a parameter name.
1ow can one impro"e ,mport? Export performance? :for +$5;
+P46%:
. )et the 5*GG+6 parameter to a high value 1e.g. 2-3
. )et the 6+26;(+<D%> parameter to a high value 1e.g. NJB3
. )top unnecessar# applications to "ree-up resources "or #our &ob.
. 9" #ou run multiple e.port sessions$ ensure the# write to di""erent ph#sical dis0s.
. ; <% e.port to an <G) mounted "iles#stem. 9t will ta0e "orever.
9-46%:
2N
. 2reate an inde."ile so that #ou can create inde.es 'G%+6 #ou have imported data. ;o this b#
setting 9<;+PG9(+ to a "ilename and then import. <o data will be imported but a "ile containing
inde. de"initions will be created. ,ou must edit this "ile a"terwards and suppl# the passwords "or
the schemas on all 2<<+2% statements.
. 4lace the "ile to be imported on a separate ph#sical dis0 "rom the oracle data "iles
. 9ncrease ;5_2'2>+_)9C+ 1;5_5(2B_5*GG+6) prior to Fi3 considerabl# in the
initE)9;.ora "ile
. )et the (D_5*GG+6 to a big value and restart oracle.
. )top redo log archiving i" it is running 1'(%+6 ;'%'5')+ <'62>9:+(DI3
. 2reate a 59D tablespace with a 59D rollbac0 segment inside. )et all other rollbac0 segments
o""line 1e.cept the ),)%+- rollbac0 segment o" course3. %he rollbac0 segment must be as big
as #our biggest table 19 thin0Y3
. *se 2--9%H< in the import parameter "ile i" #ou can a""ord it
. *se '<'(,C+H< in the import parameter "ile to avoid time consuming '<'(,C+
statements
. 6emember to run the inde."ile previousl# created
-i"e the se0uence of execution of the "arious report triggers?
5e"ore "orm $ '"ter "orm $ 5e"ore report$ 5etween page$ '"ter report.
What are the common ,mport? Export problems? :for +$5 ;
6'-00007: *nique constraint 1...3 violated - ,ou are importing duplicate rows. *se
9D<6+H< to s0ip tables that alread# e.ist 1imp will give an error i" the ob&ect is re-created3.
6'-07555: )napshot too old - 's0 #our users to )%4 wor0ing while #ou are e.porting or use
parameter 2<)9)%+<%H<
6'-075N2: Gailed to e.tend rollbac0 segment - 2reate bigger rollbac0 segments or set
parameter 2--9%H, while importing
9-4-00075: )tatement "ailed ... ob&ect alread# e.ists... - *se the 9D<6+H, import parameter
to ignore these errors$ but be care"ul as #ou might end up with duplicate rows.
Why is it preferable to create a fewer no< of 0ueries in the data model?
5ecause "or each quer#$ report has to open a separate cursor and has to rebind$ e.ecute and "etch
data.
Where is the external 0uery executed at the client or the server?
't the server.
Where is a procedure return in an external pl?s0l library executed at the client or at the
ser"er?
't the client.
What is coordination E"ent?
'n# event that ma0es a di""erent record in the master bloc0 the current record is a coordination
causing event.
What is the difference between O(E Ser"er E Ole !ontainer?
'n le server application creates ole b&ects that are embedded or lin0ed in ole 2ontainers e..
le servers are ms_word U ms_e.cel. (+ containers provide a place to store$ displa# and
manipulate ob&ects that are created b# ole server applications. +.. oracle "orms is an e.ample
o" an ole 2ontainer.
What is an obect group?
'n ob&ect group is a container "or a group o" ob&ectsI #ou de"ine an ob&ect group when #ou want
to pac0age related ob&ects$ so that #ou cop# or re"erence them in other modules.
27
What is an (O*?
'n (: is a scrollable pop"p $indo$ that provides the operator with either a single or multi
column selection list.
5t what point of report execution is the before 'eport trigger fired?
'"ter the quer# is e.ecuted but be"ore the report is e.ecuted and the records are displa#ed.
What are the built &ins used for Modifying a groups structure?
';;-D6*4_2(*-< 1"unction3
';;_D6*4_68 1procedure3
;+(+%+_D6*4_681procedure3
What is an user exit used for?
' wa# in which to pass control 1and possibl# arguments 3 "orm racle report to another Oracle
prod"cts o" 3 D( and then return control 1 and 3 bac0 to racle reports.
What is the 3ser&.amed Editor?
' user named editor has the same te.t editing "unctionalit# as the de"ault editor$ but$ because it is
a named ob&ect$ #ou can speci"# editor attributes such as windows displa# siAe$ position$ and
title.
My database was terminated while in $5!/3# MO+E, do , need to reco"er? :for +$5;
9" a database was terminated while one o" its tablespaces was in 5'2B*4 -;+ 1'(%+6
%'5(+)4'2+ .#A 5+D9< 5'2B*4I3$ it will tell #ou that media recover# is required when
#ou tr# to restart the database. %he ;5' is then required to recover the database and appl# all
archived logs to the database. >owever$ "rom racle7.2$ #ou can simpl# ta0e the individual
data"iles out o" bac0up mode and restart the database.
'(%+6 ;'%'5')+ ;'%'G9(+ L/path/"ilename/ +<; 5'2B*4I
ne can select "rom :E5'2B*4 to see which data"iles are in bac0up mode. %his normall#
saves a signi"icant amount o" database down time.
%hiru :adivelu contributed the "ollowing:
Grom Oracle+i onwards$ the "ollowing command can be used to ta0e all o" the data"iles out o"
hot bac0up mode:
'(%+6 ;'%'5')+ +<; 5'2B*4I
%he above commands need to be issued when the database is mounted.
What is a Static 'ecord -roup?
' static record group is not associated with a quer#$ rather$ #ou de"ine its structure and row
values at design time$ and the# remain "i.ed at runtime.
What is a record group?
' record group is an internal racle Gorms that structure that has a column/row "ramewor0
similar to a database table. >owever$ unli0e database tables$ record groups are separate ob&ects
that belong to the "orm module which the# are de"ined.
My database is down and , cannot restore< What now? :for +$5 ;
6ecover# without an# bac0up is normall# not supported$ however$ racle 2onsulting can
sometimes e.tract data "rom an o""line database using a utilit# called ;*( 1;is0 *n(oad3. %his
utilit# reads data in the data iles and unloads it into )=(O(oader or e.port dump "iles. ;*(
does not care about rollbac0 segments$ corrupted bloc0s$ etc$ and can thus not guarantee that the
data is not logicall# corrupt. 9t is intended as an absolute last resort and will most li0el# cost #our
compan# a lot o" mone#VVV
,="e lost my 'E+O(O- files, how can , get my +$ bac%? :for +$5;
%he "ollowing 9<9%.6' parameter ma# be required i" #our current redo logs are corrupted or
28
blown awa#. 2aution is advised when enabling this parameter as #ou might end-up losing #our
entire database. 4lease contact racle )upport be"ore using it. _allow_resetlogs_corruption H
true
What is a property clause?
' propert# clause is a named ob&ect that contains a list o" properties and their settings. nce #ou
create a propert# clause #ou can base other ob&ect on it. 'n ob&ect based on a propert# can inherit
the setting o" an# propert# in the clause that ma0es sense "or that ob&ect.
What is a physical page ? E What is a logical page ?
' ph#sical page is a siAe o" a page. %hat is output b# the printer. %he logical page is the siAe o"
one page o" the actual report as seen in the 4reviewer.
,="e lost some 'ollbac% Segments, how can , get my +$ bac%? :for +$5;
6e-start #our database with the "ollowing 9<9%.6' parameter i" one o" #our rollbac0 segments
is corrupted. ,ou can then drop the corrupted rollbac0 segments and create it "rom scratch.
2aution is advised when enabling this parameter$ as uncommitted transactions will be mar0ed as
committed. ne can ver# well end up with lost or inconsistent dataVVV 4lease contact racle
)upport be"ore using it. _2orrupted_rollbac0_segments H 1rbs07$ rbs07$ rbs03$ rbs0J3
What are the differences between E$3 and 'M5.? :for +$5;
+nterprise 5ac0up *tilit# 1+5*3 is a "unctionall# rich$ high per"ormance inter"ace "or bac0ing
up racle7 databases. 9t is sometimes re"erred to as +5* "or racle +nterprise 5ac0up *tilit#.
%he racle 6ecover# -anager 16-'<3 utilit# that ships with racle8 and above is similar to
racle7/s +5* utilit#. >owever$ there is no direct upgrade path "rom +5* to 6-'<.
1ow does one create a 'M5. reco"ery catalog? :for +$5;
)tart b# creating a database schema 1usuall# called rman3. 'ssign an appropriate tablespace to it
and grant it the recover#_catalog_owner role. (oo0 at this e.ample:
sqlplus s#s
SQLKcreate user rman identi"ied b# rmanI
)=(K alter user rman de"ault tablespace tools temporar# tablespace tempI
)=(K alter user rman quota unlimited on toolsI
)=(K grant connect$ resource$ recover#_catalog_owner to rmanI
)=(K e.itI
<e.t$ log in to rman and create the catalog schema. 4rior to racle 8i this was done b# running
the catrman.sql script. rman catalog rman/rman
6-'<Kcreate catalog tablespace toolsI
6-'<K e.itI
,ou can now continue b# registering #our databases in the catalog. (oo0 at this e.ample:
rman catalog rman/rman target bac0dba/bac0dba
6-'<K register databaseI
1ow can a group in a cross products be "isually distinguished from a group that does not
form a cross product?
' group that "orms part o" a cross product will have a thic0er border.
What is the frame E repeating frame?
' "rame is a holder "or a group o" "ields. ' repeating "rame is used to displa# a set o" records
when the no. o" records that are to displa#ed is not 0nown be"ore.
What is a combo box?
' combo bo. st#le list item combines the "eatures "ound in list and te.t item. *nli0e the pop
list or the te.t list st#le list items$ the combo bo. st#le list item will both displa# "i.ed values and
2F
accept one operator entered value.
What are three panes that appear in the run time pl?s0l interpreter?
7. )ource pane.
2. interpreter pane.
3. <avigator pane.
What are the two panes that 5ppear in the design time pl?s0l interpreter?
7. )ource pane.
2. 9nterpreter pane
What are the two ways by which data can be generated for a parameters list of "alues?
7. *sing static values.
2. 8riting select statement.
What are the "arious methods of performing a calculation in a report ?
7. 4er"orm the calculation in the )=( statements itsel".
2. *se a calculated / summar# column in the data model.
What are the default extensions of the files created by menu module?
.mmb$
.mm.
What are the default extensions of the files created by forms modules?
."mb - "orm module binar#
."m. - "orm module e.ecutable
To display the page no< for each page on a report what would be the source E logical page
no< or E of physical page no<?
U ph#sical page no.
,t is possible to use raw de"ices as data files and what is the ad"antages o"er file< system
files ?
,es. %he advantages over "ile s#stem "iles. 9/ will be improved because racle is b#e-passing
the 0ernnel which writing into dis0. ;is0 2orruption will be ver# less.
What are disad"antages of ha"ing raw de"ices ?
8e should depend on e.port/import utilit# "or bac0up/recover# 1"ull# reliable3 %he tar command
cannot be used "or ph#sical "ile bac0up$ instead we can use dd command which is less "le.ible
and has limited recoveries.
What is the significance of ha"ing storage clause ?
8e can plan the storage "or a table as how much initial e.tents are required$ how much can be
e.tended ne.t$ how much S should leave "ree "or managing row updations etc.$
What is the use of ,.!TY#E option in ED# command ?
%#pe e.port should be per"ormed 2-4(+%+$2*-*('%9:+$9<26+-+<%'(. (ist the
sequence o" events when a large transaction that e.ceeds be#ond its optimal value when an entr#
wraps and causes the rollbac0 segment toe.pand into anotion 2ompletes. e. will be written.
What is the use of ),(E option in ,M# command ?
%he name o" the "ile "rom which import should be per"ormed.
What is a Shared SQL pool?
%he data dictionar# cache is stored in an area in )D' called the )hared )=( 4ool. %his will
allow sharing o" parsed SQL statements among concurrent users.
What is hot bac%up and how it can be ta%en?
%a0ing bac0up o" archive log "iles when database is open. Gor this the '62>9:+(D mode
should be enabled. %he "ollowing "iles need to be bac0ed up. 'll data "iles. 'll 'rchive log$ redo
30
log "iles. 'll control "iles.
(ist the Optional )lexible 5rchitecture :O)5; of Oracle database? or 1ow can we
organi2e the tablespaces in Oracle database to ha"e maximum performance ?
),)%+- - ;ata dictionar# tables.
;'%' - )tandard operational tables.
;'%'2- )tatic tables used "or standard operations
9<;+P+) - 9nde.es "or )tandard operational tables.
9<;+P+)7 - 9nde.es o" static tables used "or standard operations.
%() - %ools table.
%()7 - 9nde.es "or tools table.
65) - )tandard perations 6ollbac0 )egments$
65)7$65)2 - 'dditional/)pecial 6ollbac0 segments.
%+-4 - %emporar# purpose tablespace
%+-4_*)+6 - %emporar# tablespace "or users.
*)+6) - *ser tablespace.
1ow to implement the multiple control files for an existing database ?
)hutdown the database 2op# one o" the e.isting control "ile to new location +dit 2on"ig ora "ile
b# adding new control "ile. name 6estart the database.
What is ad"antage of ha"ing dis% shadowing? Mirroring ?
)hadow set o" dis0s save as a bac0up in the event o" dis0 "ailure. 9n most Operating System i"
an# dis0 "ailure occurs it automaticall# switchover to place o" "ailed dis0. 9mproved per"ormance
because most ) support volume shadowing can direct "ile 9/ request to use the shadow set o"
"iles instead o" the main set o" "iles. %his reduces 9/ load on the main set o" dis0s.
1ow will you force database to use particular rollbac% segment ?
)+% %6'<)'2%9< *)+ 6((5'2B )+D-+<% rbs_name.
Why 0uery fails sometimes ?
6ollbac0 segment d#namicall# e.tent to handle larger transactions entr# loads. ' single
transaction ma# wipeout all available ree space in the 6ollbac0 )egment %ablespace. %his
prevents other user using 6ollbac0 segments.
What is the use of 'E!O'+ (E.-T1 option in ED# command ?
6ecord length in b#tes.
1ow will you monitor rollbac% segment status ?
=uer#ing the ;5'_6((5'2B_)+D) view
9< *)+ - 6ollbac0 )egment is on-line.
':'9('5(+ - 6ollbac0 )egment available but not on-line.
GG-(9<+ - 6ollbac0 )egment o""-line
9<:'(9; - 6ollbac0 )egment ;ropped.
<++;) 6+2:+6, - 2ontains data but need recover# or corupted.
4'6%(, ':'9('5(+ - 2ontains data "rom an unresolved transaction involving a distributed
database.
What is meant by 'edo Log file mirroring ? 1ow it can be achie"ed?
4rocess o" having a cop# o" redo log "iles is called mirroring. %his can be achieved b# creating
group o" log "iles together$ so that (D86 will automaticall# writes them to all the members o"
the current on-line redo log group. 9" an# one group "ails then database automaticall# switch over
to ne.t group. 9t degrades per"ormance.
Which parameter in Storage clause will reduce no< of rows per bloc%?
37
42%G6++ parameter
6ow siAe also reduces no o" rows per bloc0.
What is meant by recursi"e hints ?
<umber o" times processes repeatedl# quer# the dictionar# table is called recursive hints. 9t is
due to the data dictionar# cache is too small. 5# increasing the )>'6+;_4(_)9C+
parameter we can optimiAe the siAe o" ;ata ;ictionar# 2ache.
What is the use of #5'),(E option in ED# command ?
<ame o" the parameter "ile to be passed "or e.port.
What is the difference between loc%s, latches, en0ueues and semaphores? :for +$5;
' latch is an internal racle mechanism used to protect data str"ct"res in the )D' "rom
simultaneous access. 'tomic hardware instructions li0e %+)%-'<;-)+% is used to implement
latches. (atches are more restrictive than loc0s in that the# are alwa#s e.clusive. (atches are
never queued$ but will spin or sleep until the# obtain a resource$ or time out.
+nqueues and loc0s are di""erent names "or the same thing. 5oth support queuing and
concurrenc#. %he# are queued and serviced in a "irst-in-"irst-out 1G9G3 order.
)emaphores are an operating s#stem "acilit# used to control waiting. )emaphores are controlled
b# the "ollowing *ni. parameters: semmni$ semmns and semmsl. %#pical settings are:
semmns H sum o" the ?processes@ parameter "or each instance
1see init.ora "or each instance3
semmni H number o" instances running simultaneousl#I
semmsl H semmns
What is a logical bac%up?
(ogical bac0up involves reading a set o" database records and writing them into a "ile. +.port
utilit# is used "or ta0ing bac0up and 9mport utilit# is used to recover "rom bac0up.
Where can one get a list of all hidden Oracle parameters? :for +$5;
racle initialiAation or 9<9%.6' parameters with an underscore in "ront are hidden or
unsupported parameters. ne can get a list o" all hidden parameters b# e.ecuting this quer#:
select O
"rom ),).PEB)449
where substr1B)449<-$7$73 H L_/I
%he "ollowing quer# displa#s parameter names with their current value:
select a.0sppinm ?4arameter@$ b.0sppstvl ?)ession :alue@$ c.0sppstvl ?9nstance :alue@
"rom .E0sppi a$ .E0sppcv b$ .E0sppsv c
where a.ind. H b.ind. and a.ind. H c.ind.
and substr10sppinm$7$73H/_/
order b# a.0sppinmI
6emember: %hou shall not pla# with undocumented parametersV
What is a database E*E.T and how does one set it? :for +$5;
racle trace events are use"ul "or debugging the racle database server. %he "ollowing two
e.amples are simpl# to demonstrate s#nta.. 6e"er to later notes on this page "or an e.planation
o" what these particular events do.
+ither adding them to the 9<9%.6' parameter "ile can activate events. +.g.
eventH/7J07 trace name errorstac0$ level 72/
... or$ b# issuing an '(%+6 )+))9< )+% +:+<%) command: +.g.
alter session set events L700JN trace name conte.t "orever$ level J/I
%he alter session method onl# a""ects the user/s current session$ whereas changes to the
32
9<9%.6' "ile will a""ect all sessions once the database has been restarted.
What is a 'ollbac% segment entry ?
9t is the set o" be"ore image data bloc0s that contain rows that are modi"ied b# a transaction.
+ach 6ollbac0 )egment entr# must be completed within one rollbac0 segment. ' single rollbac0
segment can have multiple rollbac0 segment entries.
What database e"ents can be set? :for +$5;
%he "ollowing events are "requentl# used b# ;5's and racle )upport to diagnose problems:
@ 700JN trace name conte.t "orever$ level J %race )=( statements and show bind variables in
trace output.
@ 700JN trace name conte.t "orever$ level 8 %his shows wait events in the )=( trace "iles
@ 700JN trace name conte.t "orever$ level 72 %his shows both bind variable names and wait
events in the )=( trace "iles
@ 7J07 trace name errorstac0$ level 72 7J07 trace name errorstac0$ level J 7J07 trace name
processstate ;umps out trace in"ormation i" an 6'-7J07 ?inserted value too large "or column@
error occurs. %he 7J07 can be replaced b# an# other racle )erver error code that #ou want to
trace.
@ N0 trace name errorstac0 level 70 )how where in the code racle gets a deadloc0 16'-N03$
and ma# help to diagnose the problem.
%he "ollowing lists o" events are e.amples onl#. %he# might be version speci"ic$ so please call
racle be"ore using them:
@ 70270 trace name conte.t "orever$ level 70 70277 trace name conte.t "orever$ level 70 70237
trace name conte.t "orever$ level 70 %hese events prevent database bloc0 corruptions
@ 700JF trace name conte.t "orever$ level 2 -emor# protect cursor
@ 70270 trace name conte.t "orever$ level 2 ;ata bloc0 chec0
@ 70277 trace name conte.t "orever$ level 2 9nde. bloc0 chec0
@ 70235 trace name conte.t "orever$ level 7 -emor# heap chec0
@ 702N2 trace name conte.t "orever$ level 300 'llow 300 b#tes memor# lea0 "or connections
<ote: ,ou can use the *ni. oerr command to get the description o" an event. n *ni.$ #ou can
t#pe ?oerr ora 70053@ "rom the command prompt to get event details.
1ow can one dump internal database structures? :for +$5;
%he "ollowing 1mostl# undocumented3 commands can be used to obtain in"ormation about
internal database structures.
o ;ump control "ile contents
alter session set events Limmediate trace name 2<%6(G level 70/
/
o ;ump "ile headers
alter session set events Limmediate trace name G9(+_>;6) level 70/
/
o ;ump redo log headers
alter session set events Limmediate trace name 6+;>;6 level 70/
/
o ;ump the s#stem state
<%+: %a0e 3 successive ),)%+-)%'%+ dumps$ with 70-minute intervals alter session set
events Limmediate trace name ),)%+-)%'%+ level 70/
/
o ;ump the process state
33
alter session set events Limmediate trace name 462+)))%'%+ level 70/
/
o ;ump (ibrar# 2ache details
alter session set events Limmediate trace name librar# cache level 70/
/
o ;ump optimiAer statistics whenever a )=( statement is parsed 1hint: change statement or "lush
pool3 alter session set events L70053 trace name conte.t "orever$ level 7/
/
o ;ump a database bloc0 1Gile/ 5loc0 must be converted to ;5' address3 2onvert "ile and bloc0
number to a ;5' 1database bloc0 address3.
+g: variable . varchar2I
e.ec :. :H dbms_utilit#.ma0e_data_bloc0_address17$723I
print .
alter session set events Limmediate trace name bloc0dump level 503N08FJ/
/
What are the different %ind of export bac%ups?
Gull bac0 - 2omplete database
9ncremental - nl# a""ected tables "rom last incremental date/"ull bac0up date.
2umulative bac0up - nl# a""ected table "rom the last cumulative date/"ull bac0up date.
1ow free extents are managed in *er G<B and *er H<B ?
Gree e.tents cannot be merged together in :er N.0.
Gree e.tents are periodicall# coalesces with the neighboring "ree e.tent in :er 7.0
What is the use of 'E!O'+ option in ED# command?
Gor 9ncremental e.ports$ the "lag indirects whether a record will be stores data dictionar# tables
recording the e.port.
What is the use of 'OWS option in ED# command ?
Glag to indicate whether table rows should be e.ported. 9" L</ onl# ;;( statements "or the
database ob&ects will be created.
What is the use of !OM#'ESS option in ED# command ?
Glag to indicate whether e.port should compress "ragmented segments into single e.tents.
1ow will you swap obects into a different table space for an existing database ?
+.port the user
4er"orm import using the command imp s#stem/manager "ileHe.port.dmp inde."ileHnewrite.s(l.
%his will create all de"initions into new"ile.sql. ;rop necessar# ob&ects.
6un the script new"ile.sql a"ter altering the tablespaces.
9mport "rom the bac0up "or the necessar# ob&ects.
1ow does Space allocation table place within a bloc% ?
+ach bloc0 contains entries as "ollows
Gi.ed bloc0 header
:ariable bloc0 header
6ow >eader$row date 1multiple rows ma# e.ists3
42%+6++ 1S o" ree space "or row updation in "uture3
What are the factors causing the reparsing of SQL statements in S-5?
;ue to insu""icient )hared )=( pool siAe. -onitor the ratio o" the reloads ta0es place while
e.ecuting )=( statements. 9" the ratio is greater than 7 then increase the
)>'6+;_4(_)9C+. (D92'( U 4>,)92'( '62>9%+2%*6+ G ;'%'5')+.
3J
What is dictionary cache ?
;ictionar# cache is in"ormation about the databse ob&ects stored in a data dictionar# table.
What is a !ontrol file ?
;atabase overall ph#sical architecture is maintained in a "ile called control "ile. 9t will be used to
maintain internal consistenc# and guide recover# operations. -ultiple copies o" control "iles are
advisable.
What is +atabase $uffers ?
;atabase bu""ers are cache in the )D' used to hold the data bloc0s that are read "rom the data
segments in the database such as tables$ inde.es and cl"sters ;5_5(2B_5*GG+6)
parameter in 9<9%.6' decides the siAe.
1ow will you create multiple rollbac% segments in a database ?
2reate a database which implicitl# creates a SYSTEM 6ollbac0 )egment in a ),)%+-
tablespace. 2reate a )econd 6ollbac0 )egment name 60 in the ),)%+- tablespace. -a0e new
rollbac0 segment available 1'"ter shutdown$ modi"# init.ora "ile and )tart database3 2reate other
tablespaces 165)3 "or rollbac0 segments. ;eactivate 6ollbac0 )egment 60 and activate the
newl# created rollbac0 segments.
What is cold bac%up? What are the elements of it?
2old bac0up is ta0ing bac0up o" all ph#sical "iles a"ter normal shutdown o" database. 8e need to
ta0e.
- 'll %ata iles.
- 'll 2ontrol "iles.
- 'll on-line redo log "iles.
- %he init.ora "ile 1ptional3
What is meant by redo log buffer ?
2hanges made to entries are written to the on-line redo log iles. )o that the# can be used in roll
"orward operations during database recoveries. 5e"ore writing them into the redo log "iles$ the#
will "irst brought to redo log bu""ers in )D' and (D86 will write into "iles "requentl#.
(D_5*GG+6 parameter will decide the siAe.
1ow will you estimate the space re0uired by a non&clustered tables?
2alculate the total header siAe
2alculate the available dataspace per data bloc0
2alculate the combined column lengths o" the average row
2alculate the total average row siAe.
2alculate the average number rows that can "it in a bloc0
2alculate the number o" bloc0s and b#tes required "or the table.
'"ter arriving the calculation$ add 70 S additional space to calculate the initial e.tent siAe "or a
wor0ing table.
1ow will you monitor the space allocation ?
5# quer#ing ;5'_)+D-+<% table/view.
What is meant by free extent ?
' "ree e.tent is a collection o" continuous "ree bloc0s in tablespace. 8hen a segment is dropped
its e.tents are reallocated and are mar0ed as "ree.
What is the use of ,-.O'E option in ,M# command ?
' "lag to indicate whether the import should ignore errors encounter when issuing 26+'%+
commands.
What is the use of 5.5(YSE : *er H; option in ED# command ?
35
' "lag to indicate whether statistical in"ormation about the e.ported ob&ects should be written to
e.port dump "ile.
What is the use of 'OWS option in ,M# command ?
' "lag to indicate whether rows should be imported. 9" this is set to L</ then onl# ;;( "or
database ob&ects will be e.ecuted.
What is the use of ,.+EDES option in ED# command ?
' "lag to indicate whether inde.es on tables will be e.ported.
What is the use of ,.+EDES option in ,M# command ?
' "lag to indicate whether import should import inde. on tables or not.
What is the use of -'5.T option in ED# command?
' "lag to indicate whether grants on databse ob&ects will be e.ported or not. :alue is L,/ or L</.
What is the use of -'5.T option in ,M# command ?
' "lag to indicate whether grants on database ob&ects will be imported.
What is the use of )3(( option in ED# command ?
' "lag to indicate whether "ull databse e.port should be per"ormed.
What is the use of S1OW option in ,M# command ?
' "lag to indicate whether "ile content should be displa#ed or not.
What is the use of !O.ST'5,.TS option in ED# command ?
' "lag to indicate whether constraints on table need to be e.ported.
What is the use of !O.S,STE.T :*er H; option in ED# command ?
' "lag to indicate whether a read consistent version o" all the e.ported ob&ects should be
maintained.
What are the different methods of bac%ing up oracle database ?
- (ogical 5ac0ups
- 2old 5ac0ups
- >ot 5ac0ups 1'rchive log3
What is the difference between O.&*5(,+5TE&),E(+ trigger and a #OST&!15.-E
trigger ?
8hen #ou changes the +.isting value to null$ the n-validate "ield trigger will "ire post change
trigger will not "ire. 't the time o" e.ecute-quer# post-change trigger will "ire$ on-validate "ield
trigger will not "ire.
When is #'E&43E'Y trigger executed ?
8hen +.ecute-quer# or count-quer# 4ac0age procedures are invo0ed.
1ow do you trap the error in forms I<B ?
using n--essage or n-+rror triggers.
1ow many pages you can in a single form ?
*nlimited
While specifying master?detail relationship between two bloc%s specifying the oin
condition is a must ?
%rue or Galse. Y
%rue
ED,T7)O'M is a restricted pac%age procedure ?
a. %rue b. Galse
%rue
What is the usage of an O.&,.SE'T,O.&+E(ETE and O.&3#+5TE T',--E'S ?
%hese triggers are e.ecutes when inserting$ deleting and updating operations are per"ormed and
3N
can be used to change the de"ault "unction o" insert$ delete or update respectivel#. Gor +g$ instead
o" inserting a row in a table an e.isting row can be updated in the same table.
What are the types of #op&up window ?
the pop,"p "ield editor
pop-up list o" values
pop-up pages.
'lert :
What is an S4( @)O'MS ?
SQL O"orms is JD( tool "or developing and e.ecutingI racle based interactive application.
1ow do you control the constraints in forms ?
)elect the use constraint propert# is < 5loc0 de"inition screen.
5(2B
What is the difference between restricted and unrestricted pac%age procedure ?
6estricted pac0age procedure that a""ects the basic "unctions o" )=( O Gorms. 9t cannot used in
all triggers e.cept 0e# triggers. *nrestricted pac0age procedure that does not inter"ere with the
basic "unctions o" )=( O Gorms it can be used in an# triggers.
5 0uery fetched FB records 1ow many times does a #'E&43E'Y Trigger and #OST&
43E'Y Trigger will get executed ?
46+-=*+6, "ires once.
4)%-=*+6, "ires 70 times.
-i"e the se0uence in which triggers fired during insert operations, when the following I
triggers are defined at the same bloc% le"el ?
a. <-9<)+6% b. 4)%-9<)+6% c. 46+-9<)+6%
State the order in which these triggers are executed ?
4)%-G9+(;$<-:'(9;'%+-G9+(;$4)%-2>'<D+ and B+,-<+P%G(;. B+,-
<+P%G(;$4)%-2>'<D+$ <-:'(9;'%+-G9+(;$ 4)%-G9+(;. g.
What the #53SE pac%age procedure does ?
4ause suspends processing until the operator presses a "unction 0e#
What do you mean by a page ?
4ages are collection o" display inormation$ such as constant te.t and graphics
What are the type of 3ser Exits ?
6'2(+ 4recompliers user e.its
29 16'2(+ 2all 9nter"ace3
<on-6'2+( user e.its.
4age :
What is the difference between an O.&*5(,+5TE&),E(+ trigger and a trigger ?
n-validate-"ield trigger "ires$ when the "ield :alidation status <ew or changed. 4ost-"ield-
trigger whenever the control leaving "orm the "ield$ it will "ire.
!an we use a restricted pac%age procedure in O.&*5(,+5TE&),E(+ Trigger ?
<o
,s a /ey startup trigger fires as result of a operator pressing a %ey explicitly ?
<o
!an we use -O&$(O!/ pac%age in a pre&field trigger ?
<o
!an we create two bloc%s with the same name in form I<B ?
<o
37
What does an on&clear&bloc% Trigger fire?
9t "ires &ust be"ore )=( O "orms the current bloc0.
.ame the two files that are created when you generate the form gi"e the filex extension ?
9<4 1)ource Gile3
G6- 1+.ecutable Gile3
What pac%age procedure used for in"o%e s0l @plus from s0l @forms ?
>ost 1+.g. >ost 1sqlplus33
What is the significance of #5-E B in forms I<B ?
>ide the "ields "or internal calculation.
What are the different types of %ey triggers ?
Gunction Be#
Be#-"unction
Be#-others
Be#-startup
What is the difference between a )unction /ey Trigger and /ey )unction Trigger ?
Gunction 0e# triggers are associated with individual )=(OG6-) "unction 0e#s ,ou can attach
Be# "unction triggers to 70 0e#s or 0e# sequences that normall# do not per"orm an# )=( O
G6-) operations. %hese 0e#s re"erred as 0e# G0 through 0e# GF.
!ommitted bloc% sometimes refer to a $5SE T5$(E ?
Galse
Error7!ode is a pac%age proecdure ?
a. %rue b. "alse
Galse
When is cost based optimi2ation triggered? :for +$5;
9t/s important to have statistics on all tables "or the 25 12ost 5ased ptimiAer3 to wor0
correctl#. 9" one table involved in a statement does not have statistics$ racle has to revert to
rule-based optimiAation "or that statement. )o #ou reall# want "or all tables to have statistics right
awa#I it won/t help much to &ust have the larger tables anal#Aed.
Denerall#$ the 25 can change the e.ecution plan when #ou:
7. 2hange statistics o" ob&ects b# doing an '<'(,C+I
2. 2hange some initialiAation parameters 1"or e.ample: hash_&oin_enabled$ sort_area_siAe$
db_"ile_multibloc0_read_count3.
1ow can one optimi2e JDY9J 0ueries? :for +$5;
9t is possible to improve SP,CS queries b# "orcing the optimiAer to scan all the entries "rom
the inde. instead o" the table. %his can be done b# speci"#ing hints. 9" the inde. is ph#sicall#
smaller than the table 1which is usuall# the case3 it will ta0e less time to scan the entire inde.
than to scan the entire table.
What Enter pac%age procedure does ?
+nter :alidate-data in the current validation unit.
Where can one find ,?O statistics per table? :for +$5;
%he *%(+)%'% report shows 9/ per tablespace but one cannot see what tables in the
tablespace has the most 9/. %he E6'2(+_>-+/rdbms/admin/catio.s(l script creates a
sample_io procedure and table to gather the required in"ormation. '"ter e.ecuting the procedure$
one can do a simple )+(+2% O G6- io_per_ob&ectI to e.tract the required in"ormation. Gor
more details$ loo0 at the header comments in the E6'2(+_>-+/rdbms/admin/catio.sql
script.
38
My 0uery was fine last wee% and now it is slow< Why? :for +$5;
%he li0el# cause o" this is because the e.ecution plan has changed. Denerate a current e.plain
plan o" the o""ending quer# and compare it to a previous one that was ta0en when the quer# was
per"orming well. *suall# the previous plan is not available.
)ome "actors that can cause a plan to change are:
. 8hich tables are currentl# anal#AedY 8ere the# previousl# anal#AedY 1ie. 8as the quer# using
65 and now 25Y3
. >as 4%9-9C+6_-;+ been changed in 9<9%.6'Y
. >as the ;+D6++ o" parallelism been de"ined/changed on an# tableY
. >ave the tables been re-anal#AedY 8ere the tables anal#Aed using estimate or computeY 9"
estimate$ what percentage was usedY
. >ave the statistics changedY
. >as the 9<9%.6' parameter ;5_G9(+_-*(%95(2B_6+';_2*<% been changedY
. >as the 9<9%.6' parameter )6%_'6+'_)9C+ been changedY
. >ave an# other 9<9%.6' parameters been changedY
. 8hat do #ou thin0 the plan should beY 6un the quer# with hints to see i" this produces the
required per"ormance.
Why is Oracle not using the damn index? :for +$5;
%his problem normall# onl# arises when the quer# plan is being generated b# the 2ost 5ased
ptimiAer. %he usual cause is because the 25 calculates that e.ecuting a Gull %able )can
would be "aster than accessing the table via the inde..
Gundamental things that can be chec0ed are:
. *)+6_%'5_2(*-<).<*-_;9)%9<2% - %his column de"ines the number o" distinct
values the column holds.
. *)+6_%'5(+).<*-_68) - 9" <*-_;9)%9<2% H <*-_68) then using an inde.
would be pre"erable to doing a G*(( %'5(+ )2'<. 's the <*-_;9)%9<2% decreases$ the
cost o" using an inde. increase thereb# is ma0ing the inde. less desirable.
. *)+6_9<;+P+).2(*)%+69<D_G'2%6 - %his de"ines how ordered the rows are in the
inde.. 9" 2(*)%+69<D_G'2%6 approaches the number o" bloc0s in the table$ the rows are
ordered. 9" it approaches the number o" rows in the table$ the rows are randoml# ordered. 9n such
a case$ it is unli0el# that inde. entries in the same lea" bloc0 will point to rows in the same data
bloc0s.
. ;ecrease the 9<9%.6' parameter ;5_G9(+_-*(%95(2B_6+';_2*<% - ' higher
value will ma0e the cost o" a G*(( %'5(+ )2'< cheaper.
. 6emember that #ou -*)% suppl# the leading column o" an inde.$ "or the inde. to be used
1unless #ou use a G')% G*(( )2'< or )B94 )2'<<9<D3.
. %here are man# other "actors that a""ect the cost$ but sometimes the above can help to show
wh# an inde. is not being used b# the 25. 9" "rom chec0ing the above #ou still "eel that the
quer# should be using an inde.$ tr# speci"#ing an inde. hint. btain an e.plain plan o" the quer#
either using %B46G with %9-+;_)%'%9)%92)$ so that one can see the C-' "tili.ation$ or
with '*%%6'2+ to see the statistics. 2ompare this to the e.plain plan when not using an
inde..
When should one rebuild an index? :for +$5;
,ou can run the L'<'(,C+ 9<;+P :'(9;'%+ )%6*2%*6+/ command on the a""ected
inde.es - each invocation o" this command creates a single row in the 9<;+P_)%'%) view.
%his row is overwritten b# the ne.t '<'(,C+ 9<;+P command$ so cop# the contents o" the
3F
view into a local table a"ter each '<'(,C+. %he Lbadness/ o" the inde. can then be &udged b#
the ratio o" L;+(_(G_68)/ to L(G_68)/.
What are the unrestricted procedures used to change the popup screen position during run
time ?
'nchor-view
6esiAe -:iew
-ove-:iew.
What is an 5lert ?
'n alert is window that appears in the middle o" the screen overla#ing a portion o" the current
displa#.
+eleting a page remo"es information about all the fields in that page ?
a. %rue. b. GalseY
a. %rue.
Two popup pages can appear on the screen at a time ?Two popup pages can appear on the
screen at a time ?
a. %rue. b. GalseY
a. %rue.
!lassify the restricted and unrestricted procedure from the following<
a. 2all
b. *ser-+.it
c. 2all-=uer#
d. *p
e. +.ecute-=uer#
". -essage
g. +.it-Grom
h. 4ost
i. 5rea0Y
a. 2all - unrestricted
b. *ser +.it - *nrestricted
c. 2all_quer# - *nrestricted
d. *p - 6estricted
e. +.ecute =uer# - 6estricted
". -essage - 6estricted
g. +.it_"orm - 6estricted
h. 4ost - 6estricted
i. 5rea0 - *nrestricted.
What is an 3ser Exits ?
' user e.it is a subroutine which are written in programming lang"ages using proO2 pro
O2obol $ etc.$ that lin0 into the )=( O "orms e.ecutable.
What is a Trigger ?
' piece o" logic that is e.ecuted at or triggered b# a SQL O"orms event.
What is a #ac%age #rocedure ?
' 4ac0age procedure is built in 4(/)=( procedure.
What is the maximum si2e of a form ?
255 character width and 255 characters (ength.
What is the difference between system<current7field and system<cursor7field ?
J0
7. )#stem.current_"ield gives name o" the "ield.
2. )#stem.cursor_"ield gives name o" the "ield with bloc0 name.
(ist the system "ariables related in $loc% and )ield?
7. )#stem.bloc0_status
2. )#stem.current_bloc0
3. )#stem.current_"ield
J. )#stem.current_value
5. )#stem.c"rsor_bloc0
N. )#stem.cursor_"ield
7. )#stem."ield_status.
What are the different types of #ac%age #rocedure ?
7. 6estricted pac0age procedure.
2. *nrestricted pac0age procedure.
What are the types of T',--E'S ?
7. <avigational %riggers.
2. %ransaction %riggers.
,dentify pac%age function from the following ?
7. Error,Code
2. 5rea0
3. 2all
J. +rror-te.t
5. Gorm-"ailure
N. Gorm-"atal
7. +.ecute-quer#
8. 'nchor :iew
F. -essage_codeY
7. +rror_2ode
2. +rror_%e.t
3. Gorm_Gailure
J. Gorm_Gatal
5. -essage_2ode
!an you attach an lo" to a field at run&time? if yes, gi"e the build&in name<?
,es. )et_item_propret#
,s it possible to attach same library to more than one form?
,es
!an you attach an lo" to a field at design time?
,es
(ist the windows e"ent triggers a"ailable in )orms K<B?
8hen-window-activated$
when-window-closed$
when-window-deactivated$
when-window-resiAed
What are the triggers associated with the image item?
8hen-9mage-activated1Gires when the operator double clic0s on an image 9tems3
8hen-image-pressed1"ires when the operator selects or deselects the image item3
What is a "isual attribute?
J7
:isual 'ttributes are the "ont$ color and pattern characteristics o" ob&ects that operators see and
intract with in our application.
1ow many maximum number of radio buttons can you assign to a radio group?
*nlimited no o" radio buttons can be assigned to a radio group
1ow do you pass the parameters from one form to another form?
%o pass one or more parameters to a called "orm$ the calling "orm must per"orm the "ollowing
steps in a trigger or user named routine e.ecute the create_parameter_list built-in "unction to
programmaticall#. 2reate a parameter list to e.ecute the add parameter built-in procedure to add
one or more parameters list. +.ecute the call_"orm$ <ew_"orm or run_product built_in procedure
and include the name or id o" the parameter list to be passed to the called "orm.
What is a (ayout Editor?
%he (a#out +ditor is a graphical design "acilit# "or creating and arranging items and boilerplate
te.t and graphics ob&ects in #our application/s inter"ace.
(ist the Types of ,tems?
%e.t item.
2hart item.
2hec0 bo..
;ispla# item.
9mage item.
List item.
6adio Droup.
*ser 'rea item.
(ist system "ariables a"ailable in forms K<B, and not a"ailable in forms I<B?
System.cordination_operation
)#stem ;ate_threshold
)#stem.e""ective_;ate
)#stem.event_window
)#stem.suppress_wor0ing
What are the display styles of an alert?
)top$ 2aution$ note
What built&in is used for showing the alert during run&time?
)how_alert.
What built&in is used for changing the properties of the window dynamically?
)et_window_propert#
2anvas-:iew
What are the different types of windows?
6oot window$ secondar# window.
What is a predefined exception a"ailable in forms K<B?
6aise "orm_trigger_"ailure
What is a radio -roup?
6adio groups displa# a "i.ed no o" options that are mutuall# +.clusive. *ser can select one out
o" n number o" options.
What are the different type of a record group?
=uer# record group
)tatic record group
<on quer# record group
J2
What are the menu items that oracle forms K<B supports?
4lain$ 2hec0$6adio$ )eparator$ -agic
-i"e the e0ui"alent term in forms K<B for the following< #age, #age B?
4age - 2anvas-:iew
4age 0 - 2anvas-view null.
What triggers are associated with the radio group?
nl# when-radio-changed trigger associated with radio group
:isual 'ttributes.
What are the triggers associated with a chec% box?
nl# 8hen-chec0bo.-activated %rigger associated with a 2hec0 bo..
!an you attach an alert to a field?
<o
!an a root window be made modal?
<o
What is a list item?
9t is a list o" te.t elements.
(ist some built&in routines used to manipulate images in image7item?
9mage_add
9mage_and
9mage_subtract
9mage_.or
9mage_Aoom
!an you change the alert messages at run&time?
9" #es$ give the name o" the built-in to change the alert messages at run-time. ,es.
)et_alert_propert#.
What is the built&in used to get and set lo" properties during run&time?
Det_lov_propert#
)et_lov_propert#
6ecord Droup
What is the built&in routine used to count the no of rows in a group?
Det_group _row_count
)#stem :ariables
-i"e the Types of modules in a form?
Gorm
-enu
(ibrar#
Write the 5bbre"iation for the following File Extension F< )M$ A< MM$ I< #((?
G-5 ----- Gorm -odule 5inar#.
--5 ----- -enu -odule 5inar#.
4(( ------ 4(/SQL (ibrar# -odule 5inar#.
(ist the built&in routine for controlling window during run&time?
Gind_window$
get_window_propert#$
hide_window$
move_window$
resiAe_window$
J3
set_window_propert#$
show_:iew
(ist the built&in routine for controlling window during run&time?
Gind_canvas
Det-2anvas_propert#
Det_view_propert#
>ide_:iew
6eplace_content_view
)croll_view
)et_canvas_propert#
)et_view_propert#
)how_view
'lert
What is the built&in function used for finding the alert?
Gind_alert
+ditors
(ist the editors a"ailables in forms K<B?
;e"ault editor
*ser_de"ined editors
s#stem editors.
What buil&in routines are used to display editor dynamicaly?
+dit_te.t item
show_editor
(:
What is an (o"?
' list o" values is a single or multi column selection list displa#ed in a pop-up window
What is a record -roup?
' record group is an internal oracle "orms data str"ct"re that has a similar column/row "rame
wor0 to a database table
-i"e built&in routine related to a record groups?
2reate_group 1Gunction3
2reate_group_"rom_quer#1Gunction3
;elete_group14rocedure3
'dd_group_column1Gunction3
'dd_group_row14rocedure3
;elete_group_row14rocedure3
4opulate_group1Gunction3
4opulate_group_with_quer#1Gunction3
)et_group_2har_cell1procedure3
(ist the built&in routines for the controlling can"as "iews during run&time?
Gind_canvas
Det-2anvas_propert#
Det_view_propert#
>ide_:iew
6eplace_content_view
)croll_view
JJ
)et_canvas_propert#
)et_view_propert#
)how_view
'lert
System<effecti"e7date system "ariable is read only True?)alse?
Galse
What are the built7in used to trapping errors in forms K?
+rror_t#pe return character
+rror_code return number
+rror_te.t return char
;bms_error_code return no.
;bms_error_te.t return char
What is Oracle )inancials? :for +$5;
racle Ginancials products provide organiAations with solutions to a wide range o" long- and
short-term accounting s#stem issues. 6egardless o" the siAe o" the business$ racle Ginancials
can meet accounting management demands with:
racle Assets: +nsures that an organiAation/s propert# and equipment investment is accurate and
that the correct asset ta. accounting strategies are chosen.
racle Deneral (edger: ""ers a complete solution to &ournal entr#$ budgeting$ allocations$
consolidation$ and "inancial reporting needs.
racle 9nventor#: >elps an organiAation ma0e better inventor# decisions b# minimiAing stoc0
and ma.imiAing cash "low.
racle rder +ntr#: 4rovides organiAations with a sophisticated order entr# s#stem "or managing
customer commitments.
racle 4a#ables: (ets an organiAation process more invoices with "ewer sta"" members and
tighter controls. >elps save mone# through ma.imum discounts$ ban0 "loat$ and prevention o"
duplicate pa#ment.
racle 4ersonnel: 9mproves the management o" emplo#ee- related issues b# retaining and
ma0ing available ever# "orm o" personnel data.
racle 4urchasing: 9mproves bu#ing power$ helps negotiate bigger discounts$ eliminates paper
"low$ increases "inancial controls$ and increases productivit#.
racle 6eceivables:. 9mproves cash "low b# letting an organiAation process more pa#ments
"aster$ without o""-line research. >elps correctl# account "or cash$ reduce outstanding
receivables$ and improve collection e""ectiveness.
racle 6evenue 'ccounting Dives an organiAation timel# and accurate revenue and "le.ible
commissions reporting.
Oracle Sales 'nal#sis: 'llows "or better "orecasting$ planning. and reporting o" sales
in"ormation.
What are the design facilities a"ailable in forms K<B?
;e"ault 5loc0 "acilit#.
(a#out +ditor.
-enu +ditor.
b&ect (ists.
4ropert# )heets.
4(/)=( +ditor.
%ables 2olumns 5rowser.
J5
5uilt-ins 5rowser.
What is the most important module in Oracle )inancials? :for +$5;
%he Deneral (edger 1D(3 module is the basis "or all other racle Ginancial modules. 'll other
modules provide in"ormation to it. 9" #ou implement racle Ginancials$ #ou should switch #our
current D( s#stem "irst.D( is relativel# eas# to implement. ,ou should go live with it "irst to
give #our implementation team a chance to be "amiliar with racle Ginancials.
What are the types of can"as&"iews?
2ontent :iew$ )tac0ed :iew.
What is the MultiOrg and what is it used for? :for +$5;
-ultirg or -ultiple rganiAations 'rchitecture allows multiple operating units and their
relationships to be de"ined within a single installation o" racle 'pplications. %his 0eeps each
operating unit/s transaction data separate and secure.
*se the "ollowing quer# to determine i" -ulirg is intalled:
select multi_org_"lag "rom "nd_product_groupsI
What is the difference between )ields and )lex)ields? :for +$5;
' "ield is a position on a "orm that one uses to enter$ view$ update$ or delete in"ormation. ' "ield
prompt describes each "ield b# telling what 0ind o" in"ormation appears in the "ield$ or
alternativel#$ what 0ind o" in"ormation should be entered in the "ield.
' "le."ield is an racle 'pplications "ield made up o" segments. +ach segment has an assigned
name and a set o" valid values. racle 'pplications uses "le."ields to capture in"ormation about
#our organiAation. %here are two t#pes o" "le."ields: 0e# "le."ields and descriptive "le."ields.
Explain types of $loc% in formsK<B?
5ase table 5loc0s.
2ontrol 5loc0s.
7. ' base table bloc0 is one that is associated with a speci"ic database table or view.
2. ' control bloc0 is a bloc0 that is not associated with a database table. 9%+-)
What is an 5lert?
'n alert is a modal window that displa#s a message noti"ies the operator o" some application
condition
What are the built&in routines is a"ailable in forms K<B to create and manipulate a
parameter list?
'dd_parameter
2reate_4arameter_list
;elete_parameter
;estro#_parameter_list
Det_parameter_attr
Det_parameter_list
set_parameter_attr
What is a record -roup?
' record group is an internal oracle "orms data structure that has a similar column/row "rame
wor0 to a database table
What is a .a"igable item?
' navigable item is one that operators can navigate to with the 0e#board during de"ault
navigation$ or that racle "orms can navigate to b# e.ecuting a navigational built-in procedure.
What is a library in )orms K<B?
' librar# is a collection o" 4l/SQL program units$ including user named procedures$ "unctions U
JN
pac0ages
1ow image7items can be populate to field in forms K<B?
' "etch "rom a long raw database column 4(/)ql assignment to e.ecuting the read_image_"ile
built_in procedure to get an image "rom the ile system.
What is the content "iew and stac%ed "iew?
' content view is the ?5ase@ view that occupies the entire content pane o" the window in which
it is displa#ed. ' stac0ed view di""ers "rom a content canvas view in that it is not the base view
"or the window to which it is assigned
What is a !hec% $ox?
' 2hec0 5o. is a two state control that indicates whether a certain condition or value is on or
o""$ true or "alse. %he displa# state o" a chec0 bo. is alwa#s either ?chec0ed@ or ?unchec0ed@.
What is a can"as&"iew?
' canvas-view is the bac0ground ob&ect on which #ou la#out the inter"ace items 1te.t-items$
chec0 bo.es$ radio groups$ and so on.3 and boilerplate ob&ects that operators see and interact with
as the# run #our "orm. 't run-time$ operators can see onl# those items that have been assigned to
a speci"ic canvas. +ach canvas$ in term$ must be displa#ed in a speci"ic window.
Explain the following file extension related to library?
.pll$.lib$.pld
%he librar# pll "iles is a portable design "ile comparable to an "mb "orm "ile
%he librar# lib "ile is a plat "orm speci"ic$ generated librar# "ile comparable to a "m. "orm "ile
%he pld "ile is %.t "ormat "ile and can be used "or source controlling #our librar# "iles 4arameter
Explain the usage of W1E'E !3''E.T O) clause in cursors ?
8>+6+ 2*66+<% G clause in an *4;'%+$;+(+%+ statement re"ers to the latest row
"etched "rom a cursor. %atabase %riggers
.ame the tables where characteristics of #ac%age, procedure and functions are stored ?
*ser_ob&ects$ *ser_)ource and *ser_error.
Explain the two type of !ursors ?
%here are two t#pes o" cursors$ 9mplicit 2ursor and +.plicit 2ursor. 4(/SQL uses 9mplicit
2ursors "or queries. *ser de"ined cursors are called +.plicit 2ursors. %he# can be declared and
used.
What are two parts of pac%age ?
%he two parts o" pac0age are 4'2B'D+ )4+29G92'%9< U 4'2B'D+ 5;,. 4ac0age
)peci"ication contains declarations that are global to the pac0ages and local to the schema.
4ac0age 5od# contains actual procedures and local declaration o" the procedures and cursor
declarations.
What are two "irtual tables a"ailable during database trigger execution ?
%he table columns are re"erred as (;.column_name and <+8.column_name.
Gor triggers related to 9<)+6% onl# <+8.column_name values onl# available.
Gor triggers related to *4;'%+ onl# (;.column_name <+8.column_name values onl#
available.
Gor triggers related to ;+(+%+ onl# (;.column_name values onl# available.
What is )ine -rained 5uditing? :for +$5;
Gine Drained 'uditing 1;5-)_GD'3 allows auditing records to be generated when certain rows
are selected "rom a table. ' list o" de"ined policies can be obtained "rom
;5'_'*;9%_4(929+). 'udit records are stored in ;5'_GD'_'*;9%_%6'9(. (oo0 at this
e.ample:
J7
o 'dd polic# on table with autiting condition...
e.ecute dbms_"ga.add_polic#1L>6/$ L+-4/$ Lpolic#7/$ Ldeptno K 70/3I
o -ust '<'(,C+$ this "eature wor0s with 25 12ost 5ased ptimiAer3
anal#Ae table +-4 compute statisticsI
select O "rom +-4 where c7 H 77I -- 8ill trigger auditing
select O "rom +-4 where c7 H 0FI -- <o auditing
o <ow we can see the statments that triggered the auditing condition...
select sqlte.t "rom s#s."ga_logEI
delete "rom s#s."ga_logEI
What is a pac%age ? What are the ad"antages of pac%ages ? What is #ragma
EDE!#T,O.7,.,T ? Explain the usage ?
%he 46'D-' +P+24%9<_9<9% tells the complier to associate an e.ception with an oracle
error. %o get an error message o" a speci"ic oracle error. e.g. 46'D-' +P2+4%9<_9<9%
1e.ception name$ oracle error number3
What is a *irtual #ri"ate +atabase? :for +$5;
racle 8i introduced the notion o" a :irtual 4rivate ;atabase 1:4;3. ' :4; o""ers Gine-Drained
'ccess 2ontrol 1GD'23 "or secure separation o" data. %his ensures that users onl# have access to
data that pertains to them. *sing this option$ one could even store multiple companies/ data
within the same schema$ without them 0nowing about it. :4; con"iguration is done via the
;5-)_6() 16ow (evel )ecurit#3 pac0age. )elect "rom ),).:E:4;_4(92, to see e.isting
:4; con"iguration.
What is 'aise7application7error ?
6aise_application_error is a procedure o" pac0age ;5-)_)%'<;'6; which allows to issue
an user_de"ined error messages "rom stored sub-program or database trigger.
What is Oracle (abel Security? :for +$5;
racle (abel )ecurit# 1"ormerl# called %rusted racle -() 6;5-)3 uses the :4; 1:irtual
4rivate ;atabase3 "eature o" racle8i to implement row level securit#. 'ccess to rows are
restricted according to a user/s securit# sensitivit# tag or label. racle (abel )ecurit# is
con"igured$ controlled and managed "rom the 4olic# -anager$ an +nterprise -anager-based D*9
utilit#.
-i"e the structure of the procedure ?
462+;*6+ name 1parameter list.....3
is
local variable declarations
5+D9<
+.ecutable statements.
+.ception.
e.ception handlers
endI
What is OEM :Oracle Enterprise Manager;? :for +$5;
+- is a set o" s#stems management tools provided b# racle 2orporation "or managing the
racle environment. 9t provides tools to monitor the racle environment and automate tas0s
1both one-time and repetitive in nature3 to ta0e database administration a step closer to ?(ights
ut@ management.
4uestion What is #(?S4( ?
4(/)=( is a procedural language that has both interactive )=( and procedural programming
J8
lang"age constructs such as iteration$ conditional branching.
What are the components of OEM? :for +$5;
racle +nterprise -anager 1+-3 has the "ollowing components:
. -anagement )erver 1-)3: -iddle tier server that handles communication with the
intelligent agents. %he +- 2onsole connects to the management server to monitor and
con"igure the racle enterprise.
. 2onsole: %his is a graphical inter"ace "rom where one can schedule &obs$ events$ and monitor
the database. %he console can be opened "rom a 8indows $or!station$ *ni. P%erm 1oemapp
command3 or 8eb browser session 1oem_webstage3.
. 9ntelligent 'gent 19'3: %he 9' runs on the target database and ta0es care o" the e.ecution o"
&obs and events scheduled through the 2onsole.
What happens if a procedure that updates a column of table D is called in a database
trigger of the same table ?
-utation o" table occurs.
,s it possible to use Transaction control Statements such a 'O(($5!/ or !OMM,T in
+atabase Trigger ? Why ?
9t is not possible. 's triggers are de"ined "or each table$ i" #ou use 2--9% o" 6((5'2B in
a trigger$ it a""ects logical transaction processing.
1ow many types of database triggers can be specified on a table ? What are they ?
9nsert *pdate ;elete
5e"ore 6ow o.0. o.0. o.0.
'"ter 6ow o.0. o.0. o.0.
5e"ore )tatement o.0. o.0. o.0.
'"ter )tatement o.0. o.0. o.0.
9" G6 +'2> 68 clause is speci"ied$ then the trigger "or each 6ow a""ected b# the statement.
9" 8>+< clause is speci"ied$ the trigger "ires according to the returned 5oolean value.
What are the modes of parameters that can be passed to a procedure ?
9<$*%$9<-*% parameters.
Where the #re7defined7exceptions are stored ?
9n the standard pac0age.
4rocedures$ Gunctions U 4ac0ages I
Write the order of precedence for "alidation of a column in a table ?
,< done using +atabase triggers<
ii< done using ,ntegarity !onstraints<?
9 U ii.
-i"e the structure of the function ?
G*<2%9< name 1argument list .....3 6eturn datat#pe is
local variable declarations
5egin
e.ecutable statements
+.ception
e.ecution handlers
+ndI
Explain how procedures and functions are called in a #(?S4( bloc% ?
Gunction is called as part o" an e.pression.
sal :H calculate_sal 1La822/3I
JF
procedure is called as a 4(/)=( statement
calculate_bonus 1L'822/3I
What are ad"antages fo Stored #rocedures?
+.tensibilit#$-odularit#$ 6eusabilit#$ -aintainabilit# and one time compilation.
What is an Exception ? What are types of Exception ?
+.ception is the error handling part o" 4(/)=( bloc0. %he t#pes are 4rede"ined and user de"ined.
)ome o" 4rede"ined e.ceptions are.
2*6)6_'(6+';,_4+<
;*4_:'(_<_9<;+P
<_;'%'_G*<;
%_-'<,_68)
9<:'(9;_2*6)6
9<:'(9;_<*-5+6
(D<_;+<9+;
<%_(DD+;_<
46D6'--+666
)%6'D+_+666
%9-+*%_<_6+)*62+
:'(*+_+666
C+6_;9:9;+
%>+6).
What are the #(?SQL Statements used in cursor processing ?
;+2('6+ 2*6)6 name$ 4+< cursor name$ G+%2> cursor name 9<% or 6ecord t#pes$
2()+ c"rsor name.
What are the components of a #(?S4( $loc% ?
;eclarative part$ +.ecutable part and +.ception part.
;atat#pes 4(/)=(
What is a database trigger ? .ame some usages of database trigger ?
;atabase trigger is stored 4(/)=( program unit associated with a speci"ic database table.
*sages are 'udit data modi"ications$ (og events transparentl#$ +n"orce comple. business rules
;erive column values automaticall#$ 9mplement comple. securit# authoriAations. -aintain
replicate tables.
What is a cursor ? Why !ursor is re0uired ?
2ursor is a named private SQL area "rom where in"ormation can be accessed. 2ursors are
required to process rows individuall# "or queries returning multiple rows.
What is a cursor for loop ?
2ursor "or loop implicitl# declares S68%,4+ as loop inde.$ opens a cursor$ "etches rows o"
values "rom active set into "ields in the record and closes when all the records have been
processed.
e.g.. G6 emp_rec 9< 27 (4
salar#_total :H salar#_total Temp_rec salI
+<; (4I
What will happen after commit statement ?
2ursor 27 is
)elect empno$
ename "rom empI
50
5egin
open 27I loop
Getch 27 into
eno.enameI
+.it 8hen
27 Snot"oundI-----
commitI
end loopI
endI
%he cursor having quer# as )+(+2% .... G6 *4;'%+ gets closed a"ter
2--9%/6((5'2B.
%he cursor having quer# as )+(+2%.... does not get closed even a"ter 2--9%/6((5'2B.
1ow pac%aged procedures and functions are called from the following?
a< Stored procedure or anonymous bloc%
b< an application program such a #'! 2$ 46 !O$O(
c< S4( @#(3S??
a. 4'2B'D+ <'-+.462+;*6+ <'-+ 1parameters3I
variable :H 4'2B'D+ <'-+.G*<2%9< <'-+ 1arguments3I
+P+2 )=( +P+2*%+
b.5+D9<
4'2B'D+ <'-+.462+;*6+ <'-+ 1parameters3
variable :H 4'2B'D+ <'-+.G*<2%9< <'-+ 1arguments3I
+<;I
+<; +P+2I
c. +P+2*%+ 4'2B'D+ <'-+.462+;*6+ i" the procedures does not have an# out/in-out
parameters. ' "unction can not be called.
What is a stored procedure ?
' stored procedure is a sequence o" statements that per"orm speci"ic "unction.
What are the components of a #(?S4( bloc% ?
' set o" related declarations and procedural statements is called bloc0.
What is difference between a #'O!E+3'E E )3.!T,O. ?
' G*<2%9< is alwa#s returns a value using the return statement.
' 462+;*6+ ma# return one or more values through parameters or ma# not return at all.
What is difference between a !ursor declared in a procedure and !ursor declared in a
pac%age specification ?
' cursor declared in a pac0age speci"ication is global and can be accessed b# other procedures or
procedures in a pac0age.
' cursor declared in a procedure is local to the procedure that can not be accessed b# other
procedures.
What are the cursor attributes used in #(?S4( ?
S9)4+< - to chec0 whether cursor is open or not
S 682*<% - number o" rows "etched/updated/deleted.
S G*<; - to chec0 whether cursor has "etched an# row. %rue i" rows are "etched.
S <% G*<; - to chec0 whether cursor has "etched an# row. %rue i" no rows are "eatched.
%hese attributes are proceeded with )=( "or 9mplicit 2ursors and with 2ursor name "or +.plicit
2ursors.
57
What are J TY#E and J 'OWTY#E ? What are the ad"antages of using these o"er
datatypes?
S %,4+ provides the data type o" a variable or a database column to that variable.
S 68%,4+ provides the record t#pe that represents a entire row o" a table or view or columns
selected in the cursor.
%he advantages are :
9. <eed not 0now about variable/s data t#pe
ii. 9" the database de"inition o" a column in a table changes$ the data t#pe o" a variable changes
accordingl#.
What is difference between J 'OWTY#E and TY#E 'E!O'+ ?
S 68%,4+ is to be used whenever quer# returns a entire row o" a table or view.
%,4+ rec 6+26; is to be used whenever quer# returns columns o" di""erent table or views
and variables.
+.g. %,4+ r_emp is 6+26; 1eno emp.empnoS t#pe$ename emp ename St#pe 3I
e_rec empS 68%,4+
cursor c7 is select empno$deptno "rom empI
e_rec c7 S68%,4+.
What are the different types of #(?S4( program units that can be defined and stored in
O!CLE database ?
4rocedures and Gunctions$4ac0ages and ;atabase %riggers.
What are the ad"antages of ha"ing a #ac%age ?
9ncreased "unctionalit# 1"or e.ample$global pac0age variables can be declared and used b# an#
proecdure in the pac0age3 and per"ormance 1"or e.ample all ob&ects o" the pac0age are parsed
compiled$ and loaded into memor# once3
What are the uses of +atabase Trigger ?
;atabase triggers can be used to automatic data generation$ audit data modi"ications$ en"orce
comple. 9ntegrit# constraints$ and customiAe comple. securit# authoriAations.
What is a #rocedure ?
' 4rocedure consist o" a set o" )=( and 4(/)=( statements that are grouped together as a unit
to solve a speci"ic problem or per"orm a set o" related tas0s.
What is a #ac%age ?
' 4ac0age is a collection o" related procedures$ "unctions$ variables and other pac0age constructs
together as a unit in the database.
What is difference between #rocedures and )unctions ?
' Gunction returns a value to the caller where as a 4rocedure does not.
What is +atabase Trigger ?
' ;atabase %rigger is procedure 1set o" )=( and 4(/)=( statements3 that is automaticall#
e.ecuted as a result o" an insert in$ update to$ or delete "rom a table.
!an the default values be assigned to actual parameters?
,es
!an a primary %ey contain more than one columns?
,es
What is an 3T(7),(E<What are different procedures and functions associated with it?
*%(_G9(+ is a pac0age that adds the abilit# to read and write to operating system "iles.
4rocedures associated with it are G2()+$ G2()+_'(( and 5 procedures to output data to a
"ile 4*%$ 4*%_(9<+$ <+8_(9<+$ 4*%G$ GG(*)>.4*%$
52
GG(*)>.4*%_(9<+$GG(*)>.<+8_(9<+. Gunctions associated with it are G4+<$ 9)4+<.
What are O'5!(E #'E!OM#,(E'S?
*sing 6'2(+ 46+2-49(+6)$ )=( statements and 4(/)=( bloc0s can be contained inside
3D( programs written in 2$2TT$25($4')2'($ G6%6'<$4(/7 '<; ';'. %he
4recompilers are 0nown as 4roO2$4roO2obol$... %his "orm o" 4(/)=( is 0nown as embedded
pl/sql$the language in which pl/sql is embedded is 0nown as the host language. %he prcompiler
translates the embedded )=( and pl/sql statements into calls to the precompiler runtime librar#.
%he output must be compiled and lin0ed with this librar# to creator an e.ecutable.
+ifferentiate between T'3.!5TE and +E(ETE?
%6*<2'%+ deletes much "aster than ;+(+%+
%6*<2'%+
;+(+%+
9t is a ;;( statement
9t is a ;-( statement
9t is a one wa# trip$ cannot 6((5'2B
ne can 6ollbac0
;oesn/t have selective "eatures 1where clause3
>as
;oesn/t "ire database triggers
;oes
9t requires disabling o" re"erential constraints.
What is difference between a formal and an actual parameter?
%he variables declared in the procedure and which are passed$ as arguments are called actual$ the
parameters in the procedure declaration. 'ctual parameters contain the values that are passed to a
procedure and receive results. Gormal parameters are the placeholders "or the values o" actual
parameters
What should be the return type for a cursor "ariable<!an we use a scalar data type as
return type?
%he return t#pe "or a cursor must be a record t#pe.9t can be declared e.plicitl# as a user-de"ined
or S68%,4+ can be used. eg %,4+ t_studentsre" 9) 6+G C'RSOR 6+%*6< students
S68%,4+
What are different Oracle database obects?
-%'5(+)
-:9+8)
-9<;+P+)
-),<<,-)
-)+=*+<2+)
-%'5(+)4'2+) etc
What is difference between S3$ST' and ,.ST'?
)*5)%6 returns a speci"ied portion o" a string eg )*5)%61L52;+G/$J3 output 52;+ 9<)%6
provides character position in which a pattern is "ound in a string. eg 9<)%61L'52-;2-G/$/-L$23
output 7 12
nd
occurence o" L-L3
+isplay the number "alue in Words?
SQLK select sal$ 1to_char1to_date1sal$/&/3$ L&sp/33
"rom empI
the output li0e$
53
)'( 1%_2>'61%_;'%+1)'($/Q/3$/Q)4/33
--------- ----------------------------------------
800 eight hundred
7N00 one thousand si. hundred
7250 one thousand two hundred "i"t#
9" #ou want to add some te.t li0e$ 6s. %hree %housand onl#.
)=(K select sal ?)alar# ?$
1L 6s. LRR 1to_char1to_date1sal$/&/3$ LQsp/33RR L onl#./33
@)al in 8ords@ "rom emp
/
)alar# )al in 8ords
------- -----------------------------------------------
800 6s. +ight >undred onl#.
7N00 6s. ne %housand )i. >undred onl#.
7250 6s. ne %housand %wo >undred Gi"t# onl#.
What is difference between S4( and S4(@#(3S?
)=(O4(*) is a command line tool where as )=( and 4(/)=( language inter"ace and
reporting tool. 9ts a command line tool that allows user to t#pe )=( commands to be e.ecuted
directl# against an Oracle database. )=( is a language used to quer# the relational
database1;-($;2($;;(3. )=(O4(*) commands are used to "ormat quer# result$ )et options$
+dit )=( commands and 4(/)=(.
What are "arious oins used while writing S3$43E',ES?
)el" &oin-9ts a &oin "oreign 0e# o" a table re"erences the same table. uter Qoin\9ts a &oin
condition used where ne can quer# all the rows o" one o" the tables in the &oin condition even
though the# don/t satis"# the &oin condition.
+qui-&oin\9ts a &oin condition that retrieves rows "rom one or more tables in which one or more
columns in one table are equal to one or more columns in the second table.
What a SE(E!T )O' 3#+5TE cursor represent<?
)+(+2%......G6-......G6......*4;'%+]G column-re"erence^]<8'9%^
%he processing done in a "etch loop modi"ies the rows that have been retrieved b# the cursor. '
convenient wa# o" modi"#ing the rows is done b# a method with two parts: the G6 *4;'%+
clause in the cursor declaration$ 8>+6+ 2*66+<% G 2('*)+ in an *4;'%+ or
declaration statement.
What are "arious pri"ileges that a user can grant to another user?
-)+(+2%
-2<<+2%
-6+)*62+)
+isplay the records between two range?
select rownum$ empno$ ename "rom emp where rowid in 1select rowid "rom emp where rownum
[HUupto minus select rowid "rom emp where rownum[U)tart3I min"alue<s0l Select the .th
lowest "alue from a table?
select level$ min1Lcol_name/3 "rom m#_table where level H LUn/ connect b# prior 1Lcol_name/3 [
Lcol_name/3 group b# levelI +.ample: Diven a table called emp with the "ollowing columns: -- id
number\name varchar21203 -- sal number -- -- Gor the second lowest salar#: -- select level$
min1sal3 "rom emp\where levelH2 -- connect b# prior sal [K8hat is di""erence between
6ename and 'liasY
5J
6ename is a permanent name given to a table or column whereas 'lias is a temporar# name
given to a table or column which do not e.ist once the SQL statement is e.ecuted.
+ifference between an implicit E an explicit cursor<?
onl# one row. >owever$queries that return more than one row #ou must declare an e.plicit
cursor or use a cursor G6 loop. +.plicit cursor is a cursor in which the cursor name is e.plicitl#
assigned to a )+(+2% statement via the 2*6)6...9) statement. 'n implicit cursor is used "or
all )=( statements ;eclare$ pen$ Getch$ 2lose. 'n e.plicit cursors are used to process multirow
)+(+2% statements 'n implicit cursor is used to process 9<)+6%$ *4;'%+$ ;+(+%+ and
single row )+(+2%. .9<% statements.
What is a O3TE' LO,.?
uter Qoin\9ts a &oin condition used where #ou can quer# all the rows o" one o" the tables in the
&oin condition even though the# don/t satis"# the &oin condition.
What is a cursor?
racle uses wor0 area to e.ecute )=( statements and store processing inormation 4(/)=(
construct called a cursor lets #ou name a wor0 area and access its stored in"ormation ' cursor is
a mechanism used to "etch more than one row in a 4l/)=l bloc0.
What is the purpose of a cluster?
racle does not allow a user to speci"icall# locate tables$ since that is a part o" the "unction o" the
6;5-). >owever$ "or the purpose o" increasing per"ormance$ oracle allows a developer to
create a 2(*)%+6. ' 2(*)%+6 provides a means "or storing data "rom di""erent tables
together "or "aster retrieval than i" the table placement were le"t to the 6;5-).
What is O!,< What are its uses?
racle 2all 9nter"ace is a method o" accesing database "rom a 3D( program. *ses\<o
precompiler is required$4(/)=( bloc0s are e.ecuted li0e other ;-( statements.
%he 29 librar# provides\"unctions to parse )=( statemets\bind input variables\bind output
variables\e.ecute statements\"etch the results
1ow you open and close a cursor "ariable<Why it is re0uired?
4+< cursor variable G6 )+(+2%...)tatement
2()+ cursor variable 9n order to associate a cursor variable with a particular )+(+2%
statement 4+< s#nta. is used. 9n order to "ree the resources used "or the quer# 2()+
statement is used.
+isplay Odd? E"en number of records?
dd number o" records:
select O "rom emp where 1rowid$73 in 1select rowid$ mod1rownum$23 "rom emp3I
utput:-
7
3
5
+ven number o" records:
select O "rom emp where 1rowid$03 in 1select rowid$ mod1rownum$23 "rom emp3
utput:-
2
J
N
55
What are "arious constraints used in S4(?
-<*((
-<% <*((
-2>+2B
-;+G'*(%
!an cursor "ariables be stored in #(?S4( tables<,f yes how< ,f not why?
<o$ a cursor variable points a row which cannot be stored in a two-dimensional 4(/)=( table.
+ifference between .O +5T5 )O3.+ and J.OT)O3.+?
< ;'%' G*<; is an e.ception raised onl# "or the )+(+2%....9<% statements when the
where clause o" the quer#does not match an# rows. 8hen the where clause o" the e.plicit cursor
does not match an# rows the S<%G*<; attribute is set to %6*+ instead.
!an you use a commit statement within a database trigger?
<o
What W1E'E !3''E.T O) clause does in a cursor?
(4
)+(+2% num_credits 9<% v_numcredits G6- classes
8>+6+ deptH723 and courseH707I
*4;'%+ students
G>BIIIIIIIII)+% current_creditsHcurrent_creditsTv_numcredits
8>+6+ 2*66+<% G PI
There is a string FABBBB FA B <FAC , how you will find the position of the decimal place?
9<)%61L720000 72 0 .725/$7$/./3
output 73
What are different modes of parameters used in functions and procedures?
-9< -*% -9<*%
1ow you were passing cursor "ariables in #(?S4( A<A?
9n 4(/)=( 2.2 cursor variables cannot be declared in a pac0age.%his is because the storage "or a
cursor variable has to be allocated using 4roO2 or 29 with version 2.2$ the onl# means o"
passing a cursor variable to a 4(/)=( bloc0 is via bind variable or a procedure parameter.
When do you use W1E'E clause and when do you use 15*,.- clause?
>':9<D clause is used when #ou want to speci"# a condition "or a group "unction and it is
written a"ter D6*4 5, clause. %he 8>+6+ clause is used when #ou want to speci"# a
condition "or columns$ single row "unctions e.cept group "unctions and it is written be"ore
D6*4 5, clause i" it is used.
+ifference between procedure and function<?
Gunctions are named 4(/)=( bloc0s that return a value and can be called with arguments
procedure a named bloc0 that can be called with parameter. ' procedure all is a 4(/)=(
statement b# itsel"$ while a Gunction call is called as part o" an e.pression.
Which is more faster & ,. or ED,STS?
+P9)%) is more "aster than 9< because +P9)%) returns a 5oolean value whereas 9< returns a
value.
What is syntax for dropping a procedure and a function <5re these operations possible?
;rop 4rocedure procedure_name
;rop Gunction "unction_name
1ow will you delete duplicating rows from a base table?
delete "rom table_name where rowid not in 1select ma.1rowid3 "rom table group b#
5N
duplicate_values_"ield_name3I or delete duplicate_values_"ield_name dv "rom table_name ta
where rowid [1select min1rowid3 "rom table_name tb where ta.dvHtb.dv3I +ifference between
database triggers and form triggers?
-;ata base trigger1;5%3 "ires when a ;-( operation is per"ormed on a data base table. Gorm
trigger1G%3 Gires when user presses a 0e# or navigates between "ields on the screen
-2an be row level or statement level <o distinction between row level and statement level.
-2an manipulate data stored in racle tables via SQL 2an manipulate data in racle tables as
well as variables in "orms.
-2an be "ired "rom an# session e.ecuting the triggering ;-( statements. 2an be "ired onl# "rom
the "orm that de"ine the trigger.
-2an cause other database triggers to "ire.2an cause other database triggers to "ire$ but not other
"orm triggers.
What is a cursor for loop?
2ursor Gor (oop is a loop where oracle implicitl# declares a loop variable$ the loop inde. that o"
the same record t#pe as the cursor/s record.
1ow you will a"oid duplicating records in a 0uery?
5# using ;9)%9<2%
What is a "iew ?
' view is stored proced"re based on one or more tables$ it/s a virtual table.
What is difference between 3.,43E and #',M5'Y /EY constraints?
' table can have onl# one 469-'6, B+, whereas there can be an# number o" *<9=*+ 0e#s.
%he columns that compose 4B are automaticall# de"ine <% <*(($ whereas a column that
compose a *<9=*+ is not automaticall# de"ined to be mandator# must also speci"# the column
is <% <*((.
What is use of a cursor "ariable? 1ow it is defined?
' cursor variable is associated with di""erent statements at run time$ which can hold di""erent
values at run time. )tatic cursors can onl# be associated with one run time quer#. ' cursor
variable is re"erence t#pe 1li0e a pointer in 23.
;eclaring a cursor variable:
%,4+ t#pe_name 9) 6+G 2*6)6 6+%*6< return_t#pe t#pe_name is the name o" the
re"erence t#pe$return_t#pe is a record t#pe indicating the t#pes o" the select list that will
eventuall# be returned b# the cursor variable.
1ow do you find the numbert of rows in a Table ?
' bad answer is count them 1)+(+2% 2*<%1O3 G6- table_name3
' good answer is :-
/5# generating )=( to '<'(,C+ %'5(+ table_name 2*<% )%'%9)%92) b# quer#ing
racle System 2atalogues 1e.g. *)+6_%'5(+) or '((_%'5(+)3.
%he best answer is to re"er to the utilit# which racle released which ma0es it unnecessar# to do
'<'(,C+ %'5(+ "or each %able individuall#.
What is the maximum buffer si2e that can be specified using the
D"#S7O3T#3T<E.5$(E function?
7$000$00
What are cursor attributes?
-S682*<%
-S<%G*<;
-SG*<;
57
-S9)4+<
There is a J sign in one field of a column< What will be the 0uery to find it?
@ )hould be used be"ore LS/.
What is O. +E(ETE !5S!5+E ?
8hen < ;+(+%+ 2')2';+ is speci"ied 6'2(+ maintains re"erential integrit# b#
automaticall# removing dependent "oreign 0e# values i" a re"erenced primar# or unique 0e#
value is removed.
What is the fastest way of accessing a row in a table ?
*sing 689;.2<)%6'9<%)
What is difference between T'3.!5TE E +E(ETE ?
%6*<2'%+ commits a"ter deleting entire table i.e.$ can not be rolled bac0. ;atabase triggers do
not "ire on %6*<2'%+;+(+%+ allows the "iltered deletion. ;eleted records can be rolled bac0
or committed.;atabase triggers "ire on ;+(+%+.
What is a transaction ?
%ransaction is logical unit between two commits and commit and rollbac0.
What are the ad"antages of *,EW ?
%o protect some o" the columns o" a table "rom other users.%o hide comple.it# o" a quer#.%o
hide comple.it# o" calculations.
1ow will you a acti"ate?deacti"ate integrity constraints ?
%he integrit# constraints can be enabled or disabled b# '(%+6 %'5(+ +<'5(+
constraint/;9)'5(+ constraint.
Where the integrity constraints are stored in +ata +ictionary ?
%he integrit# constraints are stored in *)+6_2<)%6'9<%).
What is the Sub0uery ?
)ub quer# is a quer# whose return values are used in "iltering conditions o" the main quer#.
1ow to access the current "alue and next "alue from a se0uence ? ,s it possible to access the
current "alue in a session before accessing next "alue ?
)equence name 2*66:'($ )equence name <+P%:'(.9t is not possible. nl# i" #ou access
ne.t value in the session$ current value can be accessed.
What are the usage of S5*E#O,.TS ?"alue in a session before accessing next "alue ?
)':+49<%) are used to subdivide a transaction into smaller parts. 9t enables rolling bac0 part
o" a transaction. -a.imum o" "ive save points are allowed.
What is 'OW,+ ?in a session before accessing next "alue ?
689; is a pseudo column attached to each row o" a table. 9t is 78 character long$ bloc0no$
rownumber are the components o" 689;.
Explain !onnect by #rior ?in a session before accessing next "alue ?
6etrieves rows in hierarchical order.e.g. select empno$ ename "rom emp where.
1ow many (O.- columns are allowed in a table ? ,s it possible to use (O.- columns in
W1E'E clause or O'+E' $Y ?
nl# one (<D columns is allowed. 9t is not possible to use (<D column in 8>+6+ or
6;+6 5, clause.
What is 'eferential ,ntegrity ?
-aintaining data integrity through a set o" rules that restrict the values o" one or more columns
o" the tables based on the values o" primar# 0e# or unique 0e# o" the re"erenced table.
What is a oin ? Explain the different types of oins ?
Qoin is a quer# which retrieves related columns or rows "rom multiple tables.)el" Qoin - Qoining
58
the table with itsel".+qui Qoin - Qoining two tables b# equating two common columns.<on-+qui
Qoin - Qoining two tables b# equating two common columns.uter Qoin - Qoining two tables in
such a wa# that quer# can also retrieve rows that do not have corresponding &oin value in the
other table.
,f an uni0ue %ey constraint on +5TE column is created, will it "alidate the rows that are
inserted with SYS+5TE ?
9t won/t$ 5ecause ),);'%+ "ormat contains time attached with it.
1ow does one stop and start the OMS? :for +$5;
*se the "ollowing command sequence to stop and start the -) 1racle -anagement )erver3:
oemctl start oms
oemctl status oms s#sman/oem_temp
oemctl stop oms s#sman/oem_temp
/indo$s 0T/2000 users can &ust stop and start the required services. %he de"ault +-
administrator is ?s#sman@ with a password o" ?oem_temp@.
<%+: *se command oemctrl instead o" oemctl "or Oracle 1i and below.
What is an ,ntegrity !onstraint ?
9ntegrit# constraint is a rule that restricts values to a column in a table.
1ow does one create a repository? :for +$5;
Gor +- v2 and above$ start the racle +nterprise -anager 2on"iguration 'ssistant 1emca on
*ni.3 to create and con"igure the management server and repositor#. 6emember to setup a
bac0up "or the repositor# database a"ter creating it.
,f a *iew on a single base table is manipulated will the changes be reflected on the base
table ?
9" changes are made to the tables which are base tables o" a view will the changes be re"erence
on the view.
%he "ollowing describes means to create a +- :7.. 1ver# oldVVV3 repositor# on 8indows<%:
. 2reate a tablespace that would hold the repositor# data. ' siAe between 200- 250 -5 would be
ideal. (et us call it ;umm#_)pace.
. 2reate an racle user who would own this repositor#. 'ssign ;5'$ )<-4'gent$
+.p_Gull_database$ 9mp_Gull_database roles to this user. (ets call this user ;umm#_user.
'ssign ;umm#_)pace as the de"ault tablespace.
. 2reate an operating system user with the same name as the racle username. 9.e.
;umm#_*ser. 'dd L(og on as a batch &ob/ under advanced rights in *ser manager.
. Gire up +nterprise manager and log in as ;umm#_*ser and enter the password. %his would
trigger the creation o" the repositor#. Grom now on$ +nterprise manager is read# to accept &obs.
What is a database lin% ?
;atabase (in0 is a named path through which a remote database can be accessed.
1ow does one list one=s databases in the OEM !onsole? :for +$5;
Gollow these steps to discover databases and other services "rom the +- 2onsole:
7. +nsure the D(5'(_;5<'-+ parameter is set "or all databases in #our (9)%+<+6.6'
"ile 1optional3. %hese names will be listed in the +- 2onsole. 4lease note that names entered
are case sensitive. ' portion o" a listener.ora "ile:
1)9;_;+)2 H
1D(5'(_;5<'-+ H ;5_name_"or_+-3
1)9;_<'-+ H ...
2. )tart the racle 9ntelligent 'gent on the machine #ou want to discover. )ee section ?>ow
5F
does one start the racle 9ntelligent 'gentY@.
3. )tart the +- 2onsole$ navigate to menu ?<avigator/ ;iscover <odes@. %he +- ;iscover#
8iAard will guide #ou through the process o" discovering #our databases and other services.
What is !Y!(E?.O !Y!(E in a Se0uence ?
2,2(+ speci"ies that the sequence continues to generate values a"ter reaching either ma.imum
or minimum value. '"ter pan ascending sequence reaches its ma.imum value$ it generates its
minimum value. '"ter a descending sequence reaches its minimum$ it generates its
ma.imum.< 2,2(+ speci"ies that the sequence cannot generate more values a"ter reaching its
ma.imum or minimum value.
What is correlated sub&0uery ?
2orrelated sub quer# is a sub quer# which has re"erence to the main quer#.
What are the data types allowed in a table ?
2>'6$:'62>'62$<*-5+6$;'%+$6'8$(<D and (<D 6'8.
What is difference between !15' and *5'!15'A ? What is the maximum S,9E
allowed for each type ?
2>'6 pads blan0 spaces to the ma.imum length. :'62>'62 does not pad blan0 spaces. Gor
2>'6 it is 255 and 2000 "or :'62>'62.
!an a "iew be updated?inserted?deleted? ,f Yes under what conditions ?
' :iew can be updated/deleted/inserted i" it has onl# one base table i" the view is based on
columns "rom one or more tables then insert$ update and delete is not possible.
What are the different types of !oordinations of the Master with the +etail bloc%?
44*('%+_D6*41"unction3
44*('%+_D6*4_89%>_=*+6,1"unction3
)+%_D6*4_2>'6_2+((1procedure3
)+%_D6*42+((1procedure3
)+%_D6*4_<*-5+6_2+((1procedure3
3se the 5++7-'O3#7!O(3M. function to add a column to a record group that was
created at design time?
93 %6*+ 993 G'()+
993 G'()+
3se the 5++7-'O3#7'OW procedure to add a row to a static record group?
93 %6*+ 993 G'()+
93 G'()+
max"alue<sql Select the .th 1ighest "alue from a table?
select level$ ma.1Lcol_name/3 "rom m#_table where level H LUn/ connect b# prior 1Lcol_name/3
K Lcol_name/3
group b# levelI
+.ample:
Diven a table called emp with the "ollowing columns:
-- id number\name varchar21203
-- sal number
--
-- Gor the second highest salar#:
-- select level$ ma.1sal3 "rom emp\where levelH2
-- connect b# prior sal K sal\group b# level
)ind out nth highest salary from emp table?
N0
)+(+2% ;9)%9<2% 1a.sal3 G6- +-4 ' 8>+6+ U< H 1)+(+2% 2*<% 1;9)%9<2%
1b.sal33 G6- +-4 5 8>+6+ a.sal[Hb.sal3I Gor +.g.:- +nter value "or n: 2 )'( --------- 3700
Suppose a customer table is ha"ing different columns li%e customer no, payments<What
will be the 0uery to select top three max payments?
)+(+2% customer_no$ pa#ments "rom customer 27
8>+6+ 3[H1)+(+2% 2*<%1O3 "rom customer 22 8>+6+ 27.pa#ment [H 22.pa#ment3
1ow you will a"oid your 0uery from using indexes?
)+(+2% O G6- emp
8here emp_noT/ LH723J5I
i.e #ou have to concatenate the column name with space within codes in the where condition.
)+(+2% /OT G*((1a3 O/ ename$ emp_no "rom emp
where emp_noH723JI
i.e using >9<%)
What utility is used to create a physical bac%up?
+ither rman or alter tablespace begin bac0up will do..
What are the $ac% ground processes in Oracle and what are they<
%his is one o" the most "requentl# as0ed question.%here are basicall# F 4rocesses but in a general
system we need to mention the "irst "ive bac0ground processes.%he# do the house 0eeping
activities "or the racle and are common in an# s#stem.
%he various bac0ground processes in oracle are
a3 ;ata 5ase 8riter1;5863 :: ;ata 5ase 8riter 8rites -odi"ied bloc0s "rom ;atabase bu""er
cache to %ata 2iles.%his is required since the data is not written whenever a transaction is
committed.
b3(og8riter1(D863 :: (og8riter writes the redo log entries to dis0. 6edo (og data is generated
in redo log bu""er o" )D'. 's transaction commits and log bu""er "ills$ (D86 writes log entries
into a online redo log ile.
c3 )#stem -onitor1)-<3 :: %he )#stem -onitor per"orms instance recover# at instance
startup. %his is use"ul "or recover# "rom s#stem "ailure
d34rocess Monitor14-<3 :: %he 4rocess -onitor per"orms process recover# when user
4rocess "ails. 4mon 2lears and Grees resources that process was using.
e3 2hec04oint12B4%3 :: 't )peci"ied times$ all modi"ied database bu""ers in )D' are written to
data "iles b# ;586 at 2hec0points and *pdating all data "iles and control "iles o" database to
indicate the most recent chec0point
"3'rchieves1'62>3 :: %he 'rchiver copies online redo log "iles to archival storal when the# are
bus#.
g3 6ecoveror16+23 :: %he 6ecoveror is used to resolve the distributed transaction in networ0
h3 ;ispatcher 1;nnn3 :: %he ;ispatcher is use"ul in -ulti %hreaded 'rchitecture
i3 (c0n :: 8e can have upto 70 loc0 processes "or inter instance loc0ing in parallel sql.
1ow many types of S0l Statements are there in Oracle
%here are basicall# N t#pes o" sql statments.%he# are
a3 ;ata ;e"inition (anguage1;;(3 :: %he ;;( statements de"ine and maintain ob&ects and drop
ob&ects.
b3 ;ata -anipulation (anguage1;-(3 :: %he ;-( statements manipulate database data.
c3 %ransaction 2ontrol )tatements :: -anage change b# ;-(
d3 )ession 2ontrol :: *sed to control the properties o" current session enabling and disabling
roles and changing .e.g. :: 'lter )tatements$ )et 6ole
N7
e3 )#stem 2ontrol )tatements :: 2hange 4roperties o" racle 9nstance .e.g.:: 'lter )#stem
"3 +mbedded )ql :: 9ncorporate ;;($ ;-( and %.2.) in 4rogramming (anguage.e.g:: *sing the
)ql )tatements in languages such as L2/$ pen$ Getch$ e.ecute and close
What is a Transaction in Oracle
' transaction is a (ogical unit o" wor0 that compromises one or more )=( )tatements e.ecuted
b# a single *ser. 'ccording to '<)9$ a transaction begins with "irst e.ecutable statement and
ends when it is e.plicitl# committed or rolled bac0.
/ey Words 3sed in Oracle
%he Be# words that are used in racle are ::
a3 2ommitting :: ' transaction is said to be committed when the transaction ma0es permanent
changes resulting "rom the )=( statements.
b3 6ollbac0 :: ' transaction that retracts an# o" the changes resulting "rom )=( statements in
%ransaction.
c3 )ave4oint :: Gor long transactions that contain man# )=( statements$ intermediate mar0ers or
savepoints are declared. )avepoints can be used to divide a transaction into smaller points.
d3 6olling Gorward :: 4rocess o" appl#ing redo log during recover# is called rolling "orward.
e3 2ursor :: ' cursor is a handle 1 name or a pointer3 "or the memor# associated with a speci"ic
stamen. ' cursor is basicall# an area allocated b# racle "or e.ecuting the )ql )tatement. racle
uses an implicit cursor statement "or )ingle row quer# and *ses +.plicit cursor "or a multi row
quer#.
"3 )#stem Dlobal 'rea1)D'3 :: %he )D' is a shared memor# region allocated b# the racle that
contains ;ata and control in"ormation "or one racle 9nstance. 9t consists o" ;atabase 5u""er
2ache and 6edo log 5u""er.
g3 4rogram Dlobal 'rea 14D'3 :: %he 4D' is a memor# bu""er that contains data and control
in"ormation "or server process.
g3 ;atabase 5u""er 2ache :: ;atabase 5u""er o" )D' stores the most recentl# used bloc0s o"
database data. %he set o" database bu""ers in an instance is called ;atabase 5u""er 2ache.
h3 6edo log 5u""er :: 6edo log 5u""er o" )D' stores all the redo log entries.
i3 6edo (og Giles :: 6edo log "iles are set o" "iles that protect altered database data in memor#
that has not been written to ;ata Giles. %he# are basicall# used "or bac0up when a database
crashes.
&3 4rocess :: ' 4rocess is a Lthread o" control/ or mechanism in perating )#stem that e.ecutes
series o" steps.
What are snap shots and "iews
)napshots are mirror or replicas o" tables. :iews are built using the columns "rom one or more
tables. %he )ingle %able :iew can be updated but the view with multi table cannot be updated
What are the OO#S concepts in Oracle<
racle does implement the 4) concepts. %he best e.ample is the 4ropert# 2lasses. 8e can
categorise the properties b# setting the visual attributes and then attach the propert# classes "or
the ob&ects. 4) supports the concepts o" ob&ects and classes and we can consider the
peropert# classes as classes and the items as ob&ects
What is the difference between candidate %ey, uni0ue %ey and primary %ey
2andidate 0e#s are the columns in the table that could be the primar# 0e#s and the primar# 0e# is
the 0e# that has been selected to identi"# the rows. *nique 0e# is also use"ul "or identi"#ing the
distinct rows in the table.3
What is concurrency
N2
2oncurrenc# is allowing simultaneous access o" same data b# di""erent users. (oc0s use"ul "or
accesing the database are
a3 +.clusive
%he e.clusive loc0 is use"ul "or loc0ing the row when an insert$update or delete is being
done.%his loc0 should not be applied when we do onl# select "rom the row.
b3 )hare loc0
8e can do the table as )hare_(oc0 as man# share_loc0s can be put on the same resource.
#re"ileges and -rants
4revileges are the right to e.ecute a particulare t#pe o" SQL statements. e.g :: 6ight to 2onnect$
6ight to create$ 6ight to resource Drants are given to the ob&ects so that the ob&ect might be
accessed accordingl#.%he grant has to be given b# the owner o" the ob&ect
Table Space,Data Files,#arameter )ile, !ontrol )iles
%able )pace :: %he table space is use"ul "or storing the data in the database.8hen a database is
created two table spaces are created.
a3 System %able space :: %his data "ile stores all the tables related to the s#stem and dba tables
b3 *ser %able space :: %his data "ile stores all the user related tables
8e should have seperate table spaces "or storing the tables and inde.es so that the access is "ast.
;ata Giles :: +ver# racle %ata &ase has one or more ph#sical data "iles.%he# store the data "or
the database.+ver# data"ile is associated with onl# one database.nce the ;ata "ile is created the
siAe cannot change.%o increase the siAe o" the database to store more data we have to add data
"ile.
4arameter Giles :: 4arameter "ile is needed to start an instance.' parameter "ile contains the list
o" instance con"iguration parameters e.g.::
db_bloc0_bu""ers H 500
db_name H 6'7
db_domain H u.s.acme lang
2ontrol Giles :: 2ontrol "iles record the ph#sical structure o" the data "iles and redo log iles
%he# contain the ;b name$ name and location o" dbs$ data "iles $redo log "iles and time stamp.
#hysical Storage of the +ata
%he "inest level o" granularit# o" the data base are the data bloc0s.
;ata 5loc0 :: ne ;ata 5loc0 correspond to speci"ic number o" ph#sical database space
+.tent :: +.tent is the number o" speci"ic number o" contigious data bloc0s.
)egments :: )et o" +.tents allocated "or +.tents. %here are three t#pes o" )egments
a3 ;ata )egment :: <on 2lustered %able has data segment data o" ever# table is stored in cl"ster
data segment
b3 9nde. )egment :: +ach 9nde. has inde. segment that stores data
c3 6oll 5ac0 )egment :: %emporaril# store Lundo/ in"ormation
What are the #ct )ree and #ct 3sed
4ct Gree is used to denote the percentage o" the ree space that is to be le"t when creating a
table. )imilarl# 4ct *sed is used to denote the percentage o" the used space that is to be used
when creating a table
eg.:: 4ct"ree 20$ 4ctused J0
What is 'ow !haining
%he data o" a row in a table ma# not be able to "it the same data bloc0.;ata "or row is stored in a
chain o" data bloc0s .
What is a A #hase !ommit
N3
%wo 4hase commit is used in distributed data base s#stems. %his is use"ul to maintain the
integrit# o" the database so that all the users see the same values. 9t contains ;-( statements or
6emote 4rocedural calls that re"erence a remote ob&ect. %here are basicall# 2 phases in a 2 phase
commit.
a3 4repare 4hase :: Dlobal coordinator as0s participants to prepare
b3 2ommit 4hase :: 2ommit all participants to coordinator to 4repared$ 6ead onl# or abort 6epl#
What is the difference between deleting and truncating of tables
;eleting a table will not remove the rows "rom the table but entr# is there in the database
dictionar# and it can be retrieved 5ut truncating a table deletes it completel# and it cannot be
retrieved.
What are mutating tables
8hen a table is in state o" transition it is said to be mutating. eg :: 9" a row has been deleted then
the table is said to be mutating and no operations can be done on the table e.cept select.
What are !odd 'ules
2odd 6ules describe the ideal nature o" a 6;5-). <o 6;5-) satis"ies all the 72 codd rules
and racle )atis"ies 77 o" the 72 rules and is the onl# 6dbms to satis"# the ma.imum number o"
rules.
What is .ormalisation
<ormalisation is the process o" organising the tables to remove the redundanc#.%here are mainl#
5 <ormalisation rules.
a3 7 <ormal Gorm :: ' table is said to be in 7
st
<ormal Gorm when the attributes are atomic
b3 2 <ormal Gorm :: ' table is said to be in 2
nd
<ormal Gorm when all the candidate 0e#s are
dependant on the primar# 0e#
c3 3
rd
<ormal Gorm :: ' table is said to be third <ormal "orm when it is not dependant
transitivel#
What is the +ifference between a post 0uery and a pre 0uery
' post quer# will "ire "or ever# row that is "etched but the pre quer# will "ire onl# once.
+eleting the +uplicate rows in the table
8e can delete the duplicate rows in the table b# using the 6owid
!an 3 disable database trigger? 1ow?
,es. 8ith respect to table
'(%+6 %'5(+ %'5(+
]] ;9)'5(+ all_trigger ^^
What is pseudo columns ? .ame them?
' pseudocolumn behaves li0e a table column$ but is not actuall# stored in the table. ,ou can
select "rom pseudocolumns$ but #ou cannot insert$ update$ or delete their values. %his section
describes these pseudocolumns:
O 2*66:'(
O <+P%:'(
O (+:+(
O 689;
O 68<*-
1ow many columns can table ha"e?
%he number o" columns in a table can range "rom 7 to 25J.
,s space ac0uired in bloc%s or extents ?
9n e.tents .
NJ
What is clustered index?
9n an inde.ed cluster$ rows are stored together based on their cluster 0e# values . 2an not applied
"or >')>.
What are the datatypes supported $y oracle :,.TE'.5(;?
:archar2$ <umber$2har $ -()('5+(.
What are attributes of cursor?
SG*<; $ S<%G*<; $ S9)4+<$S682*<%
!an you use select in )'OM clause of S4( select ?
,es.
Which trigger are created when master &detail relay?
master delete propert#
O <<-9)('%+; 1de"ault3
a3 on chec0 delete master
b3 on clear details
c3 on populate details
O 9)('%+;
a3 on clear details
b3 on populate details
O 2')2';+
a3 per-delete
b3 on clear details
c3 on populate details
which system "ariables can be set by users?
),)%+-.-+))'D+_(+:+(
),)%+-.;'%+_%>6+)>(;
),)%+-.+GG+2%9:+_;'%+
),)%+-.)*446+))_86B9<D
What are obect group?
'n ob&ect group is a container "or a group o" ob&ects. ,ou de"ine an ob&ect group when #ou want
to pac0age related ob&ects so #ou can cop# or re"erence them in another module.
What are referenced obects?
6e"erencing allows #ou to create ob&ects that inherit their "unctionalit# and appearance "rom
other ob&ects. 6e"erencing an ob&ect is similar to cop#ing an ob&ect$ e.cept that the resulting
re"erence ob&ect maintains a lin0 to its so"rce object. ' re"erence ob&ect automaticall# inherits
an# changes that have been made to the source ob&ect when #ou open or regenerate the module
that contains the re"erence ob&ect.
!an you store obects in library?
6e"erencing allows #ou to create ob&ects that inherit their "unctionalit# and appearance "rom
other ob&ects. 6e"erencing an ob&ect is similar to cop#ing an ob&ect$ e.cept that the resulting
re"erence ob&ect maintains a lin0 to its source ob&ect. ' re"erence ob&ect automaticall# inherits
an# changes that have been made to the source ob&ect when #ou open or regenerate the module
that contains the re"erence ob&ect.
,s forms K<C ob$ect oriented tool ? why?
#es $ partiall#. 73 464+6%, 2(')) - inheritance propert# 23 :+6(';9<D : procedures
and "unctions.
!an you issue ++( in forms?
N5
#es$ but #ou have to use G6-)_;;(.
6e"erencing allows #ou to create ob&ects that inherit their "unctionalit# and appearance "rom
other ob&ects. 6e"erencing an ob&ect is similar to cop#ing an ob&ect$ e.cept that the resulting
re"erence ob&ect maintains a lin0 to its source ob&ect. ' re"erence ob&ect automaticall# inherits
an# changes that have been made to the source ob&ect when #ou open or regenerate the module
that contains the re"erence ob&ect. 'n# string e.pression up to 32B:
- a literal
- an e.pression or a variable representing the te.t o" a bloc0 o" d#namicall# created 4(/SQL code
- a ;-( statement or
- a ;;( statement
6estrictions:
%he statement #ou pass to G6-)_;;( ma# not contain bind variable re"erences in the string$
but the values o" bind variables can be concatenated into the string be"ore passing the result to
G6-)_;;(.
What is SE!3'E property?
- >ides characters that the operator t#pes into the te.t item. %his setting is t#picall# used "or
pass$ord protection.
What are the types of triggers and how the se0uence of firing in text item
%riggers can be classi"ied as Be# %riggers$ -ouse %riggers $<avigational %riggers.
Be# %riggers :: Be# %riggers are "ired as a result o" Be# action.e.g :: Be#-ne.t-"ield$ Be#-
up$Be#-;own
-ouse %riggers :: -ouse %riggers are "ired as a result o" the mouse navigation.e.g. 8hen-
mouse-button-presed$when-mouse-doubleclic0ed$etc
<avigational %riggers :: %hese %riggers are "ired as a result o" <avigation. +.g. : 4ost-%e.t-
item$4re-te.t-item.
8e also have event triggers li0e when Ynew-"orm-instance and when-new-bloc0-instance.
8e cannot call restricted procedures li0e go_to1Ym#_bloc0."irst_itemY3 in the <avigational
triggers
5ut can use them in the Be#-ne.t-item.
%he ;i""erence between Be#-ne.t and 4ost-%e.t is an ver# important question. %he 0e#-ne.t is
"ired as a result o" the 0e# action while the post te.t is "ired as a result o" the mo"se movement.
Be# ne.t will not "ire unless there is a 0e# event. %he sequence o" "iring in a te.t item are as
"ollows ::
a3 pre - te.t
b3 when new item
c3 0e#-ne.t
d3 when validate
e3 post te.t
!an you store pictures in database? 1ow?
,es $ in long 6aw datat#pe.
What are property classes ? !an property classes ha"e trigger?
4ropert# class inheritance is a power"ul "eature that allows #ou to quic0l# de"ine ob&ects that
con"orm to #our own inter"ace and "unctionalit# standards. 4ropert# classes also allow #ou to
ma0e global changes to applications quic0l#. 5# simpl# changing the de"inition o" a propert#
class$ #ou can change the de"inition o" all ob&ects that inherit properties "rom that class.
,es . 'll t#pe o" triggers .
NN
,f you ha"e property class attached to an item and you ha"e same trigger written for the
item < Which will fire first?
9tem level trigger "ires $ 9" item level trigger "ires$ propert# level trigger won/t "ire. %riggers at
the lowest level are alwa#s given the "irst pre"erence. %he item level trigger "ires "irst and then
the bloc0 and then the Gorm level trigger.
What are record groups ? @ !an record groups created at run&time?
' record group is an internal racle Gorms data str"ct"re that has a column/row "ramewor0
similar to a database table. >owever$ unli0e database tables$ record groups are separate ob&ects
that belong to the "orm module in which the# are de"ined. ' record group can have an unlimited
number o" columns o" t#pe 2>'6$ (<D$ <*-5+6$ or ;'%+ provided that the total number
o" columns does not e.ceed NJB. 6ecord group column names cannot e.ceed 30 characters.
4rogrammaticall#$ record groups can be used whenever the "unctionalit# o""ered b# a two-
dimensional arra# o" multiple data types is desirable.
%,4+) G 6+26; D6*4:
=uer# 6ecord Droup ' quer# record group is a record group that has an associated )+(+2%
statement. %he columns in a quer# record group derive their de"ault names$ data t#pes$ and
lengths "rom the database columns re"erenced in the )+(+2% statement. %he records in a quer#
record group are the rows retrieved b# the quer# associated with that record group.
<on-quer# 6ecord Droup ' non-quer# record group is a group that does not have an associated
quer#$ but whose structure and values can be modi"ied programmaticall# at runtime.
)tatic 6ecord Droup ' static record group is not associated with a quer#I rather$ #ou de"ine its
structure and row values at design time$ and the# remain "i.ed at runtime.
What are 5(E'T?
'n '(+6% is a modal window that displa#s a message noti"#ing operator o" some application
condition.
!an a button ha"e icon and label at the same time ?
-<
What is mouse na"igate property of button?
8hen -ouse <avigate is %rue 1the de"ault3$ racle Gorms per"orms standard navigation to move
the "ocus to the item when the operator activates the item with the mouse.
8hen -ouse <avigate is set to Galse$ racle Gorms does not per"orm navigation 1and the
resulting validation3 to move to the item when an operator activates the item with the mouse.
What is )O'MS7M+,7W,.+OW?
"orms run inside the -;9 application window. %his propert# is use"ul "or calling a "orm "rom
another one.
What are timers ? when when&timer&expired does not fire?
%he 8hen-%imer-+.pired trigger can not "ire during trigger$ navigation$ or transaction
processing.
!an obect group ha"e a bloc%?
,es $ ob&ect group can have bloc0 as well as program units.
1ow many types of can"ases are there<
%here are 2 t#pes o" canvases called as 2ontent and )tac0 2anvas. 2ontent canvas is the de"ault
and the one that is used mostl# "or giving the base e""ect. 9ts li0e a plate on which we add items
and stac0ed canvas is used "or giving 3 dimensional e""ect.
What are user&exits?
9t invo0es 3D( programs.
N7
!an you pass "alues to&and&fro from foreign function ? how ?
,es . ,ou obtain a return value "rom a "oreign "unction b# assigning the return value to an
racle Gorms variable or item. -a0e sure that the racle Gorms variable or item is the same data
t#pe as the return value "rom the "oreign "unction.
'"ter assigning an racle Gorms variable or item value to a 4(/)=( variable$ pass the 4(/)=(
variable as a parameter value in the 4(/)=( inter"ace o" the "oreign "unction. %he 4(/)=(
variable that is passed as a parameter must be a valid 4(/)=( data t#peI it must also be the
appropriate parameter t#pe as de"ined in the 4(/)=( inter"ace.
What is ,5#DT$ structure ?
%he entries o" 4ro O 2 and user e.its and the "orm which simulate the proc or user_e.it are stored
in 9'4P%5 table in d/b.
!an you call W,.&S+/ thru user exits?
,+).
+oes user exits supports +(( on MSW,.+OWS ?
,+) .
What is path setting for +((?
-a0e sure #ou include the name o" the ;(( in the G6-)J5_*)+6+P9% variable o" the
6'2(+.9<9 "ile$ or rename the ;(( to GJ5P%5.;((. 9" #ou rename the ;(( to
GJ5P%5.;(($ replace the e.isting GJ5P%5.;(( in the 6'89<59< director# with the new
GJ5P%5.;((.
1ow is mapping of name of +(( and function done?
%he dll can be created using the :isual 2TT / 3is"al &asic %ools and then the dll is put in the
path that is de"ined the register#.
What is precompiler?
9t is similar to 2 precompiler directives.
!an you connect to non & oracle datasource ? 1ow?
,es .
What are %ey&mode and loc%ing mode properties? le"el ?
Be# -ode : )peci"ies how oracle "orms uniquel# identi"ies rows in the database.%his is
propert# includes "or application that will run against <<-6'2(+ datasources .
Be# setting unique 1de"ault.3
dateable
n-updateable.
(oc0ing mode :
)peci"ies when racle Gorms should attempt to obtain database loc0s on rows that correspond to
queried records in the "orm. a3 immediate b3 dela#ed
What are sa"epoint mode and cursor mode properties ? le"el?
)peci"ies whether racle Gorms should issue savepoints during a session. %his propert# is
included primaril# "or applications that will run against non-6'2(+ data so"rces. Gor
applications that will run against 6'2(+$ use the de"ault setting.
2ursor mode - de"ine cursur state across transaction pen/close.
What is transactional trigger property?
9denti"ies a bloc0 as transactional control bloc0. i.e. non - database bloc0 that oracle "orms
should manage as transactional bloc0.1<<-6'2(+ datasource3 de"ault - G'()+.
What is O(E automation ?
(+ automation allows an (+ server application to e.pose a set o" commands and "unctions
N8
that can be invo0ed "rom an (+ container application. (+ automation provides a wa# "or an
(+ container application to use the "eatures o" an (+ server application to manipulate an
(+ ob&ect "rom the (+ container environment. 1G6-)_(+3
What does in"o%e built&in do?
%his procedure invo0es a method.
)#nta.:
462+;*6+ (+2.9<:B+
1ob&ect ob&_t#pe$
method :'62>'62$
list list_t#pe :H 03I
4arameters:
ob&ect 9s an (+2 'utomation b&ect.
method 9s a method 1procedure3 o" the (+2 ob&ect.
list 9s the name o" an argument list assigned to the (+2.26+'%+_'6D(9)% "unction.
What are O#E.7)O'M,!5((7)O'M,.EW7)O'M? diff?
2'((_G6- : 9t calls the other "orm. but parent remains active$ when called "orm completes
the operation $ it releases loc0 and control goes bac0 to the calling "orm.
8hen #ou call a "orm$ racle Gorms issues a savepoint "or the called "orm. 9" the
2(+'6_G6- "unction causes a rollbac0 when the called "orm is current$ racle Gorms rolls
bac0 uncommitted changes to this savepoint.
4+<_G6- : 8hen #ou call a "orm$ racle Gorms issues a savepoint "or the called "orm. 9"
the 2(+'6_G6- "unction causes a rollbac0 when the called "orm is current$ racle Gorms
rolls bac0 uncommitted changes to this savepoint.
<+8_G6- : +.its the current "orm and enters the indicated "orm. %he calling "orm is
terminated as the parent "orm. 9" the calling "orm had been called b# a higher "orm$ racle Gorms
0eeps the higher call active and treats it as a call to the new "orm. racle Gorms releases memor#
1such as database cursors3 that the terminated "orm was using.
racle Gorms runs the new "orm with the same 6un"orm options as the parent "orm. 9" the parent
"orm was a called "orm$ racle Gorms runs the new "orm with the same options as the parent
"orm.
What is call form stac%?
8hen successive "orms are loaded via the 2'((_G6- procedure$ the resulting module
hierarch# is 0nown as the call "orm stac0.
!an u port applictions across the platforms? how?
,es we can port applications across plat"orms.2onsider the "orm developed in a $indo$s
system.%he "orm would be generated in uni. s#stem b# using "J5gen m#_"orm."mb scott/tiger
What is a "isual attribute?
:isual attributes are the "ont$ color$ and pattern properties that #ou set "or "orm and menu ob&ects
that appear in #our application/s inter"ace.
+iff< between *5T and #roperty !lass?
<amed visual attributes de"ine onl# "ont$ color$ and pattern attributesI propert# classes can
contain these and an# other properties.
,ou can change the appearance o" ob&ects at runtime b# changing the named visual attribute
programmaticall#I propert# class assignment cannot be changed programmaticall#. 8hen an
ob&ect is inheriting "rom both a propert# class and a named visual attribute$ the named visual
attribute settings ta0e precedence$ and an# visual attribute properties in the class are ignored.
NF
Which trigger related to mouse?
8hen--ouse-2lic0
8hen--ouse-;ouble2lic0
8hen--ouse-;own
8hen--ouse-+nter
8hen--ouse-(eave
8hen--ouse--ove
8hen--ouse-*p
What is !urrent record attribute property?
)peci"ies the named visual attribute used when an item is part o" the current record. 2urrent
6ecord 'ttribute is "requentl# used at the bloc0 level to displa# the current row in a multi-record
9" #ou de"ine an item-level 2urrent 6ecord 'ttribute$ #ou can displa# a pre-determined item in a
special color when it is part o" the current record$ but #ou cannot d#namicall# highlight the
current item$ as the input "ocus changes.
!an u change *5T at run time?
,es. ,ou can programmaticall# change an ob&ect/s named visual attribute setting to change the
"ont$ color$ and pattern o" the ob&ect at runtime.
!an u set default font in forms?
,es. 2hange $indo$s registry1regedit3. )et "ormJ5_"ont to the desired "ont.
_brea0
What is (og Switch ?
%he point at which 6'2(+ ends writing to one online redo log "ile and begins writing to
another is called a log switch.
What is On&line 'edo (og?
%he n-line 6edo (og is a set o" tow or more on-line redo "iles that record all committed
changes made to the database. 8henever a transaction is committed$ the corresponding redo
entries temporaril# stores in redo log bu""ers o" the )D' are written to an on-line redo log "ile b#
the bac0ground process (D86. %he on-line redo log "iles are used in c#clical "ashion.
Which parameter specified in the +E)53(T STO'5-E clause of !'E5TE
T5$(ES#5!E cannot be altered after creating the tablespace?
'll the de"ault storage parameters de"ined "or the tablespace can be changed using the '(%+6
%'5(+)4'2+ command. 8hen ob&ects are created their 9<9%9'( and -9<+P%+<) values
cannot be changed.
What are the steps in"ol"ed in +atabase Startup ?
)tart an instance$ -ount the ;atabase and pen the ;atabase.
6olling "orward to recover data that has not been recorded in data "iles$ #et has been recorded
in the on-line redo log$ including the contents o" rollbac0 segments. 6olling bac0 transactions
that have been e.plicitl# rolled bac0 or have not been committed as indicated b# the rollbac0
segments regenerated in step a. 6eleasing an# resources 1loc0s3 held b# transactions in process at
the time o" the "ailure. 6esolving an# pending distributed transactions undergoing a two-phase
commit at the time o" the instance "ailure.
!an )ull $ac%up be performed when the database is open ?
<o.
What are the different modes of mounting a +atabase with the #arallel Server ?
+.clusive -ode 9" the "irst instance that mounts a database does so in e.clusive mode$ onl# that
9nstance can mount the database.
70
4arallel -ode 9" the "irst instance that mounts a database is started in parallel mode$ other
instances that are started in parallel mode can also mount the database.
What are the ad"antages of operating a database in 5'!1,*E(O- mode o"er operating
it in .O 5'!1,*E(O- mode ?
2omplete database recover# "rom dis0 "ailure is possible onl# in '62>9:+(D mode. nline
database bac0up is possible onl# in '62>9:+(D mode.
What are the steps in"ol"ed in +atabase Shutdown ?
2lose the ;atabase$ ;ismount the ;atabase and )hutdown the 9nstance.
What is 5rchi"ed 'edo (og ?
'rchived 6edo (og consists o" 6edo (og "iles that have archived be"ore being reused.
What is 'estricted Mode of ,nstance Startup ?
'n instance can be started in 1or later altered to be in3 restricted mode so that when the database
is open connections are limited onl# to those whose user accounts have been granted the
6+)%692%+; )+))9< s#stem privilege.
!an u ha"e O(E obects in forms?
,es.
!an u ha"e *$D and O!D controls in forms ?
,es.
What r the types of windows :Window style;?
)peci"ies whether the window is a ;ocument window or a %ialog $indo$.
What is O(E 5cti"ation style property?
)peci"ies the event that will activate the (+ containing item.
!an u change the mouse pointer ? 1ow?
,es. )peci"ies the mo"se c"rsor st#le. *se this propert# to d#namicall# change the shape o" the
cursor.
1ow many types of columns are there and what are they
Gormula columns :: Gor doing mathematical calculations and returning one value )ummar#
2olumns :: Gor doing summar# calculations such as summations etc. 4lace holder 2olumns ::
%hese columns are use"ul "or storing the value in a variable
!an u ha"e more than one layout in report
9t is possible to have more than one la#out in a report b# using the additional la#out option in the
la#out editor.
!an u run the report with out a parameter form
,es it is possible to run the report without parameter "orm b# setting the 4'6'- value to <ull
What is the loc% option in reports layout
5# using the loc0 option we cannot move the "ields in the la#out editor outside the "rame. %his is
use"ul "or maintaining the "ields .
What is )lex
Gle. is the propert# o" moving the related "ields together b# setting the "le. propert# on
What are the minimum number of groups re0uired for a matrix report
%he minimum o" groups required "or a matri. report are J e -----
What is a Synonym ?
' s#non#m is an alias "or a table$ view$ sequence or program unit.
What is a Se0uence ?
' sequence generates a serial list o" unique numbers "or numerical columns o" a databases
tables.
77
What is a Segment ?
' segment is a set o" e.tents allocated "or a certain logical structure.
What is schema?
' schema is collection o" database ob&ects o" a *ser.
+escribe 'eferential ,ntegrity ?
' rule de"ined on a column 1or set o" columns3 in one table that allows the insert or update o" a
row onl# i" the value "or the column or set o" columns 1the dependent value3 matches a value in a
column o" a related table 1the re"erenced value3. 9t also speci"ies the t#pe o" data manipulation
allowed on re"erenced data and the action to be per"ormed on dependent data as a result o" an#
action on re"erenced data.
What is 1ash Cluster ?
' row is stored in a hash cluster based on the result o" appl#ing a hash "unction to the row/s
cluster 0e# value. 'll rows with the same hash 0e# value are stores together on dis0.
What is a #ri"ate Synonyms ?
' 4rivate )#non#ms can be accessed onl# b# the owner.
What is Database (in% ?
' database lin0 is a named ob&ect that describes a ?path@ "rom one database to another.
What is index cluster?
' cluster with an inde. on the cluster 0e#.
What is hash cluster?
' row is stored in a hash cluster based on the result o" appl#ing a hash "unction to the row/s
cluster 0e# value. 'll rows with the same hash 0e# value are stores together on dis0.
When can hash cluster used?
>ash clusters are better choice when a table is o"ten queried with equalit# queries. Gor such
queries the speci"ied cluster 0e# value is hashed. %he resulting hash 0e# value points directl# to
the area on dis0 that stores the speci"ied rows.
When can hash cluster used?
>ash clusters are better choice when a table is o"ten queried with equalit# queries. Gor such
queries the speci"ied cluster 0e# value is hashed. %he resulting hash 0e# value points directl# to
the area on dis0 that stores the speci"ied rows.
What are the types of database lin%s?
4rivate database lin0$ public database lin0 U net$or! database lin0.
What is pri"ate database lin%?
4rivate database lin0 is created on behal" o" a speci"ic user. ' private database lin0 can be used
onl# when the owner o" the lin0 speci"ies a global ob&ect name in a SQL statement or in the
de"inition o" the owner/s views or procedures.
What is public database lin%?
4ublic database lin0 is created "or the special user group 4*5(92. ' public database lin0 can be
used when an# user in the associated database speci"ies a global ob&ect name in a )=( statement
or ob&ect de"inition.
What is networ% database lin%?
<etwor0 database lin0 is created and managed b# a networ0 domain service. ' networ0 database
lin0 can be used when an# user o" an# database in the networ0 speci"ies a global ob&ect name in
a )=( statement or ob&ect de"inition.
What is data bloc%?
Oracle databases data is stored in data bloc0s. ne data bloc0 corresponds to a speci"ic
72
number o" b#tes o" ph#sical database space on dis0.
1ow to define data bloc% si2e?
' data bloc0 siAe is speci"ied "or each racle database when the database is created. ' database
users and allocated "ree database space in racle data bloc0s. 5loc0 siAe is speci"ied in init.ora
"ile and cannot be changed latter.
What is row chaining?
9n circumstances$ all o" the data "or a row in a table ma# not be able to "it in the same data bloc0.
8hen this occurs$ the data "or the row is stored in a chain o" data bloc0 1one or more3 reserved
"or that segment.
What is an extent?
'n e.tent is a speci"ic number o" contiguous data bloc0s$ obtained in a single allocation and used
to store a speci"ic t#pe o" in"ormation.
What are the different types of segments?
;ata segment$ inde. segment$ rollbac0 segment and temporar# segment.
What is a data segment?
+ach non-cl"stered table has a data segment. 'll o" the table/s data is stored in the e.tents o" its
data segment. +ach cl"ster has a data segment. %he data o" ever# table in the cluster is stored in
the cluster/s data segment.
What is an index segment?
+ach inde. has an inde. segment that stores all o" its data.
What is rollbac% segment?
' database contains one or more rollbac0 segments to temporaril# store ?undo@ in"ormation.
What are the uses of rollbac% segment?
%o generate read-consistent database in"ormation during database recovery and to rollbac0
uncommitted transactions b# the users.
What is a temporary segment?
%emporar# segments are created b# racle when a SQL statement needs a temporar# wor0 area
to complete e.ecution. 8hen the statement "inishes e.ecution$ the temporar# segment e.tents are
released to the s#stem "or "uture use.
What is a datafile?
+ver# Oracle database has one or more ph#sical data "iles. ' database/s data "iles contain all
the database data. %he data o" logical database structures such as tables and inde.es is ph#sicall#
stored in the data iles allocated "or a database.
What are the characteristics of data files?
' data "ile can be associated with onl# one database. nce created a data "ile can/t change siAe.
ne or more data "iles "orm a logical unit o" database storage called a tablespace.
What is a redo log?
%he set o" redo log iles "or a database is collectivel# 0nown as the database redo log.
What is the function of redo log?
%he primar# "unction o" the redo log is to record all changes made to data.
What is the use of redo log information?
%he in"ormation in a redo log "ile is used onl# to recover the database "rom a system or media
"ailure prevents database data "rom being written to a database/s data "iles.
What does a control file contains?
- ;atabase name
- <ames and locations o" a databases iles and redolog "iles.
73
- %ime stamp o" database creation.
What is the use of control file?
8hen an instance o" an racle database is started$ its control "ile is used to identi"# the database
and redo log "iles that must be opened "or database operation to proceed. 9t is also used in
database recover#.
,s it possible to split the print re"iewer into more than one region?
,es
,s it possible to center an obect hori2ontally in a repeating frame that has a "ariable
hori2ontal si2e?
,es
)or a field in a repeating frame, can the source come from the column which does not exist
in the data group which forms the base for the frame?
,es
!an a field be used in a report without it appearing in any data group?
,es
The oin defined by the default data lin% is an outer oin yes or no?
,es
!an a formula column referred to columns in higher group?
,es
!an a formula column be obtained through a select statement?
,es
,s it possible to insert comments into s0l statements return in the data model editor?
,es
,s it possible to disable the parameter from while running the report?
,es
When a form is in"o%ed with call7form, +oes oracle forms issues a sa"e point?
,es
Explain the difference between a hot bac%up and a cold bac%up and the benefits associated
with each<
' hot bac0up is basicall# ta0ing a bac0up o" the database while it is still up and running and it
must be in archive log mode. ' cold bac0up is ta0ing a bac0up o" the database while it is shut
down and does not require being in archive log mode. %he bene"it o" ta0ing a hot bac0up is that
the database is still available "or use while the bac0up is occurring and #ou can recover the
database to an# point in time. %he bene"it o" ta0ing a cold bac0up is that it is t#picall# easier to
administer the bac0up and recover# process. 9n addition$ since #ou are ta0ing cold bac0ups the
database does not require being in archive log mode and thus there will be a slight per"ormance
gain as the database is not cutting archive logs to dis0.
You ha"e ust had to restore from bac%up and do not ha"e any control files< 1ow would
you go about bringing up this database?
9 would create a te.t based bac0up control "ile$ stipulating where on dis0 all the data "iles where
and then issue the recover command with the using bac0up control "ile clause.
1ow do you switch from an init<ora file to a spfile?
9ssue the create sp"ile "rom p"ile command.
Explain the difference between a data bloc%, an extent and a segment<
' data bloc0 is the smallest unit o" logical storage "or a database ob&ect. 's ob&ects grow the#
ta0e chun0s o" additional storage that are composed o" contiguous data bloc0s. %hese groupings
7J
o" contiguous data bloc0s are called e.tents. 'll the e.tents that an ob&ect ta0es when grouped
together are considered the segment o" the database ob&ect.
-i"e two examples of how you might determine the structure of the table +E#T<
*se the describe command or use the dbms_metadata.get_ddl pac0age.
Where would you loo% for errors from the database engine?
9n the alert log.
!ompare and contrast T'3.!5TE and +E(ETE for a table<
5oth the truncate and delete command have the desired outcome o" getting rid o" all the rows in
a table. %he di""erence between the two is that the truncate command is a ;;( operation and &ust
moves the high water mar0 and produces a now rollbac0. %he delete command$ on the other
hand$ is a ;-( operation$ which will produce a rollbac0 and thus ta0e longer to complete.
-i"e the reasoning behind using an index<
Gaster access to data bloc0s in a table.
-i"e the two types of tables in"ol"ed in producing a star schema and the type of data they
hold<
Gact tables and dimension tables. ' "act table contains measurements while dimension tables will
contain data that will help describe the "act tables.
What type of index should you use on a fact table?
' 5itmap inde..
-i"e two examples of referential integrity constraints<
' primar# 0e# and a "oreign 0e#.
5 table is classified as a parent table and you want to drop and re&create it< 1ow would you
do this without affecting the children tables?
;isable the "oreign 0e# constraint to the parent$ drop the table$ re-create the table$ enable the
"oreign 0e# constraint.
Explain the difference between 5'!1,*E(O- mode and .O5'!1,*E(O- mode and
the benefits and disad"antages to each<
'62>9:+(D mode is a mode that #ou can put the database in "or creating a bac0up o" all
transactions that have occurred in the database so that #ou can recover to an# point in time.
<'62>9:+(D mode is basicall# the absence o" '62>9:+(D mode and has the
disadvantage o" not being able to recover to an# point in time. <'62>9:+(D mode does
have the advantage o" not having to write transactions to an archive log and thus increases the
per"ormance o" the database slightl#.
What command would you use to create a bac%up control file?
'lter database bac0up control "ile to trace.
-i"e the stages of instance startup to a usable state where normal users may access it<
)%'6%*4 <-*<% - 9nstance startup
)%'6%*4 -*<% - %he database is mounted
)%'6%*4 4+< - %he database is opened
What column differentiates the *> "iews to the -*> "iews and how?
%he 9<)%_9; column which indicates the instance in a 6'2 environment the in"ormation came
"rom.
1ow would you go about generating an ED#(5,. plan?
2reate a plan table with utl.plan.sql.
*se the e.plain plan set statement_id H Ltst7/ into plan_table "or a SQL statement
(oo0 at the e.plain plan with utl.plp.sql or utl.pls.sql
75
1ow would you go about increasing the buffer cache hit ratio?
*se the bu""er cache advisor# over a given wor0load and then quer# the vEdb_cache_advice
table. 9" a change was necessar# then 9 would use the alter system set db_cache_siAe command.
Explain an O'5&BFCCC
,ou get this error when #ou get a snapshot too old within rollbac0. 9t can usuall# be solved b#
increasing the undo retention or increasing the siAe o" rollbac0s. ,ou should also loo0 at the
logic involved in the application getting the error message.
Explain the difference between >O'5!(E71OME and >O'5!(E7$5SE<
6'2(+_5')+ is the root director# "or oracle. 6'2(+_>-+ located beneath
6'2(+_5')+ is where the oracle products reside.
1ow would you determine the time 2one under which a database was operating?
select ;5%9-+C<+ "rom dualI
Explain the use of setting -(O$5(7.5MES e0ual to T'3E<
)etting D(5'(_<'-+) dictates how #ou might connect to a database. %his variable is either
%6*+ or G'()+ and i" it is set to %6*+ it en"orces database lin0s to have the same name as the
remote database to which the# are lin0ing.
What command would you use to encrypt a #(?S4( application?
86'4
Explain the difference between a )3.!T,O., #'O!E+3'E and #5!/5-E<
' "unction and procedure are the same in that the# are intended to be a collection o" 4(/SQL
code that carries a single tas0. 8hile a procedure does not have to return an# values to the
calling application$ a "unction will return a single value. ' pac0age on the other hand is a
collection o" "unctions and procedures that are grouped together based on their commonalit# to a
business "unction or application.
Explain the use of table functions<
%able "unctions are designed to return a set o" rows through 4(/)=( logic but are intended to be
used as a normal table or view in a )=( statement. %he# are also used to pipeline in"ormation in
an +%( process.
.ame three ad"isory statistics you can collect<
5u""er 2ache 'dvice$ )egment (evel )tatistics$ U %imed )tatistics
Where in the Oracle directory tree structure are audit traces placed?
9n uni. E6'2(+_>-+/rdbms/audit$ in 8indows the event viewer
Explain materiali2ed "iews and how they are used<
-aterialiAed views are ob&ects that are reduced sets o" in"ormation that have been summariAed$
grouped$ or aggregated "rom base tables. %he# are t#picall# used in data warehouse or decision
support s#stems.
When a user process fails, what bac%ground process cleans up after it?
4-<
What bac%ground process refreshes materiali2ed "iews?
%he Qob =ueue 4rocesses.
1ow would you determine what sessions are connected and what resources they are
waiting for?
*se o" :E)+))9< and :E)+))9<_8'9%
+escribe what redo logs are<
6edo logs are logical and ph#sical structures that are designed to hold all the changes made to a
database and are intended to aid in the recover# o" a database.
7N
1ow would you force a log switch?
'(%+6 ),)%+- )89%2> (DG9(+I
-i"e two methods you could use to determine what ++( changes ha"e been made<
,ou could use (ogminer or )treams
What does coalescing a tablespace do?
2oalescing is onl# valid "or dictionar#-managed tablespaces and de-"ragments space b#
combining neighboring "ree e.tents into large single e.tents.
What is the difference between a TEM#O'5'Y tablespace and a #E'M5.E.T
tablespace?
' temporar# tablespace is used "or temporar# ob&ects such as sort structures while permanent
tablespaces are used to store those ob&ects meant to be used as the true ob&ects o" the database.
.ame a tablespace automatically created when you create a database<
%he ),)%+- tablespace.
When creating a user, what permissions must you grant to allow them to connect to the
database?
Drant the 2<<+2% to the user.
1ow do you add a data file to a tablespace
'(%+6 %'5(+)4'2+ ';; ;'%'G9(+ )9C+
1ow do you resi2e a data file?
'(%+6 ;'%'5')+ ;'%'G9(+ 6+)9C+ I
What "iew would you use to loo% at the si2e of a data file?
;5'_;'%'_G9(+)
What "iew would you use to determine free space in a tablespace?
;5'_G6++_)4'2+
1ow would you determine who has added a row to a table?
%urn on "ine grain auditing "or the table.
1ow can you rebuild an index?
'(%+6 9<;+P 6+5*9(;I
Explain what partitioning is and what its benefit is<
4artitioning is a method o" ta0ing large tables and inde.es and splitting them into smaller$ more
manageable pieces.
You ha"e ust compiled a #(?S4( pac%age but got errors, how would you "iew the errors?
)>8 +666)
1ow can you gather statistics on a table?
%he '<'(,C+ command.
1ow can you enable a trace for a session?
*se the ;5-)_)+))9<.)+%_)=(_%6'2+ or
*se '(%+6 )+))9< )+% )=(_%6'2+ H %6*+I
What is the difference between the S4(@(oader and ,M#O'T utilities?
%hese two racle utilities are used "or loading data into the database. %he di""erence is that the
import utilit# relies on the data being produced b# another racle utilit# +P46% while the
)=(O(oader utilit# allows data to be loaded that has been produced b# other utilities "rom
di""erent data so"rces &ust so long as it con"orms to ')299 "ormatted or delimited "iles.
.ame two files used for net%ork connection to a database<
%<)<'-+).6' and )=(<+%.6'
77
What is the function of Optimi2er ?
%he goal o" the optimiAer is to choose the most e""icient wa# to e.ecute a SQL statement.
What is Execution #lan ?
%he combinations o" the steps the optimiAer chooses to e.ecute a statement is called an e.ecution
plan.
!an one resi2e tablespaces and data files? :for +$5;
ne can manuall# increase or decrease the siAe o" a data"ile "rom racle 7.2 using the command.
'(%+6 ;'%'5')+ ;'%'G9(+ L"ilename2/ 6+)9C+ 700-I
5ecause #ou can change the siAes o" data"iles$ #ou can add more space to #our database without
adding more data"iles. %his is bene"icial i" #ou are concerned about reaching the ma.imum
number o" data"iles allowed in #our database.
-anuall# reducing the siAes o" data"iles allows #ou to reclaim unused space in the database. %his
is use"ul "or correcting errors in estimations o" space requirements.
'lso$ data"iles can be allowed to automaticall# e.tend i" more space is required. (oo0 at the
"ollowing command:
26+'%+ %'5(+)4'2+ pcs_data_ts
;'%'G9(+ Lc:Zora_appsZpcsZpcsdata7.db"/ )9C+ 3-
'*%+P%+<; < <+P% 7- -'P)9C+ *<(9-9%+;
;+G'*(% )%6'D+ 19<9%9'( 702J0
<+P% 702J0
-9<+P%+<%) 7
-'P+P%+<%) *<(9-9%+;
42%9<26+')+ 03
<(9<+
4+6-'<+<%I
What is S5*E #O,.T ?
Gor long transactions that contain man# )=( statements$ intermediate mar0ers or savepoints can
be declared which can be used to divide a transaction into smaller parts. %his allows the option o"
later rolling bac0 all wor0 per"ormed "rom the current point in the transaction to a declared
savepoint within the transaction.
What are the "alues that can be specified for O#T,M,9E' MO+E #arameter ?
2)% and 6*(+.
!an one rename a tablespace? :for +$5;
<o$ this is listed as +nhancement 6equest 7J87J2. 8or0around:
+.port all o" the ob&ects "rom the tablespace
;rop the tablespace including contents
6ecreate the tablespace
9mport the ob&ects
What is '3(E&based approach to optimi2ation ?
2hoosing an e.ecuting planbased on the access paths available and the ran0s o" these access
paths.
What are the "alues that can be specified for O#T,M,9E'7-O5( parameter of the
5(TE' SESS,O. !ommand ?
2>)+$'((_68)$G96)%_68) and 6*(+.
1ow does one create a standby database? :for +$5;
8hile #our production database is running$ ta0e an 1image cop#3 bac!"p and restore it on
78
duplicate hardware. <ote that an e.port will not wor0VVV
n #our standb# database$ issue the "ollowing commands:
'(%+6 ;'%'5')+ 26+'%+ )%'<;5, 2<%6(G9(+ ') L"ilename/I
'(%+6 ;'%'5')+ -*<% )%'<;5, ;'%'5')+I
6+2:+6 )%'<;5, ;'%'5')+I
n s#stems prior to Oracle 1i$ write a &ob to cop# archived redo log "iles "rom the primar#
database to the standb# s#stem$ and appl# the redo log "iles to the standb# database 1pipe it3.
6emember the database is recovering and will prompt #ou "or the ne.t log "ile to appl#.
racle 8i onwards provide an ?'utomated )tandb# ;atabase@ "eature$ which will send archived$
log "iles to the remote site via <+%8$ and appl# then to the standb# database.
8hen one needs to activate the standb# database$ stop the recover# process and activate it:
'(%+6 ;'%'5')+ '2%9:'%+ )%'<;5, ;'%'5')+I
1ow does one gi"e developers access to trace files :re0uired as input to t%prof;? :for +$5;
%he ?alter session set sql_traceHtrue@ command generates trace "iles in *)+6_;*-4_;+)%
that can be used b# developers as input to t0pro". n *ni. the de"ault "ile mas0 "or these "iles are
?rw. r-- ---?.
%here is an undocumented 9<9%.6' parameter that will allow ever#one to read 1rw. r-r--3
these trace "iles:
_trace_"iles_public H true
9nclude this in #our 9<9%.6' "ile and bounce #our database "or it to ta0e e""ect.
What are the responsibilities of a +atabase 5dministrator ?
9nstalling and upgrading the racle Server and application tools. 'llocating s#stem storage and
planning "uture storage requirements "or the database s#stem. -anaging primar# database
structures 1tablespaces3 -anaging primar# ob&ects 1table$views$inde.es3 +nrolling users and
maintaining system sec"rity. +nsuring compliance with ralce license agreement 2ontrolling
and monitoring user access to the database. -onitoring and optimiAing the per"ormance o" the
database. 4lanning "or bac0up and recover# o" database in"ormation. -aintain archived data on
tape 5ac0ing up and restoring the database. 2ontacting racle 2orporation "or technical support.
What is a trace file and how is it created ?
+ach server and bac0ground process can write an associated trace "ile. 8hen an internal error is
detected b# a process or user process$ it dumps in"ormation about the error to its trace. %his can
be used "or tuning the database.
What are the roles and user accounts created automatically with the database?
;5' - role 2ontains all database system privileges.
),) user account - %he ;5' role will be assigned to this account. 'll o" the base tables and
views "or the database/s dictionar# are store in this schema and are manipulated onl# b#
6'2(+. ),)%+- user account - 9t has all the s#stem privileges "or the database and
additional tables and views that displa# administrative in"ormation and internal tables and views
used b# oracle tools are created using this username.
What are the minimum parameters should exist in the parameter file :init<ora; ?
;5 <'-+ - -ust set to a te.t string o" no more than 8 characters and it will be stored inside the
data"iles$ redo log "iles and control "iles and control "ile while database creation.
;5_;-'9< - 9t is string that speci"ies the net$or! domain where the database is created.
%he global database name is identi"ied b# setting these parameters
1;5_<'-+ U ;5_%OMA)03 2<%6( G9(+) - (ist o" control "ilenames o" the database. 9"
name is not mentioned then de"ault name will be used.
7F
;5_5(2B_5*GG+6) - %o determine the no o" bu""ers in the bu""er cache in )D'.
462+))+) - %o determine number o" operating s#stem processes that can be connected to
6'2(+ concurrentl#. %he value should be 5 1bac0ground process3 and additional 7 "or each
user.
6((5'2B_)+D-+<%) - (ist o" rollbac0 segments an 6'2(+ instance acquires at
database startup. 'lso optionall#
(92+<)+_-'P_)+))9<)$(92+<)+_)+))9<_8'6<9<D and
(92+<)+_-'P_*)+6).
Why and when should , bac%up my database? :for +$5;
5ac0up and recover# is one o" the most important aspects o" a ;5's &ob. 9" #ou lose #our
compan#/s data$ #ou could ver# well lose #our &ob. >ardware and so"tware can alwa#s be
replaced$ but #our data ma# be irreplaceableV
<ormall# one would schedule a hierarch# o" dail#$ wee0l# and monthl# bac0ups$ however
consult with #our users be"ore deciding on a bac0up schedule. 5ac0up "requenc# normall#
depends on the "ollowing "actors:
. 6ate o" data change/ transaction rate
. ;atabase availabilit#/ 2an #ou shutdown "or cold bac0upsY
. 2riticalit# o" the data/ :alue o" the data to the compan#
. 6ead-onl# tablespace needs bac0ing up &ust once right a"ter #ou ma0e it read-onl#
. 9" #ou are running in archivelog mode #ou can bac0up parts o" a database over an e.tended
c#cle o" da#s
. 9" archive logging is enabled one needs to bac0up archived log "iles timeousl# to prevent
database "reeAes
. +tc.
2are"ull# plan bac0up retention periods. +nsure enough bac0up media 1tapes3 are available and
that old bac0ups are e.pired in-time to ma0e media available "or new bac0ups. ""-site vaulting
is also highl# recommended.
Grequentl# test #our abilit# to recover and document all possible scenarios. 6emember$ it/s the
little things that will get #ou. -ost "ailed recoveries are a result o" organiAational errors and
miscommunications.
What strategies are a"ailable for bac%ing&up an Oracle database? :for +$5;
%he "ollowing methods are valid "or bac0ing-up an racle database:
+.port/9mport - +.ports are ?logical@ database bac0ups in that the# e.tract logical de"initions
and data "rom the database to a "ile.
2old or ""-line 5ac0ups - )hut the database down and bac0up up '(( data$ log$ and control
"iles.
>ot or n-line 5ac0ups - 9" the databases are available and in '62>9:+(D mode$ set the
tablespaces into bac0up mode and bac0up their "iles. 'lso remember to bac0up the control "iles
and archived redo log "iles.
6-'< 5ac0ups - 8hile the database is o""-line or on-line$ use the ?rman@ utilit# to bac0up the
database.
9t is advisable to use more than one o" these methods to bac0up #our database. Gor e.ample$ i"
#ou choose to do on-line database bac0ups$ also cover #oursel" b# doing database e.ports. 'lso
test '(( bac0up and recover# scenarios care"ull#. 9t is better to be save than sorr#.
6egardless o" #our strateg#$ also remember to bac0up all required so"tware libraries$ parameter
"iles$ password "iles$ etc. 9" #our database is in '62D9:+(D mode$ #ou also need to bac0up
80
archived log "iles.
What is the difference between online and offline bac%ups? :for +$5;
' hot bac0up is a bac0up per"ormed while the database is online and available "or read/write.
+.cept "or racle e.ports$ one can onl# do on-line bac0ups when running in '62>9:+(D
mode.
' cold bac0up is a bac0up per"ormed while the database is o""-line and unavailable to its users.
What is the difference between restoring and reco"ering? :for +$5;
6estoring involves cop#ing bac0up "iles "rom secondar# storage 1bac0up media3 to dis0. %his
can be done to replace damaged "iles or to cop#/move a database to a new location.
6ecover# is the process o" appl#ing redo logs to the database to roll it "orward. ne can roll-
"orward until a speci"ic point-in-time 1be"ore the disaster occurred3$ or roll-"orward until the last
transaction recorded in the log "iles. )qlK connect ),) as ),);5'
)qlK 6+2:+6 ;'%'5')+ *<%9( %9-+ L2007-03-0N:7N:00:00/ *)9<D 5'2B*4
2<%6(G9(+I
1ow does one bac%up a database using the export utility? :for +$5;
racle e.ports are ?logical@ database bac0ups 1not ph#sical3 as the# e.tract data and logical
de"initions "rom the database into a "ile. ther bac0up strategies normall# bac0-up the ph#sical
data "iles.
ne o" the advantages o" e.ports is that one can selectivel# re-import tables$ however one cannot
roll-"orward "rom an restored e.port "ile. %o completel# restore a database "rom an e.port "ile
one practicall# needs to recreate the entire database.
'lwa#s do "ull s#stem level e.ports 1G*((H,+)3. Gull e.ports include more in"ormation about
the database in the e.port "ile than user level e.ports.
What are the built7ins used the display the (O*?
)how_lov
(ist_values
1ow do you call other Oracle #roducts from Oracle )orms?
6un_product is a built-in$ *sed to invo0e one o" the supported oracle tools products and
speci"ies the name o" the document or module to be run. 9" the called product is unavailable at
the time o" the call$ racle Gorms returns a message to the operator.
What is the main diff< bet< 'eports A<B E 'eports A<C?
6eport 2.5 is ob&ect oriented.
What are the $uilt&ins to display the user&named editor?
' user named editor can be displa#ed programmaticall# with the built in procedure )>8-
+;9%6$ +;9%_%+%9%+- independent o" an# particular te.t item.
1ow many number of columns a record group can ha"e?
' record group can have an unlimited number o" columns o" t#pe 2>'6$ (<D$ <*-5+6$ or
;'%+ provided that the total number o" column does not e.ceed NJB.
What is a 4uery 'ecord -roup?
' quer# record group is a record group that has an associated )+(+2% statement. %he columns
in a quer# record group derive their de"ault names$ data t#pes$ had lengths "rom the database
columns re"erenced in the )+(+2% statement. %he records in quer# record group are the rows
retrieved b# the quer# associated with that record group. 8hat is a <on =uer# 6ecord DroupY
What does the term panel refer to with regard to pages?
' panel is the no. o" ph#sical pages needed to print one logical page.
What is a master detail relationship?
87
' master detail relationship is an association between two base table bloc0s- a master bloc0 and
a detail bloc0. %he relationship between the bloc0s re"lects a primar# 0e# to "oreign 0e#
relationship between the tables on which the bloc0s are based.
What is a library?
' librar# is a collection o" subprograms including user named procedures$ "unctions and
pac0ages.
What is an anchoring obect E what is its use? What are the "arious sub e"ents a mouse
double clic% e"ent in"ol"es?
'n anchoring ob&ect is a print condition ob&ect which used to e.plicitl# or implicitl# anchor other
ob&ects to itsel".
3se the add7group7column function to add a column to record group that was created at a
design time?
Galse
What are the "arious sub e"ents a mouse double clic% e"ent in"ol"es? What are the "arious
sub e"ents a mouse double clic% e"ent in"ol"es?
;ouble clic0ing the mouse consists o" the mouse down$ mouse up$ mouse clic0$ mouse down U
mouse up events.
What is the use of brea% group? What are the "arious sub e"ents a mouse double clic%
e"ent in"ol"es?
' brea0 group is used to displa# one record "or one group ones. 8hile multiple related records in
other group can be displa#ed.
What tuning indicators can one use? :for +$5;
%he "ollowing high-level tuning indicators can be used to establish i" a database is per"orming
optimall# or not:
. 5u""er 2ache >it 6atio
Gormula: >it 6atio H 1(ogical 6eads - 4h#sical 6eads3 / (ogical 6eads
'ction: 9ncrease ;5_2'2>+_)9C+ 1;5_5(2B_5*GG+6) prior to Fi3 to increase hit ratio
. (ibrar# 2ache >it 6atio
'ction: 9ncrease the )>'6+;_4(_)9C+ to increase hit ratio
What tools?utilities does Oracle pro"ide to assist with performance tuning? :for +$5;
racle provide the "ollowing tools/ utilities to assist with per"ormance monitoring and tuning:
. %B4ro"
. *%(5)%'%.SQL and *%(+)%'%.)=( - 5egin and end stats monitoring
. )tatspac0
. racle +nterprise -anager - %uning 4ac0
What is ST5TS#5!/ and how does one use it? :for +$5;
)tatspac0 is a set o" perormance monitoring and reporting utilities provided b# racle "rom
racle8i and above. )tatspac0 provides improved 5)%'%/+)%'% "unctionalit#$ though the old
5)%'%/+)%'% scripts are still available. Gor more in"ormation about )%'%)4'2B$ read the
documentation in "ile E6'2(+_>-+/rdbms/admin/spdoc.t.t.
9nstall )tatspac0:
cd E6'2(+_>-+/rdbms/admin
sqlplus ?/ as s#sdba@ _spdrop.sql\9nstall )tatspac0 -
sqlplus ?/ as s#sdba@ _spcreate.sql\+nter tablespace names when prompted
*se )tatspac0:
sqlplus per"stat/per"stat
82
e.ec statspac0.snapI -- %a0e a per"ormance snapshots
e.ec statspac0.snapI
o Det a list o" snapshots
select )<'4_9;$ )<'4_%9-+ "rom )%'%)E)<'4)>%I
_spreport.sql\+nter two snapshot id/s "or di""erence report
ther )tatspac0 )cripts:
. sppurge.sql - 4urge a range o" )napshot 9d/s between the speci"ied begin and end )nap 9d/s
. spauto.sql - )chedule a dbms_&ob to automate the collection o" )%'%4'2B statistics
. spcreate.sql - 9nstalls the )%'%)4'2B user$ tables and pac0age on a database 16un as ),)3.
. spdrop.sql - ;einstall )%'%)4'2B "rom database 16un as ),)3
. sppurge.sql - ;elete a range o" )napshot 9d/s "rom the database
. spreport.sql - 6eport on di""erences between values recorded in two snapshots
. sptrunc.sql - %runcates all data in )tatspac0 tables
What are the common 'M5. errors :with solutions;? :for +$5;
)ome o" the common 6-'< errors are:
6-'<-202J2: )peci"ication does not match an# archivelog in the recover# catalog.
'dd to 6-'< script: sql Lalter system archive log current/I
6-'<-0N08F: archived log .#A not "ound or out o" s#nc with catalog
+.ecute "rom 6-'<: change archivelog all validateI
1ow can you execute the user defined triggers in forms I<B ?
+.ecute %rigger 1trigger-name3
What E'5SE pac%age procedure does ?
+rase removes an indicated global variable.
What is the difference between .5ME7,. and !O#Y ?
2op# is pac0age procedure and writes values into a "ield.
<ame in is a pac0age "unction and returns the contents o" the variable to which #ou appl#.
What pac%age procedure is used for calling another form ?
2all 1+.g. 2all1"ormname3
When the form is running in +E$3- mode, ,f you want to examine the "alues of global
"ariables and other form "ariables, What pac%age procedure command you would use in
your trigger text ?
5rea0.
),)%+- :'69'5(+)
The "alue recorded in system<last7record "ariable is of type
a. <umber
b. 5oolean
c. 2haracter. Y
b. 5oolean.
What is mean by #rogram -lobal 5rea :#-5; ?
9t is area in memor# that is used b# a )ingle Oracle 'ser 4rocess.
What is hit ratio ?
9t is a measure o" well the data cache bu""er is handling requests "or data. >it 6atio H 1(ogical
6eads - 4h#sical 6eads - >its -isses3/ (ogical 6eads.
1ow do u implement the ,f statement in the Select Statement
8e can implement the i" statement in the select statement b# using the ;ecode statement. e.g.
select ;+2;+ 1+-4_2'%$/7/$/Girst/$/2/$/)econd/<ull3I >ere the <ull is the else statement
83
where null is done .
1ow many types of Exceptions are there
%here are 2 t#pes o" e.ceptions. %he# are
a3 )#stem +.ceptions
e.g. 8hen no_data_"ound$ 8hen too_man#_rows
b3 *ser ;e"ined +.ceptions
e.g. -#_e.ception e.ception
8hen -#_e.ception then
What are the inline and the precompiler directi"es
%he inline and precompiler directives detect the values directl#
1ow do you use the same lo" for A columns
8e can use the same lov "or 2 columns b# passing the return values in global values and using
the global values in the code
1ow many minimum groups are re0uired for a matrix report
%he minimum number o" groups in matri. report are J
What is the difference between static and dynamic lo"
%he static lov contains the predetermined values while the d#namic lov contains values that
come at run time
1ow does one manage Oracle database users? :for +$5;
racle user accounts can be loc0ed$ unloc0ed$ "orced to choose new passwords$ etc. Gor
e.ample$ all accounts e.cept ),) and ),)%+- will be loc0ed a"ter creating an racleFi;5
database using the ;5 2on"iguration 'ssistant 1dbca3. ;5'/s must unloc0 these accounts to
ma0e them available to users.
(oo0 at these e.amples:
'(%+6 *)+6 scott '22*<% (2B\loc0 a user account
'(%+6 *)+6 scott '22*<% *<(2BI -- unloc0s a loc0ed users account
'(%+6 *)+6 scott 4'))86; +P496+I -- Gorce user to choose a new password
What is the difference between +$)ile Se0uential and Scattered 'eads?:for +$5;
5oth ?db "ile sequential read@ and ?db "ile scattered read@ events signi"# time waited "or 9/ read
requests to complete. %ime is reported in 700/s o" a second "or Oracle 1i releases and below$
and 7000/s o" a second "or racle Fi and above. -ost people con"use these events with each
other as the# thin0 o" how data is read "rom dis0. 9nstead the# should thin0 o" how data is read
into the )D' bu""er cache.
db "ile sequential read:
' sequential read operation reads data into contiguous memor# 1usuall# a single-bloc0 read with
p3H7$ but can be multiple bloc0s3. )ingle bloc0 9/s are usuall# the result o" using inde.es. %his
event is also used "or rebuilding the control "ile and reading data ile headers 142H73. 9n
general$ this event is indicative o" dis0 contention on inde. reads.
db "ile scattered read:
)imilar to db "ile sequential reads$ e.cept that the session is reading multiple data bloc0s and
scatters them into di""erent discontinuous bu""ers in the )D'. %his statistic is <6-'((,
indicating dis0 contention on "ull table scans. 6arel#$ data "rom "ull table scans could be "itted
into a contiguous bu""er area$ these waits would then show up as sequential reads instead o"
scattered reads.
%he "ollowing quer# shows average wait time "or sequential versus scattered reads:
prompt ?':+6'D+ 8'9% %9-+ G6 6+'; 6+=*+)%)@
8J
select a.average_wait ?)+= 6+';@$ b.average_wait ?)2'% 6+';@
"rom s#s.v_Es#stem_event a$ s#s.v_Es#stem_event b
where a.event H Ldb "ile sequential read/
and b.event H Ldb "ile scattered read/I
What is the use of #5'),(E option in ED# command ?
<ame o" the parameter "ile to be passed "or e.port.
What is the use of T5$(ES option in ED# command ?
(ist o" tables should be e.ported.Ae3
What is the O#T,M5( parameter?
9t is used to set the optimal length o" a rollbac0 segment.
1ow does one use O'5+E$3- from Ser"er Manager? S4(@#lus? :for +$5;
+.ecute the ?6';+5*D >+(4@ command "rom svrmgrl or sqlplus to obtain a list o" valid
6';+5*D commands. (oo0 at these e.amples:
)=(4(*)K 6+- %race )=( statements with bind variables
)=(4(*)K oradebug setospid 70727
racle pid: F7$ *ni. process pid: 70727$ image: oracleorcl
)=(4(*)K oradebug +:+<% 700JN trace name conte.t "orever$ level 72
)tatement processed.
)=(4(*)K V vi /app/oracle/admin/orcl/bdump/ora_70727.trc
)=(4(*)K 6+- %race 4rocess )tatistics
)=(4(*)K oradebug setorapid 2
*ni. process pid: 7J3N$ image: ora_pmon_orcl
)=(4(*)K oradebug procstat
)tatement processed.
)=(4(*)KK oradebug %6'2+G9(+_<'-+
/app/oracle/admin/orcl/bdump/pmon_7J3N.trc
)=(4(*)K 6+- (ist semaphores and shared memor# segments in use
)=(4(*)K oradebug ipc
)=(4(*)K 6+- ;ump +rror )tac0
)=(4(*)K oradebug setospid
)=(4(*)K oradebug event immediate trace name errorstac0 level 3
)=(4(*)K 6+- ;ump 4arallel )erver ;(- loc0s
)=(4(*)K oradebug l0debug -a convloc0
)=(4(*)K oradebug l0debug -a convres
)=(4(*)K oradebug l0debug -r 1i.e 0.80NNd338 "rom convres dump3
5re there any undocumented commands in Oracle? :for +$5;
)ure there are$ but it is hard to "ind them. (oo0 at these e.amples:
Grom )erver -anager 1racle7.3 and above3: 6';+5*D >+(4
9t loo0s li0e one can change memor# locations with the 6';+5*D 4B+ command. 'n#one
brave enough to test this one "or usY 4reviousl# this "unctionalit# was available with 6';5P
1ls -l E6'2(+_>-+/rdbms/lib/oradb..oI ma0e -" oracle.m0 oradb.3 )=(O4lus: '(%+6
)+))9< )+% 2*66+<%_)2>+-' H ),)
,f the maximum record retrie"ed property of the 0uery is set to FB then a summary "alue
will be calculated?
nl# "or 70 records.
What are the different obects that you cannot copy or reference in obect groups?
85
b&ects o" di""erent modules
'nother ob&ect groups
9ndividual bloc0 dependent items
4rogram units.
What is an O(E?
b&ect (in0ing U +mbedding provides #ou with the capabilit# to integrate ob&ects "rom man#
-s-8indows applications into a single compound document creating integrated applications
enables #ou to use the "eatures "orm .
!an a repeating frame be created without a data group as a base?
<o
,s it possible to set a filter condition in a cross product group in matrix reports?
<o
What is O"erloading of procedures ?
%he )ame procedure name is repeated with parameters o" di""erent datat#pes and parameters in
di""erent positions$ var#ing number o" parameters is called overloading o" procedures. e.g.
;5-)_*%4*% put_line
What are the return "alues of functions S4(!O+E and S4(E''M ? What is #ragma
EDE!#T,O.7,.,T ? Explain the usage ?
)=(2;+ returns the latest code o" the error that has occurred.
)=(+66- returns the relevant error message o" the )=(2;+.
What are the datatypes a a"ailable in #(?S4( ?
)ome scalar data types such as <*-5+6$ :'62>'62$ ;'%+$ 2>'6$ (<D$ 5(+'<.
)ome composite data t#pes such as 6+26; U %'5(+.
What are the two parts of a procedure ?
4rocedure )peci"ication and 4rocedure 5od#.
What is the basic structure of #(?SQL ?
4(/)=( uses bloc0 structure as its basic structure. 'non#mous bloc0s or nested bloc0s can be
used in 4(/)=(
What is #(?S4( table ?
b&ects o" t#pe %'5(+ are called ?4(/)=( tables@$ which are modeled as 1but not the same as3
database tables$ 4(/)=( tables use a primar# 4(/)=( tables can have one column and a
primar# 0e#. 2ursors
W15T ,S 'M5. ? :for +$5;
6ecover# -anager is a tool that: manages the process o" creating bac0ups and also manages the
process o" restoring and recovering "rom them.
W1Y 3SE 'M5. ? :for +$5;
<o e.tra costs `9ts available "ree
Y6-'< introduced in racle 8 it has become simpler with newer versions and easier than user
managed bac0ups
Y4roper securit#
Y,ou are 700S sure #our database has been bac0ed up.
Y9ts contains detail o" the bac0ups ta0en etc in its central repositor#
Gacilit# "or testing validit# o" bac0ups also commands li0e crosschec0 to chec0 the status o"
bac0up.
Gaster bac!"ps and restores compared to bac0ups without 6-'<
6-'< is the onl# bac0up tool which supports incremental bac0ups.
8N
racle 70g has got "urther optimiAed incremental bac0up which has resulted in improvement o"
per"ormance during bac0up and recover# time
4arallel operations are supported
5etter quer#ing "acilit# "or 0nowing di""erent details o" bac0up
<o e.tra redo generated when bac0up is ta0en..compared to online
bac0up without 6-'< which results in saving o" space in hard dis0
6-'< an intelligent tool
-aintains repositor# o" bac0up metadata
6emembers bac0up set location
Bnows what need to bac0ed up
Bnows what is required "or recover#
Bnows what bac0ups are redundant
3.+E'ST5.+,.- T1E 'M5. 5'!1,TE!T3'E
'n oracle 6-'< comprises o"
6-'< +P+2*%'5(+ %his could be present and "ired even through client side
%'6D+% ;'%'5')+ %his is the database which needs to be bac0ed up .
6+2:+6, 2'%'(D 6ecover# catalog is optional otherwise bac0up details are stored in
target database control"ile .
9t is a repositor# o" in"ormation queried and updated b# 6ecover# -anager
9t is a schema or user stored in Oracle database. ne schema can support man# databases
9t contains in"ormation about ph#sical schema o" target database data"ile and archive log $bac0up
sets and pieces 6ecover# catalog is a must in "ollowing scenarios
. 9n order to store scripts
. Gor tablespace point in time recover#
-edia Management Sot$are
-edia -anagement so"tware is a must i" #ou are using 6-'< "or storing bac0up in tape drive
directl#.
5ac0ups in 6-'<
racle bac0ups in 6-'< are o" the "ollowing t#pe
6-'< complete bac0up 6 6-'< incremental bac0up
%hese bac0ups are o" 6-'< proprietar# nature
9-'D+ 24,
%he advantage o" uing 9mage cop# is its not in 6-'< proprietar# "ormat..
5ac0up Gormat
6-'< bac0up is not in oracle "ormat but in 6-'< "ormat. racle bac0up comprises o" bac0up
sets and it consists o" bac0up pieces. 5ac0up sets are logical entit# 9n oracle Fi it gets stored in a
de"ault location %here are two t#pe o" bac0up sets ;ata"ile bac0up sets$ 'rchivelog bac0up sets
ne more important point o" data "ile bac0up sets is it do not include empt# bloc0s. ' bac0up set
would contain man# bac0up pieces.
' single bac0up piece consists o" ph#sical "iles which are in 6-'< proprietar# "ormat.
+.ample o" ta0ing bac0up using 6-'<
%a0ing 6-'< 5ac0up
9n non archive mode in dos prompt t#pe
6-'<
,ou get the 6-'< prompt
6-'< K 2onnect %arget
87
2onnect to target database : -agic
using target database control"ile instead o" recover# catalog
(ets ta0e a simple bac0up o" database in non archive mode
shutdown immediate I - - )hutdowns the database
startup mount
bac0up database I- its start bac0ing the database
alter database openI
8e can "ire the same command in archive log mode
'nd whole o" data"iles will be bac0ed
5ac0up database plus archivelogI
6estoring database
6estoring database has been made ver# simple in Fi .
9t is &ust 6estore database..
6-'< has become intelligent to identi"# which data"iles has to be restored
and the location o" bac0uped up "ile.
racle +nhancement "or 6-'< in 70 D
Glash 6ecover# 'rea
6ight now the price o" hard dis0 is "alling. -an# dba are ta0ing oracle database bac0up inside
the hard dis0 itsel" since it results in lesser mean time between recoverabilit#.
%he new parameter introduced is
;5_6+2:+6,_G9(+_;+)% H /oracle/"lash_recover#_area
5# con"iguring the 6-'< 6+%+<%9< 4(92, the "lash recover# area will automaticall#
delete obsolete bac0ups and archive logs that are no longer required based on that con"iguration
racle has introduced ne$ eat"res in incremental bac0up
2hange %rac0ing Gile
racle 70g has the "acilit# to deliver "aster incrementals with the implementation o" changed
trac0ing "ile "eature.%his will results in "aster bac0ups lesser space consumption and also reduces
the time needed "or dail# bac0ups
9ncrementall# *pdated 5ac0ups
racle database 70g 9ncrementall# *pdates 5ac0up "eatures merges the image cop# o" a data"ile
with 6-'< incremental bac0up. %he resulting image cop# is now updated with bloc0 changes
captured b# incremental bac0ups.%he merging o" the image cop# and incremental bac0up is
initiated with 6-'< recover command. %his results in "aster recover#.
5inar# compression technique reduces bac0up space usage b# 50-75S.
8ith the new ;*6'%9< option "or the 6-'< 5'2B*4 command$ ;5's can weigh bac0up
per"ormance against system service level requirements. 5# speci"#ing a duration$ 6-'< will
automaticall# calculate the appropriate bac0up rateI in addition$ ;5's can optionall# speci"#
whether bac0ups should minimiAe time or s#stem load.
<ew Geatures in em to identi"# 6-'< related bac0up li0e bac0up pieces$ bac0up sets and
image cop#
racle Fi <ew "eatures 4ersistent 6-'< 2on"iguration
' new con"igure command has been introduced in racle Fi $ that lets #ou con"igure various
"eatures including automatic channels$ parallelism $bac0up options$ etc.
%hese automatic allocations and options can be overridden b# commands in a 6-'< command
"ile.
2ontrol"ile 'uto bac0ups
88
%hrough this new "eature 6-'< will automaticall# per"orm a control"ile auto bac0up. a"ter
ever# bac0up or cop# command.
5loc0 -edia 6ecover#
9" we can restore a "ew bloc0s rather than an entire "ile we onl# need "ew bloc0s.
8e even dont need to bring the data "ile o""line.
)#nta. "or it as "ollows
5loc0 6ecover data"ile 8 bloc0 22I
2on"igure 5ac0up ptimiAation
4rior to Fi whenever we bac0ed up database using 6-'< our bac0up also used ta0e bac0up o"
read onl# table spaces which had alread# been bac0ed up and also the same with archive log too.
<ow with Fi bac0up optimiAation parameter we can prevent repeat bac0up o" read onl#
tablespace and archive log. %he command "or this is as "ollows 2on"igure bac0up optimiAation
on
'rchive (og "ailover
9" 6-'< cannot read a bloc0 in an archived log "rom a destination. 6-'< automaticall#
attempts to read "rom an alternate location this is called as archive log "ailover
%here are additional commands li0e
bac0up database not bac0ed up since time L37-&an-2002 7J:00:00/
;o not bac0up previousl# bac0ed up "iles
1sa# a previous bac0up "ailed and #ou want to restart "rom where it le"t o""3.
)imilar s#nta. is supported "or restores
bac0up device sbt bac0up set all 2op# a dis0 bac0up to tape
1bac0ing up a bac0up
'dditionall# it supports
. 5ac0up o" server parameter "ile
. 4arallel operation supported
. +.tensive reporting available
. )cripting
. ;uple. bac0up sets
. 2orrupt bloc0 detection
. 5ac0up archive logs
4it"alls o" using 6-'<
4revious to version racle Fi bac0ups were not that eas# which means #ou had to allocate a
channel compulsoril# to ta0e bac0up ,ou had to give a run etc . %he s#nta. was a bit comple. `
6-'< has now become ver# simple and eas# to use..
9" #ou changed the location o" bac0up set it is compulsor# "or #ou to register it using 6-'< or
while #ou are tr#ing to restore bac0up 9t resulted in hanging situations
%here is no method to 0now whether during recover# database restore is going to "ail because o"
missing archive log "ile.
2ompulsor# -edia -anagement onl# i" using tape bac0up
9ncremental bac0ups though used to consume less space used to be slower since it used to read
the entire database to "ind the changed bloc0s and also %he# have di""icult time streaming the
tape device. .
2onsiderable improvement has been made in 70g to optimiAe the algorithm to handle changed
bloc0.
bservation
8F
9ntroduced in racle 8 it has become more power"ul and simpler with newer version o" racle F
and 70 g.
)o i" #ou reall# don/t want to miss something critical please start using 6-'<.
Explain 3.,O.,M,.3S,3.,O. 5((, ,.TE'SE!T ?
9<%+6)+2% returns all distinct rows selected b# both queries.-9<*) - returns all distinct rows
selected b# the "irst quer# but not b# the second.*<9< - returns all distinct rows selected b#
either quer#*<9< '(( - returns all rows selected b# either quer#$ including all duplicates.
Should the OEM !onsole be displayed at all times :when there are scheduled obs;? :for
+$5;
8hen a &ob is submitted the agent will con"irm the status o" the &ob. 8hen the status shows up as
scheduled$ #ou can close down the +- console. %he processing o" the &ob is managed b# the
9' 1racle 9ntelligent 'gent3. %he 9' maintains a .&ou "ile in the agent/s subdirector#. 8hen
the console is launched communication with the 'gent is established and the contents o" the .&ou
"ile 1binar#3 are reported to the console &ob subs#stem. <ote that +- will not be able to send e-
mail and paging noti"ications when the 2onsole is not started.
+ifference between S3$ST' and ,.ST' ?
9<)%6 1)tring7$)tring21n$1m33$9<)%6 returns the position o" the mth occurrence o" the string 2
instring7. %he search begins "rom nth position o" string7.)*5)%6 1)tring7 n$m3)*5)%6
returns a character string o" siAe m in string7$ starting "rom nth position o" string7.
What %ind of obs can one schedule with OEM? :for +$5;
+- comes with pre-de"ined &obs li0e +.port$ 9mport$ run ) commands$ run sql scripts$
)=(O4lus commands etc. 9t also gives #ou the "le.ibilit# o" scheduling custom &obs written with
the %2( language.
What are the pre re0uisites ?
9. to modi"# data type o" a column Y ii. to add a column with <% <*(( constraint Y %o
-odi"# the datat#pe o" a column the column must be empt#. to add a column with <% <*((
constrain$ the table must be empt#.
1ow does one bac%out e"ents and obs during maintenance slots? :for +$5;
-anagemnet and data collection activit# can be suspended b# imposing a blac0out. (oo0 at
these e.amples:
agentctl start blac0out M 5lac0out the entrire agent
agentctl stop blac0out M 6esume normal monitoring and management
agentctl start blac0out 62( M 5lac0out database 62(
agentctl stop blac0out 62( M 6esume normal monitoring and management
agentctl start blac0out -s &obs -d 00:20 M 5lac0out &obs "or 20 minutes
What are the types of SQL Statement ?
;ata ;e"inition (anguage :
26+'%+$'(%+6$;64$%6*<2'%+$6+:B+$< '*;9% U 2--9%.
;ata -anipulation (anguage:
9<)+6%$*4;'%+$;+(+%+$(2B
%'5(+$+P4('9< 4('< U )+(+2%.%ransactional 2ontrol:
2--9% U 6((5'2B)ession 2ontrol: '(%+6)+))9< U )+%
6(+)#stem 2ontrol :
'(%+6 SYSTEM.
What is the Oracle ,ntelligent 5gent? :for +$5;
%he racle 9ntelligent 'gent 19'3 is an autonomous process that needs to run on a remote node
F0
in the net$or! to ma0e the node +- manageable. %he racle 9ntelligent 'gent is responsible
"or:
. ;iscovering targets that can be managed 1%atabase Servers$ <et8 (isteners$ etc.3I
. -onitoring o" events registered in +nterprise -anagerI and
. +.ecuting tas0s associated with &obs submitted to +nterprise -anager.
1ow does one start the Oracle ,ntelligent 5gent? :for +$5;
ne needs to start an 9' 1racle 9ntelligent 'gent3 process on all machines that will to be
managed via +-.
Gor +- Fi and above:
agentctl start agent
agentctl stop agent
Gor +- 2.7 and below:
lsnrctl dbsnmp_start
lsnrctl dbsnmp_status
n /indo$s 0T$ start the ?racle'gent@ )ervice.
9" the agent doesn/t want to start$ ensure #our environment variables are set correctl# and delete
the "ollowing "iles be"ore tr#ing again:
73 9n E6'2(+_>-+/networ0/admin: snmp_ro.ora and snmp_rw.ora.
23 'lso delete '(( "iles in E6'2(+_>-+/networ0/agent/.
!an one write scripts to send alert messages to the console?
)tart the +- console and create a new event. )elect option ?+nable *nsolicited +vent@. )elect
test ?*nsolicited +vent@. 8hen entering the parameters$ enter values similar to these:
+vent <ame: /oracle/script/m#alert
b&ect: O
)everit#: O
-essage: O
ne can now write the script and invo0e the oemevent command to send alerts to the console.
(oo0 at this e.ample: oemevent /oracle/script/m#alert ;+)%9<'%9< alert ?-# custom error
message@ where ;+)%9<'%9< is the same value as entered in the ?-onitored ;estinations@
"ield when #ou/ve registered the event in the +- 2onsole.
Where can one get more information about T!(? :for +$5;
ne can write custom event chec0ing routines "or +- using the %2( 1%ool 2ommand
(anguage3 language. 2hec0 the "ollowing sites "or more in"ormation about %2(:
. %he %cl %eveloper Pchange - download and learn about %2(
. ra%2( at )ource"orge - ;ownload the ra%2( pac0age
. %om 4oinde.ter/s %cl 4age - ratcl was originall# written b# %om 4oinde.ter
5re there any troubleshooting tips for OEM? :for +$5;
. 2reate the +- repositor# with a user 1which will manage the +-3 and store it in a
tablespace that does not share an# data with other database users. 9t is a bad practice to create the
repositor# with ),) and )#stem.
. 9" #ou are unable to launch the console or there is a communication problem with the intelligent
agent 1daemon3. +nsure 2P "iles are registered. %#pe the "ollowing in the ;) prompt 1the
current director# should be E6'2(+_>-+Z59<:
2:ZrawinF5Z5inK 6eg)vr32 mmd.32.2P
2:ZrawinF5Z5inK 6eg)vr32 vo&t.2P
. 9" #ou have a problem starting the racle 'gent
F7
)olution ': 5ac0up the O.= "iles and ;elete all the O.= Giles 1Eracle_home/networ0/agent
"older3
5ac0up and delete S0M-_6.ora$ )<-4_68.ora$ dbsnmp.ver and services.ora "iles
1Eracle_>ome/networ0/admin "older3 )tart the racle 'gent service.
)olution 5: ,our version o" 9ntelligent 'gent could be bugg#. 2hec0 with racle "or an#
available patches. Gor e.ample$ the 9ntelligent 'gent that comes with racle 8.0.J is bugg#.
)ometimes #ou get a Gailed status "or the &ob that was e.ecuted success"ull#.
2hec0 the log to see the results o" the e.ecution rather than rel#ing on this status.
What is import?export and why does one need it? :for +$5;
%he racle e.port 1+P43 and import 19-43 utilities are used to per"orm logical database bac0up
and recover#. %he# are also used to move racle data "rom one machine$ database or schema to
another.
%he imp/e.p utilities use an racle proprietar# binar# ile ormat and can thus onl# be used
between racle databases. ne cannot e.port data and e.pect to import it into a non-Oracle
database. Gor more in"ormation on how to load and unload data "rom "iles$ read the
)=(O(oader G'=.
%he e.port/import utilities are also commonl# used to per"orm the "ollowing tas0s:
. 5ac0up and recover# 1small databases onl#3
. 6eorganiAation o" data/ +liminate database "ragmentation
. ;etect database corruption. +nsure that all the data can be read.
. %ransporting tablespaces between databases
. +tc.
What is a display item?
;ispla# items are similar to te.t items but store onl# "etched or assigned values. perators
cannot navigate to a displa# item or edit the value it contains.
1ow does one use the import?export utilities? :for +$5;
(oo0 "or the ?imp@ and ?e.p@ e.ecutables in #our E6'2(+_>-+/bin director#. ne can run
them interactivel#$ using command line parameters$ or using parameter "iles. (oo0 at the
imp/e.p parameters be"ore starting. %hese parameters can be listed b# e.ecuting the "ollowing
commands: ?e.p helpH#es@ or ?imp helpH#es@.
%he "ollowing e.amples demonstrate how the imp/e.p utilities can be used:
e.p scott/tiger "ileHemp.dmp logHemp.log tablesHemp rowsH#es inde.esHno
e.p scott/tiger "ileHemp.dmp tablesH1emp$dept3
imp scott/tiger "ileHemp.dmp "ullH#es
imp scott/tiger "ileHemp.dmp "romuserHscott touserHscott tablesHdept
e.p useridHscott/tiger_orcl par"ileHe.port.t.t
... where e.port.t.t contains:
5*GG+6H700000
G9(+Haccount.dmp
G*((Hn
8<+6Hscott
D6'<%)H#
2-46+))H#
<%+: 9" #ou do not li0e command line utilities$ #ou can import and e.port data with the
?)chema -anager@ D*9 that ships with racle +nterprise -anager 1+-3.
What are the types of "isual attribute settings?
F2
2ustom :isual attributes ;e"ault visual attributes <amed :isual attributes. 8indow
!an one export a subset of a table? :for +$5;
Grom racle8i one can use the =*+6,H e.port parameter to selectivel# unload a subset o" the
data "rom a table. (oo0 at this e.ample:
e.p scott/tiger tablesHemp quer#HZ@where deptnoH70Z@
What are the two ways to incorporate images into a oracle forms application?
5oilerplate 9mages
9mage_items
!an one monitor how fast a table is imported? :for +$5;
9" #ou need to monitor how "ast rows are imported "rom a running import &ob$ tr# one o" the
"ollowing methods:
-ethod 7:
select substr1sql_te.t$instr1sql_te.t$/9<% ?/3$303 table_name$
rows_processed$
round11s#sdate-to_date1"irst_load_time$/####-mm-dd hh2J:mi:ss/33O2JON0$73 minutes$
trunc1rows_processed/11s#sdate-to_date1"irst_load_time$/####-mm-dd hh2J:mi:ss/33O2JON033
rows_per_min
"rom s#s.v_Esqlarea
where sql_te.t li0e L9<)+6% S9<% ?S/
and command_t#pe H 2
and open_versions K 0I
Gor this to wor0 one needs to be on racle 7.3 or higher 17.2 might also be B3. 9" the import
has more than one table$ this statement will onl# show in"ormation about the current table being
imported.
2ontributed b# svaldo 'ncarola$ 5s. 's. 'rgentina.
-ethod 2:
*se the G++;5'2BHn import parameter. %his command will tell 9-4 to displa# a dot "or ever#
< rows imported.
!an one import tables to a different tablespace? :for +$5;
racle o""ers no parameter to speci"# a di""erent tablespace to import data into. b&ects will be
re-created in the tablespace the# were originall# e.ported "rom. ne can alter this behaviour b#
"ollowing one o" these procedures: 4re-create the table1s3 in the correct tablespace:
. 9mport the dump "ile using the 9<;+PG9(+H option
. +dit the inde."ile. 6emove remar0s and speci"# the correct tablespaces.
. 6un this inde."ile against #our database$ this will create the required tables in the appropriate
tablespaces
. 9mport the table1s3 with the 9D<6+H, option.
2hange the de"ault tablespace "or the user:
. 6evo0e the ?*<(9-9%+; %'5(+)4'2+@ privilege "rom the user
. 6evo0e the user/s quota "rom the tablespace "rom where the ob&ect was e.ported. %his "orces
the import utilit# to create tables in the user/s de"ault tablespace.
. -a0e the tablespace to which #ou want to import the de"ault tablespace "or the user
. 9mport the table
What do you mean by a bloc% in formsK<B?
5loc0 is a single mechanism "or grouping related items into a "unctional unit "or storing$
displa#ing and manipulating records.
F3
1ow is possible to restrict the user to a list of "alues while entering "alues for parameters?
5# setting the 6estrict %o (ist propert# to true in the parameter propert# sheet.
What is S4(@(oader and what is it used for? :for +$5;
)=(O(oader is a bul0 loader utilit# used "or moving data "rom e.ternal "iles into the racle
database. 9ts s#nta. is similar to that o" the ;52 (oad utilit#$ but comes with more options.
)=(O(oader supports various load "ormats$ selective loading$ and multi-table loads.
1ow does one use the S4(@(oader utility? :for +$5;
ne can load data into an racle database b# using the sqlldr 1sqlload on some plat"orms3 utilit#.
9nvo0e the utilit# without arguments to get a list o" available parameters. (oo0 at the "ollowing
e.ample:
sqlldr scott/tiger controlHloader.ctl
%his sample control "ile 1loader.ctl3 will load an e.ternal data "ile containing delimited data:
load data
in"ile Lc:ZdataZm#data.csv/
into table emp
"ields terminated b# ?$@ optionall# enclosed b# L@/
1 empno$ empname$ sal$ deptno 3
%he m#data.csv "ile ma# loo0 li0e this:
70007$@)cott %iger@$ 7000$ J0
70002$@Gran0 <aude@$ 500$ 20
'nother )ample control "ile with in-line data "ormatted as "i. length records. %he tric0 is to
speci"# ?O@ as the name o" the data "ile$ and use 5+D9<;'%' to start the data section in the
control "ile.
load data
in"ile O
replace
into table departments
1 dept position 102:053 char1J3$
deptname position 108:273 char1203
3
begindata
2)2 2-4*%+6 )29+<2+
+<D( +<D(9)> (9%+6'%*6+
-'%> -'%>+-'%92)
4(, 4(9%92'( )29+<2+
1ow can a cross product be created?
5# selecting the cross products tool and drawing a new group surrounding the base group o" the
cross products.
,s there a S4(@3nloader to download data to a flat file? :for +$5;
racle does not suppl# an# data unload utilities. >owever$ #ou can use )=(O4lus to select and
"ormat #our data and then spool it to a "ile:
set echo o"" newpage 0 space 0 pagesiAe 0 "eed o"" head o"" trimspool on
spool oradata.t.t
select col7 RR L$/ RR col2 RR L$/ RR col3
"rom tab7
where col2 H LP,C/I
FJ
spool o""
'lternativel# use the *%(_G9(+ 4(/)=( pac0age:
rem 6emember to update init)9;.ora$ utl_"ile_dirH/c:Zoradata/ parameter
declare
"p utl_"ile."ile_t#peI
begin
"p :H utl_"ile."open1Lc:Zoradata/$/tab7.t.t/$/w/3I
utl_"ile.put"1"p$ LSs$ SsZn/$ L%e.tGield/$ 553I
utl_"ile."close1"p3I
endI
/
,ou might also want to investigate third part# tools li0e )=(8a#s "rom 9spirer )#stems$ %';
"rom =uest$ or -anage9% Gast *nloader "rom 2' to help #ou unload data "rom racle.
!an one load "ariable and fix length data records? :for +$5;
,es$ loo0 at the "ollowing control "ile e.amples. 9n the "irst we will load delimited data 1variable
length3:
('; ;'%'
9<G9(+ O
9<% %'5(+ load_delimited_data
G9+(;) %+6-9<'%+; 5, ?$@ 4%9<'((, +<2()+; 5, L@/
%6'9(9<D <*((2()
1 data7$
data2
3
5+D9<;'%'
77777$''''''''''
22222$@'$5$2$;$@
9" #ou need to load positional data 1"i.ed length3$ loo0 at the "ollowing control "ile e.ample:
('; ;'%'
9<G9(+ O
9<% %'5(+ load_positional_data
1 data7 4)9%9<17:53$
data2 4)9%9<1N:753
3
5+D9<;'%'
77777''''''''''
222225555555555
2an one s0ip header records load while loadingY
*se the ?)B94 n@ 0e#word$ where n H number o" logical rows to s0ip. (oo0 at this e.ample:
('; ;'%'
9<G9(+ O
9<% %'5(+ load_positional_data
)B94 5
1 data7 4)9%9<17:53$
data2 4)9%9<1N:753
3
F5
5+D9<;'%'
77777''''''''''
222225555555555
!an one modify data as it loads into the database? :for +$5;
;ata can be modi"ied as it loads into the racle ;atabase. <ote that this onl# applies "or the
conventional load path and not "or direct path loads.
('; ;'%'
9<G9(+ O
9<% %'5(+ modi"ied_data
1 rec_no ?m#_db_sequence.ne.tval@$
region 2<)%'<% L37/$
time_loaded ?to_char1),);'%+$ L>>2J:-9/3@$
data7 4)9%9<17:53 ?:data7/700@$
data2 4)9%9<1N:753 ?upper1:data23@$
data3 4)9%9<17N:223@to_date1:data3$ L,,--;;/3@
3
5+D9<;'%'
77777''''''''''FF7207
222225555555555FF0772
('; ;'%'
9<G9(+ Lmail_orders.t.t/
5';G9(+ Lbad_orders.t.t/
'44+<;
9<% %'5(+ mailing_list
G9+(;) %+6-9<'%+; 5, ?$@
1 addr$
cit#$
state$
Aipcode$
mailing_addr ?decode1:mailing_addr$ null$ :addr$ :mailing_addr3@$
mailing_cit# ?decode1:mailing_cit#$ null$ :cit#$ :mailing_cit#3@$
mailing_state
3
!an one load data into multiple tables at once? :for +$5;
(oo0 at the "ollowing control "ile:
('; ;'%'
9<G9(+ O
6+4('2+
9<% %'5(+ emp
8>+< empno VH L L
1 empno 4)9%9<17:J3 9<%+D+6 +P%+6<'($
ename 4)9%9<1N:753 2>'6$
deptno 4)9%9<177:783 2>'6$
mgr 4)9%9<120:233 9<%+D+6 +P%+6<'(
3
9<% %'5(+ pro&
FN
8>+< pro&no VH L L
1 pro&no 4)9%9<125:273 9<%+D+6 +P%+6<'($
empno 4)9%9<17:J3 9<%+D+6 +P%+6<'(
3
What is the difference between boiler plat images and image items?
5oiler plate 9mages are static images 1+ither vector or bit map3 that #ou import "rom the "ile
s#stem or database to use a graphical elements in #our "orm$ such as compan# logos and maps.
9mage items are special t#pes o" inter"ace controls that store and displa# either vector or bitmap
images. (i0e other items that store values$ image items can be either base table items1items that
relate directl# to database columns3 or control items. %he de"inition o" an image item is stored as
part o" the "orm module G-5 and G-P "iles$ but no image "ile is actuall# associated with an
image item until the item is populate at run time.
What are the triggers a"ailable in the reports?
5e"ore report$ 5e"ore "orm$ '"ter "orm $ 5etween page$ '"ter report.
Why is a Where clause faster than a group filter or a format trigger?
5ecause$ in a where clause the condition is applied during data retrievalthan a"ter retrieving the
data.
!an one selecti"ely load only the records that one need? :for +$5;
(oo0 at this e.ample$ 1073 is the "irst character$ 130:373 are characters 30 to 37:
('; ;'%'
9<G9(+ Lm#data.dat/ 5';G9(+ Lm#data.bad/ ;9)2'6;G9(+ Lm#data.dis/
'44+<;
9<% %'5(+ m#_selective_table
8>+< 1073 [K L>/ and 1073 [K L%/ and 130:373 H L7FFF7277/
1
region 2<)%'<% L37/$
service_0e# 4)9%9<107:773 9<%+D+6 +P%+6<'($
call_b_no 4)9%9<172:2F3 2>'6
3
!an one s%ip certain columns while loading data? :for +$5;
ne cannot use 4)%9<1.:#3 with delimited data. (uc0il#$ "rom Oracle 1i one can speci"#
G9((+6 columns. G9((+6 columns are used to s0ip columns/"ields in the load "ile$ ignoring
"ields that one does not want. (oo0 at this e.ample: -- ne cannot use 4)%9<1.:#3 as it is
stream data$ there are no positional "ields-the ne.t "ield begins a"ter some delimiter$ not in
column P. --K
('; ;'%'
%6*<2'%+ 9<% %'5(+ %7
G9+(;) %+6-9<'%+; 5, L$/
1 "ield7$
"ield2 G9((+6$
"ield3
3
1ow does one load multi&line records? :for +$5;
ne can create one logical record "rom multiple ph#sical records using one o" the "ollowing two
clauses:
. 2<2'%+<'%+: - use when SQLO(oader should combine the same number o" ph#sical
F7
records together to "orm one logical record.
. 2<%9<*+9G - use i" a condition indicates that multiple records should be treated as one. +g.
b# having a LM/ character in column 7.
1ow can get S4(@(oader to !OMM,T only at the end of the load file? :for +$5;
ne cannot$ but b# setting the 68)H parameter to a large value$ committing can be reduced.
-a0e sure #ou have big rollbac0 segments read# when #ou use a high value "or 68)H.
!an one impro"e the performance of S4(@(oader? :for +$5;
' ver# simple but easil# overloo0ed hint is not to have an# inde.es and/or constraints 1primar#
0e#3 on #our load tables during the load process. %his will signi"icantl# slow down load times
even with 68)H set to a high value.
'dd the "ollowing option in the command line: ;96+2%H%6*+. %his will e""ectivel# b#pass
most o" the 6;5-) processing. >owever$ there are cases when #ou can/t use direct load. 6e"er
to chapter 8 on racle server *tilities manual.
%urn o"" database logging b# speci"#ing the *<6+2:+6'5(+ option. %his option can onl#
be used with direct data loads. 6un multiple load &obs concurrentl#.
1ow does one use S4(@(oader to load images, sound clips and documents? :for +$5;
)=(O(oader can load data "rom a ?primar# data ile@$ );G 1)econdar# ;ata "ile - "or loading
nested tables and :'66',s3 or (DG9(+. %he (5G9(+ method provides and eas# wa# to
load documents$ images and a"dio clips into 5(5 and 2(5 columns. (oo0 at this e.ample:
Diven the "ollowing table:
26+'%+ %'5(+ image_table 1
image_id <*-5+6153$
"ile_name :'62>'621303$
image_data 5(53I
2ontrol Gile:
('; ;'%'
9<G9(+ O
9<% %'5(+ image_table
6+4('2+
G9+(;) %+6-9<'%+; 5, L$/
1
image_id 9<%+D+6153$
"ile_name 2>'61303$
image_data (5G9(+ 1"ile_name3 %+6-9<'%+; 5, +G
3
5+D9<;'%'
007$image7.gi"
002$image2.&pg
What is the difference between the con"entional and direct path loader? :for +$5;
%he conventional path loader essentiall# loads the data b# using standard 9<)+6% statements.
%he direct path loader 1;96+2%H%6*+3 b#passes much o" the logic involved with that$ and
loads directl# into the racle data "iles. -ore in"ormation about the restrictions o" direct path
loading can be obtained "rom the *tilities *sers Duide.
GENERAL INTERVIEW QUESTIONS
What are the "arious types of Exceptions ?
*ser de"ined and 4rede"ined +.ceptions.
F8
!an we define exceptions twice in same bloc% ?
<o.
What is the difference between a procedure and a function ?
Gunctions return a single variable b# value whereas procedures do not return an# variable b#
value. 6ather the# return multiple variables b# passing variables b# re"erence through their *%
parameter.
!an you ha"e two functions with the same name in a #(?S4( bloc% ?
,es.
!an you ha"e two stored functions with the same name ?
,es.
!an you call a stored function in the constraint of a table ?
<o.
What are the "arious types of parameter modes in a procedure ?
9<$ *% '<; 9<*%.
What is O"er (oading and what are its restrictions ?
ver(oading means an ob&ect per"orming di""erent "unctions depending upon the no. o"
parameters or the data type o" the parameters passed to it.
!an functions be o"erloaded ?
,es.
!an A functions ha"e same name E input parameters but differ only by return datatype ?
<o.
What are the constructs of a procedure, function or a pac%age ?
%he constructs o" a procedure$ "unction or a pac0age are :
variables and constants
c"rsors
e.ceptions
Why !reate or 'eplace and not +rop and recreate procedures ?
)o that Drants are not dropped.
!an you pass parameters in pac%ages ? 1ow ?
,es. ,ou can pass parameters to procedures or "unctions in a pac0age.
What are the parts of a database trigger ?
%he parts o" a trigger are:
' triggering event or statement
' trigger restriction
' trigger action
What are the "arious types of database triggers ?
%here are 72 t#pes o" triggers$ the# are combination o" :
9nsert$ ;elete and *pdate %riggers.
5e"ore and '"ter %riggers.
6ow and )tatement %riggers.
13O2O2H723
What is the ad"antage of a stored procedure o"er a database trigger ?
8e have control over the "iring o" a stored procedure but we have no control over the "iring o" a
trigger.
What is the maximum no< of statements that can be specified in a trigger statement ?
ne.
FF
!an "iews be specified in a trigger statement ?
<o
What are the "alues of Mnew and Mold in ,nsert?+elete?3pdate Triggers ?
9<)+6% : new H new value$ old H <*((
;+(+%+ : new H <*(($ old H old value
*4;'%+ : new H new value$ old H old value
What are cascading triggers? What is the maximum no of cascading triggers at a time?
8hen a statement in a trigger bod# causes another trigger to be "ired$ the triggers are said to be
cascading. -a. H 32.
What are mutating triggers ?
' trigger giving a )+(+2% on the table on which the trigger is written.
What are constraining triggers ?
' trigger giving an 9nsert/*pdat e on a table having re"erential integrit# constraint on the
triggering table.
+escribe Oracle database&s physical and logical structure ?
4h#sical : ;ata "iles$ 6edo (og "iles$ 2ontrol "ile.
(ogical : %ables$ :iews$ %ablespaces$ etc.
!an you increase the si2e of a tablespace ? 1ow ?
,es$ b# adding data"iles to it.
What is the use of !ontrol files ?
2ontains pointers to locations o" various data iles$ redo log "iles$ etc.
What is the use of +ata +ictionary ?
*sed b# racle to store in"ormation about various ph#sical and logical racle structures e.g.
%ables$ %ablespaces$ data"iles$ etc
What are the ad"antages of clusters ?
'ccess time reduced "or &oins.
What are the disad"antages of clusters ?
%he time "or 9nsert increases.
!an (ong?(ong '5W be clustered ?
<o.
!an null %eys be entered in cluster index, normal index ?
,es.
!an !hec% constraint be used for self referential integrity ? 1ow ?
,es. 9n the 2>+2B condition "or a column o" a table$ we can re"erence some other column o"
the same table and thus en"orce sel" re"erential integrit#.
What are the min< extents allocated to a rollbac% extent ?
%wo
What are the states of a rollbac% segment ? What is the difference between partly a"ailable
and needs reco"ery ?
%he various states o" a rollbac0 segment are :
<(9<+$ GG(9<+$ 4'6%(, ':'9('5(+$ <++;) 6+2:+6, and 9<:'(9;.
What is the difference between uni0ue %ey and primary %ey ?
*nique 0e# can be nullI 4rimar# 0e# cannot be null.
5n insert statement followed by a create table statement followed by rollbac% ? Will the
rows be inserted ?
<o.
700
!an you define multiple sa"epoints ?
,es.
!an you 'ollbac% to any sa"epoint ?
,es.
What is the maximum no< of columns a table can ha"e ?
25J.
What is the significance of the E and EE operators in #( S4( ?
%he U operator means that the 4( )=( bloc0 requires user input "or a variable. %he UU operator
means that the value o" this variable should be the same as inputted b# the user previousl# "or
this same variable. 9" a transaction is ver# large$ and the rollbac0 segment is not able to hold the
rollbac0 in"ormation$ then will the transaction span across di""erent rollbac0 segments or will it
terminate Y 9t will terminate 14lease chec0 3.
!an you pass a parameter to a cursor ?
+.plicit cursors can ta0e parameters$ as the e.ample below shows. ' cursor parameter can
appear in a quer# wherever a constant can appear. 2*6)6 c7 1median 9< <*-5+63 9)
)+(+2% &ob$ ename G6- emp 8>+6+ sal K medianI
What are the "arious types of 'oll$ac% Segments ?
4ublic 'vailable to all instances
4rivate 'vailable to speci"ic instance
!an you use J'ow!ount as a parameter to a cursor ?
,es
,s the 0uery below allowed M
)elect sal$ ename 9nto . Grom emp 8here ename H LB9<D/
18here . is a record o" <umber1J3 and 2har17533
,es
,s the assignment gi"en below allowed M
'52 H 4=6 18here '52 and 4=6 are records3
,es
,s this for loop allowed M
Gor . in U)tart..U+nd (oop
,es
1ow many rows will the following SQL return M
)elect O "rom emp 8here rownum [K>ow man# rows will the "ollowing )=( return :
)elect O "rom emp 8here rownum H 70I
<o rows
Which symbol preceeds the path to the table in the remote database ?
_
5re "iews automatically updated when base tables are updated ?
,es
!an a trigger written for a "iew ?
<o
,f all the "alues from a cursor ha"e been fetched and another fetch is issued, the output will
be M error, last record or first record ?
(ast 6ecord
5 table has the following data M NNC, .ull, FBOO< What will the a"erage function return ?
7.5
707
,s Sysdate a system "ariable or a system function?
)#stem Gunction
!onsider a se0uence whose curr"al is F and gets incremented by F by using the next"al
reference we get the next number A< Suppose at this point we issue an rollbac% and again
issue a next"al< What will the output be ?
3
+efinition of relational +ata$ase by +r< !odd :,$M;?
' 6elational ;atabase is a database where all data visible to the user is organiAed strictl# as
tables o" data values and where all database operations wor0 on these tables.
What is Multi Threaded Server :MT5; ?
9n a )ingle %hreaded 'rchitecture 1or a dedicated server con"iguration3 the database manager
creates a separate process "or each database user. 5ut in -%' the database manager can assign
multiple users 1multiple user processes3 to a single dispatcher 1server process3$ a controlling
process that queues request "or wor0 thus reducing the databases memor# requirement and
resources.
Which are initial '+$MS, 1ierarchical E .?w database ?
6;5-) - 6 s#stem
>ierarchical - 9-)
</8 - ;5%D
What is )unctional +ependency
Diven a relation 6$ attribute , o" 6 is "unctionall# dependent on attribute P o" 6 i" and onl# i"
each P-value has associated with it precisel# one -, value in 6
What is !uditing ?
%he database has the abilit# to audit all actions that ta0e place within it.
a3 (ogin attempts$ b3 b&ect 'ccesss$ c3 ;atabase 'ction 6esult o" Dreatest17$<*((3 or
(east17$<*((3 <*((
While designing in client?server what are the A imp< things to be considered ?
<etwor0 verhead 1tra""ic3$ )peed and (oad o" client server
When to create indexes ?
%o be created when table is queried "or less than 2S or JS to 25S o" the table rows.
1ow can you a"oid indexes ?
% ma0e inde. access path unavailable - *se G*(( hint to optimiAer "or "ull table scan - *se
9<;+P or '<;-+=*'( hint to optimiAer to use one inde. or set to inde.es instead o" another.
- *se an e.pression in the 8here 2lause o" the SQL.
What is the result of the following S4( M
Select F from dual
3.,O.
Select P5= from dualQ
+rror
!an database trigger written on synonym of a table and if it can be then what would be
the effect if original table is accessed<
,es$ database trigger would "ire.
!an you alter synonym of "iew or "iew ?
<o
!an you create index on "iew ?
<o
702
What is the difference between a "iew and a synonym ?
)#non#m is &ust a second name o" table used "or multiple lin0 o" database. :iew can be created
with man# tables$ and with virtual columns and with conditions. 5ut s#non#m can be on view.
What is the difference between alias and synonym ?
'lias is temporar# and used with one quer#. )#non#m is permanent and not used as alias.
What is the effect of synonym and table name used in same Select statement ?
:alid
What=s the length of S4( integer ?
45 bit length
What is the difference between foreign %ey and reference %ey ?
Goreign 0e# is the 0e# i.e. attribute which re"ers to another table primar# 0e#. 6e"erence 0e# is
the primar# 0e# o" table re"erred b# another table.
!an dual table be deleted, dropped or altered or updated or inserted ?
,es
,f content of dual is updated to some "alue computation ta%es place or not ?
,es
,f any other table same as dual is created would it act similar to dual?
,es
)or which relational operators in where clause, index is not used ?
[K $ li0e LS .../ is <% "unctions$ "ield Tconstant$ "ield RR ?
5ssume that there are multiple databases running on one machine< 1ow can you switch
from one to another ?
2hanging the 6'2(+_)9;
What are the ad"antages of Oracle ?
4ortabilit# : racle is ported to more plat"orms than an# o" its competitors$ running on more than
700 hardware plat"orms and 20 net$or!ing protocols.
-ar0et 4resence : racle is b# "ar the largest 6;5-) vendor and spends more on 6 U ; than
most o" its competitors earn in total revenue. %his mar0et clout means that #ou are unli0el# to be
le"t in the lurch b# racle and there are alwa#s lots o" third part# inter"aces available.
5ac0up and 6ecover# : racle provides industrial strength support "or on-line bac0up and
recover# and good sot$are "ault tolerence to dis0 "ailure. ,ou can also do point-in-time
recover#.
4er"ormance : )peed o" a Ltuned/ Oracle %atabase and application is quite good$ even with
large databases. racle can manage K 700D5 databases.
-ultiple database support : racle has a superior abilit# to manage multiple databases within the
same transaction using a two-phase commit protocol.
What is a forward declaration ? What is its use ?
4(/)=( requires that #ou declare an identi"ier be"ore using it. %here"ore$ #ou must declare a
subprogram be"ore calling it. %his declaration at the start o" a subprogram is called "orward
declaration. ' "orward declaration consists o" a subprogram speci"ication terminated b# a
semicolon.
What are actual and formal parameters ?
'ctual 4arameters : )ubprograms pass in"ormation using parameters. %he variables or
e.pressions re"erenced in the parameter list o" a subprogram call are actual parameters. Gor
e.ample$ the "ollowing procedure call lists two actual parameters named emp_num and amount:
+g. raise_salar#1emp_num$ amount3I
703
Gormal 4arameters : %he variables declared in a subprogram speci"ication and re"erenced in the
subprogram bod# are "ormal parameters. Gor e.ample$ the "ollowing procedure declares two
"ormal parameters named emp_id and increase: +g. 462+;*6+ raise_salar# 1emp_id
9<%+D+6$ increase 6+'(3 9) current_salar# 6+'(I
What are the types of .otation ?
4osition$ <amed$ -i.ed and 6estrictions.
What all important parameters of the init<ora are supposed to be increased if you want to
increase the S-5 si2e ?
9n our case$ db_bloc0_bu""ers was changed "rom N0 to 7000 1std values are N0$ 550 U 35003
shared_pool_siAe was changed "rom 3.5-5 to F-5 1std values are 3.5$ 5 U F-53 open_c"rsors
was changed "rom 200 to 300 1std values are 200 U 3003 db_bloc0_siAe was changed "rom 20J8
12B3 to J0FN 1JB3 Wat the time o" database creationX.
%he initial )D' was around J-5 when the server 6'- was 32-5 and %he new )D' was
around 73-5 when the server 6'- was increased to 728-5.
,f , ha"e an execute pri"ilege on a procedure in another users schema, can , execute his
procedure e"en though , do not ha"e pri"ileges on the tables within the procedure ?
,es
What are "arious types of oins ?
+qui&oins$ <on-equi&oins$ sel" &oin$ outer &oin
What is a pac%age cursor ?
' pac0age cursor is a cursor which #ou declare in the pac0age speci"ication without an SQL
statement. %he )=( statement "or the cursor is attached d#namicall# at runtime "rom calling
procedures.
,f you insert a row in a table, then create another table and then say 'ollbac%< ,n this case
will the row be inserted ?
,es. 5ecause 2reate table is a ;;( which commits automaticall# as soon as it is e.ecuted. %he
;;( commits the transaction even i" the create statement "ails internall# 1eg table alread# e.ists
error3 and not s#ntacticall#.
What are the "arious types of 0ueries ??
<ormal =ueries
)ub =ueries
2o-related queries
<ested queries
2ompound queries
What is a transaction ?
' transaction is a set o" )=( statements between an# two 2--9% and 6((5'2B
statements.
What is implicit cursor and how is it used by Oracle ?
'n implicit cursor is a cursor which is internall# created b# racle. 9t is created b# racle "or
each individual )=(.
Which of the following is not a schema obect M ,ndexes, tables, public synonyms, triggers
and pac%ages ?
4ublic s#non#ms
What is #(?S4(?
4(/)=( is racle/s 4rocedural (anguage e.tension to )=(. %he language includes ob&ect
oriented programming techniques such as encapsulation$ "unction overloading$ in"ormation
70J
hiding 1all but inheritance3$ and so$ brings state-o"-the-art programming to the racle database
server and a variet# o" racle tools.
,s there a #(?S4( Engine in S4(@#lus?
<o. *nli0e racle Gorms$ )=(O4lus does not have a 4(/)=( engine. %hus$ all #our 4(/)=( are
send directl# to the database engine "or e.ecution. %his ma0es it much more e""icient as )=(
statements are not stripped o"" and send to the database individuall#.
,s there a limit on the si2e of a #(?S4( bloc%?
2urrentl#$ the ma.imum parsed/compiled siAe o" a 4(/)=( bloc0 is NJB and the ma.imum code
siAe is 700B. ,ou can run the "ollowing select statement to quer# the siAe o" an e.isting pac0age
or procedure.
)=(K select O "rom dba_ob&ect_siAe where name H Lprocedure_name/
!an one read?write files from #(?S4(?
9ncluded in racle 7.3 is a *%(_G9(+ pac0age that can read and write "iles. %he director# #ou
intend writing to has to be in #our 9<9%.6' "ile 1see *%(_G9(+_;96H... parameter3. 5e"ore
racle 7.3 the onl# means o" writing a "ile was to use ;5-)_*%4*% with the )=(O4lus
)4( command.
;+2('6+
"ile>andler *%(_G9(+.G9(+_%,4+I
5+D9<
"ile>andler :H *%(_G9(+.G4+<1L/home/oracle/tmp/$ Lm#output/$/8/3I
*%(_G9(+.4*%G1"ile>andler$ L:alue o" "unc7 is Ssn/$ "unc71733I
*%(_G9(+.G2()+1"ile>andler3I
+<;I
1ow can , protect my #(?S4( source code?
4(/)=( :2.2$ available with racle7.2$ implements a binar# wrapper "or 4(/)=( programs to
protect the source code. %his is done via a standalone utilit# that trans"orms the 4(/)=( source
code into portable binar# ob&ect code 1somewhat larger than the original3. %his wa# #ou can
distribute so"tware without having to worr# about e.posing #our proprietar# algorithms and
methods. )=(O4lus and )=(O;5' will still understand and 0now how to e.ecute such scripts.
Qust be care"ul$ there is no ?decode@ command available.
%he s#nta. is:
wrap inameHm#script.sql onameH.....###
!an one use dynamic S4( within #(?S4(? O' !an you use a ++( in a procedure ?
1ow ?
Grom 4(/)=( :2.7 one can use the ;5-)_)=( pac0age to e.ecute d#namic )=( statements.
+g: 26+'%+ 6 6+4('2+ 462+;*6+ ;,<)=(
')
cur integerI
rc integerI
5+D9<
cur :H ;5-)_)=(.4+<_2*6)6I
;5-)_)=(.4'6)+1cur$/26+'%+ %'5(+ P 1, ;'%+3/$ ;5-)_)=(.<'%9:+3I
rc :H ;5-)_)=(.+P+2*%+1cur3I
;5-)_)=(.2()+_2*6)61cur3I
+<;I
705

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