Documente Academic
Documente Profesional
Documente Cultură
3. What is a tablespace?
A database is divided into Logical Storage Unit called tablespaces. A
tablespace is used to grouped related logical structures together.
6. What is schema?
A schema is collection of database objects of a user.
Page 1 of 153
A view is a virtual table. Every view has a query attached to it. (The
query is a SELECT statement that identifies the columns and rows of
the table(s) the view uses.)
11. What is Partial Backup ?
A Partial Backup is any operating system backup short of a full backup,
taken while the database is open or shut down.
Page 2 of 153
Each Index has an Index segment that stores all of its data.
Page 3 of 153
33. What is an Oracle sequence?
A sequence generates a serial list of unique numbers for numerical
columns of a database's tables.
Page 4 of 153
space in ORACLE datablocks. Block size is specified in INIT.ORA file and
can’t be changed latter.
Page 5 of 153
ALTER SYSTEM SET DB_CREATE_ONLINE_LOG_DEST_2='/u03/oradata/';
CREATE DATABASE;
Page 6 of 153
performance issue anymore, unless they run into thousands and
thousands where additional I/O may be required to fetch the additional
blocks where extent maps of the segment are stored.
56. Where can one find the high water mark for a table? (for
DBA)
There is no single system table, which contains the high water mark
(HWM) for a table. A table's HWM can be calculated using the results
from the following SQL statements:
SELECT BLOCKS
FROM DBA_SEGMENTS
WHERE OWNER=UPPER(owner) AND SEGMENT_NAME = UPPER(table);
ANALYZE TABLE owner.table ESTIMATE STATISTICS;
SELECT EMPTY_BLOCKS
FROM DBA_TABLES
WHERE OWNER=UPPER(owner) AND SEGMENT_NAME = UPPER(table);
Thus, the tables' HWM = (query result 1) - (query result 2) - 1
NOTE: You can also use the DBMS_SPACE package and calculate the
HWM = TOTAL_BLOCKS - UNUSED_BLOCKS - 1.
Page 7 of 153
60. Can one rename a database user (schema)? (for DBA)
No, this is listed as Enhancement Request 158508. Workaround:
Do a user-level export of user A
create new user B
Import system/manager fromuser=A touser=B
Drop user A
61. Define Transaction ?
A Transaction is a logical unit of work that comprises one or more SQL
statements executed by a single user.
Page 8 of 153
User objects (table,indexes,views etc.,)
The server that access the database consists of
SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers,
Shared SQL pool)
SMON (System MONito)
PMON (Process MONitor)
LGWR (LoG Write)
DBWR (Data Base Write)
ARCH (ARCHiver)
CKPT (Check Point)
RECO
Dispatcher
User Process with associated PGS
68. What is clusters ?
Group of tables physically stored together because they share common
columns and are often used together is called Cluster.
Page 9 of 153
The number of concurrent sessions the user can establish the CPU
processing time available to the user's session the CPU processing
time available to a single call to ORACLE made by a SQL statement the
amount of logical I/O available to the user's session the amout of
logical I/O available to a single call to ORACLE made by a SQL
statement the allowed amount of idle time for the user's session the
allowed amount of connect time for the user's session.
Page 10 of 153
security domains of all users granted the group's role automatically
reflect the changes made to the role.
SELECTIVE AVAILABILITY OF PRIVILEGES - The roles granted to a user
can be selectively enable (available for use) or disabled (not available
for use). This allows specific control of a user's privileges in any given
situation.
APPLICATION AWARENESS - A database application can be designed to
automatically enable and disable selective roles when a user attempts
to use the application.
Page 11 of 153
from SYS.V_$INSTANCE JUL,
SYS.V_$INSTANCE SEC
where JUL.KEY like '%JULIAN%'
and SEC.KEY like '%SECOND%';
select to_char (to_date (JUL.VALUE, 'J') + (SEC.VALUE/86400), -Return a
DATE
'DD-MON-YY HH24:MI:SS') STARTED
from V$INSTANCE JUL,
V$INSTANCE SEC
where JUL.KEY like '%JULIAN%'
and SEC.KEY like '%SECOND%';
90. How can one see who is using a temporary segment? (for
DBA
For every user using temporary space, there is an entry in
SYS.V$_LOCK with type 'TS'.
All temporary segments are named 'ffff.bbbb' where 'ffff' is the file it is
in and 'bbbb' is first block of the segment. If your temporary
tablespace is set to TEMPORARY, all sorts are done in one large
temporary segment. For usage stats, see SYS.V_$SORT_SEGMENT
From Oracle 8.0, one can just query SYS.v$sort_usage. Look at these
Page 12 of 153
examples:
select s.username, u."USER", u.tablespace, u.contents, u.extents,
u.blocks
from sys.v_$session s, sys.v_$sort_usage u
where s.addr = u.session_addr
/
select s.osuser, s.process, s.username, s.serial#,
Sum (u.blocks)*vp.value/1024 sort_size
from sys.v_$session s, sys.v_$sort_usage u, sys.v_$parameter VP
where s.saddr = u.session_addr
and vp.name = 'db_block_size'
and s.osuser like '&1'
group by s.osuser, s.process, s.username, s.serial#, vp.value
/
91. How does one get the view definition of fixed views/tables?
Query v$fixed_view_definition. Example: SELECT * FROM
v$fixed_view_definition WHERE view_name='V$SESSION';
Page 13 of 153
Updating or Inserting records in remote database through database
triggers. It may fail if remote database is having any problem.
Page 14 of 153
It is a table that maintains a record of modifications to the master table
in a snapshot. It is stored in the same database as master table and is
only available for simple snapshots. It should be created before
creating snapshots.
113. Can you have more than one content canvas view
attached with a window?
Page 15 of 153
Yes. Each window you create must have atleast one content canvas
view assigned to it. You can also create a window that has manipulated
content canvas view. At run time only one of the content canvas views
assign to a window is displayed at a time.
115. Does a Before form trigger fire when the parameter form
is suppressed?
Yes.
116. What is SGA?
The System Global Area in an Oracle database is the area in memory
to facilitate the transfer of information between users. It holds the
most recently requested structural information between users. It holds
the most recently requested structural information about the database.
The structure is database buffers, dictionary cache, redo log buffer and
shared pool area.
Page 16 of 153
124. What is user Account in Oracle database?
A user account is not a physical structure in database but it is having
important relationship to the objects in the database and will be having
certain privileges.
129. What are the sql clauses supported in the link property
sheet?
Where start with having.
Page 17 of 153
system. event_window to determine the name of the window for which
the trigger fired.
Page 18 of 153
140. Which of the two views should objects according to
possession?
view by structure.
141. What are the two types of views available in the object
navigator(specific to report 2.5)?
View by structure and view by type .
144. How do you create a new session while open a new form?
Using open_form built-in setting the session option Ex.
Open_form('Stocks ',active,session). when invoke the mulitiple forms
with open form and call_form in the same application, state whether
the following are true/False
146. If two groups are not linked in the data model editor,
What is the hierarchy between them?
Two group that is above are the left most rank higher than the group
that is to right or below it.
147. An open form can not be execute the call_form procedure
if you chain of called forms has been initiated by another open
form?
True
Page 19 of 153
150. What is the use of image_zoom built-in?
To manipulate images in image items.
Page 20 of 153
159. What is the maximum no of chars the parameter can
store?
The maximum no of chars the parameter can store is only valid for
char parameters, which can be upto 64K. No parameters default to
23Bytes and Date parameter default to 7Bytes.
Page 21 of 153
select member from sys.v_$logfile;
select name from sys.v_$controlfile;
Sometimes Oracle takes forever to shutdown with the "immediate"
option. As workaround to this problem, shutdown using these
commands:
alter system checkpoint;
shutdown abort
startup restrict
shutdown immediate
Note that if you database is in ARCHIVELOG mode, one can still use
archived log files to roll forward from an off-line backup. If you cannot
take your database down for a cold (off-line) backup at a convenient
time, switch your database into ARCHIVELOG mode and perform hot
(on-line) backups.
169. What are the built-ins that are used to Attach an LOV
programmatically to an item?
set_item_property
get_item_property
(by setting the LOV_NAME property)
171. How does one backup a database using RMAN? (for DBA
Page 22 of 153
The biggest advantage of RMAN is that it only backup used space in
the database. Rman doesn't put tablespaces in backup mode, saving
on redo generation overhead. RMAN will re-read database blocks until
it gets a consistent image of it. Look at this simple backup example.
rman target sys/*** nocatalog
run {
allocate channel t1 type disk;
backup
format '/app/oracle/db_backup/%d_t%t_s%s_p%p'
( database );
release channel t1;
}
Example RMAN restore:
rman target sys/*** nocatalog
run {
allocate channel t1 type disk;
# set until time 'Aug 07 2000 :51';
restore tablespace users;
recover tablespace users;
release channel t1;
}
The examples above are extremely simplistic and only useful for
illustrating basic concepts. By default Oracle uses the database
controlfiles to store information about backups. Normally one would
rather setup a RMAN catalog database to store RMAN metadata in.
Read the Oracle Backup and Recovery Guide before implementing any
RMAN backups.
Note: RMAN cannot write image copies directly to tape. One needs to
use a third-party media manager that integrates with RMAN to backup
directly to tape. Alternatively one can backup to disk and then
manually copy the backups to tape.
172. What are the different file extensions that are created by
oracle reports?
Rep file and Rdf file.
Page 23 of 153
one can start to use on-line database backups. To enable ARCHIVELOG
mode, simply change your database startup command script, and
bounce the database:
SQLPLUS> connect sys as sysdba
SQLPLUS> startup mount exclusive;
SQLPLUS> alter database archivelog;
SQLPLUS> archive log start;
SQLPLUS> alter database open;
NOTE1: Remember to take a baseline database backup right after
enabling archivelog mode. Without it one would not be able to recover.
Also, implement an archivelog backup to prevent the archive log
directory from filling-up.
NOTE2: ARCHIVELOG mode was introduced with Oracle V6, and is
essential for database point-in-time recovery. Archiving can be used in
combination with on-line and off-line database backups.
NOTE3: You may want to set the following INIT.ORA parameters when
enabling ARCHIVELOG mode: log_archive_start=TRUE,
log_archive_dest=... and log_archive_format=...
NOTE4: You can change the archive log destination of a database on-
line with the ARCHIVE LOG START TO 'directory'; statement. This
statement is often used to switch archiving between a set of
directories.
NOTE5: When running Oracle Real Application Server (RAC), you need
to shut down all nodes before changing the database to ARCHIVELOG
mode.
175. How does one backup archived log files? (for DBA
One can backup archived log files using RMAN or any operating system
backup utility. Remember to delete files after backing them up to
prevent the archive log directory from filling up. If the archive log
directory becomes full, your database will hang! Look at this simple
RMAN backup script:
RMAN> run {
2> allocate channel dev1 type disk;
3> backup
4> format '/app/oracle/arch_backup/log_t%t_s%s_p%p'
5> (archivelog all delete input);
6> release channel dev1;
7> }
Page 24 of 153
In backup mode, Oracle will write out complete changed blocks to the
redo log files. Normally only deltas (changes) are logged to the redo
logs. This is done to enable reconstruction of a block if only half of it
was backed up (split blocks). Because of this, one should notice
increased log activity and archiving during on-line backups.
177. What is the Maximum allowed length of Record group
Column?
Record group column names cannot exceed 30 characters.
Page 25 of 153
Oracle Precompiler exits, Oracle call interface, NonOracle user exits.
Page 26 of 153
process table of many systems. Administrators needs to be aware of
this!
195. How does one add users to a password file? (for DBA
One can select from the SYS.V_$PWFILE_USERS view to see which
users are listed in the password file. New users can be added to the
password file by granting them SYSDBA or SYSOPER privileges, or by
using the orapwd utility. GRANT SYSDBA TO scott;
Page 27 of 153
Modalless windows
Modal windows
207. What are the difference between lov & list item?
Lov is a property where as list item is an item. A list item can have only
one column, lov can have one or more columns.
208. What is the advantage of the library?
Libraries provide a convenient means of storing client-side program
units and sharing them among multiple applications. Once you create
a library, you can attach it to any other form, menu, or library modules.
When you can call library program units from triggers menu items
commands and user named routine, you write in the modules to which
you have attach the library. When a library attaches another library,
program units in the first library can reference program units in the
attached library. Library support dynamic loading-that is library
Page 28 of 153
program units are loaded into an application only when needed. This
can significantly reduce the run-time memory requirements of
applications.
215. How is link tool operation different bet. reports 2 & 2.5?
In Reports 2.0 the link tool has to be selected and then two fields to be
linked are selected and the link is automatically created. In 2.5 the first
field is selected and the link tool is then used to link the first field to
the second field.
Page 29 of 153
219. Name of the functions used to get/set canvas properties?
Get_view_property, Set_view_property
220. What are the built-ins that are used for setting the LOV
properties at runtime?
get_lov_property
set_lov_property
223. What are the built-in used for getting cell values?
Get_group_char_cell(function)
Get_groupcell(function)
Get_group_number_cell(function)
224. What are the built-ins used for Getting cell values?
GET_GROUP_CHAR_CELL (function)
GET_GROUPCELL(function)
GET_GROUP_NUMBET_CELL(function)
225. Atleast how many set of data must a data model have
before a data model can be base on it?
Four
226. To execute row from being displayed that still use column
in the row which property can be used?
Format trigger.
Page 30 of 153
228. What is the remove on exit property?
For a modelless window, it determines whether oracle forms hides the
window automatically when the operators navigates to an item in the
another window.
233. What are the built-ins used for finding Object ID function?
FIND_GROUP(function)
FIND_COLUMN(function)
Page 31 of 153
Veritas NetBackup
EMC Data Manager (EDM)
HP OMNIBack II
IBM's Tivoli Storage Manager - formerly ADSM
Legato Networker
ManageIT Backup and Recovery
Sterling Software's SAMS:Alexandria - formerly from Spectralogic
Sun Solstice Backup
239. What is the use of place holder column? What are the
various sub events a mouse double click event involves?
A placeholder column is used to hold calculated values at a specified
place rather than allowing is to appear in the actual row where it has to
appear.
240. What is the use of hidden column? What are the various
sub events a mouse double click event involves?
A hidden column is used to when a column has to embed into
boilerplate text.
Page 32 of 153
. Are the Oracle Names and LDAP Servers up and responding to
requests
. Are the Web Listeners up and responding to requests
243. What are the various sub events a mouse double click
event involves? What are the various sub events a mouse
double click event involves?
Double clicking the mouse consists of the mouse down, mouse up,
mouse click, mouse down & mouse up events.
Page 33 of 153
245. What are the default parameter that appear at run time in
the parameter screen? What are the various sub events a
mouse double click event involves?
Destype and Desname.
246. What are the built-ins used for Creating and deleting
groups?
CREATE-GROUP (function)
CREATE_GROUP_FROM_QUERY(function)
DELETE_GROUP(procedure)
252. How can values be passed bet. precompiler exits & Oracle
call interface?
By using the statement EXECIAFGET & EXECIAFPUT.
Page 34 of 153
By using the link file property in the layout boiler plate property sheet.
260. Can one export to multiple files?/ Can one beat the Unix 2
Gig limit? (for DBA
From Oracle8i, the export utility supports multiple output files. This
feature enables large exports to be divided into files whose sizes will
not exceed any operating system limits (FILESIZE= parameter). When
importing from multi-file export you must provide the same filenames
in the same sequence in the FILE= parameter. Look at this example:
exp SCOTT/TIGER FILE=D:\F1.dmp,E:\F2.dmp FILESIZE=10m
LOG=scott.log
Use the following technique if you use an Oracle version prior to 8i:
Page 35 of 153
Create a compressed export on the fly. Depending on the type of data,
you probably can export up to 10 gigabytes to a single file. This
example uses gzip. It offers the best compression I know of, but you
can also substitute it with zip, compress or whatever.
# create a named pipe
mknod exp.pipe p
# read the pipe - output to zip file in the background
gzip < exp.pipe > scott.exp.gz &
# feed the pipe
exp userid=scott/tiger file=exp.pipe ...
. Create an indexfile so that you can create indexes AFTER you have
imported data. Do this by setting INDEXFILE to a filename and then
import. No data will be imported but a file containing index definitions
will be created. You must edit this file afterwards and supply the
passwords for the schemas on all CONNECT statements.
. Place the file to be imported on a separate physical disk from the
oracle data files
. Increase DB_CACHE_SIZE (DB_BLOCK_BUFFERS prior to 9i)
considerably in the init$SID.ora file
. Set the LOG_BUFFER to a big value and restart oracle.
. Stop redo log archiving if it is running (ALTER DATABASE
NOARCHIVELOG;)
. Create a BIG tablespace with a BIG rollback segment inside. Set all
other rollback segments offline (except the SYSTEM rollback segment
of course). The rollback segment must be as big as your biggest table
(I think?)
. Use COMMIT=N in the import parameter file if you can afford it
. Use ANALYZE=N in the import parameter file to avoid time consuming
ANALYZE statements
. Remember to run the indexfile previously created
Page 36 of 153
263. Give the sequence of execution of the various report
triggers?
Before form , After form , Before report, Between page, After report.
264. What are the common Import/ Export problems? (for DBA
ORA-00001: Unique constraint (...) violated - You are importing
duplicate rows. Use IGNORE=NO to skip tables that already exist (imp
will give an error if the object is re-created).
ORA-01555: Snapshot too old - Ask your users to STOP working while
you are exporting or use parameter CONSISTENT=NO
ORA-01562: Failed to extend rollback segment - Create bigger rollback
segments or set parameter COMMIT=Y while importing
IMP-00015: Statement failed ... object already exists... - Use the
IGNORE=Y import parameter to ignore these errors, but be careful as
you might end up with duplicate rows.
Page 37 of 153
An LOV is a scrollable popup window that provides the operator with
either a single or multi column selection list.
273. What are the built -ins used for Modifying a groups
structure?
ADD-GROUP_COLUMN (function)
ADD_GROUP_ROW (procedure)
DELETE_GROUP_ROW(procedure)
Page 38 of 153
278. What is a record group?
A record group is an internal Oracle Forms that structure that has a
column/row framework similar to a database table. However, unlike
database tables, record groups are separate objects that belong to the
form module which they are defined.
279. My database is down and I cannot restore. What now? (for
DBA
Recovery without any backup is normally not supported, however,
Oracle Consulting can sometimes extract data from an offline database
using a utility called DUL (Disk UnLoad). This utility reads data in the
data files and unloads it into SQL*Loader or export dump files. DUL
does not care about rollback segments, corrupted blocks, etc, and can
thus not guarantee that the data is not logically corrupt. It is intended
as an absolute last resort and will most likely cost your company a lot
of money!!!
284. What are the differences between EBU and RMAN? (for
DBA
Page 39 of 153
Enterprise Backup Utility (EBU) is a functionally rich, high performance
interface for backing up Oracle7 databases. It is sometimes referred to
as OEBU for Oracle Enterprise Backup Utility. The Oracle Recovery
Manager (RMAN) utility that ships with Oracle8 and above is similar to
Oracle7's EBU utility. However, there is no direct upgrade path from
EBU to RMAN.
285. How does one create a RMAN recovery catalog? (for DBA
Start by creating a database schema (usually called rman). Assign an
appropriate tablespace to it and grant it the recovery_catalog_owner
role. Look at this example:
sqlplus sys
SQL>create user rman identified by rman;
SQL> alter user rman default tablespace tools temporary tablespace
temp;
SQL> alter user rman quota unlimited on tools;
SQL> grant connect, resource, recovery_catalog_owner to rman;
SQL> exit;
Next, log in to rman and create the catalog schema. Prior to Oracle 8i
this was done by running the catrman.sql script. rman catalog
rman/rman
RMAN>create catalog tablespace tools;
RMAN> exit;
You can now continue by registering your databases in the catalog.
Look at this example:
rman catalog rman/rman target backdba/backdba
RMAN> register database;
286. How can a group in a cross products be visually
distinguished from a group that does not form a cross product?
A group that forms part of a cross product will have a thicker border.
289. What are three panes that appear in the run time pl/sql
interpreter?
1. Source pane.
2. interpreter pane.
3. Navigator pane.
Page 40 of 153
290. What are the two panes that Appear in the design time
pl/sql interpreter?
1. Source pane.
2. Interpreter pane
291. What are the two ways by which data can be generated
for a parameters list of values?
1. Using static values.
2. Writing select statement.
295. To display the page no. for each page on a report what
would be the source & logical page no. or & of physical page
no.?
& physical page no.
296. It is possible to use raw devices as data files and what is
the advantages over file. system files ?
Yes. The advantages over file system files. I/O will be improved
because Oracle is bye-passing the kernnel which writing into disk. Disk
Corruption will be very less.
Page 41 of 153
Type export should be performed
COMPLETE,CUMULATIVE,INCREMENTAL. List the sequence of events
when a large transaction that exceeds beyond its optimal value when
an entry wraps and causes the rollback segment toexpand into anotion
Completes. e. will be written.
Page 42 of 153
306. How will you force database to use particular rollback
segment ?
SET TRANSACTION USE ROLLBACK SEGMENT rbs_name.
Page 43 of 153
A latch is an internal Oracle mechanism used to protect data structures
in the SGA from simultaneous access. Atomic hardware instructions
like TEST-AND-SET is used to implement latches. Latches are more
restrictive than locks in that they are always exclusive. Latches are
never queued, but will spin or sleep until they obtain a resource, or
time out.
Enqueues and locks are different names for the same thing. Both
support queuing and concurrency. They are queued and serviced in a
first-in-first-out (FIFO) order.
Semaphores are an operating system facility used to control waiting.
Semaphores are controlled by the following Unix parameters: semmni,
semmns and semmsl. Typical settings are:
semmns = sum of the "processes" parameter for each instance
(see init<instance>.ora for each instance)
semmni = number of instances running simultaneously;
semmsl = semmns
316. Where can one get a list of all hidden Oracle parameters?
(for DBA
Oracle initialization or INIT.ORA parameters with an underscore in front
are hidden or unsupported parameters. One can get a list of all hidden
parameters by executing this query:
select *
from SYS.X$KSPPI
where substr(KSPPINM,1,1) = '_';
The following query displays parameter names with their current value:
317. What is a database EVENT and how does one set it? (for
DBA
Oracle trace events are useful for debugging the Oracle database
server. The following two examples are simply to demonstrate syntax.
Refer to later notes on this page for an explanation of what these
particular events do.
Either adding them to the INIT.ORA parameter file can activate events.
E.g.
Page 44 of 153
event='1401 trace name errorstack, level 12'
... or, by issuing an ALTER SESSION SET EVENTS command: E.g.
alter session set events '10046 trace name context forever, level 4';
The alter session method only affects the user's current session,
whereas changes to the INIT.ORA file will affect all sessions once the
database has been restarted.
320. How can one dump internal database structures? (for DBA
The following (mostly undocumented) commands can be used to
obtain information about internal database structures.
o Dump control file contents
Page 45 of 153
alter session set events 'immediate trace name CONTROLF level 10'
/
o Dump file headers
alter session set events 'immediate trace name FILE_HDRS level 10'
/
o Dump redo log headers
alter session set events 'immediate trace name REDOHDR level 10'
/
o Dump the system state
NOTE: Take 3 successive SYSTEMSTATE dumps, with 10-minute
intervals alter session set events 'immediate trace name
SYSTEMSTATE level 10'
/
o Dump the process state
alter session set events 'immediate trace name PROCESSSTATE level
10'
/
o Dump Library Cache details
alter session set events 'immediate trace name library cache level 10'
/
o Dump optimizer statistics whenever a SQL statement is parsed (hint:
change statement or flush pool) alter session set events '10053 trace
name context forever, level 1'
/
o Dump a database block (File/ Block must be converted to DBA
address) Convert file and block number to a DBA (database block
address).
Eg: variable x varchar2;
exec :x := dbms_utility.make_data_block_address(1,12);
print x
alter session set events 'immediate trace name blockdump level
50360894'
/
322. How free extents are managed in Ver 6.0 and Ver 7.0 ?
Free extents cannot be merged together in Ver 6.0.
Free extents are periodically coalesces with the neighboring free
extent in Ver 7.0
Page 46 of 153
For Incremental exports, the flag indirects whether a record will be
stores data dictionary tables recording the export.
324. What is the use of ROWS option in EXP command ?
Flag to indicate whether table rows should be exported. If 'N' only DDL
statements for the database objects will be created.
326. How will you swap objects into a different table space for
an existing database ?
Export the user
Perform import using the command imp system/manager
file=export.dmp indexfile=newrite.sql.
This will create all definitions into newfile.sql. Drop necessary objects.
Run the script newfile.sql after altering the tablespaces.
Import from the backup for the necessary objects.
Page 47 of 153
332. How will you create multiple rollback segments in a
database ?
Create a database which implicitly creates a SYSTEM Rollback Segment
in a SYSTEM tablespace. Create a Second Rollback Segment name R0
in the SYSTEM tablespace. Make new rollback segment available (After
shutdown, modify init.ora file and Start database) Create other
tablespaces (RBS) for rollback segments. Deactivate Rollback Segment
R0 and activate the newly created rollback segments.
333. What is cold backup? What are the elements of it?
Cold backup is taking backup of all physical files after normal
shutdown of database. We need to take.
- All Data files.
- All Control files.
- All on-line redo log files.
- The init.ora file (Optional)
Page 48 of 153
A flag to indicate whether statistical information about the exported
objects should be written to export dump file.
Page 49 of 153
352. How do you trap the error in forms 3.0 ?
using On-Message or On-Error triggers.
Page 50 of 153
362. Give the sequence in which triggers fired during insert
operations, when the following 3 triggers are defined at the
same block level ?
a. ON-INSERT b. POST-INSERT c. PRE-INSERT
Page 51 of 153
It fires just before SQL * forms the current block.
374. Name the two files that are created when you generate
the form give the filex extension ?
INP (Source File)
FRM (Executable File)
375. What package procedure used for invoke sql *plus from
sql *forms ?
Host (E.g. Host (sqlplus))
Page 52 of 153
table (which is usually the case) it will take less time to scan the entire
index than to scan the entire table.
384. Where can one find I/O statistics per table? (for DBA
The UTLESTAT report shows I/O per tablespace but one cannot see
what tables in the tablespace has the most I/O. The
$ORACLE_HOME/rdbms/admin/catio.sql script creates a sample_io
procedure and table to gather the required information. After
executing the procedure, one can do a simple SELECT * FROM
io_per_object; to extract the required information. For more details,
look at the header comments in the
$ORACLE_HOME/rdbms/admin/catio.sql script.
385. My query was fine last week and now it is slow. Why? (for
DBA
The likely cause of this is because the execution plan has changed.
Generate a current explain plan of the offending query and compare it
to a previous one that was taken when the query was performing well.
Usually the previous plan is not available.
Some factors that can cause a plan to change are:
. Which tables are currently analyzed? Were they previously analyzed?
(ie. Was the query using RBO and now CBO?)
. Has OPTIMIZER_MODE been changed in INIT.ORA?
. Has the DEGREE of parallelism been defined/changed on any table?
. Have the tables been re-analyzed? Were the tables analyzed using
estimate or compute? If estimate, what percentage was used?
. Have the statistics changed?
. Has the INIT.ORA parameter DB_FILE_MULTIBLOCK_READ_COUNT
been changed?
. Has the INIT.ORA parameter SORT_AREA_SIZE been changed?
. Have any other INIT.ORA parameters been changed?
. What do you think the plan should be? Run the query with hints to
see if this produces the required performance.
386. Why is Oracle not using the damn index? (for DBA
This problem normally only arises when the query plan is being
generated by the Cost Based Optimizer. The usual cause is because
the CBO calculates that executing a Full Table Scan would be faster
than accessing the table via the index.
Fundamental things that can be checked are:
. USER_TAB_COLUMNS.NUM_DISTINCT - This column defines the
number of distinct values the column holds.
. USER_TABLES.NUM_ROWS - If NUM_DISTINCT = NUM_ROWS then
using an index would be preferable to doing a FULL TABLE SCAN. As
the NUM_DISTINCT decreases, the cost of using an index increase
Page 53 of 153
thereby is making the index less desirable.
. USER_INDEXES.CLUSTERING_FACTOR - This defines how ordered the
rows are in the index. If CLUSTERING_FACTOR approaches the number
of blocks in the table, the rows are ordered. If it approaches the
number of rows in the table, the rows are randomly ordered. In such a
case, it is unlikely that index entries in the same leaf block will point to
rows in the same data blocks.
. Decrease the INIT.ORA parameter
DB_FILE_MULTIBLOCK_READ_COUNT - A higher value will make the cost
of a FULL TABLE SCAN cheaper.
. Remember that you MUST supply the leading column of an index, for
the index to be used (unless you use a FAST FULL SCAN or SKIP
SCANNING).
. There are many other factors that affect the cost, but sometimes the
above can help to show why an index is not being used by the CBO. If
from checking the above you still feel that the query should be using
an index, try specifying an index hint. Obtain an explain plan of the
query either using TKPROF with TIMED_STATISTICS, so that one can
see the CPU utilization, or with AUTOTRACE to see the statistics.
Compare this to the explain plan when not using an index.
Page 54 of 153
392. Classify the restricted and unrestricted procedure from
the following.
a. Call
b. User-Exit
c. Call-Query
d. Up
e. Execute-Query
f. Message
g. Exit-From
h. Post
i. Break?
a. Call - unrestricted
b. User Exit - Unrestricted
c. Call_query - Unrestricted
d. Up - Restricted
e. Execute Query - Restricted
f. Message - Restricted
g. Exit_form - Restricted
h. Post - Restricted
i. Break - Unrestricted.
Page 55 of 153
401. What are the different types of Package Procedure ?
1. Restricted package procedure.
2. Unrestricted package procedure.
407. What are the triggers associated with the image item?
When-Image-activated(Fires when the operator double clicks on an
image Items)
When-image-pressed(fires when the operator selects or deselects the
image item)
Page 56 of 153
Visual Attributes are the font, color and pattern characteristics of
objects that operators see and intract with in our application.
415. What built-in is used for showing the alert during run-
time?
Show_alert.
Page 57 of 153
Radio groups display a fixed no of options that are mutually Exclusive.
User can select one out of n number of options.
420. What are the menu items that oracle forms 4.0 supports?
Plain, Check,Radio, Separator, Magic
421. Give the equivalent term in forms 4.0 for the following.
Page, Page 0?
Page - Canvas-View
Page 0 - Canvas-view null.
Page 58 of 153
430. What is the built-in routine used to count the no of rows
in a group?
Get_group _row_count
System Variables
433. List the built-in routine for controlling window during run-
time?
Find_window,
get_window_property,
hide_window,
move_window,
resize_window,
set_window_property,
show_View
434. List the built-in routine for controlling window during run-
time?
Find_canvas
Get-Canvas_property
Get_view_property
Hide_View
Replace_content_view
Scroll_view
Set_canvas_property
Set_view_property
Show_view
Alert
435. What is the built-in function used for finding the alert?
Find_alert
Editors
Page 59 of 153
437. What buil-in routines are used to display editor
dynamicaly?
Edit_text item
show_editor
LOV
438. What is an Lov?
A list of values is a single or multi column selection list displayed in a
pop-up window
441. List the built-in routines for the controlling canvas views
during run-time?
Find_canvas
Get-Canvas_property
Get_view_property
Hide_View
Replace_content_view
Scroll_view
Set_canvas_property
Set_view_property
Show_view
Alert
Page 60 of 153
444. What is Oracle Financials? (for DBA
Oracle Financials products provide organizations with solutions to
a wide range of long- and short-term accounting system issues.
Regardless of the size of the business, Oracle Financials can
meet accounting management demands with:
• Oracle Assets: Ensures that an organization's property and
equipment investment is accurate and that the correct asset tax
accounting strategies are chosen.
• Oracle General Ledger: Offers a complete solution to journal
entry, budgeting, allocations, consolidation, and financial
reporting needs.
• Oracle Inventory: Helps an organization make better inventory
decisions by minimizing stock and maximizing cash flow.
• Oracle Order Entry: Provides organizations with a sophisticated
order entry system for managing customer commitments.
• Oracle Payables: Lets an organization process more invoices with
fewer staff members and tighter controls. Helps save money
through maximum discounts, bank float, and prevention of
duplicate payment.
• Oracle Personnel: Improves the management of employee-
related issues by retaining and making available every form of
personnel data.
• Oracle Purchasing: Improves buying power, helps negotiate
bigger discounts, eliminates paper flow, increases financial
controls, and increases productivity.
• Oracle Receivables:. Improves cash flow by letting an
organization process more payments faster, without off-line
research. Helps correctly account for cash, reduce outstanding
receivables, and improve collection effectiveness.
• Oracle Revenue Accounting Gives an organization timely and
accurate revenue and flexible commissions reporting.
• Oracle Sales Analysis: Allows for better forecasting, planning.
and reporting of sales information.
Page 61 of 153
implement Oracle Financials, you should switch your current GL system
first.GL is relatively easy to implement. You should go live with it first
to give your implementation team a chance to be familiar with Oracle
Financials.
448. What is the MultiOrg and what is it used for? (for DBA
MultiOrg or Multiple Organizations Architecture allows multiple
operating units and their relationships to be defined within a single
installation of Oracle Applications. This keeps each operating unit's
transaction data separate and secure.
Use the following query to determine if MuliOrg is intalled:
select multi_org_flag from fnd_product_groups;
Page 62 of 153
456 .What is a record Group?
A record group is an internal oracle forms data structure that has a
similar column/row frame work to a database table
Page 63 of 153
WHERE CURRENT OF clause in an UPDATE,DELETE statement refers to
the latest row fetched from a cursor. Database Triggers
Page 64 of 153
oracle error. e.g. PRAGMA EXCEPTION_INIT (exception name, oracle
error number)
Page 65 of 153
PL/SQL is a procedural language that has both interactive SQL and
procedural programming language constructs such as iteration,
conditional branching.
Page 66 of 153
486. Give the structure of the function ?
FUNCTION name (argument list .....) Return datatype is
local variable declarations
Begin
executable statements
Exception
execution handlers
End;
Page 67 of 153
492. What is a database trigger ? Name some usages of
database trigger ?
Database trigger is stored PL/SQL program unit associated with a
specific database table. Usages are Audit data modifications, Log
events transparently, Enforce complex business rules Derive column
values automatically, Implement complex security authorizations.
Maintain replicate tables.
Page 68 of 153
PACKAGE NAME.PROCEDURE NAME (parameters)
variable := PACKAGE NAME.FUNCTION NAME (arguments);
END;
END EXEC;
c. EXECUTE PACKAGE NAME.PROCEDURE if the procedures does not
have any out/in-out parameters. A function can not be called.
Page 69 of 153
% ROWTYPE is to be used whenever query returns a entire row of a
table or view.
TYPE rec RECORD is to be used whenever query returns columns of
different table or views and variables.
E.g. TYPE r_emp is RECORD (eno emp.empno% type,ename emp
ename %type );
e_rec emp% ROWTYPE
cursor c1 is select empno,deptno from emp;
e_rec c1 %ROWTYPE.
504. What are the different types of PL/SQL program units that
can be defined and stored in ORACLE database ?
Procedures and Functions,Packages and Database Triggers.
Page 70 of 153
513. What is an UTL_FILE.What are different procedures and
functions associated with it?
UTL_FILE is a package that adds the ability to read and write to
operating system files. Procedures associated with it are FCLOSE,
FCLOSE_ALL and 5 procedures to output data to a file PUT, PUT_LINE,
NEW_LINE, PUTF, FFLUSH.PUT, FFLUSH.PUT_LINE,FFLUSH.NEW_LINE.
Functions associated with it are FOPEN, ISOPEN.
Page 71 of 153
-INDEXES
-SYNONYMS
-SEQUENCES
-TABLESPACES etc
Page 72 of 153
523. What a SELECT FOR UPDATE cursor represent.?
SELECT......FROM......FOR......UPDATE[OF column-reference][NOWAIT]
The processing done in a fetch loop modifies the rows that have been
retrieved by the cursor. A convenient way of modifying the rows is
done by a method with two parts: the FOR UPDATE clause in the cursor
declaration, WHERE CURRENT OF CLAUSE in an UPDATE or declaration
statement.
Page 73 of 153
529. What is a OUTER JOIN?
Outer Join--Its a join condition used where you can query all the rows of
one of the tables in the join condition even though they don’t satisfy
the join condition.
Page 74 of 153
from emp)
Output:-
2
4
6
540. There is a string 120000 12 0 .125 , how you will find the
position of the decimal place?
INSTR('120000 12 0 .125',1,'.')
output 13
Page 75 of 153
variable to a PL/SQL block is via bind variable or a procedure
parameter.
543. When do you use WHERE clause and when do you use
HAVING clause?
HAVING clause is used when you want to specify a condition for a
group function and it is written after GROUP BY clause. The WHERE
clause is used when you want to specify a condition for columns, single
row functions except group functions and it is written before GROUP BY
clause if it is used.
547. How will you delete duplicating rows from a base table?
delete from table_name where rowid not in (select max(rowid) from
table group by duplicate_values_field_name); or delete
duplicate_values_field_name dv from table_name ta where rowid
<(select min(rowid) from table_name tb where ta.dv=tb.dv);
Page 76 of 153
550. How you will avoid duplicating records in a query?
By using DISTINCT
Page 77 of 153
'' Should be used before '%'.
Page 78 of 153
568. What is ROWID ?in a session before accessing next value ?
ROWID is a pseudo column attached to each row of a table. It is 18
character long, blockno, rownumber are the components of ROWID.
Page 79 of 153
management server and repository. Remember to setup a backup for
the repository database after creating it.
580. How does one list one's databases in the OEM Console?
(for DBA
Follow these steps to discover databases and other services from the
OEM Console:
1. Ensure the GLOBAL_DBNAME parameter is set for all databases in
your LISTENER.ORA file (optional). These names will be listed in the
OEM Console. Please note that names entered are case sensitive. A
portion of a listener.ora file:
(SID_DESC =
(GLOBAL_DBNAME = DB_name_for_OEM)
(SID_NAME = ...
2. Start the Oracle Intelligent Agent on the machine you want to
discover. See section "How does one start the Oracle Intelligent
Agent?".
3. Start the OEM Console, navigate to menu "Navigator/ Discover
Nodes". The OEM Discovery Wizard will guide you through the process
of discovering your databases and other services.
Page 80 of 153
sequence reaches its maximum value, it generates its minimum value.
After a descending sequence reaches its minimum, it generates its
maximum.NO CYCLE specifies that the sequence cannot generate
more values after reaching its maximum or minimum value.
Page 81 of 153
--
-- For the second highest salary:
-- select level, max(sal) from emp
-- where level=2
-- connect by prior sal > sal
-- group by level
592. How you will avoid your query from using indexes?
SELECT * FROM emp
Where emp_no+' '=12345;
i.e you have to concatenate the column name with space within codes
in the where condition.
SELECT /*+ FULL(a) */ ename, emp_no from emp
where emp_no=1234;
i.e using HINTS
Page 82 of 153
c) System Monitor(SMON) :: The System Monitor performs instance
recovery at instance startup.This is useful for recovery from system
failure
d)Process Monitor(PMON) :: The Process Monitor peforms process
recovery when user Process fails. Pmon Clears and Frees resources
that process was using.
e) CheckPoint(CKPT) :: At Specified times, all modified database buffers
in SGA are written to data files by DBWR at Checkpoints and Updating
all data files and control files of database to indicate the most recent
checkpoint
f)Archieves(ARCH) :: The Archiver copies online redo log files to
archival storal when they are busy.
g) Recoveror(RECO) :: The Recoveror is used to resolve the distributed
transaction in network
h) Dispatcher (Dnnn) :: The Dispatcher is useful in Multi Threaded
Architecture
i) Lckn :: We can have upto 10 lock processes for inter instance locking
in parallel sql.
Page 83 of 153
c) SavePoint :: For long transactions that contain many SQL
statements, intermediate markers or savepoints are declared.
Savepoints can be used to divide a transactino into smaller points.
d) Rolling Forward :: Process of applying redo log during recovery is
called rolling forward.
e) Cursor :: A cursor is a handle ( name or a pointer) for the memory
associated with a specific stament. A cursor is basically an area
allocated by Oracle for executing the Sql Statement. Oracle uses an
implicit cursor statement for Single row query and Uses Explcit cursor
for a multi row query.
f) System Global Area(SGA) :: The SGA is a shared memory region
allocated by the Oracle that contains Data and control information for
one Oracle Instance.It consists of Database Buffer Cache and Redo log
Buffer.
g) Program Global Area (PGA) :: The PGA is a memory buffer that
contains data and control information for server process.
g) Database Buffer Cache :: Databese Buffer of SGA stores the most
recently used blocks of datatbase data.The set of database buffers in
an instance is called Database Buffer Cache.
h) Redo log Buffer :: Redo log Buffer of SGA stores all the redo log
entries.
i) Redo Log Files :: Redo log files are set of files that protect altered
database data in memory that has not been written to Data Files. They
are basically used for backup when a database crashes.
j) Process :: A Process is a 'thread of control' or mechansim in
Operating System that executes series of steps.
598. What are Procedure,functions and Packages
Procedures and functions consist of set of PL/SQL statements that are
grouped together as a unit to solve a specific problem or perform set
of related tasks.
Procedures do not Return values while Functions return one One Value
Packages :: Packages Provide a method of encapsulating and storing
related procedures, functions, variables and other Package Contents
Page 84 of 153
Onwards.
Stored Procedures :: Stored Procedures are Procedures that are stored
in Compiled form in the database.The advantage of using the stored
procedures is that many users can use the same procedure in
compiled and ready to use format.
600. How many Integrity Rules are there and what are they
There are Three Integrity Rules. They are as follows ::
a) Entity Integrity Rule :: The Entity Integrity Rule enforces that the
Primary key cannot be Null
b) Foreign Key Integrity Rule :: The FKIR denotes that the relationship
between the foreign key and the primary key has to be enforced.When
there is data in Child Tables the Master tables cannot be deleted.
c) Business Integrity Rules :: The Third Intigrity rule is about the
complex business processes which cannot be implemented by the
above 2 rules.
601. What are the Various Master and Detail Relation ships.
The various Master and Detail Relationship are
a) NonIsolated :: The Master cannot be deleted when a child is exisiting
b) Isolated :: The Master can be deleted when the child is exisiting
c) Cascading :: The child gets deleted when the Master is deleted.
Page 85 of 153
db_block_lru_statistics parameter has to be set to
true to gather information in this table.
X$KCVFH File Header Fixed Table
X$KDNCE SGA Cache Entry Fixed Table
X$KDNST Sequence Cache Statistics Fixed Table
X$KDXHS Histogram structure Fixed Table
X$KDXST Statistics collection Fixed Table
One-row summary of LRU statistics for the shared
X$KGHLU
pool
X$KGLBODY Derived from X$KGLOB (col kglhdnsp = 2)
X$KGLCLUSTER Derived from X$KGLOB (col kglhdnsp = 5)
X$KGLINDEX Derived from X$KGLOB (col kglhdnsp = 4)
Latch Clean-up state for library cache objects
X$KGLLC
Fixed Table
X$KGLPN Library cache pin Fixed Table
X$KGLTABLE Derived from X$KGLOB (col kglhdnsp = 1)
X$KGLTR Library Cache Translation Table entry Fixed Table
X$KGLTRIGGER Derived from X$KGLOB (col kglhdnsp = 3)
X$KGLXS Library Cache Access Table
Fixed table to look at what databases are
X$KKMMD
mounted and their status
X$KKSBV Cursor Cache Bind Variables
Each row represents a piece of memory in the
X$KSMSP
shared pool
X$KSQDN Global database name
X$KSQST Enqueue statistics by type
Cost function for each Kernel Profile (join to
X$KSUCF
X$KSUPL)
X$KSUPL Resource Limit for each Kernel Profile
Resource Usage for each Kernel Profile (join with
X$KSURU
X$KSUPL)
X$KSQST Gets and waits for different types of enqueues
Indicate tablespace that has valid save undo
X$KTTVS
segments
Internal instance parameters set at instance
X$KVII
initialization
X$KVIS Oracle Data Block (size_t type) variables
X$KVIT Instance internal flags, variables and parameters
Page 86 of 153
that can change during the life of an instance
X$KXFPCDS Client Dequeue Statistics
X$KXFPCMS Client Messages Statistics
Represent an os role as defined by the operating
X$KZDOS
system
X$KZSRO Security state Role: List of enabled roles
Lock Element: each PCM lock that is used by the
X$LE
buffer cache (gc_db_locks)
Displays all the different messages that can be
X$MESSAGES
sent to the Background processes
X$NLS_PARAMETERS NLS database parameters
Page 87 of 153
KC Cache Layer
KS Services Layer
KJ Lock Manager Layer
KG Generic Layer
KV Kernel Variables (eg. x$KVIS and X$KVII)
S or
Operating System Dependencies
ODS
Page 88 of 153
DROP USER scott CASCADE; -- Remove user
After creating a new user, assign the required privileges:
GRANT CONNECT, RESOURCE TO scott;
GRANT DBA TO scott; -- Make user a DB Administrator
Remember to give the user some space quota on its tablespaces:
ALTER USER scott QUOTA UNLIMITED ON tools;
Page 89 of 153
Oracle Trace server
Created by: ?/rdbms/admin/otrcsvr.sql
DBSNMP/DBSNMP
Oracle Intelligent agent
Created by: ?/rdbms/admin/catsnmp.sql, called from catalog.sql
Can password be changed: Yes - put the new password in snmp_rw.ora
file
Can user be dropped: YES - Only if you do not use the Intelligent
Agents
ORDPLUGINS/ORDPLUGINS
Object Relational Data (ORD) User used by Time Series, etc.
Created by: ?/ord/admin/ordinst.sql
ORDSYS/ORDSYS
Object Relational Data (ORD) User used by Time Series, etc
Created by: ?/ord/admin/ordinst.sql
DSSYS/DSSYS
Oracle Dynamic Services and Syndication Server
Created by: ?/ds/sql/dssys_init.sql
MDSYS/MDSYS
Oracle Spatial administrator user
Created by: ?/ord/admin/ordinst.sql
AURORA$ORB$UNAUTHENTICATED/INVALID
Used for users who do not authenticate in Aurora/ORB
Created by: ?/javavm/install/init_orb.sql called
from ?/javavm/install/initjvm.sql
PERFSTAT/PERFSTAT
Oracle Statistics Package (STATSPACK) that supersedes
UTLBSTAT/UTLESTAT
Created by: ?/rdbms/admin/statscre.sql
Remember to change the passwords for the SYS and SYSTEM users
immediately after installation!
Except for the user SYS, there should be no problem altering these
users to use a different default and temporary tablespace.
608. How does one enforce strict password control? (for DBA
By default Oracle's security is not extremely good. For example, Oracle
will allow users to choose single character passwords and passwords
that match their names and userids. Also, passwords don't ever expire.
This means that one can hack an account for years without ever
locking the user.
From Oracle8 one can manage passwords through profiles. Some of
the things that one can restrict:
. FAILED_LOGIN_ATTEMPTS - failed login attempts before the account is
locked
. PASSWORD_LIFE_TIME - limits the number of days the same password
can be used for authentication
. PASSWORD_REUSE_TIME - number of days before a password can be
reused
Page 90 of 153
. PASSWORD_REUSE_MAX - number of password changes required
before the current password can be reused
. PASSWORD_LOCK_TIME - number of days an account will be locked
after maximum failed login attempts
. PASSWORD_GRACE_TIME - number of days after the grace period
begins during which a warning is issued and login is allowed
. PASSWORD_VERIFY_FUNCTION - password complexity verification
script
Look at this simple example:
CREATE PROFILE my_profile LIMIT
PASSWORD_LIFE_TIME 30;
ALTER USER scott PROFILE my_profile;
609. How does one switch to another user in Oracle? (for DBA
Users normally use the "connect" statement to connect from one
database user to another. However, DBAs can switch from one user to
another without a password. Of course it is not advisable to bridge
Oracle's security, but look at this example: SQL> select password from
dba_users where username='SCOTT';
PASSWORD
F894844C34402B67
SQL> alter user scott identified by lion;
User altered.
Page 91 of 153
612. What is the difference between candidate key, unique key
and primary key
Candidate keys are the columns in the table that could be the primary
keys and the primary key is the key that has been selected to identify
the rows. Unique key is also useful for identifying the distinct rows in
the table.)
Page 92 of 153
616. Physical Storage of the Data
The finest level of granularity of the data base are the data blocks.
Data Block :: One Data Block correspond to specific number of physical
database space
Extent :: Extent is the number of specific number of contigious data
blocks.
Segments :: Set of Extents allocated for Extents. There are three types
of Segments
a) Data Segment :: Non Clustered Table has data segment data of
every table is stored in cluster data segment
b) Index Segment :: Each Index has index segment that stores data
c) Roll Back Segment :: Temporarily store 'undo' information
Page 93 of 153
623. What is Normalisation
Normalisation is the process of organising the tables to remove the
redundancy.There are mainly 5 Normalisation rules.
a) 1 Normal Form :: A table is said to be in 1st Normal Form when the
attributes are atomic
b) 2 Normal Form :: A table is said to be in 2nd Normal Form when all
the candidate keys are dependant on the primary key
c) 3rd Normal Form :: A table is said to be third Normal form when it is
not dependant transitively
Page 94 of 153
633. Can you use select in FROM clause of SQL select ?
Yes.
634. Which trigger are created when master -detail rela?
master delete property
* NON-ISOLATED (default)
a) on check delete master
b) on clear details
c) on populate details
* ISOLATED
a) on clear details
b) on populate details
* CASCADE
a) per-delete
b) on clear details
c) on populate details
Page 95 of 153
yes, but you have to use FORMS_DDL.
Referencing allows you to create objects that inherit their functionality
and appearance from other objects. Referencing an object is similar to
copying an object, except that the resulting reference object maintains
a link to its source object. A reference object automatically inherits any
changes that have been made to the source object when you open or
regenerate the module that contains the reference object. Any string
expression up to 32K:
- a literal
- an expression or a variable representing the text of a block of
dynamically created PL/SQL code
- a DML statement or
- a DDL statement
Restrictions:
The statement you pass to FORMS_DDL may not contain bind variable
references in the string, but the values of bind variables can be
concatenated into the string before passing the result to FORMS_DDL.
642. What are the types of triggers and how the sequence of
firing in text item
Triggers can be classified as Key Triggers, Mouse Triggers
,Navigational Triggers.
Key Triggers :: Key Triggers are fired as a result of Key action.e.g ::
Key-next-field, Key-up,Key-Down
Mouse Triggers :: Mouse Triggers are fired as a result of the mouse
navigation.e.g. When-mouse-button-presed,when-mouse-
doubleclicked,etc
Navigational Triggers :: These Triggers are fired as a result of
Navigation. E.g : Post-Text-item,Pre-text-item.
We also have event triggers like when ?new-form-instance and when-
new-block-instance.
We cannot call restricted procedures like go_to(?my_block.first_item?)
in the Navigational triggers
But can use them in the Key-next-item.
The Difference between Key-next and Post-Text is an very important
question. The key-next is fired as a result of the key action while the
post text is fired as a result of the mouse movement. Key next will not
fire unless there is a key event. The sequence of firing in a text item
are as follows ::
a) pre - text
b) when new item
c) key-next
d) when validate
e) post text
Page 96 of 153
643. Can you store pictures in database? How?
Yes , in long Raw datatype.
Page 97 of 153
An ALERT is a modal window that displays a message notifiying
operator of some application condition.
648. Can a button have icon and lable at the same time ?
-NO
Page 98 of 153
657. Can you call WIN-SDK thruo' user exits?
YES.
658. Does user exits supports DLL on MSWINDOWS ?
YES .
Locking mode :
Specifies when Oracle Forms should attempt to obtain database locks
on rows that correspond to queried records in the form. a) immediate
b) delayed
Page 99 of 153
667. What is OLE automation ?
OLE automation allows an OLE server application to expose a set of
commands and functions that can be invoked from an OLE container
application. OLE automation provides a way for an OLE container
application to use the features of an OLE server application to
manipulate an OLE object from the OLE container environment.
(FORMS_OLE)
Rolling forward to recover data that has not been recorded in data
files, yet has been recorded in the on-line redo log, including the
contents of rollback segments. Rolling back transactions that have
been explicitly rolled back or have not been committed as indicated by
the rollback segments regenerated in step a. Releasing any resources
(locks) held by transactions in process at the time of the failure.
Resolving any pending distributed transactions undergoing a two-
phase commit at the time of the instance failure.
682. How many types of columns are there and what are they
Formula columns :: For doing mathematical calculations and returning
one value Summary Columns :: For doing summary calculations such
as summations etc. Place holder Columns :: These columns are useful
for storing the value in a variable
722. For 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?
Yes
724. The join defined by the default data link is an outer join
yes or no?
Yes
731. You have just had to restore from backup and do not have
any control files. How would you go about bringing up this
database?
I would create a text based backup control file, stipulating where on
disk all the data files where and then issue the recover command with
the using backup control file clause.
746. How would you go about increasing the buffer cache hit
ratio?
Use the buffer cache advisory over a given workload and then query
the v$db_cache_advice table. If a change was necessary then I would
use the alter system set db_cache_size command.
749. How would you determine the time zone under which a
database was operating?
select DBTIMEZONE from dual;
762. Give two methods you could use to determine what DDL
changes have been made.
769. What view would you use to look at the size of a data file?
DBA_DATA_FILES
774. You have just compiled a PL/SQL package but got errors,
how would you view the errors?
SHOW ERRORS
781. Can one resize tablespaces and data files? (for DBA)
One can manually increase or decrease the size of a datafile from
Oracle 7.2 using the command.
ALTER DATABASE DATAFILE 'filename2' RESIZE 100M;
Because you can change the sizes of datafiles, you can add more
space to your database without adding more datafiles. This is
beneficial if you are concerned about reaching the maximum number
of datafiles allowed in your database.
Manually reducing the sizes of datafiles allows you to reclaim unused
space in the database. This is useful for correcting errors in
estimations of space requirements.
Also, datafiles can be allowed to automatically extend if more space is
required. Look at the following command:
CREATE TABLESPACE pcs_data_ts
DATAFILE 'c:\ora_apps\pcs\pcsdata1.dbf' SIZE 3M
AUTOEXTEND ON NEXT 1M MAXSIZE UNLIMITED
DEFAULT STORAGE (INITIAL 10240
NEXT 10240
MINEXTENTS 1
MAXEXTENTS UNLIMITED
783. What are the values that can be specified for OPTIMIZER
MODE Parameter ?
COST and RULE.
797. How does one backup a database using the export utility?
(for DBA
Oracle exports are "logical" database backups (not physical) as they
extract data and logical definitions from the database into a file. Other
backup strategies normally back-up the physical data files.
One of the advantages of exports is that one can selectively re-import
tables, however one cannot roll-forward from an restored export file.
To completely restore a database from an export file one practically
needs to recreate the entire database.
Always do full system level exports (FULL=YES). Full exports include
more information about the database in the export file than user level
exports.
798. What are the built_ins used the display the LOV?
799. How do you call other Oracle Products from Oracle Forms?
Run_product is a built-in, Used to invoke one of the supported oracle
tools products and specifies the name of the document or module to
be run. If the called product is unavailable at the time of the call,
Oracle Forms returns a message to the operator.
800. What is the main diff. bet. Reports 2.0 & Reports 2.5?
Report 2.5 is object oriented.
805. What does the term panel refer to with regard to pages?
A panel is the no. of physical pages needed to print one logical page.
807.What is a library?
A library is a collection of subprograms including user named
procedures, functions and packages.
808. What is an anchoring object & what is its use? What are
the various sub events a mouse double click event involves?
An anchoring object is a print condition object which used to explicitly
or implicitly anchor other objects to itself.
810. What are the various sub events a mouse double click
event involves? What are the various sub events a mouse
double click event involves?
Double clicking the mouse consists of the mouse down, mouse up,
mouse click, mouse down & mouse up events.
811. What is the use of break group? What are the various sub
events a mouse double click event involves?
A break group is used to display one record for one group ones. While
multiple related records in other group can be displayed.
814. What is STATSPACK and how does one use it? (for DBA
Statspack is a set of performance monitoring and reporting utilities
provided by Oracle from Oracle8i and above. Statspack provides
improved BSTAT/ESTAT functionality, though the old BSTAT/ESTAT
scripts are still available. For more information about STATSPACK, read
the documentation in file $ORACLE_HOME/rdbms/admin/spdoc.txt.
Install Statspack:
cd $ORACLE_HOME/rdbms/admin
sqlplus "/ as sysdba" @spdrop.sql -- Install Statspack -
sqlplus "/ as sysdba" @spcreate.sql-- Enter tablespace names when
prompted
Use Statspack:
sqlplus perfstat/perfstat
exec statspack.snap; -- Take a performance snapshots
exec statspack.snap;
815. What are the common RMAN errors (with solutions)? (for
DBA
Some of the common RMAN errors are:
RMAN-20242: Specification does not match any archivelog in the
recovery catalog.
Add to RMAN script: sql 'alter system archive log current';
RMAN-06089: archived log xyz not found or out of sync with catalog
Execute from RMAN: change archivelog all validate;
816. How can you execute the user defined triggers in forms
3.0 ?
Execute Trigger (trigger-name)
830. How does one manage Oracle database users? (for DBA
Oracle user accounts can be locked, unlocked, forced to choose new
passwords, etc. For example, all accounts except SYS and SYSTEM will
be locked after creating an Oracle9iDB database using the DB
839. What are the different objects that you cannot copy or
reference in object groups?
Objects of different modules
Another object groups
Individual block dependent items
Program units.
Backups in RMAN
Oracle backups in RMAN are of the following type
RMAN complete backup OR RMAN incremental backup
These backups are of RMAN proprietary nature
IMAGE COPY
The advantage of uing Image copy is its not in RMAN proprietary
format..
Backup Format
RMAN backup is not in oracle format but in RMAN format. Oracle
backup comprises of backup sets and it consists of backup pieces.
Backup sets are logical entity In oracle 9i it gets stored in a default
location There are two type of backup sets Datafile backup sets,
Archivelog backup sets One more important point of data file backup
sets is it do not include empty blocks. A backup set would contain
many backup pieces.
A single backup piece consists of physical files which are in RMAN
proprietary format.
With the new DURATION option for the RMAN BACKUP command, DBAs
can weigh backup performance against system service level
requirements. By specifying a duration, RMAN will automatically
calculate the appropriate backup rate; in addition, DBAs can optionally
specify whether backups should minimize time or system load.
Observation
Introduced in Oracle 8 it has become more powerful and simpler with
newer version of Oracle 9 and 10 g.
So if you really don't want to miss something critical please start using
RMAN.
851. Explain UNION,MINUS,UNION ALL, INTERSECT ?
INTERSECT returns all distinct rows selected by both queries.MINUS -
returns all distinct rows selected by the first query but not by the
second.UNION - returns all distinct rows selected by either queryUNION
ALL - returns all rows selected by either query, including all duplicates.
854. What kind of jobs can one schedule with OEM? (for DBA
ROLESystem Control :
ALTER SYSTEM.
859. How does one start the Oracle Intelligent Agent? (for DBA
One needs to start an OIA (Oracle Intelligent Agent) process on all
machines that will to be managed via OEM.
For OEM 9i and above:
Start the OEM console and create a new event. Select option "Enable
Unsolicited Event". Select test "Unsolicited Event". When entering the
parameters, enter values similar to these:
Event Name: /oracle/script/myalert
Object: *
Severity: *
Message: *
One can now write the script and invoke the oemevent command to
send alerts to the console. Look at this example: oemevent
/oracle/script/myalert DESTINATION alert "My custom error message"
where DESTINATION is the same value as entered in the "Monitored
Destinations" field when you've registered the event in the OEM
Console.
860. Where can one get more information about TCL? (for DBA
One can write custom event checking routines for OEM using the TCL
(Tool Command Language) language. Check the following sites for
more information about TCL:
. The Tcl Developer Xchange - download and learn about TCL
. OraTCL at Sourceforge - Download the OraTCL package
. Tom Poindexter's Tcl Page - Oratcl was originally written by Tom
Poindexter
861. Are there any troubleshooting tips for OEM? (for DBA
. Create the OEM repository with a user (which will manage the OEM)
and store it in a tablespace that does not share any data with other
database users. It is a bad practice to create the repository with SYS
and System.
. If you are unable to launch the console or there is a communication
problem with the intelligent agent (daemon). Ensure OCX files are
registered. Type the following in the DOS prompt (the current directory
should be $ORACLE_HOME\BIN:
C:\Orawin95\Bin> RegSvr32 mmdx32.OCX
867. How does one use the import/export utilities? (for DBA
Look for the "imp" and "exp" executables in your $ORACLE_HOME/bin
directory. One can run them interactively, using command line
parameters, or using parameter files. Look at the imp/exp parameters
before starting. These parameters can be listed by executing the
following commands: "exp help=yes" or "imp help=yes".
The following examples demonstrate how the imp/exp utilities can be
used:
exp scott/tiger file=emp.dmp log=emp.log tables=emp rows=yes
indexes=no
exp scott/tiger file=emp.dmp tables=(emp,dept)
imp scott/tiger file=emp.dmp full=yes
871. Can one monitor how fast a table is imported? (for DBA
If you need to monitor how fast rows are imported from a running
import job, try one of the following methods:
Method 1:
select substr(sql_text,instr(sql_text,'INTO "'),30) table_name,
rows_processed,
round((sysdate-to_date(first_load_time,'yyyy-mm-dd
hh24:mi:ss'))*24*60,1) minutes,
trunc(rows_processed/((sysdate-to_date(first_load_time,'yyyy-mm-dd
hh24:mi:ss'))*24*60)) rows_per_min
from sys.v_$sqlarea
where sql_text like 'INSERT %INTO "%'
and command_type = 2
and open_versions > 0;
For this to work one needs to be on Oracle 7.3 or higher (7.2 might also
be OK). If the import has more than one table, this statement will only
show information about the current table being imported.
Contributed by Osvaldo Ancarola, Bs. As. Argentina.
Method 2:
876. How does one use the SQL*Loader utility? (for DBA
One can load data into an Oracle database by using the sqlldr (sqlload
on some platforms) utility. Invoke the utility without arguments to get
a list of available parameters. Look at the following example:
sqlldr scott/tiger control=loader.ctl
This sample control file (loader.ctl) will load an external data file
containing delimited data:
load data
infile 'c:\data\mydata.csv'
into table emp
879. Can one load variable and fix length data records? (for
DBA
Yes, look at the following control file examples. In the first we will load
delimited data (variable length):
LOAD DATA
INFILE *
INTO TABLE load_delimited_data
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
( data1,
data2
)
BEGINDATA
11111,AAAAAAAAAA
22222,"A,B,C,D,"
If you need to load positional data (fixed length), look at the following
control file example:
LOAD DATA
INFILE *
INTO TABLE load_positional_data
( data1 POSITION(1:5),
data2 POSITION(6:15)
)
BEGINDATA
11111AAAAAAAAAA
22222BBBBBBBBBB
Can one skip header records load while loading?
Use the "SKIP n" keyword, where n = number of logical rows to skip.
Look at this example:
LOAD DATA
INFILE *
INTO TABLE load_positional_data
SKIP 5
( data1 POSITION(1:5),
data2 POSITION(6:15)
)
BEGINDATA
11111AAAAAAAAAA
22222BBBBBBBBBB
880. Can one modify data as it loads into the database? (for
DBA
Data can be modified as it loads into the Oracle Database. Note that
this only applies for the conventional load path and not for direct path
loads.
881.Can one load data into multiple tables at once? (for DBA
Look at the following control file:
LOAD DATA
INFILE *
REPLACE
INTO TABLE emp
WHEN empno != ' '
( empno POSITION(1:4) INTEGER EXTERNAL,
ename POSITION(6:15) CHAR,
deptno POSITION(17:18) CHAR,
mgr POSITION(20:23) INTEGER EXTERNAL
)
INTO TABLE proj
WHEN projno != ' '
( projno POSITION(25:27) INTEGER EXTERNAL,
empno POSITION(1:4) INTEGER EXTERNAL
)
882. What is the difference between boiler plat images and
image items?
885. Can one selectively load only the records that one need?
(for DBA
Look at this example, (01) is the first character, (30:37) are characters
30 to 37:
LOAD DATA
INFILE 'mydata.dat' BADFILE 'mydata.bad' DISCARDFILE 'mydata.dis'
APPEND
INTO TABLE my_selective_table
WHEN (01) <> 'H' and (01) <> 'T' and (30:37) = '19991217'
(
region CONSTANT '31',
service_key POSITION(01:11) INTEGER EXTERNAL,
call_b_no POSITION(12:29) CHAR
)
886. Can one skip certain columns while loading data? (for DBA
One cannot use POSTION(x:y) with delimited data. Luckily, from Oracle
8i one can specify FILLER columns. FILLER columns are used to skip
columns/fields in the load file, ignoring fields that one does not want.
Look at this example: -- One cannot use POSTION(x:y) as it is stream
data, there are no positional fields-the next field begins after some
delimiter, not in column X. -->
LOAD DATA
TRUNCATE INTO TABLE T1
FIELDS TERMINATED BY ','
( field1,
field2 FILLER,
field3
)
889. How can get SQL*Loader to COMMIT only at the end of the
load file? (for DBA
One cannot, but by setting the ROWS= parameter to a large value,
committing can be reduced. Make sure you have big rollback segments
ready when you use a high value for ROWS=.
891. How does one use SQL*Loader to load images, sound clips
and documents? (for DBA
SQL*Loader can load data from a "primary data file", SDF (Secondary
Data file - for loading nested tables and VARRAYs) or LOGFILE. The
LOBFILE method provides and easy way to load documents, images
and audio clips into BLOB and CLOB columns. Look at this example:
Given the following table:
CREATE TABLE image_table (
image_id NUMBER(5),
file_name VARCHAR2(30),
image_data BLOB);
Control File:
LOAD DATA
INFILE *
INTO TABLE image_table
REPLACE
FIELDS TERMINATED BY ','
(
image_id INTEGER(5),
file_name CHAR(30),
4.Can you have two functions with the same name in a PL/SQL
block ?
Yes.
5.Can you have two stored functions with the same name ?
Yes.
53.If all the values from a cursor have been fetched and
another fetch is issued, the output will be : error, last record
or first record ?
Last Record
54.A table has the following data : [[5, Null, 10]]. What will the
average function return ?
7.5
88.If you insert a row in a table, then create another table and
then say Rollback. In this case will the row be inserted ?
Yes. Because Create table is a DDL which commits automatically as
soon as it is executed. The DDL commits the transaction even if the
create statement fails internally (eg table already exists error) and not
syntactically.
90.What is a transaction ?
A transaction is a set of SQL statements between any two COMMIT and
ROLLBACK statements.
99.Can one use dynamic SQL within PL/SQL? OR Can you use a
DDL in a procedure ? How ?