Infolinks

Showing posts with label SPOA. Show all posts
Showing posts with label SPOA. Show all posts

Thursday, 21 June 2012

Types of Invoices in Oracle Account Payables

 Types of Invoices in Oracle Account Payables


Following are the types of Invoices In oracle Applications Account Payables Module

1] Standard
An invoice from a supplier representing an amount due for goods or services 
purchased. Standard invoices can be either matched to a purchase order or not matched.

2] Credit Memo
A memo from a supplier representing a credit amount toward goods or services.

3] Debit Memo
An invoice you enter to record a credit for a supplier who does not send you a credit memo.

4] Mixed
An invoice type you enter for matching to both purchase orders and invoices. You can enter either a positive or a negative amount for a Mixed invoice type.

5] Prepayment
A type of invoice you enter to pay an advance payment for expenses to a supplier or employee.

6] Expense Report
An invoice representing an amount due to an employee for business-related expenses.

7] Withholding Tax
An invoice you enter to remit taxes withheld to the appropriate tax authority.

8] Interest
If you allow interest invoices, payables will automatically calculate interest for overdue invoices and create interest invoices for selected suppliers.

9] Retainage Release
Invoices created for complex work and advance contract financing.

10] Transportation Invoices
Invoices from freight payment

SQL Server DBA interview questions


SQL Server DBA interview questions


What are the steps to take to improve performance of a poor performing query?
  • Maximum use of indexes, stored procures should be done.
  • Avoid excessive use of complicated joins and cursors.
  • Avoid using conditional operators using columns of different tables.
  • Make use of computed columns and rewriting the query.

What is a deadlock and what is a live lock? How will you go about resolving deadlocks?
A deadlock occurs when two or more processes waits for a resource that is acquired by or is under the control of another process. A live lock is similar to a deadlock except the process states keeps changing. The result of such state is that none of the process will be complete.
Deadlock detection finds and resolves deadlocks. A WFG strategy is followed. WFG is wait for graph. In WFG, processes are represented by nodes while dependencies are represented by edges. Thus, if process A is waiting for a resource held by process B, there is an edge in the WFG from the node for process A to the node for process B. a cycle is this graph is a deadlock. WFG constantly checks for cycles or when a process is blocked and adds a new edge to the WFG.   When a cycle is found, a victim is selected and aborted.

What is blocking and how would you troubleshoot it?
Blocking occurs when two or more rows are locked by one SQL connection and a second connection to the SQL server requires a conflicting on lock on those rows. This results in the second connection to wait until the first lock is released.
Troubleshooting blocking:
  • SQL scripts can be written that constantly monitor the state of locking and blocking on SQL Server
  • The common blocking scenarios must be identified and resolved.
  • The scripts output must be checked constantly,
  • The SQL profilers data must be examined regularly to detect blocking.
Explain the different types of BACKUPs available in SQL Server.
Complete database backup: This type of backup will backup all the information in the database. Used most commonly for disaster recovery and takes the longest time to backup.
Differential databse backup: The database is divided into partitions that have been modified since last complete backup. Most suitable for large databases. The most recent differential backup contains the changes from previous backups.
Transaction log backups: Backups only the changes logged in the transaction log. The transaction log has all changes logged about a database. Once the changes are accommodated on the database, the log is truncated or backed up.
File/File Group backups: used to recover individual files or file groups. Each filegroup can be individually backed up. This helps in recovery only the required file or filegroup for disaster recovery.

What is database isolation in SQL Server?
Isolation in database defines how and when changes made by one transaction can be visible to other transactions. Different isolation levels are:
  • Serializable
  • Repeatable read
  • Read committed
  • Read uncommitted

What is a Schema in SQL Server 2005? Explain how to create a new Schema in a Database?
A schema is used to create database objects. It can be created using CREATE SCHEMA statement. The objects created can be moved between schemas. Multiple database users can share a single default schema.
CREATE SCHEMA sample;
Table creation
Create table sample.sampleinfo
{
id int primary key,
name varchar(20)
}

