1.What is Autonomous Transaction.. A transaction which is independent of other transaction is called Autonomous Transaction.

Explain him with an Example ........ 2.What is Pragma Autonomous_Transaction. The pragma instructs the PL/SQL compiler to establish a PL/SQL block as autonomous or independent. both are one and the same.. 3.cursor attributes.... %found,%notfound,%rowcount,%isopen in addition to that they will ask for %bulk_rowcount 4.what is procedure and function .diiferences between them....... 1. Function is mainly used in the case where it must return a value. Where as a procedure may or may not return a value or may return more than one value using the OUT parameter. 2. Function can be called from SQL statements where as procedure can not be called from the sql statements

3. Functions are normally used for computations where as procedures are normally used for executing business logic.

4. You can have DML (insert,update, delete) statements in a function. But, you cannot call such a function in a SQL query.

5.A Function returns 1 value only. Procedure can return multiple values (max 1024).

6. Stored Procedure: supports deferred name resolution. Example while writing a stored procedure that uses table named tabl1 and tabl2 etc..but actually not exists in database is allowed only in during creation but runtime throws error Function won¶t support deferred name resolution.

7.Stored procedure returns always integer value by default zero. where as function return type could be scalar or table or table values

8. Stored procedure is precompiled execution plan where as functions are not.

9.A procedure may modify an object where a function can only return a value The RETURN statement immediately completes the execution of a subprogram and returns control to the caller.

5.In how many ways that procedure parameters can be referenced... postional anad named parameters can be passed

6.briefly about IN,OUT AND INOUT parameters

7.advantage of packages A. Modularity - Encapsulate related constructs.

B. Easier Application Design - Code and compile specification and body separately.

C. Hiding Information - Only the declarations in the pacakge specification are visible and accessible to application. - Private constructs in the package body are hidden and inaccesible.

D. Better Performance . 8. Each block forms a unit of a task or a logical module. . which can be nested within each other. .why Pl/sql is Advantageous than pro*c. y y y y Block Structures: PL SQL consists of blocks of code.Advantages of procedures and triggers« . E. Added Functionality . Better Performance: PL SQL engine processes multiple SQL statements simultaneously as a single block. thereby reducing network traffic. 9.The entire package is loaded into memory when the package is first referenced. U can explain them each with an example.Persistency of variables and coursors. PL/SQL Blocks can be stored in the database and reused. F..All coding is hidden in the package body..Multiple subprograms of the same name. Error Handling: PL/SQL handles errors or exceptions effectively during the execution of a PL/SQL program.Advsntsge of Stored Procedures: . Once an exception is caught. Overloading .. Procedural Language Capability: PL SQL consists of procedural language constructs such as conditional statements (if else statements) and loops like (FOR loops). specific actions can be taken depending upon the type of the exception or it can be displayed to the user with a message.The dependency hierarchy is simplified..There is only one copy in memory for all users.

