Professional Documents
Culture Documents
ORACLE database is comprised of three types of files. One or more Data files, two
are more Redo Log files, and one or more Control files.
3. What is a Tablespace?
Each databases logically divided into one or more tablespaces One or more data files
are explicitly created for each tablespace.
6. What is schema?
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.
Yes.
Yes.
16. What is a Synonym ?
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.
Indexes are automatically maintained and used by ORACLE. Changes to table data
are automatically incorporated into all relevant indexes.
A database link is a named object that describes a "path" from one database to
another.
Private Database Link, Public Database Link & Network Database Link.
Private database link is created on behalf of a specific user. A private database link
can be used only when the owner of the link specifies a global object name in a SQL
statement or in the definition of the owner's views or procedures.
In Circumstances, all of the data for a row in a table may not be able to fit in the
same data block. When this occurs , the data for the row is stored in a chain of data
block (one or more) reserved for that segment.
Every ORACLE database has one or more physical data files. A database's data files
contain all the database data. The data of logical database structures such as tables
and indexes is physically stored in the data files allocated for a database.
The set of Redo Log files for a database is collectively known as the database's redo
log.
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 the prevents database data from being written to a database's data
files.
A Control file records the physical structure of the database. It contains the following
information.
i. Database Name
ii. Names and locations of a database's files and redolog files.
iii. Time stamp of database creation.
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.
35. What is a Data Dictionary ?
The data dictionary of an ORACLE database is a set of tables and views that are used
a read-only reference about the database.
It stores information about both the logical and physical structure of the database,
the valid users of an ORACLE database, integrity constraints defined for tables in the
database and space allocated for a schema object and how much of it is being used.
Prepare phase - The global coordinator (initiating node) ask a participants to prepare
(to promise to commit or rollback the transaction, even if there is a failure)
Commit - Phase - If all participants respond to the coordinator that they are
prepared, the coordinator asks all nodes to commit the transaction, if all participants
cannot prepare, the coordinator asks all nodes to roll back the transaction.
SQL *NET is ORACLE's mechanism for interfacing with the communication protocols
used by the networks that facilitate distributed processing and distributed databases.
It is used in Clint-Server and Server-Server communications.
- to collect statisties about object used by the optimizer and store them in the data
dictionary.
- to delete statistics about the object used by object from the data dictionary.
- to validate the structure of the object.
- to identify migrated and chained rows of the table or cluster.
Database on other servers can be updated and those transactions can be grouped
together with others in a logical unit.
Database uses a two phase commit.
A flag to indicate whether grants on databse objects will be exported or not. Value is
'Y' or
'N'.
Flag to indicate whether table rows should be exported. If 'N' only DDL statements
for the
databse objects will be created.
For Incremental exports, the flag indirects whether a record will be stores data
dictionary
tables recording the export.
A flag to indicate whether the import should ignore errors encounter when issuing
CREATE
commands.
A flag to indicate whether rows should be imported. If this is set to 'N' then only DDL
for database objects will be exectued.
A temporary tablespace is used for temporary objects such as sort structures while
permanent tablespaces are used to store those objects meant to be used as the true
objects of the database.
61. What is the difference between the SQL*Loader and IMPORT utilities?
These two Oracle utilities are used for loading data into the database. The difference
is that the import utility relies on the data being produced by another Oracle utility
EXPORT while the SQL*Loader utility allows data to be loaded that has been
produced by other utilities from different data sources just so long as it conforms to
ASCII formattsed or delimited files.
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.
What are % TYPE and % ROWTYPE ? What are the advantages of using
these over datatypes?
% TYPE provides the data type of a variable or a database column to that
variable.
% ROWTYPE provides the record type that represents a entire row of a
table or view or
columns selected in the cursor.
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.
What are the cursor attributes used in PL/SQL ?
GLOBAL_NAME
-------------------------------------------------------
tifa.prod.com.sg
SQLLOADER:
SQL*Loader is a bulk loader utility used for moving data from external files into the
Oracle database. SQL*Loader supports various load formats, selective loading, and
multi-table loads.
Can I load more than one input file at the same time?
Yes.
LOAD DATA
INFILE 'C:empcsv1.csv'
INFILE 'C:empcsv2.csv'
INFILE 'C:empcsv3.csv'
TRUNCATE INTO TABLE EMP
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
EMPNO,
ENAME,
SAL
)
find out the objects created in SYSTEM tablespace other than SYSTEM, SYS
users?
ora9i$maran> SELECT TABLE_NAME, OWNER from dba_tables
2 where TABLESPACE_NAME= 'SYSTEM' and
3 OWNER NOT IN ('SYSTEM','SYS');
TABLE_NAME OWNER
------------------------------------------------------------
COUNTER_MAS$ TIFA
RIGHTS_DET TIFA
2 rows selected.
ora9i$maran>