Oracle 10g Interview Questions & Answers

  1. Answer :
    Oracle 10g is a version of the Oracle Database. The g stands for "grid" to indicate that 10g is "grid-computing ready".
  2. Answer :
    The union operation, you will recall, brings two sets of data together. It will *NOT* however produce duplicate or redundant rows. To perform this feat of magic, a SORT operation is done on both tables. This is obviously computationally intensive, and uses significant memory as well. A UNION ALL conversely just dumps collection of both sets together in random order, not worrying about duplicates.
  3. Answer :
    You can script the process to include it in a set of install scripts you deliver with a product.
    You can put your create database script in CVS for version control, so as you make changes or adjustments to it, you can track them like you do changes to software code.
    You can log the output and review it for errors. You learn more about the process of database creation, such as what options are available and why.
  4. Answer :
    A trigger is one or more statements of SQL that are being executed in event of data modification in a table to which the trigger belongs.
    Triggers enhance the security, efficiency, and standardization of databases.
    Triggers can be beneficial when used:
    • to check or modify values before they are actually updated or inserted in the database. This is useful if you need to transform data from the way the user sees it to some internal database format.
    • to run other non-database operations coded in user-defined functions
    • to update data in other tables. This is useful for maintaining relationships between data or in keeping audit trail information.
    • to check against other data in the table or in other tables. This is useful to ensure data integrity when referential integrity constraints aren’t appropriate, or when table check constraints limit checking to the current table only.
  5. Answer :
    A table scan.
  6. Question 6. What Is The Difference Of A Left Join And An Inner Join Statement?
  7. Answer :
    A LEFT JOIN will take ALL values from the first declared table and matching values from the second declared table based on the column the join has been declared on. An INNER JOIN will take only matching values from both tables
  8. Answer :
    A stored procedure is pre-loaded in memory for faster execution. It allows the DBMS control of permissions for security purposes. It also eliminates the need to recompile components when minor changes occur to the database.
  9. Answer :
    A Cartesian product is the result of an unrestricted join of two or more tables. The result set of a three table Cartesian product will have x * y * z number of rows where x, y, z correspond to the number of rows in each table involved in the join. It is causes by specifying a table in the FROM clause without joining it to another table.
  10. Answer :
    12 triggers.
  11. Answer :
    1 for positive value, 
    0 for Zero, 
    -1 for Negative value.
  12. Answer :
  13. Answer :
    Cursor_Already_Open, Invalid_Cursor
  14. Answer :

  15. Answer :
  16. Answer :
    Odd number of records: 
    select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp); 

    Even number of records: 
    select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)

  17. Answer :
    SQL> select banner from v$version;
  18. Answer :
    Enter value for n: 2 

  19. Answer :
    There are four cursor attributes used in Oracle

  20. Answer :
    To achive this use rownum pseudocolumn with query, like
    SQL> select rownum, ename from emp;

    1 Scott 
    2 Millor 
    3 Jiyo 
    4 Smith

  21. Answer :
    SQL> host
  22. Answer :
    Sql> show user;
  23. Answer :
    If changes are made to the tables and these tables are the base tables of a view, then the changes will be reference on the view.
  24. Answer :
    A View can be updated/deleted/inserted if it has only one base table if the view is based on columns from one or more tables then insert, update and delete is not possible.
  25. Answer :
    - To protect some of the columns of a table from other users.
    - To hide complexity of a query.
    - To hide complexity of calculations.

  26. Answer :
    CYCLE specifies that the sequence continue to generate values after reaching either maximum or minimum value. After pan-ascending sequence reaches its maximum value, it generates its minimum value. After a descending sequence reaches its minimum, it generates its maximum.
    NO CYCLE specifies that the sequence cannot generate more values after reaching its maximum or minimum value.
  27. Answer :
    Sequence name CURRVAL, sequence name NEXTVAL. It is not possible. Only if you access next value in the session, current value can be accessed.
  28. Answer :
    Database link is a named path through which a remote database can be accessed.
  29. [post_ads]
  30. Answer :
    It won’t, Because SYSDATE format contains time attached with it.
  31. Answer :
    The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE CONSTRAINT / DISABLE CONSTRAINT.
  32. Answer :
    The integrity constraints are stored in USER_CONSTRAINTS.
  33. Answer :
    - To modify the datatype of a column the column must be empty.
    - To add a column with NOT NULL constrain, the table must be empty.

  34. Answer :
    Only one LONG column is allowed. It is not possible to use LONG column in WHERE or ORDER BY clause.
  35. Answer :
    • CHAR pads blank spaces to the maximum length.
    • VARCHAR2 does not pad blank spaces.
    • For CHAR the maximum length is 255 and 2000 for VARCHAR2.
  36. Answer :
  37. Answer :
    When ON DELETE CASCADE is specified Oracle maintains referential integrity by automatically removing dependent foreign key values if a referenced primary or unique key value is removed.
  38. Answer :
    SAVEPOINTS are used to subdivide a transaction into smaller parts. It enables rolling back part of a transaction. Maximum of five save points are allowed.
  39. Answer :
    Maintaining data integrity through a set of rules that restrict the values of one or more columns of the tables based on the values of primary key or unique key of the referenced table.
  40. Answer :
    Integrity constraint is a rule that restricts values to a column in a table.
  41. Answer :
    ROWID is a pseudo column attached to each row of a table. It is 18 characters long, blockno, rownumber are the components of ROWID.
  42. Answer :
    INTERSECT - returns all distinct rows selected by both queries.
    MINUS - returns all distinct rows selected by the first query but not by the second.
    UNION - returns all distinct rows selected by either query
    UNION ALL - returns all rows selected by either query, including all duplicates.

  43. Answer :
    INSTR (String1, String2 (n, (m)),
    INSTR returns the position of the m-th occurrence of the string 2 in string1. The search begins from nth position of string1.

    SUBSTR (String1 n, m)
    SUBSTR returns a character string of size m in string1, starting from n-th position of string1.

  44. Answer :
    Retrieves rows in hierarchical order
    eg: select empno, ename from emp where.
  45. Answer :
    Correlated sub-query is a sub-query, which has reference to the main query.
  46. Answer :
    Sub-query is a query whose return values are used in filtering conditions of the main query.
  47. Answer :
    Join is a query, which retrieves related columns or rows from multiple tables.
    Self Join – Joining the table with itself.
    Equi Join – Joining two tables by equating two common columns.
    Non-Equi Join – Joining two tables by equating two common columns.
    Outer Join – Joining two tables in such a way that query can also retrieve rows that do not have corresponding join value in the other table.
  48. Answer :
    TRUNCATE commits after deleting entire table i.e., cannot be rolled back.
    Database triggers do not fire on TRUNCATE
    DELETE allows the filtered deletion. Deleted records can be rolled back or committed.
    Database triggers fire on DELETE.

  49. Answer :
    Transaction is logical unit between two commits and commit and rollback.
  50. Answer :

    Transactional Control: COMMIT & ROLLBACK.
    Session Control: ALTERSESSION & SET ROLE.
    System Control: ALTER SYSTEM.
  51. Answer :
    SQL*Plus Statements

  52. Answer :
    Don’t grant user access directly to tables within the application.
    Instead grant the ability to access the procedures that access the tables.
    When procedure executed it will execute the privilege of procedures owner. Users cannot access tables except via the procedure.

  53. Answer :
    A user account is not a physical structure in database but it is having important relationship to the objects in the database and will be having certain privileges.
  54. Answer :
    - The space used transaction entries and deleted records, does not become free immediately after completion due to delayed cleanout.
    - Trailing nulls and length bytes are not stored.
    - Inserts of, updates to and deletes of rows as well as columns larger than a single data block, can cause fragmentation a chained row pieces.

  55. Answer :
    We should depend on export/import utility for backup/recovery (fully reliable)
    The tar command cannot be used for physical file backup, instead we can use dd command, which is less flexible and has limited recoveries.

  56. Answer :
    When Segment is dropped.
    When Shrink (RBS only)
    When truncated (TRUNCATE used with drop storage option)

  57. Answer :
    It is a measure of well the data cache buffer is handling requests for data.
    Hit Ratio = (Logical Reads – Physical Reads – Hits Misses)/ Logical Reads.

  58. Answer :
    It is the set of before image data blocks that contain rows that are modified by a transaction.
    Each rollback segment entry must be completed within one rollback segment.
    A single rollback segment can have multiple rollback segment entries.

  59. Answer :
    They allow the database to maintain read consistency between multiple transactions.
  60. Answer :
    Shadow set of disks save as a backup in the event of disk failure. In most operating systems if any disk failure occurs it automatically switchover to place of failed disk.
    Improved performance because most OS support volume shadowing can direct file I/O request to use the shadow set of files instead of the main set of files. This reduces I/O load on the main set of disks.
  61. Answer :
    Process of having a copy of redo log files is called mirroring.
    This can be achieved by creating group of log files together, so that LGWR will automatically writes them to all the members of the current on-line redo log group. If any one group fails then database automatically switch over to next group. It degrades performance.

  62. Answer :
    Shutdown the database
    Copy one of the existing controlfile to new location
    Edit Config ora file by adding new control filename
    Restart the database.

  63. Answer :
    Database’s overall physical architecture is maintained in a file called control file. It will be used to maintain internal consistency and guide recovery operations. Multiple copies of control files are advisable.
  64. Answer :
    The advantages over file system files are that I/O will be improved because Oracle is bye-passing the kernel which writing into disk. Disk corruption will be very less.
  65. Answer :
    • Limit the number of extents in the table
    • Separate table from its indexes.
    • Allocate sufficient temporary storage.
  66. Answer :
    By querying DBA_SEGMENT table/view
  67. Answer :
    Rollback segment dynamically extent to handle larger transactions entry loads.
    A single transaction may wipeout all available free space in the rollback segment tablespace. This prevents other user using rollback segments.

  68. Answer :
    It will try to fit the transaction in a cyclic fashion to all existing extents. Once it found an extent is in use then it forced to acquire a new extent (number of extents is based on the optimal size)
  69. Answer :
    - Create a database, which implicitly creates a SYSTEM rollback segment in a SYSTEM tablespace.
    - Create a second rollback segment name R0 in the SYSTEM tablespace.
    - Make new rollback segment available (after shutdown, modify init.ora file and start database)
    - Create other tablespaces (RBS) for rollback segments.
    - Deactivate rollback segment R0 and activate the newly created rollback segments.

  70. Answer :
    To manage the database level transactions such as modifications of the data dictionary table that record information about the free space usage.
  71. Answer :
    It is used to set the optimal length of a rollback segment.
  72. Answer :
    This is used to reserve certain amount of space in a block for expansion of rows.
  73. Answer :
    Each block contains entries as follows
    Fixed block header
    Variable block header
    Row Header, row date (multiple rows may exists)
    PCTEREE (% of free space for row updating in future)

  74. Answer :
    We can plan the storage for a table as how much initial extents are required, how much can be extended next, how much % should leave free for managing row updating, etc.,
  75. Answer :
    PCTFREE parameter
    Row size also reduces no of rows per block.

  76. Answer :
    A free extent is a collection of continuous free blocks in tablespace. When a segment is dropped its extents are reallocated and are marked as free.
  77. Answer :
  78. Answer :
    SYSTEM – Data dictionary tables.
    DATA - Standard operational tables.
    DATA2- Static tables used for standard operations
    INDEXES – Indexes for Standard operational tables.
    INDEXES1 – Indexes of static tables used for standard operations.
    TOOLS – Tools table.
    TOOLS1 – Indexes for tools table.
    RBS – Standard Operations Rollback Segments,
    RBS1,RBS2 – Additional/Special Rollback segments.
    TEMP – Temporary purpose tablespace
    TEMP_USER – Temporary tablespace for users.
    USERS – User tablespace.

  79. Answer :
    - Export the user
    - Perform import using the command imp system/manager file=export.dmp indexfile=newrite.sql. This will create all definitions into newfile.sql.
    - Drop necessary objects.
    - Run the script newfile.sql after altering the tablespaces.
    - Import from the backup for the necessary objects.

  80. Answer :
    Changes made to the records are written to the on-line redo log files. So that they can be used in roll forward operations during database recoveries. Before writing them into the redo log files, they will first brought to redo log buffers in SGA and LGWR will write into files frequently. LOG_BUFFER parameter will decide the size.
  81. Answer :
    Number of times processes repeatedly query the dictionary table is called recursive hints. It is due to the data dictionary cache is too small. By increasing the SHARED_POOL_SIZE parameter we can optimize the size of data dictionary cache.
  82. Answer :
    Dictionary cache is information about the database objects stored in a data dictionary table.
  83. Answer :
    Database buffers are cache in the SGA used to hold the data blocks that are read from the data segments in the database such as tables, indexes and clusters DB_BLOCK_BUFFERS parameter in INIT.ORA decides the size.
  84. Answer :
    • Due to insufficient shared pool size.
    • Monitor the ratio of the reloads takes place while executing SQL statements. If the ratio is greater than 1 then increase the SHARED_POOL_SIZE.
    • Database Logical & Physical Architecture
  85. Answer :
    Data segment are the physical areas within a database block in which the data associated with tables and clusters are stored.
  1. Answer :
    It is area in memory that is used by a single Oracle user process.
  2. Answer :
    Shared pool in oracle contains cache information that collects, parses, interprets and executes SQL statements that goes against database. This shared pool acts like a buffer for these SQL statements.
  3. Answer :
    The System Global Area in an Oracle database is the area in memory to facilitate the transfer of information between users. It holds the most recently requested structural information between users. It holds the most recently requested structural information about the database. The structure is database buffers, dictionary cache, redo log buffer and shared pool area.
  4. Answer :
    The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster index and its value is stored only once for multiple tables in the cluster.
  5. Answer :
    Group of tables physically stored together because they share common columns and are often used together is called cluster.
  6. Answer :
    An index is a database structure used by the server to have direct access of a row in a table. An index is automatically created when a unique of primary key constraint clause is specified in create table command
  7. Answer :
    The set of objects owned by user account is called the schema.
  8. Answer :
    Multiple instances accessing the same database (only in multi-CPU environments)
  9. Answer :
    A database instance (Server) is a set of memory structure and background processes that access a set of database files. The processes can be shared by all of the users.
    The memory structure that is used to store the most queried data from database. This helps up to improve database performance by decreasing the amount of I/O performed against data file.
  10. Answer :
    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.
  11. Answer :
    - Database name
    - Names and locations of a database’s files and redolog files.
    - Time stamp of database creation.

  12. Answer :
    The information in a redo log file is used only to recover the database from a system or media failure prevents database data from being written to a database’s data files.
  13. Answer :
    The primary function of the redo log is to record all changes made to data.
  14. Answer :
    The set of redo log files for a database is collectively known as the database redo log.
  15. Answer :
    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.
  16. Answer :
    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.
  17. Answer :
    When the statement finishes execution, the temporary segment extents are released to the system for future use.
  18. Answer :
    To generate read-consistent database information during database recovery and to rollback uncommitted transactions by the users.
  19. Answer :
    A database contains one or more rollback segments to temporarily store “undo” information.
  20. Answer :
    Each index has an index segment that stores all of its data.
  21. Answer :
    Data segment, index segment, rollback segment and temporary segment.
  22. Answer :
    A segment is a set of extents allocated for a certain logical structure.
  23. Answer :
    An extent is a specific number of contiguous data blocks, obtained in a single allocation and used to store a specific type of information.
  24. Answer :
    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.
  25. Answer :
    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 data blocks. Block size is specified in init.ora file and cannot be changed latter.
  26. Answer :
    Oracle database’s data is stored in data blocks. One data block corresponds to a specific number of bytes of physical database space on disk.
  27. Answer :
    Network database link is created and managed by a network domain service. A network database link can be used when any user of any database in the network specifies a global object name in a SQL statement or object definition.
  28. Answer :
    Public database link is created for the special user group PUBLIC. A public database link can be used when any user in the associated database specifies a global object name in a SQL statement or object definition.
  29. Answer :
    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.
  30. Answer :
    Private database link, public database link & network database link.
  31. Answer :
    A database link is a named object that describes a “path” from one database to another.
  32. Answer :
    Hash clusters are better choice when a table is often queried with equality queries. For such queries the specified cluster key value is hashed. The resulting hash key value points directly to the area on disk that stores the specified rows.
  33. Answer :
    A row is stored in a hash cluster based on the result of applying a hash function to the row’s cluster key value. All rows with the same hash key value are stores together on disk.
  34. Answer :
    A cluster with an index on the cluster key.
  35. Answer :
    The related columns of the tables in a cluster are called the cluster key.
  36. Answer :
    Indexes are automatically maintained and used by Oracle. Changes to table data are automatically incorporated into all relevant indexes.
  37. Answer :
    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.
  38. Answer :
    - 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.

  39. Answer :
    Any database user can access a public synonym.
  40. Answer :
    Only its owner can access a private synonym.
  41. Answer :
    There are two types of synonyms private and public.
  42. Answer :
    A synonym is an alias for a table, view, sequence or program unit.
  43. Answer :
    A sequence generates a serial list of unique numbers for numerical columns of a database’s tables.
  44. Answer :
    •  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.
  45. Answer :
  46. Answer :
    Views do not contain or store data.
  47. Answer :
    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.)
  48. Answer :
    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.
  49. Answer :
  50. Answer :
  51. Answer :
    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.
  52. Answer :
    A schema is collection of database objects of a user.
  53. Answer :
    Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace.
  54. Answer :
    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.
  55. Answer :
    A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together.
  56. Answer :
    There are tablespaces and database’s schema objects.
  57. Answer :
    Oracle database is comprised of three types of files. One or more datafiles, two are more redo log files, and one or more control files.