Explain how to create a Scrollable Cursor with the SCROLL Option.
Using the SCROLL keyword while declaring a cursor allows fetching of rows in any sequence
Example:
DECLARE employee_curs SCROLL CURSOR FOR SELECT * FROM employee;
The active set of the cursor is stored can be accessed in any order without the need of opening and closing the cursor. The Scroll cursors can be set for select and function cursors but not insert or update statements.

Explain how to create a Dynamic Cursor with the DYNAMIC Option.
When a cursor is declared as DYNAMIC, the cursor reflects all changes made to the base tables as the cursor is scrolled around.
Declare cursor_name cursor
[ STATIC | KEYSET | DYNAMIC | FAST_FORWARD ]
FOR select_statement
The dynamic option does not support ABSOLUTE FETCH.

What are database files and filegroups?

Database files are used for mapping the database over some operating system files. Data and log information are separate. SQL server database has three types of database files:

Primary: starting point of a database. It also points to other files in database. Extension: .mdf
Secondary: All data files except primary data file is a part of secondary files. Extension: .ndf
Log files: All log information used to recover database. Extension: .ldf


Describe in brief Databases and SQL Server Databases Architecture.

SQL Server consists of a set of various components which fulfill data storage and data analysis needs for enterprise applications. Database architecture: All the data is stored in databases which is organized into logical components visible to the end users. It’s only the administrator who needs to actually deal with the physical storage aspect of the databases, whereas users only deal with database tables.

Every SQL Server instance has primarily 4 system database i.e. master, model, tempdb and msdb. All other databases are user created databases as per their needs and requirements.

A single SQL Server instance is capable of handling thousands of users working on multiple databases.

Linux interview questions


Linux interview questions


What is Kernel? Explain the task it performs. 
Kernel is used in UNIX like systems and is considered to be the heart of the operating system. It is responsible for communication between hardware and software components. It is primarily used for managing the systems resources as well.
Kernel Activities:
The Kernel task manager allows tasks to run concurrently.
Managing the computer resources: Kernel allows the other programs to run and use the resources

Resources include i/o devices, CPU, memory.
Kernel is responsible for Process management. It allows multiple processes to run simultaneously allowing user to multitask.
Kernel has an access to the systems memory and allows the processes to access the memory when required.
Processes may also need to access the devices attached to the system. Kernel assists the processes in doing so.
For the processes to access and make use of these services, system calls are used.
What is Linux Shell? What is Shell Script?
Linux shell is a user interface used for executing the commands. Shell is a program the user uses for executing the commands. In UNIX, any program can be the users shell. Shell categories in Linux are:
Bourne shell compatible, C shell compatible, nontraditional, and historical
A shell script, as the name suggests, is a script written for the shell. Script here means a programming language used to control the application. The shell script allows different commands entered in the shell to be executed. Shell script is easy to debug, quicker as compared to writing big programs. However the execution speed is slow because it launches a new process for every shell command executed. Examples of commands are cp, cn, cd.
What are Pipes? Explain uses of pipes.
A pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another. UNIX shell has a special syntax for creation of pipelines. The commands are written in sequence separated by |. Different filters are used for Pipes like AWK, GREP.
e.g. sort file | lpr ( sort the file and send it to printer)
Uses of Pipe
Several powerful functions can be in a single statement
Streams of processes can be redirected to user specified locations using >

