Friday, February 17, 2012

My interview preparation questions and answers (Answers are not self prepared)) part 2:



 HI

Below content i am not prepared own, that content take from different sites for my interview preparation.

Some one diffidently useful those questions, that's why i posted in my blog.

About Oracle:

Oracle Database is the flagship relational database management system (RDBMS)
software product released by Oracle Corporation. Oracle Database is commonly referred
to as Oracle RDBMS or simply Oracle.
Oracle targets high-end workstations and minicomputers as the server platforms on
which to run its database systems. Along with Sun Microsystems, Oracle has long been
a champion of network computers. It now boasts that it was the world's first software
company to develop and deploy 100 percent Internet-enabled enterprise software across
its entire product line: database, server, enterprise business applications, and application
development and decision support tools. In fact, Oracle  CEO  Ellison has said, "If the
Internet turns out not to be the future of computing, we're toast. But if it is, we're golden."
What is Oracle table?
A table is the basic unit of data storage in an Oracle database. The tables of a database
hold all of the user accessible data. Table data is stored in rows and columns.

What is an Oracle view?
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.)

What are Schema Objects?

Schema objects are the logical structures that directly refer to the database's data. Schema
objects include tables, views, sequences, synonyms, indexes, clusters, database triggers,
procedures, functions packages and database links.

What is schema?
A schema is collection of database objects of a user.

Explain the relationship among database, tablespace and data file.
Each databases logically divided into one or more tablespaces one or more data files are
explicitly created for each tablespace.

What is SYSTEM tablespace and when is it created?
Every Oracle database contains a tablespace named SYSTEM, which is automatically
created when the database is created. The SYSTEM tablespace always contains the data
dictionary tables for the entire database.

What are the components of logical database structure of Oracle database?
There are tablespaces and database's schema objects.

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.
What is Mirrored on-line Redo Log ?
A mirrored on-line redo log consists of copies of on-line redo log files physically located
on separate disks, changes made to one member of the group are made to all members.

What is Full Backup?
A full backup is an operating system backup of all data files, on-line redo log files and
control file that constitute ORACLE database and the parameter.

What is a tablespace?
A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to
grouped related logical structures together.

Do View contain Data ?
Views do not contain or store data.

What is a Redo Log ?
The set of Redo Log files YSDATE,UID,USER or USERENV SQL functions, or the
pseudo columns LEVEL or ROWNUM.

Explain the relationship among Database, Tablespace and Data file.
Each databases logically divided into one or more tablespaces one or more data files are
explicitly created for each tablespace

What are Clusters?
Clusters are groups of one or more tables physically stores together to share common
columns and are often used together.

What is an Integrity Constrains?
An integrity constraint is a declarative way to define a business rule for a column of a
table.
What is Table?
A table is the basic unit of data storage in an ORACLE database. The tables of a database
hold all of the user accessible data. Table data is stored in rows and columns.

What is an Oracle sequence?
A sequence generates a serial list of unique numbers for numerical columns of a
database's tables.

What are the types of synonyms?
There are two types of synonyms private and public.

What is a private synonym?
Only its owner can access a private synonym.

What are synonyms used for?

•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.

How are the index updates?
Indexes are automatically maintained and used by Oracle. Changes to table data are
automatically incorporated into all relevant indexes.

What is Rollback Segment?
A Database contains one or more Rollback Segments to temporarily store "undo"
information.

How to define Data Block size?

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 can’t be changed latter.
What does ROLLBACK do?
ROLLBACK retracts any of the changes resulting from the SQL statements in the
transaction.

What is the use of Control File ?

When an instance of an ORACLE database is started, its control file is used to identify
the database and redo log files that must be opened for database operation to proceed. It is
also used in database recovery.

What are the Referential actions supported by FOREIGN KEY integrity constraint ?
UPDATE and DELETE Restrict - A referential integrity rule that disallows the update
or deletion of referenced data.
DELETE Cascade - When a referenced row is deleted all associated dependent rows are
deleted.

What are the type of Synonyms?

There are two types of Synonyms Private and Public.

What is an Index Segment?
Each Index has an Index segment that stores all of its data.

What are the different type of Segments?

Data Segment, Index Segment, Rollback Segment and Temporary Segment.

What is an Index?

An Index is an optional structure associated with a table to have direct access to rows,
which can be created to increase the performance of data retrieval. Index can be created
on one or more columns of a table.

What is an Extent?
An Extent is a specific number of contiguous data blocks, obtained in a single allocation,
and used to store a specific type of information.
What is a View?
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.)

What are the advantages of views?
Provide an additional level of table security, by restricting access to a
predetermined set of rows and columns of a table.

•Hide data complexity.
•Simplify commands for the user.
•Present the data in a different perspective from that of the base table.
•Store complex queries.

What is a synonym?
A synonym is an alias for a table, view, sequence or program unit.

What is a public synonym?
Any database user can access a public synonym.

What is an Oracle index?
An index is an optional structure associated with a table to have direct access to rows,
which can be created to increase the performance of data retrieval. Index can be created
on one or more columns of a table.

What is a Tablespace?
A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to
grouped related logical structures together.

What are the Characteristics of Data Files?
A data file can be associated with only one database. Once created a data file can't change
size. One or more data files form a logical unit of database storage called a tablespace.

What does a Control file Contain?
A Control file records the physical structure of the database. It contains the following
information.
Database Name, Names and locations of a database's files and redolog files.
Time stamp of database creation.

How are extents allocated to a segment?
Oracle8 and above rounds off extents to a multiple of 5 blocks when more than 5 blocks
are requested. If one requests 16K or 2 blocks (assuming a 8K block size), Oracle doesn't
round it up to 5 blocks, but it allocates 2 blocks or 16K as requested. If one asks for 8
blocks, Oracle will round it up to 10 blocks.
Space allocation also depends upon the size of contiguous free space available. If one asks
for 8 blocks and Oracle finds a contiguous free space that is exactly 8 blocks, it would
give it you. If it were 9 blocks, Oracle would also give it to you. Clearly Oracle doesn't
always round extents to a multiple of 5 blocks.
The exception to this rule is locally managed tablespaces. If a tablespace is created with
local extent management and the extent size is 64K, then Oracle allocates 64K or 8 blocks
assuming 8K-block size. Oracle doesn't round it up to the multiple of 5 when a tablespace
is locally managed.

What is a deadlock ? Explain
Two processes wating to update the rows of a table which are locked by the other process
then deadlock arises. In a database environment this will often happen because of not
issuing proper row lock commands. Poor design of front-end application may cause
this situation and the performance of server will reduce drastically. These locks will be
released automatically when a commit/rollback operation performed or any one of this
processes being killed externally.

No comments:

Post a Comment