Account Payables,1,Advance Table In OAF,1,AME,1,AOL Concepts,19,AP Holds,1,Apps Initialization,1,Blanket Purchase Orders,1,Blanket Releases,1,Careers,9,Common Errors and Solutions,2,Concurrent Programs,10,Contract Purchase Orders,1,Corporate Culture,3,Corporate Ladder,3,Customer Interface,3,Customization,1,De-Normalization,1,EAM,1,EBS Tutorials,10,Education,16,Emterprise Asset Management,1,English,1,Enterprise Asset Management,1,Entrepreneur,1,Error Fixes,1,Executables,2,Extension,1,fnd_user,1,FNDLOAD,1,Global Agreements,1,Guest Posts,7,Handy Scripts,63,Health Tips,1,Important Apps Queries,1,Infographic,3,Interview Preparation,62,Interview Q/A,68,Inventory Org ID,1,Iproc,4,Iprocurement,4,IT,3,jDeveloper,1,Job Search,1,Key Tables In Oracle Apps,5,Learning English,1,MDS,1,Metadata Tables,2,Multi Org Architecture,2,Normalization,1,O2C,1,OAF Interview,50,OAF Personalization,1,OAF Tutorials,52,OCI,1,Operating Unit,1,Oracle 10g,1,Oracle 11g,1,Oracle Access Manager,1,Oracle ADF,1,Oracle Alerts,2,Oracle AP,12,Oracle Apex,1,Oracle APIs,4,Oracle Application Object Library,19,Oracle Applications,10,Oracle Approvals Management,1,Oracle Apps,4,Oracle Apps DBA,2,Oracle Apps Interviews,36,Oracle Apps Tips,9,Oracle Apps Tutorials,98,Oracle AR,18,Oracle Assets,2,Oracle BAM,1,Oracle BI Publisher,1,Oracle BPEL,1,Oracle BPM,1,Oracle Cloud,1,Oracle Cloud Infrastructure,1,Oracle Dabase Structure,2,Oracle Database Architecture,2,Oracle Database Key Tables,3,Oracle EAM,2,Oracle EBS,5,Oracle Financials,2,Oracle Forms And Reports,17,Oracle Forms Interview Questions,6,Oracle Forms Tutorials,6,Oracle GL,4,Oracle Holds,1,Oracle HRMS,10,Oracle Human Resources,1,Oracle Inventory,4,Oracle Payables,1,Oracle Payroll,1,Oracle POTutorials,1,Oracle Purchasing,7,Oracle Reports Interview,9,Oracle Reports Tutorials,3,Oracle SOA,1,Oracle System Administrator,4,Oracle Workflow,4,Order Management,2,Organization ID,3,Organizations,3,Performance Tuning,2,Personalization,1,PL/SQL Block,1,PL/SQL Interview Questions,11,PL/SQL Scripts,44,PL/SQL Tutorials,53,Planned Purchase Orders,1,PO,1,PO Action History,1,PO_ACTION_HISTORY,1,POracle Purchasing,1,PR,1,Procedures And Functions,2,Profile Options,2,Purchase Orders,1,Purchase Requisition,2,Receipts,1,Request Groups,1,Responsibility,1,Shell Script,1,SOA Tutorials,4,Social Media,1,Software Industry,2,Software Tools,1,SQL And PL/SQL Interview,38,SQL Interview,52,SQL Scripts,38,SQL Tutorials,43,Standard Purchase Orders,1,Troubleshooting,1,Unexpected error,1,Unix/Linux Commands,3,User,1,Value Sets,1,Weblogic,1,XML Publisher,4,
Oracle Apps Guy: Oracle 10g Interview Questions & Answers
Oracle 10g Interview Questions & Answers
Oracle 10g Interview Questions & Answers,250+ Oracle 10g Interview Questions and Answers, Question1: what is Oracle 10g? Question2: Why is a UNION ALL faster than a UNION? Question3: What are some advantages to using Oracle's CREATE DATABASE statement to create a new database manually? Question4: What are the pros and cons of using triggers?
Oracle Apps Guy
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content