Explain trap command; shift Command, getopts command of linux.
Trap command: controls the action to be taken by the shell when a signal is received.
Trap [OPTIONS] [ [arg] signspec..]
Arg is the action to be taken or executed on receiving a signal specified in signspec.
e.g. trap “rm $FILE; exit” // exit (signal) and remove file (action)
Shift Command:  Using shift command, command line arguments can be accessed. The command causes the positional parameters shift to the left. Shift [n] where n defaults to 1. It is useful when several parameters need to be tested.
Getopts command: this command is used to parse arguments passed. It examines the next command line argument and determines whether it is a valid option
Getopts {optstring} {variable1}. Here, optsring contains letters to be recognized if a letter is followed by a colon, an argument should be specified. E.g (whether the argument begins with a minus sign and is followed by any single letter contained inside options ) If not, diagnostic messages are shown. It is usually executed inside a loop.
What Stateless Linux server? What feature it offers?
A stateless Linux server is a centralized server in which no state exists on the single workstations. There may be scenarios when a state of a partilcuar system is meaningful (A snap shot is taken then) and the user wants all the other machines to be in that state. This is where the stateless Linux server comes into picture.
Features:
It stores the prototypes of every machine
It stores snapshots taken for those systems
It stores home directories for those systems
Uses LDAP containing information of all systems to assist in finding out which snapshot (of state) should be running on which system.

What does nslookup do? Explain its two modes.
Nslookup is used to find details related to a Domain name server. Details like IP addresses of a machine, MX records, servers etc. It sends a domain name query packet to the corresponding DNS.
Nslookup has two modes. Interactive and non interactive. Interactive mode allows the user to interact by querying information about different hosts and domains.
Non interactive mode is used to fetch information about the specified host or domain.
Interactive mode:
Nslookup [options] [server]

What is Bash Shell?
Bash is a free shell for UNIX. It is the default shell for most UNIX systems. It has a combination of the C and Korn shell features.  Bash shell is not portable. any Bash-specific feature will not function on a system using the Bourne shell or one of its replacements, unless bash is installed as a secondary shell and the script begins with #!/bin/bash. It supports regular and expressions. When bash script starts, it executes commands of different scripts.
Explain Some Network-Monitoring Tools in Linux: ping, traceroute, tcpdump, ntop
Network monitoring tools are used to monitor the network, systems present on the network, traffic etc.
Ping: Ping command is used to check if the system is in the network or not. To check if the host is operating.
e.g. ping ip_address
When the command is executed, it returns a detailed summary of the host. Packets   sent, received, lost by estimating the round trip time.
Traceroute : the command is used to trace the path taken by the packet across a network. Tracing the path here means finding out the hosts visited by the packet to reach its destination. This information is useful in debugging. Roundtrip time in ms is shown for every visit to a host.
Tcpdump: commonly used to monitor network traffic. Tcdump captures and displays packet headers and matching them against criteria or all. It interprets Boolean operators and accepts host names, ip address, network names as arguments.
Ntop : Network top shows the network usage. It displays summary of network usage by machines on the network in a format as of UNIX top utility. It can also be run in web mode, which allows the display to be browsed with a web browser. It can display network traffic statistics, identify host etc. Interfaces are available to view such information.

Explain file system of linux. The root "/" filesystem, /usr filesystem, /var filesystem, /home filesystem, /proc filesystem.
Root "/" file system: The kernel needs a root file system to mount at start up. The root file system is generally small and should not be changed often as it may interrupt in booting. The root directory usually does not have the critical files. Instead sub directories are created. E.g. /bin (commands needed during bootup), /etc (config files) , /lib(shared libraries).
/usr filesystem : this file system is generally large as it contains the executable files to be shared amongst different machines. Files are usually the ones installed while installing Linux. This makes it possible to update the system from a new version of the distribution, or even a completely new distribution, without having to install all programs again. Sub directories include /bin, /include, /lib, /local (for local executables)
/var filesystem : this file system is specific to local systems. It is called as var because the data keeps changing. The sub directories include /cache/man (A cache for man pages), /games (any variable data belong to games), /lib (files that change), /log (log from different programs), /tmp (for temporary files)
/home filesystem: - this file system differs from host to host. User specific configuration files for applications are stored in the user's home directory in a file. UNIX creates directories for all users directory. E.g /home/my_name. Once the user is logged in ; he is placed in his home directory.
/proc filesystem :  this file system does  not exist on the hard disk. It is created by the kernel in its memory to provide information about the system. This information is usually about the processes. Contains a hierarchy of special files which represent the current state of the kernel .Few of the Directories include /1 (directory with information about process num 1, where 1 is the identification number), /cpuinfo (information about cpu), /devices (information about devices installed), /filesystem (file systems configured), /net (information about network protocols), /mem (memory usage)

