Professional Documents
Culture Documents
General Interview Questions
General Interview Questions
Oracle 8i -
It is a DB of internet computing , It changes the of information managed and accessed to
meet the demandof internet age.
-- Significant new feature for OLTP(Online trans Processing) and data ware housing
Appl.
-- To mange all types of datain web site.
-- iFS Internet file Syatem
-- interMedia to manage and access multimedia data,audio,video
-- Support to java(to install JVM on server)
-- Security enhancement(authentication and authorization,centralizing user management)
Oracle 8(ORDBMS) -
-Parrallel enhancement ,faster connection
-Table partitioning , Connection inc to 30000 ,Table column upto 1000
-DB size inc from few tera byte to 10 tera. , Data file inc 65,533
-Support MTS,provides LOB
Oracle Start -
1. Oracle instance start -Allocates SGA and start BAckground processes.
2. Mount Oracle DB-Method of Associating DB with previous started instance
3.Opening DB-To make available.
Normalization -
It's a technique thr. which we can design the DB.
During normalization dependancies can be identified which can cause pbs during deletion
& updation .It is used in simplifing the structure of table.
1NF-Unnorma;ised data transfer to normalised form.
2NF-Functional dependancies can be find out & decompose the table without loss of
data.
3NF-Transist dependancies ,Every non key attrbute is functionally dependant on just PK.
4NF(BCNF)-The relation which has multiple candidate keys ,then we have to go for
BCNF.
Denormalization-
At the same time when information is required from more than one table at faster rate
then it is wiser to add some sort of dependancies.
Rooling Forward -To reapply to Data file to all changes that are recorded in Redo log file
due to which datafile contains commited & uncommited dat.
Forward Declaration-To declare variable and procedures before using it.
2- Tier Arch. Disadv-When Business Rule changes.
PL/SQL Record-To represent more than one row at time.
PL/SQL Table -To define single variable comprises several data element.
To delete define one more empty table and assign it.
Tablespace -
Profile-To control system resources ,memory ,diskspace and CPU time.
We can find rows effected by %rowcount.
Data Binding-Dividing the cursor in appl as per select stamt.
Trancate -Faster than delete ,doesn't fire ny DB trigger ,Allocate space ,No roolback.
Defered Integrity constraints-When we refere PK in the same table where we defined .
Cascading trigger-
Temporary Table-Delete operation table.
Log Table-to store information abt error.
Coordinity-
Err Trap -To trap error use SQLERRM,SQLCODE
Modularity-PL/SQL allows to create program module to improve software reliability and
to hide complexity
Positional and Named Notation -
The actual arguments are associaed with formal arguments by position k/s Positional
Notation.It's commonly used.
A Trigger doesn't accept argument & have same name as table or procedure as it exist in
seperate namespace.
How we ref FK in Sql -Join Condition.
Security/Lock-
Shared/exclusive -When 2 transaction wants to read/write from db at the same time.
Dead- 1trans updates emp and dep
2 trans update dep and emp
TO add a not null column to a table which has already some records -
Alter table a
Add(b number default 1 not null)
Sequence- Start with,increment by,Cache/No cache,Order/No order,Max,Min
ER Dia.- Entity Relation Dia.
Set Transaction -To set a current transaction online offline
Oracle err-
ORA-06500 stiorage err
ORA-00923 from keyword not found
ORA-06501program err
ORA-00904 Invalid Col
ORA-00001Uk violated.
Mutating/Constraining Err/Table
Diff of where and group by
Connect,Allocate.Analyse Command.
Queries--
1. 3rd Max
select distinct sal
from emp a
where 3=(select count(distinct sal)
from emp b
where a.sal=<b.sal)
3. First 5 Max No
select sal
from (select abs(-sal) sal
from emp
group by -sal)
where rownum<6
Views--
-No Aggr function,group by,having
-U/D without PK but not Insert.
-Join -No DML
-No join-DML
Index -are used for row selection in where and order by only if indexing on column
You can launch the DBA Studio or the individual tools directly from the Windows NT
Start menu. Or, you can use the following syntax to launch them from a command line
prompt:
oemapp tool_name
DBA?
If to_date(sysdate,'DAY')='Tuesday' then ..
Buffer Cache-To improve data block recently used by user in order to improve the
performance.
Ordinality-Emp, Expences-Emp may expense sheet and Expense sheet has only one Emp.
This fact k/s Referred Ordinality.
Three Steps in creating DB.--
-Creating physical location for data in tables and indexes to be stored in DB.
-To create the file that still store log entries.
-To create logical structure of data dictionary.
This is accomplished by create DB
1. Back up existing DB.
2.Create or Edit the init.ora file
3.Varify the instance name
4. Start Application management DB tool.
5.start instance
6.Create and Backup the new DB.
Control file -250K
Oracle Administration Assistant for W-NT is a DB management tool that enables to
create DB administartor, operator, Users and role. To manage Oracle DB services, DB
start up, shut down, Edit registry parameter setting, views oracle process information.
Database Configuration Assistant -To create DB
Oracle environment-
OLTP-Many users can read and update, hight response time.
DSS-Read only.
Hybrid-both OLTP & DSS App. are running with this App.
Init.ora-is a parameter file like DB_NAME, CONTROL_FILE, DB_BLOCK _SIZE
RowID-BlockIDRowIdDatafileId
Cluster Segment-To support use of cluster on the DB.
Hash Cluster-By placing data in close proximity k/s Hashing.
Optimization-
Decides line of execution of query.
First apply condition and then make Cartesian product. The cost can reduce by reducing
no of rows.
Oracle ways for optimization-
-Evaluation of expression and condition amt>500/100--amt>5
Like convert to equal
IN - OR condition
Any -OR
Between/ALL -AND
NOT-Avoid
Transitivity-where a.id=b.id and a.id=1 use a.id=1 and b.id =1
Merging views
Index column be in order by clause.
The UTLBSTAT and UTLESTAT script to get general overview of database 's
performance over a certain period of time.
UTLBSTAT creates table and views containing cumulative database performance
summary information at the time when the script runs .All the objects create by
UTLBSTAT contain word login.
Utlbstat.sql
UTLESTAT creates table and views containing cumulative database performance
summary information at the time when the script runs .All the objects create by
UTLESTAT contain word end.
UTLESTAT spools the results of these SQL statements to a file called REPORT.TXT
Utlestat.sql
The shared pool is one of the memory structures in SGA .It is comprised of the data
dictionary and the library cache. Check v$sgastat
The data dictionary cache buffers data dictionary objects that contain data about tables,
indexes, users and all other objects.
The Library Cache/SQL Cache buffers previously executed queries, so that they need not
be reloaded and reparsed if user calls them again.
Otherwise if the information is not in the buffer then oracle must get it from disk.
The V$LIBRAY CACHE View stores performance data for library cache and
V$ROWCACHE view stores performance data for the data dictionary cache.
Redo Log --
Oracle 8 stores all changes to the database, even uncommitted changes, in the redo log
files.
LGWR writes .
By querying the V$SESSION view , we can determine who is logged on ,as well as
information such as the time of logon .
Unbalanced Index ?
if we do have lot on index on a table and we are doing I/U/D frequently then there is a
problem of disk contention . To check this problem sees the BLEVEL value in
DBA_INDEXES and if it is 1,2,3,4 then it?s ok else rebuild the index .
Execute utlchain.sql
1. Describe the purpose of the db architecture in the Oracle db as part of the logical
structure.
2. Describe the events that occur during MOUNT in the Oracle db start-up procedure.
Report message to a moderator