<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7067326527441676813</id><updated>2012-02-16T08:49:40.313-08:00</updated><category term='WHAT DOES IT MEAN WHEN ORACLE INDICATES THAT A SESSION IS “ACTIVE'/><category term='HOW CAN YOU SPECIFY AN DIFFERENT DIRECTORY FOR THE LISTENER.ORA FILE'/><category term='what is ADDM in oracle 10g. how it helps to diagnose the performance problem.'/><category term='WHAT ARE THE IMPORTANT LIMITATIONS OF GRANTING OBJECT PRIVILEGES VIA ROLES'/><category term='Data Guard Database Synchronization Options'/><category term='Name three SQL operations that perform a SORT'/><category term='What are the differences between AWR and STATSPACK'/><category term='Handling Errors During Backups: Example'/><category term='ST enqueue'/><category term='How does one backup and restore a database using RMAN?'/><category term='HOW DO YOU CHANGE THE SETTING FOR THE PACKET SIZE'/><category term='How do you add a node to 10G EM grid control'/><category term='What is Oracle Secure Backup (OSB)?'/><category term='WHAT SETTING SHOULD I USE FOR DB_FILE_MULTIBLOCK_READ_COUNT'/><category term='HOW CAN I MAKE ALL MY COMMANDS DEFAULT TO A DIFFERENT SCHEMA'/><category term='“COMPRESS” MEAN'/><category term='Cumulative Incremental Backups'/><category term='Oracle 10 RMAN Views'/><category term='How does one backup and restore archived log files?'/><category term='What are the extended flashback features in oracle 10g?'/><category term='How is Oracle Application Server 10g packaged and what components are included in each edition?'/><category term='Reverting a Table to its Previous Statistics'/><category term='What is PCTFREE and PCTUSED'/><category term='What is Oracle Application Server 10g?'/><category term='WHAT DOES QUERY REWRITE DO IN CONJUNCTION WITH A MATERIALIZED VIEW'/><category term='Copying Statistics Using DBMS_STATS'/><category term='WITHOUT STATSPACK REPORTS'/><category term='WHAT SECTION SUMMARIZES WHERE MOST OF THE DATABASE TIME IS SPENT'/><category term='EVEN THOUGH NO SQL HINT WAS SPECIFIED'/><category term='Using Function-based Indexes for Performance'/><category term='What is Bigfile tablespace? why do we create it? what is the advantage of using it?'/><category term='WHAT DOES “KEY” MEAN'/><category term='Finding Locks and Lock Holders'/><category term='Define INITTRANS  parameter in oracle table'/><category term='Oracle Real Application Clusters (RAC) FAQ - previously called Oracle Parallel Server (OPS)'/><category term='How many OCR and voting disks should one have?'/><category term='HOW DO YOU SEE ROLES GIVEN TO A USER'/><category term='Database Backup and Recovery Concepts'/><category term='What is auxiliary instance? when it is created?'/><category term='Backing Up Control Files with RMAN'/><category term='How do you bring the database in ARCHIVELOG mode from NOARCHIVELOG mode? The following steps switch the database archiving mode from NOARCHIVELOG to ARCHIVELOG'/><category term='Can any application be deployed on RAC?'/><category term='IN PERFORMING A DATABASE RECOVERY'/><category term='Oracle Database 10g Scheduler'/><category term='Oracle Datapump expdp/impdp help parameters'/><category term='SQL Loader - Frquently Asked Questions and Answers'/><category term='Backing Up Server Parameter Files with RMAN'/><category term='How many Maximum Datafiles can there be in an Oracle Database'/><category term='HOW DO YOU LIMIT THE MAXIMUM NUMBER OF PARALLEL PROCESSES FOR THE DATABASE'/><category term='P3 PARAMETERS'/><category term='What SQL you use to see oracle background processes?'/><category term='INSTEAD OF A REGULAR TABLE'/><category term='Which background processes coordinates the rebalancing of disks in ASM'/><category term='What is Oracle ASM?'/><category term='What are the common requirements for ASM installation'/><category term='What is Oracle data guard. can it be used in RAC env?'/><category term='What information is stored in Control File'/><category term='Connection hanging? what are the possibilities?'/><category term='What is Oracle Data Pump in 10g. how it is different than Oracle exp/imp utility'/><category term='Explain Partitioning in Oracle? What is the advantage of using it?'/><category term='WHAT SQL HINT IS USED FOR A HASH JOIN'/><category term='Oracle database tuning without any tools - using performance views - part 1'/><category term='Oracle 10gR2 load balancing - Server side load balancing'/><category term='What is FLASHBACK TABLE ? Explain with examples?'/><category term='What are oracle data guard benefits?'/><category term='How RMAN Performs Control File Autobackups?'/><category term='HOW MUST YOU SPECIFY A SQL HINT ON THAT TABLE'/><category term='Privilages to create a refresh-on-commit materialized view'/><category term='WHAT DOES SKIP-SCAN MEAN'/><category term='How does Oracle handle locking'/><category term='VPD'/><category term='WHY WOULD YOU SEE HUGE AMOUNTS OF LOG FILE SYNC'/><category term='HOW CAN YOU IDENTIFY WHAT QUERIES OR TRANSACTIONS ARE RUNNING IN THE DATABASE RIGHT NOW'/><category term='ON A UNIX SERVER'/><category term='What is block change tracking in RMAN Oracle 10g'/><category term='Database and Instance Shutdown'/><category term='What is HWM (High water mark in oracle)?'/><category term='Connection and Process'/><category term='HOW CAN YOU SEE WHICH SESSIONS ARE ACTIVE'/><category term='HOW CAN TABLE PARTITIONING ACTUALLY HURT PERFORMANCE'/><category term='Do you need special hardware to run RAC?'/><category term='WHAT IS QUERY SUBFACTORING AND WHY IS IT HELPFUL'/><category term='Level 0 and Level 1 Incremental Backups'/><category term='What are the different files that RMAN can backup?'/><category term='WHAT OPTIONS DO WE HAVE FOR PREVENTING A SNAPSHOT TOO OLD ERROR'/><category term='Job Interview Answer: Tell Me About Yourself'/><category term='What is Partition Pruning'/><category term='IN THE EXECUTION PLAN FOR A PARTITIONED TABLE SCAN'/><category term='What is the Job of SMON'/><category term='Data Guard Benefits'/><category term='WHY DOES A “SNAPSHOT TOO OLD” ERROR OCCUR'/><category term='WHY WOULD WE EVER NEED TO USE COMPOSITE PARTITIONS'/><category term='HOW COULD YOU FIND IT'/><category term='RMAN Incremental Backups'/><category term='Oracle 10g Data Pump APIs'/><category term='Data Pump expdp help'/><category term='What platforms will Oracle Application Server 10g be available on?'/><category term='What is block pinging and why is it so bad?'/><category term='HOW CAN I SUMMARIZE THE CUMULATIVE RESOURCES USED BY A PARTICULAR SESSION'/><category term='HOW CAN I IDENTIFY THE OBJECTS INCURRING THE MOST LOGICAL and  PHYSICAL READS'/><category term='WHAT DOES THE OPTION'/><category term='How to setup RMAN in Oracle 9i'/><category term='Difference between old exp/imp and new data pump expdp/impdp'/><category term='Backing Up Individual Tablespaces with RMAN'/><category term='Flashback version query in oracle 10g'/><category term='AT THE DATABASE LEVEL'/><category term='HOW CAN YOU FIX THE OPTIMIZER PROBLEM WITH “BITMAP CONVERSION FROM ROWIDS'/><category term='WHAT’S THE ADVANTAGE OF USING PGA AGGREGATE TARGET'/><category term='How process communicates in Unix/Linux'/><category term='Unused Block Compression and Binary Compression of Backup Sets'/><category term='What is materialized view?'/><category term='Explain Oracle Partitioning. How it is helpfull in DWH env?'/><category term='Creating Primary Key Materialized Views: Example'/><category term='Backup Scripts When Few Data Blocks Change'/><category term='Oracle 10g Recovery Manager RMAN'/><category term='Automatic Refresh Times for Materialized Views: Example'/><category term='How does one convert a single instance database to RAC?'/><category term='general guidelines for setting object storage parameters'/><category term='Data Guard Role Management'/><category term='How to Negotiate a Compensation Package'/><category term='What is Oracle Enterprise Manager Grid Control?'/><category term='Manipulating Statistics Using DBMS_STATS'/><category term='WHAT ARE TYPICAL WAYS TO PARTITION A TABLE'/><category term='HOW CAN YOU USE A SQL HINT SO AS TO CHANGE THE JOIN ORDER'/><category term='Choosing Columns and Expressions to Index'/><category term='HOW CAN I SEE WHAT OBJECT IS BEING READ BY A CERTAIN SESSION AT THE PRESENT TIME'/><category term='Oracle Database 10g Scheduler - Associating Jobs with Programs'/><category term='Creating Prebuilt Materialized Views: Example'/><category term='TM enqueue'/><category term='Find how much memory is in your unix machine/server?'/><category term='Optimizing Performance of Direct Path Loads'/><category term='DBMS_JOB Package'/><category term='Redo Apply and SQL Apply'/><category term='HOW CAN PARALLEL PROCESSES BE WORKING ON A QUERY'/><category term='What is the advantage of using ASM in oracle 10g'/><category term='What is Automatic Workload Repository (AWR) in Oracle Database 10g. how it is diiferent than  UTLBSTAT/UTLESTAT'/><category term='Oracle 10gR2 load balancing - Part2 - Client-Side Load balancing'/><category term='What is Flashback Query'/><category term='What are new  RMAN features in Oracle 10g?'/><category term='How to Identify Your Oracle Database Software Release'/><category term='GIVE AN EXAMPLE OF A TYPE OF OPERATION THAT CAN EXCLUDE LOGGING'/><category term='Data Guard Broker'/><category term='WHAT’S AN EASY WAY TO CHECK THE VALUE OF A PARTICULAR INIT.ORA PARAMETER'/><category term='RMAN Backups and Tags'/><category term='How does one create a RMAN recovery catalog?'/><category term='Exporting and Importing External tables using Data Pump'/><category term='WHY WOULD YOU USE A “STORED OUTLINE'/><category term='Data Guard Protection Modes'/><category term='AND JUST SHOW THE STATISTICIS AND EXECUTION PLAN'/><category term='Oracle RMAN 11g - New Features'/><category term='HOW CAN YOU FIND THE EXECUTION PATH THAT WAS ACTUALLY RUN'/><category term='HOW CAN WE IDENTIFY UNUSED INDEXES'/><category term='WHY WOULD I EVER USE A GLOBAL TEMPORARY TABLE'/><category term='Backup Validation with RMAN'/><category term='HOW CAN I CHANGE HOW MANY BLOCKS ORACLE READS AT A SINGLE TIME'/><category term='What is Incremental Merge in RMAN 10g?'/><category term='Difference between Session'/><category term='What Happens When You Open a Database'/><category term='How do you generate AWR report?'/><category term='Oracle database tuning without any tools - using performance views - part 4 - Examine the Oracle Statistics'/><category term='iostat - Top 20 DBA unix commands'/><category term='vmstat - Top 20 DBA Unix commands'/><category term='WHAT’S THE SQL HINT FOR SPECIFYING THE LEADING TABLE OF A JOIN'/><category term='What is ASM - Automatic Storage management in Oracle 10g'/><category term='Creating Rowid Materialized Views: Example'/><category term='How Does Data Pump Access Data?'/><category term='PMON processes'/><category term='Backing Up Datafiles and Datafile Copies with RMAN'/><category term='Where you suggest using RAC environment and how this is effective for'/><category term='Differences Between Data Warehouse and OLTP Systems'/><category term='Differential Incremental Backups'/><category term='Oracle Database 10g Scheduler - Creating Jobs Without Programs'/><category term='DBMS_ADVISOR Package'/><category term='WHY DO WE CARE IF BIND VARIABLES ARE USED BY AN APPLICATION'/><category term='Moving from DBMS_JOB to DBMS_SCHEDULER'/><category term='Are the Oracle Application Server 10g modules licensed separately?'/><category term='WHAT init.ora PARAMETER MUST BE SET FOR FUNCTION-INDEXES TO WORK'/><category term='HW enqueue'/><category term='Oracle database tuning without any tools - using performance views - part 3 - Examine the Host system'/><category term='WHAT’S THE DIFFERENCE BETWEEN SEQUENTIAL AND SCATTERED READS'/><category term='Parameter File Search Order in Oracle Real Application Clusters'/><category term='RAC Differences'/><category term='What are the major differences between Oracle9i Application Server (Oracle9iAS) and Oracle Application Server 10g?'/><category term='Improving Incremental Backup Performance: Change Tracking'/><category term='Choosing Composite Indexes'/><category term='What’s the difference between traditional Hot backup and RMAN backup'/><category term='Gathering statistics with DBMS_STAT Package'/><category term='Flashback Versions Query and Flashback Transaction Query'/><category term='Oracle Data Pump in Oracle Database 10g'/><category term='Full and Incremental Datafile Backups'/><category term='Moving data files'/><category term='Oracle database tuning without any tools - using performance views - part 2 - Define a problem'/><category term='When RMAN Performs Control File Autobackups'/><category term='All about ASM'/><category term='HOW CAN ORACLE AUTOMATICALLY CHECK FOR OBSOLETE STATISTICS'/><category term='Job Interview Answer:'/><category term='What is ASM instance. how it is started'/><category term='Making Consistent and Inconsistent Backups with RMAN'/><category term='IN SQL*PLUS'/><category term='Tests and Integrity Checks for Backups?'/><category term='Oracle data pump 10g impdp help'/><category term='What is oracle ASM in Oracle 10g? How do we create ASM instance?'/><category term='When you start an Oracle DB which file is accessed first'/><category term='What are the key product messages for Oracle Application Server 10g?'/><category term='Can one restore RMAN backups without a CONTROLFILE and RECOVERY CATALOG?'/><category term='Creating Materialized Aggregate Views: Example'/><category term='sar - Top 20 DBA unix commands'/><category term='What&apos;s New in Oracle Data Guard 11g?'/><category term='Using Compressed Backupsets'/><category term='WHAT’S AN EASY WAY TO SEE HOW MUCH DISK I/O WAS USED BY A SQL STATEMENT'/><category term='WHAT’S A TYPICAL RATE THAT ORACLE CAN PERFORM SEQUENTIAL READS'/><category term='Periodic Refresh of Materialized Views: Example'/><category term='What is ASMM (Automatic Shared memory management) in oracle 10g'/><category term='Creating Subquery Materialized Views: Example'/><category term='Creating a Fast Refreshable Materialized View: Example'/><category term='Data Loading Methods - SQL Loader'/><category term='Making Whole Database Backups with RMAN'/><category term='What is Voting Disk and OCR'/><category term='Can I test if a database is running in RAC mode?'/><category term='You have taken a manual backup of a datafile using o/s. How RMAN will know about it'/><category term='HOW DO HISTOGRAMS HELP THE OPTIMIZER MAKE BETTER DECISIONS'/><category term='How to find the resource definitions'/><category term='How does one stop and start RAC instances?'/><category term='IF YOU USE AN ALIAS FOR A TABLE'/><category term='P2'/><category term='What is VPD (viirtual private database in 10 g)'/><category term='WHEN DOES AN IMPLICIT COMMIT OCCUR'/><category term='Privilages to create a materialized view in another user&apos;s schema'/><category term='WHAT’S THE SIGNIFICANCE OF “RESET LOGS'/><category term='What is the difference between RAID 5 and RAID 10? Which is better for Oracle'/><category term='WHAT ARE THE P1'/><category term='What is the difference between a materialized view (snapshot) fast refresh versus complete refresh'/><category term='IN STATSPACK (OR AWR) REPORTS'/><category term='Move or shrink command - which one is better nd why'/><category term='Detecting Physical and Logical Block Corruption'/><category term='IN THE EXPORT UTILITY'/><category term='Shared Pool Concepts and  Using the Shared Pool Effectively'/><category term='What is Optimizer Plan Stability?'/><category term='WHAT MIGHT BE WRONG WITH SETTING PARALLELISM AT THE TABLE (OR INDEX) LEVEL'/><category term='What is RMAN and how does one use it?'/><category term='Incrementally Updated Backups: A One Week Example'/><category term='FOR A LONG-RUNNING TABLE SCAN'/><category term='How does one clone/duplicate a database with RMAN?'/><category term='HOW COULD I EASILY SEE THE PROGRESS'/><category term='GIVE AN EXAMPLE OF A SCALAR SUBQUERY'/><category term='DESCRIBE THE TWO BASIC WAYS TO REFRESH A MATERIALIZED VIEW'/><category term='Oracle 10gR2 load balancing- Client-Side Connection Failover'/><category term='what are the major new featurs in Oracle 10g data pump?'/><category term='Preparation for DBA Interview - Few Basic Questions'/><category term='HOW CAN WE CHANGE OUR QUERY TO USE MORE RESOURCES TO SPEED-UP A FULL TABLE SCAN'/><category term='HOW CAN YOU STOP THE OUTPUT'/><category term='Basic Incremental Backup Strategy'/><category term='DESCRIBE A MAJOR FUNCTIONALITY PROBLEM WITH BIT-MAP INDEXES'/><category term='Oracle 10gR2 load balancing - Part1'/><category term='Oracle Application Server Architecture'/><category term='Quick DBA Test - Oracle 10g'/><category term='WHAT IS A BUFFER_BUSY WAIT AND WHY DOES IT HAPPEN'/><category term='HOW CAN YOU TELL WHEN A TABLE WAS LAST ANALYZED'/><category term='How does one integrate RMAN with third-party Media Managers?'/><category term='Oracle Fundamentals'/><category term='WHAT IS THE PURPOSE OF AN AUTONOMOUS TRANSACTION'/><category term='WHAT’S THE DANGER OF USING THE NOLOGGING OPTION FOR A TRANSACTION'/><category term='TX enqueue'/><category term='Automatic Instance Creation for RMAN TSPITR'/><category term='What is difference between PFile and SPFile'/><category term='IF YOU FORGOT THE EXACT NAME OF A CERTAIN V$VIEW'/><category term='WHY DOES “ITL” LOCKING OCCUR'/><category term='Creating Materialized Join Views: Example'/><category term='GIVE AN EXAMPLE OF A “SET OPERATION.” WHY WOULD I NEED TO USE A SET OPERATION'/><category term='Data Conversion During Direct Path Loads'/><category term='Load Balancing In Oracle 10g Real Application Clusters Environments'/><category term='What is split brain'/><category term='WHAT’S THE DIFFERENCE BETWEEN A GLOBAL INDEX AND A LOCAL INDEX'/><category term='Oracle Version Information - How to CheckYour Current Release Number ?'/><category term='Detection of Logical Block Corruption'/><category term='Is database using pfile or spfile'/><category term='Setting oracle database in archive mode from non-archive mode'/><category term='What are RMAN 10g backup formats?'/><category term='Oracle Data pump 10g getting started'/><category term='HOW DOES ORACLE PRESERVE READ CONSISTENCY'/><category term='WHAT IS THE MAIN REASON TO INDEX FOREIGN KEYS'/><category term='WHAT PROBLEM USUALLY OCCURS ON A GLOBAL INDEX IF WE RUN DDL ON THE TABLE? CAN THIS PROBLEM BE AVOIDED'/><category term='Backing Up Archived Redo Logs with RMAN'/><category term='Creating a Nested Materialized View: Example'/><category term='What’s the difference between latch and enque'/><category term='what command do you execute to ensure that the control file is automatically backed up using Recovery Manager (RMAN)?'/><category term='How do you configure data guard in oracle?'/><category term='RMAN 10g'/><category term='IS IT POSSIBLE TO TURN OFF LOGGING FOR ALL TRANSACTIONS IN THE DATABASE'/><title type='text'>Oracle DBA Interview Questions</title><subtitle type='html'>Oracle DBA interview questions and Answers. Updated Weekly. RMAN Questions, AWR Questions, ADDM Questions, ASM Questions. Oracle 10g and Oracle 11g new features explained.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default?start-index=101&amp;max-results=100'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>277</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-9126294746252680906</id><published>2008-12-17T08:57:00.000-08:00</published><updated>2008-12-17T08:59:00.203-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Differences Between Data Warehouse and OLTP Systems'/><title type='text'>Differences Between Data Warehouse and OLTP Systems</title><content type='html'>Data warehouses and OLTP systems have very different requirements. Here are some examples of differences between typical data warehouses and OLTP systems:&lt;br /&gt;Workload&lt;br /&gt;&lt;br /&gt;Data warehouses are designed to accommodate ad hoc queries. You might not know the workload of your data warehouse in advance, so a data warehouse should be optimized to perform well for a wide variety of possible query operations.&lt;br /&gt;&lt;br /&gt;OLTP systems support only predefined operations. Your applications might be specifically tuned or designed to support only these operations.&lt;br /&gt;Data Modifications&lt;br /&gt;&lt;br /&gt;A data warehouse is updated on a regular basis by the ETL process (run nightly or weekly) using bulk data modification techniques. The end users of a data warehouse do not directly update the data warehouse.&lt;br /&gt;&lt;br /&gt;In OLTP systems, end users routinely issue individual data modification statements to the database. The OLTP database is always up to date, and reflects the current state of each business transaction.&lt;br /&gt;Schema Design&lt;br /&gt;&lt;br /&gt;Data warehouses often use denormalized or partially denormalized schemas (such as a star schema) to optimize query performance.&lt;br /&gt;&lt;br /&gt;OLTP systems often use fully normalized schemas to optimize update/insert/delete performance, and to guarantee data consistency.&lt;br /&gt;Typical Operations&lt;br /&gt;&lt;br /&gt;A typical data warehouse query scans thousands or millions of rows.For example, "Find the total sales for all customers last month."&lt;br /&gt;&lt;br /&gt;A typical OLTP operation accesses only a handful of records. For example, "Retrieve the current order for this customer."&lt;br /&gt;Historical Data&lt;br /&gt;&lt;br /&gt;Data warehouses usually store many months or years of data. This is to support historical analysis.&lt;br /&gt;&lt;br /&gt;OLTP systems usually store data from only a few weeks or months. The OLTP system stores only historical data as needed to successfully meet the requirements of the current transaction.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-9126294746252680906?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/9126294746252680906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=9126294746252680906' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9126294746252680906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9126294746252680906'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/12/differences-between-data-warehouse-and.html' title='Differences Between Data Warehouse and OLTP Systems'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4859774708044608287</id><published>2008-11-12T09:28:00.001-08:00</published><updated>2008-11-12T09:28:49.376-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Parameter File Search Order in Oracle Real Application Clusters'/><title type='text'>Parameter File Search Order in Oracle Real Application Clusters</title><content type='html'>Oracle searches for your parameter file in a particular order depending on your platform. On UNIX-based platforms, Oracle examines directories in the following order:&lt;br /&gt;&lt;br /&gt;   1.&lt;br /&gt;&lt;br /&gt;      $ORACLE_HOME/dbs/spfilesid.ora&lt;br /&gt;   2.&lt;br /&gt;&lt;br /&gt;      $ORACLE_HOME/dbs/spfile.ora&lt;br /&gt;   3.&lt;br /&gt;&lt;br /&gt;      $ORACLE_HOME/dbs/initsid.ora&lt;br /&gt;&lt;br /&gt;The search order on Windows-based platforms is:&lt;br /&gt;&lt;br /&gt;   1.&lt;br /&gt;&lt;br /&gt;      %ORACLE_HOME%\database\spfilesid.ora&lt;br /&gt;   2.&lt;br /&gt;&lt;br /&gt;      %ORACLE_HOME%\database\spfile.ora&lt;br /&gt;   3.&lt;br /&gt;&lt;br /&gt;      %ORACLE_HOME%\database\initsid.ora&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4859774708044608287?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4859774708044608287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4859774708044608287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4859774708044608287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4859774708044608287'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/11/parameter-file-search-order-in-oracle.html' title='Parameter File Search Order in Oracle Real Application Clusters'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8220517676311487478</id><published>2008-10-20T14:32:00.001-07:00</published><updated>2008-10-20T14:32:55.359-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Using Function-based Indexes for Performance'/><title type='text'>Using Function-based Indexes for Performance</title><content type='html'>A function-based index includes columns that are either transformed by a function, such as the UPPER function, or included in an expression, such as col1 + col2. With a function-based index, you can store computation-intensive expressions in the index.&lt;br /&gt;&lt;br /&gt;Defining a function-based index on the transformed column or expression allows that data to be returned using the index when that function or expression is used in a WHERE clause or an ORDER BY clause. This allows Oracle to bypass computing the value of the expression when processing SELECT and DELETE statements. Therefore, a function-based index can be beneficial when frequently-executed SQL statements include transformed columns, or columns in expressions, in a WHERE or ORDER BY clause.&lt;br /&gt;&lt;br /&gt;Oracle treats descending indexes as function-based indexes. The columns marked DESC are sorted in descending order.&lt;br /&gt;&lt;br /&gt;For example, function-based indexes defined with the UPPER(column_name) or LOWER(column_name) keywords allow case-insensitive searches. The index created in the following statement:&lt;br /&gt;&lt;br /&gt;CREATE INDEX uppercase_idx ON employees (UPPER(last_name));&lt;br /&gt;&lt;br /&gt;facilitates processing queries such as:&lt;br /&gt;&lt;br /&gt;SELECT * FROM employees&lt;br /&gt;    WHERE UPPER(last_name) = 'MARKSON';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8220517676311487478?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8220517676311487478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8220517676311487478' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8220517676311487478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8220517676311487478'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/using-function-based-indexes-for.html' title='Using Function-based Indexes for Performance'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7545678366048030174</id><published>2008-10-20T14:30:00.001-07:00</published><updated>2008-10-20T14:30:55.190-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Choosing Composite Indexes'/><title type='text'>Choosing Composite Indexes</title><content type='html'>A composite index contains more than one key column. Composite indexes can provide additional advantages over single-column indexes:&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;*Improved selectivity&lt;br /&gt;&lt;br /&gt;Sometimes two or more columns or expressions, each with poor selectivity, can be combined to form a composite index with higher selectivity.&lt;br /&gt;    &lt;br /&gt;*Reduced I/O&lt;br /&gt;&lt;br /&gt;If all columns selected by a query are in a composite index, then Oracle can return these values from the index without accessing the table.&lt;br /&gt;&lt;br /&gt;A SQL statement can use an access path involving a composite index if the statement contains constructs that use a leading portion of the index.&lt;br /&gt;&lt;br /&gt;Note:This is no longer the case with index skip scans. See "Index Skip Scans".&lt;br /&gt;&lt;br /&gt;A leading portion of an index is a set of one or more columns that were specified first and consecutively in the list of columns in the CREATE INDEX statement that created the index. Consider this CREATE INDEX statement:&lt;br /&gt;&lt;br /&gt;CREATE INDEX comp_ind &lt;br /&gt;ON table1(x, y, z);&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;*x, xy, and xyz combinations of columns are leading portions of the index&lt;br /&gt;    &lt;br /&gt;*yz, y, and z combinations of columns are not leading portions of the index&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Choosing Keys for Composite Indexes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Follow these guidelines for choosing keys for composite indexes:&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;*Consider creating a composite index on keys that are used together frequently in WHERE clause conditions combined with AND operators, especially if their combined selectivity is better than the selectivity of either key individually.&lt;br /&gt;    &lt;br /&gt;*If several queries select the same set of keys based on one or more key values, then consider creating a composite index containing all of these keys.&lt;br /&gt;&lt;br /&gt;Of course, consider the guidelines associated with the general performance advantages and trade-offs of indexes described in the previous sections.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Ordering Keys for Composite Indexes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Follow these guidelines for ordering keys in composite indexes:&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;*Create the index so the keys used in WHERE clauses make up a leading portion.&lt;br /&gt;    &lt;br /&gt;*If some keys are used in WHERE clauses more frequently, then be sure to create the index so that the more frequently selected keys make up a leading portion to allow the statements that use only these keys to use the index.&lt;br /&gt;    &lt;br /&gt;*If all keys are used in the WHERE clauses equally often but the data is physically ordered on one of the keys, then place that key first in the composite index.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7545678366048030174?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7545678366048030174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7545678366048030174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7545678366048030174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7545678366048030174'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/choosing-composite-indexes.html' title='Choosing Composite Indexes'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-2957061485444137938</id><published>2008-10-20T13:59:00.000-07:00</published><updated>2008-10-20T14:00:15.263-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Choosing Columns and Expressions to Index'/><title type='text'>Choosing Columns and Expressions to Index</title><content type='html'>A key is a column or expression on which you can build an index. Follow these guidelines for choosing keys to index:&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;* Consider indexing keys that are used frequently in WHERE clauses.&lt;br /&gt;    &lt;br /&gt;* Consider indexing keys that are used frequently to join tables in SQL statements. For more information on optimizing joins, see the section "Using Hash Clusters for Performance".&lt;br /&gt;    &lt;br /&gt;* Choose index keys that have high selectivity. The selectivity of an index is the percentage of rows in a table having the same value for the indexed key. An index's selectivity is optimal if few rows have the same value.&lt;br /&gt;&lt;br /&gt;      Note:Oracle automatically creates indexes, or uses existing indexes, on the keys and expressions of unique and primary keys that you define with integrity constraints.&lt;br /&gt;&lt;br /&gt;      Indexing low selectivity columns can be helpful if the data distribution is skewed so that one or two values occur much less often than other values.&lt;br /&gt;    &lt;br /&gt;*Do not use standard B-tree indexes on keys or expressions with few distinct values. Such keys or expressions usually have poor selectivity and therefore do not optimize performance unless the frequently selected key values appear less frequently than the other key values. You can use bitmap indexes effectively in such cases, unless the index is modified frequently, as in a high concurrency OLTP application.&lt;br /&gt;    &lt;br /&gt;*Do not index columns that are modified frequently. UPDATE statements that modify indexed columns and INSERT and DELETE statements that modify indexed tables take longer than if there were no index. Such SQL statements must modify data in indexes as well as data in tables. They also generate additional undo and redo.&lt;br /&gt;    &lt;br /&gt;*Do not index keys that appear only in WHERE clauses with functions or operators. A WHERE clause that uses a function, other than MIN or MAX, or an operator with an indexed key does not make available the access path that uses the index except with function-based indexes.&lt;br /&gt;    &lt;br /&gt;*Consider indexing foreign keys of referential integrity constraints in cases in which a large number of concurrent INSERT, UPDATE, and DELETE statements access the parent and child tables. Such an index allows UPDATEs and DELETEs on the parent table without share locking the child table.&lt;br /&gt;    &lt;br /&gt;*When choosing to index a key, consider whether the performance gain for queries is worth the performance loss for INSERTs, UPDATEs, and DELETEs and the use of the space required to store the index. You might want to experiment by comparing the processing times of the SQL statements with and without indexes. You can measure processing time with the SQL trace facility.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-2957061485444137938?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/2957061485444137938/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=2957061485444137938' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2957061485444137938'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2957061485444137938'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/choosing-columns-and-expressions-to.html' title='Choosing Columns and Expressions to Index'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8072958770476941610</id><published>2008-10-17T11:41:00.003-07:00</published><updated>2008-10-17T11:41:55.917-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Finding Locks and Lock Holders'/><title type='text'>Finding Locks and Lock Holders</title><content type='html'>Query V$LOCK to find the sessions holding the lock. For every session waiting for the event enqueue, there is a row in V$LOCK with REQUEST &lt;&gt; 0. Use one of the following two queries to find the sessions holding the locks and waiting for the locks.&lt;br /&gt;&lt;br /&gt;If there are enqueue waits, you can see these using the following statement:&lt;br /&gt;&lt;br /&gt;SELECT * FROM V$LOCK WHERE request &gt; 0;&lt;br /&gt;&lt;br /&gt;To show only holders and waiters for locks being waited on, use the following:&lt;br /&gt;&lt;br /&gt;SELECT DECODE(request,0,'Holder: ','Waiter: ') || &lt;br /&gt;          sid sess, id1, id2, lmode, request, type&lt;br /&gt;   FROM V$LOCK&lt;br /&gt; WHERE (id1, id2, type) IN (SELECT id1, id2, type FROM V$LOCK WHERE request &gt; 0)&lt;br /&gt;   ORDER BY id1, request;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8072958770476941610?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8072958770476941610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8072958770476941610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8072958770476941610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8072958770476941610'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/finding-locks-and-lock-holders.html' title='Finding Locks and Lock Holders'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4661751109428207127</id><published>2008-10-17T11:41:00.001-07:00</published><updated>2008-10-17T11:41:21.178-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TM enqueue'/><title type='text'>TM enqueue</title><content type='html'>TM enqueue&lt;br /&gt;&lt;br /&gt;The most common reason for waits on TM locks tend to involve foreign key constraints where the constrained columns are not indexed. Index the foreign key columns to avoid this problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4661751109428207127?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4661751109428207127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4661751109428207127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4661751109428207127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4661751109428207127'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/tm-enqueue.html' title='TM enqueue'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7234885348193878109</id><published>2008-10-17T11:40:00.003-07:00</published><updated>2008-10-17T11:40:49.621-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HW enqueue'/><title type='text'>HW enqueue</title><content type='html'>The HW enqueue is used to serialize the allocation of space beyond the high water mark of a segment.&lt;br /&gt;&lt;br /&gt;    *V$SESSION_WAIT.P2 / V$LOCK.ID1 is the tablespace number.&lt;br /&gt;    *V$SESSION_WAIT.P3 / V$LOCK.ID2 is the relative dba of segment header of the object for which space is being allocated.&lt;br /&gt;&lt;br /&gt;If this is a point of contention for an object, then manual allocation of extents solves the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7234885348193878109?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7234885348193878109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7234885348193878109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7234885348193878109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7234885348193878109'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/hw-enqueue.html' title='HW enqueue'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-9115365145937104409</id><published>2008-10-17T11:40:00.001-07:00</published><updated>2008-10-17T11:40:19.538-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ST enqueue'/><title type='text'>ST enqueue</title><content type='html'>ST enqueue&lt;br /&gt;&lt;br /&gt;If the contended-for enqueue is the ST enqueue, then the problem is most likely to be dynamic space allocation. Oracle dynamically allocates an extent to a segment when there is no more free space available in the segment. This enqueue is only used for dictionary managed tablespaces.&lt;br /&gt;&lt;br /&gt;To solve contention on this resource:&lt;br /&gt;&lt;br /&gt;*Check to see whether the temporary (that is, sort) tablespace uses TEMPFILES. If not, then switch to using TEMPFILES.&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;*Switch to using locally managed tablespaces if the tablespace that contains segments that are growing dynamically is dictionary managed.&lt;br /&gt;&lt;br /&gt;#If it is not possible to switch to locally managed tablespaces, then ST enqueue resource usage can be decreased by changing the next extent sizes of the growing objects to be large enough to avoid constant space allocation. To determine which segments are growing constantly, monitor the EXTENTS column of the DBA_SEGMENTS view for all SEGMENT_NAMEs. See Oracle Database Administrator's Guide for information about displaying information about space usage.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#Preallocate space in the segment, for example, by allocating extents using the ALTER TABLE ALLOCATE EXTENT SQL statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-9115365145937104409?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/9115365145937104409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=9115365145937104409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9115365145937104409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9115365145937104409'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/st-enqueue.html' title='ST enqueue'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8101407058784690351</id><published>2008-10-17T11:36:00.001-07:00</published><updated>2008-10-17T11:36:19.705-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TX enqueue'/><title type='text'>TX enqueue</title><content type='html'>TX enqueue&lt;br /&gt;&lt;br /&gt;These are acquired exclusive when a transaction initiates its first change and held until the transaction does a COMMIT or ROLLBACK.&lt;br /&gt;&lt;br /&gt;* Waits for TX in mode 6: occurs when a session is waiting for a row level lock that is already held by another session. This occurs when one user is updating or deleting a row, which another session wishes to update or delete. This type of TX enqueue wait corresponds to the wait event enq: TX - row lock contention.&lt;br /&gt;&lt;br /&gt;The solution is to have the first session already holding the lock perform a COMMIT or ROLLBACK.&lt;br /&gt;    &lt;br /&gt;* Waits for TX in mode 4 can occur if the session is waiting for an ITL (interested transaction list) slot in a block. This happens when the session wants to lock a row in the block but one or more other sessions have rows locked in the same block, and there is no free ITL slot in the block. Usually, Oracle dynamically adds another ITL slot. This may not be possible if there is insufficient free space in the block to add an ITL. If so, the session waits for a slot with a TX enqueue in mode 4. This type of TX enqueue wait corresponds to the wait event enq: TX - allocate ITL entry.&lt;br /&gt;&lt;br /&gt;The solution is to increase the number of ITLs available, either by changing the INITRANS or MAXTRANS for the table (either by using an ALTER statement, or by re-creating the table with the higher values).&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;*Waits for TX in mode 4 can also occur if a session is waiting due to potential duplicates in UNIQUE index. If two sessions try to insert the same key value the second session has to wait to see if an ORA-0001 should be raised or not. This type of TX enqueue wait corresponds to the wait event enq: TX - row lock contention.&lt;br /&gt;&lt;br /&gt;The solution is to have the first session already holding the lock perform a COMMIT or ROLLBACK.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*Waits for TX in mode 4 is also possible if the session is waiting due to shared bitmap index fragment. Bitmap indexes index key values and a range of ROWIDs. Each 'entry' in a bitmap index can cover many rows in the actual table. If two sessions want to update rows covered by the same bitmap index fragment, then the second session waits for the first transaction to either COMMIT or ROLLBACK by waiting for the TX lock in mode 4. This type of TX enqueue wait corresponds to the wait event enq: TX - row lock contention.&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;*Waits for TX in Mode 4 can also occur waiting for a PREPARED transaction.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*Waits for TX in mode 4 also occur when a transaction inserting a row in an index has to wait for the end of an index block split being done by another transaction. This type of TX enqueue wait corresponds to the wait event enq: TX - index contention.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8101407058784690351?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8101407058784690351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8101407058784690351' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8101407058784690351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8101407058784690351'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/tx-enqueue.html' title='TX enqueue'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8040587437863366895</id><published>2008-10-16T13:05:00.001-07:00</published><updated>2008-10-16T13:05:46.854-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sar - Top 20 DBA unix commands'/><title type='text'>sar - Top 20 DBA unix commands</title><content type='html'>SAR: Displays the activity for the CPU.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;sar [-a] [-A] [-b] [-c] [-d] [-g] [-k] [-m] [-p] [-q] [-r] [-u] [-v] [-w] [-y ] [ -o filename ] t [ n ]&lt;br /&gt;&lt;br /&gt;sar [-a] [-A] [-b] [-c] [-d] [-g] [-k] [-m] [-p] [-q] [-r] [-u] [-v] [-w] [-y ] [ -e time ] [ -f filename ] [-i sec ] [ -s time ]&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;-a  Report use of file access system routines: iget/s, namei/s, dirblk/s&lt;br /&gt;-A  Report all data. Equivalent to -abcdgkmpqruvwy.&lt;br /&gt;-b  Report buffer activity:&lt;br /&gt;&lt;br /&gt;bread/s, bwrit/s&lt;br /&gt;transfers per second of data between system buffers and disk or other block devices.&lt;br /&gt;&lt;br /&gt;lread/s, lwrit/s&lt;br /&gt;accesses of system buffers.&lt;br /&gt;&lt;br /&gt;%rcache, %wcache&lt;br /&gt;cache hit ratios, that is, (1-bread/lread) as a percentage.&lt;br /&gt;&lt;br /&gt;pread/s, pwrit/s&lt;br /&gt;transfers using raw (physical) device mechanism.&lt;br /&gt;-c  Report system calls:&lt;br /&gt;&lt;br /&gt;scall/s system calls of all types.&lt;br /&gt;&lt;br /&gt;sread/s, swrit/s, fork/s, exec/s&lt;br /&gt;specific system calls.&lt;br /&gt;&lt;br /&gt;rchar/s, wchar/s&lt;br /&gt;characters transferred by read and write system calls. No incoming or outgoing exec and fork calls are reported.&lt;br /&gt;-d  Report activity for each block device (for example, disk or tape drive) with the exception of XDC disks and tape drives. When data is displayed, the device specification dsk- is generally used to represent a disk drive. The device specification used to represent a tape drive is machine dependent. The activity data reported is: &lt;br /&gt;&lt;br /&gt;%busy, avque&lt;br /&gt;portion of time device was busy servicing a transfer request, average number of requests outstanding during that time. &lt;br /&gt;&lt;br /&gt;read/s, write/s, blks/s&lt;br /&gt;number of read/write transfers from or to device, number of bytes transferred in 512-byte units. &lt;br /&gt;&lt;br /&gt;avwait average wait time in milliseconds.&lt;br /&gt;&lt;br /&gt;avserv average service time in milliseconds.&lt;br /&gt;-g  Report paging activities:&lt;br /&gt;&lt;br /&gt;pgout/s&lt;br /&gt;page-out requests per second.&lt;br /&gt;&lt;br /&gt;ppgout/s&lt;br /&gt;pages paged-out per second.&lt;br /&gt;&lt;br /&gt;pgfree/s&lt;br /&gt;pages per second placed on the free list by the page stealing daemon.&lt;br /&gt;&lt;br /&gt;pgscan/s&lt;br /&gt;pages per second scanned by the page stealing daemon.&lt;br /&gt;&lt;br /&gt;%ufs_ipf&lt;br /&gt;the percentage of UFS inodes taken off the freelist by iget which had reusable pages associated with them. These pages are flushed and cannot be reclaimed by processes. Thus, this is the percentage of igets with page flushes.&lt;br /&gt;-k  Report kernel memory allocation (KMA) activities:&lt;br /&gt;&lt;br /&gt;sml_mem, alloc, fail&lt;br /&gt;information about the memory pool reserving and allocating space for small requests: the amount of memory in bytes KMA has for the small pool, the number of bytes allocated to satisfy requests for small amounts of memory, and the number of requests for small amounts of memory that were not satisfied (failed).&lt;br /&gt;&lt;br /&gt;lg_mem, alloc, fail&lt;br /&gt;information for the large memory pool (analogous to the information for the small memory pool). &lt;br /&gt;&lt;br /&gt;ovsz_alloc, fail&lt;br /&gt;the amount of memory allocated for oversize requests and the number of oversize requests which could not be satisfied (because oversized memory is allocated dynamically, there is not a pool).&lt;br /&gt;-m  Report message and semaphore activities:&lt;br /&gt;&lt;br /&gt;msg/s, sema/s&lt;br /&gt;primitives per second.&lt;br /&gt;-p  Report paging activities:&lt;br /&gt;&lt;br /&gt;atch/s&lt;br /&gt;page faults per second that are satisfied by reclaiming a page currently in memory (attaches per second). &lt;br /&gt;&lt;br /&gt;pgin/s&lt;br /&gt;page-in requests per second.&lt;br /&gt;&lt;br /&gt;ppgin/s&lt;br /&gt; pages paged-in per second.&lt;br /&gt;&lt;br /&gt;pflt/s&lt;br /&gt;page faults from protection errors per second (illegal access to page) or "copy-on-writes".&lt;br /&gt;&lt;br /&gt;vflt/s&lt;br /&gt;address translation page faults per second (valid page not in memory).&lt;br /&gt;&lt;br /&gt;slock/s&lt;br /&gt;faults per second caused by software lock requests requiring physical I/O.&lt;br /&gt;-q  Report average queue length while occupied, and percent of time occupied:&lt;br /&gt;&lt;br /&gt;runq-sz, %runocc&lt;br /&gt;run queue of processes in memory and runnable.&lt;br /&gt;&lt;br /&gt;swpq-sz, %swpocc&lt;br /&gt;these are no longer reported by sar .&lt;br /&gt;-r  Report unused memory pages and disk blocks:&lt;br /&gt;&lt;br /&gt;freemem average pages available to user processes.&lt;br /&gt;&lt;br /&gt;freeswap disk blocks available for page swapping.&lt;br /&gt;-u  Report CPU utilization (the default):&lt;br /&gt;&lt;br /&gt;%usr, %sys, %wio, %idle&lt;br /&gt;portion of time running in user mode, running in system mode, idle with some process waiting for block I/O, and otherwise idle.&lt;br /&gt;-v  Report status of process, i-node, file tables:&lt;br /&gt;&lt;br /&gt;proc-sz, inod-sz, file-sz, lock-sz&lt;br /&gt;entries/size for each table, evaluated&lt;br /&gt;&lt;br /&gt;ov&lt;br /&gt;overflows that occur between sampling points for each table.&lt;br /&gt;-w  Report system swapping and switching activity:&lt;br /&gt;&lt;br /&gt;swpin/s, swpot/s, bswin/s, bswot/s&lt;br /&gt;number of transfers and number of 512-byte units transferred for swapins and swapouts (including initial loading of some programs).&lt;br /&gt;&lt;br /&gt;pswch/s&lt;br /&gt;process switches.&lt;br /&gt;-y  Report TTY device activity:&lt;br /&gt;&lt;br /&gt;rawch/s, canch/s, outch/s&lt;br /&gt;input character rate, input character rate processed by canon, output character rate.&lt;br /&gt;&lt;br /&gt;rcvin/s, xmtin/s, mdmin/s&lt;br /&gt;receive, transmit and modem interrupt rates.&lt;br /&gt;-o filename  Save samples in file, filename, in binary format.&lt;br /&gt;-e time  Select data up to time . Default is 18:00.&lt;br /&gt;-f filename  Use filename as the data source for sar . Default is the current daily data file /var/adm/sa/sadd.&lt;br /&gt;-i sec  Select data at intervals as close as possible to sec seconds.&lt;br /&gt;&lt;br /&gt;Examples&lt;br /&gt;&lt;br /&gt;sar - display today's CPU activity so far. You must have permission and the information must be present on the computer.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;top: top - display top CPU processes&lt;br /&gt;SYNOPSIS&lt;br /&gt;top [-] [d delay] [p pid] [q] [c] [C] [S] [s] [i] [n iter] [b]&lt;br /&gt;DESCRIPTION&lt;br /&gt;top provides an ongoing look at processor activity in real time. It displays a listing of the most CPU-intensive tasks on the system, and can provide an interactive interface for manipulating processes. It can sort the tasks by CPU usage, memory usage and runtime. can be better configured than the standard top from the procps suite. Most features can either be selected by an interactive command or by specifying the feature in the personal or system-wide configuration file. See below for more information.&lt;br /&gt;&lt;br /&gt;COMMAND-LINE OPTIONS&lt;br /&gt;-d&lt;br /&gt;    Specifies the delay between screen updates. You can change this with the s interactive command. &lt;br /&gt;-p&lt;br /&gt;    Monitor only processes with given process id. This flag can be given up to twenty times. This option is neither available interactively nor can it be put into the configuration file. &lt;br /&gt;-q&lt;br /&gt;    This causes top to refresh without any delay. If the caller has superuser privileges, top runs with the highest possible priority. &lt;br /&gt;-S&lt;br /&gt;    Specifies cumulative mode, where each process is listed with the CPU time that it as well as its dead children has spent. This is like the -S flag to ps(1). See the discussion below of the S interactive command. &lt;br /&gt;-s&lt;br /&gt;    Tells top to run in secure mode. This disables the potentially dangerous of the interactive commands (see below). A secure top is a nifty thing to leave running on a spare terminal. &lt;br /&gt;-i&lt;br /&gt;    Start top ignoring any idle or zombie processes. See the interactive command i below. &lt;br /&gt;-C&lt;br /&gt;    display total CPU states instead of individual CPUs. This option only affects SMP systems. &lt;br /&gt;-c&lt;br /&gt;    display command line instead of the command name only. The default behavior has been changed as this seems to be more useful. &lt;br /&gt;-H&lt;br /&gt;    Show all threads. &lt;br /&gt;-n&lt;br /&gt;    Number of iterations. Update the display this number of times and then exit. &lt;br /&gt;-b&lt;br /&gt;    Batch mode. Useful for sending output from top to other programs or to a file. In this mode, top will not accept command line input. It runs until it produces the number of iterations requested with the n option or until killed. Output is plain text suitable for display on a dumb terminal. &lt;br /&gt;FIELD DESCRIPTIONS&lt;br /&gt;top displays a variety of information about the processor state. The display is updated every 5 seconds by default, but you can change that with the d command-line option or the s interactive command.&lt;br /&gt;"uptime"&lt;br /&gt;    This line displays the time the system has been up, and the three load averages for the system. The load averages are the average number of process ready to run during the last 1, 5 and 15 minutes. This line is just like the output of uptime(1). The uptime display may be toggled by the interactive l command. &lt;br /&gt;processes&lt;br /&gt;    The total number of processes running at the time of the last update. This is also broken down into the number of tasks which are running, sleeping, stopped, or undead. The processes and states display may be toggled by the t interactive command. &lt;br /&gt;"CPU states"&lt;br /&gt;    Shows the percentage of CPU time in user mode, system mode, niced tasks, iowait and idle. (Niced tasks are only those whose nice value is positive.) Time spent in niced tasks will also be counted in system and user time, so the total will be more than 100%. The processes and states display may be toggled by the t interactive command. &lt;br /&gt;Mem&lt;br /&gt;    Statistics on memory usage, including total available memory, free memory, used memory, shared memory, and memory used for buffers. The display of memory information may be toggled by the m interactive command. &lt;br /&gt;Swap&lt;br /&gt;    Statistics on swap space, including total swap space, available swap space, and used swap space. This and Mem are just like the output of free(1). &lt;br /&gt;PID&lt;br /&gt;    The process ID of each task. &lt;br /&gt;PPID&lt;br /&gt;    The parent process ID each task. &lt;br /&gt;UID&lt;br /&gt;    The user ID of the task's owner. &lt;br /&gt;USER&lt;br /&gt;    The user name of the task's owner. &lt;br /&gt;PRI&lt;br /&gt;    The priority of the task. &lt;br /&gt;NI&lt;br /&gt;    The nice value of the task. Negative nice values are higher priority. &lt;br /&gt;SIZE&lt;br /&gt;    The size of the task's code plus data plus stack space, in kilobytes, is shown here. &lt;br /&gt;TSIZE&lt;br /&gt;    The code size of the task. This gives strange values for kernel processes and is broken for ELF processes. &lt;br /&gt;DSIZE&lt;br /&gt;    Data + Stack size. This is broken for ELF processes. &lt;br /&gt;TRS&lt;br /&gt;    Text resident size. &lt;br /&gt;SWAP&lt;br /&gt;    Size of the swapped out part of the task. &lt;br /&gt;D&lt;br /&gt;    Size of pages marked dirty. &lt;br /&gt;LC&lt;br /&gt;    Last used processor. (That this changes from time to time is not a bug; Linux intentionally uses weak affinity. Also notice that the very act of running top may break weak affinity and cause more processes to change current CPU more often because of the extra demand for CPU time.) &lt;br /&gt;RSS&lt;br /&gt;    The total amount of physical memory used by the task, in kilobytes, is shown here. For ELF processes used library pages are counted here, for a.out processes not. &lt;br /&gt;SHARE&lt;br /&gt;    The amount of shared memory used by the task is shown in this column. &lt;br /&gt;STAT&lt;br /&gt;    The state of the task is shown here. The state is either S for sleeping, D for uninterruptible sleep, R for running, Z for zombies, or T for stopped or traced. These states are modified by trailing &lt; for a process with negative nice value, N for a process with positive nice value, W for a swapped out process (this does not work correctly for kernel processes). &lt;br /&gt;WCHAN&lt;br /&gt;    depending on the availability of either /boot/psdatabase or the kernel link map /boot/System.map this shows the address or the name of the kernel function the task currently is sleeping in. &lt;br /&gt;TIME&lt;br /&gt;    Total CPU time the task has used since it started. If cumulative mode is on, this also includes the CPU time used by the process's children which have died. You can set cumulative mode with the S command line option or toggle it with the interactive command S. The header line will then be changed to CTIME. &lt;br /&gt;%CPU&lt;br /&gt;    The task's share of the CPU time since the last screen update, expressed as a percentage of total CPU time per processor. &lt;br /&gt;%MEM&lt;br /&gt;    The task's share of the physical memory. &lt;br /&gt;COMMAND&lt;br /&gt;    The task's command name, which will be truncated if it is too long to be displayed on one line. Tasks in memory will have a full command line, but swapped-out tasks will only have the name of the program in parentheses (for example, "(getty)"). &lt;br /&gt;"A , WP"&lt;br /&gt;    these fields from the kmem top are not supported. &lt;br /&gt;INTERACTIVE COMMANDS&lt;br /&gt;Several single-key commands are recognized while top is running. Some are disabled if the s option has been given on the command line.&lt;br /&gt;space&lt;br /&gt;    Immediately updates the display. &lt;br /&gt;^L&lt;br /&gt;    Erases and redraws the screen. &lt;br /&gt;h or ?&lt;br /&gt;    Displays a help screen giving a brief summary of commands, and the status of secure and cumulative modes. &lt;br /&gt;k&lt;br /&gt;    Kill a process. You will be prompted for the PID of the task, and the signal to send to it. For a normal kill, send signal 15. For a sure, but rather abrupt, kill, send signal 9. The default signal, as with kill(1), is 15, SIGTERM. This command is not available in secure mode. &lt;br /&gt;i&lt;br /&gt;    Ignore idle and zombie processes. This is a toggle switch. &lt;br /&gt;I&lt;br /&gt;    Toggle between Solaris (CPU percentage divided by total number of CPUs) and Irix (CPU percentage calculated solely by amount of time) views. This is a toggle switch that affects only SMP systems. &lt;br /&gt;n or #&lt;br /&gt;    Change the number of processes to show. You will be prompted to enter the number. This overrides automatic determination of the number of processes to show, which is based on window size measurement. If 0 is specified, then top will show as many processes as will fit on the screen; this is the default. &lt;br /&gt;q&lt;br /&gt;    Quit. &lt;br /&gt;r&lt;br /&gt;    Re-nice a process. You will be prompted for the PID of the task, and the value to nice it to. Entering a positve value will cause a process to be niced to negative values, and lose priority. If root is running top, a negative value can be entered, causing a process to get a higher than normal priority. The default renice value is 10. This command is not available in secure mode. &lt;br /&gt;S&lt;br /&gt;    This toggles cumulative mode, the equivalent of ps -S, i.e., that CPU times will include a process's defunct children. For some programs, such as compilers, which work by forking into many separate tasks, normal mode will make them appear less demanding than they actually are. For others, however, such as shells and init, this behavior is correct. In any case, try cumulative mode for an alternative view of CPU use. &lt;br /&gt;s&lt;br /&gt;    Change the delay between updates. You will be prompted to enter the delay time, in seconds, between updates. Fractional values are recognized down to microseconds. Entering 0 causes continuous updates. The default value is 5 seconds. Note that low values cause nearly unreadably fast displays, and greatly raise the load. This command is not available in secure mode. &lt;br /&gt;f or F&lt;br /&gt;    Add fields to display or remove fields from the display. See below for more information. &lt;br /&gt;o or O&lt;br /&gt;    Change order of displayed fields. See below for more information. &lt;br /&gt;l&lt;br /&gt;    toggle display of load average and uptime information. &lt;br /&gt;m&lt;br /&gt;    toggle display of memory information. &lt;br /&gt;t&lt;br /&gt;    toggle display of processes and CPU states information. &lt;br /&gt;c&lt;br /&gt;    toggle display of command name or full command line. &lt;br /&gt;N&lt;br /&gt;    sort tasks by pid (numerically). &lt;br /&gt;A&lt;br /&gt;    sort tasks by age (newest first). &lt;br /&gt;P&lt;br /&gt;    sort tasks by CPU usage (default). &lt;br /&gt;M&lt;br /&gt;    sort tasks by resident memory usage. &lt;br /&gt;T&lt;br /&gt;    sort tasks by time / cumulative time. &lt;br /&gt;W&lt;br /&gt;    Write current setup to ~/.toprc. This is the recommended way to write a top configuration file. &lt;br /&gt;The Field and Order Screens&lt;br /&gt;After pressing f, F, o or O you will be shown a screen specifying the field order on the top line and short descriptions of the field contents. The field order string uses the following syntax: If the letter in the filed string corresponding to a field is upper case, the field will be displayed. This is furthermore indicated by an asterisk in front of the field description. The order of the fields corresponds to the order of the letters in the string.&lt;br /&gt;From the field select screen you can toggle the display of a field by pressing the corresponding letter.&lt;br /&gt;From the order screen you may move a field to the left by pressing the corresponding upper case letter resp. to the right by pressing the lower case one.&lt;br /&gt;Configuration Files&lt;br /&gt;The command top reads it's default configuration from two files, /etc/toprc and ~/.toprc. The global configuration file may be used to restrict the usage of top to the secure mode for non-non-privileged users. If this is desired, the file should contain a 's' to specify secure mode and a digit d (2&lt;=d&lt;=9) for the default delay (in seconds) on a single line. The personal configuration file contains two lines. The first line contains lower and upper letters to specify which fields in what order are to be displayed. The letters correspond to the letters in the Fields or Order screens from top. As this is not very instructive, it is recommended to select fields and order in a running top process and to save this using the W interactive command.&lt;br /&gt;&lt;br /&gt;The second line is more interesting (and important). It contains information on the other options. Most important, if you have saved a configuration in secure mode, you will not get an insecure top without removing the lower 's' from the second line of your ~/.toprc.&lt;br /&gt;&lt;br /&gt;A digit specifies the delay time between updates, a capital 'S' cumulative mode, a lower 'i' no-idle mode, a capital 'I' Irix view. As in interactive mode, a lower 'm', 'l', and 't' suppresses the display of memory, uptime resp. process and CPU state information. Currently changing the default sorting order (by CPU usage) is not supported.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8040587437863366895?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8040587437863366895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8040587437863366895' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8040587437863366895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8040587437863366895'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/sar-top-20-dba-unix-commands.html' title='sar - Top 20 DBA unix commands'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1065253199857658035</id><published>2008-10-16T13:03:00.000-07:00</published><updated>2008-10-16T13:04:31.691-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iostat - Top 20 DBA unix commands'/><title type='text'>iostat - Top 20 DBA unix commands</title><content type='html'>iostat: Reports Central Processing Unit (CPU) statistics and input/output statistics for the entire system, adapters, tty devices, disks and CD-ROMs.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;iostat [ -s ] [ -a ] [ -d | -t ] [ PhysicalVolume ... ] [ Interval [ Count ] ]&lt;br /&gt;&lt;br /&gt;Description&lt;br /&gt;&lt;br /&gt;The iostat command is used for monitoring system input/output device loading by observing the time the physical disks are active in relation to their average transfer rates. The iostat command generates reports that can be used to change system configuration to better balance the input/output load between physical disks and adapters.&lt;br /&gt;&lt;br /&gt;The first report generated by the iostat command provides statistics concerning the time since the system was booted. Each subsequent report covers the time since the previous report. All statistics are reported each time the iostat command is run. The report consists of a tty and CPU header row followed by a row of tty and CPU statistics. On multiprocessor systems, CPU statistics are calculated system-wide as averages among all processors.&lt;br /&gt;&lt;br /&gt;If the -s flag is specified, a system-header row is displayed followed by a line of statistics for the entire system. The hostname of the system is printed in the system-header row.&lt;br /&gt;&lt;br /&gt;If the -a flag is specified, an adapter-header row is displayed followed by a line of statistics for the adapter. This will be followed by a disk-header row and the statistics of all the disks/CD-ROMs connected to the adapter. Such reports are generated for all the disk adapters connected to the system.&lt;br /&gt;&lt;br /&gt;A disks header row is displayed followed by a line of statistics for each disk that is configured. If the PhysicalVolume parameter is specified, only those names specified are displayed.&lt;br /&gt;&lt;br /&gt;If the PhysicalVolume parameter is specified, one or more alphabetic or alphanumeric physical volumes can be specified. If the PhysicalVolume parameter is specified, the tty and CPU reports are displayed and the disk report contains statistics for the specified drives. If a specified logical drive name is not found, the report lists the specified name and displays the message Drive Not Found. If no Logical Drive Names are specified, the report contains statistics for all configured disks and CD-ROMs. If no drives are configured on the system, no disk report is generated. The first character in the PhysicalVolume parameter cannot be numeric.&lt;br /&gt;&lt;br /&gt;The Interval parameter specifies the amount of time in seconds between each report. The first report contains statistics for the time since system startup (boot). Each subsequent report contains statistics collected during the interval since the previous report. The Count parameter can be specified in conjunction with the Interval parameter. If the Count parameter is specified, the value of count determines the number of reports generated at Interval seconds apart. If the Interval parameter is specified without the Count parameter, the iostat command generates reports continuously.&lt;br /&gt;&lt;br /&gt;The iostat command is useful in determining whether a physical volume is becoming a performance bottleneck and if there is potential to improve the situation. The % utilization field for the physical volumes indicates how evenly the file activity is spread across the drives. A high % utilization on a physical volume is a good indication that there may be contention for this resource. Since the CPU utilization statistics are also available with the iostat report, the percentage of time the CPU is in I/O wait can be determined at the same time. Consider distributing data across drives if the I/O wait time is significant and the disk utilization is not evenly distributed across volumes.&lt;br /&gt;&lt;br /&gt;    Note: Some system resource is consumed in maintaining disk I/O history for the iostat command. Use the sysconfig subroutine, or the System Management Interface Tool (SMIT) to stop history accounting. &lt;br /&gt;&lt;br /&gt;Reports&lt;br /&gt;&lt;br /&gt;The iostat command generates four types of reports, the tty and CPU Utilization report, the Disk Utilization report, the System throughput report and the Adapter throughput report.&lt;br /&gt;&lt;br /&gt;tty and CPU Utilization Report&lt;br /&gt;&lt;br /&gt;The first report generated by the iostat command is the tty and CPU Utilization Report. For multiprocessor systems, the CPU values are global averages among all processors. Also, the I/O wait state is defined system-wide and not per processor. The report has the following format:&lt;br /&gt;Column  Description&lt;br /&gt;tin  Shows the total number of characters read by the system for all ttys.&lt;br /&gt;tout  Shows the total number of characters written by the system to all ttys.&lt;br /&gt;% user  Shows the percentage of CPU utilization that occurred while executing at the user level (application).&lt;br /&gt;% sys  Shows the percentage of CPU utilization that occurred while executing at the system level (kernel).&lt;br /&gt;% idle  Shows the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request.&lt;br /&gt;% iowait  Shows the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request.&lt;br /&gt;&lt;br /&gt;This information is updated at regular intervals by the kernel (typically sixty times per second). The tty report provides a collective account of characters per second received from all terminals on the system as well as the collective count of characters output per second to all terminals on the system.&lt;br /&gt;&lt;br /&gt;Methods Used to Compute CPU Disk I/O Wait Time&lt;br /&gt;&lt;br /&gt;Operating system version 4.3.3 and later contain enhancements to the method used to compute the percentage of CPU time spent waiting on disk I/O (wio time).The method used in AIX 4.3.2 and earlier versions of the operating system can, under certain circumstances, give an inflated view of wio time on SMPs. The wio time is reported by the commands sar (%wio), vmstat (wa) and iostat (% iowait).&lt;br /&gt;&lt;br /&gt;The method used in AIX 4.3.2 and earlier versions is as follows: At each clock interrupt on each processor (100 times a second per processor), a determination is made as to which of the four categories (usr/sys/wio/idle) to place the last 10 ms of time. If the CPU was busy in usr mode at the time of the clock interrupt, then usr gets the clock tick added into its category. If the CPU was busy in kernel mode at the time of the clock interrupt, then the sys category gets the tick. If the CPU was not busy, a check is made to see if any I/O to disk is in progress. If any disk I/O is in progress, the wio category is incremented. If no disk I/O is in progress and the CPU is not busy, the idle category gets the tick. The inflated view of wio time results from all idle CPUs being categorized as wio regardless of the number of threads waiting on I/O. For example, systems with just one thread doing I/O could report over 90 percent wio time regardless of the number of CPUs it has.&lt;br /&gt;&lt;br /&gt;The method used in AIX 4.3.3 and later is as follows: The change in operating system version 4.3.3 is to only mark an idle CPU as wio if an outstanding I/O was started on that CPU. This method can report much lower wio times when just a few threads are doing I/O and the system is otherwise idle. For example, a system with four CPUs and one thread doing I/O will report a maximum of 25 percent wio time. A system with 12 CPUs and one thread doing I/O will report a maximum of 8 percent wio time. NFS client reads/writes go through the VMM, and the time that biods spend in the VMM waiting for an I/O to complete is now reported as I/O wait time.&lt;br /&gt;&lt;br /&gt;Disk Utilization Report&lt;br /&gt;&lt;br /&gt;The second report generated by the iostat command is the Disk Utilization Report. The disk report provides statistics on a per physical disk basis. The report has a format similar to the following:&lt;br /&gt;% tm_act  Indicates the percentage of time the physical disk was active (bandwidth utilization for the drive).&lt;br /&gt;Kbps  Indicates the amount of data transferred (read or written) to the drive in KB per second.&lt;br /&gt;tps  Indicates the number of transfers per second that were issued to the physical disk. A transfer is an I/O request to the physical disk. Multiple logical requests can be combined into a single I/O request to the disk. A transfer is of indeterminate size.&lt;br /&gt;Kb_read  The total number of KB read.&lt;br /&gt;Kb_wrtn  The total number of KB written.&lt;br /&gt;&lt;br /&gt;Statistics for CD-ROM devices are also reported.&lt;br /&gt;&lt;br /&gt;For large system configurations where a large number of disks are configured, the system can be configured to avoid collecting physical disk input/output statistics when the iostat command is not executing. If the system is configured in the above manner, the first Disk report displays the message Disk History Since Boot Not Available instead of the disk statistics. Subsequent interval reports generated by the iostat command contain disk statistics collected during the report interval. Any tty and CPU statistics after boot are unaffected. If a system management command is used to re-enable disk statistics keeping, the first iostat command report displays activity from the interval starting at the point that disk input/output statistics were enabled.&lt;br /&gt;&lt;br /&gt;System Throughput Report&lt;br /&gt;&lt;br /&gt;This report is generated if the -s flag is specified. This report provides statistics for the entire system. This report has the following format:&lt;br /&gt;Kbps  Indicates the amount of data transferred (read or written) in the entire system in KB per second.&lt;br /&gt;tps  Indicates the number of transfers per second issued to the entire system.&lt;br /&gt;Kb_read  The total number of KB read from the entire system.&lt;br /&gt;Kb_wrtn  The total number of KB written to the entire system.&lt;br /&gt;&lt;br /&gt;Adapter Throughput Report&lt;br /&gt;&lt;br /&gt;This report is generated if the -a flag is specified. This report provides statistics on an adapter-by-adapter basis.This report has the following format:&lt;br /&gt;Kbps  Indicates the amount of data transferred (read or written) in the adapter in KB per second.&lt;br /&gt;tps  Indicates the number of transfers per second issued to the adapter.&lt;br /&gt;Kb_read  The total number of KB read from the adapter.&lt;br /&gt;Kb_wrtn  The total number of KB written to the adapter.&lt;br /&gt;&lt;br /&gt;Disk Input/Output History&lt;br /&gt;&lt;br /&gt;To improve performance on, the collection of disk input/output statistics has been disabled. To enable the collection of this data, enter:&lt;br /&gt;&lt;br /&gt;chdev -l sys0 -a iostat=true&lt;br /&gt;&lt;br /&gt;To display the current settings, enter:&lt;br /&gt;&lt;br /&gt;lsattr -E -l sys0 -a iostat&lt;br /&gt;&lt;br /&gt;If the collection of disk input/output history is disabled, the first disk report of iostat output displays the message Disk History Since Boot Not Available instead of disk statistics. As before, subsequent interval reports generated by the iostat command contain disk statistics collected during the report interval.&lt;br /&gt;&lt;br /&gt;Flags&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-a  Displays the adapter throughput report.&lt;br /&gt;-d  The -d flag is exclusive of the -t flag and displays only the disk utilization report.&lt;br /&gt;-s  Displays the system throughput report.&lt;br /&gt;-t   The -t flag is exclusive of the -d flag and displays only the tty and cpu usage reports.&lt;br /&gt;&lt;br /&gt;    Notes:&lt;br /&gt;&lt;br /&gt;        * The -s and -a flags can both be specified to display both the system and adapter throughput reports.&lt;br /&gt;        * If the -a flag is specified with the -t flag, the tty and CPU report is displayed, followed by the adapter throughput report. Disk Utilization reports of the disks connected to the adapters, will not be displayed after the Adapter throughput report.&lt;br /&gt;        * If the -a flag is specified with the -d flag, tty and CPU report will not be displayed. If Physical Volume parameter is specified, the Disk Utilization Report of the specified Physical volume will be printed under the corresponding adapter to which it belongs. &lt;br /&gt;&lt;br /&gt;Examples&lt;br /&gt;&lt;br /&gt;   1. To display a single history since boot report for all tty, CPU, and Disks, enter:&lt;br /&gt;&lt;br /&gt;      iostat&lt;br /&gt;&lt;br /&gt;   2. To display a continuous disk report at two second intervals for the disk with the logical name disk1, enter:&lt;br /&gt;&lt;br /&gt;      iostat -d disk1 2&lt;br /&gt;&lt;br /&gt;   3. To display six reports at two second intervals for the disk with the logical name disk1, enter:&lt;br /&gt;&lt;br /&gt;      iostat disk1 2 6&lt;br /&gt;&lt;br /&gt;   4. To display six reports at two second intervals for all disks, enter:&lt;br /&gt;&lt;br /&gt;      iostat -d 2 6&lt;br /&gt;&lt;br /&gt;   5. To display six reports at two second intervals for three disks named disk1, disk2, disk3, enter:&lt;br /&gt;&lt;br /&gt;      iostat disk1 disk2 disk3 2 6&lt;br /&gt;&lt;br /&gt;   6. To print the System throughput report, enter:&lt;br /&gt;&lt;br /&gt;       iostat -s&lt;br /&gt;&lt;br /&gt;   7. To print the Adapter throughput report, enter:&lt;br /&gt;&lt;br /&gt;      iostat -a&lt;br /&gt;&lt;br /&gt;   8. To print the System and Adapter throughput reports, with only the tty and CPU report (no disk reports), enter:&lt;br /&gt;&lt;br /&gt;        iostat -sat&lt;br /&gt;&lt;br /&gt;   9. To print the System and Adapter throughput reports with the Disk Utilization reports of hdisk0 and hdisk7, enter&lt;br /&gt;&lt;br /&gt;      iostat -sad hdisk0 hdisk7&lt;br /&gt;&lt;br /&gt;File&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/usr/bin/iostat  Contains the iostat command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1065253199857658035?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1065253199857658035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1065253199857658035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1065253199857658035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1065253199857658035'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/iostat-top-20-dba-unix-commands.html' title='iostat - Top 20 DBA unix commands'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-2668188188557437761</id><published>2008-10-16T13:02:00.001-07:00</published><updated>2008-10-16T13:02:53.847-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmstat - Top 20 DBA Unix commands'/><title type='text'>vmstat - Top 20 DBA Unix commands</title><content type='html'>VMSTAT: Reports virtual memory statistics.&lt;br /&gt;&lt;br /&gt;Syntax&lt;br /&gt;&lt;br /&gt;vmstat [ -f ] [ -i ] [ -s ] [ -I ] [ -t ] [ PhysicalVolume ... ] [ Interval [ Count ] ] &lt;br /&gt;&lt;br /&gt;Description&lt;br /&gt;&lt;br /&gt;The vmstat command reports statistics about kernel threads, virtual memory, disks, traps and CPU activity. Reports generated by the vmstat command can be used to balance system load activity. These system-wide statistics (among all processors) are calculated as averages for values expressed as percentages, and as sums otherwise.&lt;br /&gt;&lt;br /&gt;If the vmstat command is invoked without flags, the report contains a summary of the virtual memory activity since system startup. If the -f flag is specified, the vmstat command reports the number of forks since system startup. The PhysicalVolume parameter specifies the name of the physical volume.&lt;br /&gt;&lt;br /&gt;The Interval parameter specifies the amount of time in seconds between each report. The first report contains statistics for the time since system startup. Subsequent reports contain statistics collected during the interval since the previous report. If the Interval parameter is not specified, the vmstat command generates a single report and then exits. The Count parameter can only be specified with the Interval parameter. If the Count parameter is specified, its value determines the number of reports generated and the number of seconds apart. If the Interval parameter is specified without the Count parameter, reports are continuously generated. A Count parameter of 0 is not allowed.&lt;br /&gt;&lt;br /&gt;AIX 4.3.3 and later contain enhancements to the method used to compute the percentage of CPU time spent waiting on disk I/O (wio time).The method used in AIX 4.3.2 and earlier versions of the operating system can, under certain circumstances, give an inflated view of wio time on SMPs.&lt;br /&gt;&lt;br /&gt;The method used in AIX 4.3.2 and earlier versions is as follows: At each clock interrupt on each processor (100 times a second per processor), a determination is made as to which of the four categories (usr/sys/wio/idle) to place the last 10 ms of time. If the CPU was busy in usr mode at the time of the clock interrupt, then usr gets the clock tick added into its category. If the CPU was busy in kernel mode at the time of the clock interrupt, then the sys category gets the tick. If the CPU was not busy, a check is made to see if any I/O to disk is in progress. If any disk I/O is in progress, the wio category is incremented. If no disk I/O is in progress and the CPU is not busy, the idle category gets the tick. The inflated view of wio time results from all idle CPUs being categorized as wio regardless of the number of threads waiting on I/O. For example, systems with just one thread doing I/O could report over 90 percent wio time regardless of the number of CPUs it has. The wio time is reported by the commands sar (%wio), vmstat (wa) and iostat (% iowait).&lt;br /&gt;&lt;br /&gt;The method used in operating system AIX 4.3.3 and later is as follows: The change in operating system AIX 4.3.3 is to only mark an idle CPU as wio if an outstanding I/O was started on that CPU. This method can report much lower wio times when just a few threads are doing I/O and the system is otherwise idle. For example, a system with four CPUs and one thread doing I/O will report a maximum of 25 percent wio time. A system with 12 CPUs and one thread doing I/O will report a maximum of 8 percent wio time. NFS client reads/writes go through the VMM, and the time that biods spend in the VMM waiting for an I/O to complete is now reported as I/O wait time.&lt;br /&gt;&lt;br /&gt;The kernel maintains statistics for kernel threads, paging, and interrupt activity, which the vmstat command accesses through the use of the knlist subroutine and the /dev/kmem pseudo-device driver. The disk input/output statistics are maintained by device drivers. For disks, the average transfer rate is determined by using the active time and number of transfers information. The percent active time is computed from the amount of time the drive is busy during the report.&lt;br /&gt;&lt;br /&gt;The following example of a report generated by the vmstat command contains the column headings and their description:&lt;br /&gt;&lt;br /&gt;kthr: kernel thread state changes per second over the sampling interval.&lt;br /&gt;r  Number of kernel threads placed in run queue.&lt;br /&gt;b  Number of kernel threads placed in wait queue (awaiting resource, awaiting input/output).&lt;br /&gt;&lt;br /&gt;Memory: information about the usage of virtual and real memory. Virtual pages are considered active if they have been accessed. A page is 4096 bytes.&lt;br /&gt;avm  Active virtual pages.&lt;br /&gt;fre  Size of the free list.&lt;br /&gt;&lt;br /&gt;    Note: A large portion of real memory is utilized as a cache for file system data. It is not unusual for the size of the free list to remain small. &lt;br /&gt;&lt;br /&gt;Page: information about page faults and paging activity. These are averaged over the interval and given in units per second.&lt;br /&gt;re  Pager input/output list.&lt;br /&gt;pi  Pages paged in from paging space.&lt;br /&gt;po  Pages paged out to paging space.&lt;br /&gt;fr  Pages freed (page replacement).&lt;br /&gt;sr  Pages scanned by page-replacement algorithm.&lt;br /&gt;cy  Clock cycles by page-replacement algorithm.&lt;br /&gt;&lt;br /&gt;Faults: trap and interrupt rate averages per second over the sampling interval.&lt;br /&gt;in  Device interrupts.&lt;br /&gt;sy  System calls.&lt;br /&gt;cs  Kernel thread context switches.&lt;br /&gt;&lt;br /&gt;Cpu: breakdown of percentage usage of CPU time.&lt;br /&gt;us  User time.&lt;br /&gt;sy  System time.&lt;br /&gt;id  CPU idle time.&lt;br /&gt;wa  CPU idle time during which the system had outstanding disk/NFS I/O request(s). See detailed description above.&lt;br /&gt;&lt;br /&gt;Disk: Provides the number of transfers per second to the specified physical volumes that occurred in the sample interval. The PhysicalVolume parameter can be used to specify one to four names. Transfer statistics are given for each specified drive in the order specified. This count represents requests to the physical device. It does not imply an amount of data that was read or written. Several logical requests can be combined into one physical request.&lt;br /&gt;&lt;br /&gt;If the -I flag is specified, an I/O oriented view is presented with the following column changes.&lt;br /&gt;kthr  The column p will also be displayed besides columns r and b.&lt;br /&gt;&lt;br /&gt;p&lt;br /&gt;    Number of threads waiting on actual physical I/O per second. &lt;br /&gt;&lt;br /&gt;page  New columns fi and fo will be displayed instead of re and cy columns.&lt;br /&gt;&lt;br /&gt;fi&lt;br /&gt;    File page-ins per second. &lt;br /&gt;&lt;br /&gt;fo&lt;br /&gt;    File page-outs per second. &lt;br /&gt;&lt;br /&gt;Flags&lt;br /&gt;&lt;br /&gt;    Note: Both the -f and -s flags can be entered on the command line, but the system will only accept the first flag specified and override the second flag. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-f  Reports the number of forks since system startup.&lt;br /&gt;-i  Displays the number of interrupts taken by each device since system startup.&lt;br /&gt;-I  Displays I/O oriented view with the new columns of output, p under heading kthr,and columns fi and fo under heading page instead of the columns re and cy in the page heading.&lt;br /&gt;-s  Writes to standard output the contents of the sum structure, which contains an absolute count of paging events since system initialization. The -s option is exclusive of the other vmstat command options. These events are described as follows:&lt;br /&gt;&lt;br /&gt;address translation faults&lt;br /&gt;    Incremented for each occurrence of an address translation page fault. I/O may or may not be required to resolve the page fault. Storage protection page faults (lock misses) are not included in this count. &lt;br /&gt;&lt;br /&gt;page ins&lt;br /&gt;    Incremented for each page read in by the virtual memory manager. The count is incremented for page ins from page space and file space. Along with the page out statistic, this represents the total amount of real I/O initiated by the virtual memory manager. &lt;br /&gt;&lt;br /&gt;page outs&lt;br /&gt;    Incremented for each page written out by the virtual memory manager. The count is incremented for page outs to page space and for page outs to file space. Along with the page in statistic, this represents the total amount of real I/O initiated by the virtual memory manager. &lt;br /&gt;&lt;br /&gt;paging space page ins&lt;br /&gt;    Incremented for VMM initiated page ins from paging space only. &lt;br /&gt;&lt;br /&gt;paging space page outs&lt;br /&gt;    Incremented for VMM initiated page outs to paging space only. &lt;br /&gt;&lt;br /&gt;total reclaims&lt;br /&gt;    Incremented when an address translation fault can be satisfied without initiating a new I/O request. This can occur if the page has been previously requested by VMM, but the I/O has not yet completed; or if the page was pre-fetched by VMM's read-ahead algorithm, but was hidden from the faulting segment; or if the page has been put on the free list and has not yet been reused. &lt;br /&gt;&lt;br /&gt;zero-filled page faults&lt;br /&gt;    Incremented if the page fault is to working storage and can be satisfied by assigning a frame and zero-filling it. &lt;br /&gt;&lt;br /&gt;executable-filled page faults&lt;br /&gt;    Incremented for each instruction page fault. &lt;br /&gt;&lt;br /&gt;pages examined by the clock&lt;br /&gt;    VMM uses a clock-algorithm to implement a pseudo least recently used (lru) page replacement scheme. Pages are aged by being examined by the clock. This count is incremented for each page examined by the clock. &lt;br /&gt;&lt;br /&gt;revolutions of the clock hand&lt;br /&gt;    Incremented for each VMM clock revolution (that is, after each complete scan of memory). &lt;br /&gt;&lt;br /&gt;pages freed by the clock&lt;br /&gt;    Incremented for each page the clock algorithm selects to free from real memory. &lt;br /&gt;&lt;br /&gt;   &lt;br /&gt;&lt;br /&gt;backtracks&lt;br /&gt;    Incremented for each page fault that occurs while resolving a previous page fault. (The new page fault must be resolved first and then initial page faults can be backtracked.) &lt;br /&gt;&lt;br /&gt;lock misses&lt;br /&gt;    VMM enforces locks for concurrency by removing addressability to a page. A page fault can occur due to a lock miss, and this count is incremented for each such occurrence. &lt;br /&gt;&lt;br /&gt;free frame waits&lt;br /&gt;    Incremented each time a process is waited by VMM while free frames are gathered. &lt;br /&gt;&lt;br /&gt;extend XPT waits&lt;br /&gt;    Incremented each time a process is waited by VMM due to a commit in progress for the segment being accessed. &lt;br /&gt;&lt;br /&gt;pending I/O waits&lt;br /&gt;    Incremented each time a process is waited by VMM for a page-in I/O to complete. &lt;br /&gt;&lt;br /&gt;start I/Os&lt;br /&gt;    Incremented for each read or write I/O request initiated by VMM. This count should equal the sum of page-ins and page-outs. &lt;br /&gt;&lt;br /&gt;iodones&lt;br /&gt;    Incremented at the completion of each VMM I/O request. &lt;br /&gt;&lt;br /&gt;CPU context switches&lt;br /&gt;    Incremented for each CPU context switch (dispatch of a new process). &lt;br /&gt;&lt;br /&gt;device interrupts&lt;br /&gt;    Incremented on each hardware interrupt. &lt;br /&gt;&lt;br /&gt;software interrupts&lt;br /&gt;    Incremented on each software interrupt. A software interrupt is a machine instruction similar to a hardware interrupt that saves some state and branches to a service routine. System calls are implemented with software interrupt instructions that branch to the system call handler routine. &lt;br /&gt;&lt;br /&gt;traps&lt;br /&gt;    Not maintained by the operating system. &lt;br /&gt;&lt;br /&gt;syscalls&lt;br /&gt;    Incremented for each system call. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-t  Prints the time-stamp next to each line of output of vmstat. The time-stamp is displayed in the HH:MM:SS format.&lt;br /&gt;&lt;br /&gt;    Note: Time stamp will not be printed if -f, -s, or -i flags are specified. &lt;br /&gt;&lt;br /&gt;Examples&lt;br /&gt;&lt;br /&gt;   1. To display a summary of the statistics since boot, enter:&lt;br /&gt;&lt;br /&gt;      vmstat&lt;br /&gt;&lt;br /&gt;   2. To display five summaries at 2-second intervals, enter:&lt;br /&gt;&lt;br /&gt;      vmstat 2 5&lt;br /&gt;&lt;br /&gt;      The first summary contains statistics for the time since boot.&lt;br /&gt;   3. To display a summary of the statistics since boot including statistics for logical disks scdisk13 and scdisk14, enter:&lt;br /&gt;&lt;br /&gt;      vmstat scdisk13 scdisk14&lt;br /&gt;&lt;br /&gt;   4. To display fork statistics, enter:&lt;br /&gt;      vmstat -f&lt;br /&gt;   5. To display the count of various events, enter:&lt;br /&gt;&lt;br /&gt;      vmstat -s&lt;br /&gt;&lt;br /&gt;   6. To display time-stamp next to each column of output of vmstat, enter:&lt;br /&gt;&lt;br /&gt;      vmstat -t&lt;br /&gt;&lt;br /&gt;   7. To display the new I/O oriented view with an alternative set of columns, enter:&lt;br /&gt;&lt;br /&gt;      vmstat -I&lt;br /&gt;&lt;br /&gt;Files&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/unix  Symbolic link to the kernel boot image.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/usr/bin/vmstat  Contains the vmstat command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-2668188188557437761?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/2668188188557437761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=2668188188557437761' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2668188188557437761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2668188188557437761'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/vmstat-top-20-dba-unix-commands.html' title='vmstat - Top 20 DBA Unix commands'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6705213127855312943</id><published>2008-10-16T13:00:00.000-07:00</published><updated>2008-10-16T13:01:19.511-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Find how much memory is in your unix machine/server?'/><title type='text'>Find how much memory is in your unix machine/server?</title><content type='html'>Solaris&lt;br /&gt;&lt;br /&gt;   1. dmesg | grep mem&lt;br /&gt;   2. prtdiag | grep Memory&lt;br /&gt;   3. prtconf -v | grep Memory &lt;br /&gt;&lt;br /&gt;AIX&lt;br /&gt;&lt;br /&gt;   1. bootinfo -r&lt;br /&gt;   2. lsattr -E1 sys0 -a realmem&lt;br /&gt;   3. getconf REAL_MEMORY &lt;br /&gt;&lt;br /&gt;HPUX&lt;br /&gt;&lt;br /&gt;   1. dmesg | grep Physical&lt;br /&gt;   2. /opt/ignite/bin/print_manifest | grep Memory&lt;br /&gt;   3. machinfo | grep Memory &lt;br /&gt;&lt;br /&gt;Linux&lt;br /&gt;&lt;br /&gt;   1. dmesg | grep Memory&lt;br /&gt;   2. grep -i memtotal /proc/meminfo&lt;br /&gt;   3. free &lt;br /&gt;&lt;br /&gt;OpenVMS&lt;br /&gt;&lt;br /&gt;   1. show mem /page &lt;br /&gt;&lt;br /&gt;FreeBSD&lt;br /&gt;&lt;br /&gt;   1. dmesg | grep memory&lt;br /&gt;   2. grep memory /var/run/dmesg.boot&lt;br /&gt;   3. sysctl -a | grep mem&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6705213127855312943?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6705213127855312943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6705213127855312943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6705213127855312943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6705213127855312943'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/find-how-much-memory-is-in-your-unix.html' title='Find how much memory is in your unix machine/server?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6034410797929344956</id><published>2008-10-16T10:41:00.000-07:00</published><updated>2008-10-16T10:42:12.182-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Difference between Session'/><category scheme='http://www.blogger.com/atom/ns#' term='Connection and Process'/><title type='text'>Difference between Session, Connection and Process</title><content type='html'>A connection is a physical circuit between you and the database.  A connection might be &lt;br /&gt;one of many types -- most popular begin DEDICATED server and SHARED server.  Zero, one or &lt;br /&gt;more sessions may be established over a given connection to the database as show above &lt;br /&gt;with sqlplus.  A process will be used by a session to execute statements.  Sometimes &lt;br /&gt;there is a one to one relationship between CONNECTION-&gt;SESSION-&gt;PROCESS (eg: a normal &lt;br /&gt;dedicated server connection).  Sometimes there is a one to many from connection to &lt;br /&gt;sessions (eg: like autotrace, one connection, two sessions, one process).  A process does &lt;br /&gt;not have to be dedicated to a specific connection or session however, for example when &lt;br /&gt;using shared server (MTS), your SESSION will grab a process from a pool of processes in &lt;br /&gt;order to execute a statement.  When the call is over, that process is released back to &lt;br /&gt;the pool of processes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6034410797929344956?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6034410797929344956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6034410797929344956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6034410797929344956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6034410797929344956'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/difference-between-session-connection.html' title='Difference between Session, Connection and Process'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-9084901750585566917</id><published>2008-10-15T12:33:00.001-07:00</published><updated>2008-10-15T12:33:29.644-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moving data files'/><title type='text'>Moving data files</title><content type='html'>Moving or renaming a datafile while the database is in the MOUNT stage requires the use of the ALTER DATABASE &lt;br /&gt;&lt;br /&gt;command. When using the ALTER DATABASE method to move datafiles, the datafile is moved after the instance is shut &lt;br /&gt;&lt;br /&gt;down. A summary of the steps involved follows:&lt;br /&gt;&lt;br /&gt;   1. Shutdown the instance&lt;br /&gt;   2. Use operating system commands to move or rename the files(s).&lt;br /&gt;   3. Mount the database and use the ALTER DATABASE to rename the file within the database.&lt;br /&gt;   4. Opening the Database &lt;br /&gt;&lt;br /&gt;% sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;&lt;br /&gt;SQL&gt; !mv /u05/app/oradata/ORA920/indx01.dbf /u06/app/oradata/ORA920/indx01.dbf&lt;br /&gt;&lt;br /&gt;SQL&gt; startup mount&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database rename file '/u05/app/oradata/ORA920/indx01.dbf' to '/u06/app/oradata/ORA920/indx01.dbf';&lt;br /&gt;&lt;br /&gt;    Do not disconnect after this step. Stay logged in &lt;br /&gt;    and proceed to open the database!&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;&lt;br /&gt;Moving or renaming a datafile while the database is in the 'OPEN' stage requires the use of the ALTER TABLESPACE &lt;br /&gt;&lt;br /&gt;command. When using the ALTER TABLESPACE method to move datafiles, the datafile is moved while the instance is &lt;br /&gt;&lt;br /&gt;running. A summary of the steps involved follows:&lt;br /&gt;&lt;br /&gt;   1. Take the tablespace OFFLINE.&lt;br /&gt;   2. Use operating system commands to move or rename the file(s).&lt;br /&gt;   3. Use the ALTER TABLESPACE command to rename the file within the database.&lt;br /&gt;   4. Bring the tablespace back ONLINE. &lt;br /&gt;&lt;br /&gt;NOTE: This method can only be used for non-SYSTEM tablespaces. It also cannot be used for tablespaces that contain &lt;br /&gt;&lt;br /&gt;active ROLLBACK segments or TEMPORARY segments.&lt;br /&gt;&lt;br /&gt;% sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace INDX offline;&lt;br /&gt;&lt;br /&gt;SQL&gt; !mv /u05/app/oradata/ORA920/indx01.dbf /u06/app/oradata/ORA920/indx01.dbf&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace INDX &lt;br /&gt;  2  rename datafile '/u05/app/oradata/ORA920/indx01.dbf' to '/u06/app/oradata/ORA920/indx01.dbf';&lt;br /&gt;&lt;br /&gt;    Do not disconnect after this step. Stay logged in &lt;br /&gt;    and proceed to bring the tablespace back online!&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace INDX online;&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-9084901750585566917?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/9084901750585566917/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=9084901750585566917' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9084901750585566917'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9084901750585566917'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/10/moving-data-files.html' title='Moving data files'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-2025864763995842107</id><published>2008-09-24T07:33:00.000-07:00</published><updated>2008-09-24T07:51:03.957-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Setting oracle database in archive mode from non-archive mode'/><title type='text'>Setting oracle database in archive mode from non-archive mode</title><content type='html'>&lt;p&gt; Lets start by checking the current archive mode.  &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;pre&gt;SQL&gt; SELECT LOG_MODE FROM SYS.V$DATABASE;&lt;br /&gt;&lt;br /&gt;LOG_MODE&lt;br /&gt;------------&lt;br /&gt;NOARCHIVELOG&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt; So we're in NOARCHIVELOG mode and we need to change.   We can use a database alter statement, but that won't be permanent, so lets just update the pfile directly.C:\oracle\product\10.2.0\admin\orcl&lt;/p&gt;&lt;p&gt; &lt;/p&gt;###########################################&lt;br /&gt;# Enable Archive Log&lt;br /&gt;###########################################&lt;br /&gt;log_archive_dest_1='location=C:\oracle\product\10.2.0\oradata\archive'&lt;br /&gt;log_archive_start=TRUE&lt;br /&gt;&lt;br /&gt;note: You must first create the archive directory and grant access priv to oracle user.&lt;br /&gt; &lt;p&gt; Note that we're not actually required to specify the location of the log destination, but if you don't it'll end up  in strange places (in my test it went to $ORACLE_HOME/dbs making a mess). You can specify as many as 10 diffrent archive log destinations by using the paramters log_archive_dest_1 through log_archive_dest_10. Remember, if you run out of space in your archive log destination the database will &lt;i&gt;shut down&lt;/i&gt;!     &lt;/p&gt;&lt;p&gt; Now we can startup the database in mount mode and put it in  archivelog mode.  &lt;/p&gt;&lt;pre&gt;&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  612368384 bytes&lt;br /&gt;Fixed Size                  1292036 bytes&lt;br /&gt;Variable Size             230689020 bytes&lt;br /&gt;Database Buffers          373293056 bytes&lt;br /&gt;Redo Buffers                7094272 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt; SELECT LOG_MODE FROM SYS.V$DATABASE;&lt;br /&gt;&lt;br /&gt;NOARCHIVELOG&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate&lt;br /&gt;Database closed.&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  612368384 bytes&lt;br /&gt;Fixed Size                  1292036 bytes&lt;br /&gt;Variable Size             234883324 bytes&lt;br /&gt;Database Buffers          369098752 bytes&lt;br /&gt;Redo Buffers                7094272 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;SQL&gt; alter database archivelog;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT LOG_MODE FROM SYS.V$DATABASE;&lt;br /&gt;&lt;br /&gt;ARCHIVELOG&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-2025864763995842107?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/2025864763995842107/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=2025864763995842107' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2025864763995842107'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2025864763995842107'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/setting-oracle-database-in-archive-mode.html' title='Setting oracle database in archive mode from non-archive mode'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5620177668365046645</id><published>2008-09-21T10:50:00.000-07:00</published><updated>2008-09-21T10:51:01.042-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Version Information - How to CheckYour Current Release Number ?'/><title type='text'>Oracle Version Information - How to CheckYour Current Release Number ?</title><content type='html'>&lt;p&gt;&lt;a id="sthref107" name="sthref107"&gt;&lt;/a&gt;To identify the release of Oracle Database that is currently installed and to see the release levels of other database components you are using, query the data dictionary view &lt;a id="sthref108" name="sthref108"&gt;&lt;/a&gt;&lt;code&gt;PRODUCT_COMPONENT_VERSION&lt;/code&gt;. A sample query follows. (You can also query the &lt;a id="sthref109" name="sthref109"&gt;&lt;/a&gt;&lt;code&gt;V$VERSION&lt;/code&gt; view to see component-level information.) Other product release levels may increment independent of the database server.&lt;/p&gt; &lt;pre space="preserve" class="oac_no_warn"&gt;COL PRODUCT FORMAT A35&lt;br /&gt;COL VERSION FORMAT A15&lt;br /&gt;COL STATUS FORMAT A15&lt;br /&gt;SELECT * FROM PRODUCT_COMPONENT_VERSION;&lt;br /&gt;&lt;br /&gt;PRODUCT                                  VERSION     STATUS&lt;br /&gt;---------------------------------------- ----------- -----------&lt;br /&gt;NLSRTL                                   10.2.0.1.0  Production&lt;br /&gt;Oracle Database 10g Enterprise Edition   10.2.0.1.0  Prod&lt;br /&gt;PL/SQL                                   10.2.0.1.0  Production&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5620177668365046645?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5620177668365046645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5620177668365046645' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5620177668365046645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5620177668365046645'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-version-information-how-to.html' title='Oracle Version Information - How to CheckYour Current Release Number ?'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-9046554903329958010</id><published>2008-09-21T10:47:00.000-07:00</published><updated>2008-09-21T10:48:39.347-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database and Instance Shutdown'/><title type='text'>Database and Instance Shutdown</title><content type='html'>&lt;h3 class="sect2"&gt;Close a Database&lt;/h3&gt; &lt;p&gt;&lt;a id="sthref1905" name="sthref1905"&gt;&lt;/a&gt;When you close a database, Oracle writes all database data and recovery data in the SGA to the datafiles and redo log files, respectively. Next, Oracle closes all online datafiles and redo log files. (Any offline datafiles of any offline tablespaces have been closed already. If you subsequently reopen the database, any tablespace that was offline and its datafiles remain offline and closed, respectively.) At this point, the database is closed and inaccessible for normal operations. The control files remain open after a database is closed but still mounted.&lt;/p&gt; &lt;div class="sect3"&gt;&lt;a id="sthref1906" name="sthref1906"&gt;&lt;/a&gt; &lt;h4 class="sect3"&gt;Close the Database by Terminating the Instance&lt;/h4&gt; &lt;p&gt;&lt;a id="sthref1907" name="sthref1907"&gt;&lt;/a&gt;&lt;a id="sthref1908" name="sthref1908"&gt;&lt;/a&gt;&lt;a id="sthref1909" name="sthref1909"&gt;&lt;/a&gt;&lt;a id="sthref1910" name="sthref1910"&gt;&lt;/a&gt;In rare emergency situations, you can terminate the instance of an open database to close and completely shut down the database instantaneously. This process is fast, because the operation of writing all data in the buffers of the SGA to the datafiles and redo log files is skipped. The subsequent reopening of the database requires recovery, which Oracle performs automatically.&lt;/p&gt; &lt;div class="infoboxnote"&gt; &lt;p class="notep1"&gt;Note:&lt;/p&gt; &lt;a id="sthref1911" name="sthref1911"&gt;&lt;/a&gt;&lt;a id="sthref1912" name="sthref1912"&gt;&lt;/a&gt;&lt;a id="sthref1913" name="sthref1913"&gt;&lt;/a&gt;&lt;a id="sthref1914" name="sthref1914"&gt;&lt;/a&gt;If a system or power failure occurs while the database is open, then the instance is, in effect, terminated, and recovery is performed when the database is reopened.&lt;/div&gt; &lt;/div&gt; &lt;!-- class="sect3" --&gt; &lt;!-- class="sect2" --&gt; &lt;div class="sect2"&gt;&lt;a id="sthref1915" name="sthref1915"&gt;&lt;/a&gt; &lt;h3 class="sect2"&gt;Unmount a Database&lt;/h3&gt; &lt;p&gt;After the database is closed, Oracle unmounts the database to disassociate it from the instance. At this point, the instance remains in the memory of your computer.&lt;/p&gt; &lt;p&gt;After a database is unmounted, Oracle closes the control files of the database.&lt;/p&gt; &lt;/div&gt; &lt;!-- class="sect2" --&gt; &lt;a id="sthref1916" name="sthref1916"&gt;&lt;/a&gt; &lt;h3 class="sect2"&gt;Shut Down an Instance&lt;/h3&gt; &lt;p&gt;&lt;a id="sthref1917" name="sthref1917"&gt;&lt;/a&gt;&lt;a id="sthref1918" name="sthref1918"&gt;&lt;/a&gt;The final step in database shutdown is shutting down the instance. When you shut down an instance, the SGA is removed from memory and the background processes are terminated.&lt;/p&gt; &lt;a id="sthref1919" name="sthref1919"&gt;&lt;/a&gt; &lt;h4 class="sect3"&gt;Abnormal Instance Shutdown&lt;/h4&gt; &lt;p&gt;&lt;a id="sthref1920" name="sthref1920"&gt;&lt;/a&gt;&lt;a id="sthref1921" name="sthref1921"&gt;&lt;/a&gt;&lt;a id="sthref1922" name="sthref1922"&gt;&lt;/a&gt;&lt;a id="sthref1923" name="sthref1923"&gt;&lt;/a&gt;In unusual circumstances, shutdown of an instance might not occur cleanly; all memory structures might not be removed from memory or one of the background processes might not be terminated. When remnants of a previous instance exist, a subsequent instance startup most likely will fail. In such situations, the database administrator can force the new instance to start up by first removing the remnants of the previous instance and then starting a new instance, or by issuing a &lt;code&gt;SHUTDOWN&lt;/code&gt; &lt;code&gt;ABORT&lt;/code&gt; statement in SQL*Plus or using Enterprise Manager.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-9046554903329958010?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/9046554903329958010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=9046554903329958010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9046554903329958010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/9046554903329958010'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/database-and-instance-shutdown_21.html' title='Database and Instance Shutdown'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5482150256506437044</id><published>2008-09-21T10:46:00.000-07:00</published><updated>2008-09-21T10:47:26.189-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database and Instance Shutdown'/><title type='text'>Database and Instance Shutdown</title><content type='html'>&lt;p&gt;&lt;a id="sthref1899" name="sthref1899"&gt;&lt;/a&gt;&lt;a id="sthref1900" name="sthref1900"&gt;&lt;/a&gt;&lt;a id="sthref1901" name="sthref1901"&gt;&lt;/a&gt;&lt;a id="sthref1902" name="sthref1902"&gt;&lt;/a&gt;The three steps to shutting down a database and its associated instance are:&lt;/p&gt; &lt;ol&gt;&lt;li&gt; &lt;p&gt;Close the database.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;Unmount the database.&lt;/p&gt; &lt;/li&gt;&lt;li&gt; &lt;p&gt;Shut down the instance.&lt;/p&gt; &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;a id="sthref1903" name="sthref1903"&gt;&lt;/a&gt;A database administrator can perform these steps using Enterprise Manager. Oracle automatically performs all three steps whenever an instance is shut down.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5482150256506437044?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5482150256506437044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5482150256506437044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5482150256506437044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5482150256506437044'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/database-and-instance-shutdown.html' title='Database and Instance Shutdown'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7979550489565072113</id><published>2008-09-21T10:45:00.001-07:00</published><updated>2008-09-21T10:45:43.411-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What Happens When You Open a Database'/><title type='text'>What Happens When You Open a Database</title><content type='html'>&lt;p&gt;&lt;a id="sthref1881" name="sthref1881"&gt;&lt;/a&gt;Opening a mounted database&lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/glossary.htm#i998168"&gt;&lt;span class="xrefglossterm"&gt;&lt;/span&gt;&lt;/a&gt; makes it available for normal database operations. Any valid user can connect to an open database and access its information. Usually, a database administrator opens the database to make it available for general use.&lt;/p&gt; &lt;p&gt;When you open the database, Oracle opens the online datafiles and redo log files. If a tablespace was offline when the database was previously shut down, the tablespace and its corresponding datafiles will still be offline when you reopen the database.&lt;/p&gt; &lt;p&gt;If any of the datafiles or redo log files are not present when you attempt to open the database, then Oracle returns an error. You must perform recovery on a backup of any damaged or missing files before you can open the database.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7979550489565072113?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7979550489565072113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7979550489565072113' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7979550489565072113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7979550489565072113'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-happens-when-you-open-database.html' title='What Happens When You Open a Database'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-396094745372540714</id><published>2008-09-21T10:42:00.000-07:00</published><updated>2008-09-21T10:44:08.800-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to Identify Your Oracle Database Software Release'/><title type='text'>How to Identify Your Oracle Database Software Release</title><content type='html'>&lt;p&gt;Because Oracle Database continues to evolve and can require maintenance, Oracle periodically produces new releases. Not all customers initially subscribe to a new release or require specific maintenance for their existing release. As a result, multiple releases of the product exist simultaneously.&lt;/p&gt; &lt;p&gt;As many as five numbers may be required to fully identify a release. The significance of these numbers is discussed in the sections that follow.&lt;/p&gt; &lt;a id="i1106400" name="i1106400"&gt;&lt;/a&gt; &lt;a id="sthref95" name="sthref95"&gt;&lt;/a&gt; &lt;h3 class="sect2"&gt;Release Number Format&lt;a id="sthref96" name="sthref96"&gt;&lt;/a&gt;&lt;a id="sthref97" name="sthref97"&gt;&lt;/a&gt;&lt;a id="sthref98" name="sthref98"&gt;&lt;/a&gt;&lt;/h3&gt; &lt;p&gt;To understand the release nomenclature used by Oracle, examine the following example of an Oracle Database server labeled "Release 10.1.0.1.0".&lt;/p&gt; &lt;a id="sthref99" name="sthref99"&gt;&lt;/a&gt; &lt;p class="titleinfigure"&gt;Figure 1-1 Example of an Oracle Database Release Number&lt;/p&gt; &lt;img src="http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14231/img/admin002.gif" alt="Description of Figure 1-1 follows" title="Description of Figure 1-1 follows" width="318" height="141" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-396094745372540714?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/396094745372540714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=396094745372540714' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/396094745372540714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/396094745372540714'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/how-to-identify-your-oracle-database.html' title='How to Identify Your Oracle Database Software Release'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1514262938353001775</id><published>2008-09-21T06:34:00.000-07:00</published><updated>2008-09-21T06:38:00.363-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is block change tracking in RMAN Oracle 10g'/><title type='text'>What is block change tracking in RMAN Oracle 10g</title><content type='html'>&lt;span class="bodycopy"&gt;Oracle Database 10&lt;em&gt;g&lt;/em&gt; RMAN implements incremental backups in a manner that disposes of the  objection " &lt;/span&gt;&lt;span class="bodycopy"&gt;&lt;span style="font-weight: bold;"&gt;RMAN scans all the data blocks to identify candidates for backup. This process puts so much stress on the system that doing incrementals becomes impractical&lt;/span&gt;" &lt;/span&gt;&lt;span class="bodycopy"&gt;. It uses a file, analogous to journals in filesystems, to track the blocks that have changed since the last backup. RMAN reads this file to determine which blocks are to be backed up. &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;You can enable this tracking mechanism by issuing the following command: &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;pre&gt;SQL&gt; alter database enable block change tracking using file '/rman_bkups/change.log';&lt;br /&gt;&lt;/pre&gt; &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;This command creates a binary file called /rman_bkups/change.log for tracking purposes. Conversely, you can disable tracking with &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;pre&gt;SQL&gt; alter database disable block change tracking;&lt;br /&gt;&lt;/pre&gt;  &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;To see whether change tracking is currently enabled, you can query: &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;pre&gt;SQL&gt; select filename, status from v$block_change_tracking;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1514262938353001775?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1514262938353001775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1514262938353001775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1514262938353001775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1514262938353001775'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-blick-change-tracking-in-rman.html' title='What is block change tracking in RMAN Oracle 10g'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8111695820542795381</id><published>2008-09-21T06:26:00.000-07:00</published><updated>2008-09-21T06:29:03.126-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is Incremental Merge in RMAN 10g?'/><title type='text'>What is Incremental Merge in RMAN 10g?</title><content type='html'>&lt;span class="bodycopy"&gt;Let's say you have the following backup schedule: &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;Sunday - Level 0 (full), with tag level_0&lt;br /&gt;Monday - Level 1 (incremental) with tag level_1_mon&lt;br /&gt;Tuesday - Level 1 (incremental) with tag level_1_tue &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;and so on. If the database fails on Saturday, prior to 10&lt;em&gt;g&lt;/em&gt; you would have had to restore the tag level_0 and then apply all six incrementals. It would have taken a long time, which is another reason many DBAs shun incremental backups. &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;Oracle Database 10&lt;em&gt;g&lt;/em&gt; RMAN radically changes that equation. Now, your incremental backup command looks like this: &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;pre&gt;RMAN&gt; backup incremental level_1 for recover of copy with tag level_0 database;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;Here we have instructed RMAN to make an incremental level_1 backup and merge that with the full backup copy with the tag &lt;tt&gt;level_0&lt;/tt&gt;. After this command, level_0 becomes a full backup of that day.  &lt;/span&gt; &lt;p&gt; &lt;/p&gt; &lt;span class="bodycopy"&gt;So, on Tuesday, the backup with tag level_0, when merged with incremental level_1 backup, becomes identical to the full Tuesday backup. Similarly, the incremental taken on Saturday, when applied to the backup on disk, will be equivalent to a full level_0 Saturday backup. If the database fails on Saturday, you just need to restore the level_0 backup plus a few archive logs to bring the database into a consistent state; there is no need to apply additional incrementals. This approach cuts down recovery time dramatically, speeds backup, and eliminates the need to make a full database backup again. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8111695820542795381?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8111695820542795381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8111695820542795381' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8111695820542795381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8111695820542795381'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-incremental-merge-in-rman-10g.html' title='What is Incremental Merge in RMAN 10g?'/><author><name>OracleDBAFAQ</name><uri>http://www.blogger.com/profile/05504116708319595979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-155056919628141853</id><published>2008-09-20T19:53:00.002-07:00</published><updated>2008-09-20T19:54:20.718-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moving from DBMS_JOB to DBMS_SCHEDULER'/><title type='text'>Moving from DBMS_JOB to DBMS_SCHEDULER</title><content type='html'>Removing a Job from the Job Queue&lt;br /&gt;&lt;br /&gt;The following example removes a job using DBMS_JOB, where 14144 is the number of the job being run:&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_JOB.REMOVE(14144);&lt;br /&gt;COMMIT;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using DBMS_SCHEDULER, you would issue the following statement instead:&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;   DBMS_SCHEDULER.DROP_JOB('myjob1');&lt;br /&gt;END;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-155056919628141853?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/155056919628141853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=155056919628141853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/155056919628141853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/155056919628141853'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/moving-from-dbmsjob-to-dbmsscheduler_5295.html' title='Moving from DBMS_JOB to DBMS_SCHEDULER'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-2124829252663608797</id><published>2008-09-20T19:53:00.001-07:00</published><updated>2008-09-20T19:53:21.506-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moving from DBMS_JOB to DBMS_SCHEDULER'/><title type='text'>Moving from DBMS_JOB to DBMS_SCHEDULER</title><content type='html'>Altering a Job&lt;br /&gt;&lt;br /&gt;An example of altering a job using DBMS_JOB is the following:&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_JOB.WHAT(31, 'INSERT INTO employees VALUES (7935, ''TOM'', ''DOGAN'', &lt;br /&gt;   ''tom.dogan@xyzcorp.com'', NULL, SYSDATE,''AD_PRES'', NULL,&lt;br /&gt;   NULL, NULL, NULL);');&lt;br /&gt;COMMIT;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This changes the action for job 31 to insert a different value. An equivalent statement using DBMS_SCHEDULER is the following:&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_SCHEDULER.SET_ATTRIBUTE(&lt;br /&gt;   name          =&gt; 'JOB1',&lt;br /&gt;   attribute     =&gt; 'job_action',&lt;br /&gt;   value         =&gt; 'INSERT INTO employees VALUES (7935, ''TOM'', ''DOGAN'', &lt;br /&gt;      ''tom.dogan@xyzcorp.com'', NULL, SYSDATE, ''AD_PRES'', NULL,&lt;br /&gt;      NULL, NULL, NULL);');&lt;br /&gt;END;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-2124829252663608797?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/2124829252663608797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=2124829252663608797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2124829252663608797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2124829252663608797'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/moving-from-dbmsjob-to-dbmsscheduler_5857.html' title='Moving from DBMS_JOB to DBMS_SCHEDULER'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4464279893380994067</id><published>2008-09-20T19:51:00.000-07:00</published><updated>2008-09-20T19:52:16.541-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moving from DBMS_JOB to DBMS_SCHEDULER'/><title type='text'>Moving from DBMS_JOB to DBMS_SCHEDULER</title><content type='html'>Creating a Job&lt;br /&gt;&lt;br /&gt;An example of creating a job using DBMS_JOB is the following:&lt;br /&gt;&lt;br /&gt;VARIABLE jobno NUMBER;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_JOB.SUBMIT(:jobno, 'INSERT INTO employees VALUES (7935, ''SALLY'',&lt;br /&gt;   ''DOGAN'', ''sally.dogan@xyzcorp.com'', NULL, SYSDATE, ''AD_PRES'', NULL, &lt;br /&gt;    NULL, NULL, NULL);', SYSDATE, 'SYSDATE+1');&lt;br /&gt;COMMIT;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An equivalent statement using DBMS_SCHEDULER is the following:&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;DBMS_SCHEDULER.CREATE_JOB(&lt;br /&gt;   job_name          =&gt;  'job1',&lt;br /&gt;   job_type          =&gt;  'PLSQL_BLOCK',&lt;br /&gt;   job_action        =&gt;  'INSERT INTO employees VALUES (7935, ''SALLY'',&lt;br /&gt;     ''DOGAN'', ''sally.dogan@xyzcorp.com'', NULL, SYSDATE,''AD_PRES'', NULL,&lt;br /&gt;      NULL, NULL, NULL);');&lt;br /&gt;   start_date        =&gt;  SYSDATE,&lt;br /&gt;   repeat_interval   =&gt;  'FREQ = DAILY; INTERVAL = 1');&lt;br /&gt;END;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4464279893380994067?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4464279893380994067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4464279893380994067' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4464279893380994067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4464279893380994067'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/moving-from-dbmsjob-to-dbmsscheduler_20.html' title='Moving from DBMS_JOB to DBMS_SCHEDULER'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-2906176636564527311</id><published>2008-09-20T19:48:00.000-07:00</published><updated>2008-09-20T19:50:35.414-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moving from DBMS_JOB to DBMS_SCHEDULER'/><title type='text'>Moving from DBMS_JOB to DBMS_SCHEDULER</title><content type='html'>Moving from DBMS_JOB to DBMS_SCHEDULER&lt;br /&gt;&lt;br /&gt;Oracle Database provides advanced scheduling capabilities through the database Scheduler, a collection of functions and procedures in the DBMS_SCHEDULER package. The Scheduler offers far more functionality than the DBMS_JOB package, which was the previous Oracle Database job scheduler. In our next few posting we will discusses how you can take statements created with DBMS_JOB and rewrite them using DBMS_SCHEDULER.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-2906176636564527311?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/2906176636564527311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=2906176636564527311' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2906176636564527311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2906176636564527311'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/moving-from-dbmsjob-to-dbmsscheduler.html' title='Moving from DBMS_JOB to DBMS_SCHEDULER'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-964271310760035299</id><published>2008-09-20T19:47:00.000-07:00</published><updated>2008-09-20T19:48:00.978-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g Scheduler - Associating Jobs with Programs'/><title type='text'>Oracle Database 10g Scheduler - Associating Jobs with Programs</title><content type='html'>Associating Jobs with Programs&lt;br /&gt;&lt;br /&gt;In the above case, you created a job independently of any program. Now let's create one that refers to an operating system utility or program, a schedule to specify how many times something should run, and then join the two to create a job.&lt;br /&gt;&lt;br /&gt;First you need to make the database aware that your script is a program to be used in a job. To create this program, you must have the CREATE JOB privilege.&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;    dbms_scheduler.create_program&lt;br /&gt;    (&lt;br /&gt;       program_name   =&gt; 'MOVE_ARCS',&lt;br /&gt;       program_type   =&gt; 'EXECUTABLE',&lt;br /&gt;       program_action =&gt; '/home/arup/dbtools/move_arcs.sh',&lt;br /&gt;       enabled        =&gt; TRUE,&lt;br /&gt;       comments       =&gt; 'Moving Archived Logs to Staging Directory'&lt;br /&gt;    );&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Here you have created a named program unit, specified it as an executable, and noted what the program unit is called.&lt;br /&gt;&lt;br /&gt;Next, you will create a named schedule to be run every 30 minutes called EVERY_30_MINS. You would do that with:&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;    dbms_scheduler.create_schedule&lt;br /&gt;    (&lt;br /&gt;       schedule_name   =&gt; 'EVERY_30_MINS',&lt;br /&gt;       repeat_interval =&gt; 'FREQ=MINUTELY; INTERVAL=30',&lt;br /&gt;       comments        =&gt; 'Every 30-mins'&lt;br /&gt;    );&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Now that the program and schedule are created, you will associate the program to the schedule to create a job.&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;   dbms_scheduler.create_job&lt;br /&gt;   (&lt;br /&gt;      job_name      =&gt; 'ARC_MOVE',&lt;br /&gt;      program_name  =&gt; 'MOVE_ARCS',&lt;br /&gt;      schedule_name =&gt; 'EVERY_30_MINS',&lt;br /&gt;      comments      =&gt; 'Move Archived Logs to a Different Directory',&lt;br /&gt;      enabled       =&gt; TRUE&lt;br /&gt;   );&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;This will create a job to be run every 30 minutes that executes the shell script move_arcs.sh. It will be handled by the Scheduler feature inside the database—no need for cron or the AT utility.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-964271310760035299?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/964271310760035299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=964271310760035299' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/964271310760035299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/964271310760035299'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-database-10g-scheduler_20.html' title='Oracle Database 10g Scheduler - Associating Jobs with Programs'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3385397630358630765</id><published>2008-09-20T19:46:00.000-07:00</published><updated>2008-09-20T19:47:03.943-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g Scheduler - Creating Jobs Without Programs'/><title type='text'>Oracle Database 10g Scheduler - Creating Jobs Without Programs</title><content type='html'>Creating Jobs Without Programs&lt;br /&gt;&lt;br /&gt;Perhaps the concept can be best introduced through examples. Suppose you have created a shell script to move archived log files to a different filesystem as follows:&lt;br /&gt;&lt;br /&gt;/home/arup/dbtools/move_arcs.sh&lt;br /&gt;&lt;br /&gt;We can specify the OS executable directly without creating it as a program first.&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;   dbms_scheduler.create_job&lt;br /&gt;   (&lt;br /&gt;      job_name      =&gt; 'ARC_MOVE_2',&lt;br /&gt;      schedule_name =&gt; 'EVERY_30_MINS',&lt;br /&gt;      job_type      =&gt; 'EXECUTABLE',&lt;br /&gt;      job_action    =&gt; '/home/arup/dbtools/move_arcs.sh',&lt;br /&gt;      enabled       =&gt; true,&lt;br /&gt;      comments      =&gt; 'Move Archived Logs to a Different Directory'&lt;br /&gt;   );&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Similarly, you can create a job without a named schedule.&lt;br /&gt;&lt;br /&gt;begin&lt;br /&gt;   dbms_scheduler.create_job&lt;br /&gt;   (&lt;br /&gt;      job_name        =&gt; 'ARC_MOVE_3',&lt;br /&gt;      job_type        =&gt; 'EXECUTABLE',&lt;br /&gt;      job_action      =&gt; '/home/arup/dbtools/move_arcs.sh',&lt;br /&gt;      repeat_interval =&gt; 'FREQ=MINUTELY; INTERVAL=30',&lt;br /&gt;      enabled         =&gt; true,&lt;br /&gt;      comments        =&gt; 'Move Archived Logs to a Different Directory'&lt;br /&gt;   );&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;One advantage of Scheduler over dbms_job is pretty clear from our initial example: the ability to call OS utilities and programs, not just PL/SQL program units. This ability makes it the most comprehensive job management tool for managing Oracle Database and related jobs. However, you may have noted another, equally important advantage: the ability to define intervals in natural language. Note that in the above example we wanted our schedule to run every 30 minutes; hence the parameter REPEAT_INTERVAL is defined with a simple, English-like expression (not a PL/SQL one) :&lt;br /&gt;&lt;br /&gt;'FREQ=MINUTELY; INTERVAL=30'&lt;br /&gt;&lt;br /&gt;A more complex example may help convey this advantage even better. Suppose your production applications become most active at 7:00AM and 3:00PM. To collect system statistics, you want to run Statspack from Monday to Friday at 7:00AM and 3:00PM only. If you use DBMS_JOB.SUBMIT to create a job, the NEXT_DATE parameter will look something like this:&lt;br /&gt;&lt;br /&gt;DECODE&lt;br /&gt;(&lt;br /&gt;   SIGN&lt;br /&gt;   (&lt;br /&gt;      15 - TO_CHAR(SYSDATE,'HH24')&lt;br /&gt;   ), &lt;br /&gt;   1,&lt;br /&gt;      TRUNC(SYSDATE)+15/24,&lt;br /&gt;   TRUNC&lt;br /&gt;   (&lt;br /&gt;      SYSDATE +&lt;br /&gt;      DECODE&lt;br /&gt;      ( &lt;br /&gt;          TO_CHAR(SYSDATE,'D'), 6, 3, 1&lt;br /&gt;      )&lt;br /&gt;    )&lt;br /&gt;    +7/24&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;Is that code easy to understand? Not really.&lt;br /&gt;&lt;br /&gt;Now let's see the equivalent job in DBMS_SCHEDULER. The parameter REPEAT_INTERVAL will be as simple as:&lt;br /&gt;&lt;br /&gt;'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=7,15'&lt;br /&gt;&lt;br /&gt;Furthermore, this parameter value can accept a variety of intervals, some of them very powerful. Here are some more examples:&lt;br /&gt;&lt;br /&gt;    * Last Sunday of every month:&lt;br /&gt;&lt;br /&gt;      FREQ=MONTHLY; BYDAY=-1SUN&lt;br /&gt;&lt;br /&gt;    * Every third Friday of the month:&lt;br /&gt;&lt;br /&gt;      FREQ=MONTHLY; BYDAY=3FRI&lt;br /&gt;&lt;br /&gt;    * Every second Friday from the end of the month, not from the beginning:&lt;br /&gt;&lt;br /&gt;      FREQ=MONTHLY; BYDAY=-2FRI&lt;br /&gt;&lt;br /&gt;The minus signs before the numbers indicate counting from the end, instead of the beginning.&lt;br /&gt;&lt;br /&gt;What if you wanted to verify if the interval settings are correct? Wouldn't it be nice to see the various dates constructed from the calendar string? Well, you can get a preview of the calculation of next dates using the EVALUATE_CALENDAR_STRING procedure. Using the first example—running Statspack every day from Monday through Friday at 7:00AM and 3:00PM—you can check the accuracy of your interval string as follows:&lt;br /&gt;&lt;br /&gt;set serveroutput on size 999999&lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;   L_start_date    TIMESTAMP;&lt;br /&gt;   l_next_date     TIMESTAMP;&lt;br /&gt;   l_return_date   TIMESTAMP;&lt;br /&gt;begin&lt;br /&gt;   l_start_date := trunc(SYSTIMESTAMP);&lt;br /&gt;   l_return_date := l_start_date;&lt;br /&gt;   for ctr in 1..10 loop&lt;br /&gt;      dbms_scheduler.evaluate_calendar_string(&lt;br /&gt;        'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=7,15',&lt;br /&gt;         l_start_date, l_return_date, l_next_date&lt;br /&gt;      );&lt;br /&gt;      dbms_output.put_line('Next Run on: ' ||&lt;br /&gt;          to_char(l_next_date,'mm/dd/yyyy hh24:mi:ss')&lt;br /&gt;      );&lt;br /&gt;      l_return_date := l_next_date;&lt;br /&gt;   end loop;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;The output is:&lt;br /&gt;&lt;br /&gt;Next Run on: 03/22/2004 07:00:00&lt;br /&gt;Next Run on: 03/22/2004 15:00:00&lt;br /&gt;Next Run on: 03/23/2004 07:00:00&lt;br /&gt;Next Run on: 03/23/2004 15:00:00&lt;br /&gt;Next Run on: 03/24/2004 07:00:00&lt;br /&gt;Next Run on: 03/24/2004 15:00:00&lt;br /&gt;Next Run on: 03/25/2004 07:00:00&lt;br /&gt;Next Run on: 03/25/2004 15:00:00&lt;br /&gt;Next Run on: 03/26/2004 07:00:00&lt;br /&gt;Next Run on: 03/26/2004 15:00:00&lt;br /&gt;&lt;br /&gt;This confirms that your settings are correct.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3385397630358630765?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3385397630358630765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3385397630358630765' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3385397630358630765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3385397630358630765'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-database-10g-scheduler-creating.html' title='Oracle Database 10g Scheduler - Creating Jobs Without Programs'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3141331738864455935</id><published>2008-09-20T19:45:00.001-07:00</published><updated>2008-09-20T19:45:50.550-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Database 10g Scheduler'/><title type='text'>Oracle Database 10g Scheduler</title><content type='html'>The Oracle Database 10g Scheduler feature offers the best of all worlds: a job scheduler utility right inside the database that is sufficiently powerful to handle all types of jobs, not just PL/SQL code segments, and that can help you create jobs either with or without associated programs and/or schedules. Best of all, it comes with the database at no additional cost. In this installment, we'll take a look at how it works.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3141331738864455935?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3141331738864455935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3141331738864455935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3141331738864455935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3141331738864455935'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-database-10g-scheduler.html' title='Oracle Database 10g Scheduler'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3740925148709474811</id><published>2008-09-20T19:42:00.000-07:00</published><updated>2008-09-20T19:44:25.053-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBMS_JOB Package'/><title type='text'>DBMS_JOB Package</title><content type='html'>Some of you may use the dbms_job package extensively to submit database jobs to be run in the background, control the time or interval of a run, report failures, and much more.&lt;br /&gt;&lt;br /&gt;The problem with the package is that it can handle only PL/SQL code segments—just anonymous blocks and stored program units. It cannot handle anything outside the database that is in an operating system command file or executable. To do so, you would have to resort to using an operating system scheduling utility such as cron in Unix or the AT command in Windows. Or, you could use a third-party tool, one that may even extend this functionality by providing a graphical user interface.&lt;br /&gt;&lt;br /&gt;Even so, dbms_job has a distinct advantage over these alternatives: it is active only when the database is up and running. If the database is down, the jobs don't run. A tool outside the database must manually check if the database is up—and that can be difficult. Another advantage is that dbms_job is internal to the database; hence you can access it via a database access utility such as SQL*Plus.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3740925148709474811?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3740925148709474811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3740925148709474811' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3740925148709474811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3740925148709474811'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/dbmsjob-package.html' title='DBMS_JOB Package'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4161872784665806770</id><published>2008-09-20T19:37:00.000-07:00</published><updated>2008-09-20T19:39:04.616-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Guard Database Synchronization Options'/><title type='text'>Data Guard Database Synchronization Options</title><content type='html'>Data Guard Database Synchronization Options&lt;br /&gt;&lt;br /&gt;Data Guard can be configured to run with varying synchronization modes indicating the potential for data loss:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;    * No-Data-Loss mode :&lt;/span&gt; This simply means that the log transport services will not acknowledge modifications to the primary database until they are available to the standby database. This doesn't mean that the modifications have been applied to the standby database, merely that the log information is available to the log apply services should failover occur. This mode is implemented using standby redo logs on the standby server.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;    * No-Data-Divergence mode :&lt;/span&gt; This is an extension of the no-data-loss mode whereby modifications to the primary database are prevented if conectivity between the primary and at least one standby database is unavailable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;    * Minimal-Data-Loss mode :&lt;/span&gt; When the performance requirements of the primary database are the top priority this mode provides the optimum balance of data protection and performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4161872784665806770?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4161872784665806770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4161872784665806770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4161872784665806770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4161872784665806770'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/data-guard-database-synchronization.html' title='Data Guard Database Synchronization Options'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6138863471365382003</id><published>2008-09-20T19:32:00.000-07:00</published><updated>2008-09-20T19:34:55.064-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Guard Role Management'/><title type='text'>Data Guard Role Management</title><content type='html'>Role Management&lt;br /&gt;&lt;br /&gt;Using Data Guard, the role of a database can be switched from a primary role to a standby role and vice versa, ensuring no data loss in the process, and minimizing downtime. &lt;br /&gt;&lt;br /&gt;There are two kinds of role transitions - &lt;span style="font-weight:bold;"&gt;a switchover and a failover.&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;A switchover is a role reversal between the primary database and one of its standby databases. This is typically done for planned maintenance of the primary system. During a switchover, the primary database transitions to a standby role and the standby database transitions to the primary role. The transition occurs without having to re-create either database. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;A failover is a transition of a standby database to the primary role following a sudden outage of the primary database. The failed primary can be reinstated as a standby database for the new primary using Oracle Flashback Database.  This can eliminate the need to recreate the failed primary from a backup, dramatically reducing the time and effort required to return the configuration to a protected state. &lt;/span&gt;&lt;br /&gt;Administrators have the option of executing failovers manually, or Data Guard can be configured to automatically detect primary database failures and execute a failover to the standby&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6138863471365382003?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6138863471365382003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6138863471365382003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6138863471365382003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6138863471365382003'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/data-guard-role-management.html' title='Data Guard Role Management'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-364114217291849797</id><published>2008-09-20T19:30:00.000-07:00</published><updated>2008-09-20T19:31:35.033-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Guard Broker'/><title type='text'>Data Guard Broker</title><content type='html'>Data Guard Broker&lt;br /&gt;&lt;br /&gt;The Oracle Data Guard Broker is a distributed management framework that automates and centralizes the creation, maintenance, and monitoring of Data Guard configurations. All management operations can be performed either through Oracle Enterprise Manager, which uses the Broker, or through the Broker's specialized command-line interface (DGMGRL). Data Guard Broker 11g also enables automatic database failover for Data Guard configurations using either Maximum Availability or Maximum Performance modes.&lt;br /&gt;&lt;br /&gt;Data Guard Broker&lt;br /&gt;&lt;br /&gt;    * Enables automatic database failover for configurations using either Maximum Availability or Maximum Performance mode.&lt;br /&gt;    * Enables configurable events to trigger immediate automatic failover to a target standby database.&lt;br /&gt;    * Improved support for redo transport options, enabling an administrator to specify a connect description for Redo Transport Services.&lt;br /&gt;    * Elimination of database downtime when changing the protection mode to and from Maximum Availability and Maximum Performance.&lt;br /&gt;    * Support for single instance databases configured for HA using Oracle Clusterware and cold failover clusters.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-364114217291849797?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/364114217291849797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=364114217291849797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/364114217291849797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/364114217291849797'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/data-guard-broker.html' title='Data Guard Broker'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4190840113911189464</id><published>2008-09-20T19:28:00.000-07:00</published><updated>2008-09-20T19:29:21.791-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Guard Protection Modes'/><title type='text'>Data Guard Protection Modes</title><content type='html'>Data Guard Protection Modes&lt;br /&gt;&lt;br /&gt;In some situations, a business cannot afford to lose data at any cost. In other situations, some applications require maximum database performance and can tolerate a potential loss of data. Data Guard provides three distinct modes of data protection to satisfy these varied requirements:&lt;br /&gt;&lt;br /&gt;    *&lt;span style="font-weight:bold;"&gt;Maximum Protection—&lt;/span&gt;This mode offers the highest level of data protection. Data is synchronously transmitted to the standby database from the primary database and transactions are not committed on the primary database unless the redo data is available on at least one standby database configured in this mode. If the last standby database configured in this mode becomes unavailable, processing stops on the primary database. This mode ensures no-data-loss, even in the event of multiple failures.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;    *Maximum Availability—&lt;/span&gt;This mode is similar to the maximum protection mode, including zero data loss. However, if a standby database becomes unavailable (for example, because of network connectivity problems), processing continues on the primary database. When the fault is corrected, the standby database is automatically resynchronized with the primary database.  This mode achieves no-data-loss in the event of a single failure (e.g. network failure, primary site failure . . .)&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt;*Maximum Performance—&lt;/span&gt;This mode offers slightly less data protection on the primary database, but higher performance than maximum availability mode. In this mode, as the primary database processes transactions, redo data is asynchronously shipped to the standby database. The commit operation of the primary database does not wait for the standby database to acknowledge receipt of redo data before completing write operations on the primary database. If any standby destination becomes unavailable, processing continues on the primary database and there is little effect on primary database performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4190840113911189464?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4190840113911189464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4190840113911189464' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4190840113911189464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4190840113911189464'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/data-guard-protection-modes.html' title='Data Guard Protection Modes'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8115476628732004597</id><published>2008-09-20T19:27:00.001-07:00</published><updated>2008-09-20T19:27:47.056-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Redo Apply and SQL Apply'/><title type='text'>Redo Apply and SQL Apply</title><content type='html'>Redo Apply and SQL Apply&lt;br /&gt;&lt;br /&gt;A standby database is initially created from a backup copy of the primary database. Once created, Data Guard automatically maintains the standby database as a synchronized copy of the primary database by transmitting primary database redo data to the standby system and then applying the redo data to the standby database.&lt;br /&gt;&lt;br /&gt;Data Guard provides two methods to apply this redo data to the standby database and keep it synchronized with the primary, and these methods correspond to the two types of standby databases supported by Data Guard.&lt;br /&gt;&lt;br /&gt;    * Redo Apply, used for physical standby databases&lt;br /&gt;    * SQL Apply, used for logical standby databases&lt;br /&gt;&lt;br /&gt;A physical standby database provides a physically identical copy of the primary database, with on-disk database structures that are identical to the primary database on a block-for-block basis. The database schema, including indexes, are the same. The Redo Apply technology applies redo data on the physical standby database using standard Oracle media recovery techniques. In addition to traditional Data Guard functionality, the Active Data Guard Option for Oracle Database 11g enables a physical standby database to be open read-only while it applies updates received from the primary database. This makes physical standby databases useful for offloading the primary database from the overhead of processing read-only queries and reports.  This also makes it simple to validate that the standby database is synchronized with the primary database at all times.&lt;br /&gt;&lt;br /&gt;A logical standby database contains the same logical information as the production database, although the physical organization and structure of the data can be different. The SQL apply technology keeps the logical standby database synchronized with the primary database by transforming redo data received from the primary database into SQL statements and then executing the SQL statements on the standby database. This makes it possible for the logical standby database to be open read-write and accessed for queries and reporting purposes at the same time the SQL is being applied to it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8115476628732004597?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8115476628732004597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8115476628732004597' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8115476628732004597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8115476628732004597'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/redo-apply-and-sql-apply.html' title='Redo Apply and SQL Apply'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8210632634919710066</id><published>2008-09-20T19:26:00.001-07:00</published><updated>2008-09-20T19:26:56.925-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Guard Benefits'/><title type='text'>Data Guard Benefits</title><content type='html'>Data Guard Benefits&lt;br /&gt;&lt;br /&gt;   1. Disaster recovery and high availability&lt;br /&gt;&lt;br /&gt;      Data Guard provides an efficient and comprehensive disaster recovery and high availability solution. Automatic failover and easy-to-manage switchover capabilities allow quick role reversals between primary and standby databases, minimizing the downtime of the primary database for planned and unplanned outages.&lt;br /&gt;&lt;br /&gt;   2. Complete data protection&lt;br /&gt;&lt;br /&gt;      A standby database also provides an effective safeguard against data corruptions and user errors. Storage level physical corruptions on the primary database do not propagate to the standby database. Similarly, logical corruptions or user errors that cause the primary database to be permanently damaged can be resolved. Finally, the redo data is validated at the time it is received at the standby database and further when applied to the standby database.&lt;br /&gt;&lt;br /&gt;   3. Efficient utilization of system resources&lt;br /&gt;&lt;br /&gt;      A physical standby database can be used for backups and read-only reporting, thereby reducing the primary database workload and saving valuable CPU and I/O cycles. A physical standby database can also be easily converted back and forth between being a physical standby database and an open read/write database, without compromising data protection. A logical standby database enables read-write access to a synchronized standby database, and/or adding local tables to the standby database that can also be updated, and/or creating additional indexes to optimize read performance.&lt;br /&gt;&lt;br /&gt;   4. Flexibility in data protection to balance availability against performance requirements&lt;br /&gt;&lt;br /&gt;      Oracle Data Guard offers the maximum protection, maximum availability, and maximum performance modes to help enterprises balance data availability against system performance requirements.&lt;br /&gt;&lt;br /&gt;   5. Protection from communication failures&lt;br /&gt;&lt;br /&gt;      If network connectivity is lost between the primary and one or more standby databases, redo data cannot be sent from the primary to those standby databases. Once connectivity is re-established, the missing redo data is automatically detected by Data Guard and the necessary archive logs are automatically transmitted to the standby databases. The standby databases are resynchronized with the primary database, with no manual intervention by the administrator. &lt;br /&gt;&lt;br /&gt;   6. Centralized and simple management&lt;br /&gt;&lt;br /&gt;      Data Guard Broker automates the management and monitoring tasks across the multiple databases in a Data Guard configuration. Administrators may use either Oracle Enterprise Manager or the Broker’s own specialized command-line interface (DGMGRL) to take advantage of this integrated management framework.&lt;br /&gt;&lt;br /&gt;   7. Integrated with Oracle database&lt;br /&gt;&lt;br /&gt;      Data Guard is available as an integrated feature of the Oracle Database (Enterprise Edition) at no extra cost.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8210632634919710066?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8210632634919710066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8210632634919710066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8210632634919710066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8210632634919710066'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/data-guard-benefits.html' title='Data Guard Benefits'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1888737953175182718</id><published>2008-09-20T19:24:00.000-07:00</published><updated>2008-09-20T19:25:01.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating a Nested Materialized View: Example'/><title type='text'>Creating a Nested Materialized View: Example</title><content type='html'>Creating a Nested Materialized View: Example&lt;br /&gt;&lt;br /&gt;The following example uses the materialized view from the preceding example as a master table to create a materialized view tailored for a particular sales representative in the sample oe schema:&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW my_warranty_orders&lt;br /&gt;   AS SELECT w.order_id, w.line_item_id, o.order_date&lt;br /&gt;   FROM warranty_orders w, orders o&lt;br /&gt;   WHERE o.order_id = o.order_id&lt;br /&gt;   AND o.sales_rep_id = 165;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1888737953175182718?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1888737953175182718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1888737953175182718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1888737953175182718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1888737953175182718'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-nested-materialized-view.html' title='Creating a Nested Materialized View: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7695971146092909542</id><published>2008-09-20T19:23:00.000-07:00</published><updated>2008-09-20T19:24:25.665-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating a Fast Refreshable Materialized View: Example'/><title type='text'>Creating a Fast Refreshable Materialized View: Example</title><content type='html'>Creating a Fast Refreshable Materialized View: Example&lt;br /&gt;&lt;br /&gt;The following statement creates a fast-refreshable materialized view that selects columns from the order_items table in the sample oe schema, using the UNION set operator to restrict the rows returned from the product_information and inventories tables using WHERE conditions. The materialized view logs for order_items and product_information were created in the "Examples " section of CREATE MATERIALIZED VIEW LOG. This example also requires a materialized view log on oe.inventories.&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW LOG ON inventories&lt;br /&gt;   WITH (quantity_on_hand);&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW warranty_orders REFRESH FAST AS&lt;br /&gt;  SELECT order_id, line_item_id, product_id FROM order_items o&lt;br /&gt;    WHERE EXISTS&lt;br /&gt;    (SELECT * FROM inventories i WHERE o.product_id = i.product_id&lt;br /&gt;      AND i.quantity_on_hand IS NOT NULL)&lt;br /&gt;  UNION&lt;br /&gt;    SELECT order_id, line_item_id, product_id FROM order_items&lt;br /&gt;    WHERE quantity &gt; 5; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This materialized view requires that materialized view logs be defined on order_items (with product_id as a join column) and on inventories (with quantity_on_hand as a filter column).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7695971146092909542?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7695971146092909542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7695971146092909542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7695971146092909542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7695971146092909542'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-fast-refreshable-materialized.html' title='Creating a Fast Refreshable Materialized View: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6635540394016530684</id><published>2008-09-20T19:22:00.000-07:00</published><updated>2008-09-20T19:23:02.497-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Automatic Refresh Times for Materialized Views: Example'/><title type='text'>Automatic Refresh Times for Materialized Views: Example</title><content type='html'>Automatic Refresh Times for Materialized Views: Example&lt;br /&gt;&lt;br /&gt;The following statement creates the complex materialized view all_customers that queries the employee tables on the remote and local databases:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;CREATE MATERIALIZED VIEW all_customers&lt;br /&gt;   PCTFREE 5 PCTUSED 60 &lt;br /&gt;   TABLESPACE example &lt;br /&gt;   STORAGE (INITIAL 50K NEXT 50K) &lt;br /&gt;   USING INDEX STORAGE (INITIAL 25K NEXT 25K)&lt;br /&gt;   REFRESH START WITH ROUND(SYSDATE + 1) + 11/24 &lt;br /&gt;   NEXT NEXT_DAY(TRUNC(SYSDATE), 'MONDAY') + 15/24 &lt;br /&gt;   AS SELECT * FROM sh.customers@remote &lt;br /&gt;         UNION&lt;br /&gt;      SELECT * FROM sh.customers@local; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Database automatically refreshes this materialized view tomorrow at 11:00 a.m. and subsequently every Monday at 3:00 p.m. The default refresh method is FORCE. The defining query contains a UNION operator, which is not supported for fast refresh, so the database will automatically perform a complete refresh.&lt;br /&gt;&lt;br /&gt;The preceding statement also establishes storage characteristics for both the materialized view and the index that the database uses to maintain it:&lt;br /&gt;&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt;*The first STORAGE clause establishes the sizes of the first and second extents of the materialized view as 50 kilobytes each.&lt;br /&gt;    *The second STORAGE clause, appearing with the USING INDEX clause, establishes the sizes of the first and second extents of the index as 25 kilobytes each.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6635540394016530684?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6635540394016530684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6635540394016530684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6635540394016530684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6635540394016530684'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/automatic-refresh-times-for.html' title='Automatic Refresh Times for Materialized Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-353040630269544083</id><published>2008-09-20T19:21:00.001-07:00</published><updated>2008-09-20T19:21:22.558-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Periodic Refresh of Materialized Views: Example'/><title type='text'>Periodic Refresh of Materialized Views: Example</title><content type='html'>Periodic Refresh of Materialized Views: Example&lt;br /&gt;&lt;br /&gt;The following statement creates the primary key materialized view emp_data and populates it with data from the sample table hr.employees:&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW LOG ON employees&lt;br /&gt;   WITH PRIMARY KEY&lt;br /&gt;   INCLUDING NEW VALUES;&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW emp_data &lt;br /&gt;   PCTFREE 5 PCTUSED 60 &lt;br /&gt;   TABLESPACE example &lt;br /&gt;   STORAGE (INITIAL 50K NEXT 50K)&lt;br /&gt;   REFRESH FAST NEXT sysdate + 7 &lt;br /&gt;   AS SELECT * FROM employees; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The statement does not include a START WITH parameter, so Oracle Database determines the first automatic refresh time by evaluating the NEXT value using the current SYSDATE. A materialized view log was created for the employee table, so Oracle Database performs a fast refresh of the materialized view every 7 days, beginning 7 days after the materialized view is created.&lt;br /&gt;&lt;br /&gt;Because the materialized view conforms to the conditions for fast refresh, the database will perform a fast refresh. The preceding statement also establishes storage characteristics that the database uses to maintain the materialized view.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-353040630269544083?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/353040630269544083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=353040630269544083' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/353040630269544083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/353040630269544083'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/periodic-refresh-of-materialized-views.html' title='Periodic Refresh of Materialized Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5814029582305287475</id><published>2008-09-20T19:20:00.001-07:00</published><updated>2008-09-20T19:20:33.195-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating Rowid Materialized Views: Example'/><title type='text'>Creating Rowid Materialized Views: Example</title><content type='html'>Creating Rowid Materialized Views: Example&lt;br /&gt;&lt;br /&gt;The following statement creates a rowid materialized view on the sample table oe.orders:&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW order_data REFRESH WITH ROWID &lt;br /&gt;   AS SELECT * FROM orders;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5814029582305287475?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5814029582305287475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5814029582305287475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5814029582305287475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5814029582305287475'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-rowid-materialized-views.html' title='Creating Rowid Materialized Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4943262624476194171</id><published>2008-09-20T19:19:00.002-07:00</published><updated>2008-09-20T19:20:05.390-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating Primary Key Materialized Views: Example'/><title type='text'>Creating Primary Key Materialized Views: Example</title><content type='html'>Creating Primary Key Materialized Views: Example&lt;br /&gt;&lt;br /&gt;The following statement creates the primary key materialized view catalog on the sample table oe.product_information:&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW catalog   &lt;br /&gt;   REFRESH FAST START WITH SYSDATE NEXT  SYSDATE + 1/4096 &lt;br /&gt;   WITH PRIMARY KEY &lt;br /&gt;   AS SELECT * FROM product_information;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4943262624476194171?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4943262624476194171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4943262624476194171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4943262624476194171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4943262624476194171'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-primary-key-materialized-views.html' title='Creating Primary Key Materialized Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6227496555040785997</id><published>2008-09-20T19:19:00.001-07:00</published><updated>2008-09-20T19:19:24.084-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating Subquery Materialized Views: Example'/><title type='text'>Creating Subquery Materialized Views: Example</title><content type='html'>Creating Subquery Materialized Views: Example&lt;br /&gt;&lt;br /&gt;The following statement creates a subquery materialized view based on the customers and countries tables in the sh schema at the remote database:&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW foreign_customers FOR UPDATE&lt;br /&gt;   AS SELECT * FROM sh.customers@remote cu&lt;br /&gt;   WHERE EXISTS&lt;br /&gt;     (SELECT * FROM sh.countries@remote co&lt;br /&gt;      WHERE co.country_id = cu.country_id);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6227496555040785997?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6227496555040785997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6227496555040785997' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6227496555040785997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6227496555040785997'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-subquery-materialized-views.html' title='Creating Subquery Materialized Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7987451617131881754</id><published>2008-09-20T19:18:00.003-07:00</published><updated>2008-09-20T19:18:55.929-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating Prebuilt Materialized Views: Example'/><title type='text'>Creating Prebuilt Materialized Views: Example</title><content type='html'>Creating Prebuilt Materialized Views: Example&lt;br /&gt;&lt;br /&gt;The following statement creates a materialized aggregate view for the preexisting summary table, sales_sum_table:&lt;br /&gt;&lt;br /&gt;CREATE TABLE sales_sum_table&lt;br /&gt;   (month VARCHAR2(8), state VARCHAR2(40), sales NUMBER(10,2));&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW sales_sum_table&lt;br /&gt;   ON PREBUILT TABLE WITH REDUCED PRECISION&lt;br /&gt;   ENABLE QUERY REWRITE&lt;br /&gt;   AS SELECT t.calendar_month_desc AS month, &lt;br /&gt;             c.cust_state_province AS state,&lt;br /&gt;             SUM(s.amount_sold) AS sales&lt;br /&gt;      FROM times t, customers c, sales s&lt;br /&gt;      WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id&lt;br /&gt;      GROUP BY t.calendar_month_desc, c.cust_state_province;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this example, the materialized view has the same name and also has the same number of columns with the same datatypes as the prebuilt table. The WITH REDUCED PRECISION clause allows for differences between the precision of the materialized view columns and the precision of the values returned by the subquery.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7987451617131881754?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7987451617131881754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7987451617131881754' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7987451617131881754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7987451617131881754'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-prebuilt-materialized-views.html' title='Creating Prebuilt Materialized Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5241269105322034533</id><published>2008-09-20T19:18:00.001-07:00</published><updated>2008-09-20T19:18:23.633-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating Materialized Join Views: Example'/><title type='text'>Creating Materialized Join Views: Example</title><content type='html'>Creating Materialized Join Views: Example&lt;br /&gt;&lt;br /&gt;The following statement creates and populates the materialized aggregate view sales_by_month_by_state using tables in the sample sh schema. The materialized view will be populated with data as soon as the statement executes successfully. By default, subsequent refreshes will be accomplished by reexecuting the defining query of the materialized view:&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW sales_by_month_by_state&lt;br /&gt;     TABLESPACE example&lt;br /&gt;     PARALLEL 4&lt;br /&gt;     BUILD IMMEDIATE&lt;br /&gt;     REFRESH COMPLETE&lt;br /&gt;     ENABLE QUERY REWRITE&lt;br /&gt;     AS SELECT t.calendar_month_desc, c.cust_state_province,&lt;br /&gt;        SUM(s.amount_sold) AS sum_sales&lt;br /&gt;        FROM times t, sales s, customers c&lt;br /&gt;        WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id&lt;br /&gt;        GROUP BY t.calendar_month_desc, c.cust_state_province;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5241269105322034533?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5241269105322034533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5241269105322034533' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5241269105322034533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5241269105322034533'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-materialized-join-views.html' title='Creating Materialized Join Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1075841429350374269</id><published>2008-09-20T19:17:00.001-07:00</published><updated>2008-09-20T19:17:48.763-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Creating Materialized Aggregate Views: Example'/><title type='text'>Creating Materialized Aggregate Views: Example</title><content type='html'>The following statement creates and populates a materialized aggregate view on the sample sh.sales table and specifies the default refresh method, mode, and time. It uses the materialized view log created in "Creating a Materialized View Log: Examples", as well as the two additional logs shown here:&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW LOG ON times&lt;br /&gt;   WITH ROWID, SEQUENCE (time_id, calendar_year)&lt;br /&gt;   INCLUDING NEW VALUES;&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW LOG ON products&lt;br /&gt;   WITH ROWID, SEQUENCE (prod_id)&lt;br /&gt;   INCLUDING NEW VALUES;&lt;br /&gt;&lt;br /&gt;CREATE MATERIALIZED VIEW sales_mv&lt;br /&gt;   BUILD IMMEDIATE&lt;br /&gt;   REFRESH FAST ON COMMIT&lt;br /&gt;   AS SELECT t.calendar_year, p.prod_id, &lt;br /&gt;      SUM(s.amount_sold) AS sum_sales&lt;br /&gt;      FROM times t, products p, sales s&lt;br /&gt;      WHERE t.time_id = s.time_id AND p.prod_id = s.prod_id&lt;br /&gt;      GROUP BY t.calendar_year, p.prod_id;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1075841429350374269?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1075841429350374269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1075841429350374269' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1075841429350374269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1075841429350374269'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/creating-materialized-aggregate-views.html' title='Creating Materialized Aggregate Views: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3280719926633585420</id><published>2008-09-20T19:11:00.000-07:00</published><updated>2008-09-20T19:13:06.051-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Privilages to create a refresh-on-commit materialized view'/><title type='text'>Privilages to create a refresh-on-commit materialized view</title><content type='html'>To create a refresh-on-commit materialized view (ON COMMIT REFRESH clause), in addition to the preceding privileges, you must have the ON COMMIT REFRESH object privilege on any master tables that you do not own or you must have the ON COMMIT REFRESH system privilege.&lt;br /&gt;&lt;br /&gt;To create the materialized view with query rewrite enabled, in addition to the preceding privileges:&lt;br /&gt;&lt;br /&gt;    *If the schema owner does not own the master tables, then the schema owner must have the GLOBAL QUERY REWRITE privilege or the QUERY REWRITE object privilege on each table outside the schema.&lt;br /&gt;    *If you are defining the materialized view on a prebuilt container (ON PREBUILT TABLE clause), then you must have the SELECT privilege WITH GRANT OPTION on the container table.&lt;br /&gt;&lt;br /&gt;The user whose schema contains the materialized view must have sufficient quota in the target tablespace to store the master table and index of the materialized view or must have the UNLIMITED TABLESPACE system privilege.&lt;br /&gt;&lt;br /&gt;When you create a materialized view, Oracle Database creates one internal table and at least one index, and may create one view, all in the schema of the materialized view. Oracle Database uses these objects to maintain the materialized view data. You must have the privileges necessary to create these objects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3280719926633585420?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3280719926633585420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3280719926633585420' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3280719926633585420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3280719926633585420'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/privilages-to-create-refresh-on-commit.html' title='Privilages to create a refresh-on-commit materialized view'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8572110985865450233</id><published>2008-09-20T19:10:00.000-07:00</published><updated>2008-09-20T19:11:13.612-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Privilages to create a materialized view in another user&apos;s schema'/><title type='text'>Privilages to create a materialized view in another user's schema</title><content type='html'>To create a materialized view in another user's schema:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;    *You must have the CREATE ANY MATERIALIZED VIEW system privilege.&lt;/span&gt;&lt;br /&gt;    &lt;span style="font-weight:bold;"&gt;*The owner of the materialized view must have the CREATE TABLE system privilege. The owner must also have access to any master tables of the materialized view that the schema owner does not own (for example, if the master tables are on a remote database) and to any materialized view logs defined on those master tables, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8572110985865450233?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8572110985865450233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8572110985865450233' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8572110985865450233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8572110985865450233'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/privilages-to-create-materialized-view.html' title='Privilages to create a materialized view in another user&apos;s schema'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7145751087841840055</id><published>2008-09-20T19:07:00.000-07:00</published><updated>2008-09-20T19:09:43.892-07:00</updated><title type='text'>What Privilages required to create a materialized view?</title><content type='html'>&lt;span style="font-weight:bold;"&gt;The privileges required to create a materialized view should be granted directly rather than through a role.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To create a materialized view in your own schema:&lt;br /&gt;&lt;br /&gt;    *You must have been granted the CREATE MATERIALIZED VIEW system privilege and either the CREATE TABLE or CREATE ANY TABLE system privilege.&lt;br /&gt;    *You must also have access to any master tables of the materialized view that you do not own, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7145751087841840055?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7145751087841840055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7145751087841840055' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7145751087841840055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7145751087841840055'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-rivilagees-required-to-create.html' title='What Privilages required to create a materialized view?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7897781582817363352</id><published>2008-09-20T19:05:00.000-07:00</published><updated>2008-09-20T19:07:14.096-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is materialized view?'/><title type='text'>What is materialized view?</title><content type='html'>A materialized view is a database object that contains the results of a query. The FROM clause of the query can name tables, views, and other materialized views. Collectively these objects are called master tables (a replication term) or detail tables (a data warehousing term). &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The keyword SNAPSHOT is supported in place of MATERIALIZED VIEW for backward compatibility.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7897781582817363352?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7897781582817363352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7897781582817363352' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7897781582817363352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7897781582817363352'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-materialized-view.html' title='What is materialized view?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7503331617024110027</id><published>2008-09-20T18:57:00.000-07:00</published><updated>2008-09-20T19:03:11.859-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is Optimizer Plan Stability?'/><title type='text'>What is Optimizer Plan Stability?</title><content type='html'>Plan stability prevents certain database environment changes from affecting the performance characteristics of applications. Such changes include changes in optimizer statistics, changes to the optimizer mode settings, and changes to parameters affecting the sizes of memory structures, such as SORT_AREA_SIZE and BITMAP_MERGE_AREA_SIZE. Plan stability is most useful when you cannot risk any performance changes in an application.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Plan stability preserves execution plans in stored outlines. An outline is implemented as a set of optimizer hints that are associated with the SQL statement. If the use of the outline is enabled for the statement, Oracle automatically considers the stored hints and tries to generate an execution plan in accordance with those hints.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Oracle can create a public or private stored outline for one or all SQL statements. The optimizer then generates equivalent execution plans from the outlines when you enable the use of stored outlines. You can group outlines into categories and control which category of outlines Oracle uses to simplify outline administration and deployment.&lt;br /&gt;&lt;br /&gt;The plans Oracle maintains in stored outlines remain consistent despite changes to a system's configuration or statistics. Using stored outlines also stabilizes the generated execution plan if the optimizer changes in subsequent Oracle releases.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;This utility has several features:&lt;br /&gt;&lt;br /&gt;SQL parsing and execution time is reduced because Oracle will quickly grab and execute the stored outline for the SQL.&lt;br /&gt;&lt;br /&gt;Tuning of SQL statements can easily be made permanent without locating the source code.&lt;br /&gt;&lt;br /&gt;SQL from third-party products (e.g., SAP, Peoplesoft) can be tuned without touching the SQL source code.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Optimizer plan stability enables you to maintain the same execution plans for the same SQL statements, regardless of changes to the database.  Without optimizer plan stability, any of the following database changes may alter the execution plan for every SQL statement on your system:&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;&lt;br /&gt;1 – Re-analyzing tables&lt;br /&gt;2 - Adding or deleting data from tables&lt;br /&gt;3 - Modifying a table's columns, constraints, or indexes&lt;br /&gt;4 - Changing the system configuration&lt;br /&gt;5 - Upgrading to a new version of the optimizer.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7503331617024110027?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7503331617024110027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7503331617024110027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7503331617024110027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7503331617024110027'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-optimizer-plan-stability.html' title='What is Optimizer Plan Stability?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-2299267220016764326</id><published>2008-09-20T18:45:00.000-07:00</published><updated>2008-09-20T18:54:25.069-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBMS_ADVISOR Package'/><title type='text'>DBMS_ADVISOR Package</title><content type='html'>The DBMS_ADVISOR package is new to Oracle 10g. It is used to provide the PL/SQL application programming interface (API), which manages all the advisors. The DBMS_ADVISOR package is also used to create and execute any advisor tasks, including SQL Access Advisor tasks. There are many procedures available for the package, as given below:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Procedure name Description&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;CREATE_TASK Creates a new advisor task in the repository.&lt;br /&gt;SET_TASK_PARAMETER Modifies a user parameter within a task (a task can only be modified if it is in the initial state).&lt;br /&gt;EXECUTE_TASK Executes the specified task (analysis task in the asked case).&lt;br /&gt;GET_TASK_REPORT Creates and returns an XML report for the specified task.&lt;br /&gt;DELETE_TASK Deletes the specified advisor task.&lt;br /&gt;CANCEL_TASK Cancels a currently executing task.&lt;br /&gt;INTERRUPT_TASK Stops the currently executing task, with normal exit.&lt;br /&gt;RESUME_TASK Resumes an interrupted task.&lt;br /&gt;RESET_TASK Resets a task to its original state.&lt;br /&gt;UPDATE_TASK_ATTRIBUTES Changes various attributes of a task.&lt;br /&gt;MARK_RECOMMENDATION Accepts, rejects, or ignores a recommendation.&lt;br /&gt;GET_TASK_SCRIPT Creates a SQL*Plus-compatible SQL script of all the recommendations that are accepted from a specified task.&lt;br /&gt;CREATE_FILE Creates an external file from a PL/SQL CLOB variable, used for creating scripts and reports.&lt;br /&gt;QUICK_TIME Analyzes and generates recommendations for a single SQL statement.&lt;span style="font-style:italic;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; Oracle10g introduced several intelligent utilities that produce performance tuning advices and suggestions based on historical data stored in the AWR. These utilities are called advisors. The dbms_advisor package provides PL/SQL API to access the following advisors:&lt;br /&gt;&lt;br /&gt;The Automatic Database Diagnostic Monitor (ADDM) provides Oracle DBAs with performance data gathered by the AWR.  The ADDM also identifies root causes of performance bottlenecks and generates a report containing recommendations or findings on how to improve database performance.&lt;br /&gt;&lt;br /&gt;The SQLAccess Advisor provides analysis and recommendations about indexes and materialized views   which may improve system performance.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Summary of DBMS_ADVISOR Subprograms&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Subprogram  &lt;br /&gt;Description  &lt;br /&gt;Used in&lt;br /&gt;&lt;br /&gt;ADD_SQLWKLD_REF Procedure&lt;br /&gt;Adds a workload reference to an Advisor task&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ADD_SQLWKLD_STATEMENT Procedure&lt;br /&gt;Adds a single statement to a workload&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;ADD_STS_REF Procedure&lt;br /&gt;Establishes a link between the current SQL Access Advisor task and a SQL Tuning Set&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;CANCEL_TASK Procedure&lt;br /&gt;Cancels a currently executing task operation&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;COPY_SQLWKLD_TO_STS Procedure&lt;br /&gt;Copies the contents of a SQL workload object to a SQL Tuning Set&lt;br /&gt;SQL Access Advisor&lt;br /&gt;&lt;br /&gt;CREATE_FILE Procedure&lt;br /&gt;Creates an external file from a PL/SQL CLOB variable, which is useful for creating scripts and reports&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;CREATE_OBJECT Procedure&lt;br /&gt;Creates a new task object&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;CREATE_SQLWKLD Procedure&lt;br /&gt;Creates a new workload object&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;CREATE_TASK Procedures&lt;br /&gt;Creates a new Advisor task in the repository&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;DELETE_SQLWKLD Procedure&lt;br /&gt;Deletes an entire workload object&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;DELETE_SQLWKLD_REF Procedure&lt;br /&gt;Deletes an entire workload object&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;DELETE_SQLWKLD_STATEMENT Procedures&lt;br /&gt;Deletes one or more statements from a workload&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;DELETE_STS_REF Procedure&lt;br /&gt;Removes a link between the current SQL Access Advisor task and a SQL Tuning Set object&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;DELETE_TASK Procedure&lt;br /&gt;Deletes the specified task from the repository&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;EXECUTE_TASK Procedure&lt;br /&gt;Executes the specified task&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;GET_REC_ATTRIBUTES Procedure&lt;br /&gt;Retrieves specific recommendation attributes from a task&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;GET_TASK_REPORT Function&lt;br /&gt;Creates and returns a report for the specified task&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;GET_TASK_SCRIPT Function&lt;br /&gt;Creates and returns an executable SQL script of the Advisor task's recommendations in a buffer&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;IMPLEMENT_TASK Procedure&lt;br /&gt;Implements the recommendations for a task&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;IMPORT_SQLWKLD_SCHEMA Procedure&lt;br /&gt;Imports data into a workload from the current SQL cache&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;IMPORT_SQLWKLD_SQLCACHE Procedure&lt;br /&gt;Imports data into a workload from the current SQL cache&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;IMPORT_SQLWKLD_STS Procedure&lt;br /&gt;Imports data into a workload from a SQL Tuning Set into a SQL workload data object&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;IMPORT_SQLWKLD_SUMADV Procedure&lt;br /&gt;Imports data into a workload from the current SQL cache&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;IMPORT_SQLWKLD_USER Procedure&lt;br /&gt;Imports data into a workload from the current SQL cache&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;INTERRUPT_TASK Procedure&lt;br /&gt;Stops a currently executing task, ending its operations as it would at a normal exit, so that the recommendations are visible&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;MARK_RECOMMENDATION Procedure&lt;br /&gt;Sets the annotation_status for a particular recommendation&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;QUICK_TUNE Procedure&lt;br /&gt;Performs an analysis on a single SQL statement&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;RESET_TASK Procedure&lt;br /&gt;Resets a task to its initial state&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;SET_DEFAULT_SQLWKLD_PARAMETER Procedures&lt;br /&gt;Imports data into a workload from schema evidence&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;SET_DEFAULT_TASK_PARAMETER Procedures&lt;br /&gt;Modifies a default task parameter&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;SET_SQLWKLD_PARAMETER Procedures&lt;br /&gt;Sets the value of a workload parameter&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;SET_TASK_PARAMETER Procedure&lt;br /&gt;Sets the specified task parameter value&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;TUNE_MVIEW Procedure&lt;br /&gt;Shows how to decompose a materialized view into two or more materialized views or to restate the materialized view in a way that is more advantageous for fast refresh and query rewrite&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;UPDATE_OBJECT Procedure&lt;br /&gt;Updates a task object&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;UPDATE_REC_ATTRIBUTES Procedure&lt;br /&gt;Updates an existing recommendation for the specified task&lt;br /&gt;All Advisors&lt;br /&gt;&lt;br /&gt;UPDATE_SQLWKLD_ATTRIBUTES Procedure&lt;br /&gt;Updates a workload object&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;UPDATE_SQLWKLD_STATEMENT Procedure&lt;br /&gt;Updates one or more SQL statements in a workload&lt;br /&gt;SQL Access Advisor only&lt;br /&gt;&lt;br /&gt;UPDATE_TASK_ATTRIBUTES Procedure&lt;br /&gt;Updates a task's attributes&lt;br /&gt;All Advisors&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-2299267220016764326?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/2299267220016764326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=2299267220016764326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2299267220016764326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2299267220016764326'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/dbmsadvisor-package.html' title='DBMS_ADVISOR Package'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-682119461750365184</id><published>2008-09-20T18:36:00.000-07:00</published><updated>2008-09-20T18:40:53.126-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is Bigfile tablespace? why do we create it? what is the advantage of using it?'/><title type='text'>What is Bigfile tablespace? why do we create it? what is the advantage of using it?</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Bigfile Tablespaces&lt;/span&gt;&lt;br /&gt;Bigfile tablespaces are tablespaces with a single large datafile. In contrast normal (smallfile) tablespaces can have several datafiles, but each is limited in size. The benefits of bigfile tablespaces are:&lt;br /&gt;&lt;br /&gt;Creating Bigfile tables space&lt;br /&gt;&lt;br /&gt;-- Valid statement.&lt;br /&gt;CREATE BIGFILE TABLESPACE mybigtbs &lt;br /&gt;  DATAFILE '/u01/oracle/MYSID/mybigtbs01.dbf' SIZE 100G;&lt;br /&gt;&lt;br /&gt;-- Valid statement.&lt;br /&gt;CREATE BIGFILE TABLESPACE mybigtbs &lt;br /&gt;  DATAFILE '/u01/oracle/MYSID/mybigtbs01.dbf' SIZE 100G&lt;br /&gt;  EXTENT MANAGEMENT LOCAL&lt;br /&gt;  SEGMENT SPACE MANAGEMENT AUTO;&lt;br /&gt;  &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;-- invalid statement.&lt;br /&gt;CREATE BIGFILE TABLESPACE mybigtbs &lt;br /&gt;  DATAFILE '/u01/oracle/MYSID/mybigtbs01.dbf' SIZE 100G&lt;br /&gt;  EXTENT MANAGEMENT DICTIONARY&lt;br /&gt;  SEGMENT SPACE MANAGEMENT MANUAL;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    * An Oracle database can have a maximum of 64,000 datafiles which limits its total capacity. By allowing tablespaces to have a single large datafile the total capacity of the database is increased. A bigfile tablespace with 8K and 32K blocks can contain 32 terabyte and 128 terabyte datafiles respectively.&lt;br /&gt;    * Using fewer larger datafiles allows the DB_FILES and MAXDATAFILES parameters to be reduced, saving SGA and controlfile space.&lt;br /&gt;    * The ALTER TABLESPACE syntax has been updated to allow operations at the tablespace level, rather than datafile level.&lt;br /&gt;&lt;br /&gt;Typically bigfile tablespaces must be locally managed with automatic segment-space management. Exceptions to this rule include temporary tablespaces, the SYSTEM tablespace and locally managed undo tablespaces which are all allowed to have manual segment-space management.&lt;br /&gt;&lt;br /&gt;Bigfile tablespaces are create using the CREATE BIGFILE TABLESPACE command. The first two of the following statements have the same affect as the EXTENT MANAGEMENT LOCAL and SEGMENT SPACE MANAGEMENT AUTO clauses are the default actions, while the last statement would error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-682119461750365184?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/682119461750365184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=682119461750365184' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/682119461750365184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/682119461750365184'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-bigfile-tablespave-why-do-we.html' title='What is Bigfile tablespace? why do we create it? what is the advantage of using it?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1002898541465330614</id><published>2008-09-20T18:33:00.001-07:00</published><updated>2008-09-20T18:33:47.817-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reverting a Table to its Previous Statistics'/><title type='text'>Reverting a Table to its Previous Statistics</title><content type='html'>Reverting a Table to its Previous Statistics&lt;br /&gt;&lt;br /&gt;Usually, re-analyzing a schema and specifying a high percentage of rows for the sample size will improve performance. Unfortunately, the occasional hiccup will occur when you re-analyze tables. Sometimes the new statistics produce much worse execution plans than before. You can avoid the risk of a major screw up by using the DBMS_STATS package to save a copy of your current statistics just in case you need to restore them later. This requires the following steps:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step 1.&lt;/span&gt;&lt;br /&gt;Export your schema statistics to your statistics table. If you don’t already have a statistics table, you can create it using the DBMS_STATS.CREATE_STATS_TABLE procedure. The export is performed as follows:&lt;br /&gt;&lt;br /&gt;EXECUTE SYS.DBMS_STATS.EXPORT_SCHEMA_STATS (OWNNAME=&gt;'STRINIX', STATTAB=&gt; 'PAR_STAT_TABLE', STATID=&gt;'STAT_12DEC_2007');&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Step 2.&lt;/span&gt; Gather your new statistics:&lt;br /&gt;&lt;br /&gt;EXECUTE SYS.DBMS_STATS.GATHER_SCHEMA_STATS (OWNNAME=&gt;'STRINIX', ESTIMATE_PERCENT=&gt;10, DEGREE=&gt;4, CASCADE=&gt;TRUE);&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Step 3.&lt;/span&gt; If there are problems with unsuitable execution paths being selected as a result of the new statistics, revert back to the previous statistics by loading the previous statistics from the statistics table:&lt;br /&gt;&lt;br /&gt;EXECUTE SYS.DBMS_STATS.IMPORT_SCHEMA_STATS (OWNNAME=&gt;'HROA', STATTAB=&gt;'HROA_STAT_TABLE', STATID=&gt;'START_12DEC_2007');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1002898541465330614?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1002898541465330614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1002898541465330614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1002898541465330614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1002898541465330614'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/reverting-table-to-its-previous.html' title='Reverting a Table to its Previous Statistics'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3469976811481216880</id><published>2008-09-20T18:32:00.001-07:00</published><updated>2008-09-20T18:32:48.119-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Manipulating Statistics Using DBMS_STATS'/><title type='text'>Manipulating Statistics Using DBMS_STATS</title><content type='html'>Manipulating Statistics Using DBMS_STATS&lt;br /&gt;&lt;br /&gt;You can modify the individual statistic elements on a table. Perhaps this be mightbe useful where in if you want to replicate the table stats in development similar to that of production or replicate the table stats in production similar to that of development.&lt;br /&gt;&lt;br /&gt; You can achieve this by using DBMS_STATS.SET_TABLE_STATS to modify the statistics for a table in your development or for a test database to match those in your production database. The optimizer uses the number of rows, number of blocks, and number of distinct values for a column to determine whether an index or a full table scan should be used.&lt;br /&gt;&lt;br /&gt;The following example assumes that your symb_history table is going to have 20,00,567 rows in 9,000 blocks:&lt;br /&gt;&lt;br /&gt;EXECUTE SYS.DBMS_STATS.SET_TABLE_STATS (OWNNAME=&gt;'STRINIX_TEST', TABNAME=&gt;'SYMB_HISTORY', NUMROWS=&gt; 2000567, NUMBLKS=&gt; 9000);&lt;br /&gt;&lt;br /&gt;Regardless of how many rows you really have in your test database for the table SYMB_HISTORY, the cost-based optimizer will now behave as if there were 20,00,567.&lt;br /&gt;&lt;br /&gt;The optimizer also uses the number of distinct values for each column to decide on index usage. If the number of distinct values is less than 10% of the number of rows in the table, the optimizer will usually decide to perform a full table scan in preference to using an index on the table column. Change the percentage of distinct values for a column as follows:&lt;br /&gt;&lt;br /&gt;EXECUTE SYS.DBMS_STATS.SET_COLUMN_STATS (OWNNAME=&gt;'STRINIX_TEST', TABNAME=&gt;'COMP_SCRIP_MAP',COLNAME=&gt;'SYMBOL', DISTCNT=&gt;400);javascript:void(0)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3469976811481216880?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3469976811481216880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3469976811481216880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3469976811481216880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3469976811481216880'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/manipulating-statistics-using-dbmsstats.html' title='Manipulating Statistics Using DBMS_STATS'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3496673398914652769</id><published>2008-09-20T18:31:00.001-07:00</published><updated>2008-09-20T18:31:48.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Copying Statistics Using DBMS_STATS'/><title type='text'>Copying Statistics Using DBMS_STATS</title><content type='html'>Copying Statistics Using DBMS_STATS&lt;br /&gt;&lt;br /&gt;DBMS_STATS package provides you the ability to copy statistics from one schema to another, or from one oracle database to another Oracle database, using the following procedure: &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step1:&lt;/span&gt;&lt;br /&gt;First save the statistics to a table. Create a table to store the statistics, DBMS_STATS.CREATE_STATS_TABLE can be used to create a new table in your own schema to store the statistics of tables and indexes.&lt;br /&gt;&lt;br /&gt;EXECUTE DBMS_STATS.CREATE_STATS_TABLE (OWNNAME=&gt;'STRINIX', STATTAB=&gt;'PAR_STAT_TAB');&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step 2.&lt;/span&gt; Populate the table with the statistics from the schema that you are copying from:&lt;br /&gt;&lt;br /&gt;EXECUTE SYS.DBMS_STATS.EXPORT_SCHEMA_STATS (OWNNAME=&gt;'STRINIX', STATTAB=&gt;'PAR_STAT_TAB', STATID=&gt; 'STAT_19DEC_2007');&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step 3.&lt;/span&gt; If you are copying statistics to a different database, such as from production to development, export and import that statistics table as required:&lt;br /&gt;&lt;br /&gt;exp strinix/baba@prod file=stats tables=PAR_stat_tab&lt;br /&gt;imp strinix/babat@dev file=stats tables=PAR_stat_tab&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Step 4.&lt;/span&gt; Populate the statistics in the target schema’s dictionary. Below example show you that statistics are being loaded for the schema STRINIX_TEST from the table named PAT_STAT_TAB:&lt;br /&gt;&lt;br /&gt;EXECUTE SYS.DBMS_STATS.IMPORT_SCHEMA_STATS (OWNNAME=&gt;'STRINIX_TEST', STATTAB=&gt;'PAR_STAT_TAB', STATID=&gt;'STAT_19DEC_2007', STATOWN=&gt; 'STRINIX');&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3496673398914652769?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3496673398914652769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3496673398914652769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3496673398914652769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3496673398914652769'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/copying-statistics-using-dbmsstats.html' title='Copying Statistics Using DBMS_STATS'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-34971398719345724</id><published>2008-09-20T18:28:00.000-07:00</published><updated>2008-09-20T18:30:39.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Gathering statistics with DBMS_STAT Package'/><title type='text'>Gathering statistics with DBMS_STAT Package</title><content type='html'>DBMS_STATS to Manage Statistics&lt;br /&gt;&lt;br /&gt;DBMS_STATS package  provides critical functionality for the cost-based optimizer, including  the analyzing process extended to PL/SQL programs, allowing statistics to be modified, reverting back to previous statistics, and copying statistics from one schema (or database) to another.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;By USING DBMS_STATS package you can&lt;br /&gt;&lt;br /&gt;    * You can collects statistics on tables and Indexes&lt;br /&gt;    * Modify Statistics on tables.&lt;br /&gt;    * Save statitstics at a certain point of time&lt;br /&gt;    * Revert back statistics to the Previously saved statistics.&lt;br /&gt;    * Copy Statistics from One Schema to another Schema.&lt;br /&gt;    * Import statistics from one database to another&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-34971398719345724?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/34971398719345724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=34971398719345724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/34971398719345724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/34971398719345724'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/gathering-statistics-with-dbmsstat.html' title='Gathering statistics with DBMS_STAT Package'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1644435846725665341</id><published>2008-09-20T18:17:00.001-07:00</published><updated>2008-09-20T18:17:57.951-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Handling Errors During Backups: Example'/><title type='text'>Handling Errors During Backups: Example</title><content type='html'>Handling Errors During Backups: Example&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;By default a checksum is calculated for every block read from a datafile and stored in the backup or image copy. If you use the NOCHECKSUM option, then checksums are not calculated. If the block already contains a checksum, however, then the checksum is validated and stored in the backup. If the validation fails, then the block is marked corrupt in the backup.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The SET MAXCORRUPT FOR DATAFILE command sets how many corrupt blocks in a datafile that BACKUP will tolerate. If a datafile has more corrupt blocks than specified by the MAXCORRUPT parameter, the command terminates. If you specify the CHECK LOGICAL option, RMAN checks for logical and physical corruption.&lt;br /&gt;&lt;br /&gt;By default, the BACKUP command terminates when it cannot access a datafile. You can specify parameters to prevent termination, as listed in the following table.&lt;br /&gt;If you specify the option ...  Then RMAN skips...&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;SKIP INACCESSIBLE&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Inaccessible datafiles. A datafile is only considered inaccessible if it cannot be read. Some offline datafiles can still be read because they exist on disk. Others have been deleted or moved and so cannot be read, making them inaccessible.&lt;br /&gt;&lt;br /&gt;SKIP OFFLINE&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Offline datafiles.&lt;br /&gt;&lt;br /&gt;SKIP READONLY&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;Datafiles in read-only tablespaces.&lt;br /&gt;&lt;br /&gt;The following example uses an automatic channel to back up the database, and sets the corruption level for the datafile in the SYSTEM tablespace so that up to 10 errors will be accepted:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;RMAN&gt; RUN&lt;br /&gt;{&lt;br /&gt;  SET MAXCORRUPT FOR DATAFILE 1 TO 10;&lt;br /&gt;  BACKUP DATABASE&lt;br /&gt;    SKIP INACCESSIBLE&lt;br /&gt;    SKIP READONLY&lt;br /&gt;    SKIP OFFLINE; &lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1644435846725665341?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1644435846725665341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1644435846725665341' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1644435846725665341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1644435846725665341'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/handling-errors-during-backups-example.html' title='Handling Errors During Backups: Example'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-230877878123047536</id><published>2008-09-20T18:11:00.000-07:00</published><updated>2008-09-20T18:14:35.312-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Backup Validation with RMAN'/><title type='text'>Backup Validation with RMAN</title><content type='html'>Backup Validation with RMAN&lt;br /&gt;&lt;br /&gt;You can run the BACKUP ... VALIDATE command to check datafiles for physical and logical corruption, or to confirm that all database files exist in the correct locations. No backup is taken, but all specified files are scanned to verify that they can be backed up. Here is an example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;BACKUP VALIDATE DATABASE ARCHIVELOG ALL;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You cannot use the MAXCORRUPT or PROXY parameters with the VALIDATE option.&lt;br /&gt;&lt;br /&gt;You can use the VALIDATE keyword of the BACKUP command to do the following:&lt;br /&gt;&lt;br /&gt;    * Check datafiles for physical and logical corruption&lt;br /&gt;    * Confirm that all database files exist and are in the correct locations&lt;br /&gt;&lt;br /&gt;RMAN does not actually produce backup sets, but rather reads the specified files in their entirety, to determine whether they can be backed up and are not corrupted. In this sense, the BACKUP VALIDATE command is similar to the RESTORE VALIDATE command, except for backups rather than restore jobs.&lt;br /&gt;&lt;br /&gt;If the backup validation discovers corrupt blocks, then RMAN updates the V$DATABASE_BLOCK_CORRUPTION view with rows describing the corruptions. After a corrupt block is repaired, the row identifying this block is deleted from the view.&lt;br /&gt;&lt;br /&gt;For example, you can validate that all database files and archived redo logs can be backed up by running a command as follows:&lt;br /&gt;&lt;br /&gt;RMAN&gt; BACKUP VALIDATE DATABASE ARCHIVELOG ALL;&lt;br /&gt;&lt;br /&gt;This form of the command would check for physical corruption. To check for logical corruption,&lt;br /&gt;&lt;br /&gt;RMAN&gt; BACKUP VALIDATE CHECK LOGICAL DATABASE ARCHIVELOG ALL;&lt;br /&gt;&lt;br /&gt;RMAN displays the same output that it would if it were really backing up the files. If RMAN cannot validate the backup of one or more of the files, then it displays an error message. For example, RMAN may show output similar to the following:&lt;br /&gt;&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-03002: failure of backup command at 08/29/2001 14:33:47&lt;br /&gt;ORA-19625: error identifying file /oracle/oradata/trgt/arch/archive1_6.dbf&lt;br /&gt;ORA-27037: unable to obtain file status&lt;br /&gt;SVR4 Error: 2: No such file or directory&lt;br /&gt;Additional information: 3&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;You cannot use the MAXCORRUPT or PROXY parameters with the VALIDATE option.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-230877878123047536?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/230877878123047536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=230877878123047536' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/230877878123047536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/230877878123047536'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/backup-validation-with-rman.html' title='Backup Validation with RMAN'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8147004171360086931</id><published>2008-09-20T18:10:00.001-07:00</published><updated>2008-09-20T18:10:41.905-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Detection of Logical Block Corruption'/><title type='text'>Detection of Logical Block Corruption</title><content type='html'>Besides testing for media corruption, the database can also test data and index blocks for logical corruption, such as corruption of a row piece or index entry. If RMAN finds logical corruption, then it logs the block in the alert.log. If CHECK LOGICAL was used, the block is also logged in the server session trace file. By default, error checking for logical corruption is disabled.&lt;br /&gt;&lt;br /&gt;For BACKUP commands the MAXCORRUPT parameter sets the total number of physical and logical corruptions permitted in a file. If the sum of physical and logical corruptions for a file is less than its MAXCORRUPT setting, the RMAN command completes successfully. If MAXCORRUPT is exceeded, the command terminates and RMAN does not read the rest of the file. V$DATABASE_BLOCK_CORRUPTION is populated with corrupt block ranges if the command succeeds. Otherwise, you must set MAXCORRUPT higher and re-run the backup to find out the corrupt block ranges.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8147004171360086931?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8147004171360086931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8147004171360086931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8147004171360086931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8147004171360086931'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/detection-of-logical-block-corruption.html' title='Detection of Logical Block Corruption'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4989706345594819626</id><published>2008-09-20T18:08:00.000-07:00</published><updated>2008-09-20T18:09:40.949-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Detecting Physical and Logical Block Corruption'/><title type='text'>Detecting Physical and Logical Block Corruption</title><content type='html'>Because an database server session is performing the backups and has a great understanding of files being backed up or copied, the server session is able to detect many types of physically corrupt blocks during the backup process. Each new corrupt block not previously encountered in a backup is recorded in the control file and in the alert.log. By default, error checking for physical corruption is enabled.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;At the end of a backup, RMAN stores the corruption information in the recovery catalog and control file. Access this data using the V$DATABASE_BLOCK_CORRUPTION view.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the server session encounters a datafile block during a backup that has already been identified as corrupt by the database, then the server session copies the corrupt block into the backup and the corrupt block is recorded the control file as either a logical or media corruption. RMAN copies the block in case the user wants to try to salvage the contents of the block.&lt;br /&gt;&lt;br /&gt;If RMAN encounters a datafile block that has media corruption but that has not already been identified as corrupt by the database, then it writes the block to the backup with a reformatted header indicating that the block has media corruption.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4989706345594819626?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4989706345594819626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4989706345594819626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4989706345594819626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4989706345594819626'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/detecting-physical-and-logical-block.html' title='Detecting Physical and Logical Block Corruption'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1186330631906442992</id><published>2008-09-20T18:04:00.000-07:00</published><updated>2008-09-20T18:07:36.994-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tests and Integrity Checks for Backups?'/><title type='text'>Tests and Integrity Checks for Backups?</title><content type='html'>The database prevents operations that result in unusable backup files or corrupt restored datafiles. The database server automatically does the following:&lt;br /&gt;&lt;br /&gt;    * Blocks access to datafiles while they are being restored or recovered&lt;br /&gt;    * Allows only one restore operation for each datafile at a time&lt;br /&gt;    * Ensures that incremental backups are applied in the correct order&lt;br /&gt;    * Stores information in backup files to allow detection of corruption&lt;br /&gt;&lt;br /&gt;You can use the &lt;span style="font-weight:bold;"&gt;BACKUP VALIDATE&lt;/span&gt; and &lt;span style="font-weight:bold;"&gt;RESTORE VALIDATE commands to test backup and restore operations without creating output files&lt;/span&gt;. In this way, you can check your datafiles for possible problems. If you run RMAN with the following configuration, then it detects all types of corruption that are possible to detect:&lt;br /&gt;&lt;br /&gt;    * In the initialization parameter file, set DB_BLOCK_CHECKSUM=TRUE&lt;br /&gt;    * &lt;span style="font-weight:bold;"&gt;In the RMAN BACKUP and RESTORE commands, do not specify the MAXCORRUPT option, do not specify the NOCHECKSUM option, but do specify the CHECK LOGICAL option&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1186330631906442992?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1186330631906442992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1186330631906442992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1186330631906442992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1186330631906442992'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/tests-and-integrity-checks-for-backups.html' title='Tests and Integrity Checks for Backups?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8235855097474298321</id><published>2008-09-20T13:22:00.001-07:00</published><updated>2008-09-20T13:22:49.139-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='When RMAN Performs Control File Autobackups'/><title type='text'>When RMAN Performs Control File Autobackups</title><content type='html'>When RMAN Performs Control File Autobackups&lt;br /&gt;&lt;br /&gt;By default, control file autobackups are turned off, and no control file autobackups are performed. If CONFIGURE CONTROLFILE AUTOBACKUP is ON, then RMAN automatically backs up the control file and the current server parameter file (if used to start up the database) in one of two circumstances: when a successful backup must be recorded in the RMAN repository, and when a structural change to the database affects the contents of the control file which therefore must be backed up.&lt;br /&gt;Control File Autobackups After Backup Acivities&lt;br /&gt;&lt;br /&gt;This means that the control file is backed up in the following situations:&lt;br /&gt;&lt;br /&gt;    * After every BACKUP command issued at the RMAN prompt.&lt;br /&gt;    * At the end of a RUN block, if the last command in the block was BACKUP.&lt;br /&gt;    * Whenever a BACKUP command within a RUN block is followed by a command that is not BACKUP.&lt;br /&gt;&lt;br /&gt;The first channel allocated during the backup job creates the autobackup and places it into its own backup set. The control file autobackup may be written to disk or tape.&lt;br /&gt;Control File Autobackups After Database Structural Changes&lt;br /&gt;&lt;br /&gt;The control file is also automatically backed up after database structural changes such as adding a new tablespace, altering the state of a tablespace or datafile (for example, bringing it online), adding a new online redo log, renaming a file, adding a new redo thread, and so on. Losing this information would compromise your ability to recover the database.&lt;br /&gt;&lt;br /&gt;This backup is performed by the server process itself, rather than one of the RMAN channels. This type of autobackup, unlike autobackups that occur after a successful backup, is always created on disk. You can use CONFIGURE CONTROLFILE AUTOBACKUP FOR DEVICE TYPE DISK to set the location for this disk based control file autobackup. Note that a failure of the automatic control file autobackup after a structural change never causes the associated structural change to fail. For example, if you add a datafile, and if the resulting control file autobackup fails, then the datafile addition is still successful.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8235855097474298321?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8235855097474298321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8235855097474298321' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8235855097474298321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8235855097474298321'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/when-rman-performs-control-file.html' title='When RMAN Performs Control File Autobackups'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1526134631925136922</id><published>2008-09-20T13:20:00.001-07:00</published><updated>2008-09-20T13:20:59.918-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How RMAN Performs Control File Autobackups?'/><title type='text'>How RMAN Performs Control File Autobackups?</title><content type='html'>How RMAN Performs Control File Autobackups&lt;br /&gt;&lt;br /&gt;The first channel allocated during the backup job creates the autobackup and places it into its own backup set; for autobackups after database structural changes, the default disk channel makes the backup. If a server parameter file is used, it is backed up in the same backup set as the control file during a control file autobackup.&lt;br /&gt;&lt;br /&gt;After the control file autobackup completes, the database writes a message containing the complete path of the backup piece and the device type to the alert log.&lt;br /&gt;&lt;br /&gt;The RMAN behavior when the BACKUP command includes datafile 1 depends on the CONFIGURE CONTROLFILE AUTOBACKUP setting. If control file autobackups are ON and the backup includes datafile 1, RMAN writes the control file and SPFILE to a separate autobackup backup set. If control file autobackups are OFF and the backup includes datafile 1, then RMAN includes the current control file and SPFILE in the same backup set as the datafiles.&lt;br /&gt;&lt;br /&gt;The control file autobackup filename has a default format of %F for all device types, so that RMAN can guess the file location and restore it without a repository. The substitution variable %F is defined in the description of the CONFIGURE command in Oracle Database Backup and Recovery Basics. You can specify a different format with the CONFIGURE CONTROLFILE AUTOBACKUP FORMAT command. All autobackup formats must include the %F variable.&lt;br /&gt;&lt;br /&gt;The SET CONTROLFILE AUTOBACKUP FORMAT command, which you can specify either within a RUN block or at the RMAN prompt, overrides the configured autobackup format in the session only. The order of precedence is:&lt;br /&gt;&lt;br /&gt;   1. SET within a RUN block&lt;br /&gt;   2. SET at RMAN prompt&lt;br /&gt;   3. CONFIGURE CONTROLFILE AUTOBACKUP FORMAT&lt;br /&gt;&lt;br /&gt;You can configure the autobackup format even when CONFIGURE CONTROLFILE AUTOBACKUP is set to OFF, but RMAN does not generate autobackups in this case. For RMAN to make autobackups, you must set CONFIGURE CONTROLFILE AUTOBACKUP to ON.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1526134631925136922?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1526134631925136922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1526134631925136922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1526134631925136922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1526134631925136922'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/how-rman-performs-control-file.html' title='How RMAN Performs Control File Autobackups?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4718066429204189406</id><published>2008-09-20T13:18:00.000-07:00</published><updated>2008-09-20T13:19:45.023-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='what command do you execute to ensure that the control file is automatically backed up using Recovery Manager (RMAN)?'/><title type='text'>what command do you execute to ensure that the control file is automatically backed up using Recovery Manager (RMAN)?</title><content type='html'>what command do you execute to ensure that the control file is automatically backed up using Recovery Manager? &lt;br /&gt;&lt;br /&gt;The automatic backup of the control file occurs independently of any backup of the current control file explicitly requested as part of your backup command. You can turn the autobackup feature on or off by running the following commands:&lt;br /&gt;&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP OFF;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4718066429204189406?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4718066429204189406/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4718066429204189406' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4718066429204189406'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4718066429204189406'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-command-do-you-execute-to-ensure.html' title='what command do you execute to ensure that the control file is automatically backed up using Recovery Manager (RMAN)?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7587089296122614247</id><published>2008-09-20T13:07:00.002-07:00</published><updated>2008-09-20T13:09:52.018-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Which background processes coordinates the rebalancing of disks in ASM'/><title type='text'>Which background processes coordinates the rebalancing of disks in ASM</title><content type='html'>In addition to the normal database background processes like CKPT, DBWR, LGWR, SMON, and PMON, an ASM instance uses at least two additional background processes to manage data storage operations. &lt;span style="font-weight:bold;"&gt;The Rebalancer process, RBAL&lt;/span&gt;, coordinates the rebalance activity for ASM disk groups, and the A&lt;span style="font-weight:bold;"&gt;ctual ReBalance processes, ARBn&lt;/span&gt;, handle the actual rebalance of data extent movements. &lt;span style="font-weight:bold;"&gt;There are usually several ARB background processes (ARB0, ARB1, and so forth). I will talk more about disk rebalancing operations in the final article in this series.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7587089296122614247?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7587089296122614247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7587089296122614247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7587089296122614247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7587089296122614247'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/which-background-processes-coordinates_20.html' title='Which background processes coordinates the rebalancing of disks in ASM'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-2524440940833612129</id><published>2008-09-20T13:07:00.001-07:00</published><updated>2008-09-20T13:07:56.304-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Which background processes coordinates the rebalancing of disks in ASM'/><title type='text'>Which background processes coordinates the rebalancing of disks in ASM</title><content type='html'>&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-2524440940833612129?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/2524440940833612129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=2524440940833612129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2524440940833612129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/2524440940833612129'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/which-background-processes-coordinates.html' title='Which background processes coordinates the rebalancing of disks in ASM'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1778516605514841097</id><published>2008-09-20T12:53:00.000-07:00</published><updated>2008-09-20T13:02:42.109-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is oracle ASM in Oracle 10g? How do we create ASM instance?'/><title type='text'>What is oracle ASM in Oracle 10g? How do we create ASM instance?</title><content type='html'>Automatic Storage Management (ASM) is a new feature that was introduced in Oracle 10g to simplify the storage of Oracle datafiles, controlfiles and logfiles. &lt;br /&gt;&lt;br /&gt;Automatic Storage Management (ASM) simplifies administration of Oracle related files by allowing the administrator to reference disk groups rather than individual disks and files, which are managed by ASM. The ASM functionality is an extention of the Oracle Managed Files (OMF) functionality that also includes striping and mirroring to provide balanced and secure storage. The new ASM functionality can be used in combination with existing raw and cooked file systems, along with OMF and manually managed files.&lt;br /&gt;&lt;br /&gt;ASM provides the following functionality:&lt;br /&gt;&lt;br /&gt;    * Manages groups of disks, called disk groups.&lt;br /&gt;    * Manages disk redundancy within a disk group.&lt;br /&gt;    * Provides near-optimal I/O balancing without any manual tuning.&lt;br /&gt;    * Enables management of database objects without specifying mount points and filenames.&lt;br /&gt;    * Supports large files.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Creating ASM instance&lt;br /&gt;&lt;br /&gt;Step1. To create an ASM instance first create a file called initASM.ora.&lt;br /&gt;INSTANCE_TYPE=ASM&lt;br /&gt;&lt;br /&gt;The initialization parameters that are of specific interest for an ASM instance are:&lt;br /&gt;&lt;br /&gt;INSTANCE_TYPE - Set to ASM or RDBMS depending on the instance type. The default is RDBMS.&lt;br /&gt;DB_UNIQUE_NAME - Specifies a globally unique name for the database. This defaults to +ASM but must be altered if you intend to run multiple ASM instances.&lt;br /&gt;ASM_POWER_LIMIT -The maximum power for a rebalancing operation on an ASM instance. The valid values range from 1 to 11, with 1 being the default. The higher the limit the more resources are allocated resulting in faster rebalancing operations. This value is also used as the default when the POWER clause is omitted from a rebalance operation.&lt;br /&gt;ASM_DISKGROUPS - The list of disk groups that should be mounted by an ASM instance during instance startup, or by the ALTER DISKGROUP ALL MOUNT statement. ASM configuration changes are automatically reflected in this parameter.&lt;br /&gt;ASM_DISKSTRING - Specifies a value that can be used to limit the disks considered for discovery. Altering the default value may improve the speed of disk group mount time and the speed of adding a disk to a disk group. Changing the parameter to a value which prevents the discovery of already mounted disks results in an error. The default value is NULL allowing all suitable disks to be considered.&lt;br /&gt;&lt;br /&gt;Step 2: using SQL*Plus connect to the idle instance.&lt;br /&gt;&lt;br /&gt;    export ORACLE_SID=+ASM&lt;br /&gt;    sqlplus / as sysdba&lt;br /&gt;&lt;br /&gt;Step3: Create an spfile using the contents of the initASM.ora file.&lt;br /&gt;&lt;br /&gt;    SQL&gt; CREATE SPFILE FROM PFILE='initASM.ora';&lt;br /&gt;&lt;br /&gt;    File created.&lt;br /&gt;Step 4: Start the instance with the NOMOUNT option.&lt;br /&gt;&lt;br /&gt;    SQL&gt; startup nomount&lt;br /&gt;    ASM instance started&lt;br /&gt;&lt;br /&gt;The ASM instance is now ready to use for creating and mounting disk groups. To shutdown the ASM instance issue the following command.&lt;br /&gt;&lt;br /&gt;    SQL&gt; shutdown&lt;br /&gt;    ASM instance shutdown&lt;br /&gt;    SQL&gt;&lt;br /&gt;&lt;br /&gt;Startup and Shutdown of ASM Instances&lt;br /&gt;ASM instance are started and stopped in a similar way to normal database instances. The options for the STARTUP command are:&lt;br /&gt;&lt;br /&gt;    * FORCE - Performs a SHUTDOWN ABORT before restarting the ASM instance.&lt;br /&gt;    * MOUNT - Starts the ASM instance and mounts the disk groups specified by the ASM_DISKGROUPS parameter.&lt;br /&gt;    * NOMOUNT - Starts the ASM instance without mounting any disk groups.&lt;br /&gt;    * OPEN - This is not a valid option for an ASM instance.&lt;br /&gt;&lt;br /&gt;The options for the SHUTDOWN command are:&lt;br /&gt;&lt;br /&gt;    * NORMAL - The ASM instance waits for all connected ASM instances and SQL sessions to exit then shuts down.&lt;br /&gt;    * IMMEDIATE - The ASM instance waits for any SQL transactions to complete then shuts down. It doesn't wait for sessions to exit.&lt;br /&gt;    * TRANSACTIONAL - Same as IMMEDIATE.&lt;br /&gt;    * ABORT - The ASM instance shuts down instantly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1778516605514841097?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1778516605514841097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1778516605514841097' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1778516605514841097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1778516605514841097'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-oracle-asm-in-oracle-10g-how-do.html' title='What is oracle ASM in Oracle 10g? How do we create ASM instance?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3516136477743847186</id><published>2008-09-20T07:45:00.000-07:00</published><updated>2008-09-20T07:50:13.425-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Load Balancing In Oracle 10g Real Application Clusters Environments'/><title type='text'>Load Balancing In Oracle 10g Real Application Clusters Environments</title><content type='html'>An Oracle 10gR2 Real Application Clusters (RAC) clustered database needs more robust load balancing capabilities because of the nature of that environment.&lt;br /&gt;&lt;br /&gt;A RAC clustered database comprises at least two (and usually many more) nodes, each running a separate instance of the clustered database. In addition, a RAC database usually needs to supply a minimum amount of connections and resources to several applications, each with dramatically different resource needs depending on the current business processing cycle(s), so the application load that’s placed on each instance in the clustered database therefore can be dramatically different at different times of the day, week, month, and year. Finally, it’s likely that a RAC clustered database will need to guarantee a minimum cardinality (i.e. a specific number of nodes on which the application needs to run at all times) to one or more mission-critical applications.&lt;br /&gt;&lt;br /&gt;RAC Services. Starting in Oracle 8i, an Oracle database could dynamically register a database directly with its corresponding listener(s) based on the settings for the SERVICE_NAMES initialization parameter through the database’s Process Monitor (PMON) background process. To completely support this feature, Oracle strongly suggested that the SERVICE_NAME parameter should be used instead of the original SID parameter in the TNSNAMES.ORA configuration file so that an incoming user session could immediately identify the database instance to which a session intended to connect.&lt;br /&gt;&lt;br /&gt;Oracle 10g RAC leverages this service naming feature to distribute application connections efficiently across a RAC clustered database. For example, a clustered database may need to support three different applications, OLTP, DSS, and ADHOC. The OLTP application is the main order entry application for this enterprise computing environment, and therefore it needs a minimum cardinality of two cluster database instances at all times. The DSS application, on the other hand, supports extraction, transformation and load (ETL) operations for the enterprise’s data warehouse, and thus it requires a minimum cardinality of just one instance. Likewise, the ADHOC application supports OLAP and general user query execution against the data warehouse, but it too only requires a minimum cardinality of a single instance.&lt;br /&gt;Oracle 10gR2 RAC: Server-Side Connect-Time Load Balancing&lt;br /&gt;&lt;br /&gt;It’s also important to realize that in a RAC environment, the server-side load balancing methodology differs slightly from the methodology used in a single-instance environment because Oracle 10gR2 discriminates whether the incoming connection has been requested as either a dedicated or a shared server connection:&lt;br /&gt;&lt;br /&gt;    * If a dedicated session is requested, then the listener will select the instance first on the basis of the node that is least loaded; if all nodes are equally loaded, it will then select the instance that has the least load.&lt;br /&gt;    * For a shared server connection, however, the listener goes one step further. It will also check to see if all of the available instances are equally loaded; if this is true, the listener will place the connection on the least-loaded dispatcher on the selected instance. &lt;br /&gt;&lt;br /&gt;Advanced Load Balancing: The Load Balancing Advisor (LBA)&lt;br /&gt;&lt;br /&gt;In a RAC environment, it’s not unlikely that one node may become overwhelmed by application requests for resources. For example, let’s assume that a two-node clustered database currently has 100 user sessions connected across both nodes in the cluster, and that the database is using standard server-side load balancing. If there is a sudden “storm” of 200 additional connections, the listeners on the two nodes will simply distribute them evenly across both nodes, 100 to each node, resulting in 150 connections per node. However, it’s possible that node RACDB2 is actually much “busier” than the other node. As a result, node RACDB2 will most likely be completely overwhelmed by those new connections’ resource demands, while node RACDB1 remains relatively underutilized with plenty of additional resources.&lt;br /&gt;&lt;br /&gt;The good news is that Oracle 10gR2 now provides an advanced method to overcome this imbalance: the Load Balancing Advisor (LBA). The LBA will calculate how much work each instance in the clustered database has been asked to do. The LBA will then make sure that any new incoming work is routed to the instance(s) that are least busy. This determination takes place on a service-by-service basis across all instances that are providing resources to each service.&lt;br /&gt;&lt;br /&gt;The LBA considers the following factors when determining how to perform this “balancing act”:&lt;br /&gt;&lt;br /&gt;    * Are there any differences in processing power between nodes?&lt;br /&gt;    * Are there any sessions that are currently blocked from execution because of waits?&lt;br /&gt;    * Have any failures occurred on a node that might block processing from continuing?&lt;br /&gt;    * Are there any services that are competing for resources, and have those services been granted a different priority to complete their tasks at hand? &lt;br /&gt;&lt;br /&gt;Not only does this help to balance out the total workload across all instances in the cluster, it also insures that one node won’t be overwhelmed by requests for service by its primary application(s).&lt;br /&gt;&lt;br /&gt;As part of its Fast Application Notification (FAN) event transmission features, Oracle 10g RAC uses Oracle Notification Services (ONS) to communicate the status of cluster resources to all participating node applications in the cluster. In Oracle 10gR2, FAN added a new event type, SERVICE_METRIC, whose event payload contains information about the relative workload of each node in the RAC cluster, and it’s this information that the Load Balancing Advisory uses to determine how to route new connections throughout the clustered database’s instances.&lt;br /&gt;&lt;br /&gt;Oracle 10gR2 supplies an upgraded DBMS_SERVICE.MODIFY_SERVICE procedure that modifies an existing RAC service so that it can utilize the Load Balance Advisory for service-by-service load balancing. This procedure provides two crucial parameters, GOAL and CLB_GOAL, that interact to determine what methods (if any) Oracle 10gR2 will utilize to perform load balancing. For example, if I set the GOAL parameter to either the GOAL_SERVICE_TIME or the GOAL_THROUGHPUT enumerated constants for a specific RAC service, Oracle 10gR2 will activate the Load Balancing Advisory for load balancing of that service’s incoming connections. Table 1 explains the difference between these two load balancing targets.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3516136477743847186?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3516136477743847186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3516136477743847186' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3516136477743847186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3516136477743847186'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/load-balancing-in-oracle-10g-real.html' title='Load Balancing In Oracle 10g Real Application Clusters Environments'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4484710740342782509</id><published>2008-09-20T07:42:00.000-07:00</published><updated>2008-09-20T07:44:08.065-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10gR2 load balancing - Server side load balancing'/><title type='text'>Oracle 10gR2 load balancing - Server side load balancing</title><content type='html'>The two previous methods will adequately handle the distribution of user sessions across available resources while helping to guarantee that no session will wait an excessive time to find a currently active address on which to connect. Clearly, a better solution was needed, and Oracle 9i offered one: server-side load balancing. This method divides the connection load evenly between all available listeners by determining the total number of connections on each listener, and then distributing new user session connection requests to the least loaded listener(s) based on the total number of sessions already connected. While a bit more complex to implement because it requires configuration of multiple listeners, it most definitely helps to even out connections across all available listeners in a database system.&lt;br /&gt;&lt;br /&gt;To implement server-side load balancing, at least two listeners must be configured. Also, the REMOTE_LISTENERS initialization parameter must be added to the database’s PFILE or SPFILE so that the database knows to search out the value provided in that parameter in the database server’s TNSNAMES.ORA configuration file. When server-side load balancing is activated, each listener that contributes a listening endpoint communicates with the other listener(s) via each database instance’s PMON process. Oracle then determines how many user connections each listener is servicing, and it will distribute any new connection requests so that the load is balanced evenly across all servers. The entries in TNSNAMES.ORA direct the listeners to share information about the relative load connectivity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4484710740342782509?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4484710740342782509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4484710740342782509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4484710740342782509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4484710740342782509'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-10gr2-load-balancing-server-side.html' title='Oracle 10gR2 load balancing - Server side load balancing'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5038850499684436368</id><published>2008-09-20T07:41:00.000-07:00</published><updated>2008-09-20T07:42:19.454-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10gR2 load balancing- Client-Side Connection Failover'/><title type='text'>Oracle 10gR2 load balancing- Client-Side Connection Failover</title><content type='html'>Client-Side Connection Failover. Obviously, balancing the overall number of connections is a desirable goal, but what happens if the chosen connection point is unavailable because the database server’s listener is no longer active? To forestall this, Oracle 8i provided the capability to determine if the connection that has been chosen at random is still “alive” and, if not, continue to try the other listed connection points until a live connection is found. This simple method tends to limit the chance of a lost connection, but unfortunately it must rely on TCP/IP timeouts to determine if a connection is alive or dead, and this means that an application may wait several seconds (or even longer!) before it receives a notification that the connection has been terminated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5038850499684436368?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5038850499684436368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5038850499684436368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5038850499684436368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5038850499684436368'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-10gr2-load-balancing-client-side.html' title='Oracle 10gR2 load balancing- Client-Side Connection Failover'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4697115055034060015</id><published>2008-09-20T07:35:00.000-07:00</published><updated>2008-09-20T07:38:17.716-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10gR2 load balancing - Part2 - Client-Side Load balancing'/><title type='text'>Oracle 10gR2 load balancing - Part2 - Client-Side Load balancing</title><content type='html'>Client-Side Load Balancing Methods&lt;br /&gt;&lt;br /&gt;1. Client-Side Connection Load Balancing. &lt;br /&gt;This load balancing method has been available since Oracle 8i. When a user session attempts to connect to the database, the database’s listener will assign the session randomly to one of the listed multiple listening endpoints.&lt;br /&gt;&lt;br /&gt;While this load balancing method is certainly simplest to implement, it also has an obvious limitation: the listener has no idea if the session has been assigned to an endpoint whose corresponding database server is already overloaded. Moreover, since the listener is essentially picking the connection completely at random, there is no guarantee that the connection chosen will even be available at that time. This may force the session to wait for a considerable length of time – perhaps even minutes, a relative eternity in computing timeframes! – until the operating system indicates to the listener that the connection is unavailable, which causes the user session to fail eventually with an ORA-01034 ORACLE not available error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4697115055034060015?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4697115055034060015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4697115055034060015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4697115055034060015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4697115055034060015'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-10gr2-load-balancing-part2.html' title='Oracle 10gR2 load balancing - Part2 - Client-Side Load balancing'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3033928446396346791</id><published>2008-09-20T07:33:00.000-07:00</published><updated>2008-09-20T07:35:23.212-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10gR2 load balancing - Part1'/><title type='text'>Oracle 10gR2 load balancing - Part1</title><content type='html'>Oracle 10gR2 takes advantage of simple client-side connection load balancing, server-side load balancing, and the new Load Balancing Advisor (LBA) features to significantly improve the distribution of workloads across the appropriate nodes in an Oracle 10gR2 Real Application Clusters (RAC) clustered database environment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3033928446396346791?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3033928446396346791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3033928446396346791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3033928446396346791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3033928446396346791'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-10gr2-load-balancing-part1.html' title='Oracle 10gR2 load balancing - Part1'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6678454522599209219</id><published>2008-09-19T07:48:00.003-07:00</published><updated>2008-09-19T09:06:01.818-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle database tuning without any tools - using performance views - part 4 - Examine the Oracle Statistics'/><title type='text'>Oracle database tuning without any tools - using performance views - part 4 - Examine the Oracle Statistics</title><content type='html'>Examine the Oracle Statistics&lt;br /&gt;&lt;br /&gt;Oracle provides the init.ora parameter STATISTICS_LEVEL (BASIC, TYPICAL-default, ALL), which controls all major statistics collections or advisories in the database.&lt;br /&gt;&lt;br /&gt;you can see the statistics level from v$statistics_level view.&lt;br /&gt;&lt;br /&gt;1. wait events &lt;br /&gt;&lt;br /&gt;main views to look for wait events are&lt;br /&gt;1. v$session&lt;br /&gt;2. v$session_wait&lt;br /&gt;3. v$session_wait_class&lt;br /&gt;4. v$system_wait_class&lt;br /&gt;5. v$session_wait_history&lt;br /&gt;6. v$waitclassmetric&lt;br /&gt;7. v$active_session_history&lt;br /&gt;8. v$sess_time_model&lt;br /&gt;9. v$session_event&lt;br /&gt;10. v$system_event&lt;br /&gt;11. v$event_histogram&lt;br /&gt;12. v$file_histogram&lt;br /&gt;13. v$temp_histogram&lt;br /&gt;&lt;br /&gt;wait events are grouped into classes.  main classes are&lt;br /&gt;1. administrative&lt;br /&gt;2. application&lt;br /&gt;3. cluster&lt;br /&gt;4. concurrency&lt;br /&gt;5. commit&lt;br /&gt;6. configuration&lt;br /&gt;7. idle&lt;br /&gt;8. network&lt;br /&gt;9. other,&lt;br /&gt;10. scheduler&lt;br /&gt;11. system i/o&lt;br /&gt;12. user i/o&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6678454522599209219?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6678454522599209219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6678454522599209219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6678454522599209219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6678454522599209219'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-database-tuning-without-any_8746.html' title='Oracle database tuning without any tools - using performance views - part 4 - Examine the Oracle Statistics'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6702007858207845607</id><published>2008-09-19T07:48:00.002-07:00</published><updated>2008-09-19T08:34:42.091-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle database tuning without any tools - using performance views - part 3 - Examine the Host system'/><title type='text'>Oracle database tuning without any tools - using performance views - part 3 - Examine the Host system</title><content type='html'>Examine the Host system&lt;br /&gt;&lt;br /&gt;1. CPU usage&lt;br /&gt;2. Non oracle processes running on the system&lt;br /&gt;3. Oracle processes (SQL_TRACe and TKPROF to identify bad PL/SQl code or SQL query)&lt;br /&gt;4. Oracle CPU statistics (look at the following v$ views v$sysstat, v$sesstat, v$rsrc_consumer_group)&lt;br /&gt;5. interpreting CPU statistics&lt;br /&gt;6. Detecting I/O problems&lt;br /&gt;7. Detecting Network problem&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6702007858207845607?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6702007858207845607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6702007858207845607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6702007858207845607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6702007858207845607'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-database-tuning-without-any_5461.html' title='Oracle database tuning without any tools - using performance views - part 3 - Examine the Host system'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5977940499393938314</id><published>2008-09-19T07:48:00.001-07:00</published><updated>2008-09-19T08:26:13.179-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle database tuning without any tools - using performance views - part 2 - Define a problem'/><title type='text'>Oracle database tuning without any tools - using performance views - part 2 - Define a problem</title><content type='html'>Define a problem&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It is very important to understand the purpose of tuning and nature of the problem before we start implementing the solution. If we do not understand, it will be almost impossible to implement effective changes. Collect as much data as you can in this stage. following data is vital for the next step&lt;br /&gt;&lt;br /&gt;1. Identify the performance objective: what is the measure of acceptable performance i.e. response time that will meet the required performance level.&lt;br /&gt;&lt;br /&gt;2. Identify the scope of the problem &lt;br /&gt;&lt;br /&gt;what is affected by the slowdown?&lt;br /&gt;Is it particular application?&lt;br /&gt;Is it particular program?&lt;br /&gt;Is it a particular operation?&lt;br /&gt;Is it a single user?&lt;br /&gt;&lt;br /&gt;3. Identify the time frame when the problem occurs.&lt;br /&gt;Is it happening in a particular time(peak time)?&lt;br /&gt;Is the performance deteriorate over the course of the day?&lt;br /&gt;Is the slowdown gradual or sudden?&lt;br /&gt;&lt;br /&gt;4. Quantify the slowdown&lt;br /&gt;&lt;br /&gt;This helps to identify the extent of the problem and also acts as a measure for comparison when deciding whether changes made to fix the problem have actually made the difference or not.&lt;br /&gt;&lt;br /&gt;5. Identify the changes: Identify what has changed since performance was acceptable. this may narrow the potential problem very quickly. For example any change in hardware configuration, software versions, or oracle release has been upgraded, large amount of data has been loaded, data input or user volume grown etc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5977940499393938314?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5977940499393938314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5977940499393938314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5977940499393938314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5977940499393938314'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-database-tuning-without-any_19.html' title='Oracle database tuning without any tools - using performance views - part 2 - Define a problem'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1183837734428653507</id><published>2008-09-19T07:48:00.000-07:00</published><updated>2008-09-19T08:03:34.001-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle database tuning without any tools - using performance views - part 1'/><title type='text'>Oracle database tuning without any tools - using performance views - part 1</title><content type='html'>Oracle instance tuning steps:&lt;br /&gt;&lt;br /&gt;1. Define a problem : This step involves feedback from users about the scope of the problem.&lt;br /&gt;&lt;br /&gt;2. Examine the Host System and Examine the Oracle Statistics&lt;br /&gt;&lt;br /&gt;a) Obtain a full set of os, database, and application statistics, examine the data for any evidence of performance problem.&lt;br /&gt;b) Consider the list of common performance errors and see if data gathered contribute to that problem&lt;br /&gt;c) Build a conceptual model (mental model) what is happening in the system using the performance data gathered.&lt;br /&gt;&lt;br /&gt;3. Implement and measure the change: In this step implement proposed changes and what will be expected result after these changes. do the change and see if you are getting expected results.  Measure the application performance gain.&lt;br /&gt;&lt;br /&gt;4.determine if the performance objective defined in step 1 are met not. if not then repead step 2 and 3 until the performance goals are met.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1183837734428653507?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1183837734428653507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1183837734428653507' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1183837734428653507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1183837734428653507'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-database-tuning-without-any.html' title='Oracle database tuning without any tools - using performance views - part 1'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7093755848748005761</id><published>2008-09-18T15:03:00.000-07:00</published><updated>2008-09-18T15:04:51.307-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Quick DBA Test - Oracle 10g'/><title type='text'>Quick DBA Test - Oracle 10g</title><content type='html'>As a database administrator, you are required to implement a backup plan that has been documented as follows:&lt;br /&gt;&lt;br /&gt;a) Full backups every Saturday night&lt;br /&gt;b) Cumulative backups every Wednesday to back up everything since the last full backup&lt;br /&gt;C) Daily incremental backups for the rest of the days of the week&lt;br /&gt;&lt;br /&gt;The database has to be available 24 hours a day, 7 days a week, and can therefore not be shutdown at any time.&lt;br /&gt;&lt;br /&gt;Referring to the scenario above, how do you implement this backup plan using RMAN?&lt;br /&gt;&lt;br /&gt;a.)    1. Saturdays - Level 0 Backups2. Wednesdays - Level 1 Backups3. Sundays, Mondays, Tuesdays, Thursdays, Fridays - Level 2 Backups&lt;br /&gt;b.)    1. Saturdays - Level 1 Backups2. Wednesdays - Level 2 Backups3. Sundays, Mondays, Tuesdays, Thursdays, Fridays - Level 3 Backups&lt;br /&gt;c.)    1. Saturdays - Level 2 Backups2. Wednesdays - Level 1 Backups3. Sundays, Mondays, Tuesdays, Thursdays, Fridays - Level 0 Backups&lt;br /&gt;d.)    1. Saturdays - Cold Backups2. Wednesdays - Level 1 Backups3. Sundays, Mondays, Tuesdays, Thursdays, Fridays - Level 2 Backups&lt;br /&gt;e.)    1. Saturdays - Level 0 Backups2. Wednesdays - Level 1 Backups3. Sundays, Mondays, Tuesdays, Thursdays, Fridays - Level 1 Backups&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Rob has been asked to look into the execution plans from an application which is working very slowly.&lt;br /&gt;&lt;br /&gt;Based on the scenario above, at which one of the following does Rob first look when performing SQL statement tuning? &lt;br /&gt;&lt;br /&gt;a.)    Outer joins &lt;br /&gt;b.)    Inner joins &lt;br /&gt;c.)    Index range scans &lt;br /&gt;d.)    Full table scans &lt;br /&gt;e.)    Hash joins&lt;br /&gt;&lt;br /&gt;Which one of the following do you execute to ensure that the control file is automatically backed up using Recovery Manager? &lt;br /&gt;&lt;br /&gt;a.)    CONFIGURE CONTROLFILE AUTOBACKUP ON; &lt;br /&gt;b.)    CONFIGURE CONTROLFILE BACKUP AUTO; &lt;br /&gt;c.)    CONFIGURE CONTROL FILE AUTOBACKUP; &lt;br /&gt;d.)    CONFIGURE CONTROL BACKUP AUTO; &lt;br /&gt;e.)    CONFIGURE CONTROL AUTO BACKUP;&lt;br /&gt;&lt;br /&gt;Which one of the following background processes coordinates the rebalancing of disks in Automatic Storage Management?&lt;br /&gt;&lt;br /&gt;a.)    J000 &lt;br /&gt;b.)    ORB1 &lt;br /&gt;c.)    RECO &lt;br /&gt;d.)    RBAL &lt;br /&gt;e.)    CJQ0&lt;br /&gt;&lt;br /&gt;You want to have the same statistics in your TEST database as the ones in your PRODUCTION database.&lt;br /&gt;&lt;br /&gt;Referring to the above, how do you accomplish the requirements stated above? &lt;br /&gt;&lt;br /&gt;a.)    Run the GATHER_SCHEMA_STATS on TEST and PRODUCTION at the same time. &lt;br /&gt;b.)    Run the GATHER_DATABASE_STATS on TEST and PRODUCTION at the same time. &lt;br /&gt;c.)    EXPORT statistics from PRODUCTION and IMPORT to TEST using the DBMS_STATS package procedures. &lt;br /&gt;d.)    RESTORE statistics from PRODUCTION to TEST using the DBMS_STATS package procedures. &lt;br /&gt;e.)    RESTORE the PRODUCTION tables and data on TEST.&lt;br /&gt;&lt;br /&gt;1. In Oracle 10g, how is the scheduler implemented? &lt;br /&gt;&lt;br /&gt;a.)    As a separate daemon which runs under root privileges &lt;br /&gt;b.)    As a separate thread under the SMON daemon which wakes up at a pre-defined interval to check for job schedules &lt;br /&gt;c.)    As a collection of functions and procedures in the DBMS_SCHEDULER package &lt;br /&gt;d.)    As a collection of functions, procedures, and packages in the DBMS_JOB_SCHEDULER package &lt;br /&gt;e.)    As a command-line tool named "schedjob" which interfaces with the OS scheduler&lt;br /&gt;&lt;br /&gt;2. Which one of the following is a valid DDL statement to create a Bigfile tablespace?&lt;br /&gt;&lt;br /&gt;a.)    CREATE BIGFILE TABLESPACE tbs_bf_fct_001DATAFILE 'tbs_bf_fct_001.dbf'SIZE 6G EXTENT MANAGEMENT DICTIONARY;&lt;br /&gt;b.)    CREATE BIGFILE TABLESPACE tbs_bf_fct_001DATAFILE 'tbs_bf_fct_001.dbf'SIZE 6G;&lt;br /&gt;c.)    CREATE BIGFILE TABLESPACE tbs_bf_fct_001DATAFILE 'tbs_bf_fct_001.dbf'SIZE 6G SEGMENT SPACE MANAGEMENT MANUAL;&lt;br /&gt;d.)    CREATE BIGFILE TABLESPACE tbs_bf_fct_001DATAFILE 'tbs_bf_fct_001.dbf'SIZE 6G SEGMENT SPACE MANAGEMENT MANUAL EXTENT MANAGEMENT DICTIONARY;&lt;br /&gt;e.)    CREATE BIGFILE TABLESPACE tbs_bf_fct_001DATAFILE 'tbs_bf_fct_001.dbf' SIZE 3GB, 'tbs_bf_fct_002.dbf' SIZE 3G;&lt;br /&gt;&lt;br /&gt;3. Which one of the following do you query in order to access fine-grained audit information? &lt;br /&gt;&lt;br /&gt;a.)    DBA_FGA_AUDIT_INFO &lt;br /&gt;b.)    DBA_FGA_AUDIT_TRAIL &lt;br /&gt;c.)    DBA_FGA_AUDIT &lt;br /&gt;d.)    V$FGA_AUDIT_TRAIL &lt;br /&gt;e.)    V$FGA_AUDIT_INFO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Which one of the following describes the "Reset database to incarnation" command used by Recovery Manager?&lt;br /&gt;a.)         It performs point-in-time recovery when using Recovery Manager.&lt;br /&gt;b.)    It is used to undo the effect of a resetlogs operation by restoring backups of a prior incarnation of the database.&lt;br /&gt;c.)    It restores the database to a save point as defined by the version control number or incarnation number of the database.&lt;br /&gt;d.)    It restores the database to the initial state in which it was found when first backing it up via Recovery Manager.&lt;br /&gt;e.)    It performs a resynchronization of online redo logs to a given archive log system change number (SCN).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5.You have a multi-master replication setup. You need to add a DATE type column to the table GL_ENTRY.&lt;br /&gt;&lt;br /&gt;Referring to the scenario above, which one of the following Oracle packages do you execute to ensure that this change is replicated to all the other sites? &lt;br /&gt;&lt;br /&gt;a.)        DBMS_REPCAT.ALTER_MASTER_OBJECT&lt;br /&gt;b.)    DBMS_REPCAT.EXECUTE_MASTER_DDL&lt;br /&gt;c.)    DBMS_REPCAT.ALTER_MASTER_DDL&lt;br /&gt;d.)    DBMS_REPCAT.REPLICATE_OBJECT_DDL&lt;br /&gt;e.)    DBMS_REPCAT.ALTER_MASTER_REPOBJECT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. How many levels of CPU percentage can be specified when creating a resource plan directive for Database Resource Manager? &lt;br /&gt;a.)         2&lt;br /&gt;b.)    4&lt;br /&gt;c.)    8&lt;br /&gt;d.)    16&lt;br /&gt;e.)    32&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. Which one of the following procedures do you use to analyze a single SQL statement? &lt;br /&gt;&lt;br /&gt;a.)         DBMS_ADVISOR.ADD_SQLWKLD_REF&lt;br /&gt;b.)    DBMS_ADVISOR.ADD_SQLWKLD_STATEMENT *&lt;br /&gt;c.)    DBMS_ADVISOR.QUICK_TUNE&lt;br /&gt;d.)    DBMS_ADVISOR.CREATE_TASK&lt;br /&gt;e.)    DBMS_ADVISOR.CREATE_SQLWKLD&lt;br /&gt;&lt;br /&gt;8. Which one of the following components of Data Guard pulls archived redo logs from the primary site?&lt;br /&gt;&lt;br /&gt;a.)         MRP*&lt;br /&gt;b.)    FAL client&lt;br /&gt;c.)    FAL server&lt;br /&gt;d.)    ARCn&lt;br /&gt;e.)    LGWR&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;9.Which one of the following is a valid Data Availability Mode within Data Guard? &lt;br /&gt;&lt;br /&gt;a.)         Guaranteed protection mode&lt;br /&gt;b.)    Instant protection mode&lt;br /&gt;c.)    Rapid protection mode&lt;br /&gt;d.)    Maximum protection mode&lt;br /&gt;e.)    Delayed protection mode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt; &lt;br /&gt;10. Which one of the following do you access to find out what benefit you can expect to the system after a recommendation is carried out? &lt;br /&gt;&lt;br /&gt;a.)         DBA_ADVISOR&lt;br /&gt;b.)    DBA_ADVISOR_TASKS *&lt;br /&gt;c.)    DBA_ADVISOR_FINDINGS&lt;br /&gt;d.)    DBA_ADVISOR_RECOMMENDATIONS&lt;br /&gt;e.)    DBA_ADVISOR_LOG&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;11. Which one of the following is the default type of materialized view? &lt;br /&gt;&lt;br /&gt;a.)         Primary Key Materialized View*&lt;br /&gt;b.)    Object Materialized View&lt;br /&gt;c.)    ROWID Materialized View&lt;br /&gt;d.)    Complex Materialized View&lt;br /&gt;e.)    Hash Materialized View&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;12. One of your database developers is concerned about optimizer execution plan changes when other changes are made to the database.&lt;br /&gt;&lt;br /&gt;Referring to the scenario above, how do you prevent this from occurring? &lt;br /&gt;&lt;br /&gt;a.)         Make no structural changes to the database.&lt;br /&gt;b.)    Use hints.&lt;br /&gt;c.)    Use optimizer plan stability.&lt;br /&gt;d.)    Set the optimizer mode to RULE.&lt;br /&gt;e.)    Set the optimizer mode to ALL_ROWS&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7093755848748005761?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7093755848748005761/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7093755848748005761' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7093755848748005761'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7093755848748005761'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/quick-dba-test-oracle-10g.html' title='Quick DBA Test - Oracle 10g'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7419060266859685583</id><published>2008-09-17T08:25:00.000-07:00</published><updated>2008-09-17T08:27:53.366-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='what are the major new featurs in Oracle 10g data pump?'/><title type='text'>what are the major new featurs in Oracle 10g data pump?</title><content type='html'>Major new features in oracle 10g data pump&lt;br /&gt;&lt;br /&gt;    *The ability to specify the maximum number of threads of active execution operating on behalf of the Data Pump job. This enables you to adjust resource consumption versus elapsed time. See PARALLEL for information about using this parameter in export. See PARALLEL for information about using this parameter in import. (This feature is available only in the Enterprise Edition of Oracle Database 10g.)&lt;br /&gt;    *The ability to restart Data Pump jobs. See START_JOB for information about restarting export jobs. See START_JOB for information about restarting import jobs.&lt;br /&gt;    *The ability to detach from and reattach to long-running jobs without affecting the job itself. This allows DBAs and other operations personnel to monitor jobs from multiple locations. The Data Pump Export and Import utilities can be attached to only one job at a time; however, you can have multiple clients or jobs running at one time. (If you are using the Data Pump API, the restriction on attaching to only one job at a time does not apply.) You can also have multiple clients attached to the same job. See ATTACH for information about using this parameter in export. See ATTACH for information about using this parameter in import.&lt;br /&gt;    *Support for export and import operations over the network, in which the source of each operation is a remote instance. See NETWORK_LINK for information about using this parameter in export. See NETWORK_LINK for information about using this parameter in import.&lt;br /&gt;    *The ability, in an import job, to change the name of the source datafile to a different name in all DDL statements where the source datafile is referenced. See REMAP_DATAFILE.&lt;br /&gt;    *Enhanced support for remapping tablespaces during an import operation. See REMAP_TABLESPACE.&lt;br /&gt;    *Support for filtering the metadata that is exported and imported, based upon objects and object types. For information about filtering metadata during an export operation, see INCLUDE and EXCLUDE. For information about filtering metadata during an import operation, see INCLUDE and EXCLUDE.&lt;br /&gt;    *Support for an interactive-command mode that allows monitoring of and interaction with ongoing jobs. See Commands Available in Export's Interactive-Command Mode and Commands Available in Import's Interactive-Command Mode.&lt;br /&gt;    *The ability to estimate how much space an export job would consume, without actually performing the export. See ESTIMATE_ONLY.&lt;br /&gt;    *The ability to specify the version of database objects to be moved. In export jobs, VERSION applies to the version of the database objects to be exported. See VERSION for more information about using this parameter in export.&lt;br /&gt;&lt;br /&gt;      In import jobs, VERSION applies only to operations over the network. This means that VERSION applies to the version of database objects to be extracted from the source database. See VERSION for more information about using this parameter in import.&lt;br /&gt;    * Most Data Pump export and import operations occur on the Oracle database server. (This contrasts with original export and import, which were primarily client-based.) See Default Locations for Dump, Log, and SQL Files for information about some of the implications of server-based operations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7419060266859685583?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7419060266859685583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7419060266859685583' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7419060266859685583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7419060266859685583'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-are-major-new-featurs-in-oracle.html' title='what are the major new featurs in Oracle 10g data pump?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8270723908186893886</id><published>2008-09-07T09:57:00.000-07:00</published><updated>2008-09-07T09:58:14.890-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flashback version query in oracle 10g'/><title type='text'>Flashback version query in oracle 10g</title><content type='html'>flashback version query in oracle 10g&lt;br /&gt;&lt;br /&gt;Flashback query was introduced in Oracle 9i. It provides a mechanism for viewing data as it existed at a particular point in time (a timestamp or SCN). With 10g Release 1, Oracle has extended flashback query to enable us to view different versions of our data in a given range between two timestamps or SCNs.&lt;br /&gt;&lt;br /&gt;This article introduces the new flashback version query. It assumes that readers are familiar with flashback query concepts. For an overview, including the necessary privileges required, read this oracle-developer.net article.&lt;br /&gt;&lt;br /&gt;sample data&lt;br /&gt;&lt;br /&gt;For the examples in this article, we will use a scratch table and some dummy data. The table is created as follows.&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE TABLE fbt&lt;br /&gt;  2  ( x INTEGER&lt;br /&gt;  3  , y TIMESTAMP&lt;br /&gt;  4  , z VARCHAR2(30) );&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;We can now populate the table and make several changes to the data. We will add a row, update it a couple of times and finally delete it. We will include a short pause between each DML operation, but capture the timestamp before and after the updates for use in later examples. All DML operations will be committed, because new versions of data are only recorded following a commit. We'll begin with a single-row insert.&lt;br /&gt;&lt;br /&gt;SQL&gt; EXEC DBMS_LOCK.SLEEP(10);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; INSERT INTO fbt VALUES (1, LOCALTIMESTAMP, 'Initial population');&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;SQL&gt; COMMIT;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;Note that we included a sleep before we added any data to the table. This is recommended by Oracle to avoid ORA-01466: unable to read data - table definition has changed (this will only be an issue if the table is subject to flashback queries as soon as it is created).&lt;br /&gt;&lt;br /&gt;We can now update our sample data. Before we do, however, we'll capture the timestamp to use later in this article. We will also sleep for ten seconds. Again, our DML must be committed.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SESSION SET nls_timestamp_format = 'DD-MON-YYYY HH24:MI:SS.FF3';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; EXEC DBMS_LOCK.SLEEP(10);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT LOCALTIMESTAMP AS lower_bound FROM dual;&lt;br /&gt;&lt;br /&gt;LOWER_BOUND&lt;br /&gt;------------------------&lt;br /&gt;10-AUG-2005 18:01:07.109&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; UPDATE fbt SET y = LOCALTIMESTAMP, z = 'First update';&lt;br /&gt;&lt;br /&gt;1 row updated.&lt;br /&gt;&lt;br /&gt;SQL&gt; COMMIT;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;Next, we update the data a second time and capture the timestamp after the commit.&lt;br /&gt;&lt;br /&gt;SQL&gt; EXEC DBMS_LOCK.SLEEP(10);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; UPDATE fbt SET y = LOCALTIMESTAMP, z = 'Second update';&lt;br /&gt;&lt;br /&gt;1 row updated.&lt;br /&gt;&lt;br /&gt;SQL&gt; COMMIT;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT LOCALTIMESTAMP AS upper_bound FROM dual;&lt;br /&gt;&lt;br /&gt;UPPER_BOUND&lt;br /&gt;------------------------&lt;br /&gt;10-AUG-2005 18:01:17.125&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;Finally, we will delete the data and commit the change.&lt;br /&gt;&lt;br /&gt;SQL&gt; EXEC DBMS_LOCK.SLEEP(10);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; DELETE FROM fbt WHERE x = 1;&lt;br /&gt;&lt;br /&gt;1 row deleted.&lt;br /&gt;&lt;br /&gt;SQL&gt; COMMIT;&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;Following the sample data population, we should have no data in the FBT table, which we can verify as follows.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT * FROM fbt;&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;flashback version query&lt;br /&gt;&lt;br /&gt;Despite the fact that there is no data in FBT, we can now run some flashback version queries against it. This will enable us to view the data as it evolved between commits. Flashback version query is invoked using the new VERSIONS BETWEEN extension to the FROM clause. It takes two forms as follows:&lt;br /&gt;&lt;br /&gt;VERSIONS BETWEEN TIMESTAMP [lower bound] AND [upper bound]; or&lt;br /&gt;VERSIONS BETWEEN SCN [lower bound] AND [lower bound].&lt;br /&gt;The lower and upper boundaries can either be specific timestamps/SCNs or the keywords MINVALUE and MAXVALUE. These keywords instruct Oracle to retrieve all available data versions. The age of the data available is determined by the undo_retention parameter. For our first flashback version query, we will attempt to retrieve all available data.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SESSION SET nls_timestamp_format = 'DD-MON-YYYY HH24:MI:SS.FF3';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT x, y, z&lt;br /&gt;  2  FROM   fbt VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE&lt;br /&gt;  3  ORDER  BY&lt;br /&gt;  4         y;&lt;br /&gt;&lt;br /&gt;         X Y                         Z&lt;br /&gt;---------- ------------------------- -----------------------&lt;br /&gt;         1 10-AUG-2005 18:00:57.078  Initial population&lt;br /&gt;         1 10-AUG-2005 18:01:07.109  First update&lt;br /&gt;         1 10-AUG-2005 18:01:17.125  Second update&lt;br /&gt;         1 10-AUG-2005 18:01:17.125  Second update&lt;br /&gt;&lt;br /&gt;4 rows selected.&lt;br /&gt;We have seemingly generated four rows of data from one source record. What we are seeing, however, is the evolution of this single record in terms of all the values it has held over time (depending on its presence in the undo segments). However, we can see that the second update entry appears twice, yet we have no way of identifying why from the above output. Flashback version query therefore includes several pseudo-columns to describe each version of our data, which we can now use to determine the actual operations and change times.&lt;br /&gt;&lt;br /&gt;versions pseudo-columns&lt;br /&gt;&lt;br /&gt;As stated above, Oracle provides a variety of metadata with each version of our data. The metadata is exposed via a number of pseudo-columns that we can use with our flashback version queries. These pseudo-columns are as follows:&lt;br /&gt;&lt;br /&gt;VERSIONS_STARTTIME (start timestamp of version);&lt;br /&gt;VERSIONS_STARTSCN (start SCN of version);&lt;br /&gt;VERSIONS_ENDTIME (end timestamp of version);&lt;br /&gt;VERSIONS_ENDSCN (end SCN of version);&lt;br /&gt;VERSIONS_XID (transaction ID of version); and&lt;br /&gt;VERSIONS_OPERATION (DML operation of version).&lt;br /&gt;We can now include some of these pseudo-columns in our flashback version query as follows. Note the SCN metadata is excluded as we are using timestamps for the examples.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT z&lt;br /&gt;  2  ,      VERSIONS_STARTTIME&lt;br /&gt;  3  ,      VERSIONS_ENDTIME&lt;br /&gt;  4  ,      VERSIONS_XID&lt;br /&gt;  5  ,      VERSIONS_OPERATION&lt;br /&gt;  6  FROM   fbt VERSIONS BETWEEN TIMESTAMP MINVALUE AND MAXVALUE&lt;br /&gt;  7  ORDER  BY&lt;br /&gt;  8         VERSIONS_ENDTIME;&lt;br /&gt;Z                    VERSIONS_STARTTIME        VERSIONS_ENDTIME          VERSIONS_XID     VERSIONS_OPERATION&lt;br /&gt;-------------------- ------------------------- ------------------------- ---------------- ------------------&lt;br /&gt;Initial population   10-AUG-2005 18:00:53.000  10-AUG-2005 18:01:05.000  040026008A010000 I&lt;br /&gt;First update         10-AUG-2005 18:01:05.000  10-AUG-2005 18:01:14.000  040029008A010000 U&lt;br /&gt;Second update        10-AUG-2005 18:01:14.000  10-AUG-2005 18:01:26.000  040027008A010000 U&lt;br /&gt;Second update        10-AUG-2005 18:01:26.000                            040028008A010000 D&lt;br /&gt;&lt;br /&gt;4 rows selected.&lt;br /&gt;This explains why we were seeing the second update row twice. If we look at the VERSIONS_OPERATION column, we can see that the second appearance of the final update record is actually the delete operation against it (specified by 'D'). Without the versions metadata, the Y timestamp column was actually confusing us into thinking we had two versions of the same record at the same time.&lt;br /&gt;&lt;br /&gt;The metadata also gives us an indication that the delete operation was the final version of this data. The end timestamp of the version is NULL which tells us that there is no superceding record.&lt;br /&gt;&lt;br /&gt;Interestingly, if we had not included a sleep between creating the FBT table and adding the single record, it would be likely (based on observations) that all VERSIONS_* pseudo-columns (except the ENDTIME and ENDSCN) would be NULL for the insert record.&lt;br /&gt;&lt;br /&gt;flashback transaction query&lt;br /&gt;&lt;br /&gt;Oracle has provided a new view, FLASHBACK_TRANSACTION_QUERY, to provide more information about the data versions. This includes the SQL required to reverse each change. Queries against this view are documented as "flashback transaction queries" and require the SELECT ANY TRANSACTION system privilege. The view definition is as follows.&lt;br /&gt;&lt;br /&gt;SQL&gt; desc flashback_transaction_query&lt;br /&gt; Name                          Null?    Type&lt;br /&gt; ----------------------------- -------- --------------------&lt;br /&gt; XID                                    RAW(8)&lt;br /&gt; START_SCN                              NUMBER&lt;br /&gt; START_TIMESTAMP                        DATE&lt;br /&gt; COMMIT_SCN                             NUMBER&lt;br /&gt; COMMIT_TIMESTAMP                       DATE&lt;br /&gt; LOGON_USER                             VARCHAR2(30)&lt;br /&gt; UNDO_CHANGE#                           NUMBER&lt;br /&gt; OPERATION                              VARCHAR2(32)&lt;br /&gt; TABLE_NAME                             VARCHAR2(256)&lt;br /&gt; TABLE_OWNER                            VARCHAR2(32)&lt;br /&gt; ROW_ID                                 VARCHAR2(19)&lt;br /&gt; UNDO_SQL                               VARCHAR2(4000)&lt;br /&gt;The VERSIONS_XID pseudo-column gives us the key to this view (the XID column) for specific versions of data. Rather than filter on XID, we will look at all records currently available for our FBT table, concentrating on the more interesting UNDO_SQL column.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT xid&lt;br /&gt;  2  ,      operation&lt;br /&gt;  3  ,      undo_sql&lt;br /&gt;  4  FROM   flashback_transaction_query&lt;br /&gt;  5  WHERE  table_owner = USER&lt;br /&gt;  6  AND    table_name = 'FBT'&lt;br /&gt;  7  ORDER  BY&lt;br /&gt;  8         start_timestamp;&lt;br /&gt;&lt;br /&gt;XID              OPERATION UNDO_SQL&lt;br /&gt;---------------- --------- ------------------------------------------------------------&lt;br /&gt;040026008A010000 INSERT    delete from "SCOTT"."FBT" where ROWID = 'AAANCeAAEAAAAuXAAA'&lt;br /&gt;                           ;&lt;br /&gt;&lt;br /&gt;040029008A010000 UPDATE    update "SCOTT"."FBT" set "Y" = TO_TIMESTAMP('10-AUG-2005 18:&lt;br /&gt;                           00:57.000'), "Z" = 'Initial population' where ROWID = 'AAANC&lt;br /&gt;                           eAAEAAAAuXAAA';&lt;br /&gt;&lt;br /&gt;040027008A010000 UPDATE    update "SCOTT"."FBT" set "Y" = TO_TIMESTAMP('10-AUG-2005 18:&lt;br /&gt;                           01:07.000'), "Z" = 'First update' where ROWID = 'AAANCeAAEAA&lt;br /&gt;                           AAuXAAA';&lt;br /&gt;&lt;br /&gt;040028008A010000 DELETE    insert into "SCOTT"."FBT"("X","Y","Z") values ('1',TO_TIMEST&lt;br /&gt;                           AMP('10-AUG-2005 18:01:17.000'),'Second update');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4 rows selected.&lt;br /&gt;The UNDO_SQL column shows us the reversal of every change we made to our sample record. Remember that we followed a sequence of INSERT-UPDATE-UPDATE-DELETE. The values in the OPERATION column show us this, reading from the top-down. The reversal of this sequence can be viewed by reading the UNDO_SQL column from the bottom-up. For recovery purposes this can be quite useful. Note that the user responsible for the change is also available.&lt;br /&gt;&lt;br /&gt;versions between explicit ranges&lt;br /&gt;&lt;br /&gt;So far, we have issued flashback version queries using the MINVALUE and MAXVALUE range boundaries. As noted earlier in the article, we can also supply specific timestamp or SCN ranges. Remember that we captured the timestamps before and after the updates of our data? We will use these to limit the data versions requested below. One restriction with using specific timestamps or SCNs is that they must be within the boundaries of the undo_retention parameter. Attempting to flashback to a version older than approximately query time-undo_retention will result in ORA-30052: invalid lower limit snapshot expression.&lt;br /&gt;&lt;br /&gt;Note that in the following examples, the ALTER SESSION statement is included for convenience, to save having to supply a long format mask in the TO_TIMESTAMP calls.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'DD-MON-YYYY HH24:MI:SS.FF3';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT x&lt;br /&gt;  2  ,      y&lt;br /&gt;  3  ,      z&lt;br /&gt;  4  ,      VERSIONS_OPERATION&lt;br /&gt;  5  FROM   fbt VERSIONS BETWEEN TIMESTAMP TO_TIMESTAMP('10-AUG-2005 18:01:07.109')&lt;br /&gt;  6                                    AND TO_TIMESTAMP('10-AUG-2005 18:01:17.125')&lt;br /&gt;  7  ORDER  BY&lt;br /&gt;  8         VERSIONS_ENDTIME;&lt;br /&gt;&lt;br /&gt;  X Y                         Z                    VERSIONS_OPERATION&lt;br /&gt;--- ------------------------- -------------------- ------------------&lt;br /&gt;  1 10-AUG-2005 18:00:57.078  Initial population&lt;br /&gt;  1 10-AUG-2005 18:01:07.109  First update         U&lt;br /&gt;  1 10-AUG-2005 18:01:17.125  Second update        U&lt;br /&gt;&lt;br /&gt;3 rows selected.&lt;br /&gt;Remember that we took the timestamp for the lower boundary before our first update. We can see this from the above version query. At this time, there was already a version of our data in existence (the initial insert). The VERSIONS_OPERATION pseudo-column is NULL for this record because the change had already occurred prior to the lower timestamp boundary. Our two updates occurred within the timestamp range, however, and the VERSIONS_OPERATION column shows us this. This is a useful tracking mechanism that enables us to distinguish between changes and existing data.&lt;br /&gt;&lt;br /&gt;a note on timestamps and scns&lt;br /&gt;&lt;br /&gt;As a final note, it is very simple to switch between SCNs and timestamps, should the need arise. Oracle 10g provides two conversion functions, TIMESTAMP_TO_SCN and SCN_TO_TIMESTAMP for this purpose. Timestamps are mapped to SCNs with a precision of approximately 3 seconds (in 9i this was 5 minutes). Most readers will be aware of the SYSTIMESTAMP and LOCALTIMESTAMP functions to capture timestamps, but we can also capture SCNs using the DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER function. We will complete this article with an example of each.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'DD-MON-YYYY HH24:MI:SS.FF3';&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT SYSTIMESTAMP&lt;br /&gt;  2  ,      LOCALTIMESTAMP&lt;br /&gt;  3  ,      DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER AS scn&lt;br /&gt;  4  FROM   dual;&lt;br /&gt;&lt;br /&gt;SYSTIMESTAMP                        LOCALTIMESTAMP                   SCN&lt;br /&gt;----------------------------------- ------------------------- ----------&lt;br /&gt;10-AUG-05 18.08.04.078000 +00:00    10-AUG-2005 18:08:04.078     1408640&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT SCN_TO_TIMESTAMP(1408640) AS ts&lt;br /&gt;  2  FROM   dual;&lt;br /&gt;&lt;br /&gt;TS&lt;br /&gt;-------------------------&lt;br /&gt;10-AUG-2005 18:08:03.000&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT TIMESTAMP_TO_SCN('10-AUG-2005 18:08:03.000') AS scn&lt;br /&gt;  2  FROM   dual;&lt;br /&gt;&lt;br /&gt;       SCN&lt;br /&gt;----------&lt;br /&gt;   1408640&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8270723908186893886?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8270723908186893886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8270723908186893886' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8270723908186893886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8270723908186893886'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/flashback-version-query-in-oracle-10g.html' title='Flashback version query in oracle 10g'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6469092527690587523</id><published>2008-09-07T08:29:00.001-07:00</published><updated>2008-09-07T08:29:17.592-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Optimizing Performance of Direct Path Loads'/><title type='text'>Optimizing Performance of Direct Path Loads</title><content type='html'>Optimizing Performance of Direct Path Loads&lt;br /&gt;&lt;br /&gt;You can control the time and temporary storage used during direct path loads.&lt;br /&gt;&lt;br /&gt;To minimize time:&lt;br /&gt;&lt;br /&gt;Preallocate storage space&lt;br /&gt;Presort the data&lt;br /&gt;Perform infrequent data saves&lt;br /&gt;Minimize use of the redo log&lt;br /&gt;Specify the number of column array rows and the size of the stream buffer&lt;br /&gt;Specify a date cache value&lt;br /&gt;To minimize space:&lt;br /&gt;&lt;br /&gt;When sorting data before the load, sort data on the index that requires the most temporary storage space&lt;br /&gt;Avoid index maintenance during the load&lt;br /&gt;Preallocating Storage for Faster Loading&lt;br /&gt;&lt;br /&gt;SQL*Loader automatically adds extents to the table if necessary, but this process takes time. For faster loads into a new table, allocate the required extents when the table is created.&lt;br /&gt;&lt;br /&gt;To calculate the space required by a table, see the information about managing database files in the Oracle9i Database Administrator's Guide. Then use the INITIAL or MINEXTENTS clause in the SQL CREATE TABLE statement to allocate the required space.&lt;br /&gt;&lt;br /&gt;Another approach is to size extents large enough so that extent allocation is infrequent.&lt;br /&gt;&lt;br /&gt;Presorting Data for Faster Indexing&lt;br /&gt;&lt;br /&gt;You can improve the performance of direct path loads by presorting your data on indexed columns. Presorting minimizes temporary storage requirements during the load. Presorting also allows you to take advantage of high-performance sorting routines that are optimized for your operating system or application.&lt;br /&gt;&lt;br /&gt;If the data is presorted and the existing index is not empty, then presorting minimizes the amount of temporary segment space needed for the new keys. The sort routine appends each new key to the key list.&lt;br /&gt;&lt;br /&gt;Instead of requiring extra space for sorting, only space for the keys is needed. To calculate the amount of storage needed, use a sort factor of 1.0 instead of 1.3. For more information on estimating storage requirements, see Temporary Segment Storage Requirements.&lt;br /&gt;&lt;br /&gt;If presorting is specified and the existing index is empty, then maximum efficiency is achieved. The new keys are simply inserted into the index. Instead of having a temporary segment and new index existing simultaneously with the empty, old index, only the new index exists. So, temporary storage is not required, and time is saved.&lt;br /&gt;&lt;br /&gt;SORTED INDEXES Clause&lt;br /&gt;&lt;br /&gt;The SORTED INDEXES clause identifies the indexes on which the data is presorted. This clause is allowed only for direct path loads. See Case Study 6: Loading Data Using the Direct Path Load Method for an example.&lt;br /&gt;&lt;br /&gt;Generally, you specify only one index in the SORTED INDEXES clause, because data that is sorted for one index is not usually in the right order for another index. When the data is in the same order for multiple indexes, however, all indexes can be specified at once.&lt;br /&gt;&lt;br /&gt;All indexes listed in the SORTED INDEXES clause must be created before you start the direct path load.&lt;br /&gt;&lt;br /&gt;Unsorted Data&lt;br /&gt;&lt;br /&gt;If you specify an index in the SORTED INDEXES clause, and the data is not sorted for that index, then the index is left in an Index Unusable state at the end of the load. The data is present, but any attempt to use the index results in an error. Any index that is left in an Index Unusable state must be rebuilt after the load.&lt;br /&gt;&lt;br /&gt;Multiple-Column Indexes&lt;br /&gt;&lt;br /&gt;If you specify a multiple-column index in the SORTED INDEXES clause, the data should be sorted so that it is ordered first on the first column in the index, next on the second column in the index, and so on.&lt;br /&gt;&lt;br /&gt;For example, if the first column of the index is city, and the second column is last name; then the data should be ordered by name within each city, as in the following list:&lt;br /&gt;&lt;br /&gt;Albuquerque      Adams&lt;br /&gt;Albuquerque      Hartstein&lt;br /&gt;Albuquerque      Klein&lt;br /&gt;...         ...&lt;br /&gt;Boston           Andrews&lt;br /&gt;Boston           Bobrowski&lt;br /&gt;Boston           Heigham&lt;br /&gt;...              ...&lt;br /&gt;Choosing the Best Sort Order&lt;br /&gt;&lt;br /&gt;For the best overall performance of direct path loads, you should presort the data based on the index that requires the most temporary segment space. For example, if the primary key is one numeric column, and the secondary key consists of three text columns, then you can minimize both sort time and storage requirements by presorting on the secondary key.&lt;br /&gt;&lt;br /&gt;To determine the index that requires the most storage space, use the following procedure:&lt;br /&gt;&lt;br /&gt;For each index, add up the widths of all columns in that index.&lt;br /&gt;For a single-table load, pick the index with the largest overall width.&lt;br /&gt;For each table in a multiple-table load, identify the index with the largest overall width for each table. If the same number of rows are to be loaded into each table, then again pick the index with the largest overall width. Usually, the same number of rows are loaded into each table.&lt;br /&gt;If a different number of rows are to be loaded into the indexed tables in a multiple-table load, then multiply the width of each index identified in step 3 by the number of rows that are to be loaded into that index, and pick the index with the largest result.&lt;br /&gt;Infrequent Data Saves&lt;br /&gt;&lt;br /&gt;Frequent data saves resulting from a small ROWS value adversely affect the performance of a direct path load. Because direct path loads can be many times faster than conventional loads, the value of ROWS should be considerably higher for a direct load than it would be for a conventional load.&lt;br /&gt;&lt;br /&gt;During a data save, loading stops until all of SQL*Loader's buffers are successfully written. You should select the largest value for ROWS that is consistent with safety. It is a good idea to determine the average time to load a row by loading a few thousand rows. Then you can use that value to select a good value for ROWS.&lt;br /&gt;&lt;br /&gt;For example, if you can load 20,000 rows per minute, and you do not want to repeat more than 10 minutes of work after an interruption, then set ROWS to be 200,000 (20,000 rows/minute * 10 minutes).&lt;br /&gt;&lt;br /&gt;Minimizing Use of the Redo Log&lt;br /&gt;&lt;br /&gt;One way to speed a direct load dramatically is to minimize use of the redo log. There are three ways to do this. You can disable archiving, you can specify that the load is UNRECOVERABLE, or you can set the NOLOG attribute of the objects being loaded. This section discusses all methods.&lt;br /&gt;&lt;br /&gt;Disabling Archiving&lt;br /&gt;&lt;br /&gt;If archiving is disabled, direct path loads do not generate full image redo. Use the ARCHIVELOG and NOARCHIVELOG parameters to set the archiving mode. See the Oracle9i Database Administrator's Guide for more information about archiving.&lt;br /&gt;&lt;br /&gt;Specifying the UNRECOVERABLE Parameter&lt;br /&gt;&lt;br /&gt;To save time and space in the redo log file, use the UNRECOVERABLE parameter when you load data. An UNRECOVERABLE load does not record loaded data in the redo log file; instead, it generates invalidation redo.&lt;br /&gt;&lt;br /&gt;The UNRECOVERABLE parameter applies to all objects loaded during the load session (both data and index segments). Therefore, media recovery is disabled for the loaded table, although database changes by other users may continue to be logged.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;Because the data load is not logged, you may want to make a backup of the data after loading.&lt;br /&gt;&lt;br /&gt;If media recovery becomes necessary on data that was loaded with the UNRECOVERABLE parameter, the data blocks that were loaded are marked as logically corrupted.&lt;br /&gt;&lt;br /&gt;To recover the data, drop and re-create the data. It is a good idea to do backups immediately after the load to preserve the otherwise unrecoverable data.&lt;br /&gt;&lt;br /&gt;By default, a direct path load is RECOVERABLE.&lt;br /&gt;&lt;br /&gt;Setting the NOLOG Attribute&lt;br /&gt;&lt;br /&gt;If a data or index segment has the NOLOG attribute set, then full image redo logging is disabled for that segment (invalidation redo is generated.) Use of the NOLOG attribute allows a finer degree of control over the objects that are not logged.&lt;br /&gt;&lt;br /&gt;Specifying the Number of Column Array Rows and Size of Stream Buffers&lt;br /&gt;&lt;br /&gt;The number of column array rows determines the number of rows loaded before the stream buffer is built. The STREAMSIZE parameter specifies the size (in bytes) of the data stream sent from the client to the server.&lt;br /&gt;&lt;br /&gt;Use the COLUMNARRAYROWS parameter to specify a value for the number of column array rows.&lt;br /&gt;&lt;br /&gt;Use the STREAMSIZE parameter to specify the size for direct path stream buffers.&lt;br /&gt;&lt;br /&gt;The optimal values for these parameters vary, depending on the system, input datatypes, and Oracle column datatypes used. When you are using optimal values for your particular configuration, the elapsed time in the SQL*Loader log file should go down.&lt;br /&gt;&lt;br /&gt;To see a list of default values for these and other parameters, invoke SQL*Loader without any parameters, as described in Invoking SQL*Loader.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;You should monitor process paging activity, because if paging becomes excessive, performance can be significantly degraded. You may need to lower the values for READSIZE, STREAMSIZE, and COLUMNARRAYROWS to avoid excessive paging.&lt;br /&gt;&lt;br /&gt;It can be particularly useful to specify the number of column array rows and size of the steam buffer when you perform direct path loads on multiple-CPU systems. See Optimizing Direct Path Loads on Multiple-CPU Systems for more information.&lt;br /&gt;&lt;br /&gt;Specifying a Value for the Date Cache&lt;br /&gt;&lt;br /&gt;If you are performing a direct path load in which the same date or timestamp values are loaded many times, a large percentage of total load time can end up being used for converting date and timestamp data. This is especially true if multiple date columns are being loaded. In such a case, it may be possible to improve performance by using the SQL*Loader date cache.&lt;br /&gt;&lt;br /&gt;The date cache reduces the number of date conversions done when many duplicate values are present in the input data. It allows you to specify the number of unique dates anticipated during the load.&lt;br /&gt;&lt;br /&gt;The date cache is enabled by default. To completely disable the date cache, set it to 0.&lt;br /&gt;&lt;br /&gt;The default date cache size is 1000 elements. If the default is used and the number of unique input values loaded exceeds 1000, then the date cache is automatically disabled for that table. This prevents excessive and unnecessary lookup times that could affect performance. However, if instead of using the default, you specify a nonzero value for the date cache and it is exceeded, the date cache is not disabled. Instead, any input data that exceeded the maximum is explicitly converted using the appropriate conversion routines.&lt;br /&gt;&lt;br /&gt;The date cache can be associated with only one table. No date cache sharing can take place across tables. A date cache is created for a table only if all of the following conditions are true:&lt;br /&gt;&lt;br /&gt;The DATE_CACHE parameter is not set to 0&lt;br /&gt;One or more date values, timestamp values, or both are being loaded that require datatype conversion in order to be stored in the table&lt;br /&gt;The load is a direct path load&lt;br /&gt;Date cache statistics are written to the log file. You can use those statistics to improve direct path load performance as follows:&lt;br /&gt;&lt;br /&gt;If the number of cache entries is less than the cache size and there are no cache misses, then the cache size could safely be set to a smaller value.&lt;br /&gt;If the number of cache hits (entries for which there are duplicate values) is small and the number of cache misses is large, then the cache size should be increased. Be aware that if the cache size is increased too much, it may cause other problems such as excessive paging or too much memory usage.&lt;br /&gt;If most of the input date values are unique, the date cache will not enhance performance and therefore should not be used.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;Date cache statistics are not written to the SQL*Loader log file if the cache was active by default and disabled because the maximum was exceeded.&lt;br /&gt;&lt;br /&gt;If increasing the cache size does not improve performance, revert to the default behavior or set the cache size to 0. The overall performance improvement also depends on the datatypes of the other columns being loaded. Improvement will be greater for cases in which the total number of date columns loaded is large compared to other types of data loaded.&lt;br /&gt;&lt;br /&gt;See Also:&lt;br /&gt;DATE_CACHE&lt;br /&gt;Table Load Information for an example of how date cache statistics are presented in the SQL*Loader log file&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6469092527690587523?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6469092527690587523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6469092527690587523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6469092527690587523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6469092527690587523'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/optimizing-performance-of-direct-path.html' title='Optimizing Performance of Direct Path Loads'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8540522872476151525</id><published>2008-09-07T08:22:00.000-07:00</published><updated>2008-09-07T08:23:05.060-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Conversion During Direct Path Loads'/><title type='text'>Data Conversion During Direct Path Loads</title><content type='html'>Data Conversion During Direct Path Loads&lt;br /&gt;&lt;br /&gt;During a direct path load, data conversion occurs on the client side rather than on the server side. This means that NLS parameters in the initialization parameter file (server-side language handle) will not be used. To override this behavior, you can specify a format mask in the SQL*Loader control file which is equivalent to the setting of the NLS parameter in the initialization parameter file, or set the appropriate environment variable. For example, to specify a date format for a field, you can either set the date format in the SQL*Loader control file as shown in Example 9-1 or set an NLS_DATE_FORMAT environment variable as shown in Example 9-2.&lt;br /&gt;&lt;br /&gt;Example 9-1 Setting the Date Format in the SQL*Loader Control File&lt;br /&gt;&lt;br /&gt;LOAD DATA&lt;br /&gt;INFILE 'data.dat'&lt;br /&gt;INSERT INTO TABLE emp&lt;br /&gt;FIELDS TERMINATED BY "|"&lt;br /&gt;(&lt;br /&gt;EMPNO NUMBER(4) NOT NULL,&lt;br /&gt;ENAME CHAR(10),&lt;br /&gt;JOB CHAR(9),&lt;br /&gt;MGR NUMBER(4),&lt;br /&gt;HIREDATE DATE 'YYYYMMDD',&lt;br /&gt;SAL NUMBER(7,2),&lt;br /&gt;COMM NUMBER(7,2),&lt;br /&gt;DEPTNO NUMBER(2)&lt;br /&gt;)&lt;br /&gt;Example 9-2 Setting an NLS_DATE_FORMAT Environment Variable&lt;br /&gt;&lt;br /&gt;On UNIX bourne or korn shell:&lt;br /&gt;&lt;br /&gt;% NLS_DATE_FORMAT='YYYYMMDD'&lt;br /&gt;% export NLS_DATE_FORMAT&lt;br /&gt;&lt;br /&gt;On UNIX csh:&lt;br /&gt;&lt;br /&gt;%setenv NLS_DATE_FORMAT='YYYYMMDD'&lt;br /&gt;Direct Path Load of a Partitioned or Subpartitioned Table&lt;br /&gt;&lt;br /&gt;When loading a partitioned or subpartitioned table, SQL*Loader partitions the rows and maintains indexes (which can also be partitioned). Note that a direct path load of a partitioned or subpartitioned table can be quite resource-intensive for tables with many partitions or subpartitions.&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;If you are performing a direct path load into multiple partitions and a space error occurs, the load is rolled back to the last commit point. If there was no commit point, then the entire load is rolled back. This ensures that no data encountered after the space error is written out to a different partition.&lt;br /&gt;&lt;br /&gt;You can use the ROWS parameter to specify the frequency of the commit points. If the ROWS parameter is not specified, the entire load is rolled back.&lt;br /&gt;&lt;br /&gt;Direct Path Load of a Single Partition or Subpartition&lt;br /&gt;&lt;br /&gt;When loading a single partition of a partitioned or subpartitioned table, SQL*Loader partitions the rows and rejects any rows that do not map to the partition or subpartition specified in the SQL*Loader control file. Local index partitions that correspond to the data partition or subpartition being loaded are maintained by SQL*Loader. Global indexes are not maintained on single partition or subpartition direct path loads. During a direct path load of a single partition, SQL*Loader uses the partition-extended syntax of the LOAD statement, which has either of the following forms:&lt;br /&gt;&lt;br /&gt;LOAD INTO TABLE T PARTITION (P) VALUES ... &lt;br /&gt;&lt;br /&gt;LOAD INTO TABLE T SUBPARTITION (P) VALUES ... &lt;br /&gt;&lt;br /&gt;While you are loading a partition of a partitioned or subpartitioned table, you are also allowed to perform DML operations on, and direct path loads of, other partitions in the table.&lt;br /&gt;&lt;br /&gt;Although a direct path load minimizes database processing, several calls to the Oracle database server are required at the beginning and end of the load to initialize and finish the load, respectively. Also, certain DML locks are required during load initialization and are released when the load completes. The following operations occur during the load: index keys are built and put into a sort, and space management routines are used to get new extents when needed and to adjust the upper boundary (high-water mark) for a data savepoint. See Using Data Saves to Protect Against Data Loss for information on adjusting the upper boundary.&lt;br /&gt;&lt;br /&gt;Advantages of a Direct Path Load&lt;br /&gt;&lt;br /&gt;A direct path load is faster than the conventional path for the following reasons:&lt;br /&gt;&lt;br /&gt;Partial blocks are not used, so no reads are needed to find them, and fewer writes are performed.&lt;br /&gt;SQL*Loader need not execute any SQL INSERT statements; therefore, the processing load on the Oracle database is reduced.&lt;br /&gt;A direct path load calls on Oracle to lock tables and indexes at the start of the load and releases them when the load is finished. A conventional path load calls Oracle once for each array of rows to process a SQL INSERT statement.&lt;br /&gt;A direct path load uses multiblock asynchronous I/O for writes to the database files.&lt;br /&gt;During a direct path load, processes perform their own write I/O, instead of using Oracle's buffer cache. This minimizes contention with other Oracle users.&lt;br /&gt;The sorted indexes option available during direct path loads allows you to presort data using high-performance sort routines that are native to your system or installation.&lt;br /&gt;When a table to be loaded is empty, the presorting option eliminates the sort and merge phases of index-building. The index is filled in as data arrives.&lt;br /&gt;Protection against instance failure does not require redo log file entries during direct path loads. Therefore, no time is required to log the load when:&lt;br /&gt;Oracle is operating in NOARCHIVELOG mode&lt;br /&gt;The UNRECOVERABLE parameter is set to Y&lt;br /&gt;The object being loaded has the NOLOG attribute set&lt;br /&gt;See Instance Recovery and Direct Path Loads.&lt;br /&gt;&lt;br /&gt;Restrictions on Using Direct Path Loads&lt;br /&gt;&lt;br /&gt;The following conditions must be satisfied for you to use the direct path load method:&lt;br /&gt;&lt;br /&gt;Tables are not clustered.&lt;br /&gt;Tables to be loaded do not have any active transactions pending.&lt;br /&gt;&lt;br /&gt;To check for this condition, use the Oracle Enterprise Manager command MONITOR TABLE to find the object ID for the tables you want to load. Then use the command MONITOR LOCK to see if there are any locks on the tables.&lt;br /&gt;&lt;br /&gt;For versions of the Oracle database server prior to 9i, you can only perform a SQL*Loader direct path load when the client and server are the same version. This also means that you cannot perform a direct path load of Oracle9i data into a database of an earlier version. For example, you cannot use direct path load to load data from a release 9.0.1 database into a release 8.1.7 database.&lt;br /&gt;&lt;br /&gt;However, beginning with Oracle9i, you can perform a SQL*Loader direct path load between different versions as long as both the client and server are version 9i or later. For example, you can perform a direct path load from a release 9.0.1 database into a release 9.2 database.&lt;br /&gt;&lt;br /&gt;The following features are not available with direct path load.&lt;br /&gt;&lt;br /&gt;Loading VARRAYs&lt;br /&gt;Loading a parent table together with a child table&lt;br /&gt;Loading BFILE columns&lt;br /&gt;Restrictions on a Direct Path Load of a Single Partition&lt;br /&gt;&lt;br /&gt;In addition to the previously listed restrictions, loading a single partition has the following restrictions:&lt;br /&gt;&lt;br /&gt;The table that the partition is a member of cannot have any global indexes defined on it.&lt;br /&gt;Enabled referential and check constraints on the table that the partition is a member of are not allowed.&lt;br /&gt;Enabled triggers are not allowed.&lt;br /&gt;When to Use a Direct Path Load&lt;br /&gt;&lt;br /&gt;If none of the previous restrictions apply, you should use a direct path load when:&lt;br /&gt;&lt;br /&gt;You have a large amount of data to load quickly. A direct path load can quickly load and index large amounts of data. It can also load data into either an empty or nonempty table.&lt;br /&gt;You want to load data in parallel for maximum performance. See Parallel Data Loading Models.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8540522872476151525?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8540522872476151525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8540522872476151525' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8540522872476151525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8540522872476151525'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/data-conversion-during-direct-path.html' title='Data Conversion During Direct Path Loads'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3314855634110636134</id><published>2008-09-07T08:19:00.001-07:00</published><updated>2008-09-07T08:20:33.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Loading Methods - SQL Loader'/><title type='text'>Data Loading Methods - SQL Loader</title><content type='html'>Data Loading Methods&lt;br /&gt;&lt;br /&gt;SQL*Loader provides two methods for loading data:&lt;br /&gt;&lt;br /&gt;Conventional Path Load&lt;br /&gt;Direct Path Load&lt;br /&gt;A conventional path load executes SQL INSERT statements to populate tables in an Oracle database. A direct path load eliminates much of the Oracle database overhead by formatting Oracle data blocks and writing the data blocks directly to the database files. A direct load does not compete with other users for database resources, so it can usually load data at near disk speed. Considerations inherent to direct path loads, such as restrictions, security, and backup implications, are discussed in this chapter.&lt;br /&gt;&lt;br /&gt;The tables to be loaded must already exist in the database. SQL*Loader never creates tables. It loads existing tables that either already contain data or are empty.&lt;br /&gt;&lt;br /&gt;The following privileges are required for a load:&lt;br /&gt;&lt;br /&gt;You must have INSERT privileges on the table to be loaded.&lt;br /&gt;You must have DELETE privileges on the table to be loaded, when using the REPLACE or TRUNCATE option to empty old data from the table before loading the new data in its place.&lt;br /&gt;&lt;br /&gt;Conventional Path Load&lt;br /&gt;&lt;br /&gt;Conventional path load (the default) uses the SQL INSERT statement and a bind array buffer to load data into database tables. This method is used by all Oracle tools and applications.&lt;br /&gt;&lt;br /&gt;When SQL*Loader performs a conventional path load, it competes equally with all other processes for buffer resources. This can slow the load significantly. Extra overhead is added as SQL commands are generated, passed to Oracle, and executed.&lt;br /&gt;&lt;br /&gt;The Oracle database server looks for partially filled blocks and attempts to fill them on each insert. Although appropriate during normal use, this can slow bulk loads dramatically.&lt;br /&gt;&lt;br /&gt;Conventional Path Load of a Single Partition&lt;br /&gt;&lt;br /&gt;By definition, a conventional path load uses SQL INSERT statements. During a conventional path load of a single partition, SQL*Loader uses the partition-extended syntax of the INSERT statement, which has the following form:&lt;br /&gt;&lt;br /&gt;INSERT INTO TABLE T PARTITION (P) VALUES ... &lt;br /&gt;The SQL layer of the Oracle kernel determines if the row being inserted maps to the specified partition. If the row does not map to the partition, the row is rejected, and the SQL*Loader log file records an appropriate error message.&lt;br /&gt;&lt;br /&gt;When to Use a Conventional Path Load&lt;br /&gt;&lt;br /&gt;If load speed is most important to you, you should use direct path load because it is faster than conventional path load. However, certain restrictions on direct path loads may require you to use a conventional path load. You should use a conventional path load in the following situations:&lt;br /&gt;&lt;br /&gt;When accessing an indexed table concurrently with the load, or when applying inserts or updates to a nonindexed table concurrently with the load&lt;br /&gt;&lt;br /&gt;To use a direct path load (with the exception of parallel loads), SQL*Loader must have exclusive write access to the table and exclusive read/write access to any indexes.&lt;br /&gt;&lt;br /&gt;When loading data into a clustered table&lt;br /&gt;&lt;br /&gt;A direct path load does not support loading of clustered tables.&lt;br /&gt;&lt;br /&gt;When loading a relatively small number of rows into a large indexed table&lt;br /&gt;&lt;br /&gt;During a direct path load, the existing index is copied when it is merged with the new index keys. If the existing index is very large and the number of new keys is very small, then the index copy time can offset the time saved by a direct path load.&lt;br /&gt;&lt;br /&gt;When loading a relatively small number of rows into a large table with referential and column-check integrity constraints&lt;br /&gt;&lt;br /&gt;Because these constraints cannot be applied to rows loaded on the direct path, they are disabled for the duration of the load. Then they are applied to the whole table when the load completes. The costs could outweigh the savings for a very large table and a small number of new rows.&lt;br /&gt;&lt;br /&gt;When loading records and you want to ensure that a record is rejected under any of the following circumstances:&lt;br /&gt;If the record, upon insertion, causes an Oracle error&lt;br /&gt;If the record is formatted incorrectly, so that SQL*Loader cannot find field boundaries&lt;br /&gt;If the record violates a constraint or tries to make a unique index non-unique&lt;br /&gt;Direct Path Load&lt;br /&gt;&lt;br /&gt;Instead of filling a bind array buffer and passing it to the Oracle database server with a SQL INSERT statement, a direct path load uses the direct path API to pass the data to be loaded to the load engine in the server. The load engine builds a column array structure from the data passed to it.&lt;br /&gt;&lt;br /&gt;The direct path load engine uses the column array structure to format Oracle data blocks and build index keys. The newly formatted database blocks are written directly to the database (multiple blocks per I/O request using asynchronous writes if the host platform supports asynchronous I/O).&lt;br /&gt;&lt;br /&gt;Internally, multiple buffers are used for the formatted blocks. While one buffer is being filled, one or more buffers are being written if asynchronous I/O is available on the host platform. Overlapping computation with I/O increases load performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3314855634110636134?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3314855634110636134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3314855634110636134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3314855634110636134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3314855634110636134'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/data-loading-methods-sql-loader.html' title='Data Loading Methods - SQL Loader'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8581783195929271237</id><published>2008-09-07T08:15:00.001-07:00</published><updated>2008-09-07T08:15:23.564-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How Does Data Pump Access Data?'/><title type='text'>How Does Data Pump Access Data?</title><content type='html'>How Does Data Pump Access Data?&lt;br /&gt;&lt;br /&gt;Data Pump supports two access methods to load and unload table row data: direct path and external tables. Because both methods support the same external data representation, data that is unloaded with one method can be loaded using the other method. Data Pump automatically chooses the fastest method appropriate for each table.&lt;br /&gt;&lt;br /&gt;Data Pump also uses functionality provided in the DBMS_METADATA PL/SQL package to handle all operations involving metadata, including complete extraction, transformation, and re-creation of all database object definitions.&lt;br /&gt;&lt;br /&gt;Direct Path Loads and Unloads&lt;br /&gt;&lt;br /&gt;The Oracle database has provided direct path unload capability for export operations since Oracle release 7.3 and a direct path API for OCI since Oracle8i. Data Pump technology enhances direct path technology in the following ways:&lt;br /&gt;&lt;br /&gt;Support of a direct path, proprietary format unload.&lt;br /&gt;&lt;br /&gt;Improved performance through elimination of unnecessary conversions. This is possible because the direct path internal stream format is used as the format stored in the Data Pump dump files.&lt;br /&gt;&lt;br /&gt;Support of additional datatypes and transformations.&lt;br /&gt;&lt;br /&gt;Data Pump uses direct path load and unload when the structure of a table allows it.&lt;br /&gt;&lt;br /&gt;In the following circumstances, Data Pump cannot use direct path loading:&lt;br /&gt;&lt;br /&gt;A global index on multipartition tables exists during a single-partition load. This includes object tables that are partitioned.&lt;br /&gt;&lt;br /&gt;A domain index exists for a LOB column.&lt;br /&gt;&lt;br /&gt;A table is in a cluster.&lt;br /&gt;&lt;br /&gt;A table has an active trigger.&lt;br /&gt;&lt;br /&gt;A table has fine-grained access control enabled in insert mode.&lt;br /&gt;&lt;br /&gt;A table contains BFILE columns or columns of opaque types.&lt;br /&gt;&lt;br /&gt;A referential integrity constraint is present.&lt;br /&gt;&lt;br /&gt;A table contains VARRAY columns with an embedded opaque type.&lt;br /&gt;&lt;br /&gt;If any of these conditions exist for a table, Data Pump uses external tables rather than direct path to move the data for that table.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8581783195929271237?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8581783195929271237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8581783195929271237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8581783195929271237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8581783195929271237'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/how-does-data-pump-access-data.html' title='How Does Data Pump Access Data?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5234270247092032808</id><published>2008-09-07T08:11:00.001-07:00</published><updated>2008-09-07T08:11:46.953-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle data pump 10g impdp help'/><title type='text'>Oracle data pump 10g impdp help</title><content type='html'>impdp help=y&lt;br /&gt;&lt;br /&gt;Import: Release 10.1.0.2.0 - Production on Saturday, 11 September, 2004 17:22&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Data Pump Import utility provides a mechanism for transferring data objects&lt;br /&gt;between Oracle databases. The utility is invoked with the following command:&lt;br /&gt;&lt;br /&gt;     Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp&lt;br /&gt;&lt;br /&gt;You can control how Import runs by entering the 'impdp' command followed&lt;br /&gt;by various parameters. To specify parameters, you use keywords:&lt;br /&gt;&lt;br /&gt;     Format:  impdp KEYWORD=value or KEYWORD=(value1,value2,...,valueN)&lt;br /&gt;     Example: impdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp&lt;br /&gt;&lt;br /&gt;USERID must be the first parameter on the command line.&lt;br /&gt;&lt;br /&gt;Keyword               Description (Default)&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;ATTACH                Attach to existing job, e.g. ATTACH [=job name].&lt;br /&gt;CONTENT               Specifies data to load where the valid keywords are:&lt;br /&gt;                      (ALL), DATA_ONLY, and METADATA_ONLY.&lt;br /&gt;DIRECTORY             Directory object to be used for dump, log, and sql files.&lt;br /&gt;DUMPFILE              List of dumpfiles to import from (expdat.dmp),&lt;br /&gt;                      e.g. DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.&lt;br /&gt;ESTIMATE              Calculate job estimates where the valid keywords are:&lt;br /&gt;                      (BLOCKS) and STATISTICS.&lt;br /&gt;EXCLUDE               Exclude specific object types, e.g. EXCLUDE=TABLE:EMP.&lt;br /&gt;FLASHBACK_SCN         SCN used to set session snapshot back to.&lt;br /&gt;FLASHBACK_TIME        Time used to get the SCN closest to the specified time.&lt;br /&gt;FULL                  Import everything from source (Y).&lt;br /&gt;HELP                  Display help messages (N).&lt;br /&gt;INCLUDE               Include specific object types, e.g. INCLUDE=TABLE_DATA.&lt;br /&gt;JOB_NAME              Name of import job to create.&lt;br /&gt;LOGFILE               Log file name (import.log).&lt;br /&gt;NETWORK_LINK          Name of remote database link to the source system.&lt;br /&gt;NOLOGFILE             Do not write logfile.&lt;br /&gt;PARALLEL              Change the number of active workers for current job.&lt;br /&gt;PARFILE               Specify parameter file.&lt;br /&gt;QUERY                 Predicate clause used to import a subset of a table.&lt;br /&gt;REMAP_DATAFILE        Redefine datafile references in all DDL statements.&lt;br /&gt;REMAP_SCHEMA          Objects from one schema are loaded into another schema.&lt;br /&gt;REMAP_TABLESPACE      Tablespace object are remapped to another tablespace.&lt;br /&gt;REUSE_DATAFILES       Tablespace will be initialized if it already exists (N).&lt;br /&gt;SCHEMAS               List of schemas to import.&lt;br /&gt;SKIP_UNUSABLE_INDEXES Skip indexes that were set to the Index Unusable state.&lt;br /&gt;SQLFILE               Write all the SQL DDL to a specified file.&lt;br /&gt;STATUS                Frequency (secs) job status is to be monitored where&lt;br /&gt;                      the default (0) will show new status when available.&lt;br /&gt;STREAMS_CONFIGURATION Enable the loading of Streams metadata&lt;br /&gt;TABLE_EXISTS_ACTION   Action to take if imported object already exists.&lt;br /&gt;                      Valid keywords: (SKIP), APPEND, REPLACE and TRUNCATE.&lt;br /&gt;TABLES                Identifies a list of tables to import.&lt;br /&gt;TABLESPACES           Identifies a list of tablespaces to import.&lt;br /&gt;TRANSFORM             Metadata transform to apply (Y/N) to specific objects.&lt;br /&gt;                      Valid transform keywords: SEGMENT_ATTRIBUTES and STORAGE.&lt;br /&gt;                      ex. TRANSFORM=SEGMENT_ATTRIBUTES:N:TABLE.&lt;br /&gt;TRANSPORT_DATAFILES   List of datafiles to be imported by transportable mode.&lt;br /&gt;TRANSPORT_FULL_CHECK  Verify storage segments of all tables (N).&lt;br /&gt;TRANSPORT_TABLESPACES List of tablespaces from which metadata will be loaded.&lt;br /&gt;                      Only valid in NETWORK_LINK mode import operations.&lt;br /&gt;VERSION               Version of objects to export where valid keywords are:&lt;br /&gt;                      (COMPATIBLE), LATEST, or any valid database version.&lt;br /&gt;                      Only valid for NETWORK_LINK and SQLFILE.&lt;br /&gt;&lt;br /&gt;The following commands are valid while in interactive mode.&lt;br /&gt;Note: abbreviations are allowed&lt;br /&gt;&lt;br /&gt;Command               Description (Default)&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;CONTINUE_CLIENT       Return to logging mode. Job will be re-started if idle.&lt;br /&gt;EXIT_CLIENT           Quit client session and leave job running.&lt;br /&gt;HELP                  Summarize interactive commands.&lt;br /&gt;KILL_JOB              Detach and delete job.&lt;br /&gt;PARALLEL              Change the number of active workers for current job.&lt;br /&gt;                      PARALLEL=.&lt;br /&gt;START_JOB             Start/resume current job.&lt;br /&gt;                      START_JOB=SKIP_CURRENT will start the job after skipping&lt;br /&gt;                      any action which was in progress when job was stopped.&lt;br /&gt;STATUS                Frequency (secs) job status is to be monitored where&lt;br /&gt;                      the default (0) will show new status when available.&lt;br /&gt;                      STATUS=[interval]&lt;br /&gt;STOP_JOB              Orderly shutdown of job execution and exits the client.&lt;br /&gt;                      STOP_JOB=IMMEDIATE performs an immediate shutdown of the&lt;br /&gt;                      Data Pump job.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5234270247092032808?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5234270247092032808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5234270247092032808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5234270247092032808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5234270247092032808'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-data-pump-10g-impdp-help.html' title='Oracle data pump 10g impdp help'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3264799508331410313</id><published>2008-09-07T08:10:00.000-07:00</published><updated>2008-09-07T08:11:04.683-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Data Pump expdp help'/><title type='text'>Oracle data pump 10g expdp help</title><content type='html'>Help&lt;br /&gt;&lt;br /&gt;The HELP=Y option displays the available parameters:&lt;br /&gt;expdp help=y&lt;br /&gt;&lt;br /&gt;Export: Release 10.1.0.2.0 - Production on Tuesday, 23 March, 2004 8:33&lt;br /&gt;&lt;br /&gt;Copyright (c) 2003, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Data Pump export utility provides a mechanism for transferring data objects&lt;br /&gt;between Oracle databases. The utility is invoked with the following command:&lt;br /&gt;&lt;br /&gt;   Example: expdp scott/tiger DIRECTORY=dmpdir DUMPFILE=scott.dmp&lt;br /&gt;&lt;br /&gt;You can control how Export runs by entering the 'expdp' command followed&lt;br /&gt;by various parameters. To specify parameters, you use keywords:&lt;br /&gt;&lt;br /&gt;   Format:  expdp KEYWORD=value or KEYWORD=(value1,value2,...,valueN)&lt;br /&gt;   Example: expdp scott/tiger DUMPFILE=scott.dmp DIRECTORY=dmpdir SCHEMAS=scott&lt;br /&gt;               or TABLES=(T1:P1,T1:P2), if T1 is partitioned table&lt;br /&gt;&lt;br /&gt;USERID must be the first parameter on the command line.&lt;br /&gt;&lt;br /&gt;Keyword               Description (Default)&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;ATTACH                Attach to existing job, e.g. ATTACH [=job name].&lt;br /&gt;CONTENT               Specifies data to unload where the valid keywords are:&lt;br /&gt;                      (ALL), DATA_ONLY, and METADATA_ONLY.&lt;br /&gt;DIRECTORY             Directory object to be used for dumpfiles and logfiles.&lt;br /&gt;DUMPFILE              List of destination dump files (expdat.dmp),&lt;br /&gt;                      e.g. DUMPFILE=scott1.dmp, scott2.dmp, dmpdir:scott3.dmp.&lt;br /&gt;ESTIMATE              Calculate job estimates where the valid keywords are:&lt;br /&gt;                      (BLOCKS) and STATISTICS.&lt;br /&gt;ESTIMATE_ONLY         Calculate job estimates without performing the export.&lt;br /&gt;EXCLUDE               Exclude specific object types, e.g. EXCLUDE=TABLE:EMP.&lt;br /&gt;FILESIZE              Specify the size of each dumpfile in units of bytes.&lt;br /&gt;FLASHBACK_SCN         SCN used to set session snapshot back to.&lt;br /&gt;FLASHBACK_TIME        Time used to get the SCN closest to the specified time.&lt;br /&gt;FULL                  Export entire database (N).&lt;br /&gt;HELP                  Display Help messages (N).&lt;br /&gt;INCLUDE               Include specific object types, e.g. INCLUDE=TABLE_DATA.&lt;br /&gt;JOB_NAME              Name of export job to create.&lt;br /&gt;LOGFILE               Log file name (export.log).&lt;br /&gt;NETWORK_LINK          Name of remote database link to the source system.&lt;br /&gt;NOLOGFILE             Do not write logfile (N).&lt;br /&gt;PARALLEL              Change the number of active workers for current job.&lt;br /&gt;PARFILE               Specify parameter file.&lt;br /&gt;QUERY                 Predicate clause used to export a subset of a table.&lt;br /&gt;SCHEMAS               List of schemas to export (login schema).&lt;br /&gt;STATUS                Frequency (secs) job status is to be monitored where&lt;br /&gt;                      the default (0) will show new status when available.&lt;br /&gt;TABLES                Identifies a list of tables to export - one schema only.&lt;br /&gt;TABLESPACES           Identifies a list of tablespaces to export.&lt;br /&gt;TRANSPORT_FULL_CHECK  Verify storage segments of all tables (N).&lt;br /&gt;TRANSPORT_TABLESPACES List of tablespaces from which metadata will be unloaded.&lt;br /&gt;VERSION               Version of objects to export where valid keywords are:&lt;br /&gt;                      (COMPATIBLE), LATEST, or any valid database version.&lt;br /&gt;&lt;br /&gt;The following commands are valid while in interactive mode.&lt;br /&gt;Note: abbreviations are allowed&lt;br /&gt;&lt;br /&gt;Command               Description&lt;br /&gt;------------------------------------------------------------------------------&lt;br /&gt;ADD_FILE              Add dumpfile to dumpfile set.&lt;br /&gt;                      ADD_FILE=dumpfile-name&lt;br /&gt;CONTINUE_CLIENT       Return to logging mode. Job will be re-started if idle.&lt;br /&gt;EXIT_CLIENT           Quit client session and leave job running.&lt;br /&gt;HELP                  Summarize interactive commands.&lt;br /&gt;KILL_JOB              Detach and delete job.&lt;br /&gt;PARALLEL              Change the number of active workers for current job.&lt;br /&gt;                      PARALLEL=.&lt;br /&gt;START_JOB             Start/resume current job.&lt;br /&gt;STATUS                Frequency (secs) job status is to be monitored where&lt;br /&gt;                      the default (0) will show new status when available.&lt;br /&gt;                      STATUS=[interval]&lt;br /&gt;STOP_JOB              Orderly shutdown of job execution and exits the client.&lt;br /&gt;                      STOP_JOB=IMMEDIATE performs an immediate shutdown of the&lt;br /&gt;                      Data Pump job.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3264799508331410313?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3264799508331410313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3264799508331410313' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3264799508331410313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3264799508331410313'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-data-pump-10g-expdp-help.html' title='Oracle data pump 10g expdp help'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-1065868835286234509</id><published>2008-09-07T08:08:00.001-07:00</published><updated>2008-09-07T08:08:42.088-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Exporting and Importing External tables using Data Pump'/><title type='text'>Exporting and Importing External tables using Data Pump</title><content type='html'>External Tables&lt;br /&gt;&lt;br /&gt;Oracle have incorporated support for data pump technology into external tables. The ORACLE_DATAPUMP access driver can be used to unload data to data pump export files and subsequently reload it. The unload of data occurs when the external table is created using the "AS" clause:&lt;br /&gt;CREATE TABLE emp_xt&lt;br /&gt;  ORGANIZATION EXTERNAL&lt;br /&gt;   (&lt;br /&gt;     TYPE ORACLE_DATAPUMP&lt;br /&gt;     DEFAULT DIRECTORY test_dir&lt;br /&gt;     LOCATION ('emp_xt.dmp')&lt;br /&gt;   )&lt;br /&gt;   AS SELECT * FROM emp;&lt;br /&gt;The data can then be queried using:&lt;br /&gt;SELECT * FROM emp_xt;&lt;br /&gt;The syntax to create the external table pointing to an existing file is similar, but without the "AS" clause:&lt;br /&gt;DROP TABLE emp_xt;&lt;br /&gt;&lt;br /&gt;CREATE TABLE emp_xt (&lt;br /&gt;  EMPNO     NUMBER(4),&lt;br /&gt;  ENAME     VARCHAR2(10),&lt;br /&gt;  JOB       VARCHAR2(9),&lt;br /&gt;  MGR       NUMBER(4),&lt;br /&gt;  HIREDATE  DATE,&lt;br /&gt;  SAL       NUMBER(7,2),&lt;br /&gt;  COMM      NUMBER(7,2),&lt;br /&gt;  DEPTNO    NUMBER(2))&lt;br /&gt;  ORGANIZATION EXTERNAL (&lt;br /&gt;     TYPE ORACLE_DATAPUMP&lt;br /&gt;     DEFAULT DIRECTORY test_dir&lt;br /&gt;     LOCATION ('emp_xt.dmp')&lt;br /&gt;  );&lt;br /&gt;&lt;br /&gt;SELECT * FROM emp_xt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-1065868835286234509?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/1065868835286234509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=1065868835286234509' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1065868835286234509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/1065868835286234509'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/exporting-and-importing-external-tables.html' title='Exporting and Importing External tables using Data Pump'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6364016488159703232</id><published>2008-09-07T08:06:00.001-07:00</published><updated>2008-09-07T08:06:38.884-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10g Data Pump APIs'/><title type='text'>Oracle 10g Data Pump APIs</title><content type='html'>Data Pump API&lt;br /&gt;&lt;br /&gt;Along with the data pump utilities Oracle provide an PL/SQL API. The following is an example of how this API can be used to perform a schema export:&lt;br /&gt;SET SERVEROUTPUT ON SIZE 1000000&lt;br /&gt;DECLARE&lt;br /&gt;  l_dp_handle       NUMBER;&lt;br /&gt;  l_last_job_state  VARCHAR2(30) := 'UNDEFINED';&lt;br /&gt;  l_job_state       VARCHAR2(30) := 'UNDEFINED';&lt;br /&gt;  l_sts             KU$_STATUS;&lt;br /&gt;BEGIN&lt;br /&gt;  l_dp_handle := DBMS_DATAPUMP.open(&lt;br /&gt;    operation   =&gt; 'EXPORT',&lt;br /&gt;    job_mode    =&gt; 'SCHEMA',&lt;br /&gt;    remote_link =&gt; NULL,&lt;br /&gt;    job_name    =&gt; 'EMP_EXPORT',&lt;br /&gt;    version     =&gt; 'LATEST');&lt;br /&gt;&lt;br /&gt;  DBMS_DATAPUMP.add_file(&lt;br /&gt;    handle    =&gt; l_dp_handle,&lt;br /&gt;    filename  =&gt; 'SCOTT.dmp',&lt;br /&gt;    directory =&gt; 'TEST_DIR');&lt;br /&gt;&lt;br /&gt;  DBMS_DATAPUMP.add_file(&lt;br /&gt;    handle    =&gt; l_dp_handle,&lt;br /&gt;    filename  =&gt; 'SCOTT.log',&lt;br /&gt;    directory =&gt; 'TEST_DIR',&lt;br /&gt;    filetype  =&gt; DBMS_DATAPUMP.KU$_FILE_TYPE_LOG_FILE);&lt;br /&gt;&lt;br /&gt;  DBMS_DATAPUMP.metadata_filter(&lt;br /&gt;    handle =&gt; l_dp_handle,&lt;br /&gt;    name   =&gt; 'SCHEMA_EXPR',&lt;br /&gt;    value  =&gt; '= ''SCOTT''');&lt;br /&gt;&lt;br /&gt;  DBMS_DATAPUMP.start_job(l_dp_handle);&lt;br /&gt;&lt;br /&gt;  DBMS_DATAPUMP.detach(l_dp_handle);&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;Once the job has started the status can be checked using:&lt;br /&gt;system@db10g&gt; select * from dba_datapump_jobs;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6364016488159703232?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6364016488159703232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6364016488159703232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6364016488159703232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6364016488159703232'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-10g-data-pump-apis.html' title='Oracle 10g Data Pump APIs'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-245026363991095258</id><published>2008-09-07T08:03:00.000-07:00</published><updated>2008-09-07T08:04:46.224-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Difference between old exp/imp and new data pump expdp/impdp'/><title type='text'>Difference between old exp/imp and new data pump expdp/impdp</title><content type='html'>Unlike the original exp and imp utilities all data pump ".dmp" and ".log" files are created on the Oracle server, not the client machine.&lt;br /&gt;&lt;br /&gt;All data pump actions are performed by multiple jobs (server processes not DBMS_JOB jobs). These jobs are controlled by a master control process which uses Advanced Queuing. At runtime an advanced queue table, named after the job name, is created and used by the master control process. The table is dropped on completion of the data pump job. The job and the advanced queue can be named using the JOB_NAME parameter. Cancelling the client process does not stop the associated data pump job. Issuing "ctrl+c" on the client during a job stops the client output and presents a command prompt. Typing "status" at this prompt allows you to monitor the current job:&lt;br /&gt;Export&gt; status&lt;br /&gt;&lt;br /&gt;Job: SYS_EXPORT_FULL_01&lt;br /&gt;  Operation: EXPORT&lt;br /&gt;  Mode: FULL&lt;br /&gt;  State: EXECUTING&lt;br /&gt;  Bytes Processed: 0&lt;br /&gt;  Current Parallelism: 1&lt;br /&gt;  Job Error Count: 0&lt;br /&gt;  Dump File: D:TEMPDB10G.DMP&lt;br /&gt;    bytes written: 4,096&lt;br /&gt;&lt;br /&gt;Worker 1 Status:&lt;br /&gt;  State: EXECUTING&lt;br /&gt;  Object Schema: SYSMAN&lt;br /&gt;  Object Name: MGMT_CONTAINER_CRED_ARRAY&lt;br /&gt;  Object Type: DATABASE_EXPORT/SCHEMA/TYPE/TYPE_SPEC&lt;br /&gt;  Completed Objects: 261&lt;br /&gt;  Total Objects: 261&lt;br /&gt;Data pump performance can be improved by using the PARALLEL parameter. This should be used in conjunction with the "%U" wildcard in the DUMPFILE parameter to allow multiple dumpfiles to be created or read:&lt;br /&gt;expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR parallel=4 dumpfile=SCOTT_%U.dmp logfile=expdpSCOTT.log&lt;br /&gt;The DBA_DATAPUMP_JOBS view can be used to monitor the current jobs:&lt;br /&gt;system@db10g&gt; select * from dba_datapump_jobs;&lt;br /&gt;&lt;br /&gt;OWNER_NAME                     JOB_NAME                       OPERATION&lt;br /&gt;------------------------------ ------------------------------ ------------------------------&lt;br /&gt;JOB_MODE                       STATE                              DEGREE ATTACHED_SESSIONS&lt;br /&gt;------------------------------ ------------------------------ ---------- -----------------&lt;br /&gt;SYSTEM                         SYS_EXPORT_FULL_01             EXPORT&lt;br /&gt;FULL                           EXECUTING                               1                 1&lt;br /&gt;The INCLUDE and EXCLUDE parameters can be used to limit the export/import to specific objects. When the INCLUDE parameter is used, only those objects specified by it will be included in the export. When the EXCLUDE parameter is used all objects except those specified by it will be included in the export:&lt;br /&gt;expdp scott/tiger@db10g schemas=SCOTT include=TABLE:"IN ('EMP', 'DEPT')" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log&lt;br /&gt;&lt;br /&gt;expdp scott/tiger@db10g schemas=SCOTT exclude=TABLE:"= 'BONUS'" directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-245026363991095258?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/245026363991095258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=245026363991095258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/245026363991095258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/245026363991095258'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/difference-between-old-expimp-and-new.html' title='Difference between old exp/imp and new data pump expdp/impdp'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-564119231109052331</id><published>2008-09-07T07:58:00.000-07:00</published><updated>2008-09-07T08:02:37.958-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Data pump 10g getting started'/><title type='text'>Oracle Data pump 10g getting started</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Setup account&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;CONN sys/password@db10g AS SYSDBA&lt;br /&gt;ALTER USER scott IDENTIFIED BY tiger ACCOUNT UNLOCK;&lt;br /&gt;GRANT CREATE ANY DIRECTORY TO scott;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE DIRECTORY test_dir AS '/u01/app/oracle/oradata/';&lt;br /&gt;GRANT READ, WRITE ON DIRECTORY test_dir TO scott;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Table Exports/Imports&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The TABLES parameter is used to specify the tables that are to be exported. The following is an example of the table export and import syntax:&lt;br /&gt;expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log&lt;br /&gt;&lt;br /&gt;impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log&lt;br /&gt;&lt;br /&gt;The TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Schema Exports/Imports&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The OWNER parameter of exp has been replaced by the SCHEMAS parameter which is used to specify the schemas to be exported. The following is an example of the schema export and import syntax:&lt;br /&gt;expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log&lt;br /&gt;&lt;br /&gt;impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=impdpSCOTT.log&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Database Exports/Imports&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The FULL parameter indicates that a complete database export is required. The following is an example of the full database export and import syntax:&lt;br /&gt;expdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G.log&lt;br /&gt;&lt;br /&gt;impdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=impdpDB10G.log&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-564119231109052331?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/564119231109052331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=564119231109052331' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/564119231109052331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/564119231109052331'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-data-pump-10g-getting-started.html' title='Oracle Data pump 10g getting started'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-7214099311686982639</id><published>2008-09-07T07:57:00.001-07:00</published><updated>2008-09-07T07:57:50.650-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Data Pump in Oracle Database 10g'/><title type='text'>Oracle Data Pump in Oracle Database 10g</title><content type='html'>Oracle Data Pump is a newer, faster and more flexible alternative to the "exp" and "imp" utilities used in previous Oracle versions. In addition to basic import and export functionality data pump provides a PL/SQL API and support for external tables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-7214099311686982639?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/7214099311686982639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=7214099311686982639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7214099311686982639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/7214099311686982639'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-data-pump-in-oracle-database-10g.html' title='Oracle Data Pump in Oracle Database 10g'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8481296363664565334</id><published>2008-09-06T15:02:00.000-07:00</published><updated>2008-09-06T15:05:44.018-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is FLASHBACK TABLE ? Explain with examples?'/><title type='text'>What is FLASHBACK TABLE ? Explain with examples?</title><content type='html'>Purpose&lt;br /&gt;&lt;br /&gt;Use the FLASHBACK TABLE statement to restore an earlier state of a table in the event of human or application error. The time in the past to which the table can be flashed back is dependent on the amount of undo data in the system. Also, Oracle Database cannot restore a table to an earlier state across any DDL operations that change the structure of the table.&lt;br /&gt;&lt;br /&gt;Oracle strongly recommends that you run your database in Automatic Undo Management mode by setting the UNDO_MANAGEMENT initialization parameter to AUTO. In addition, set the UNDO_RETENTION initialization parameter to an interval large enough to include the oldest data you anticipate needing. For more information please refer to the documentation on the UNDO_MANAGEMENT and UNDO_RETENTION initialization parameters.&lt;br /&gt;&lt;br /&gt;You cannot roll back a FLASHBACK TABLE statement. However, you can issue another FLASHBACK TABLE statement and specify a time just prior to the current time. Therefore, it is advisable to record the current SCN before issuing a FLASHBACK TABLE clause.&lt;br /&gt;&lt;br /&gt;Prerequisites&lt;br /&gt;&lt;br /&gt;To flash back a table to an earlier SCN or timestamp, you must have either the FLASHBACK object privilege on the table or the FLASHBACK ANY TABLE system privilege. In addition, you must have the SELECT, INSERT, DELETE, and ALTER object privileges on the table. Row movement must be enabled for all tables in the Flashback list. Please refer to row_movement_clause for information on enabling row movement.&lt;br /&gt;&lt;br /&gt;To flash back a table to before a DROP TABLE operation, you need only the privileges necessary to drop the table.&lt;br /&gt;&lt;br /&gt;Semantics&lt;br /&gt;&lt;br /&gt;During an Oracle Flashback Table operation, Oracle Database acquires exclusive DML locks on all the tables specified in the Flashback list. These locks prevent any operations on the tables while they are reverting to their earlier state.&lt;br /&gt;&lt;br /&gt;The Flashback Table operation is executed in a single transaction, regardless of the number of tables specified in the Flashback list. Either all of the tables revert to the earlier state or none of them do. If the Flashback Table operation fails on any table, then the entire statement fails.&lt;br /&gt;&lt;br /&gt;At the completion of the Flashback Table operation, the data in table is consistent with table at the earlier time. However, FLASHBACK TABLE TO SCN or TIMESTAMP does not preserve rowids, and FLASHBACK TABLE TO BEFORE DROP does not recover referential constraints.&lt;br /&gt;&lt;br /&gt;Oracle Database does not revert statistics associated with table to their earlier form. Indexes on table that exist currently are reverted and reflect the state of the table at the Flashback point. If the index exists now but did not yet exist at the Flashback point, then the database updates the index to reflect the state of the table at the Flashback point. However, indexes that were dropped during the interval between the Flashback point and the current time are not restored.&lt;br /&gt;&lt;br /&gt;schema&lt;br /&gt;&lt;br /&gt;Specify the schema containing the table. If you omit schema, then the database assumes the table is in your own schema.&lt;br /&gt;&lt;br /&gt;table&lt;br /&gt;&lt;br /&gt;Specify the name of one or more tables containing data you want to revert to an earlier version.&lt;br /&gt;&lt;br /&gt;Restrictions on Flashing Back Tables&lt;br /&gt;&lt;br /&gt;        *&lt;br /&gt;&lt;br /&gt;          Flashback Table operations are not valid for the following type objects: tables that are part of a cluster, materialized views, Advanced Queuing (AQ) tables, static data dictionary tables, system tables, remote tables, object tables, nested tables, or individual table partitions or subpartitions.&lt;br /&gt;        *&lt;br /&gt;&lt;br /&gt;          The following DDL operations change the structure of a table, so that you cannot subsequently use the TO SCN or TO TIMESTAMP clause to flash the table back to a time preceding the operation: upgrading, moving, or truncating a table; adding a constraint to a table, adding a table to a cluster; modifying or dropping a column; adding, dropping, merging, splitting, coalescing, or truncating a partition or subpartition (with the exception of adding a range partition).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;TO SCN Clause&lt;br /&gt;&lt;br /&gt;Specify the system change number (SCN) corresponding to the point in time to which you want to return the table. The expr must evaluate to a number representing a valid SCN.&lt;br /&gt;&lt;br /&gt;TO TIMESTAMP Clause&lt;br /&gt;&lt;br /&gt;Specify a timestamp value corresponding to the point in time to which you want to return the table. The expr must evaluate to a valid timestamp in the past.&lt;br /&gt;&lt;br /&gt;ENABLE | DISABLE TRIGGERS&lt;br /&gt;&lt;br /&gt;By default, Oracle Database disables all enabled triggers defined on table during the Flashback Table operation and then reenables them after the Flashback Table operation is complete. Specify ENABLE TRIGGERS if you want to override this default behavior and keep the triggers enabled during the Flashback process.&lt;br /&gt;&lt;br /&gt;This clause affects only those database triggers defined on table that are already enabled. To enable currently disabled triggers selectively, use the ALTER TABLE ... enable_disable_clause before you issue the FLASHBACK TABLE statement with the ENABLE TRIGGERS clause.&lt;br /&gt;&lt;br /&gt;TO BEFORE DROP Clause&lt;br /&gt;&lt;br /&gt;Use this clause to retrieve from the recycle bin a table that has been dropped, along with all possible dependent objects.&lt;br /&gt;&lt;br /&gt;You can specify either the original user-specified name of the table or the system-generated name Oracle Database assigned to the object when it was dropped.&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      System-generated recycle bin object names are unique. Therefore, if you specify the system-generated name, then the database retrieves that specified object.&lt;br /&gt;&lt;br /&gt;      To see the contents of your recycle bin, query the USER_RECYCLEBIN data dictionary review. You can use the RECYCLEBIN synonym instead. The following two statements return the same rows:&lt;br /&gt;&lt;br /&gt;      SELECT * FROM RECYCLEBIN;&lt;br /&gt;      SELECT * FROM USER_RECYCLEBIN;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;&lt;br /&gt;      If you specify the user-specified name, and if the recycle bin contains more than one object of that name, then the database retrieves the object that was moved to the recycle bin most recently. If you want to retrieve an older version of the table, do one of these things:&lt;br /&gt;          o&lt;br /&gt;&lt;br /&gt;            Specify the system-generated recycle bin name of the table you want to retrieve.&lt;br /&gt;          o&lt;br /&gt;&lt;br /&gt;            Issue additional FLASHBACK TABLE ... TO BEFORE DROP statements until you retrieve the table you want.&lt;br /&gt;&lt;br /&gt;Oracle Database attempts to preserve the original table name. If a new table of the same name has been created in the same schema since the original table was dropped, then the database returns an error unless you also specify the RENAME TO clause.&lt;br /&gt;&lt;br /&gt;RENAME TO Clause&lt;br /&gt;&lt;br /&gt;Use this clause to specify a new name for the table being retrieved from the recycle bin.&lt;br /&gt;&lt;br /&gt;Notes on Flashing Back Dropped Tables&lt;br /&gt;&lt;br /&gt;        *&lt;br /&gt;&lt;br /&gt;          Oracle Database retrieves all indexes defined on the table retrieved from the recycle bin except for bitmap join indexes. (Bitmap join indexes are not put in the recycle bin during a DROP TABLE operation, so cannot be retrieved.)&lt;br /&gt;        *&lt;br /&gt;&lt;br /&gt;          The database also retrieves all triggers and constraints defined on the table except for referential integrity constraints that reference other tables.&lt;br /&gt;&lt;br /&gt;          The retrieved indexes, triggers, and constraints have recycle bin names. Therefore it is advisable to query the USER_RECYCLEBIN view before issuing a FLASHBACK TABLE ... TO BEFORE DROP statement so that you can rename the retrieved triggers and constraints to more usable names.&lt;br /&gt;        *&lt;br /&gt;&lt;br /&gt;          When you drop a table, all materialized view logs defined on the table are also dropped but are not placed in the recycle bin. Therefore, the materialized view logs cannot be flashed back along with the table.&lt;br /&gt;        *&lt;br /&gt;&lt;br /&gt;          When you drop a table, any indexes on the table are dropped and put into the recycle bin along with the table. If subsequent space pressures arise, then the database reclaims space from the recycle bin by first purging indexes. In this case, when you flash back the table, you may not get back all of the indexes that were defined on the table.&lt;br /&gt;        *&lt;br /&gt;&lt;br /&gt;          You cannot flash back a table if it has been purged, either by a user or by Oracle Database as a result of some space reclamation operation.&lt;br /&gt;&lt;br /&gt;Examples&lt;br /&gt;&lt;br /&gt;Restoring a Table to an Earlier State: Examples&lt;br /&gt;&lt;br /&gt;The examples below create a new table, employees_demo, with row movement enabled, update values within the new table, and issue the FLASHBACK TABLE statement.&lt;br /&gt;&lt;br /&gt;Create table employees_demo, with row movement enabled, from table employees of the sample hr schema:&lt;br /&gt;&lt;br /&gt;CREATE TABLE employees_demo &lt;br /&gt;  ENABLE ROW MOVEMENT&lt;br /&gt;  AS SELECT * FROM employees;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As a benchmark, list those salaries less than 2500:&lt;br /&gt;&lt;br /&gt;SELECT salary&lt;br /&gt;  FROM employees_demo&lt;br /&gt;  WHERE salary &lt; 2500;&lt;br /&gt;&lt;br /&gt;    SALARY&lt;br /&gt;----------&lt;br /&gt;      2400&lt;br /&gt;      2200&lt;br /&gt;      2100&lt;br /&gt;      2400&lt;br /&gt;      2200&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;To allow time for the SCN to propagate to the mapping table used by the FLASHBACK TABLE statement, wait a minimum of 5 minutes prior to issuing the following statement. This wait would not be necessary if a previously existing table were being used in this example.&lt;br /&gt;&lt;br /&gt;Issue a 10% salary increase to those employees earning less than 2500:&lt;br /&gt;&lt;br /&gt;UPDATE employees_demo&lt;br /&gt;  SET salary = salary * 1.1&lt;br /&gt;  WHERE salary &lt; 2500;&lt;br /&gt;&lt;br /&gt;5 rows updated.&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As a second benchmark, list those salaries that remain less than 2500 following the 10% increase:&lt;br /&gt;&lt;br /&gt;SELECT salary&lt;br /&gt;  FROM employees_demo&lt;br /&gt;  WHERE salary &lt; 2500;&lt;br /&gt;&lt;br /&gt;    SALARY&lt;br /&gt;----------&lt;br /&gt;      2420&lt;br /&gt;      2310&lt;br /&gt;      2420&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Restore the table employees_demo to its state 1 minute prior to the current system time:&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE employees_demo&lt;br /&gt;  TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' minute);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;List those salaries less than 2500. After the FLASHBACK TABLE statement issued above, this list should match the list in the first benchmark.&lt;br /&gt;&lt;br /&gt;SELECT salary&lt;br /&gt;  FROM employees_demo&lt;br /&gt;  WHERE salary &lt; 2500;&lt;br /&gt;&lt;br /&gt;    SALARY&lt;br /&gt;----------&lt;br /&gt;      2400&lt;br /&gt;      2200&lt;br /&gt;      2100&lt;br /&gt;      2400&lt;br /&gt;      2200&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Retrieving a Dropped Table: Example&lt;br /&gt;&lt;br /&gt;If you accidentally drop the hr.employees table and wish to retrieve it, issue the following statement:&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE employees TO BEFORE DROP;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If another employees table has been created in the hr schema, use the RENAME TO clause to rename the retrieved table:&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE employees TO BEFORE DROP RENAME TO employees_old;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you know that the employees table has been dropped multiple times, and you wish to retrieve the oldest version, query the USER_RECYLEBIN table to determine the system-generated name, and then use that name in the FLASHBACK TABLE statement. (System-generated names in your database will differ from those shown here.)&lt;br /&gt;&lt;br /&gt;SELECT object_name, droptime FROM user_recyclebin &lt;br /&gt;   WHERE original_name = 'employees';&lt;br /&gt;&lt;br /&gt;OBJECT_NAME                    DROPTIME&lt;br /&gt;------------------------------ -------------------&lt;br /&gt;RB$$45703$TABLE$0              2003-06-03:15:26:39&lt;br /&gt;RB$$45704$TABLE$0              2003-06-12:12:27:27&lt;br /&gt;RB$$45705$TABLE$0              2003-07-08:09:28:01&lt;br /&gt;&lt;br /&gt;Flashback Dropped Table&lt;br /&gt;Flashback Table From The Recycle Bin Using The Object Name  FLASHBACK TABLE &lt;object_name&gt; TO BEFORE DROP&lt;br /&gt;{RENAME TO &lt;new_table_name&gt;};&lt;br /&gt;CREATE TABLE test (&lt;br /&gt;testcol VARCHAR2(20));&lt;br /&gt;&lt;br /&gt;ALTER TABLE test&lt;br /&gt;ADD CONSTRAINT pk_test&lt;br /&gt;PRIMARY KEY (testcol)&lt;br /&gt;USING INDEX&lt;br /&gt;PCTFREE 0;&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('ABC');&lt;br /&gt;INSERT INTO test VALUES ('DEF');&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;DROP TABLE test;&lt;br /&gt;&lt;br /&gt;SELECT object_name, original_name&lt;br /&gt;FROM recyclebin;&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE "BIN$4/V75AlOSDqCJ4fbHLAtpQ==$0"&lt;br /&gt;TO BEFORE DROP;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;SELECT constraint_name, constraint_type&lt;br /&gt;FROM user_constraints&lt;br /&gt;ORDER BY table_name;&lt;br /&gt;Flashback Table From The Recycle Bin Using The Original Name  FLASHBACK TABLE &lt;original_table_name&gt; TO BEFORE DROP&lt;br /&gt;{RENAME TO &lt;new_table_name&gt;};&lt;br /&gt;CREATE TABLE test (&lt;br /&gt;testcol  VARCHAR2(20));&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('ABC');&lt;br /&gt;&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;DROP TABLE test;&lt;br /&gt;&lt;br /&gt;CREATE TABLE test (&lt;br /&gt;testcol  VARCHAR2(20));&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('DEF');&lt;br /&gt;&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;DROP TABLE test;&lt;br /&gt;&lt;br /&gt;CREATE TABLE test (&lt;br /&gt;testcol  VARCHAR2(20));&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('GHI');&lt;br /&gt;&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;DROP TABLE test;&lt;br /&gt;&lt;br /&gt;SELECT object_name, original_name, droptime&lt;br /&gt;FROM recyclebin;&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE test TO BEFORE DROP;&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE test TO BEFORE DROP&lt;br /&gt;RENAME TO test2;&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE test TO BEFORE DROP&lt;br /&gt;RENAME TO test1;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test2;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test1;&lt;br /&gt; &lt;br /&gt;Flashback To SCN&lt;br /&gt;&lt;br /&gt;Flashback to identified SCN demo  FLASHBACK TABLE &lt;table_name&gt; TO SCN &lt;scn number&gt;;&lt;br /&gt;CREATE TABLE test (&lt;br /&gt;testcol  VARCHAR2(20));&lt;br /&gt;&lt;br /&gt;SELECT current_scn&lt;br /&gt;FROM gv$database;&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('ABC');&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT current_scn&lt;br /&gt;FROM gv$database;&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('DEF');&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT current_scn&lt;br /&gt;FROM gv$database;&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('GHI');&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT current_scn&lt;br /&gt;FROM gv$database;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;SELECT current_scn&lt;br /&gt;FROM gv$database;&lt;br /&gt;&lt;br /&gt;ALTER TABLE test ENABLE ROW MOVEMENT;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE test TO SCN 1833265;&lt;br /&gt; &lt;br /&gt;Flashback To Timestamp&lt;br /&gt;&lt;br /&gt;Flashback to identified timestamp demo  FLASHBACK TABLE &lt;table_name&gt; TO TIMESTAMP &lt;timestamp&gt;;&lt;br /&gt;CREATE TABLE test (&lt;br /&gt;testcol  VARCHAR2(20));&lt;br /&gt;&lt;br /&gt;SELECT systimestamp&lt;br /&gt;FROM dual;&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('ABC');&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT systimestamp&lt;br /&gt;FROM dual;&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('DEF');&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT systimestamp&lt;br /&gt;FROM dual;&lt;br /&gt;&lt;br /&gt;INSERT INTO test VALUES ('GHI');&lt;br /&gt;COMMIT;&lt;br /&gt;&lt;br /&gt;SELECT systimestamp&lt;br /&gt;FROM dual;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;SELECT systimestamp&lt;br /&gt;FROM dual;&lt;br /&gt;&lt;br /&gt;ALTER TABLE test ENABLE ROW MOVEMENT;&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;br /&gt;&lt;br /&gt;FLASHBACK TABLE test TO TIMESTAMP&lt;br /&gt;TO_TIMESTAMP('14-JUN-05 10.14.34.269 PM');&lt;br /&gt;&lt;br /&gt;SELECT * FROM test;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8481296363664565334?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8481296363664565334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8481296363664565334' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8481296363664565334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8481296363664565334'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-flashback-table-explain-with.html' title='What is FLASHBACK TABLE ? Explain with examples?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-3733942544194861201</id><published>2008-09-06T14:50:00.000-07:00</published><updated>2008-09-06T14:54:11.171-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is Oracle Secure Backup (OSB)?'/><title type='text'>What is Oracle Secure Backup (OSB)?</title><content type='html'>What is Oracle Secure Backup (OSB)?&lt;br /&gt;&lt;br /&gt;Oracle Secure Backup is a centralized tape backup management software providing secure data protection for heterogeneous file systems and the Oracle Database.&lt;br /&gt;&lt;br /&gt;Why switch to Oracle Secure Backup?&lt;br /&gt;&lt;br /&gt;Oracle Secure Backup delivers reliable, high performance tape backup for your entire IT environment including UNIX/Linux/Windows/NAS file systems and the Oracle database at the lowest-cost. The single component, per tape drive, pricing model is lower-cost and significantly reduces license management as compared to other media management products, which generally charge a premium for advanced functionality.&lt;br /&gt;&lt;br /&gt;Oracle Secure Backup provides key benefits:&lt;br /&gt;• Fastest Oracle database backup to tape&lt;br /&gt;• Single technical resource for entire backup environment&lt;br /&gt;• Dynamic tape drive sharing between NAS / UNIX / Linux / Windows servers&lt;br /&gt;• Policy-based backup management:&lt;br /&gt;o Backup encryption&lt;br /&gt;o Vaulting (rotation of tapes between multiple locations)&lt;br /&gt;o Tape duplication&lt;br /&gt;o Migration from virtual tapes to physical tapes&lt;br /&gt;&lt;br /&gt;Is Oracle Secure Backup a separate product from the Oracle database?&lt;br /&gt;&lt;br /&gt;Yes. Oracle Secure Backup is a separate product with independent release schedule and versioning from that of the database.&lt;br /&gt;&lt;br /&gt;What Oracle database versions does Oracle Secure Backup 10.2 support?&lt;br /&gt;&lt;br /&gt;Oracle Secure Backup 10.2 is tightly integrated with Recovery Manager (RMAN) supporting Oracle9i to Oracle Database 11g.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;What is Oracle Secure Backup Express (OSB-XE)?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Bundled with the Oracle database, Oracle Secure Backup Express is free and provides single-server tape backup management for one database server directly attached to one tape drive. Oracle Secure Backup documentation is applicable for OSB-XE with the exception of advanced functionality only available with the OSB edition. You can leverage advanced media management features by upgrading OSB-XE licensing to OSB edition. Please refer to the OSB 10.2 Licensing Documentation for feature restrictions in OSB-XE.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How difficult is upgrading from OSB 10.1 to OSB 10.2?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Upgrading from OSB 10.1 to 10.2 is relatively easy. The backup catalog is retained (unless explicitly deleted by user) during the upgrade maintaining all backup metadata and backwards compatibility of tapes (tapes written using OSB 10.1 are fully compatible with OSB 10.2 environments).&lt;br /&gt;&lt;br /&gt;Where can I find compatibility matrixes for Oracle Secure Backup?&lt;br /&gt;• Platform, Web browser and NAS support is listed on Certify at metaling.oracle.com&lt;br /&gt;• Tape device matrix is available at otn.oracle.com/technology/products/secure-backup/tape_devices.pdf&lt;br /&gt;&lt;br /&gt;If a tape device is not listed on the compatibility matrix, does OSB support it?&lt;br /&gt;No. A tape device must be listed on the compatibility matrix to be supported. To request support for a tape device, log a Service Request (SR) through Oracle support requesting an enhancement request be filed on your behalf.&lt;br /&gt;&lt;br /&gt;Which network protocols does Oracle Secure Backup support?&lt;br /&gt;Oracle Secure Backup leverages NDMP for data transport over TCP/IP supporting backup, restore and other file access through NFSA and CIFS; host name resolution through NIS and DNS.&lt;br /&gt;&lt;br /&gt;How does backup encryption differ between Oracle Secure Backup 10.1 and 10.2?&lt;br /&gt;Oracle Secure Backup 10.2 provides backup encryption for file systems and Oracle9i forward. In OSB 10.2, policy based encryption is available at the global, server or backup job level. Encryption keys may be generated transparently (randomly) or with a user-defined passphrase. In OSB 10.1, backup encryption to tape leveraged RMAN backup encryption only.&lt;br /&gt;&lt;br /&gt;What is the difference between RMAN backup encryption and OSB 10.2 database backup encryption?&lt;br /&gt;While both RMAN and Oracle Secure Backup 10.2 backup encryption leverage the same underlying Oracle encryption library, RMAN backup encryption is performed within the database and Oracle Secure Backup encryption occurs on the database server (outside of database). OSB 10.2 backup encryption supports Oracle9i forward while RMAN backup encryption is supports Oracle Database 10gR2 forward. Encryption key management differs as following:&lt;br /&gt;&lt;br /&gt;• Oracle Secure Backup encryption keys are managed by OSB and stored on the OSB Administrative Server&lt;br /&gt;• RMAN backup encryption keys are managed by the Oracle database&lt;br /&gt;Does Oracle Secure Backup support disk-based backups?&lt;br /&gt;No. However, Oracle Secure Backup supports virtual tape libraries (VTL). VTLs are disk appliances, which emulated tape drives and libraries. Oracle databases have always supported disk-based backups via RMAN. With Oracle Database 10g, the Flash Recovery Area was introduced to manage Oracle recovery related files. The Flash Recovery may be backed up to tape using Oracle Secure Backup. More information on the Flash Recovery Area is here.&lt;br /&gt;&lt;br /&gt;Does OSB vaulting support Iron Mountain FTP format?&lt;br /&gt;Yes. Oracle Secure Backup vaulting reports may be generated in Iron Mountain FTP format.&lt;br /&gt;&lt;br /&gt;Is Oracle Secure Backup integrated with 3rd-party backup tools such as Veritas NetBackup or Tivoli Storage Manager?&lt;br /&gt;No, Oracle Secure Backup is not integrated with any 3rd-party backup tools. Oracle Secure Backup is an alternative to these products offering centralized backup management for both database data, in conjunction with Recovery Manager (RMAN), and non-database data stored in file systems.&lt;br /&gt;&lt;br /&gt;Does Oracle Secure Backup support online backups of 3rd-party databases?&lt;br /&gt;No, Oracle Secure Backup does not provide native plug-ins of non-Oracle databases. Non-Oracle databases may be backed up offline (closed/consistent) as part of a file system backup. Consult with your vendor on best practices of backing up and recovering applications.&lt;br /&gt;&lt;br /&gt;Can Oracle Secure Backup share a server and/or tape resources with other backup applications?&lt;br /&gt;It is not recommended to install two backup applications on the same server or share tape hardware due to potential contention of resources. Overlapping background processes may be problematic causing unusual behavior for one or both backup applications. However, a partitioned library may be successfully shared between two applications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-3733942544194861201?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/3733942544194861201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=3733942544194861201' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3733942544194861201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/3733942544194861201'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-oracle-secure-backup-osb.html' title='What is Oracle Secure Backup (OSB)?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-6569612027405520155</id><published>2008-09-06T14:46:00.000-07:00</published><updated>2008-09-06T14:47:14.719-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is auxiliary instance? when it is created?'/><title type='text'>What is auxiliary instance? when it is created?</title><content type='html'>When you perform a tablespace point-in-time recovery (TSPITR) to recover from certain database errors, Oracle Database 10g will now automatically create the auxiliary instance and remove it after the recovery is over.&lt;br /&gt;&lt;br /&gt;This automatically generated instance will be in the same database server. Remember, as with previous versions, instance creation introduces performance overhead during the recovery operation.&lt;br /&gt;&lt;br /&gt;Automatic creation of Temporary Datafiles&lt;br /&gt;&lt;br /&gt;Starting from release 2, Temporary datafiles that belong to locally managed temporary tablespaces are automatically re-created during RMAN recovery operation. This eliminates the need to manually create temporary tablespaces after recovery.&lt;br /&gt;&lt;br /&gt;New RMAN Dynamic Performance Views&lt;br /&gt;&lt;br /&gt;In Oracle 10.2 and above, in order to provide more details about its operation, RMAN is supported by a number of new dynamic performance views including:&lt;br /&gt;&lt;br /&gt;V$BACKUP_ARCHIVELOG_DETAILS&lt;br /&gt;V$BACKUP_ARCHIVELOG_SUMMARY&lt;br /&gt;V$BACKUP_CONTROLFILE_DETAILS&lt;br /&gt;V$BACKUP_CONTROLFILE_SUMMARY&lt;br /&gt;V$BACKUP_COPY_DETAILS&lt;br /&gt;V$BACKUP_COPY_SUMMARY&lt;br /&gt;V$BACKUP_DATAFILE_DETAILS&lt;br /&gt;V$BACKUP_DATAFILES_SUMMARY&lt;br /&gt;V$BACKUP_JOB_DETAILS&lt;br /&gt;V$BACKUP_PIECE_DETAILS&lt;br /&gt;V$BACKUP_SET_DETAILS&lt;br /&gt;V$BACKUP_SET_SUMMARY&lt;br /&gt;V$BACKUP_SPFILE_DETAILS&lt;br /&gt;V$BACKUP_SPFILE_SUMMARY&lt;br /&gt;&lt;br /&gt;One other useful view is V$RMAN_BACKUP_JOB_DETAILS. It informs you about history of all backups done by the RMAN. You will find details like how long the backup took, how many RMAN jobs have been issued, the status of each job, what time they started and completed, rate of the backup produced and how fast data was read and written by the process.&lt;br /&gt;&lt;br /&gt;COL STATUS FORMAT A9&lt;br /&gt;COL HRS FORMAT 999.99&lt;br /&gt;SELECT&lt;br /&gt;SESSION_KEY, INPUT_TYPE, STATUS,&lt;br /&gt;TO_CHAR(START_TIME,'DD/MM/YY HH24:MI')&lt;br /&gt;START_TIME,&lt;br /&gt;TO_CHAR(END_TIME,'DD/MM/YY HH24:MI')&lt;br /&gt;END_TIME,&lt;br /&gt;ELAPSED_SECONDS/3600 HRS&lt;br /&gt;FROM V$RMAN_BACKUP_JOB_DETAILS&lt;br /&gt;ORDER BY SESSION_KEY&lt;br /&gt;COL INS FORMAT A10&lt;br /&gt;COL OUTS FORMAT A10&lt;br /&gt;SELECT SESSION_KEY,&lt;br /&gt;OPTIMIZED,&lt;br /&gt;COMPRESSION_RATIO,&lt;br /&gt;INPUT_BYTES_PER_SEC_DISPLAY INS,&lt;br /&gt;OUTPUT_BYTES_PER_SEC_DISPLAY OUTS,&lt;br /&gt;TIME_TAKEN_DISPLAY&lt;br /&gt;FROM V$RMAN_BACKUP_JOB_DETAILS&lt;br /&gt;ORDER BY SESSION_KEY&lt;br /&gt;&lt;br /&gt;Another new view is V$RMAN_BACKUP_TYPE. It informs the type of backups performed by RMAN : BACKUPSET, SPFILE, CONTROLFILE, ARCHIVELOG, DATAFILE INCR, DATAFILE FULL, DB INCR, RECVR AREA and DB FULL.&lt;br /&gt;&lt;br /&gt;The view V$RMAN_OUTPUT records the output (log) from the RMAN jobs so that you can view it later. This view is useful for checking log of scripted RMAN jobs as well as ad-hoc jobs.&lt;br /&gt;&lt;br /&gt;Note: All those view are in-memory and cleared upon the instance shut down.&lt;br /&gt;&lt;br /&gt;Oracle Secure Backup&lt;br /&gt;&lt;br /&gt;• In Oracle Database 10g Release 2, a new tool called Oracle Secure Backup (OSB) is available. OSB enables you to use RMAN to backup directly to tape library without using the costly third-party MML layer.&lt;br /&gt;&lt;br /&gt;• OSB can be controlled and administered via Oracle Enterprise Manager or obtool command-line.&lt;br /&gt;&lt;br /&gt;• Beside backing up the database, OSB can be used to backup filesystems as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-6569612027405520155?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/6569612027405520155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=6569612027405520155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6569612027405520155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/6569612027405520155'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-auxiliary-instance-when-it-is.html' title='What is auxiliary instance? when it is created?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-8749360052286206652</id><published>2008-09-06T14:43:00.001-07:00</published><updated>2008-09-06T14:43:27.844-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Automatic Instance Creation for RMAN TSPITR'/><title type='text'>Automatic Instance Creation for RMAN TSPITR</title><content type='html'>Automatic Instance Creation for RMAN TSPITR&lt;br /&gt;If a tablespace point-in-time recovery (TSPITR) is initiated with no reference to an auxillary instance RMAN now automatically creates an one. The auxillary instance configuration is based on that of the target database. As a result, any channels required for the restore operations must be present in the target database so they are configured correctly in the auxillary instance. The location of the datafiles for the auxillary instance are specified using the AUXILIARY DESTINATION clause shown below.&lt;br /&gt;&lt;br /&gt;    RECOVER TABLESPACE users &lt;br /&gt;      UNTIL LOGSEQ 2400 THREAD 1&lt;br /&gt;      AUXILIARY DESTINATION '/u01/oradata/auxdest';&lt;br /&gt;&lt;br /&gt;The tablespace is taken offline, restored from a backup, recovered to the specified point-in-time in the auxillary instance and re-imported into the target database. The tablespace in the target database should then be backed up and the tablespace brought back online.&lt;br /&gt;&lt;br /&gt;    BACKUP TABLESPACE users;&lt;br /&gt;    SQL "ALTER TABLESPACE users ONLINE";&lt;br /&gt;&lt;br /&gt;On successful completion the auxillary instance will be cleaned up automatically. In the event of errors the auxillary instance is left intact to aid troubleshooting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-8749360052286206652?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/8749360052286206652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=8749360052286206652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8749360052286206652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/8749360052286206652'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/automatic-instance-creation-for-rman.html' title='Automatic Instance Creation for RMAN TSPITR'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5962578770890709009</id><published>2008-09-06T14:41:00.001-07:00</published><updated>2008-09-06T14:41:44.584-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle 10 RMAN Views'/><title type='text'>Oracle 10 RMAN Views</title><content type='html'>Oracle 10g includes additional V$ views making the reporting of backup operations more transparent.&lt;br /&gt;&lt;br /&gt;    * V$RMAN_OUTPUT - This is an in-memory view of the messages reported by RMAN holding a maximum of 32767 rows. Since this information is not recorded in the controlfile it is lost on instance restart.&lt;br /&gt;    * V$RMAN_STATUS - This view displays progress and status information for in-progress and complete RMAN jobs. The information for the in-progress jobs is memory only, while the complete job information comes from the controlfile.&lt;br /&gt;    * V$BACKUP_FILES - This view display information about RMAN image copies, backupsets and archived logs, similar to the information listed by the RMAN commands LIST BACKUP and LIST COPY. This view relies on the DBMS_RCVMAN.SETDATABASE procedure being run to set the database.&lt;br /&gt;&lt;br /&gt;The V$RMAN_CONFIGURATION view from Oracle 9i is still available in Oracle 10g.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5962578770890709009?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5962578770890709009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5962578770890709009' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5962578770890709009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5962578770890709009'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/oracle-10-rman-views.html' title='Oracle 10 RMAN Views'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-5458852015433908425</id><published>2008-09-06T14:34:00.000-07:00</published><updated>2008-09-06T14:39:56.113-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How to setup RMAN in Oracle 9i'/><title type='text'>How to setup RMAN in Oracle 9i</title><content type='html'>Commands and setup parameters used to configure a typical RMAN environment.&lt;br /&gt;&lt;br /&gt;1. Configuring the Backup Database User&lt;br /&gt;&lt;br /&gt;The RMAN executable requires a SYSDBA connection to the database. Although it is possible to use the SYS account, I generally create a user dedicated to backing up the database. Before creating the new user, ensure that your database is configured to use a password file.&lt;br /&gt;&lt;br /&gt;% echo $ORACLE_SID&lt;br /&gt;ORA920&lt;br /&gt;&lt;br /&gt;% sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter remote_login_passwordfile&lt;br /&gt;&lt;br /&gt;NAME                            TYPE        VALUE&lt;br /&gt;------------------------------- ----------- ------------&lt;br /&gt;remote_login_passwordfile       string      EXCLUSIVE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE USER backup_admin IDENTIFIED BY backup_admin&lt;br /&gt;  2  DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;&lt;br /&gt;&lt;br /&gt;User created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; GRANT sysdba TO backup_admin;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;We should now test running RMAN while logging in as the newly created database user:&lt;br /&gt;&lt;br /&gt;% rman target backup_admin/backup_admin&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 9.2.0.5.0 - Production&lt;br /&gt;&lt;br /&gt;Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to target database: ORA920 (DBID=6732194167)&lt;br /&gt;&lt;br /&gt;RMAN&gt; exit&lt;br /&gt;&lt;br /&gt;Recovery Manager complete.&lt;br /&gt;&lt;br /&gt; Configuring RMAN Default Parameters&lt;br /&gt;&lt;br /&gt;    RMAN (Oracle9i and higher) now allows the DBA to perform automated database backup and recovery. This feature is supported by RMAN with its ability to define default values for a number of settings, (i.e. channel configuration). Setting RMAN settings is performed with the configure command.&lt;br /&gt;&lt;br /&gt;    Before configuring our RMAN environment, lets take a look at the default settings by using the show all command:&lt;br /&gt;&lt;br /&gt;    RMAN&gt; show all;&lt;br /&gt;&lt;br /&gt;    RMAN configuration parameters are:&lt;br /&gt;    CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default&lt;br /&gt;    CONFIGURE BACKUP OPTIMIZATION OFF; # default&lt;br /&gt;    CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default&lt;br /&gt;    CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default&lt;br /&gt;    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default&lt;br /&gt;    CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default&lt;br /&gt;    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;br /&gt;    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;br /&gt;    CONFIGURE MAXSETSIZE TO UNLIMITED; # default&lt;br /&gt;    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/9.2.0/dbs/snapcf_ORA920.f'; # default&lt;br /&gt;&lt;br /&gt;New RMAN Configuration Parameters&lt;br /&gt;&lt;br /&gt;configure retention policy to redundancy 2;&lt;br /&gt;configure default device type to disk;&lt;br /&gt;configure controlfile autobackup on;&lt;br /&gt;configure controlfile autobackup format for device type disk to '/orabackup/rman/ORA920/%F';&lt;br /&gt;configure channel device type disk format '/orabackup/rman/ORA920/backup_db_%d_S_%s_P_%p_T_%t' maxpiecesize 1024m;&lt;br /&gt;&lt;br /&gt;10g RMAN Configuration Parameters&lt;br /&gt;&lt;br /&gt;configure controlfile autobackup on;&lt;br /&gt;configure channel device type disk maxpiecesize 2 g;&lt;br /&gt;&lt;br /&gt;     After running the above configuration commands in RMAN, here is what the show all command displays:&lt;br /&gt;&lt;br /&gt;    RMAN&gt; show all;&lt;br /&gt;&lt;br /&gt;    RMAN configuration parameters are:&lt;br /&gt;    CONFIGURE RETENTION POLICY TO REDUNDANCY 2;&lt;br /&gt;    CONFIGURE BACKUP OPTIMIZATION OFF; # default&lt;br /&gt;    CONFIGURE DEFAULT DEVICE TYPE TO DISK;&lt;br /&gt;    CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;    CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/orabackup/rman/ORA920/%F';&lt;br /&gt;    CONFIGURE DEVICE TYPE DISK PARALLELISM 1; # default&lt;br /&gt;    CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;br /&gt;    CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;br /&gt;    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/orabackup/rman/ORA920/backup_db_%d_S_%s_P_%p_T_%t' MAXPIECESIZE 1024 M;&lt;br /&gt;    CONFIGURE MAXSETSIZE TO UNLIMITED; # default&lt;br /&gt;    CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/9.2.0/dbs/snapcf_ORA920.f'; # default&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Backing up the Target Database&lt;br /&gt;&lt;br /&gt;    Now that RMAN is configured, backing up the database (including backing up all archive redo logs), is as easy as:&lt;br /&gt;&lt;br /&gt;    RMAN Statements to Perform Full (online) Database Backup&lt;br /&gt;&lt;br /&gt;    % rman target backup_admin/backup_admin nocatalog msglog rman_full_backup_db_online_ORA920.log&lt;br /&gt;&lt;br /&gt;    RMAN&gt; backup database plus archivelog delete input;&lt;br /&gt;    RMAN&gt; delete noprompt force obsolete;&lt;br /&gt;    RMAN&gt; exit;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    The following table includes all resulting backup sets contained in the control file after performing the above backup routine.&lt;br /&gt;&lt;br /&gt;    BS&lt;br /&gt;    Key  Backup&lt;br /&gt;    Type  Device&lt;br /&gt;    Type  Controlfile&lt;br /&gt;    Included?  SPFILE&lt;br /&gt;    Included?  Piece&lt;br /&gt;    Number  Handle (Piece) Name  Start&lt;br /&gt;    Time  End&lt;br /&gt;    Time  Elapsed&lt;br /&gt;    Seconds  Tag  Block&lt;br /&gt;    Size&lt;br /&gt;    2  Datafile Full  DISK        1  /orabackup/rman/ORA920/backup_db_ORA920_S_5_P_1_T_543443342  11/28/04 20:29:02  11/28/04 20:32:44  222  TAG20041128T202902  8,192&lt;br /&gt;                   2  /orabackup/rman/ORA920/backup_db_ORA920_S_5_P_2_T_543443342  11/28/04 20:32:47  11/28/04 20:34:45  118  TAG20041128T202902  8,192&lt;br /&gt;    3  Archived Logs  DISK        1  /orabackup/rman/ORA920/backup_db_ORA920_S_6_P_1_T_543443693  11/28/04 20:34:53  11/28/04 20:34:53  0  TAG20041128T203452  512&lt;br /&gt;    4  Datafile Full  DISK  YES  YES  1  /orabackup/rman/ORA920/c-2542143170-20041128-01  11/28/04 20:34:54  11/28/04 20:34:55  1     8,192&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    Now, let's talk about the actual steps that were performed by RMAN after running the full (online) database backup statements. I attempted to annotate the RMAN log file (below) with the following steps. Note that the first 6 steps were all part of the backup database plus archivelog delete input; statement. The 7th step includes the delete noprompt force obsolete; statement&lt;br /&gt;&lt;br /&gt;       1. The first action performed by RMAN is a log switch (using the alter system archive log current command).&lt;br /&gt;&lt;br /&gt;       2. Next, all existing archived redo logs (including the one just archived) are backed up to a Archive Log backup set. Note that at the end of the RMAN statements in our example, this archive log backup set (backup_db_ORA920_S_4_P_1_T_543443326) will be removed as it will no longer be needed once the database files are backed up.&lt;br /&gt;&lt;br /&gt;       3. RMAN then starts the backup of the actual database files. For this backup set, (BS Key - 2), RMAN creates two backup pieces: backup_db_ORA920_S_5_P_1_T_543443342 and backup_db_ORA920_S_5_P_2_T_543443342.&lt;br /&gt;&lt;br /&gt;       4. After the full database backup, RMAN performs another archive redo log switch (using the alter system archive log current command).&lt;br /&gt;&lt;br /&gt;       5. After the archive redo log switch completes, RMAN creates an Archived Log backup set (BS Key - 3) of the remaining archived redo logs (using the backup archivelog all command). This is backup piece backup_db_ORA920_S_6_P_1_T_543443693. Keep in mind that this archived redo log backup set includes the redo logs that occured during the full database backup.&lt;br /&gt;&lt;br /&gt;       6. Finally, the autobackup of the control file and SPFILE occurs and creates another datafile backup set (BS Key - 4). This is contained in backup piece c-2542143170-20041128-01. Since a full database backup will always include datafile 1, which belongs to the SYSTEM tablespace, there will always be a backup of the control file and the SPFILE. At this point, all tasks for the backup database plus archivelog delete input; statement have been completed.&lt;br /&gt;&lt;br /&gt;       7. The delete noprompt force obsolete; statement is then run to apply the retention policy we have configured. In our example, the first Archive Log backup set (that was performed at the begining on this example) will be removed. This was piece backup_db_ORA920_S_4_P_1_T_543443326. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    RMAN Full (online) Database Backup Log File&lt;br /&gt;&lt;br /&gt;    Recovery Manager: Release 9.2.0.5.0 - Production&lt;br /&gt;&lt;br /&gt;    Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;    connected to target database: ORA920 (DBID=2542143170)&lt;br /&gt;    using target database controlfile instead of recovery catalog&lt;br /&gt;&lt;br /&gt;    RMAN&gt; &lt;br /&gt;&lt;br /&gt;    Starting backup at 28-NOV-04&lt;br /&gt;    current log archived  (Step 1)&lt;br /&gt;    allocated channel: ORA_DISK_1&lt;br /&gt;    channel ORA_DISK_1: sid=16 devtype=DISK&lt;br /&gt;    channel ORA_DISK_1: starting archive log backupset  (Step 2)&lt;br /&gt;    channel ORA_DISK_1: specifying archive log(s) in backup set&lt;br /&gt;    input archive log thread=1 sequence=89 recid=1 stamp=543441301&lt;br /&gt;    input archive log thread=1 sequence=90 recid=2 stamp=543443042&lt;br /&gt;    input archive log thread=1 sequence=91 recid=3 stamp=543443132&lt;br /&gt;    input archive log thread=1 sequence=92 recid=4 stamp=543443258&lt;br /&gt;    input archive log thread=1 sequence=93 recid=5 stamp=543443325&lt;br /&gt;    channel ORA_DISK_1: starting piece 1 at 28-NOV-04&lt;br /&gt;    channel ORA_DISK_1: finished piece 1 at 28-NOV-04&lt;br /&gt;    piece handle=/orabackup/rman/ORA920/backup_db_ORA920_S_4_P_1_T_543443326 comment=NONE&lt;br /&gt;    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15&lt;br /&gt;    channel ORA_DISK_1: deleting archive log(s)&lt;br /&gt;    archive log filename=/u06/app/oradata/ORA920/archive/arch_t1_s89.dbf recid=1 stamp=543441301&lt;br /&gt;    archive log filename=/u06/app/oradata/ORA920/archive/arch_t1_s90.dbf recid=2 stamp=543443042&lt;br /&gt;    archive log filename=/u06/app/oradata/ORA920/archive/arch_t1_s91.dbf recid=3 stamp=543443132&lt;br /&gt;    archive log filename=/u06/app/oradata/ORA920/archive/arch_t1_s92.dbf recid=4 stamp=543443258&lt;br /&gt;    archive log filename=/u06/app/oradata/ORA920/archive/arch_t1_s93.dbf recid=5 stamp=543443325&lt;br /&gt;    Finished backup at 28-NOV-04&lt;br /&gt;&lt;br /&gt;    Starting backup at 28-NOV-04&lt;br /&gt;    using channel ORA_DISK_1&lt;br /&gt;    channel ORA_DISK_1: starting full datafile backupset  (Step 3)&lt;br /&gt;    channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;    input datafile fno=00001 name=/u06/app/oradata/ORA920/system01.dbf&lt;br /&gt;    input datafile fno=00010 name=/u06/app/oradata/ORA920/users01.dbf&lt;br /&gt;    input datafile fno=00002 name=/u06/app/oradata/ORA920/undotbs01.dbf&lt;br /&gt;    input datafile fno=00011 name=/u06/app/oradata/ORA920/perfstat01.dbf&lt;br /&gt;    input datafile fno=00007 name=/u06/app/oradata/ORA920/example01.dbf&lt;br /&gt;    input datafile fno=00003 name=/u06/app/oradata/ORA920/cwmlite01.dbf&lt;br /&gt;    input datafile fno=00004 name=/u06/app/oradata/ORA920/drsys01.dbf&lt;br /&gt;    input datafile fno=00005 name=/u06/app/oradata/ORA920/odm01.dbf&lt;br /&gt;    input datafile fno=00006 name=/u06/app/oradata/ORA920/xdb01.dbf&lt;br /&gt;    input datafile fno=00008 name=/u06/app/oradata/ORA920/indx01.dbf&lt;br /&gt;    input datafile fno=00009 name=/u06/app/oradata/ORA920/tools01.dbf&lt;br /&gt;    input datafile fno=00012 name=/u06/app/oradata/ORA920/users02.dbf&lt;br /&gt;    channel ORA_DISK_1: starting piece 1 at 28-NOV-04&lt;br /&gt;    channel ORA_DISK_1: finished piece 1 at 28-NOV-04&lt;br /&gt;    piece handle=/orabackup/rman/ORA920/backup_db_ORA920_S_5_P_1_T_543443342 comment=NONE&lt;br /&gt;    channel ORA_DISK_1: starting piece 2 at 28-NOV-04&lt;br /&gt;    channel ORA_DISK_1: finished piece 2 at 28-NOV-04&lt;br /&gt;    piece handle=/orabackup/rman/ORA920/backup_db_ORA920_S_5_P_2_T_543443342 comment=NONE&lt;br /&gt;    channel ORA_DISK_1: backup set complete, elapsed time: 00:05:50&lt;br /&gt;    Finished backup at 28-NOV-04&lt;br /&gt;&lt;br /&gt;    Starting backup at 28-NOV-04&lt;br /&gt;    current log archived  (Step 4)&lt;br /&gt;    using channel ORA_DISK_1&lt;br /&gt;    channel ORA_DISK_1: starting archive log backupset  (Step 5)&lt;br /&gt;    channel ORA_DISK_1: specifying archive log(s) in backup set&lt;br /&gt;    input archive log thread=1 sequence=94 recid=6 stamp=543443692&lt;br /&gt;    channel ORA_DISK_1: starting piece 1 at 28-NOV-04&lt;br /&gt;    channel ORA_DISK_1: finished piece 1 at 28-NOV-04&lt;br /&gt;    piece handle=/orabackup/rman/ORA920/backup_db_ORA920_S_6_P_1_T_543443693 comment=NONE&lt;br /&gt;    channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01&lt;br /&gt;    channel ORA_DISK_1: deleting archive log(s)&lt;br /&gt;    archive log filename=/u06/app/oradata/ORA920/archive/arch_t1_s94.dbf recid=6 stamp=543443692&lt;br /&gt;    Finished backup at 28-NOV-04&lt;br /&gt;&lt;br /&gt;    Starting Control File and SPFILE Autobackup at 28-NOV-04  (Step 6)&lt;br /&gt;    piece handle=/orabackup/rman/ORA920/c-2542143170-20041128-01 comment=NONE&lt;br /&gt;    Finished Control File and SPFILE Autobackup at 28-NOV-04&lt;br /&gt;&lt;br /&gt;    RMAN&gt; &lt;br /&gt;    RMAN retention policy will be applied to the command  (Step 7)&lt;br /&gt;    RMAN retention policy is set to redundancy 2&lt;br /&gt;    using channel ORA_DISK_1&lt;br /&gt;    Deleting the following obsolete backups and copies:&lt;br /&gt;    Type                 Key    Completion Time    Filename/Handle&lt;br /&gt;    -------------------- ------ ------------------ --------------------&lt;br /&gt;    Backup Set           1      28-NOV-04         &lt;br /&gt;      Backup Piece       1      28-NOV-04          /orabackup/rman/ORA920/backup_db_ORA920_S_4_P_1_T_543443326&lt;br /&gt;    deleted backup piece&lt;br /&gt;    backup piece handle=/orabackup/rman/ORA920/backup_db_ORA920_S_4_P_1_T_543443326 recid=1 stamp=543443326&lt;br /&gt;    Deleted 1 objects&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    RMAN&gt; &lt;br /&gt;&lt;br /&gt;    Recovery Manager complete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;UNIX RMAN Backup Script&lt;br /&gt;&lt;br /&gt;    The following is a short UNIX script that can be used to perform the RMAN backup example we used earlier in this article.&lt;br /&gt;&lt;br /&gt;    Simple RMAN Full Database (online) Backup Script&lt;br /&gt;&lt;br /&gt;    #!/bin/ksh&lt;br /&gt;&lt;br /&gt;    rman target backup_admin/backup_admin nocatalog msglog rman_full_backup_db_online_ORA920.log EOF&lt;br /&gt;    backup database plus archivelog delete input;&lt;br /&gt;    delete noprompt force obsolete;&lt;br /&gt;    exit;&lt;br /&gt;    EOF&lt;br /&gt;&lt;br /&gt;    exit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-5458852015433908425?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/5458852015433908425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=5458852015433908425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5458852015433908425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/5458852015433908425'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/how-to-setup-rman-in-oracle-9i.html' title='How to setup RMAN in Oracle 9i'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7067326527441676813.post-4220323584729037304</id><published>2008-09-06T11:14:00.000-07:00</published><updated>2008-09-06T11:15:06.236-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='What is block pinging and why is it so bad?'/><title type='text'>What is block pinging and why is it so bad?</title><content type='html'>What is block pinging and why is it so bad?&lt;br /&gt;&lt;br /&gt;Starting with Oracle 9i, RAC can transfer blocks from one instance to another across the interconnect (cache fusion). This method is much faster than the old "pinging" method, where one instance had to write the block to disk before another instance could read it.&lt;br /&gt;&lt;br /&gt;Oracle 8i and below:&lt;br /&gt;&lt;br /&gt;Pinging is the process whereby one instance requests another to write a set of blocks from its SGA to disk so it can obtain it in exclusive mode. This method of moving data blocks from one instance's SGA to another is extremely slow. The challenge of tuning RAC/OPS is to minimize pinging activity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7067326527441676813-4220323584729037304?l=oracledbainterviewquestions.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracledbainterviewquestions.blogspot.com/feeds/4220323584729037304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7067326527441676813&amp;postID=4220323584729037304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4220323584729037304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7067326527441676813/posts/default/4220323584729037304'/><link rel='alternate' type='text/html' href='http://oracledbainterviewquestions.blogspot.com/2008/09/what-is-block-pinging-and-why-is-it-so.html' title='What is block pinging and why is it so bad?'/><author><name>MJBeservices</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
