Oracle Flashcards
What is pipeline view?
A view that get data from other views.
What is materialised View?
Materialised view (MV) is similar to a view but the data is actually stored on disk. Often used for summary and Pre-joined tables.
What are the tools for Oracle?
TOAD, PUTTY Linux/Unix, Oracle forms, Oracles reports.
How to get date and time?
Sysdate
What is a snapshot?
snapshot is just like a print screen, read only.
Difference between ref cursor and nomral cursor?
Normal Cursor is static and can be associated with only a single query where as ref cursor is dynamic and can be associated with multiple queries.
Refence Curso is basically used to pass result set to a procedure or function. Can be Strong Type or Weak Type.
What is the difference between Strong and Weak Types?
?
What is Explain Plan?
Just like SQL Server Excuation plan.
Which is faster Truncate or Delete?
Truncate will be faster because delete will have to update logs and do overhead operations and Truncate doesn not.
Where to find database errors?
Alert Log
What is DDL?
Data Definition Language (DDL) statements are used to define the database structure or schema.
Some examples:
CREATE - to create objects in the database
ALTER - alters the structure of the database
DROP - delete objects from the database
TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
COMMENT - add comments to the data dictionary
RENAME - rename an object
What is DML?
Data Manipulation Language (DML) statements are used for managing data within schema objects.
Some examples: SELECT - retrieve data INSERT - insert data into a table UPDATE - updates existing data DELETE - deletes records MERGE - UPSERT operation (insert or update) CALL - call a PL/SQL or Java subprogram EXPLAIN PLAN - explain access path to data LOCK TABLE - control concurrency
Why used an Index?
Faster Access to the data.
What is Fact Table?
A fact table contains measurements.
What is a Dimension Table?
A dimenension table will contain data that will help describe the fact tables.
List some contraints.
Primary or Unique Key
Referential Integrity
Not Null Contraint
Value contraint - to check a column value against a specific set of values.
What type of index shoould you use for a fact table?
A bitmap index.
How to drop and recreate a table children records?
Drop the foreign key constraits first. Drop and recreated, then add constraits back.
How to get the timezone?
Use dbtimezone.
What is the use of Global_Names?
To ensure the use of consistent conventions for database and links in the a networked environment.
How would you encrypt PL/SQL?
Use WRAP.
What is a Package?
Package is the collections of functions, procedures, variables which can be logically grouped together.
What is function?
Function must return a value. can be called inside a query.
What is a procedure?
procedure may or may not return a value.
Explain the use of table functions?
Table functions are designed to return a set of rows through PL/SQL logic but are intended to be used as a normal table or view in a SQL statement. They are also used to pipeline information in an ETL process.
Name three advisory statistics you can collect?
fer Cache Advice, Segment Level Statistics, & Timed Statistics
When a user process fails, what background process cleans up after it?
PMON
What background process refreshes materialized views?
Job Queue process (CJQ)
What does coalescing a tablespace do?
Coalesce simple takes contigous free extents and makes them into a single bigger free extend. Defrag?
Difference between Temp and permanent Tablespace?
Temp get cleared once the transaction is done where Permanent retains the data.
Two methods determine DDL changes?
You could use Logminer or Streams
How to rebuild an index?
ALTER INDEX Index_Name REBUILD.
Explain partitionary.
A Table partition is also a table segment and by using this techique we can enhance performance on a table.
You just compiled a PL/SQL packages and you get Errors, how to view the errors?
show errors.
Difference between SQL*Loader and IMPORT utilities?
SQL*Loader loads external data which is in OS files to oracle database tables while IMPORT utility imports data only which is experoted by EXPORT utility of Oracle database.
name two files used for network connection to a database?
TNSNames.ORA and SQLNET.ORA
What is mutating table error?
happens with TRIGGERS while trying to update a row it is using.
Describe %RowType and %Type in PL/SQL?
%RowType allows you to associate a variable with an entire table row. The %Type associates a variable with a single column type.
Developer’s Packages?
DBMS_SQL DBMS_PIPE DBMS_Transaction DBMS_Lock DBMS_ALERT DBMS_OUTPUT DBMS_Job DBMS_Utility DBMS_DDL
Describe the use of PL/SQL Tables.
PL/SQL tables are scalar arrays that be referenced by a binary integer. They can be used to hold values for use in later queires or calculations. In oracle 8 they will be able to be of the %RowType designation or RECORD
Similar to Table variable is SQL Server.
When is a DECLARE statement needed?
The DECLARE statement is used in PL/SQL anonymous block such as with stand alone, non-stored PL/SQL procedures. It must come first in a PL/SQL stand Alone file if it is used.
What is an Anonymous block?
An anonymous block is an unnamed sequence of actions. Since they are unnamed, anonymous blocks cannot be referenced by other program units.
In contrast to anonymous blocks, stored/ named code blocks include Packages, Procedures, and Functions.
What are SQLCODE and SQLERRM and why are the important for PPL/SQL developers?
SQLCODE Returns the ballue of the error number for the last error encountered. The SQLERRM returns the actual error message for the last error encountered.
Simary to SQL Server Try and CATCH