DATABASE Administrator (DBA) Interview Questions What is a DBA? What DBA activities did you to do today? What are the different modes of mounting a Database with the Parallel Server? What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode? Do you consider yourself a development DBA or a production DBA and why? What are the Large object types suported by Oracle? Diffrence between a “where” clause and a “having” claus Shall we create procedures to fetch more than one record? Do View contain Data? What are the Referential actions supported by FOREIGN KEY integrity constraint? What are the type of Synonyms? Where would you look for errors from the database engine? Compare and contrast TRUNCATE and DELETE for a table. Give the reasoning behind using an index. Give the two types of tables involved in producing a star schema and the type of data they hold. What type of index should you use on a fact table? What is a Segment? A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables? Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each. What is a Sequence? Give the stages of instance startup to a usable state where normal users may access it. What is a Synonym? How would you go about generating an EXPLAIN plan? How would you go about increasing the buffer cache hit ratio? Explain an ORA-01555 Explain the difference between $ORACLE_HOME and $ORACLE_BASE. How would you determine the time zone under which a database was operating? Explain the use of setting GLOBAL_NAMES equal to TRUE. What command would you use to encrypt a PL/SQL application? Explain the difference between a FUNCTION, PROCEDURE and PACKAGE. Explain the use of table functions. Name three advisory statistics you can collect. Where in the Oracle directory tree structure are audit traces placed? Explain materialized views and how they are used. What does a Control file Contain? What is difference between UNIQUE constraint and PRIMARY KEY constraint? What is the effect of setting the value “ALL_ROWS” for OPTIMIZER_GOAL parameter of the ALTER SESSION command? Describe what redo logs are. How would you force a log switch? What are the different Parameter types? What does coalescing a tablespace do? What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace? Name a tablespace automatically created when you create a database. When creating a user, what permissions must you grant to allow them to connect to the database? How do you add a data file to a tablespace? How do you resize a data file? What view would you use to look at the size of a data file? What view would you use to determine free space in a tablespace? How would you determine who has added a row to a table? How can you rebuild an index? Explain what partitioning is and what its benefit is. You have just compiled a PL/SQL package but got errors, how would you view the errors? How can you gather statistics on a table? How can you enable a trace for a session? What is the difference between the SQL*Loader and IMPORT utilities? What is a Schema? What is a cluster Key? What?s the command to change the SQL prompt name? What is Parallel Server? How do I eliminate the duplicate rows ? How do I display row number with records? Display the records between two range I know the nvl function only allows the same data type(ie. number or char or date Nvl(comm, 0)), if commission is null then the text ?Not Applicable? want to display, instead of blank space. How do I write the query? Oracle cursor : Implicit & Explicit cursors Explicit Cursor attributes Implicit Cursor attributes Find out nth highest salary from emp table To view installed Oracle version information Display the number value in Words Display Odd/ Even number of records Which date function returns number value? Any three PL/SQL Exceptions? What are PL/SQL Cursor Exceptions? Other way to replace query result null value with a text What are the more common pseudo-columns? What is the output of SIGN function? What is the maximum number of triggers, can apply to a single table? What is a database instance? Explain. What is Parallel Server? What is a schema? What are the options available to refresh snapshots? What is a SNAPSHOT LOG? What is Distributed database? What are the basic element of base configuration of an Oracle database? What is a deadlock? Explain. What is Privilege Auditing? What is Object Auditing? Physical DB Structure Logical DB Structure Tablespaces Online & Offline TS Schema Index Clusters Database Links Data Blocks For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame? Can a field be used in a report without it appearing in any data group? The join defined by the default data link is an outer join yes or no? What UNIX command will control the default file permissions when files are created? Explain the read, write, and execute permissions on a UNIX directory. the difference between a soft link and a hard link? Give the command to display space usage on the UNIX file system. Explain iostat, vmstat and netstat. What is new_form built-in? What is the “LOV of Validation” Property of an item? - What is the use of it? What is the diff. when Flex mode is mode on and when it is off? What is ROWID? What is a correlated subquery? Explain UNION, MINUS, UNION ALL and INTERSECT? What are the types of SQL statement? What is a pseudo column. Give some examples? What is difference between CHAR and VARCHAR2? What do you know about subqueries? What is a database link? How to drop the index ? What are the different types of SQL statements? What are the uses of rollback segment? What is a deadlock and Explain? State any three mouse events system variables? What other parts of your organization do you interact with and how? How do you display console on a window? In exception handling we have some NOT_FOUND and OTHERS. In inner layer we have some NOT_FOUND and OTHERS. While executing which one whether outer layer or inner layer will check first? What are the different types of joins? How will you copy the structure of a table without copying the data? What is a VIEW? How to get script for a view? What is a “trigger”? Explain the difference between a hot backup and a cold backup and the benefits associated with each. What cursor type do you use to retrieve multiple recordsets? What is the difference among “dropping a table”, “truncating a table” and “deleting all records” from a table. Difference between “ORACLE” and “MICROSOFT ACCESS” databases. How to remove duplicate records from a table? Are you a nuts-n-bolts DBA or a tools-n-props DBA How to create a database link? What is SQL*Loader? How to run SQL script from a Unix Shell? Talk about “Exception Handling” in PL/SQL? Give some examples of Analytical functions What is Log Switch? What is On-line Redo Log? Which parameter specified in the DEFAULT STORAGE clause of CREATE TABLESPACE cannot be altered after creating the tablespace? What are the steps involved in Database Startup? What are the steps involved in Instance Recovery? Can Full Backup be performed when the database is open? You have just had to restore from backup and do not have any control files. How would you go about bringing up this database? What are the steps involved in Database Shutdown? What is Archived Redo Log? What is Restricted Mode of Instance Startup? What is Partial Backup? What is Mirrored on-line Redo Log? What is Full Backup? Can a View based on another View? Can a Tablespace hold objects from different Schemes? Can objects of the same Schema reside in different tablespaces? What is the use of Control File? What is your typical day like? How do you switch from an init.ora file to a spfile? Explain the difference between a data block, an extent and a segment. Give two examples of how you might determine the structure of the table DEPT. What is a Redo Log? What is an Index Segment? Explain the relationship among Database, Tablespace and Data file.? What are the different type of Segments? What are Clusters? What is an Integrity Constrains? What is an Index? What is an Extent? What is a View? What is Table? What column differentiates the V$ views to the GV$ views and how? What command would you use to create a backup control file? Give two examples of referential integrity constraints. What is schema? Describe Referential Integrity? What is Hash Cluster? What is a Private Synonyms? What is Database Link? What is a Tablespace? What is Rollback Segment? What are the Characteristics of Data Files? How to define Data Block size? When a user process fails, what background process cleans up after it? What background process refreshes materialized views? How would you determine what sessions are connected and what resources they are waiting for? What is the effect of setting the value “CHOOSE” for OPTIMIZER_GOAL, parameter of the ALTER SESSION Command? What is the function of Optimizer? What is Execution Plan? What are the different approaches used by Optimizer in choosing an execution plan? What does ROLLBACK do? What is SAVE POINT? What are the values that can be specified for OPTIMIZER MODE Parameter? What is COST-based approach to optimization? What does COMMIT do? What is RULE-based approach to optimization? What are the values that can be specified for OPTIMIZER_GOAL parameter of the ALTER SESSION Command? Define Transaction? What is Read-Only Transaction? What is a deadlock? Name two files used for network connection to a database. What?s the command to see the current user name? How do you switch to DOS prompt from SQL prompt? What are the basic element of Base configuration of an oracle Database? What is clusters? What is an Index? - How it is implemented in Oracle Database? What is a Database instance? What is the use of ANALYZE command? What is default tablespace? What are the system resources that can be controlled through Profile? What is Tablespace Quota? What are the different Levels of Auditing? What is Statement Auditing? What are the database administrators utilities available? How can you enable automatic archiving? What are roles? How can we implement roles? What are the use of Roles? Auditing Audit Trial What is Auditing? What are the responsibilities of a Database Administrator? What is a trace file and how is it created? What is a profile? How will you enforce security using stored procedures? What are the dictionary tables used to monitor a database spaces? What are the roles and user accounts created automatically with the database? What are the minimum parameters should exist in the parameter file (init.ora)? How can we specify the Archived log file name format and destination? What is user Account in Oracle database? What dynamic data replication? What is Two-Phase Commit? How can you Enforce Referential Integrity in snapshots? What is a SQL * NET? What is a SNAPSHOT? What is the mechanism provided by ORACLE for table replication? What is snapshots? What are the various type of snapshots? Describe two phases of Two-phase commit? What is snapshot log? What are the benefits of distributed options in databases? What is an index? How it is implemented in Oracle database? What are clusters? What is a cluster key? How can we reduce the network traffic? Differentiate simple and complex, snapshots? What are the Built-ins used for sending Parameters to forms? Can you have more than one content canvas view attached with a window? Is the After report trigger fired if the report execution fails? Does a Before form trigger fire when the parameter form is suppressed? Is it possible to split the print reviewer into more than one region? Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size? How do you list the files in an UNIX directory while also showing hidden files? How do you execute a UNIX command in the background? Can a formula column referred to columns in higher group? Can a formula column be obtained through a select statement? If a parameter is used in a query without being previously defined, what diff. exist between report 2.0 and 2.5 when the query is applied? What are the SQL clauses supported in the link property sheet? What is trigger associated with the timer? What are the trigger associated with image items? What are the different windows events activated at runtimes? When do you use data parameter type? What is difference between open_form and call_form? How would you change all occurrences of a value using VI? Give two UNIX kernel parameters that effect an Oracle install Briefly, how do you install Oracle software on UNIX. What is the diff. when confine mode is on and when it is off? What are visual attributes? Which of the two views should objects according to possession? What are the two types of views available in the object navigator (specific to report 2.5)? What are the vbx controls? What is the use of transactional triggers? How do you create a new session while open a new form? What are the ways to monitor the performance of the report? If two groups are not linked in the data model editor, What is the hierarchy between them? An open form can not be execute the call_form procedure if you chain of called forms has been initiated by another open form? Explain about horizontal, Vertical tool bar canvas views? What is the purpose of the product order option in the column property sheet? What is the use of image_zoom built-in? How do you reference a parameter indirectly? Is it possible to insert comments into sql statements return in the data model editor? Is it possible to disable the parameter from while running the report? When a form is invoked with call_form, Does oracle forms issues a save point? Can a property clause itself be based on a property clause? What is a timer? What are the two phases of block coordination? What are Most Common types of Complex master-detail relationships? What is a text list? What is term? What is use of term? What is pop list? What is the maximum no of chars the parameter can store? What are the default extensions of the files created by library module? What are the Coordination Properties in a Master-Detail relationship? What is an index and How it is implemented in Oracle database? Lot of users are accessing select sysdate from dual and they getting some millisecond differences. If we execute SELECT SYSDATE FROM EMP; what error will we get. Why? Give two methods you could use to determine what DDL changes have been made. What are the types of calculated columns available? Explain about stacked canvas views? What are the built_ins used the display the LOV? What is the difference between SHOW_EDITOR and EDIT_TEXTITEM? What are the built-ins that are used to Attach an LOV programmatically to an item? How do you call other Oracle Products from Oracle Forms? What is the main diff. bet. Reports 2.0 & Reports 2.5? What are the different file extensions that are created by oracle reports? What is strip sources generate options? What is the basic data structure that is required for creating an LOV? What is the Maximum allowed length of Record group Column? Which parameter can be used to set read level consistency across multiple queries? What are the different types of Record Groups? From which designation is it preferred to send the output to the printed? what are difference between post database commit and post-form commit? What are the different display styles of list items? Which of the above methods is the faster method? With which function of summary item is the compute at options required? What are parameters? What are the three types of user exits available? How many windows in a form can have console? If the maximum record retrieved property of the query is set to 10 then a summary value will be calculated? What are the two repeating frame always associated with matrix object? What are the master-detail triggers? What are the different objects that you cannot copy or reference in object groups? What is an OLE? Is it possible to modify an external query in a report which contains it? Does a grouping done for objects in the layout editor affect the grouping done in the data model editor? Can a repeating frame be created without a data group as a base? If a break order is set on a column would it affect columns which are under the column? Is it possible to set a filter condition in a cross product group in matrix reports? Do user parameters appear in the data modal editor in 2.5? Can you pass data parameters to forms? Is it possible to link two groups inside a cross products after the cross products group has been created? What are the different modals of windows? What are modal windows? What are the different default triggers created when Master Deletes Property is set to Non-isolated? What are the different default triggers created when Master Deletes Property is set to isolated? What are the different default triggers created when Master Deletes Property is set to Cascade? What is the diff. bet. setting up of parameters in reports 2.0 reports2.5? What are the difference between lov & list item? What is the advantage of the library? What is lexical reference? What is system.coordination_operation? What is synchronize? What use of command line parameter cmd file? What is a Text_io Package? What is forms_DDL? How is link tool operation different bet. reports 2 & 2.5? What are the different styles of activation of ole Objects? How do you reference a Parameter? What is the difference between object embedding and linking in Oracle forms? Name of the functions used to get/set canvas properties? What are the built-ins that are used for setting the LOV properties at runtime? What are the built-ins used for processing rows? What are built-ins used for Processing rows? What are the built-in used for getting cell values? What are the built-ins used for Getting cell values? A tleast how many set of data must a data model have before a data model can be base on it? To execute row from being displayed that still use column in the row which property can be used? What are different types of modules available in oracle form? What is the remove on exit property? What is WHEN-Database-record trigger? What is a difference between pre-select and pre-query? What are built-ins associated with timers? What are the built-ins used for finding object ID functions? What are the built-ins used for finding Object ID function? Any attempt to navigate programmatically to disabled form in a call_form stack is allowed? Use the Add_group_row procedure to add a row to a static record group 1. true or false? Use the add_group_column function to add a column to record group that was created at a design time? What are the various sub events a mouse double click event involves? How can a break order be created on a column in an existing group? What is the use of place holder column? What is the use of hidden column? What is the use of break group? What is an anchoring object and what is its use? What are the various sub events a mouse double click event involves? What are the default parameter that appear at run time in the parameter screen? What are the built-ins used for Creating and deleting groups? What are different types of canvas views? What are the different types of Delete details we can establish in Master-Details? What is relation between the window and canvas views? What is a User_exit? How is it possible to select generate a select set for the query in the query property sheet? How can values be passed between precompiler exits & Oracle call interface? How can a square be drawn in the layout editor of the report writer? How can a text file be attached to a report while creating in the report writer? How can I message to passed to the user from reports? How is possible to restrict the user to a list of values while entering values for parameters? How can a button be used in a report to give a drill down facility? How can a cross product be created? What are different types of images? What is the difference between boiler plat images and image items? What is bind reference and how can it be created? What are the triggers available in the reports? Give the sequence of execution of the various report triggers? Why is a Where clause faster than a group filter or a format trigger? Why is it preferable to create a fewer no. of queries in the data model? Where is the external query executed at the client or the server? Where is a procedure return in an external pl/SQL library executed at the client or at the server? What is coordination Event? What is the difference between OLE Server & OLE Container? What is an object group? What is an LOV? At what point of report execution is the before Report trigger fired? What are the built -ins used for Modifying a groups structure? What is an user exit used for? What is the User-Named Editor? What are the Built-ins to display the user-named editor? What is a Static Record Group? What is a record group? How many number of columns a record group can have? What is a Query Record Group? What is a property clause? What is a physical page? What is a logical page? What does the term panel refer to with regarda to pages? What is a master detail relationship? What is a library? How can a group in a cross products be visually distinguished from a group that does not form a cross product? What is the frame & repeating frame? What is a combo box? What are three panes that appear in the run time pl/SQL interpreter? What are the two panes that Appear in the design time pl/SQL interpreter? What are the two ways by which data can be generated for a parameters list of values? What are the various methods of performing a calculation in a report? What are the default extensions of the files created by menu module? It is possible to use raw devices as data files and what is the advantages over file system files? What are disadvantages of having raw devices? What is the significance of having storage clause? What is the use of INCTYPE option in EXP command? What is the use of FILE option in IMP command? What is a Shared SQL pool? What is hot backup and how it can be taken? List the Optional Flexible Architecture (OFA) of Oracle database? How can we organize the tablespaces in Oracle database to have maximum performance? How to implement the multiple control files for an existing database? What is advantage of having disk shadowing/ Mirroring? How will you force database to use particular rollback segment? Give one method for transferring a table from one schema to another What is the purpose of the IMPORT option IGNORE? What is it?s default setting? You have a rollback segment in a version 7.2 database that has expanded beyond optimal, how can it be restored to optimal? If the DEFAULT and TEMPORARY tablespace clauses are left out of a CREATE USER command what happens? Is this bad or good? Why? What are some of the Oracle provided packages that DBAs should be aware of? What happens if the constraint name is left out of a constraint clause? What happens if a tablespace clause is left off of a primary key constraint clause? What is the proper method for disabling and re-enabling a primary key constraint? What happens if a primary key constraint is disabled and then enabled without fully specifying the index clause? (On UNIX) When should more than one DB writer process be used? How many should be used? You are using hot backup without being in archivelog mode, can you recover in the event of a failure? Why or why not? What causes the "snapshot too old" error? How can this be prevented or mitigated? How can you tell if a database object is invalid? A user is getting an ORA-00942 error yet you know you have granted them permission on the table, what else should you check? A developer is trying to create a view and the database won?t let him. He has the "DEVELOPER" role which has the "CREATE VIEW" system privilege and SELECT grants on the tables he is using, what is the problem? If you have an example table, what is the best way to get sizing data for the production table implementation? How can you find out how many users are currently logged into the database? How can you find their operating system id? A user selects from a sequence and gets back two values, his select is: How can you determine if an index needs to be dropped and rebuilt? A tablespace has a table with 30 extents in it. Is this bad? Why or why not. How do you set up tablespaces during an Oracle installation? You see multiple fragments in the SYSTEM tablespace, what should you check first? What are some indications that you need to increase the SHARED_POOL_SIZE parameter? What is the general guideline for sizing db_block_size and db_multi_block_read for an application that does many full table scans? What is the fastest query method for a table? Explain the use of TKPROF? What initialization parameter should be turned on to get full TKPROF output? When looking at v$sysstat you see that sorts (disk) is high. Is this bad or good? If bad How do you correct it? When should you increase copy latches? What parameters control copy latches? Where can you get a list of all initialization parameters for your instance? How about an indication if they are default settings or have been changed? Describe hit ratio as it pertains to the database buffers. What is the difference between instantaneous and cumulative hit ratio and which should be used for tuning? Discuss row chaining, how does it happen? How can you reduce it? How do you correct it? When looking at the estat events report you see that you are getting busy buffer waits. Is this bad? How can you find what is causing it? If you see contention for library caches how can you fix it? If you see statistics that deal with "undo" what are they really talking about? If a tablespace has a default pctincrease of zero what will this cause (in relationship to the smon process)? If a tablespace shows excessive fragmentation what are some methods to defragment the tablespace? (7.1,7.2 and 7.3 only) How can you tell if a tablespace has excessive fragmentation? You see the following on a status report: redo log space requests 23; redo log space wait time 0; Is this something to worry about? What if redo log space wait time is high? How can you fix this? What can cause a high value for recursive calls? How can this be fixed? If you see a pin hit ratio of less than 0.8 in the estat library cache report is this a problem? If so, how do you fix it? If you see the value for reloads is high in the estat library cache report is this a matter for concern? You look at the dba_rollback_segs view and see that there is a large number of shrinks and they are of relatively small size, is this a problem? How can it be fixed if it is a problem? DataBase Administrator (DBA) Interview Questions and Answers What is a DBA? A DBA is a Database Administrator, and this is the most common job that you find a database specialist doing. There are Development DBAs and Production DBAs. A Development DBA usually works closely with a team of developers and gets more involved in design decisions, giving advice on performance and writing good SQL. That can be satisfying at a human level because you are part of a team and you share the satisfaction of the team's accomplishments. A Production DBA (on the other hand) is responsible for maintaining Databases within an organisation, so it is a very difficult and demanding job. He or she, often gets involved when all the design decisions have been made, and has simply to keep things up and running. Therefore, of course, it is also a rewarding job, both financially and in terms of job satisfaction. But it's a more 'lonely' job than being a Development DBA. 1. What DBA activities did you to do today? This is a loaded question and almost begs for you to answer it with "What DBA activities do you LIKE to do on a daily basis?." And that is how I would answer this question. Again, do not get caught up in the "typical" day-to-day operational issues of database administration. Sure, you can talk about the index you rebuilt, the monitoring of system and session waits that were occurring, or the space you added to a data file, these are all good and great and you should convey that you understand the day-to-day operational issues. What you should also throw into this answer are the meetings that you attend to provide direction in the database arena, the people that you meet and talk with daily to answer adhoc questions about database use, the modeling of business needs within the database, and the extra time you spend early in the morning or late at night to get the job done. Just because the question stipulates "today" do not take "today" to mean "today." Make sure you wrap up a few good days into "today" and talk about them. This question also begs you to ask the question of "What typical DBA activities are performed day to day within X Corporation?" 2. What are the different modes of mounting a Database with the Parallel Server? Exclusive Mode If the first instance that mounts a database does so in exclusive mode, only that Instance can mount the database. Parallel Mode If the first instance that mounts a database is started in parallel mode, other instances that are started in parallel mode can also mount the database. 3. What are the advantages of operating a database in ARCHIVELOG mode over operating it in NO ARCHIVELOG mode? Complete database recovery from disk failure is possible only in ARCHIVELOG mode. Online database backup is possible only in ARCHIVELOG mode. 4. Do you consider yourself a development DBA or a production DBA and why? You take this as a trick question and explain it that way. Never in my database carrier have I distinguished between "development" and "production." Just ask your development staff or VP of engineering how much time and money is lost if development systems are down. Explain to the interviewer that both systems are equally important to the operation of the company and both should be considered as production systems because there are people relying on them and money is lost if either one of them is down. Ok you may be saying, and I know you are, that we lose more money if the production system is down. Ok, convey that to the interviewer and you won't get anyone to disagree with you unless your company sells software or there are million dollar deals on the table that are expecting the next release of your product or service. 5. What are the Large object types suported by Oracle? Answer1 1)bfile - Up to 4 gigabytes –> File locators that point to a read-only binary object outside of the database 2)blob - Up to 4 gigabytes. –> LOB locators that point to a large binary object within the database 3)clob - Up to 4 gigabytes. –> LOB locators that point to a large character object within the database 4)nclob - Up to 4 gigabytes. –>LOB locators that point to a large NLS character object within the database Answer2 These are the large object type supported by oracle • CLOB and LONG for large fixed-width character data • NCLOB for large fixed-width national character set data • BLOB and LONG RAW for storing unstructured data • BFILE for storing unstructured data in operating system files 6. Diffrence between a “where” clause and a “having” claus Answer1 The order of the clauses in a query syntax using a GROUP BY clause is as follows: select …where..group by…having…order by… Where filters, group by arranges into groups, having applies based on group by clause. Having is applied with group by clause. Answer2 In SQL Server, procedures and functions can return values. (In Oracle, procedures cannot directly return a value). The major difference with a function is that it can be used in a value assignment. Such as: –system function Declare @mydate datetime Set @mydate = getdate() –user function (where the user has already coded the function) Declare @My_area Set @My_area = dbo.fn_getMy_area(15,20) Answer3 1.”where” is used to filter records returned by “Select” 2.”where” appears before group by clause 3.In “where” we cannot use aggrigate functions like where count(*) >2 etc 4.”having” appears after group by clause 5.”having” is used to filter records returned by “Group by”< 6.In”Having” we can use aggrigate functions like where count(*) >2 etc there are two more 7. Shall we create procedures to fetch more than one record? Yes. We can create procedures to fetch more than a row. By using CURSOR commands we could able to do that. Ex: CREATE OR REPLACE PROCEDURE myprocedure IS CURSOR mycur IS select id from mytable; new_id mytable.id%type; BEGIN OPEN mycur; LOOP FETCH mycur INTO new_id; exit when mycur%NOTFOUND; –do some manipulations– END LOOP; CLOSE mycur; END myprocedure; In this example iam trying to fetch id from the table mytable. So it fetches the id from each record until EOF. (EXIT when mycur%NOTFOUND-is used to check EOF. For further informations, refer CURSORS. 8. Do View contain Data? Views do not contain or store data. 9. What are the Referential actions supported by FOREIGN KEY integrity constraint? UPDATE and DELETE Restrict - A referential integrity rule that disallows the update or deletion of referenced data. DELETE Cascade - When a referenced row is deleted all associated dependent rows are deleted. 10. What are the type of Synonyms? There are two types of Synonyms Private and Public 11. Where would you look for errors from the database engine? In the alert log. 12. Compare and contrast TRUNCATE and DELETE for a table. Both the truncate and delete command have the desired outcome of getting rid of all the rows in a table. The difference between the two is that the truncate command is a DDL operation and just moves the high water mark and produces a new rollback. The delete command, on the other hand, is a DML operation, which will produce a rollback and thus take longer to complete. 13. Give the reasoning behind using an index. Faster access to data blocks in a table. 14. Give the two types of tables involved in producing a star schema and the type of data they hold. Fact tables and dimension tables. A fact table contains measurements while dimension tables will contain data that will help describe the fact tables. 15. What type of index should you use on a fact table? A Bitmap index. 16. What is a Segment? A segment is a set of extents allocated for a certain logical structure. 17. A table is classified as a parent table and you want to drop and re-create it. How would you do this without affecting the children tables? Disable the foreign key constraint to the parent, drop the table, re-create the table, enable the foreign key constraint. 18. Explain the difference between ARCHIVELOG mode and NOARCHIVELOG mode and the benefits and disadvantages to each. ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all transactions that have occurred in the database so that you can recover to any point in time. NOARCHIVELOG mode is basically the absence of ARCHIVELOG mode and has the disadvantage of not being able to recover to any point in time. NOARCHIVELOG mode does have the advantage of not having to write transactions to an archive log and thus increases the performance of the database slightly. 19. What is a Sequence? A sequence generates a serial list of unique numbers for numerical columns of a database’s tables. 20. Give the stages of instance startup to a usable state where normal users may access it. STARTUP NOMOUNT - Instance startup STARTUP MOUNT - The database is mounted STARTUP OPEN - The database is opened 21. What is a Synonym? A synonym is an alias for a table, view, sequence or program unit. 22. How would you go about generating an EXPLAIN plan? Create a plan table with utlxplan.sql. Use the explain plan set statement_id = 'tst1' into plan_table for a SQL statement Look at the explain plan with utlxplp.sql or utlxpls.sql 23. How would you go about increasing the buffer cache hit ratio? Use the buffer cache advisory over a given workload and then query the v$db_cache_advice table. If a change was necessary then I would use the alter system set db_cache_size command. 24. Explain an ORA-01555 You get this error when you get a snapshot too old within rollback. It can usually be solved by increasing the undo retention or increasing the size of rollbacks. You should also look at the logic involved in the application getting the error message. 25. Explain the difference between $ORACLE_HOME and $ORACLE_BASE. ORACLE_BASE is the root directory for oracle. ORACLE_HOME located beneath ORACLE_BASE is where the oracle products reside. 26. How would you determine the time zone under which a database was operating? select DBTIMEZONE from dual; 27. Explain the use of setting GLOBAL_NAMES equal to TRUE. Setting GLOBAL_NAMES dictates how you might connect to a database. This variable is either TRUE or FALSE and if it is set to TRUE it enforces database links to have the same name as the remote database to which they are linking. 28. What command would you use to encrypt a PL/SQL application? WRAP 29. Explain the difference between a FUNCTION, PROCEDURE and PACKAGE. A function and procedure are the same in that they are intended to be a collection of PL/SQL code that carries a single task. While a procedure does not have to return any values to the calling application, a function will return a single value. A package on the other hand is a collection of functions and procedures that are grouped together based on their commonality to a business function or application. 30. 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. 31. Name three advisory statistics you can collect. Buffer Cache Advice, Segment Level Statistics, & Timed Statistics 32. Where in the Oracle directory tree structure are audit traces placed? In unix $ORACLE_HOME/rdbms/audit, in Windows the event viewer 33. Explain materialized views and how they are used. Materialized views are objects that are reduced sets of information that have been summarized, grouped, or aggregated from base tables. They are typically used in data warehouse or decision support systems. 34. What does a Control file Contain? A Control file records the physical structure of the database. It contains the following information. Database Name Names and locations of a database’s files and redolog files. Time stamp of database creation. 35. What is difference between UNIQUE constraint and PRIMARY KEY constraint? A column defined as UNIQUE can contain Nulls while a column defined as PRIMARY KEY can’t contain Nulls. 47.What is Index Cluster? - A Cluster with an index on the Cluster Key 48.When does a Transaction end? - When it is committed or Rollbacked. 36. What is the effect of setting the value “ALL_ROWS” for OPTIMIZER_GOAL parameter of the ALTER SESSION command? What are the factors that affect OPTIMIZER in choosing an Optimization approach? - Answer The OPTIMIZER_MODE initialization parameter Statistics in the Data Dictionary the OPTIMIZER_GOAL parameter of the ALTER SESSION command hints in the statement. 37. Describe what redo logs are. Redo logs are logical and physical structures that are designed to hold all the changes made to a database and are intended to aid in the recovery of a database. 38. How would you force a log switch? ALTER SYSTEM SWITCH LOGFILE; 39. What are the different Parameter types? Text ParametersData Parameters 40. What does coalescing a tablespace do? Coalescing is only valid for dictionary-managed tablespaces and de-fragments space by combining neighboring free extents into large single extents. 41. What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace? 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. 42. Name a tablespace automatically created when you create a database. The SYSTEM tablespace. 43. When creating a user, what permissions must you grant to allow them to connect to the database? Grant the CONNECT to the user. 44. How do you add a data file to a tablespace? ALTER TABLESPACE ADD DATAFILE <datafile_name> SIZE <size> 45. How do you resize a data file? ALTER DATABASE DATAFILE <datafile_name> RESIZE <new_size>; 46. What view would you use to look at the size of a data file? DBA_DATA_FILES 47. What view would you use to determine free space in a tablespace? DBA_FREE_SPACE 48. How would you determine who has added a row to a table? Turn on fine grain auditing for the table. 49. How can you rebuild an index? ALTER INDEX <index_name> REBUILD;. 50. Explain what partitioning is and what its benefit is. Partitioning is a method of taking large tables and indexes and splitting them into smaller, more manageable pieces. 51. You have just compiled a PL/SQL package but got errors, how would you view the errors? SHOW ERRORS 52. How can you gather statistics on a table? The ANALYZE command. 53. How can you enable a trace for a session? Use the DBMS_SESSION.SET_SQL_TRACE or Use ALTER SESSION SET SQL_TRACE = TRUE; 54. 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 formatted or delimited files. 55. What is a Schema? The set of objects owned by user account is called the schema. 56. What is a cluster Key? 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. 55. What?s the command to change the SQL prompt name? SQL> set sqlprompt ?database-1 > ? database-1 > database-1 > 56. What is Parallel Server? Multiple instances accessing the same database (Only In Multi-CPU environments) 57. How do I eliminate the duplicate rows ? SQL> delete from table_name where rowid not in (select max(rowid) from table group by duplicate_values_field_name); or SQL> delete duplicate_values_field_name dv from table_name ta where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv); Example. Table Emp Empno Ename 101 Scott 102 Jiyo 103 Millor 104 Jiyo 105 Smith delete ename from emp a where rowid < ( select min(rowid) from emp b where a.ename = b.ename); The output like, Empno Ename 101 Scott 102 Millor 103 Jiyo 104 Smith 58. How do I display row number with records? Answer1 To achive this use rownum pseudocolumn with query, like SQL> SQL> select rownum, ename from emp; Output: 1 Scott 2 Millor 3 Jiyo 4 Smith Answer2 select rownum ,ename from emp; Output: 1 smith 2 john 3 king 4 scott 59. Display the records between two range select rownum, empno, ename from emp where rowid in (select rowid from emp where rownum <=&upto minus select rowid from emp where rownum<&Start); Enter value for upto: 10 Enter value for Start: 7 ROWNUM EMPNO ENAME --------- --------- ---------1 7782 CLARK 2 7788 SCOTT 3 7839 KING 4 7844 TURNER 60. I know the nvl function only allows the same data type(ie. number or char or date Nvl(comm, 0)), if commission is null then the text ?Not Applicable? want to display, instead of blank space. How do I write the query? SQL> select nvl(to_char(comm.),'NA') from emp; Output : NVL(TO_CHAR(COMM),'NA') ----------------------NA 300 500 NA 1400 NA NA 61. Oracle cursor : Implicit & Explicit cursors Oracle uses work areas called private SQL areas to create SQL statements. PL/SQL construct to identify each and every work are used, is called as Cursor. For SQL queries returning a single row, PL/SQL declares all implicit cursors. For queries that returning more than one row, the cursor needs to be explicitly declared. 62. Explicit Cursor attributes There are four cursor attributes used in Oracle cursor_name%Found, cursor_name%NOTFOUND, cursor_name%ROWCOUNT, cursor_name%ISOPEN 63. Implicit Cursor attributes Same as explicit cursor but prefixed by the word SQL SQL%Found, SQL%NOTFOUND, SQL%ROWCOUNT, SQL%ISOPEN Tips : 1. Here SQL%ISOPEN is false, because oracle automatically closed the implicit cursor after executing SQL statements. 2. All are Boolean attributes. 64. Find out nth highest salary from emp table SELECT DISTINCT (a.sal) FROM EMP A WHERE &N = (SELECT COUNT (DISTINCT (b.sal)) FROM EMP B WHERE a.sal<=b.sal); Enter value for n: 2 SAL --------3700 65. To view installed Oracle version information SQL> select banner from v$version; 66. Display the number value in Words SQL> select sal, (to_char(to_date(sal,'j'), 'jsp')) from emp; the output like, SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP')) --------- ----------------------------------------800 eight hundred 1600 one thousand six hundred 1250 one thousand two hundred fifty If you want to add some text like, Rs. Three Thousand only. SQL> select sal "Salary ", (' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.')) "Sal in Words" from emp / Salary Sal in Words ------- ------------------------------------------800 Rs. Eight Hundred only. 1600 Rs. One Thousand Six Hundred only. 1250 Rs. One Thousand Two Hundred Fifty only. 67. Display Odd/ Even number of records Odd number of records: select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp); 1 3 5 Even number of records: select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp) 2 4 6 68. Which date function returns number value? months_between 69. Any three PL/SQL Exceptions? Too_many_rows, No_Data_Found, Value_Error, Zero_Error, Others 70. What are PL/SQL Cursor Exceptions? Cursor_Already_Open, Invalid_Cursor 71. Other way to replace query result null value with a text SQL> Set NULL ?N/A? to reset SQL> Set NULL ?? 72. What are the more common pseudo-columns? SYSDATE, USER , UID, CURVAL, NEXTVAL, ROWID, ROWNUM 73. What is the output of SIGN function? 1 for positive value, 0 for Zero, -1 for Negative value. 74. What is the maximum number of triggers, can apply to a single table? 12 triggers. 75. What is a database instance? Explain. 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. 76. What is Parallel Server? Multiple instances accessing the same database (only in multi-CPU environments) 77. What is a schema? Answer1 The set of objects owned by user account is called the schema. Answer2 Schema is the complete design of the database or data objects. 78. What are the options available to refresh snapshots? COMPLETE - Tables are completely regenerated using the snapshots query and the master tables every time the snapshot referenced. FAST - If simple snapshot used then a snapshot log can be used to send the changes to the snapshot tables. FORCE - Default value. If possible it performs a FAST refresh; Otherwise it will perform a complete refresh. 79. What is a SNAPSHOT LOG? A snapshot log is a table in the master database that is associated with the master table. ORACLE uses a snapshot log to track the rows that have been updated in the master table. Snapshot logs are used in updating the snapshots based on the master table. 80. What is Distributed database? A distributed database is a network of databases managed by multiple database servers that appears to a user as single logical database. The data of all databases in the distributed database can be simultaneously accessed and modified. 81. What are the basic element of base configuration of an Oracle database? It consists of one or more data files. one or more control files. two or more redo log files. The Database contains multiple users/schemas one or more rollback segments one or more tablespaces Data dictionary tables User objects (table,indexes,views etc.,) The server that access the database consists of SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool) SMON (System MONito) PMON (Process MONitor) LGWR (LoG Write) DBWR (Data Base Write) ARCH (ARCHiver) CKPT (Check Point) RECO Dispatcher User Process with associated PGS 82. What is a deadlock? Explain. Two processes waiting to update the rows of a table, which are locked by other processes then deadlock arises. In a database environment this will often happen because of not issuing the proper row lock commands. Poor design of front-end application may cause this situation and the performance of server will reduce drastically. These locks will be released automatically when a commit/rollback operation performed or any one of this processes being killed externally. 83. What is Privilege Auditing? Privilege auditing is the auditing of the use of powerful system privileges without regard to specifically named objects. 84. What is Object Auditing? Object auditing is the auditing of accesses to specific schema objects without regard to user. 85. Physical DB Structure ORACLE db consists of atleast one or more data files, two or more redo log files & one or more control files. The files of a db provide the actual physical storage for db info. 86. Logical DB Structure ORACLE db consists of one or more tablespaces, the db schema??s objects (i.e. tables, views, indexes, clusters, sequences, sp). Tablespaces, Segments, Extents dictate how physical space of a db is used. 86. Tablespaces A db is divided into logical storage units called TS. TS is used to group related logical structures together. Each db is logically divided into one or more TS. One or more data files are explicitly created for each TS to physically store the data of all logical structures in a TS. Combined size of the data file is the total storage capacity of TS. Combined storage capacity of the TS??s is the total storage capacity of the db. 87. Online & Offline TS A TS can be online (accessible) or offline (not accessible). A TS can be offline to make portion of the db unavailable while allowing normal access for the remainder of the db to make administrative tasks easier. 88. Schema Schema is a collection of objects. Schema Objects are the logical structures that directly refer to the db??s data. Schema objects includes tables, views, sequences, synonyms, stored procedures, indexes, clusters & db links. No relation between ts & schema. Objects in same schema can be in diff. ts & vice versa. 89. Index Clusters Index Clusters are group of one or more tables physically stored together because they share common columns & are often used together. The related columns of the tables in a cluster is called cluster key. The data in a cluster key of an index cluster is store only once for multiple tables, so disk access time improves. 90. Index Clusters Hash Clusters : Also cluster table data in a manner similar to normal cluster. 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 stored together on disk. Hash clusters are better than using indexed table or indexed clusters when a table is queried with equality queries. For such queries, the specified cluster key is hashed. The resulting hash key value points directly to the area on disk that stores the specified rows. 91. Database Links Database Links is a name object that describes a path from one db to another. DB links are implicitly used when a reference is made to a global object name in a distributed db. 91. Data Blocks At the finest level of granularity, an ORACLE db??s data is stored in data blocks. One data block corresponds to a specific number of bytes of physical db space on a disk. A data block size is specified when the db is created. A db uses & allocates free db space in ORACLE data blocks. 91. Data Blocks At the finest level of granularity, an ORACLE db??s data is stored in data blocks. One data block corresponds to a specific number of bytes of physical db space on a disk. A data block size is specified when the db is created. A db uses & allocates free db space in ORACLE data blocks. Every DBA should know something about the operating system that the database will be running on. The questions here are related to UNIX but you should equally be able to answer questions related to common Windows environments. 92. For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame? Yes 93. Can a field be used in a report without it appearing in any data group? Yes 94. The join defined by the default data link is an outer join yes or no? Yes 95. What UNIX command will control the default file permissions when files are created? Umask 96. Explain the read, write, and execute permissions on a UNIX directory. Read allows you to see and list the directory contents. Write allows you to create, edit and delete files and subdirectories in the directory. Execute gives you the previous read/write permissions plus allows you to change into the directory and execute programs or shells from the directory. 97. the difference between a soft link and a hard link? A symbolic (soft) linked file and the targeted file can be located on the same or different file system while for a hard link they must be located on the same file system. 99. Give the command to display space usage on the UNIX file system. df -lk 100. Explain iostat, vmstat and netstat. Iostat reports on terminal, disk and tape I/O activity. Vmstat reports on virtual memory statistics for processes, disk, tape and CPU activity. Netstat reports on the contents of network data structures. 101. What is new_form built-in? When one form invokes another form by executing new_form oracle form exits the first form and releases its memory before loading the new form calling new form completely replace the first with the second. If there are changes pending in the first form, the operator will be prompted to save them before the new form is loaded. 102. What is the “LOV of Validation” Property of an item? - What is the use of it? When LOV for Validation is set to True, Oracle Forms compares the current value of the text item to the values in the first column displayed in the LOV. Whenever the validation event occurs. If the value in the text item matches one of the values in the first column of the LOV, validation succeeds, the LOV is not displayed, and processing continues normally. If the value in the text item does not match one of the values in the first column of the LOV, Oracle Forms displays the LOV and uses the text item value as the search criteria to automatically reduce the list. 103. What is the diff. when Flex mode is mode on and when it is off? When flex mode is on, reports automatically resizes the parent when the child is resized. 104. What is ROWID? Answer1 For each row in the database, the ROWID pseudocolumn returns a row’s address. ROWID values contain information necessary to locate a row: * which data block in the data file * which row in the data block (first row is 0) * which data file (first file is 1) Answer2 .row id: A rowid is a pseudo-column that uniquely identifies a row in a table, but not within a data base. 105. What is a correlated subquery? A correlated subquery is a SELECT statement nested inside another T-SQL statement, which contains a reference to one or more columns in the outer query 106. Explain UNION, MINUS, UNION ALL and INTERSECT? The UNION command is used to select related information from two tables, much like the JOIN command. However, when using the UNION command all selected columns need to be of the same data type.The UNION ALL command is equal to the UNION command, except that UNION ALL selects all values.INTERSECT - Return only those rows that are in *both* SELECT statements.MINUS - Return the rows that are in the first SELECT but not the second. 107. What are the types of SQL statement? 4 TYPES OF SQL STATEMENTS ARE THERE Select (default) Insert Update Delete 108. What is a pseudo column. Give some examples? pseudo columns are used to access object content and other information examples:: rowid versions_xid versions_operation versions_startscn versions_endscn sysdate systimestamp rownum ora_rowscn object_value level (only in hierarchical queries with connect by user 109. What is difference between CHAR and VARCHAR2? The difference between a CHAR and a VARCHAR is that a CHAR(n) will ALWAYS be N bytes long, it will be blank padded upon insert to ensure this. A varchar2(n) on the other hand will be 1 to N bytes long, it will NOT be blank padded 110. What do you know about subqueries? A subquery is a query within a query. In Oracle, you can create subqueries within your SQL statements. These subqueries can reside in the WHERE clause, the FROM clause, or the SELECT clause. 111. What is a database link? It is a named object that describes a ‘path’ from one database to another. 112. How to drop the index ? drop index index-name;. 113. What are the different types of SQL statements? SQL statements are divided into five categories: Data manipulation language (DML). Data definition language (DDL). Transaction control. Session control. System control 114. What are the uses of rollback segment? If we find any problem after data manipulation and if we want to undo it, then we can use this ROLLBACK segment. SAVEPOINT is the command used to save the workdone. After saving data, if we want to perform insertion/deletion and we done it wrongly, then we can ROLLBACK it by using the SAVEPOINT. Ex: SAVEPOINT s1; ROLLBACK s1; 115. What is a deadlock and Explain? Waiting for an event that never happens or processed. Ex : Say there are three process P1, P2, P3 and three resources R1, R2, R3. (1) P1 is started and it is using R1. (2) P2 is started and it is using R2. (3) P3 is started and it is using R3. To complete process P1 it needs resource R2 which is currently used by P2. To complete process P2 it needs resource R3 which is currently used by P3. To complete process P3 it needs resource R1 which is currently used by P1. In this case each and every process is waiting for unoccured events. This situation we called as DEADLOCK. To prevent this concept is there called DEADLOCK PREVENTION. 116. State any three mouse events system variables? System.mouse_button_pressedSystem.mouse_button_shift 117. What other parts of your organization do you interact with and how? Again, if you have exhausted question 1 and 2 you may never get to this question. But if you have been apprehensive to opening up and explaining yourself, take note that you may have an issue and the interviewer might also be already getting tired of the interview process. If you get to this question consider yourself in trouble. You really need to forget all your hang-ups and start explaining what it is that you like to do as a DBA, and why you want to work for this particular company. You are going to have to reel this interviewer back into the interview process or you might not get to the true technical question part of the interview. 118. How do you display console on a window? The console includes the status line and message line, and is displayed at the bottom of the window to which it is assigned. To specify that the console should be displayed, set the console window form property to the name of any window in the form. To include the console, set console window to Null. 119. In exception handling we have some NOT_FOUND and OTHERS. In inner layer we have some NOT_FOUND and OTHERS. While executing which one whether outer layer or inner layer will check first? Once you got inside the OUTER_LOOP, it comes out only after the NOTFOUND statement. So OUTER_LOOP will be valuated first.Its similar to ‘C’ language, first OUTER_LOOP will valuated followed by an INNER_LOOP. 120. What are the different types of joins? Different Types of JoinsInner Join Outer Join - Right Outer Join Left Outer Join Cross Join 121. How will you copy the structure of a table without copying the data? Answer1 create table xyz as ( select * from abc where 1=0) Answer2 create table New_tbl as select * from Old_tbl where rownum Answer3 select top 0 * into xyz from try 122. What is a VIEW? How to get script for a view? Answer1 View is a logical perspective of a Table. It is a predefined set of query on a table through which we can perform any kind of select queries instead of redefining the condition every time. Update or Insert Statements cannot be performed through this. Answer2 Update or Insert statements cannot be performed ON View. Answer3 Update or Insert statements cannot be performed ON View is not correct. As I know, if a view meets certain criteria you can update it and such operation will be reflected in the original table. Also, if you are using materialized view, you can insert or update it. 123. What is a “trigger”? Answer1 It’s a piece of sql that is activitied when a certain event happens. Answer2 Trigger is also set of sql comments written together same as stored procedure but the difference is that trigger will be activated each & everytime addition or deletion takes place. 124. Explain the difference between a hot backup and a cold backup and the benefits associated with each. A hot backup is basically taking a backup of the database while it is still up and running and it must be in archive log mode. A cold backup is taking a backup of the database while it is shut down and does not require being in archive log mode. The benefit of taking a hot backup is that the database is still available for use while the backup is occurring and you can recover the database to any point in time. The benefit of taking a cold backup is that it is typically easier to administer the backup and recovery process. In addition, since you are taking cold backups the database does not require being in archive log mode and thus there will be a slight performance gain as the database is not cutting archive logs to disk. 125. What cursor type do you use to retrieve multiple recordsets? REF cursor in oracle 126. What is the difference among “dropping a table”, “truncating a table” and “deleting all records” from a table. DROP…..It will drop the table completely.(all values& table structure) TRUNCATE……All the values in the table will be deleted.(the structure wont be) DELETE….Can be use to delete particular row or all values i table.(structure wont be deleted) 127. Difference between “ORACLE” and “MICROSOFT ACCESS” databases. Answer1 ORACLE ….can be use with a no of platform eg unix,windown,solaris.SQL that is use for retriving data from oracle is known as Transact SQL.ORACLE is very big database compare with MSAcess. MSAcess……Can be use with windows only.SQL use is known just as SQL. Answer2 MSA support only in windows platforms. But oracle available in all platforms. No security and there is no conceprs of schema,users,privilages in access. Aceess is used in small and medium organizations. Oracle is a collection of large no database tools for mangaing data. 128. How to remove duplicate records from a table? Answer1 Sol. DELETE FROM table_name WHERE id=1 LIMIT 1; Answer2 in Oracle:delete from table_name where id = 1 and rowid != (select max(rowid) from table_name where id = 1); Note - min() can be used in place of max(). max() will keep the latest record and min() will keep the oldest record. Answer3 in Oracle:delete from emp where rowid not in (select max(rowid) from emp group by empno); 129. Are you a nuts-n-bolts DBA or a tools-n-props DBA A nuts-n-bolts DBA is the type that likes to figure out every little item about how the database works. He/she is a DBA who typically hates a GUI environment and prefers the command line to execute commands and accomplish tasks. A nuts-n-bolts DBA like to feel in control of the database and only feels comfortable at the command line and vi as an editor. The tools-n-props DBA is mostly the opposite of a nuts-n-bolts DBA, they like the feel of a GUI, the ease at which things can be accomplished without knowing much about the database. They want to get the job done with the least amount of intervention from having to figure out what everything is doing behind the scenes. Now the answer, I would explain myself as a combination of the two. I, having been in this business for over 20 years, have grown up in a command line era where the GUIs never seemed to work. There was high complexity in systems and not much good documentation on how things worked. Thus, I had to learn everything about most aspects of the database environment I was working in and thus became a nuts-n-bolts DBA. I was a true command line and vi bigot. Times have changed and the GUIs are very reliable, understand the environment they are installed on, and can generally get the job done quicker for individuals new to database administration. I too am slowly slipping over to the dark side of GUI administration. If you find yourself as a tools-n-props DBA, try to convey that you are aware of some tasks that require you to be a nuts-n-bolts DBA. 130. How to create a database link? A database link is an object in the local database that allows you to access objects on a remote database or to mount a secondary database in read-only mode. CREATE [PUBLIC] DATABASE LINK dblink [CONNECT TO user IDENTIFIED BY password] [USING ‘connect_string’] 131. What is SQL*Loader? SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database. One can load data into an Oracle database by using the sqlldr (sqlload on some platforms) utility. 132. How to run SQL script from a Unix Shell? The below example shows how to interact oracle from Shell script sqlplus /nolog 133. Talk about “Exception Handling” in PL/SQL? 2 types of Exception In User-defined & Pre-defined.Any Error can be Handled by Pre-defined Exception Handler (Ex. no_data_found,too_many_rows etc.) In User-defined exception has to declare in Declaration section and any exception can be handled by that Exception name. Any types of Exception(User-defined & Pre-defined) can be Handled by When Others exception Handler. 134. Give some examples of Analytical functions rank,dense_rank,rollup,cube etc 135. What is Log Switch? The point at which ORACLE ends writing to one online redo log file and begins writing to another is called a log switch. 136. What is On-line Redo Log? The On-line Redo Log is a set of tow or more on-line redo files that record all committed changes made to the database. Whenever a transaction is committed, the corresponding redo entries temporarily stores in redo log buffers of the SGA are written to an on-line redo log file by the background process LGWR. The on-line redo log files are used in cyclical fashion. 137. Which parameter specified in the DEFAULT STORAGE clause of CREATE TABLESPACE cannot be altered after creating the tablespace? All the default storage parameters defined for the tablespace can be changed using the ALTER TABLESPACE command. When objects are created their INITIAL and MINEXTENS values cannot be changed. 138. What are the steps involved in Database Startup? Start an instance, Mount the Database and Open the Database. 139. What are the steps involved in Instance Recovery? Rolling forward to recover data that has not been recorded in data files, yet has been recorded in the on-line redo log, including the contents of rollback segments. Rolling back transactions that have been explicitly rolled back or have not been committed as indicated by the rollback segments regenerated in step a. Releasing any resources (locks) held by transactions in process at the time of the failure. Resolving any pending distributed transactions undergoing a two-phase commit at the time of the instance failure. 140. Can Full Backup be performed when the database is open? No. 141. You have just had to restore from backup and do not have any control files. How would you go about bringing up this database? I would create a text based backup control file, stipulating where on disk all the data files where and then issue the recover command with the using backup control file clause. 142. What are the steps involved in Database Shutdown? Close the Database, Dismount the Database and Shutdown the Instance. 143. What is Archived Redo Log? Archived Redo Log consists of Redo Log files that have archived before being reused. 144. What is Restricted Mode of Instance Startup? An instance can be started in (or later altered to be in) restricted mode so that when the database is open connections are limited only to those whose user accounts have been granted the RESTRICTED SESSION system privilege. 145. What is Partial Backup? A Partial Backup is any operating system backup short of a full backup, taken while the database is open or shut down. 146. What is Mirrored on-line Redo Log? A mirrored on-line redo log consists of copies of on-line redo log files physically located on separate disks, changes made to one member of the group are made to all members. 147. What is Full Backup? A full backup is an operating system backup of all data files, on- line redo log files and control file that constitute ORACLE database and the parameter. 148. Can a View based on another View? Yes. 149. Can a Tablespace hold objects from different Schemes? Yes. 150. Can objects of the same Schema reside in different tablespaces? Yes. 151. What is the use of Control File? 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. 152. What is your typical day like? If you spend enough time on question 1, this question will never be asked. It is really a continuation of question 1 to try and get you to open up and talk about the type of things you like to do. Personally, I would continue with the theme of question 1 if you are cut short or this question is asked later in the interview process. Just note that this question is not all geared toward the day-to-day operational issues you experience as a DBA. This question also gives you the opportunity to see if they want to know about you as an individual. Since the question did not stipulate "on the job" I would throw in a few items like, I get up at 5:00am to get into work and get some quiet time to read up on new trends or you help coach your son/daughter's soccer team. Just test the waters to what is acceptable. If the interviewer starts to pull you back to "job" related issues, do not go to personal. Also, if you go to the office of the interviewer please notice the surroundings, if there are pictures of his/her family, it is probably a good idea to venture down the personal path. If there is a fly-fishing picture on the wall, do not say you like deep-sea fishing. You get the picture. 153. How do you switch from an init.ora file to a spfile? Issue the create spfile from pfile command. 154. Explain the difference between a data block, an extent and a segment. A data block is the smallest unit of logical storage for a database object. As objects grow they take chunks of additional storage that are composed of contiguous data blocks. These groupings of contiguous data blocks are called extents. All the extents that an object takes when grouped together are considered the segment of the database object. 155. Give two examples of how you might determine the structure of the table DEPT. Use the describe command or use the dbms_metadata.get_ddl package. 156. What is a Redo Log? The set of Redo Log files YSDATE,UID,USER or USERENV SQL functions, or the pseudo columns LEVEL or ROWNUM. 157. What is an Index Segment? Each Index has an Index segment that stores all of its data. 158. Explain the relationship among Database, Tablespace and Data file.? Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace 159. What are the different type of Segments? Data Segment, Index Segment, Rollback Segment and Temporary Segment. 160. What are Clusters? Clusters are groups of one or more tables physically stores together to share common columns and are often used together. 161. What is an Integrity Constrains? An integrity constraint is a declarative way to define a business rule for a column of a table. 162. What is an Index? 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. 163. What is an Extent? An Extent is a specific number of contiguous data blocks, obtained in a single allocation, and used to store a specific type of information. 164. What is a View? 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.) 165. What is Table? 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. 166. What column differentiates the V$ views to the GV$ views and how? The INST_ID column which indicates the instance in a RAC environment the information came from. 167. What command would you use to create a backup control file? Alter database backup control file to trace. 168. Give two examples of referential integrity constraints. A primary key and a foreign key. 169. What is schema? A schema is collection of database objects of a User. 170. Describe Referential Integrity? A rule defined on a column (or set of columns) in one table that allows the insert or update of a row only if the value for the column or set of columns (the dependent value) matches a value in a column of a related table (the referenced value). It also specifies the type of data manipulation allowed on referenced data and the action to be performed on dependent data as a result of any action on referenced data. 171. What is Hash Cluster? 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. 172. What is a Private Synonyms? A Private Synonyms can be accessed only by the owner. 173. What is Database Link? A database link is a named object that describes a “path” from one database to another. 174. What is a Tablespace? A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together 175. What is Rollback Segment? A Database contains one or more Rollback Segments to temporarily store “undo” information. 176. What are the Characteristics of Data Files? 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. 177. How to define Data Block size? 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 datablocks. Block size is specified in INIT.ORA file and can’t be changed latter. 178. When a user process fails, what background process cleans up after it? PMON 179. What background process refreshes materialized views? The Job Queue Processes. 180. How would you determine what sessions are connected and what resources they are waiting for? Use of V$SESSION and V$SESSION_WAIT 181. What is the effect of setting the value “CHOOSE” for OPTIMIZER_GOAL, parameter of the ALTER SESSION Command? The Optimizer chooses Cost_based approach and optimizes with the goal of best throughput if statistics for atleast one of the tables accessed by the SQL statement exist in the data dictionary. Otherwise the OPTIMIZER chooses RULE_based approach. 182. What is the function of Optimizer? The goal of the optimizer is to choose the most efficient way to execute a SQL statement. 183. What is Execution Plan? The combinations of the steps the optimizer chooses to execute a statement is called an execution plan. 184. What are the different approaches used by Optimizer in choosing an execution plan? Rule-based and Cost-based. 185. What does ROLLBACK do? ROLLBACK retracts any of the changes resulting from the SQL statements in the transaction. 186. What is SAVE POINT? For long transactions that contain many SQL statements, intermediate markers or savepoints can be declared which can be used to divide a transaction into smaller parts. This allows the option of later rolling back all work performed from the current point in the transaction to a declared savepoint within the transaction. 187. What are the values that can be specified for OPTIMIZER MODE Parameter? COST and RULE. 188. What is COST-based approach to optimization? Considering available access paths and determining the most efficient execution plan based on statistics in the data dictionary for the tables accessed by the statement and their associated clusters and indexes. 189. What does COMMIT do? COMMIT makes permanent the changes resulting from all SQL statements in the transaction. The changes made by the SQL statements of a transaction become visible to other user sessions transactions that start only after transaction is committed. 190. What is RULE-based approach to optimization? Choosing an executing plan based on the access paths available and the ranks of these access paths. 191. What are the values that can be specified for OPTIMIZER_GOAL parameter of the ALTER SESSION Command? CHOOSE,ALL_ROWS,FIRST_ROWS and RULE. 192. Define Transaction? A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single user. 193. What is Read-Only Transaction? A Read-Only transaction ensures that the results of each query executed in the transaction are consistent with respect to the same point in time. 193. What is a deadlock? Explain . Two processes waiting to update the rows of a table which are locked by the other process then deadlock arises. In a database environment this will often happen because of not issuing proper row lock commands. Poor design of front-end application may cause this situation and the performance of server will reduce drastically. These locks will be released automatically when a commit/rollback operation performed or any one of this processes being killed externally. 194. Name two files used for network connection to a database. TNSNAMES.ORA and SQLNET.ORA 195. What?s the command to see the current user name? Sql> show user; 196. How do you switch to DOS prompt from SQL prompt? SQL> host 197. What are the basic element of Base configuration of an oracle Database? It consists of one or more data files. one or more control files. two or more redo log files. The Database contains multiple users/schemas one or more rollback segments one or more tablespaces Data dictionary tables User objects (table, indexes, views etc.,) The server that access the database consists of SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool) SMON (System MONito) PMON (Process MONitor) LGWR (LoG Write) DBWR (Data Base Write) ARCH (ARCHiver) CKPT (Check Point) RECO Dispatcher User Process with associated PGS 198. What is clusters? Group of tables physically stored together because they share common columns and are often used together is called Cluster. 199. What is an Index? - How it is implemented in Oracle Database? 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 (Ver 7.0) 200. What is a Database instance? Explain A database instance (Server) is a set of memory structure and background processes that access a set of database files. The process can be shared by all users. The memory structure that are used to store most queried data from database. This helps up to improve database performance by decreasing the amount of I/O performed against data file. 201. What is the use of ANALYZE command? To perform one of these function on an index, table, or cluster: - To collect statistics 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 off the table or cluster. 202. What is default tablespace? The Tablespace to contain schema objects created without specifying a tablespace name. 203. What are the system resources that can be controlled through Profile? The number of concurrent sessions the user can establish the CPU processing time available to the user’s session the CPU processing time available to a single call to ORACLE made by a SQL statement the amount of logical I/O available to the user’s session the amount of logical I/O available to a single call to ORACLE made by a SQL statement the allowed amount of idle time for the user’s session the allowed amount of connect time for the user’s session. 204. What is Tablespace Quota? The collective amount of disk space available to the objects in a schema on a particular tablespace. 205. What are the different Levels of Auditing? Statement Auditing, Privilege Auditing and Object Auditing. 206. What is Statement Auditing? Statement auditing is the auditing of the powerful system privileges without regard to specifically named objects 207. What are the database administrators utilities available? SQL * DBA - This allows DBA to monitor and control an ORACLE database. SQL * Loader - It loads data from standard operating system files (Flat files) into ORACLE database tables. Export (EXP) and Import (imp) utilities allow you to move existing data in ORACLE format to and from ORACLE database. 208. How can you enable automatic archiving? Shut the database Backup the database Modify/Include LOG_ARCHIVE_START_TRUE in init.ora file. Start up the database. 209. What are roles? Roles are named groups of related privileges that are granted to users or other roles. 210. How can we implement roles? Roles are the easiest way to grant and manage common privileges needed by different groups of database users. Creating roles and assigning provides to roles. Assign each role to group of users. This will simplify the job of assigning privileges to individual users. 211. What are the use of Roles? REDUCED GRANTING OF PRIVILEGES - Rather than explicitly granting the same set of privileges to many users a database administrator can grant the privileges for a group of related users granted to a role and then grant only the role to each member of the group. DYNAMIC PRIVILEGE MANAGEMENT - When the privileges of a group must change, only the privileges of the role need to be modified. The security domains of all users granted the group’s role automatically reflect the changes made to the role. SELECTIVE AVAILABILITY OF PRIVILEGES - The roles granted to a user can be selectively enable (available for use) or disabled (not available for use). This allows specific control of a user’s privileges in any given situation. APPLICATION AWARENESS - A database application can be designed to automatically enable and disable selective roles when a user attempts to use the application. 212. Auditing To aid in the investigation of suspicious db use. Statement Auditing is the auditing of specific SQL statements. Privilege Auditing is the auditing of the use of powerful system privileges. Object Auditing is the auditing of access to specific schema objects. 213. Audit Trial Results of audited operations are stored in a table in data dictionary. 214. What is Auditing? Monitoring of user access to aid in the investigation of database use. 215. What are the responsibilities of a Database Administrator? * Installing and upgrading the Oracle Server and application tools. * Allocating system storage and planning future storage requirements for the database system. * Managing primary database structures (tablespaces) * Managing primary objects (table, views, indexes) * Enrolling users and maintaining system security. * Ensuring compliance with Oracle license agreement * Controlling and monitoring user access to the database. * Monitoring and optimizing the performance of the database. * Planning for backup and recovery of database information. * Maintain archived data on tape * Backing up and restoring the database. * Contacting Oracle Corporation for technical support. 216. What is a trace file and how is it created? Each server and background process can write an associated trace file. When an internal error is detected by a process or user process, it dumps information about the error to its trace. This can be used for tuning the database. 217. What is a profile? Each database user is assigned a Profile that specifies limitations on various system resources available to the user. 218. How will you enforce security using stored procedures? 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. 219. What are the dictionary tables used to monitor a database spaces? DBA_FREE_SPACE DBA_SEGMENTS DBA_DATA_FILES. 220. What are the roles and user accounts created automatically with the database? DBA - role Contains all database system privileges. SYS user account - The DBA role will be assigned to this account. All of the base tables and views for the database’s dictionary are store in this schema and are manipulated only by ORACLE. SYSTEM user account - It has all the system privileges for the database and additional tables and views that display administrative information and internal tables and views used by oracle tools are created using this username. 221. What are the minimum parameters should exist in the parameter file (init.ora)? DB NAME - Must set to a text string of no more than 8 characters and it will be stored inside the datafiles, redo log files and control files and control file while database creation. DB_DOMAIN - It is string that specifies the network domain where the database is created. The global database name is identified by setting these parameters (DB_NAME & DB_DOMAIN) CONTORL FILES - List of control filenames of the database. If name is not mentioned then default name will be used. DB_BLOCK_BUFFERS - To determine the no of buffers in the buffer cache in SGA. PROCESSES - To determine number of operating system processes that can be connected to ORACLE concurrently. The value should be 5 (background process) and additional 1 for each user. ROLLBACK_SEGMENTS List of rollback segments an ORACLE instance acquires at database startup. Also optionally LICENSE_MAX_SESSIONS,LICENSE_SESSION_WARNING and LICENSE_MAX_USERS. 221. How can we specify the Archived log file name format and destination? By setting the following values in init.ora file. LOG_ARCHIVE_FORMAT = arch %S/s/T/tarc (%S - Log sequence number and is zero left padded, %s - Log sequence number not padded. %T - Thread number left-zero- padded and %t - Thread number not padded). The file name created is arch 0001 are if %S is used. LOG_ARCHIVE_DEST = path. 222. What is user Account in Oracle database? An 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. 95. When will the data in the snapshot log be used? - We must be able to create a after row trigger on table (i.e., it should be not be already available) After giving table privileges. We cannot specify snapshot log name because oracle uses the name of the master table in the name of the database objects that support its snapshot log. The master table name should be less than or equal to 23 characters. (The table name created will be MLOGS_tablename, and trigger name will be TLOGS name). 223. What dynamic data replication? Updating or Inserting records in remote database through database triggers. It may fail if remote database is having any problem. 224. What is Two-Phase Commit? Two-phase commit is mechanism that guarantees a distributed transaction either commits on all involved nodes or rolls back on all involved nodes to maintain data consistency across the global distributed database. It has two phase, a Prepare Phase and a Commit Phase. 225.How can you Enforce Referential Integrity in snapshots? Time the references to occur when master tables are not in use. Peform the reference the manually immdiately locking the master tables. We can join tables in snopshots by creating a complex snapshots that will based on the master tables. 226. What is a SQL * NET? 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. 227. What is a SNAPSHOT? Snapshots are read-only copies of a master table located on a remote node which is periodically refreshed to reflect changes made to the master table. 228. What is the mechanism provided by ORACLE for table replication? Snapshots and SNAPSHOT LOGs 229. What is snapshots? Snapshot is an object used to dynamically replicate data between distribute database at specified time intervals. In ver 7.0 they are read only. 230. What are the various type of snapshots? Simple and Complex. 231. Describe two phases of Two-phase commit? 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. 232. What is snapshot log? It is a table that maintains a record of modifications to the master table in a snapshot. It is stored in the same database as master table and is only available for simple snapshots. It should be created before creating snapshots. 233. What are the benefits of distributed options in databases? 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. 234. What is an index? How it is implemented in Oracle database? 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 235. What are clusters? Group of tables physically stored together because they share common columns and are often used together is called cluster. 236. What is a cluster key? 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. 237. How can we reduce the network traffic? Replication of data in distributed environment. - Using snapshots to replicate data. - Using remote procedure calls. 238. Differentiate simple and complex, snapshots? A simple snapshot is based on a query thaat does not contains GROUP BY clauses, CONNECT BY clauses, JOINs, sub-query or snapshot of operations. - A complex snapshots contain at least any one of the above. 239. What are the Built-ins used for sending Parameters to forms? You can pass parameter values to a form when an application executes the call_form, New_form, Open_form or Run_product. 240. Can you have more than one content canvas view attached with a window? Yes. Each window you create must have at least one content canvas view assigned to it. You can also create a window that has manipulated content canvas view. At run time only one of the content canvas views assign to a window is displayed at a time. 241. Is the After report trigger fired if the report execution fails? Yes. 242. Does a Before form trigger fire when the parameter form is suppressed? Yes. 243. Is it possible to split the print reviewer into more than one region? Yes 244. Is it possible to center an object horizontally in a repeating frame that has a variable horizontal size? Yes 245. How do you list the files in an UNIX directory while also showing hidden files? ls -ltra 246. How do you execute a UNIX command in the background? Use the "&" 247. How do you execute a UNIX command in the background? Use the "*amp" 248. Can a formula column referred to columns in higher group? Yes 249. Can a formula column be obtained through a select statement? Yes 250. If a parameter is used in a query without being previously defined, what diff. exist between report 2.0 and 2.5 when the query is applied? While both reports 2.0 and 2.5 create the parameter, report 2.5 gives a message that a bind parameter has been created. 251. What are the SQL clauses supported in the link property sheet? Where start with having. 252. What is trigger associated with the timer? When-timer-expired. 253. What are the trigger associated with image items? When-image-activated fires when the operators double clicks on an image itemwhen-image-pressed fires when an operator clicks or double clicks on an image item 254. What are the different windows events activated at runtimes? When_window_activated When_window_closed When_window_deactivated When_window_resized Within this triggers, you can examine the built in system variable system. event_window to determine the name of the window for which the trigger fired. 255. When do you use data parameter type? When the value of a data parameter being passed to a called product is always the name of the record group defined in the current form. Data parameters are used to pass data to produts invoked with the run_product built-in subprogram. 256. What is difference between open_form and call_form? When one form invokes another form by executing open_form the first form remains displayed, and operators can navigate between the forms as desired. when one form invokes another form by executing call_form, the called form is modal with respect to the calling form. That is, any windows that belong to the calling form are disabled, and operators cannot navigate to them until they first exit the called form. 257. How would you change all occurrences of a value using VI? Use :%s/<old>/<new>/g 258. Give two UNIX kernel parameters that effect an Oracle install SHMMAX & SHMMNI 258. Briefly, how do you install Oracle software on UNIX. Basically, set up disks, kernel parameters, and run orainst. 259. What is the diff. when confine mode is on and when it is off? When confine mode is on, an object cannot be moved outside its parent in the layout. 260. What are visual attributes? Visual attributes are the font, color, pattern proprieties that you set for form and menu objects that appear in your application interface. 261. Which of the two views should objects according to possession? view by structure. 262. What are the two types of views available in the object navigator (specific to report 2.5)? View by structure and view by type . 263. What are the vbx controls? Vbx control provide a simple method of building and enhancing user interfaces. The controls can use to obtain user inputs and display program outputs.vbx control where originally develop as extensions for the ms visual basic environments and include such items as sliders, rides and knobs. 264. What is the use of transactional triggers? Using transactional triggers we can control or modify the default functionality of the oracle forms. 265. How do you create a new session while open a new form? Using open_form built-in setting the session option Ex. Open_form (’Stocks ‘,active,session). when invoke the mulitiple forms with open form and call_form in the same application, state whether the following are true/False 266. What are the ways to monitor the performance of the report? Use reports profile executable statement. Use SQL trace facility. 267. If two groups are not linked in the data model editor, What is the hierarchy between them? Two group that is above are the left most rank higher than the group that is to right or below it. 268. An open form can not be execute the call_form procedure if you chain of called forms has been initiated by another open form? True 269. Explain about horizontal, Vertical tool bar canvas views? Tool bar canvas views are used to create tool bars for individual windows. Horizontal tool bars are display at the top of a window, just under its menu bar. Vertical Tool bars are displayed along the left side of a window 270. What is the purpose of the product order option in the column property sheet? To specify the order of individual group evaluation in a cross products. 271. What is the use of image_zoom built-in? To manipulate images in image items. 272. How do you reference a parameter indirectly? To indirectly reference a parameter use the NAME IN, COPY ‘built-ins to indirectly set and reference the parameters value’ Example name_in (’capital parameter my param’), Copy (’SURESH’,'Parameter my_param’) 273. Is it possible to insert comments into sql statements return in the data model editor? Yes 274. Is it possible to disable the parameter from while running the report? Yes 275. When a form is invoked with call_form, Does oracle forms issues a save point? Yes 276. Can a property clause itself be based on a property clause? Yes 277. What is a timer? Timer is an “internal time clock” that you can programmatically create to perform an action each time the times. 278. What are the two phases of block coordination? There are two phases of block coordination: the clear phase and the population phase. During, the clear phase, Oracle Forms navigates internally to the detail block and flushes the obsolete detail records. During the population phase, Oracle Forms issues a SELECT statement to repopulate the detail block with detail records associated with the new master record. These operations are accomplished through the execution of triggers. 279. What are Most Common types of Complex master-detail relationships? There are three most common types of complex master-detail relationships: master with dependent details master with independent details detail with two masters 280. What is a text list? The text list style list item appears as a rectangular box which displays the fixed number of values. When the text list contains values that can not be displayed, a vertical scroll bar appears, allowing the operator to view and select values that are not displayed. 281. What is term? The term is terminal definition file that describes the terminal form which you are using r20run. 282. What is use of term? The term file which key is correspond to which oracle report functions. 283. What is pop list? The pop list style list item appears initially as a single field (similar to a text item field). When the operator selects the list icon, a list of available choices appears. 284. What is the maximum no of chars the parameter can store? The maximum no of chars the parameter can store is only valid for char parameters, which can be up to 64K. No parameters default to 23 Bytes and Date parameter default to 7 Bytes. 285. What are the default extensions of the files created by library module? The default file extensions indicate the library module type and storage format .pll - pl/sql library module binary 286. What are the Coordination Properties in a Master-Detail relationship? The coordination properties are Deferred Auto-Query These Properties determine when the population phase of block coordination should occur. 287. What is an index and How it is implemented in Oracle database? INDEX is a one which provides quick access to a row. 288. Lot of users are accessing select sysdate from dual and they getting some millisecond differences. If we execute SELECT SYSDATE FROM EMP; what error will we get. Why? No error message indication will be there. It displays the current system date. 289. Give two methods you could use to determine what DDL changes have been made. You could use Logminer or Streams 290. What are the types of calculated columns available? Summary, Formula, Placeholder column. 291. Explain about stacked canvas views? Stacked canvas view is displayed in a window on top of, or “stacked” on the content canvas view assigned to that same window. Stacked canvas views obscure some part of the underlying content canvas view, and or often shown and hidden programmatically. 292. What are the built_ins used the display the LOV? Show_lov List_values 293. What is the difference between SHOW_EDITOR and EDIT_TEXTITEM? Show editor is the generic built-in which accepts any editor name and takes some input string and returns modified output string. Whereas the edit_textitem built-in needs the input focus to be in the text item before the built-in is executed. 294. What are the built-ins that are used to Attach an LOV programmatically to an item? set_item_property get_item_property (by setting the LOV_NAME property) 295. How do you call other Oracle Products from Oracle Forms? Run_product is a built-in, Used to invoke one of the supported oracle tools products and specifies the name of the document or module to be run. If the called product is unavailable at the time of the call, Oracle Forms returns a message to the operator. 296. What is the main diff. bet. Reports 2.0 & Reports 2.5? Report 2.5 is object oriented. 297. What are the different file extensions that are created by oracle reports? Rep file and Rdf file. 298. What is strip sources generate options? Removes the source code from the library file and generates a library files that contains only pcode. The resulting file can be used for final deployment, but can not be subsequently edited in the designer.ex. f45gen module=old_lib.pll userid=scott/tiger strip_source YES output_file 299. What is the basic data structure that is required for creating an LOV? Record Group. 300. What is the Maximum allowed length of Record group Column? Record group column names cannot exceed 30 characters. 301. Which parameter can be used to set read level consistency across multiple queries? Read only 302. What are the different types of Record Groups? Query Record Groups NonQuery Record Groups State Record Groups 303. From which designation is it preferred to send the output to the printed? Previewer 304. what are difference between post database commit and post-form commit? Post-form commit fires once during the post and commit transactions process, after the database commit occurs. The post-form-commit trigger fires after inserts, updates and deletes have been posted to the database but before the transactions have been finalized in the issuing the command. The post-database-commit trigger fires after oracle forms issues the commit to finalized transactions. 305. What are the different display styles of list items? Pop_list Text_list Combo box 306. Which of the above methods is the faster method? performing the calculation in the query is faster. 307. With which function of summary item is the compute at options required? percentage of total functions. 308. What are parameters? Parameters provide a simple mechanism for defining and setting the values of inputs that are required by a form at startup. Form parameters are variables of type char, number, date that you define at design time. 309. What are the three types of user exits available? Oracle Precompiler exits, Oracle call interface, NonOracle user exits. 310. How many windows in a form can have console? Only one window in a form can display the console, and you cannot change the console assignment at runtime 311. If the maximum record retrieved property of the query is set to 10 then a summary value will be calculated? Only for 10 records. 312. What are the two repeating frame always associated with matrix object? One down repeating frame below one across repeating frame. 313. What are the master-detail triggers? On-Check_delete_master, On_clear_details, On_populate_details 314. What are the different objects that you cannot copy or reference in object groups? Objects of different modules Another object groups Individual block dependent items Program units. 315. What is an OLE? Object Linking & Embedding provides you with the capability to integrate objects from many Windows applications into a single compound document creating integrated applications enables you to use the features form. 316. Is it possible to modify an external query in a report which contains it? No. 317. Does a grouping done for objects in the layout editor affect the grouping done in the data model editor? No. 318. Can a repeating frame be created without a data group as a base? No 319. If a break order is set on a column would it affect columns which are under the column? No 320. Is it possible to set a filter condition in a cross product group in matrix reports? No 321. Do user parameters appear in the data modal editor in 2.5? No 322. Can you pass data parameters to forms? No 323. Is it possible to link two groups inside a cross products after the cross products group has been created? no 324. What are the different modals of windows? Modeless windows Modal windows 325. What are modal windows? Modal windows are usually used as dialogs, and have restricted functionality compared to modeless windows. On some platforms for example operators cannot resize, scroll or iconify a modal window. 326. What are the different default triggers created when Master Deletes Property is set to Non-isolated? Master Deletes Property Resulting Triggers: Non-Isolated (the default) On-Check-Delete-Master On-Clear-Details On-Populate-Details 327. What are the different default triggers created when Master Deletes Property is set to isolated? Master Deletes Property Resulting Triggers: Isolated On-Clear-Details On-Populate-Details 328. What are the different default triggers created when Master Deletes Property is set to Cascade? Master Deletes Property Resulting Triggers: Cascading On-Clear-Details On-Populate-Details Pre-delete 329. What is the diff. bet. setting up of parameters in reports 2.0 reports2.5? LOVs can be attached to parameters in the reports 2.5 parameter form. 330. What are the difference between lov & list item? Lov is a property where as list item is an item. A list item can have only one column, lov can have one or more columns. 331. What is the advantage of the library? Libraries provide a convenient means of storing client-side program units and sharing them among multiple applications. Once you create a library, you can attach it to any other form, menu, or library modules. When you can call library program units from triggers menu items commands and user named routine, you write in the modules to which you have attach the library. When a library attaches another library, program units in the first library can reference program units in the attached library. Library support dynamic loading-that is library program units are loaded into an application only when needed. This can significantly reduce the run-time memory requirements of applications. 332. What is lexical reference? How can it be created? - Lexical reference is place_holder for text that can be embedded in a SQL statements. A lexical reference can be created using & before the column or parameter name. 333. What is system.coordination_operation? It represents the coordination causing event that occur on the master block in master-detail relation. 334. What is synchronize? It is a terminal screen with the internal state of the form. It updates the screen display to reflect the information that oracle forms has in its internal representation of the screen. 335. What use of command line parameter cmd file? It is a command line argument that allows you to specify a file that contain a set of arguments for r20run. 336. What is a Text_io Package? It allows you to read and write information to a file in the file system. 337. What is forms_DDL? Issues dynamic Sql statements at run time, including server side pl/SQl and DDL 338. How is link tool operation different bet. reports 2 & 2.5? In Reports 2.0 the link tool has to be selected and then two fields to be linked are selected and the link is automatically created. In 2.5 the first field is selected and the link tool is then used to link the first field to the second field. 339. What are the different styles of activation of ole Objects? In place activation, External activation 340. How do you reference a Parameter? In Pl/SQL, You can reference and set the values of form parameters using bind variables syntax. Ex. PARAMETER name = ‘’ or :block.item = PARAMETER Parameter name 341. What is the difference between object embedding and linking in Oracle forms? In Oracle forms, Embedded objects become part of the form module, and linked objects are references from a form module to a linked source file. 342. Name of the functions used to get/set canvas properties? Get_view_property, Set_view_property 343. What are the built-ins that are used for setting the LOV properties at runtime? get_lov_property set_lov_property 344. What are the built-ins used for processing rows? Get_group_row_count(function) Get_group_selection_count(function) Get_group_selection(function) Reset_group_selection(procedure) Set_group_selection(procedure) Unset_group_selection(procedure) 345. What are built-ins used for Processing rows? GET_GROUP_ROW_COUNT(function) GET_GROUP_SELECTION_COUNT(function) GET_GROUP_SELECTION(function) RESET_GROUP_SELECTION(procedure) SET_GROUP_SELECTION(procedure) UNSET_GROUP_SELECTION(procedure) 346. What are the built-in used for getting cell values? Get_group_char_cell(function) Get_groupcell(function) Get_group_number_cell(function) 347. What are the built-ins used for Getting cell values? GET_GROUP_CHAR_CELL (function) GET_GROUPCELL(function) GET_GROUP_NUMBET_CELL(function) 348. A tleast how many set of data must a data model have before a data model can be base on it? Four 349. To execute row from being displayed that still use column in the row which property can be used? Format trigger. 350. What are different types of modules available in oracle form? Form module - a collection of objects and code routines Menu modules - a collection of menus and menu item commands that together make up an application menu library module - a collection of user named procedures, functions and packages that can be called from other modules in the application 351. What is the remove on exit property? For a modeless window, it determines whether oracle forms hides the window automatically when the operators navigates to an item in the another window. 352. What is WHEN-Database-record trigger? Fires when oracle forms first marks a record as an insert or an update. The trigger fires as soon as oracle forms determines through validation that the record should be processed by the next post or commit as an insert or update. Generally occurs only when the operators modifies the first item in the record, and after the operator attempts to navigate out of the item. 353. What is a difference between pre-select and pre-query? Fires during the execute query and count query processing after oracle forms constructs the select statement to be issued, but before the statement is actually issued. The pre-query trigger fires just before oracle forms issues the select statement to the database after the operator as define the example records by entering the query criteria in enter query mode. Pre-query trigger fires before pre-select trigger. 354. What are built-ins associated with timers? find_timer create_timer delete_timer 355. What are the built-ins used for finding object ID functions? Find_group(function) Find_column(function) 356. What are the built-ins used for finding Object ID function? FIND_GROUP(function) FIND_COLUMN(function) 357. Any attempt to navigate programmatically to disabled form in a call_form stack is allowed? False 358. Use the Add_group_row procedure to add a row to a static record group 1. true or false? False 359. Use the add_group_column function to add a column to record group that was created at a design time? False 360. What are the various sub events a mouse double click event involves? Double clicking the mouse consists of the mouse down, mouse up, mouse click, mouse down and mouse up events. 361. How can a break order be created on a column in an existing group? By dragging the column outside the group. 362. What is the use of place holder column? A placeholder column is used to hold calculated values at a specified place rather than allowing is to appear in the actual row where it has to appear. 363. What is the use of hidden column? A hidden column is used to when a column has to embed into boilerplate text. 364. What is the use of break group? A break group is used to display one record for one group ones. While multiple related records in other group can be displayed. 365. What is an anchoring object and what is its use? An anchoring object is a print condition object which used to explicitly or implicitly anchor other objects to itself. 366. What are the various sub events a mouse double click event involves? Double clicking the mouse consists of the mouse down, mouse up, mouse click, mouse down and mouse up events. 367. What are the default parameter that appear at run time in the parameter screen? Destype and Desname. 368. What are the built-ins used for Creating and deleting groups? CREATE-GROUP (function) CREATE_GROUP_FROM_QUERY(function) DELETE_GROUP(procedure) 369. What are different types of canvas views? Content canvas views Stacked canvas views Horizontal toolbar vertical toolbar. 370. What are the different types of Delete details we can establish in Master-Details? Cascade Isolate Non-isolate 371. What is relation between the window and canvas views? Canvas views are the back ground objects on which you place the interface items (Text items), check boxes, radio groups etc.,) and boilerplate objects (boxes, lines, images etc.,) that operators interact with us they run your form . Each canvas views displayed in a window. 372. What is a User_exit? Calls the user exit named in the user_exit_string. Invokes a 3Gl program by name which has been properly linked into your current oracle forms executable. 373. How is it possible to select generate a select set for the query in the query property sheet? By using the tables/columns button and then specifying the table and the column names. 374. How can values be passed between precompiler exits & Oracle call interface? By using the statement EXECIAFGET & EXECIAFPUT. 375. How can a square be drawn in the layout editor of the report writer? By using the rectangle tool while pressing the (Constraint) key. 376. How can a text file be attached to a report while creating in the report writer? By using the link file property in the layout boiler plate property sheet. 377. How can I message to passed to the user from reports? By using SRW.MESSAGE function. 378. How is possible to restrict the user to a list of values while entering values for parameters? By setting the Restrict To List property to true in the parameter property sheet. 379. How can a button be used in a report to give a drill down facility? By setting the action associated with button to Execute pl/SQL option and using the SRW.Run_report function. 380. How can a cross product be created? By selecting the cross products tool and drawing a new group surrounding the base group of the cross products. 381. What are different types of images? Boiler plate images, Image Items 382. What is the difference between boiler plat images and image items? Boiler plate Images are static images (Either vector or bit map) that you import from the file system or database to use a graphical elements in your form, such as company logos and maps. Image items are special types of interface controls that store and display either vector or bitmap images. Like other items that store values, image items can be either base table items (items that relate directly to database columns) or control items. The definition of an image item is stored as part of the form module FMB and FMX files, but no image file is actually associated with an image item until the item is populate at run time. 383. What is bind reference and how can it be created? Bind reference are used to replace the single value in sql, pl/sql statements a bind reference can be created using a (:) before a column or a parameter name. 384. What are the triggers available in the reports? Before report, Before form, After form , Between page, After report. 384. Give the sequence of execution of the various report triggers? Before form , After form , Before report, Between page, After report. 385. Why is a Where clause faster than a group filter or a format trigger? Because in a where clause the condition is applied during data retrieval, then after retrieving the data. 386. Why is it preferable to create a fewer no. of queries in the data model? Because for each query, report has to open a separate cursor and has to rebind, execute and fetch data. 387. Where is the external query executed at the client or the server? At the server. 388. Where is a procedure return in an external pl/SQL library executed at the client or at the server? At the client. 389. What is coordination Event? Any event that makes a different record in the master block the current record is a coordination causing event. 390. What is the difference between OLE Server & OLE Container? An Ole server application creates ole Objects that are embedded or linked in ole Containers ex. Ole servers are ms_word & ms_excel. OLE containers provide a place to store, display and manipulate objects that are created by ole server applications. Ex. oracle forms is an example of an ole Container. 391. What is an object group? An object group is a container for a group of objects; you define an object group when you want to package related objects, so that you copy or reference them in other modules. 392. What is an LOV? An LOV is a scrollable popup window that provides the operator with either a single or multi column selection list. 393. At what point of report execution is the before Report trigger fired? After the query is executed but before the report is executed and the records are displayed. 394. What are the built -ins used for Modifying a groups structure? ADD-GROUP_COLUMN (function) ADD_GROUP_ROW (procedure) DELETE_GROUP_ROW(procedure) 395. What is an user exit used for? A way in which to pass control (and possibly arguments ) form Oracle report to another Oracle products of 3 GL and then return control ( and ) back to Oracle reports. 396. What is the User-Named Editor? A user named editor has the same text editing functionality as the default editor, but, because it is a named object, you can specify editor attributes such as windows display size, position, and title. 397. What are the Built-ins to display the user-named editor? A user named editor can be displayed programmatically with the built in procedure SHOW-EDITOR, EDIT_TETITEM independent of any particular text item. 398. What is a Static Record Group? A static record group is not associated with a query, rather, you define its structure and row values at design time, and they remain fixed at runtime. 399. What is a record group? A record group is an internal Oracle Forms that structure that has a column/row framework similar to a database table. However, unlike database tables, record groups are separate objects that belong to the form module which they are defined. 400. How many number of columns a record group can have? A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or DATE provided that the total number of column does not exceed 64K. 401. What is a Query Record Group? A query record group is a record group that has an associated SELECT statement. The columns in a query record group derive their default names, data types, had lengths from the database columns referenced in the SELECT statement. The records in query record group are the rows retrieved by the query associated with that record group. 402. What is a property clause? A property clause is a named object that contains a list of properties and their settings. Once you create a property clause you can base other object on it. An object based on a property can inherit the setting of any property in the clause that makes sense for that object. 403. What is a physical page? What is a logical page? A physical page is a size of a page. That is output by the printer. The logical page is the size of one page of the actual report as seen in the Previewer. 404. What does the term panel refer to with regarda to pages? A panel is the number of physical pages needed to print one logical page. 405. What is a master detail relationship? A master detail relationship is an association between two base table blocks- a master block and a detail block. The relationship between the blocks reflects a primary key to foreign key relationship between the tables on which the blocks are based. 406. What is a library? A library is a collection of subprograms including user named procedures, functions and packages. 407. How can a group in a cross products be visually distinguished from a group that does not form a cross product? A group that forms part of a cross product will have a thicker border. 408. What is the frame & repeating frame? A frame is a holder for a group of fields. A repeating frame is used to display a set of records when the number of records that are to displayed is not known before. 409. What is a combo box? A combo box style list item combines the features found in list and text item. Unlike the pop list or the text list style list items, the combo box style list item will both display fixed values and accept one operator entered value. 410. What are three panes that appear in the run time pl/SQL interpreter? Source pane, interpreter pane, navigator pane. 411. What are the two panes that Appear in the design time pl/SQL interpreter? Source pane, interpreter pane 412. What are the two ways by which data can be generated for a parameters list of values? Using static values, writing select statement. 413. What are the various methods of performing a calculation in a report? Perform the calculation in the SQL statements itself, use a calculated / summary column in the data model. 414. What are the default extensions of the files created by menu module? .mmb, .mmx 415. What are the default extensions of the files created by forms modules? .fmb - form module binary .fmx - form module executable 416. It is possible to use raw devices as data files and what is the advantages over file system files? Yes. The advantages over file system files. I/O will be improved because Oracle is bypassing the kernel when writing to disk. Disk Corruption will decrease. 417. What are disadvantages of having raw devices? 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. 418. What is the significance of having storage clause? 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 updations etc., 419. What is the use of INCTYPE option in EXP command? Type export should be performed COMPLETE, CUMULATIVE, INCREMENTAL. List the sequence of events when a large transaction that exceeds beyond its optimal value when an entry wraps and causes the rollback segment to expand into a notion Completes. e. will be written. 420. What is the use of FILE option in IMP command? The name of the file from which import should be performed. 421. What is a Shared SQL pool? The data dictionary cache is stored in an area in SGA called the Shared SQL Pool. This will allow sharing of parsed SQL statements among concurrent users. 422. What is hot backup and how it can be taken? Taking backup of archive log files when database is open. For this the ARCHIVELOG mode should be enabled. The following files need to be backed up. All data files. All Archive log, redo log files. All control files. 423. List the Optional Flexible Architecture (OFA) of Oracle database? How can we organize the tablespaces in Oracle database to have maximum performance? 1. SYSTEM - Data dictionary tables. 2. DATA - Standard operational tables. 3. DATA2- Static tables used for standard operations 4. INDEXES - Indexes for Standard operational tables. 5. INDEXES1 - Indexes of static tables used for standard operations. 6. TOOLS - Tools table. 7. TOOLS1 - Indexes for tools table. 8. RBS - Standard Operations Rollback Segments, 9. RBS1,RBS2 - Additional/Special Rollback segments. 10. TEMP - Temporary purpose tablespace 11. TEMP_USER - Temporary tablespace for users. 12. USERS - User tablespace. 424. How to implement the multiple control files for an existing database? 1. Shutdown the database 2. Copy one of the existing control file to new location 3. Edit Config ora file by adding new control filename 4. Restart the database. 425. What is advantage of having disk shadowing/ Mirroring? Shadow set of disks save as a backup in the event of disk failure. In most Operating System if any disk failure occurs it automatically switches over to a working 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. 426. How will you force database to use particular rollback segment? SET TRANSACTION USE ROLLBACK S Interview Questions for DBA (1) 1. Give one method for transferring a table from one schema to another: Level:Intermediate Expected Answer: There are several possible methods, export-import, CREATE TABLE... AS SELECT, or COPY. 2. What is the purpose of the IMPORT option IGNORE? What is it?s default setting? Level: Low Expected Answer: The IMPORT IGNORE option tells import to ignore "already exists" errors. If it is not specified the tables that already exist will be skipped. If it is specified, the error is ignored and the tables data will be inserted. The default value is N. 3. You have a rollback segment in a version 7.2 database that has expanded beyond optimal, how can it be restored to optimal? Level: Low Expected answer: Use the ALTER TABLESPACE ..... SHRINK command. 4. If the DEFAULT and TEMPORARY tablespace clauses are left out of a CREATE USER command what happens? Is this bad or good? Why? Level: Low Expected answer: The user is assigned the SYSTEM tablespace as a default and temporary tablespace. This is bad because it causes user objects and temporary segments to be placed into the SYSTEM tablespace resulting in fragmentation and improper table placement (only data dictionary objects and the system rollback segment should be in SYSTEM). 5. What are some of the Oracle provided packages that DBAs should be aware of? Level: Intermediate to High Expected answer: Oracle provides a number of packages in the form of the DBMS_ packages owned by the SYS user. The packages used by DBAs may include: DBMS_SHARED_POOL, DBMS_UTILITY, DBMS_SQL, DBMS_DDL, DBMS_SESSION, DBMS_OUTPUT and DBMS_SNAPSHOT. They may also try to answer with the UTL*.SQL or CAT*.SQL series of SQL procedures. These can be viewed as extra credit but aren?t part of the answer. 6. What happens if the constraint name is left out of a constraint clause? Level: Low Expected answer: The Oracle system will use the default name of SYS_Cxxxx where xxxx is a system generated number. This is bad since it makes tracking which table the constraint belongs to or what the constraint does harder. 7. What happens if a tablespace clause is left off of a primary key constraint clause? Level: Low Expected answer: This results in the index that is automatically generated being placed in then users default tablespace. Since this will usually be the same tablespace as the table is being created in, this can cause serious performance problems. 8. What is the proper method for disabling and re-enabling a primary key constraint? Level: Intermediate Expected answer: You use the ALTER TABLE command for both. However, for the enable clause you must specify the USING INDEX and TABLESPACE clause for primary keys. 9. What happens if a primary key constraint is disabled and then enabled without fully specifying the index clause? Level: Intermediate Expected answer: The index is created in the user?s default tablespace and all sizing information is lost. Oracle doesn?t store this information as a part of the constraint definition, but only as part of the index definition, when the constraint was disabled the index was dropped and the information is gone. 10. (On UNIX) When should more than one DB writer process be used? How many should be used? Level: High Expected answer: If the UNIX system being used is capable of asynchronous IO then only one is required, if the system is not capable of asynchronous IO then up to twice the number of disks used by Oracle number of DB writers should be specified by use of the db_writers initialization parameter. Interview Questions for DBA (2) 11. You are using hot backup without being in archivelog mode, can you recover in the event of a failure? Why or why not? Level: High Expected answer: You can?t use hot backup without being in archivelog mode. So no, you couldn?t recover. 12. What causes the "snapshot too old" error? How can this be prevented or mitigated? Level: Intermediate Expected answer: This is caused by large or long running transactions that have either wrapped onto their own rollback space or have had another transaction write on part of their rollback space. This can be prevented or mitigated by breaking the transaction into a set of smaller transactions or increasing the size of the rollback segments and their extents. 13. How can you tell if a database object is invalid? Level: Low Expected answer: By checking the status column of the DBA_, ALL_ or USER_OBJECTS views, depending upon whether you own or only have permission on the view or are using a DBA account. 14. A user is getting an ORA-00942 error yet you know you have granted them permission on the table, what else should you check? Level: Low Expected answer: You need to check that the user has specified the full name of the object (select empid from scott.emp; instead of select empid from emp;) or has a synonym that points to the object (create synonym emp for scott.emp;) 15. A developer is trying to create a view and the database won?t let him. He has the "DEVELOPER" role which has the "CREATE VIEW" system privilege and SELECT grants on the tables he is using, what is the problem? Level: Intermediate Expected answer: You need to verify the developer has direct grants on all tables used in the view. You can?t create a stored object with grants given through views. 16. If you have an example table, what is the best way to get sizing data for the production table implementation? Level: Intermediate Expected answer: The best way is to analyze the table and then use the data provided in the DBA_TABLES view to get the average row length and other pertinent data for the calculation. The quick and dirty way is to look at the number of blocks the table is actually using and ratio the number of rows in the table to its number of blocks against the number of expected rows. 17. How can you find out how many users are currently logged into the database? How can you find their operating system id? Level: high Expected answer: There are several ways. One is to look at the v$session or v$process views. Another way is to check the current_logins parameter in the v$sysstat view. Another if you are on UNIX is to do a "ps -ef|grep oracle|wc -l? command, but this only works against a single instance installation. 18. A user selects from a sequence and gets back two values, his select is: SELECT pk_seq.nextval FROM dual; What is the problem? Level: Intermediate Expected answer: Somehow two values have been inserted into the dual table. This table is a single row, single column table that should only have one value in it. 19. How can you determine if an index needs to be dropped and rebuilt? Level: Intermediate Expected answer: Run the ANALYZE INDEX command on the index to validate its structure and then calculate the ratio of LF_BLK_LEN/LF_BLK_LEN+BR_BLK_LEN and if it isn?t near 1.0 (i.e. greater than 0.7 or so) then the index should be rebuilt. Or if the ratio BR_BLK_LEN/ LF_BLK_LEN+BR_BLK_LEN is nearing 0.3. Tuning Questions for DBA (1) 1. A tablespace has a table with 30 extents in it. Is this bad? Why or why not. Level: Intermediate Expected answer: Multiple extents in and of themselves aren?t bad. However if you also have chained rows this can hurt performance. 2. How do you set up tablespaces during an Oracle installation? Level: Low Expected answer: You should always attempt to use the Oracle Flexible Architecture standard or another partitioning scheme to ensure proper separation of SYSTEM, ROLLBACK, REDO LOG, DATA, TEMPORARY and INDEX segments. 3. You see multiple fragments in the SYSTEM tablespace, what should you check first? Level: Low Expected answer: Ensure that users don?t have the SYSTEM tablespace as their TEMPORARY or DEFAULT tablespace assignment by checking the DBA_USERS view. 4. What are some indications that you need to increase the SHARED_POOL_SIZE parameter? Level: Intermediate Expected answer: Poor data dictionary or library cache hit ratios, getting error ORA-04031. Another indication is steadily decreasing performance with all other tuning parameters the same. 5. What is the general guideline for sizing db_block_size and db_multi_block_read for an application that does many full table scans? Level: High Expected answer: Oracle almost always reads in 64k chunks. The two should have a product equal to 64 or a multiple of 64. 6. What is the fastest query method for a table? Level: Intermediate Expected answer: Fetch by rowid 7. Explain the use of TKPROF? What initialization parameter should be turned on to get full TKPROF output? Level: High Expected answer: The tkprof tool is a tuning tool used to determine cpu and execution times for SQL statements. You use it by first setting timed_statistics to true in the initialization file and then turning on tracing for either the entire database via the sql_trace parameter or for the session using the ALTER SESSION command. Once the trace file is generated you run the tkprof tool against the trace file and then look at the output from the tkprof tool. This can also be used to generate explain plan output. 8. When looking at v$sysstat you see that sorts (disk) is high. Is this bad or good? If bad -How do you correct it? Level: Intermediate Expected answer: If you get excessive disk sorts this is bad. This indicates you need to tune the sort area parameters in the initialization files. The major sort are parameter is the SORT_AREA_SIZe parameter. 9. When should you increase copy latches? What parameters control copy latches? Level: high Expected answer: When you get excessive contention for the copy latches as shown by the "redo copy" latch hit ratio. You can increase copy latches via the initialization parameter LOG_SIMULTANEOUS_COPIES to twice the number of CPUs on your system. 10. Where can you get a list of all initialization parameters for your instance? How about an indication if they are default settings or have been changed? Level: Low Expected answer: You can look in the init.ora file for an indication of manually set parameters. For all parameters, their value and whether or not the current value is the default value, look in the v$parameter view. 11. Describe hit ratio as it pertains to the database buffers. What is the difference between instantaneous and cumulative hit ratio and which should be used for tuning? Level: Intermediate Expected answer: The hit ratio is a measure of how many times the database was able to read a value from the buffers verses how many times it had to re-read a data value from the disks. A value greater than 80-90% is good, less could indicate problems. If you simply take the ratio of existing parameters this will be a cumulative value since the database started. If you do a comparison between pairs of readings based on some arbitrary time span, this is the instantaneous ratio for that time span. Generally speaking an instantaneous reading gives more valuable data since it will tell you what your instance is doing for the time it was generated over. Tuning Questions for DBA (2) 12. Discuss row chaining, how does it happen? How can you reduce it? How do you correct it? Level: high Expected answer: Row chaining occurs when a VARCHAR2 value is updated and the length of the new value is longer than the old value and won?t fit in the remaining block space. This results in the row chaining to another block. It can be reduced by setting the storage parameters on the table to appropriate values. It can be corrected by export and import of the effected table. 13. When looking at the estat events report you see that you are getting busy buffer waits. Is this bad? How can you find what is causing it? Level: high Expected answer: Buffer busy waits could indicate contention in redo, rollback or data blocks. You need to check the v$waitstat view to see what areas are causing the problem. The value of the "count" column tells where the problem is, the "class" column tells you with what. UNDO is rollback segments, DATA is data base buffers. 14. If you see contention for library caches how can you fix it? Level: Intermediate Expected answer: Increase the size of the shared pool. 15. If you see statistics that deal with "undo" what are they really talking about? Level: Intermediate Expected answer: Rollback segments and associated structures. 16. If a tablespace has a default pctincrease of zero what will this cause (in relationship to the smon process)? Level: High Expected answer: The SMON process won?t automatically coalesce its free space fragments. 17. If a tablespace shows excessive fragmentation what are some methods to defragment the tablespace? (7.1,7.2 and 7.3 only) Level: High Expected answer: In Oracle 7.0 to 7.2 The use of the 'alter session set events 'immediate trace name coalesce level ts#';? command is the easiest way to defragment contiguous free space fragmentation. The ts# parameter corresponds to the ts# value found in the ts$ SYS table. In version 7.3 the ?alter tablespace coalesce;? is best. If the free space isn?t contiguous then export, drop and import of the tablespace contents may be the only way to reclaim non-contiguous free space. 18. How can you tell if a tablespace has excessive fragmentation? Level: Intermediate If a select against the dba_free_space table shows that the count of a tablespaces extents is greater than the count of its data files, then it is fragmented. 19. You see the following on a status report: redo log space requests 23 redo log space wait time 0 Is this something to worry about? What if redo log space wait time is high? How can you fix this? Level: Intermediate Expected answer: Since the wait time is zero, no. If the wait time was high it might indicate a need for more or larger redo logs. 20. What can cause a high value for recursive calls? How can this be fixed? Level: High Expected answer: A high value for recursive calls is cause by improper cursor usage, excessive dynamic space management actions, and or excessive statement re-parses. You need to determine the cause and correct it By either relinking applications to hold cursors, use proper space management techniques (proper storage and sizing) or ensure repeat queries are placed in packages for proper reuse. 21. If you see a pin hit ratio of less than 0.8 in the estat library cache report is this a problem? If so, how do you fix it? Level: Intermediate Expected answer: This indicate that the shared pool may be too small. Increase the shared pool size. 22. If you see the value for reloads is high in the estat library cache report is this a matter for concern? Level: Intermediate Expected answer: Yes, you should strive for zero reloads if possible. If you see excessive reloads then increase the size of the shared pool. 23. You look at the dba_rollback_segs view and see that there is a large number of shrinks and they are of relatively small size, is this a problem? How can it be fixed if it is a problem? Level: High Expected answer: A large number of small shrinks indicates a need to increase the size of the rollback segment extents. Ideally you should have no shrinks or a small number of large shrinks. To fix this just increase the