They are not visible or can be traced in debugging code. e. oracle error number) 12. whenever the table affected by insert update or delete query that time the triggers will implicitely call.What is Pragma EXECPTION_INIT ? Explain the usage ? The PRAGMA EXECPTION_INIT tells the complier to associate an exception with an oracle error. 11. What is Global temporary table? and what are the benefits of it? .================================ Stored Procedures are precompiled one.Disadvantages of procedures.Advantage of Triggers: ======================== Triggers is a special kind of procedure. Disadvantage of packages: Unnecessary module loading. the Main advantage of the trigger is automatic. Triggers run every time when the database fields are updated and it is overhead on system. PRAGMA EXCEPTION_INIT (exception name. It makes system run slower. constraints. stored procedure is the one is easy to maintain. No version control.g. 2. It is easy to forget about triggers and if there is no documentation it will be difficult to figure out for new developers for their existence. To get an error message of a specific oracle error. it is the group of sql statements. Triggers execute invisible to client-application.packages and triggers Disadvantages of Triggers It is easy to view table relationships . Unable to load large packages into memory. Unable to compile large packages. 10. stored procedure in database but triggers are difficult to view. indexes. Lack of synonym support. stored procedure is a fast one because it is already precompiled. stored procedure like a application programming. It is hard to follow their logic as it they can be fired before or after the database insert/update happens.

Also it cannot execute DDL statements (such as CREATE) because they are followed by an automatic commit. 3)wnps--write no package state i.efunction does not modify any packaged variables. and the description of the temporary table is dropped. y When called from a SELECT INSERT UPDATE or DELETE statement the function cannot execute SQL transaction control statements (such as COMMIT) session control statements (such as SET ROLE) or system control statements (such as ALTER SYSTEM). y When called from an INSERT UPDATE or DELETE statement the function cannot query or modify any database tables modified by that statement.e function does not read any package variables. When the session terminates.e function does not read any database tables. It is not persistent and cannot be shared with other sessions. Each session that defines a declared global temporary table of the same name has its own unique description of the temporary table. The pragma asserts that a function does not read or write database tables or package variables. The declared temporary table description does not appear in the system catalog. what are purity rules for functions? why they use ? what effects if not follow these rules? The purity level defines what structure the function reads or modifies. the rows of the table are deleted. 4)rnps-read no package state i. the types of purity level: 1)wnds--write no database stage I. For example the following pragma asserts that packaged function . If any SQL statement inside the function body violates a rule you get an error at run time (when the statement is parsed). 2)rnds--reads no database state. To check for violations of the rules you can use the pragma (compiler directive) RESTRICT_REFERENCES.e the function does not modify any database or tables. To be callable from SQL statements a stored function (and any subprograms called by that function) must obey certain purity rules which are meant to control side effects: y When called from a SELECT statement or a parallelized INSERT UPDATE or DELETE statement the function cannot modify any database tables.GLOBAL TEMPORARY TABLE statement defines a temporary table for the current session. i. 13.

