All Oracle Apps

Frequently Asked Interview Questions

Oracle Reports

91) What are the Extension of the report?

      rdf – Binary Source File.
      .rep – Binary Executable Format.
      .rex – Text Format.
      .tdf – report template binary file.

      You can change .rdf and .rex to .rep using RWCON60 or go to File -> Admin -> Convert.

92) Can you run the report without a parameter forms?

      Yes, It is possible to run a report without the parameter form by setting the PARAM value to NULL.
      Ex: add_paramerter(pl_id, ‘PARAMFORM’,TEXT_PARAMETER,NULL);

93) What ate Data Model and Layout Model?

      The Data retrieved for a report is defined in Data Model and style of the report is defined in Layout Model.

94) What are the Back ground processes in Oracle and what are they?

      This is one of the most frequently asked questions. There are basically 9 Processes but in a general system we need to mention the first five background processes. They do the house keeping activities for the Oracle and are common in any system.

The various background processes in oracle are:

  • Data Base Writer (DBWR) -- Data Base Writer Writes Modified blocks from Database buffer cache to Data Files. This is required since the data is not written whenever a transaction is committed.
  • LogWriter (LGWR) -- LogWriter writes the redo log entries to disk. Redo Log data is generated in redo log buffer of SGA. As transaction commits and log buffer fills, LGWR writes log entries into a online redo log file.
  • System Monitor (SMON) -- The System Monitor performs instance recovery at instance startup. This is useful for recovery from system failure
  • Process Monitor (PMON) -- The Process Monitor performs process recovery when user Process fails. Pmon Clears and Frees resources that process was using.
  • CheckPoint (CKPT) -- At Specified times, all modified database buffers in SGA are written to data files by DBWR at Checkpoints and Updating all data files and control files of database to indicate the most recent checkpoint
  • Achieves (ARCH) -- The Archiver copies online redo log files to archival storal when they are busy.
  • Recoveror (RECO) -- The Recoveror is used to resolve the distributed transaction in network
  • Dispatcher (Dnnn) -- The Dispatcher is useful in Multi Threaded Architecture
  • Lckn -- We can have up to 10 lock processes for inter instance locking in parallel sql.

95) How many types of Sql Statements are there in Oracle?

      There are basically 6 types of sql statments.They are

  • Data Definition Language (DDL) -- The DDL statements define and maintain objects and drop objects.
  • Data Manipulation Language (DML) -- The DML statements manipulate database data.
  • Transaction Control Statements -- Manage change by DML
  • Session Control -- Used to control the properties of current session enabling and disabling roles and changing e.g. Alter Statements, Set Role.
  • System Control Statements -- Change Properties of Oracle Instance .e.g. Alter System.
  • Embedded Sql -- Incorporate DDL, DML and T.C.S in Programming Language. e.g. Using the Sql Statements in languages such as 'C', Open, Fetch, execute and close

96) What is a Transaction in Oracle?

      A transaction is a Logical unit of work that compromises one or more SQL Statements executed by a single User. According to ANSI, a transaction begins with first executable statement and ends when it is explicitly committed or rolled back.

Key Words Used in Oracle

      The Key words that are used in Oracle are:

      Commit: A transaction is said to be committed when the transaction makes permanent changes resulting from the SQL statements.

      Rollback: A transaction that retracts any of the changes resulting from SQL statements in Transaction.

      SavePoint: For long transactions that contain many SQL statements, intermediate markers or savepoints are declared. Savepoints can be used to divide a transaction into smaller points.

      Rolling Forward: Process of applying redo log during recovery is called rolling forward.

      Cursor: A cursor is a handle (name or a pointer) for the memory associated with a specific statement. A cursor is basically an area allocated by Oracle for executing the sql Statement. Oracle uses an implicit cursor statement for Single row query and Uses Explicit cursor for a multi row query.

      System Global Area (SGA): The SGA is a shared memory region allocated by the Oracle that contains Data and control information for one Oracle Instance. It consists of Database Buffer Cache and Redo log Buffer.

      Program Global Area (PGA): The PGA is a memory buffer that contains data and control information for server process.

      Database Buffer Cache: Database Buffer of SGA stores the most recently used blocks of database data. The set of database buffers in an instance is called Database Buffer Cache.

      Redo log Buffer: Redo log Buffer of SGA stores all the redo log entries.

      Redo Log Files: Redo log files are set of files that protect altered database data in memory that has not been written to Data Files. They are basically used for backup when a database crashes.

      Process: A Process is a 'thread of control' or mechanism in Operating System that executes series of steps.

97) What are Procedure, functions and Packages?

Procedures and functions consist of set of PL/SQL statements that are grouped together as a unit to solve a specific problem or perform set of related tasks. Procedures do not return values while Functions return one Value.

Packages: Packages provide a method of encapsulating and storing related procedures, functions, variables and other Package Contents

