Oracle Questions and Answers 4
Oracle Questions and Answers 4
3. What is a Tablespace?
6. What is schema?
Yes.
Synonyms are used to : Mask the real name and owner of an object.
Provide public access to an object
Provide location transparency for tables,views or program units of a
remote database.
Simplify the SQL statements for database users.
Hash clusters are better choice when a table is often queried with
equality queries. For such queries the specified cluster key value
is hashed. The resulting hash key value points directly to the area
on disk that stores the specified rows.
Private Database Link, Public Database Link & Network Database Link.
Public database link is created for the special user group PUBLIC. A
public database link can be used when any user in the
associated database specifies a global object name in a SQL statement
or object definition.
A data block size is specified for each ORACLE database when the
database is created. A database users and allocated free database
space in ORACLE datablocks. Block size is specified in INIT.ORA file
and cann't be changed latter.
Each Index has an Index segment that stores all of its data.
The Primary function of the redo log is to record all changes made to
data.
The Information in a redo log file is used only to recover the database
from a system or media failure prevents database data from being
written to a database's data files.
Database Name
Names and locations of a database's files and redolog files.
Time stamp of database creation.
50. What is the use of Control File ?
A rule defined on a column (or set of columns) in one table that allows
the insert or update of a row only if the value for the column
or set of columns (the dependent value) matches a value in a
column of a related table (the referenced value). It also
specifies the type of data manipulation allowed on referenced
data and the action to be performed on dependent data as a result of
any action on referenced data.
SYSTEM ARCHITECTURE :
100. What are the values that can be specified for OPTIMIZER MODE
Parameter ?
COST and RULE.
101.
Will the Optimizer always use COST-based approach
if
OPTIMIZER_MODE is set to "Cost'?
This value causes the optimizer to choose the rule_based approach for
all SQL statements issued to the instance regardless of the
presence of statistics.
103. What are the values that can be specified for OPTIMIZER_GOAL
parameter of the ALTER SESSION Command ?
110. What are the different types of PL/SQL program units that
can be defined and stored in ORACLE database ?
DATABASE SECURITY
124. What are the system resources that can be controlled through
Profile ?
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.
140. What are the different modes of mounting a Database with the
Parallel Server ?
144.WhatisOn-lineRedoLog?
The On-line Redo Log is a set of tow or more on-line redo files that
record all committed changes made to the database. Whenever a
transaction is committed, the corresponding redo entries temporarily
stores in redo log buffers of the SGA are written to an on-line
redo log file by the background process LGWR. The on-line redo log
files are used in cyclical fashion.
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.
Introduction to DBA
The memory structure that are used to store most queried data
from database. This helps up to improve database performance by
decreasing the amount of I/O performed against data file.
3. What is a Schema ?
5. What is clusters ?
It consists of
one or more data files.
one or more control files.
two or more redo log files.
The Database contains
multiple users/schemas
one or more rollback segments
one or more tablespaces
Data dictionary tables
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
Two processes wating to update the rows of a table which are locked by
the other process then deadlock arises.
MEMORY MANAGEMENT
9. What is SGA ? How it is different from Ver 6.0 and Ver 7.0 ?
The data dictionary cache is stored in an area in SGA called the Shared
SQL Pool. This will allow sharing of parsed SQL statements among
concurrent users.
Data segment are the physical areas within a database block in which
the data associated with tables and clusters are stored.
13. What are the factors causing the reparsing of SQL statements in
SGA?
Database buffers are cache in the SGA used to hold the data blocks that
are read from the data segments in the database such as tables,
indexes and clusters DB_BLOCK_BUFFERS parameter in INIT.ORA decides the
size.
Change made to entries are written to the on-line redo log files. So
that they can be used in roll forward operations during database
recoveries. Before writing them into the redo log files, they will
first brought to redo log buffers in SGA and LGWR will write
into files frequently.
LOG_BUFFER parameter will decide the size.
18. 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.
20. How will you force database to use particular rollback segment ?
22. How free extents are managed in Ver 6.0 and Ver 7.0 ?
23.Which parameter in Storage clause will reduce no. of rows per block?
PCTFREE parameter
30. How the space utilisation takes place within rollback segments ?
Transaction Begins.
36. How will you estimate the space required by a non-clustered tables?
Yes.
40. What is meant by Redo Log file mirrorring ? How it can be achieved?
Process of having a copy of redo log files is called mirroring.
It is the set of before image data blocks that contain rows that
are modified by a transaction.
Each Rollback Segment entry must be completed within one
rollback segment.
The tar command cannot be used for physical file backup, instead we can
use dd command which is less flexible and has limited recoveries.
47. List the factors that can affect the accuracy of the estimations ?
The space used transaction entries and deleted records does not become
free immediately after completion due to delayed cleanout.
Instead grant the ability to access the procedures that access the
tables.
50. What are the dictionary tables used to monitor a database spaces ?
DBA_FREE_SPACE
DBA_SEGMENTS
DBA_DATA_FILES.
52. What are the roles and user accounts created automatically with
the database ?
SYS user account - The DBA role will be assigned to this account.
All of the basetables and views for the database's dictionary are
store in this schema and are manipulated only by ORACLE.
SYSTEM user account - It has all the system privileges for the database
and additional tables and views that display administrative
information and internal tables and views used by oracle tools
are created using this username.
SQL * DBA - This allows DBA to monitor and control an ORACLE database.
Export (EXP) and Import (imp) utilities allow you to move existing
data in ORACLE format to and from ORACLE database.
55. What are the minimum parameters should exist in the parameter
file (init.ora) ?
Each server and background process can write an associated trace file.
When an internal error is detected by a process or user
process, it dumps information about the error to its trace. This can
be used for tuning the database.
Roles are the easiest way to grant and manage common privileges
needed by different groups of database users.
Assign each role to group of users. This will simplify the job of
assigning privileges to individual users.
58. What are the steps to switch a database's archiving mode between
NO ARCHIVELOG and ARCHIVELOG mode ?
60. How can we specify the Archived log file name format and
destination ?
Time the references to occur when master tables are not in use.
Peform the reference the manually immdiately locking the master
tables. We can join tables in snopshots by creating a complex
snapshots that will based on the master tables.
We cannot specify snapshot log name because oracle uses the name of
the master table in the name of the database objects that support its
snapshot log.
- Logical Backups
- Cold Backups
- Hot Backups (Archive log)
Taking backup of archive log files when database is open. For this
the ARCHIVELOG mode should be enabled. The following files need to
be backed up.
All data files. All Archive log, redo log files. All control files.
The name of the file which log of the export will be written.
2. What is a transaction ?
TRUNCATE commits after deleting entire table i.e., can not be rolled
back. Database triggers do not fire on TRUNCATE
INSTR (String1,String2(n,(m)),
INSTR returns the position of the mth occurrence of the string
2 in
string1. The search begins from nth position of string1.
Using ROWID.
CONSTRAINTS
Only one LONG columns is allowed. It is not possible to use LONG column
in WHERE or ORDER BY clause.
24. How to access the current value and next value from a sequence ?
Is it possible to access the current value in a session before
accessing next value ?
If changes are made to the tables which are base tables of a view will
the changes be reference on the view.
3. Name the two files that are created when you generate the form give
the filex extension ?
BLOCK
False.
6. Can we create two blocks with the same name in form 3.0 ?
No.
8. What is a Trigger ?
A piece of logic that is executed at or triggered by a SQL *forms
event.
1. Navigational Triggers.
2. Transaction Triggers.
Function Key
Key-function
Key-others
Key-startup
11. What is the difference between a Function Key Trigger and Key
Function Trigger ?
It fires when a value in a field has been changed and the field
status is changed or new and the key has been pressed. If the
field status is valid then any further change to the value in the
field will not fire the on-validate-field trigger.
17. A query fetched 10 records How many times does a PRE-QUERY Trigger
and POST-QUERY Trigger will get executed ?
When you changes the Existing value to null, the On-validate field
trigger will fire post change trigger will not fire. At the time of
execute-query post-chage trigger will fire, on-validate field trigger
will not fire.
Post-field trigger fires whenever the control leaving from the filed.
Post-change trigger fires at the time of execute-query procedure
invoked or filed validation status changed.
No.
No.
25. How can you execute the user defined triggers in forms 3.0 ?
Execute_Trigger (trigger-name)
Navigational Trigger.
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.
No.
Anchor-view
Resize -View
Move-View.
1. Error_Code
2. Error_Text
3. Form_Failure
4. Form_Fatal
5. Message_Code
Post writes data in the form to the database but does not perform
database commit
Commit permenently writes data in the form to the database.
41. What the PAUSE package procedure does ?
43. What package procedure used for invoke sql *plus from sql *forms ?
False.
True.
46. When the form is running in DEBUG mode, If you want to examine
the values of global variables and other form variables, What package
procedure command you would use in your trigger text ?
Break.
SYSTEM VARIABLES
1. System.block_status
2. System.current_block
3. System.current_field
4. System.current_value
5. System.cursor_block
6. System.cursor_field
7. System.field_status.
User Exits :
Page :
Unlimited.
a. True.
56. Deleting a page removes information about all the fields in that
page ?
a. True. b. False
a. True.
Popup Window :
Alert :
PL/SQL
Basiscs of PL/SQL
1. What is PL/SQL ?
PL/SQL is a procedural language that has both interactive SQL
and procedural programming language constructs such as iteration,
conditional branching.
Datatypes PL/SQL
Some scalar data types such as NUMBER, VARCHAR2, DATE, CHAR, LONG,
BOOLEAN.
Some composite data types such as RECORD & TABLE.
6. What are % TYPE and % ROWTYPE ? What are the advantages of using
these over datatypes?
The advantages are : I. Need not know about variable's data type
ii. If the database definition of a column in a table changes, the
data type of a variable changes accordingly.
There are two types of cursors, Implict Cursor and Explicit Cursor.
PL/SQL uses Implict Cursors for queries.
User defined cursors are called Explicit Cursors. They can be declared
and used.
DECLARE CURSOR cursor name, OPEN cursor name, FETCH cursor name
INTO or Record types, CLOSE cursor name.
The cursor having query as SELECT .... FOR UPDATE gets closed
after COMMIT/ROLLBACK.
The cursor having query as SELECT.... does not get closed even
after COMMIT/ROLLBACK.
Database Triggers
If FOR EACH ROW clause is specified, then the trigger for each Row
affected by the statement.
If WHEN clause is specified, the trigger fires according to the
retruned boolean value.
19. What are two virtual tables available during database trigger
execution ?
I & ii.
Exception :
DUP_VAL_ON_INDEX
NO_DATA_FOUND
TOO_MANY_ROWS
INVALID_CURSOR
INVALID_NUMBER
LOGON_DENIED
NOT_LOGGED_ON
PROGRAM-ERROR
STORAGE_ERROR
TIMEOUT_ON_RESOURCE
VALUE_ERROR
ZERO_DIVIDE
OTHERS.
25. What are the return values of functions SQLCODE and SQLERRM ?
SQLCODE returns the latest code of the error that has occured.
SQLERRM returns the relevant error message of the SQLCODE.
30. What are the modes of parameters that can be passed to a procedure
?
IN,OUT,IN-OUT parameters.
BEGIN
Executable statements.
Exception.
exception handlers
end;
34. Explain how procedures and functions are called in a PL/SQL block ?
The two parts of package are PACKAGE SPECIFICATION & PACKAGE BODY.
Package Specification contains declarations that are global to the
packages and local to the schema.
Package Body contains actual procedures and local declaration of
the procedures and cursor declarations.
39. How packaged procedures and functions are called from the
following?
a. Stored procedure or anonymous block
b. an application program such a PRC *C, PRO* COBOL
c. SQL *PLUS
FORMS4.0
Display items are similar to text items but store only fetched or
assigned values. Operators cannot navigate to a display item or edit
the value it contains.
16. How many maximum number of radio buttons can you assign to a
radio group?
17. can you change the default value of the radio button group at run
time?
No.
Visual Attributes.