What are the process states in Linux?
Process states in Linux:
Running: Process is either running or ready to run
Interruptible: a Blocked state of a process and waiting for an event or signal from another process
Uninterruptible:-  a blocked state. Process waits for a hardware condition and cannot handle any signal
Stopped: Process is stopped or halted and can be restarted by some other process
Zombie: process terminated, but information is still there in the process table.

What is a zombie? 
Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table. Since this process is not alive, it cannot react to signals. Zombie state can finish when the parent dies. All resources of the zombie state process are cleared by the kernel



Explain each system calls used for process management in linux.
System calls used for Process management:
Fork () :- Used to create a new process
Exec() :- Execute a new program
Wait():- wait until the process finishes execution
Exit():- Exit from the process
Getpid():- get the unique process id of the process
Getppid():- get the parent process unique id
Nice():- to bias the existing property of process

Oracle interview questions


Oracle interview questions



Explain the difference between trigger and stored procedure.

Trigger in act which is performed automatically before or after a event occur
Stored procedure is a set of functionality which is executed when it is explicitly invoked.


Explain Row level and statement level trigger.

Row-level: - They get fired once for each row in a table affected by the statements.
Statement: - They get fired once for each triggering statement.


Advantage of a stored procedure over a database trigger

Firing of a stored procedure can be controlled whereas on the other hand trigger will get fired whenever any modification takes place on the table.


What are cascading triggers?

A Trigger that contains statements which cause invoking of other Triggers are known as cascading triggers. Here’s the order of execution of statements in case of cascading triggers:
·         Execute all BEFORE statement triggers that apply to the current statement.
·         Loop for each row affected statement.
·         Execute all BEFORE row triggers that apply to the current statement in the loop.
·         Lock and change row, perform integrity constraints check; release lock.
·         Execute all AFTER row triggers that apply to the current statement.
·         Execute all AFTER statement triggers that apply to the current statement.


What is a JOIN? Explain types of JOIN in oracle.

A JOIN is used to match/equate different fields from 2 or more tables using primary/foreign keys. Output is based on type of Join and what is to be queries i.e. common data between 2 tables, unique data, total data, or mutually exclusive data.
Types of JOINS:
JOIN Type
Example
Description
Simple JOIN
SELECT p.last_name, t.deptName
FROM person p, dept t
WHERE p.id = t.id;
Find name and department name of students who have been allotted a department
Inner/Equi/Natural JOIN

SELECT * from Emp INNER JOIN Dept WHERE Emp.empid=Dept.empid
Extracts data that meets the JOIN conditions only. A JOIN is by default INNER unless OUTER keyword is specified for an OUTER JOIN.
Outer Join

SELECT distinct * from Emp LEFT OUTER JOIN Dept Where Emp.empid=Dept.empid
It includes non matching rows also unlike Inner Join.
Self JOIN

SELECT a.name,b.name from emp a, emp b WHERE a.id=b.rollNumber
Joining a Table to itself.



What is object data type in oracle?

New/User defined objects can be created from any database built in types or by their combinations. It makes it easier to work with complex data like images, media (audio/video). An object types is just an abstraction of the real world entities. An object has:
·         Name
·         Attributes
·         Methods
Example:
Create type MyName as object (first varchar2(20), second varchar2(20));

Now you can use this datatype while defining a table below: 

Create table Emp (empno number(5),Name MyName);
One can access the Atributes as Emp.Name.First and Emp.Name.Second



What is composite data type?

Composite data types are also known as Collections .i.e RECORD, TABLE, NESTED TABLE, VARRAY.
Composite data types are of 2 types:
PL/SQL RECORDS
PL/SQL Collections- Table, Varray, Nested Table