98) What are Database Triggers and Stored Procedures?

Database Triggers

      Database Triggers are Procedures that are automatically executed as a result of insert in, update to, or delete from table.

      Database triggers have the values old and new to denote the old value in the table before it is deleted and the new indicated the new value that will be used. DT are useful for implementing complex business rules which cannot be enforced using the integrity rules. We can have the trigger as before trigger or After Trigger and at Statement or Row level.
      e.g.: operations insert, update and delete -- 3.
       Before after 3*2 A total of 6 combinations.
      At statement level (once for the trigger) or row level ( for every execution ) .
       6 * 2 A total of 12. .
      Thus a total of 12 combinations are there and the restriction of usage of 12 triggers has been lifted from Oracle 7.3 Onwards. .

Stored Procedures:

      Stored Procedures are Procedures that are stored in Compiled form in the database. The advantage of using the stored procedures is that many users can use the same procedure in compiled and ready to use format.

99) How many Integrity Rules are there and what are they?

       There are Three Integrity Rules. They are as follows:

  • Entity Integrity Rule -- The Entity Integrity Rule enforces that the Primary key cannot be Null.
  • Foreign Key Integrity Rule -- The FKIR denotes that the relationship between the foreign key and the primary key has to be enforced. When there is data in Child Tables the Master tables cannot be deleted.
  • Business Integrity Rules -- The Third Integrity rule is about the complex business processes which cannot be implemented by the above 2 rules.

100) What are the Various Master and Detail Relation ships?

      The various Master and Detail Relationship are

  • NonIsolated -- The Master cannot be deleted when a child is existing
  • Isolated -- The Master can be deleted when the child is existing
  • Cascading -- The child gets deleted when the Master is deleted.

101) What are the Various Block Coordination Properties?

      The various Block Coordination Properties

  • Immediate Default Setting --The Detail records are shown when the Master Record are shown.
  • Deffered with Auto Query --Oracle Forms defer fetching the detail records until the operator navigates to the detail block.
  • Deffered with No Auto Query -- The operator must navigate to the detail block and explicitly execute a query

102) What are the Different Optimization Techniques?

      The Various Optimization techniques are

Execute Plan:

      We can see the plan of the query and change it accordingly based on the indexes

Optimizer_hint:

      set_item_property('DeptBlock',OPTIMIZER_HINT,'FIRST_ROWS');
      Select /*+ First_Rows */ Deptno,Dname,Loc,Rowid from dept
      where (Deptno > 25)

Optimize_Sql:

      By setting the Optimize_Sql = No, Oracle Forms assigns a single cursor for all SQL statements. This slow downs the processing because for evertime the SQL must be parsed whenever they are executed.f45run module = my_firstform userid = scott/tiger optimize_sql = No

Optimize_Tp:

      By setting the Optimize_Tp= No, Oracle Forms assigns seperate cursor only for each query SELECT statement. All other SQL statements reuse the cursor.
      f45run module = my_firstform userid = scott/tiger optimize_Tp = No

103) How do u implement the If statement in the Select Statement

      We can implement the if statement in the select statement by using the Decode statement.
      E.g. select DECODE (EMP_CAT,'1','First','2','Second'Null);
      Here the Null is the else statement where null is done.

104) How many types of Exceptions are there?

      There are 2 types of exceptions. They are

System Exceptions

      E.g. When no_data_found, When too_many_rows

User Defined Exceptions

      e.g. My_exception exception
       When My_exception then

105) What are the inline and the precompiler directives?

      The inline and precompiler directives detect the values directly

106) How do you use the same lov for 2 columns?

      We can use the same lov for 2 columns by passing the return values in global values and using the global values in the code

107) How many minimum groups are required for a matrix report?

      The minimum number of groups in matrix report is 4

108) What is the difference between static and dynamic lov

      The static lov contains the predetermined values while the dynamic lov contains values that come at run time

109) What are snap shots and views?

      Snapshots are mirror or replicas of tables. Views are built using the columns from one or more tables. The Single Table View can be updated but the view with multi table cannot be updated

110) What are the OOPS concepts in Oracle.

      Oracle does implement the OOPS concepts. The best example is the Property Classes. We can categories the properties by setting the visual attributes and then attach the property classes for the objects. OOPS supports the concepts of objects and classes and we can consider the property classes as classes and the items as objects

111) What is the difference between candidate key, unique key and primary key

      Candidate keys are the columns in the table that could be the primary keys and the primary key is the key that has been selected to identify the rows. Unique key is also useful for identifying the distinct rows in the table.

112) What is concurrency?

      Concurrency is allowing simultaneous access of same data by different users. Locks useful for accessing the database are

Exclusive

      The exclusive lock is useful for locking the row when an insert, update or delete is being done. This lock should not be applied when we do only select from the row.