you can change the trigger to statement level and apply the logic there. 15. Difference between Varray and Nested Table They are Oracle data types those who knoww any language like C and java then it is easy to understand the concept of Varray as it is related to ARRAY structure of C or java language.When after trigger is used only after the process of current updating is finished the next process gets processed. What is the difference between REF Cursor & Normal Cursor? . where as Nested Table concept is related to Struct data type of C or java langauge. One of the best approach is to make use of the after trigger which clearly takes care of concurrency problems associated with mutating triggers . because the table is in middle of a transaction so it causes the trigger to mutate. Types of Triggers in Oracle there are mainily 3 types of triggers 1> dml trigger 2>instead of trigger written on only view 3>system trigger dml trigger written on table that gets fired on dml events like insert or delete or update operation that trigger may fire 1>after dml event 2> before dml event these are timings for trigger firing instead of trigger written only on view that view is not modifiable that also gets fired when dml event occurs system trigger gets fired on system event like before log off or after log on or before shutdown this trigger may be written on database level schema level 16. What is mutating trigger? How do you resolve it? If a trigger body is trying to update dependent tables. 17. then mutating trigger error occurs. table is in transition).credit_ok writes no database state (WNDS) and reads no package state (RNPS): 14. will it get a mutating error? To avoid Mutating trigger there are many ways. if the trigger attempts to select or modify the table while the trigger has not completed (ie.

There is a table. how it is possible? GENERALLY INDEX WILL BE CREATED ON LESS NUMBER OF DML OPERATION COLUMNS. If a user tries to insert data that doesn't meet these requirements. For varrays we need to specify upperbound. In case of REF Cursor. the cursor declartion is not associated with any SQL query. 18. Pl/sql tables can not be stored in database where as varrays can be stored in database. Truly perfect dynamic cursors are the one constructed using DBMS_SQL package. In one column it has implemented a index. Though there is something dynamic with REF Cursor when compared to a normal explicit cursor.e ALTER INDEX IDX_NAME UNUSABLE.Difference Between SQL%BULK_ROWCOUNT and SQL%ROWCOUNT 20. You can not perform DML operations on PL/SQL table . EVENTHOUGH IF WE WANT PERFORM BETTER THEN BEFORE INSERTING DATA INTO THE COLUMN WE HAVE TO DISABLE THE INDEX i. REF Cursors also provide the feature of passing parameters. offcourse) programatically. DML operations can be performed on Varrays.. but still we need to keep the index.What is difference between PL/SQL tables and arrays? PL/SQL tables are temporary array like objects used in a PL/SQL Block. In pl/sql tables data need not be stored in consecutive rows. In varrays negetive index is not allowed. it is not a truly perfect dynamic cursor. The size of pl/sql table is unconstrained.In case of an normal explict cursor. but the index is disturbed by the regular dml statements. Oracle will not allow 21. it is associated with a query at a later stage this brings in a lot of flexibility as different SQL queries can be associated with the cursor (one at a time. 22. what is data integrity Data integrity allows to define certain data quality requirements that the data in the database needs to meet. Varrays are dense and retain their order while storing in database. . How can I create a table from another table without copying any values from the old table? create table table_name as ( select * from old_table where 1=2) from this query we can create a new table structure from old table structure without data. 19. the SQL query has to be defined at the time of declaring the cursor itself. We can use negetive index for pl/sql tables.

bananas . There is a sequence with min value 100.What happens when pacakge is created withot a pacakage specification«.having apples. If the table has already data in the sequence column as 100.101. how do you restrict number of rows for a particular value in a column. I want to alter this sequence to min value as 101.MAXVALYE.102.. u can save and capture data about each events to a file 26. or CREATE SEQUENCE SEQ_TET INCREMENT BY 1 START WITH 100 MAXVALUE 1000000 MINVALUE 99.so how can u restrict number of rows for apple to hundred? Using row level and statement level trigger 25.23. . Alter sequence sequanceName incremented by 2 minvalue 101.I dont want to have more than 100 apples in that table .Incremented by and CACHE of sequence. the total package body will become invalid and has to be recompiled again 24. If a procedure within a package is invalidated whether the entire package will be invalid and has to be recompiled again? Yes..but not alter START WITH. SQL> rename SEQ_TET to seq_test. The pacakage become parivate package. Sequence created. Table renamed.For example:there is a table called fruits.what is sql_profiler SQL Profiler is a graphical tool that allows system administrator to monitor events in an instance od MSSQL.papayas.. Is it possible to do so ? we can only alter MINVALUE. 27.

sal<b. field_name used (in this case ATTRIBUTE1) and table_name (in this case PO_VENDORS). How to improve the performance of a pl/sq stored procedures or functions or triggers and packages ? By using index (not always) by using bulk fetch by using exists and not exists in place of in and not in clause. How many database objects (trigger.dno=b.---------LAST_NUMBER ----------SEQ_TEST 99 1000000 1NN 20 100 28. trigger etc). select count(1) from tab will give the total number of tables..e. sequence etc) uses a particular field in a given table. packages.---------. SEQUENCE_NAME MIN_VALUE MAX_VALUE INCREMENT_BY C O CACHE_SIZE -----------------------------.----------.SQL> select * from user_sequences.What does SELECT COUNT(1) FROM TAB would result«. i have a table eno dno sal 1 10 200 2 10 150 3 10 100 4 20 75 5 20 100 i want to get sal which is less than the avg sal of thri dept. by avoiding implicit conversion by oracle ex: if in employee table emp_no is varchar then .---------.eno.avg(sal) avgsal from emp_t group by dno) b where e.views and synonms present in the current schema.dno 29. For ex: I want to know how many database object uses the ATTRIBUTE1 in the PO_VENDORS table.sal from emp_t e.e. select * from user_source where upper(text) like '%PO_VENDORS%' 31. 30.dno. eno dno sal 2 10 150 3 10 100 4 20 75 select e. What query will give me the result showing the database object name(package..avgsal and e. (select dno.

What happens if we TRUNCATE a GlobalTemporary table? The Data Is Removed Only From That Specificsession Where The TRUNCATE Is Issued. mostly try to avoid Hard Coding in the select statements.what is the sqlcodes for different exceptions«. DBMS_TRANSACTION. or. What are SQLCODE and SQLERRM and why are they important for PL/SQL developers? Expected answer: SQLCODE returns the value of the error number for the last error encountered. 36. great. UTL_FILE. There are many which developers should be aware of such as DBMS_SQL.. but not really what was asked. DBMS_PIPE. DBMS_LOCK. 0 -----no exception 1-----user defined exception +100 ---no data found -ve----another orcale server error number. DBMS_ALERT. If they include the SQL routines provided by Oracle. What packages (if any) has Oracle provided for use by developers? Expected answer: Oracle provides the DBMS_ series of packages. 32.if we query the data from employee table by where cluase like employee_number = 123 then oracle will have to implictly convert the number 123 to varhcar '123'and will require time By avoiding sql statements & select INTO kind of statements. DBMS_OUTPUT. so. DBMS_JOB. The SQLERRM returns the actual error message for the last error encountered. If they can mention a few of these and describe how they used them. Sqlcode----exception type«. the error that occurred in the code. They can be used in exception handling to report. To improve better creating cursors to hold data.. 33. Utl_http package 35. DBMS_UTILITY. store in an error log table. These are especially useful for the WHEN OTHERS EXCEPTION.Which DBMS package is used for to retrive the web portal into the PL/SQL block. even better. Indexing is the way to tune the database tables. DBMS_DDL. 34.What is materialized view «explain with an example . It Wont Affect The Data In The Same Globaltemporary Table In Other Sessions 37.

Primary Key materialized views ROWID materialized views Object materialized views -. In such conditions.T2. c. is not a feasible option. a.T3> WHERE <CONDITIONS. There comes the usage of a materialized views as they can store the data they have queried 2. it runs the saved query and fetches data. What is a materialized view? A materialized view is a snapshot of data which could be refreshed at defined intervals. How to create a Materialized view? Eg: A Materialized view which gets refreshed automatically every day at 4 AM. b. Whenever we do a select * from view. b. since views dont. c. it is unclear that a materialized view can hold data. JOINS> TABLESPACE be created in which tablespace MV is to .1. Complex materialized views 3. So. CREATE OR REPLACE MATERIALIZED VIEW TABLESPACE <tb_name> NOCACHE NOLOGGING NOPARALLEL BUILD IMMEDIATE --or < DEFFERED> REFRESH COMPLETE WITH ROWID START WITH SYSDATE NEXT UPDATE SYSDATE+4/24 SELECT <COLUMNS> FROM <T1.Created based on Object types other than tables d. From the name. there should be a technique to store the data such that we should run the query only if there is a change in data in the underlying tables. Especially in a datawarehousing environment or for reporting purposes. Different type of materialized views? a. d. Views are nothing but a query stored in a Database. running the query each time whenever required. Sometimes there would be a need for a huge query with many join operations between more than 10-20 tables containing millions of records and many where conditions.

Note: MV Log is a must for using this method to store the changes. First DEFERRED REFRESH must always be a complete refresh IMMEDIATE the data as soon as it is created.LOGGING/NOLOGGING Lets you specify whether the creation log of the MV would be written to the Redo log file (LOGGING) or not (NOLOGGING) For data that will be accessed frequently. if one is possible else a complete refresh. This asks the MV to populate REFRESH <do> FAST Incremental refresh method. When this is given MV will be populated only by next REFRESH Operation. CACHE/NOCACHE DEFERRED DEFFERED is another option instead of the BUILD IMMEDIATE one. CACHE specifies those blocks retrieved are placed in the most recently used place of LRU list in the buffer cache when full table scan is done. Oracle will perform a fast refresh. whenever the DB commits a transaction on the Master Table/s <do> ON DEMAND Refresh according to user . <do> ON COMMIT Oracle performs a FAST REFRESH When this option is specified. <do> FORCE This is the default if none of these options are specified. which performs according to the changes that have occurred in the master tables. This indicates that whenever a refresh occurs.

Stop Oracle SQLTRACE In Oracle. Oracle SQLTRACE provides generates the following statistics for each SQL statement: Count procedure was executed CPU executing Number of times OCI CPU time in seconds . to start an SQLTRACE for the current session. Could be added if the MV 38.need. Use the DBMS_MVIEW package WITH ROWID This option is used if the underlying tables used doesnot have any primary key/s. WITH PRIMARY KEY This option is used if the underlying tables used have primary key/s START WITH SYSDATE This option required only if user wants to get the MV refreshed automatically NEXT UPDATE SYSDATE+<interval> at specified time intervals FOR UPDATE needs to be updated.What is SQL_TRACE AND TKPROOF Start Oracle SQLTRACE: In Oracle. execute: ALTER SESSION SET sql_trace = false. execute: ALTER SESSION SET SQL_TRACE = TRUE. to stop SQL tracing for the current session.

Aggregate = yes/no Insert = filename List SQL statements and data inside INSERT statements. No.Elapsed Elapsed time in seconds executing Disk Number of physical reads of buffers from disk Query Number of buffers gotten for consistent read Current Number of buffers gotten in current mode (usually for update) Rows Number of rows processed by the fetch or execute call Misses in library cache during parse Parsing user id Optimizer goal When Oracle SQLTRACE facility is enabled.tablename Explain = user/password to issue EXPLAIN PLAN Print = Integer List only the first 'integer' SQL statements. all the statistics for all SQL statements executed after that are placed into trace files. It stores the following statistics of a Query: Resources used by the SQL statement. of times that the statement was called No of records processed. These trace files are not in readable format. This utility is also used for monitoring and tuning applications executing against the Oracle server. Syntax: TKPROF tracefile outputfile [print=] [insert=] [sys=] [sort=] [explain=] [table=] Table = schema. Here comes the usage of TKPROF. Sys = no TKPROF does not list SQL statements run as user SYS. Record = filename Record non-recursive statements found in the trace file. TKPROF is used for formatting the trace files to produce a more readable format. .

EXECNT Number of executes. FCHELA Elapsed time spent fetching. FCHROW Number of rows fetched. PRSCU Number of current mode block reads during parse. . EXECU Number of current mode block reads during execute. EXEDSK Number of physical reads from disk during execute. FCHDSK Number of physical reads from disk during fetch. EXECPU CPU time spent executing. EXEQRY Number of consistent mode block reads during execute. EXEMIS Number of library cache misses during executes FCHCNT Number of fetches FCHCPU CPU time spent fetching. EXEROW Number of rows processed during execute. FCHCU Number of current mode block reads during fetch. PRSMIS Number of library cache misses during parse.Waits = yes/no Record summary for any wait events found in the trace file. of times parsed. EXEELA Elapsed time spent executing. FCHQRY Number of consistent mode block reads during fetch. PRSQRY Number of consistent mode block reads during parse. EXEDSK Number of physical reads from disk during execute. Sort = option Set of zero or more of the following sort options: Sort options are listed as follows: PRSCNT No. PRSCPU CPU parsing time PRSELA Elapsed time parsing PRSDSK Number of disk reads during parse.

00 0.txt record=record.---------.---------.sql trace_output.85 42 10 Misses in library cache during parse: 2 Optimizer goal: CHOOSE Parsing user id: 10292 Rows Row Source Operation ------. VARRAY etc having records of data) as a Return type (OUT or IN OUT parameter) as we know.Eg: TKPROF insert=tkprof.07 0.sql Sample output: select * from emp where empno =9334 call current rows ------.54 0.75 0 0 42 0 0 13184 ----count cpu elapsed disk query ------.---------.---------.03 0.trc outputfile.-----.--------------------------------------------------1 TABLE ACCESS FULL EMPLOYEE 39. That means the entire data .---------.--------total 80 0.-------.---------.---------.What is nocopy Parameter in pl/sql Procedures.-------. it will be passed by value only.-----.---------.00 0.-------------0 0 0 Parse 0 Execute 0 Fetch 10 20 20 40 0.---------. Explanation of NOCOPY parameter: 13184 0 When you use a Collection (Records.54 0.

This helps reducing a lot of CPU usage as well as memory consumption. which instructs the PL/SQL Engine to avoid using the pass by value method. Provide NOCOPY after the OUT/IN OUT parameter. IN IN OUT NOCOPY NUMBER. the Engine uses pass by reference instead.will be copied to the formal parameter location. PROCEDURE PRC_NOCOPY_EXAMPLE ( P_EMPNO P_ENAME P_SAL ). So. RECORD_SAL --PL/SQL Record Now if you call the Procedure PRC_NOCOPY_EXAMPLE. VARCHAR2(50). REC_SAL RECORD_SAL. NOTE: Disadvantage: . the parameter P_SAL would only use Pass by reference method. Here comes the usage of NOCOPY parameter. which leads to lot of CPU and memory consumption. Eg: Just an example how to put the NOCOPY parameter.

Then it goes to the table and fetches only that particular value. Indexes contain an entry for each cell value that appears in the indexed column(s) of the table or cluster. to conclude. Thus an index is a performance-tuning method which allows faster retrieval of records. any change that happens on the passed Parameters gets updated in the same memory location as the Actual parameter. an Index could be considered as a unique bookmark to a database cell (of those columns which are indexed). To be precise. there will be a unique identifer. So. When you pass parameters to a procedure by reference. it is up to a Developer to take a trade-off between using or not using the NOCOPY parameter. 40. then it may result in incorrect results. could result in incorrect results too. when an index is used in a query. In Oracle 9i. For each cell in an indexed column.. which is known as the index. but at the same time. Oracle Engine first searches through the indexes and reaches the index of the particluar cell value.what are are the types of indexes and briefly explain them«. you need to be extremely careful while using this method in coding for high priority data transactions. Oracle supports different types of indexes: y y y y y B-Tree indexes (Normal) Bitmap indexes Partitioned indexes Function-based indexes Domain indexes . these changes are not Rolled back . NOCOPY could provide better performance by reducing Memory and CPU cost. So.However. So when an exception occurs in a procedure/function. if the actual values get changed.what is index. Thus. the PL/SQL engine cannot rollback these parameter changes. Thus we could avoid Full table scans. What is an Index? To explain in plain English. it is searching for. Indexes are stored in the Index segments in Oracle database (unless it is an Index Organized table (IOT) which we are not discussing here).

It goes on doing this until it reaches the leaf node which contains the value it is searching for.1 Binary Tree How to Create an Index? CREATE INDEX IDX_NAME ON TABLE_NAME (Col_nam1. When it gets a value to be searched. ) COMPUTE STATISTICS .Col_nam2. Oracle creates B-tree indexes How to Rename an Index? ALTER INDEX IDX_NAME RENAME TO NEW_IDX_NAME. it gets the nearest possible index value.Here we are going to discuss about B-Tree and Bitmap Indexes.Binary Tree Index: As the name suggests it makes use of the B-Tree parsing method to find the value being searched for. How to Collect Statistics on an Index ALTER INDEX IDX_NAME COMPUTE STATISTICS. Fig 1. --optional ** Note: by default. Then it goes to the left node if the value it lesser or to the right if the value is higher. Oracle . I. .

If the value being indexed is found in the row. That means. the records which are pointed by the 1 s in the Index. Bitmap Indexes stores the information about the value in bits.Bitmap Index: Oracle Bitmap Indexes are different from Standard B-Tree Indexes in the way they store the information about the indexes. Oracle takes only the information from those rows which shows a 1 in the Bitmap Index. and ROWIDs as we know are unique identifiers to records/rows. have got the searched/indexed value. And from a performance point of view. with 0s and 1s. These matching values are the given to the Oracle engine in the form of a ROWID list. it will specify a 1 and if not found then a 0 . Something like this: Fig 1.How to Drop an Index DROP INDEX IDX_NAME II. So while searching. Oracle . Oracle decompresses the bitmap into the RAM data buffers so that it can rapidly scan for matching values. during the data retrieval time. . Bitmap Index creates a two-dimensional array with one column for every row in the table being indexed. thus called Bitmaps.2 Show how Bitmap Indexes are stored.

How to Create a Bitmap Index? CREATE BITMAP INDEX IDX_NAME ON TABLE_NAME (Col_nam1.Bitmap Indexes ifferences between B-Tree and Bitmap Indexes in Structure and performance and their usage. Uncompressed structure in B-Tree involves a lesser CPU load compared to Bitmap but it requires more bandwidth to read since it is uncompressed data.Q. So. For eg: if you work on a batch processing environment. 1. then it is obvious that you would have frequent DML operations on the tables involved. it is better to use Bitmap Indexes on columns of Tables which are updated/inserted/deleted less frequently . the ratio of distinct values to the total number of records. Performance: Bitmap Indexes have highly compressed structure. it is better to use B-Tree indexes. B-Tree Versus . 3. Structure: Compressed structure in Bitmap Indexes makes it faster to read from disk.Col_nam2. So. . a low cardinality means. Updating bitmapped indexes consumes lot of resources. but utilises more CPU to decompress the information. Cardinality: Cardinality means. DML Operations: If you have too much DML operations (insert/update/delete) on a table on which the columns are indexed. Bitmap indexes are considered to be more efficient thatB-Tree indexes. In such a scenario. making them fast to read and their structure makes it possible for the system to combine multiple indexes together for fast access to the underlying table/s. distinct values are very less. 2. 4. ) COMPUTE STATISTICS .

The trigger can't understand whether to release the locks applied or to continue and hence hangs.Locks are released when a TCL command is executed. Record used to store a single row thus for store multiple rows on a variable use Table of records 43. The trigger is fired when an event occurs while manipulating the data in table. record D. Enable_at_time 2.what are the Flash back queries in oracle« Flashback query is used to retrieve data which is errantly deleted or updated in the database.. Or we can say we can see data prior to commit the data in the database.Varchar stores only single value.41. 42.what is size of dbms_output. If a procedure is referring a table and if the structure of the table is changed. There are two method to retrieve data. Enable_at_system_change_number . So the trigger applies a lock on it restricting others to modify it. 1. varchar2 C.Hence TCL commands are not entertained in the triggers. then is it possible that the status of the procedure remains valid? Explain The status becomes invalid. table of records We need multiple rows on a variable so we use here Table of records . 44.put_line( ) package«.Cursor is used for selecting multiple rows from stored table. lets say data type of the any column is changed. You will have to recompile the procedure. the maximum output is determined by the size you specified in dbms_output. 45.can we use TCL Commands on a TRIGGERS. which one of the following choices identifies the mechanism best suited for this task (choose one)? A.it uses just like as collection of records. cursor B.Bulk Data Operations You are developing a PL/SQL block designed for bulk data operations. Flashback only available in system managed undo database.enable(<size>). When attemping to store table data for multiple rows in a PL/SQL variable.

Based on the information you can choose a more efficient execution plan by using hint and telling the optimizer to choose a more optimal path.. Explain specific business reason of it's use Instead of triggers are used: 1) To control the DML operations on Views(Insert/Update/Delete) 2) Makes the non updatable views updatable 47. If the exception is not raised then all the transaction will be rolled back. what are optimizer hints? Optimizer hints are used to alter execution plan of SQL statement. 45. Hints used for Optimization are : All_rows First_rows 46. Why we use instead of trigger.all the transaction made before will be commited.In built package for the same is DBMS_FLASHBACK Flash back query is used to retrive the data. certain index can be sometimes more selective for certain queries. . what is the basic structure of the instead of trigger. what happens when commit is given in executable section and an error occurs ?please tell me what happens if exception block is committed at the last? Whenever the exception is raised . syn: FLASHBACK TABLE table_name TO BEFORE DROP. This will work only if recycled bin is not purged. For ex. what is the order of execution if there is a statement level and row level trigger on a same table? The Order will be: Before Statement level Before Row level After Row level After Statement level 48. For ex if a table is dropped and we want the table again so at that time.

It increases number of context switches between sql and pl/sql. Can any one explain Perforance Tuning in PL/SQL Performance tuning can be improved by using FOR ALL and BULK COLLECT clauses in place of FOR LOOP and CURSORS which makes the application faster and better. The main disadvantage of cursors is that it process records sequentially. It hampers the performance. Cursors meachanism allows us to name that private sql area there by access information stored it. . We may overcome this problem by using collections. State the advatage and disadvantage of Cursor's Whenever we execute DML statements oracle assigns a work area called private sql area to store information.49. 50.

Sign up to vote on this title
UsefulNot useful