Differences between CHAR and NCHAR in Oracle

NCHAR allow storing of Unicode data in the database. One can store Unicode characters regardless of the setting of the database characterset


Differences between CHAR and VARCHAR2 in Oracle

CHAR is used to store fixed length character strings where as Varchar2 can store variable length character strings. However, for performance sake Char is quit faster than Varchar2.
If we have char name[10] and store “abcde”, then 5 bytes will be filled with null values, whereas in case of varchar2 name[10] 5 bytes will be used and other 5 bytes will be freed.


Differences between DATE and TIMESTAMP in Oracle

Date is used to store date and time values including month, day, year, century, hours, minutes and seconds. It fails to provide granularity and order of execution when finding difference between 2 instances (events) having a difference of less than a second between them.
TimeStamp datatype stores everything that Date stores and additionally stores fractional seconds.
Date: 16:05:14
Timestamp: 16:05:14:000

Define CLOB and NCLOB datatypes.

CLOB: Character large object. It is 4GB in length.
NCLOB: National Character large object. It is CLOB datatype for multiple character sets , upto 4GB in length.


What is the BFILE datatypes?

It refers to an external binary file and its size is limited by the operating system.


What is Varrays?

Varrays are one-dimensional, arrays. The maximum length is defined in the declaration itself. These can be only used when you know in advance about the maximum number of items to be stored.
For example: One person can have multiple phone numbers. If we are storing this data in the tables, then we can store multiple phone numbers corresponding to single Name. If we know the maximum number of phone numbers, then we can use Varrays, else we use nested tables.


What is a cursor? What are its types?

Cursor is used to access the access the result set present in the memory. This result set contains the records returned on execution of a query.
They are of 2 types:
1.       Explicit
2.       Implicit


Explain the attributes of implicit cursor

  1. %FOUND - True, if the SQL statement has changed any rows.
  2. %NOTFOUND - True, if record was not fetched successfully.
  3. %ROWCOUNT - The number of rows affected by the SQL statement.
  4. %ISOPEN - True, if there is a SQL statement being associated to the cursor or the cursor is open.


Explain the attributes of explicit cursor.

  1. %FOUND - True, if the SQL statement has changed any rows.
  2. %NOTFOUND - True, if record was not fetched successfully.
  3. %ROWCOUNT - The number of rows affected by the SQL statement.
  4. %ISOPEN - True, if there is a SQL statement being associated to the cursor or the cursor is open.


What is the ref cursor in Oracle?

REF_CURSOR allows returning a recordset/cursor from a Stored procedure.
It is of 2 types:
Strong REF_CURSOR: Returning columns with datatype and length need to be known at compile time.
Weak REF_CURSOR: Structured does not need to be known at compile time.
Syntax till Oracle 9i
create or replace package REFCURSOR_PKG as
TYPE WEAK8i_REF_CURSOR IS REF CURSOR;
TYPE STRONG REF_CURSOR IS REF CURSOR RETURN EMP%ROWTYPE;
end REFCURSOR_PKG;
Procedure returning the REF_CURSOR:
create or replace procedure test( p_deptno IN number , p_cursor OUT 
REFCURSOR_PKG.WEAK8i_REF_CURSOR)
is
begin
open p_cursor FOR 
select *
from emp
where deptno = p_deptno;
end test;
Since Oracle 9i we can use SYS_REFCURSOR
create or replace procedure test( p_deptno IN number,p_cursor OUT SYS_REFCURSOR)
is
begin
open p_cursor FOR 
select *
from emp
where deptno = p_deptno;
end test;
For Strong
create or replace procedure test( p_deptno IN number,p_cursor OUT REFCURSOR_PKG.STRONG 
REF_CURSOR)
is
begin
open p_cursor FOR 
select *
from emp
where deptno = p_deptno;
end test;


What are the drawbacks of a cursor?