Share lock

      We can do the table as Share Lock as many share locks can be put on the same resource.

Privileges and Grants

Previleges are the right to execute a particular type of SQL statements.
      e.g.: Right to Connect, Right to create, Right to resource.

Grants are given to the objects so that the object might be accessed accordingly. The grant has to be given by the owner of the object.

113) What is Table Space, Data Files, Parameter File, Control Files?

Table Space:

      The table space is useful for storing the data in the database. When a database is created two table spaces are created.

System Table Space:

      This data file stores all the tables related to the system and dba tables

User Table Space:

      This data file stores all the user related tables
      We should have separate table spaces for storing the tables and indexes so that the access is fast.

Data Files:

      Every Oracle Data Base has one or more physical data files. They store the data for the database. Every data file is associated with only one database. Once the Data file is created the size cannot change. To increase the size of the database to store more data we have to add data file.

Parameter Files:

      Parameter file is needed to start an instance. A parameter file contains the list of instance configuration parameters
      e.g.
      db_block_buffers = 500
      db_name = ORA7
      db_domain = u.s.acme lang

Control Files:

      Control files record the physical structure of the data files and redo log files They contain the Db name, name and location of dbs, data files ,redo log files and time stamp.

Physical Storage of the Data

      The finest level of granularity of the data base is the data blocks.

Data Block

      One Data Block correspond to specific number of physical database space

Extent:

      Extent is the number of specific number of contagious data blocks.

Segments:

      Set of Extents allocated for Extents. There are three types of Segments
      Data Segment: Non Clustered Table has data segment data of every table is stored in cluster data segment
      Index Segment: Each Index has index segment that stores data
      Roll Back Segment: Temporarily store 'undo' information

114) What are the Pct Free and Pct Used?

      Pct Free is used to denote the percentage of the free space that is to be left when creating a table. Similarly Pct Used is used to denote the percentage of the used space that is to be used when creating a table Eg. Pctfree 20, Pctused 40

115) What is Row Chaining?

      The data of a row in a table may not be able to fit the same data block. Data for row is stored in a chain of data blocks.

116) What is a 2 Phase Commit?

      Two Phase commit is used in distributed data base systems. This is useful to maintain the integrity of the database so that all the users see the same values. It contains DML statements or Remote Procedural calls that reference a remote object. There are basically 2 phases in a 2 phase commit.

      Prepare Phase: Global coordinator asks participants to prepare

      Commit Phase: Commit all participants to coordinator to Prepared, Read only or abort Reply

117) What is the difference between deleting and truncating of tables?

      Deleting a table will not remove the rows from the table but entry is there in the database dictionary and it can be retrieved But truncating a table deletes it completely and it cannot be retrieved.

118) What are mutating tables?

      When a table is in state of transition it is said to be mutating. eg :: If a row has been deleted then the table is said to be mutating and no operations can be done on the table except select.

119) What are Codd Rules?

      Codd Rules describe the ideal nature of a RDBMS. No RDBMS satisfies all the 12 codd rules and Oracle Satisfies 11 of the 12 rules and is the only Rdbms to satisfy the maximum number of rules.

120) What is Normalization?

      Normalization is the process of organizing the tables to remove the redundancy. There are mainly 5 Normalization rules.

  1. 1 Normal Form: A table is said to be in 1st Normal Form when the attributes are atomic
  2. 2 Normal Form: A table is said to be in 2nd Normal Form when all the candidate keys are dependant on the primary key
  3. 3rd Normal Form: A table is said to be third Normal form when it is not dependant transitively

121) What is the Difference between a post query and a pre query

      A post query will fire for every row that is fetched but the pre query will fire only once.

122) Deleting the Duplicate rows in the table

      We can delete the duplicate rows in the table by using the Rowid.

123) Can U disable database trigger? How?

      Yes. With respect to table
       ALTER TABLE TABLE
      [ DISABLE all_trigger ]

124) What is a pseudo column? Name them?

      A pseudocolumn behaves like a table column, but is not actually stored in the table. You can select from pseudocolumns, but you cannot insert, update, or delete their values. This section Describes these pseudocolumns:

  • CURRVAL
  • NEXTVAL
  • LEVEL
  • ROWID
  • ROWNUM

125)How many columns can table have?

      The number of columns in a table can range from 1 to 254.

126) Is space acquired in blocks or extents?

      In extents.

127) What is clustered index?

      In an indexed cluster, rows are stored together based on their cluster key values . Can not apply for HASH.

128) What are the data types supported By oracle (INTERNAL)?

      Varchar2, Number, Char, MLSLABEL.

129) What are attributes of cursor?

      %FOUND , %NOTFOUND , %ISOPEN,%ROWCOUNT

130) Can you use select in FROM clause of SQL select?

      Yes

                                                                                                                                                       Previous