Cursors allow row by row processing of recordset. For every row, a network roundtrip is made unlike in a Select query where there is just one network roundtrip. Cursors need more I/O and temp storage resources, thus it is slower.


What is a cursor variable?

In case of a cursor, Oracle opens an anonymous work area that stores processing information. This area can be accessed by cursor variable which points to this area. One must define a REF CURSOR type, and then declare cursor variables of that type to do so.
E.g.:
/* Create the cursor type. */
TYPE company_curtype IS REF CURSOR RETURN company%ROWTYPE;
 
/* Declare a cursor variable of that type. */
company_curvar company_curtype;
 

What is implicit cursor in Oracle?

PL/SQL creates an implicit cursor whenever an SQL statement is executed through the code, unless the code employs an explicit cursor. The developer does not explicitly declare the cursor, thus, known as implicit cursor.
E.g.:
In the following UPDATE statement, which gives everyone in the company a 20% raise, PL/SQL creates an implicit cursor to identify the set of rows in the table which would be affected.
UPDATE emp
SET salary = salary * 1.2;


Can you pass a parameter to a cursor? Explain with an explain

Parameterized cursor:
/*Create a table*/
create table Employee(
ID VARCHAR2(4 BYTE)NOT NULL,
First_Name VARCHAR2(10 BYTE)
);
/*Insert some data*/
Insert into Employee (ID, First_Name) values (‘01’,’Harry’);
/*create cursor*/
declare
cursor c_emp(cin_No NUMBER)is select count(*) from employee where id=cin_No;
v_deptNo employee.id%type:=10;
v_countEmp NUMBER;
begin
open c_emp (v_deptNo);
fetch c_emp into v_countEmp;
close c_emp;
end;

/*Using cursor*/
Open c_emp (10);





What is a package cursor?

A Package that returns a Cursor type is a package cursor.
Eg:
Create or replace package pkg_Util is
    cursor c_emp is select * from employee;
    r_emp c_emp%ROWTYPE;
end;
/*Another package using this package*/
Create or replace package body pkg_aDifferentUtil is
    procedure p_printEmps is
    begin
        open pkg_Util.c_emp;
        loop
            fetch pkg_Util.c_emp into pkg_Util.r_emp;
            exit when pkg_Util.c_emp%NOTFOUND;
            DBMS_OUTPUT.put_line(pkg_Util.r_emp.first_Name);
        end loop;
        close pkg_Util.c_emp;
     end;
end;


Explain why cursor variables are easier to use than cursors.

Cursor variables are preferred over a cursor for following reasons:
A cursor variable is not tied to a specific query.
One can open a cursor variable for any query returning the right set of columns. Thus, more flexible than cursors.
A cursor variable can be passed as a parameter.
A cursor variable can refer to different work areas.


What is locking, advantages of locking and types of locking in oracle?

Locking is a mechanism to ensure data integrity while allowing maximum concurrent access to data. It is used to implement concurrency control when multiple users access table to manipulate its data at the same time.

Advantages of locking:
a.       Avoids deadlock conditions
b.      Avoids clashes in capturing the resources
Types of locks:
a.       Read Operations: Select
b.      Write Operations:  Insert, Update and Delete



What are transaction isolation levels supported by Oracle?

Oracle supports 3 transaction isolation levels:
a.       Read committed (default)
b.      Serializable transactions
c.       Read only


What is SQL*Loader?

SQL*Loader is a loader utility used for moving data from external files into the Oracle database in bulk. It is used for high performance data loads.


What is Program Global Area (PGA)?

The Program Global Area (PGA): stores data and control information for a server process in the memory. The PGA consists of a private SQL area and the session memory.


What is a shared pool?

The shared pool is a key component. The shared pool is like a buffer for SQL statements.  It is to store the SQL statements so that the identical SQL statements do not have to be parsed each time they're executed. 


38. What is snapshot in oracle?

A snapshot is a recent copy of a table from db or in some cases, a subset of rows/cols of a table. They are used to dynamically replicate the data between distributed databases. 

What is a synonym?

A synonym is an alternative name tables, views, sequences and other database objects.


What is a schema?

A schema is a collection of database objects. Schema objects are logical structures created by users to contain data. Schema objects include structures like tables, views, and indexes. 




What are Schema Objects?

Schema object is a logical data storage structure. Oracle stores a schema object logically within a tablespace of the database.



What is a sequence in oracle?

Is a column in a table that allows a faster retrieval of data from the table because this column contains data which uniquely identifies a row. It is the fastest way to fetch data through a select query. This column has constraints to achieve this ability. The constraints are put on this column so that the value corresponding to this column for any row cannot be left blank and also that the value is unique and not duplicated with any other value in that column for any row.


Difference between a hot backup and a cold backup

Cold backup: It is taken when the database is closed and not available to users.  All files of the database are copied (image copy).  The datafiles cannot be changed during the backup as they are locked, so the database remains in sync upon restore. 

Hot backup: While taking the backup, if the database remains open and available to users then this kind of back up is referred to as hot backup.  Image copy is made for all the files.  As, the database is in use the entire time, so there might be changes made when backup is taking place. These changes are available in log files so the database can be kept in sync


What are the purposes of Import and Export utilities?

Export and Import are the utilities provided by oracle in order to write data in a binary format from the db to OS files and to read them back.

These utilities are used:
·         To take backup/dump of data in OS files.
·         Restore the data from the binary files back to the database.
·         move data from one owner to another


Difference between ARCHIVELOG mode and NOARCHIVELOG mode

Archivelog mode is a mode in which backup is taken for all the transactions that takes place so as to recover the database at any point of time.
Noarichvelog   mode is in which the log files are not written. This mode has a disadvantage that the database cannot be recovered when required. It has an advantage over archivelog mode which is increase in performance.







What are the original Export and Import Utilities?

SQL*Loader, External Tables


What are data pump Export and Import Modes?

It is used for fast and bulk data movement within oracle databases. Data Pump utility is faster than the original import & export utilities.


What are SQLCODE and SQLERRM and why are they important for PL/SQL developers?

SQLCODE: It returns the error number for the last encountered error.
SQLERRM: It returns the actual error message of the last encountered error. 


Explain user defined exceptions in oracle.

A User-defined exception has to be defined by the programmer. User-defined exceptions are declared in the declaration section with their type as exception. They must be raised explicitly using RAISE statement, unlike pre-defined exceptions that are raised implicitly. RAISE statement can also be used to raise internal exceptions. 

Exception: 

DECLARE
userdefined  EXCEPTION;


BEGIN
<Condition on which exception is to be raised>
RAISE userdefined;


EXCEPTION
WHEN userdefined THEN
<task to perform when exception is raised>
 END;


Explain the concepts of Exception in Oracle. Explain its type.

Exception is the raised when an error occurs while program execution. As soon as the error occurs, the program execution stops and the control are then transferred to exception-handling part.
There are two types of exceptions:
1.       Predefined : These types of exceptions are raised whenever something occurs beyond oracle rules. E.g. Zero_Divide
2.       User defined: The ones that occur based on the condition specified by the user. They must be raised explicitly using RAISE statement, unlike pre-defined exceptions that are raised implicitly. 


How exceptions are raised in oracle?

There are four ways that you or the PL/SQL runtime engine can raise an exception:
·         Exceptions are raised automatically by the program.
·         The programmer raises a user defined exceptions. 
·          The programmer raises pre defined exceptions explicitly.


What is tkprof and how is it used?

tkprof  is used for diagnosing performance issues.  It formats a trace file into a more readable format for performance analysis. It is needed because trace file is a very complicated file to be read as it contains minute details of program execution.


What is Oracle Server Autotrace?

It is a utility that provides instant feedback on successful execution of any statement (select, update, insert, delete).  It is the most basic utility to test the performance issues.