<?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-2016638674107330364</id><updated>2011-12-03T13:44:14.552-08:00</updated><title type='text'>ORACLE DBA-APPS DBA</title><subtitle type='html'>THIS SITE IS TOTALLY DEDICATED TO ALL ORACLE DBA AND APPS DBA LOVERS.I WILL TRY TO COVER ALL MY EXPERIENCES AS AN ORACLE DBA.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default?start-index=101&amp;max-results=100'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>108</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5629028028129393664</id><published>2008-06-10T03:28:00.000-07:00</published><updated>2008-06-10T03:30:18.060-07:00</updated><title type='text'>CHANGING DATABASE CHARACTER SET</title><content type='html'>This article describes how one can change the character set of a database.&lt;br /&gt;It should be done with extreme caution having noted the following&lt;br /&gt;limitations.&lt;br /&gt;&lt;br /&gt;The database character set should only be changed if the characters of the&lt;br /&gt;code page of the originating database correspond to the same characters&lt;br /&gt;of the target database, ie. if the database was created with the&lt;br /&gt;characterset US7ASCII and it is to be updated to WE8ISO8859P1.  Since these&lt;br /&gt;have the same encoding scheme for the first 127 bits, changing the&lt;br /&gt;character set from US7ASCII to WE8ISO8859P1 will display all characters up&lt;br /&gt;to 127 bits as the same character before and after. In addition, in this&lt;br /&gt;particular example, if any characters have been entered with the 8th bit&lt;br /&gt;set, then updating the database characterset to 8 bit will allow that 8th&lt;br /&gt;bit to be displayed. You must not change the characterset from one encoding&lt;br /&gt;scheme to another encoding scheme where the code pages do not correspond.&lt;br /&gt;This will completely scramble your database. In addition, if case*designer&lt;br /&gt;diagrams are stored in the database, this method must not be used.  Contact&lt;br /&gt;Worldwide Support for further details.&lt;br /&gt;&lt;br /&gt;Before attempting to run any of the scripts below, you must take a full&lt;br /&gt;cold backup of your database. In addition, the procedure must be thoroughly&lt;br /&gt;tested before attempting this on a production instance.&lt;br /&gt;&lt;br /&gt;Here's a SQL*PLUS script that allows a database's character set to be&lt;br /&gt;changed to a different encoding scheme without having to rebuild the database.&lt;br /&gt;set echo off&lt;br /&gt;set verify off&lt;br /&gt;&lt;br /&gt;rem The data dictionary table that records the database&lt;br /&gt;rem character set is sys.props$&lt;br /&gt;rem&lt;br /&gt;rem SQL&gt; describe sys.props$&lt;br /&gt;rem  Name                            Null?    Type&lt;br /&gt;rem  ------------------------------- -------- ----&lt;br /&gt;rem  NAME                            NOT NULL VARCHAR2(30)&lt;br /&gt;rem  VALUE$                                   VARCHAR2(2000)&lt;br /&gt;rem  COMMENT$                                 VARCHAR2(2000)&lt;br /&gt;&lt;br /&gt;rem For example:&lt;br /&gt;rem&lt;br /&gt;rem SQL&gt; column c1 format a30&lt;br /&gt;rem SQL&gt; select name c1, value$ c1 from sys.props$;&lt;br /&gt;&lt;br /&gt;rem C1                             C1&lt;br /&gt;rem ------------------------------ ------------------------------&lt;br /&gt;rem DICT.BASE                      2&lt;br /&gt;rem NLS_LANGUAGE                   AMERICAN&lt;br /&gt;rem NLS_TERRITORY                  AMERICA&lt;br /&gt;rem NLS_CURRENCY                   $&lt;br /&gt;rem NLS_ISO_CURRENCY               AMERICA&lt;br /&gt;rem NLS_NUMERIC_CHARACTERS         .,&lt;br /&gt;rem NLS_DATE_FORMAT                DD-MON-YY&lt;br /&gt;rem NLS_DATE_LANGUAGE              AMERICAN&lt;br /&gt;rem NLS_CHARACTERSET               WE8DEC&lt;br /&gt;rem NLS_SORT                       BINARY&lt;br /&gt;rem GLOBAL_DB_NAME                 NLSV7.WORLD&lt;br /&gt;&lt;br /&gt;rem NLS_CHARACTERSET can be changed by updating its value, for example:&lt;br /&gt;&lt;br /&gt;rem update sys.props$&lt;br /&gt;rem set    value$ = 'WE8ISO8859P1'&lt;br /&gt;rem Where  name = 'NLS_CHARACTERSET';&lt;br /&gt;&lt;br /&gt;rem The database has to be shutdown and restarted before the change&lt;br /&gt;rem becomes effective.&lt;br /&gt;&lt;br /&gt;rem It is very important to specify the character set name correctly.&lt;br /&gt;rem IMPORTANT NOTE&lt;br /&gt;rem =============&lt;br /&gt;rem If NLS_CHARACTERSET is updated to an invalid value, it will not then&lt;br /&gt;rem be possible to restart the database once it has been shutdown.&lt;br /&gt;rem To recover, it will be necessary to re-create the database, since it&lt;br /&gt;rem cannot be restarted to correct the invalid NLS_CHARACTERSET entry.&lt;br /&gt;&lt;br /&gt;rem The character set name should be in uppercase.&lt;br /&gt;rem The new value is not effective until the database has been shutdown and&lt;br /&gt;rem restarted.&lt;br /&gt;rem&lt;br /&gt;rem A suggested procedure is as follows, and can be done by running this&lt;br /&gt;rem script from SQL*Plus when logged into the SYSTEM account.&lt;br /&gt;rem&lt;br /&gt;rem USAGE : SQL&gt; start ch_db.sql &lt;character set&gt;&lt;br /&gt;rem&lt;br /&gt;rem        where &lt;character set&gt; is the desired database character set&lt;br /&gt;rem&lt;br /&gt;&lt;br /&gt;Prompt First check that the character set name is valid.&lt;br /&gt;&lt;br /&gt;set echo on&lt;br /&gt;&lt;br /&gt;select convert('a','&amp;1','us7ascii') from dual;&lt;br /&gt;&lt;br /&gt;set echo off&lt;br /&gt;&lt;br /&gt;prompt If this select statement returns error ORA-01482, then the&lt;br /&gt;prompt specified character set name is not valid for this installation.&lt;br /&gt;prompt Abort the procedure now with Control-c&lt;br /&gt;&lt;br /&gt;prompt To continue, press return&lt;br /&gt;accept ans CHAR&lt;br /&gt;&lt;br /&gt;Prompt  Check the current value of database character set.&lt;br /&gt;&lt;br /&gt;column c1 format a30&lt;br /&gt;select name c1, value$ c1 from sys.props$&lt;br /&gt;where name = 'NLS_CHARACTERSET';&lt;br /&gt;&lt;br /&gt;prompt To continue, press return&lt;br /&gt;&lt;br /&gt;Prompt Update to new character set&lt;br /&gt;&lt;br /&gt;update sys.props$&lt;br /&gt;set    value$ = upper('&amp;1')&lt;br /&gt;where  name = 'NLS_CHARACTERSET';&lt;br /&gt;&lt;br /&gt;set echo off&lt;br /&gt;&lt;br /&gt;prompt To continue, press return&lt;br /&gt;accept ans CHAR&lt;br /&gt;&lt;br /&gt;Prompt Check the new value of database character set&lt;br /&gt;&lt;br /&gt;select name c1, value$ c1 from sys.props$&lt;br /&gt;where name = 'NLS_CHARACTERSET';&lt;br /&gt;&lt;br /&gt;Prompt If the value is updated as required, press return to continue and&lt;br /&gt;Prompt then manually type COMMIT; to commit the change. Then shutdown and&lt;br /&gt;Prompt restart the database.&lt;br /&gt;Prompt&lt;br /&gt;Prompt If the value is not updated as required, press return to continue and&lt;br /&gt;Prompt than manually type ROLLBACK; to prevent the change.&lt;br /&gt;&lt;br /&gt;prompt To continue, press return&lt;br /&gt;accept ans CHAR&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5629028028129393664?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5629028028129393664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5629028028129393664' title='36 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5629028028129393664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5629028028129393664'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/changing-database-character-set.html' title='CHANGING DATABASE CHARACTER SET'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>36</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-134872577088466326</id><published>2008-06-04T07:36:00.001-07:00</published><updated>2008-06-04T07:36:23.540-07:00</updated><title type='text'>Setting Listener Password</title><content type='html'>One of the biggest loophole that an Oracle database installation can have is Oracle Listener without a password. At the time of client server this fact somehow can be overlooked as we know who our user are, but now in days of web we don’t them so its becomes very important that we secure Oracle Listener.&lt;br /&gt;&lt;br /&gt;Setting the password for the listener can be done in following three ways:&lt;br /&gt;&lt;br /&gt;1. Editing the listener.ora file and setting the password in it.&lt;br /&gt;2. Using LSNRCTL utility.&lt;br /&gt;3. Through Oracle Graphical tools such as Net Manager, Oracle Enterprise Manager and so on.&lt;br /&gt;&lt;br /&gt;In this blog entry I will mainly concentrate on first two.&lt;br /&gt;&lt;br /&gt;Under first method we can edit the listener.ora file and add the following line in it.&lt;br /&gt;&lt;br /&gt;PASSWORDS_LISTENER = oraclebrains&lt;br /&gt;&lt;br /&gt;and then restart the listener. But the drawback with this method is that password is stored in plain text format without encryption.&lt;br /&gt;&lt;br /&gt;In Second method, we can run LSNRCTL utility and then can give command as follows:&lt;br /&gt;&lt;br /&gt;LSNRCTL&gt;change_password&lt;br /&gt;&lt;br /&gt;After it it will prompt your for old password, if it is there you can type in or press enter.&lt;br /&gt;&lt;br /&gt;Then it will prompt you for the new password which you want to set and then press enter.&lt;br /&gt;&lt;br /&gt;Then it will again prompt you to reenter the new password for confirmation and then press enter.&lt;br /&gt;&lt;br /&gt;After this password will be changes for running instance or session of the listener.&lt;br /&gt;&lt;br /&gt;If we want it applicable for all the future instance or session we need to save the configuration for future use as follows:&lt;br /&gt;&lt;br /&gt;LSNRCTL&gt; set password&lt;br /&gt;&lt;br /&gt;LSNRCTL&gt; save_config&lt;br /&gt;&lt;br /&gt;One these steps are completed, if we open listener.ora file we will notice that same line as we add in first method is added but password is in encrypted format.&lt;br /&gt;&lt;br /&gt;PASSWORDS_LISTENER = 56ETERY34373WWEGW27362&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-134872577088466326?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/134872577088466326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=134872577088466326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/134872577088466326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/134872577088466326'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/setting-listener-password.html' title='Setting Listener Password'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-4205321598148296630</id><published>2008-06-04T07:35:00.001-07:00</published><updated>2008-06-04T07:35:49.183-07:00</updated><title type='text'>Understanding Asynchronous COMMIT</title><content type='html'>Before Oracle 10g Release 2, Life cycle of a transaction was as follows:&lt;br /&gt;&lt;br /&gt;- Transaction Starts When User Issues the First DML, Oracle generates redo entries corresponding to the DML and write it to buffer in memory.&lt;br /&gt;- While user is issuing DML, Oracle generates redo entries corresponding to the DML and write it to buffer in memory.&lt;br /&gt;- Transaction Ends When User Issues a COMMIT (can be explicit or implicit), Oracle immediately writes this buffered redo to disk.&lt;br /&gt;&lt;br /&gt;Main point to understand here is that once COMMIT is issued, Oracle does not return the control to the user until the redo entries corresponding to that commited transaction have been physically written to disk.&lt;br /&gt;&lt;br /&gt;This way application can be 100% sure that once the transaction is commited, it is protected against instance failure and commited data can be recovered by “rolling forward” log files.&lt;br /&gt;&lt;br /&gt;This is another words we can say is synchronous COMMIT.&lt;br /&gt;&lt;br /&gt;Now Asynchronous COMMIT:&lt;br /&gt;&lt;br /&gt;In Oracle 10g Release 2, keeping in view a very high speed transaction environment, Oracle has introduce two options:&lt;br /&gt;&lt;br /&gt;1. One is to return immediately after the COMMIT is issued, rather than waiting for the log activity to complete.&lt;br /&gt;2. Another option batches multiple transactions together in memory before writing to the disk.&lt;br /&gt;&lt;br /&gt;The full syntax of the new WRITE clause is:&lt;br /&gt;&lt;br /&gt;COMMIT [WRITE [IMMEDIATE | BATCH] [WAIT | NOWAIT] ]&lt;br /&gt;&lt;br /&gt;By default, if no WRITE clause is specified, a normal COMMIT is equivalent to&lt;br /&gt;&lt;br /&gt;COMMIT WRITE IMMEDIATE WAIT;&lt;br /&gt;&lt;br /&gt;The COMMIT statement has a new clause, WRITE, which indicates these options. The default COMMIT statement is the same as:&lt;br /&gt;&lt;br /&gt;COMMIT WRITE IMMEDIATE WAIT;&lt;br /&gt;&lt;br /&gt;To specify that the transaction should be written individually but that the application should not wait for it, specify:&lt;br /&gt;&lt;br /&gt;COMMIT WRITE IMMEDIATE NOWAIT;&lt;br /&gt;&lt;br /&gt;or just&lt;br /&gt;&lt;br /&gt;COMMIT WRITE NOWAIT;&lt;br /&gt;&lt;br /&gt;Likewise, to specify that Oracle’s log writer process (LGWR) is allowed to batch multiple transactions together before writing, specify:&lt;br /&gt;&lt;br /&gt;COMMIT WRITE BATCH NOWAIT;&lt;br /&gt;&lt;br /&gt;The option can also be set system-wide by modifying the commit_write instance parameter. Multiple options are separated by commas, as:&lt;br /&gt;&lt;br /&gt;ALTER SYSTEM SET commit_write = BATCH, NOWAIT;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-4205321598148296630?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/4205321598148296630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=4205321598148296630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4205321598148296630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4205321598148296630'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/understanding-asynchronous-commit.html' title='Understanding Asynchronous COMMIT'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-1479852826328477449</id><published>2008-06-04T07:34:00.000-07:00</published><updated>2008-06-04T07:35:01.810-07:00</updated><title type='text'>Enabling Faster Incremental Backups in Oracle 10g</title><content type='html'>In this blog entry let me introduce you to a new capability in Oracle 10g called Block Change Tracking, which can help DBA’s do faster incremental backups via RMAN (Recovery Manager).&lt;br /&gt;&lt;br /&gt;Once this new capability in Oracle 10g is enabled it start recording the modified since last backup and stores the log of it in a block change tracking file.&lt;br /&gt;&lt;br /&gt;Later while doing backup RMAN uses this file to determine which blocks are needed to be backed up?&lt;br /&gt;&lt;br /&gt;Logically as we can see, this process improves the performance as RMAN does not have to scan whole datafile to detect which block in it has changed and needs backup.&lt;br /&gt;&lt;br /&gt;This may not show any significant impact on smaller database but definitely will have big impact on bigger databases as now with this new functionality it does not have to scan full datafile but only need to query block change tracking file.&lt;br /&gt;&lt;br /&gt;To create the Change Tracking file and enable Change Tracking, make sure the database is either open or mounted. Then issue following SQL:&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING&lt;br /&gt;FILE ‘c:\oracle\oradata\rkt\block_track\block_track_file01.log’;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;Once you issue above SQL, Oracle creates a new background process which is responsible for writing data to the block change tracking file, which is called the block change writer CTRW.&lt;br /&gt;&lt;br /&gt;To verify the status of block change tracking, use following SQL:&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT filename, status, bytes FROM v$block_change_tracking;&lt;br /&gt;&lt;br /&gt;FILENAME&lt;br /&gt;&lt;br /&gt;——————————————————&lt;br /&gt;&lt;br /&gt;STATUS BYTE&lt;br /&gt;&lt;br /&gt;————— ————–&lt;br /&gt;&lt;br /&gt;C:\ORACLE\ORADATA\RKT\BLOCK_TRACK\BLOCK_TRACK_FILE01.LOG&lt;br /&gt;&lt;br /&gt;ENABLED 1024&lt;br /&gt;&lt;br /&gt;To disable block change tracking, use following SQL:&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER DATABASE DISABLE BLOCK CHANGE TRACKING;&lt;br /&gt;&lt;br /&gt;Posted in Articles:: Oracle Backup, Blog::Oracle Backup | No Comments »&lt;br /&gt;&lt;br /&gt;creating UNIQUE index on a table with existing non unique values.&lt;br /&gt;Monday, May 7th, 2007 &lt;br /&gt;Today I came up with this challenge of creating UNIQUE index on a table with exiting non unique value. After lot of r&amp;d I came up with following very interested solution:&lt;br /&gt;&lt;br /&gt;I am using scott schema to show my solution.&lt;br /&gt;&lt;br /&gt;SQL&gt; create table test as select deptno from emp;&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; select deptno from test;&lt;br /&gt;&lt;br /&gt;DEPTNO&lt;br /&gt;———-&lt;br /&gt;20&lt;br /&gt;30&lt;br /&gt;30&lt;br /&gt;20&lt;br /&gt;30&lt;br /&gt;30&lt;br /&gt;10&lt;br /&gt;20&lt;br /&gt;10&lt;br /&gt;30&lt;br /&gt;20&lt;br /&gt;&lt;br /&gt;DEPTNO&lt;br /&gt;———-&lt;br /&gt;30&lt;br /&gt;20&lt;br /&gt;10&lt;br /&gt;&lt;br /&gt;14 rows selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter table test add constraint unique_index unique(deptno) disable;&lt;br /&gt;&lt;br /&gt;Table altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; create index unique_index on test(deptno);&lt;br /&gt;&lt;br /&gt;Index created.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter table test enable novalidate constraint unique_index;&lt;br /&gt;&lt;br /&gt;Table altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; insert into test values (20);&lt;br /&gt;insert into test values (20)&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00001: unique constraint (SCOTT.UNIQUE_INDEX) violated&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-1479852826328477449?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/1479852826328477449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=1479852826328477449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1479852826328477449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1479852826328477449'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/enabling-faster-incremental-backups-in.html' title='Enabling Faster Incremental Backups in Oracle 10g'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5605761626377868506</id><published>2008-06-04T07:30:00.000-07:00</published><updated>2008-06-04T07:31:42.458-07:00</updated><title type='text'>Oracle Histograms</title><content type='html'>About Oracle Histograms &lt;br /&gt;&lt;br /&gt;Histograms may help the Oracle optimizer in deciding whether to use an index vs. a full-table scan (where index values are skewed) or help the optimizer determine the fastest table join order.  For determining the best table join order, the WHERE clause of the query can be inspected along with the execution plan for the original query.  If the cardinality of the table is too-high, then histograms on the most selective column in the WHERE clause will tip-off the optimizer and change the table join order. &lt;br /&gt;&lt;br /&gt;Most Oracle experts only recommend scheduled re-analysis for highly dynamic databases, and most shops save one very-deep sample (with histograms), storing the statistic with the dbms_stats.export_schema_stats procedure. The only exceptions are highly-volatile systems (i.e. lab research systems) where a table is huge one-day and small the next.&lt;br /&gt;&lt;br /&gt;For periodic re-analysis, many shops us the table "monitoring" option and also method_opt "auto" after they are confident that all histograms are in-place.&lt;br /&gt;&lt;br /&gt;Oracle histograms statistics can be created when you have a highly skewed index, where some values have a disproportional number of rows. In the real world, this is quite rare, and one of the most common mistakes with the CBO is the unnecessary introduction of histograms in the CBO statistics. As a general rule, histograms are used when a column's values warrant a change to the execution plan.&lt;br /&gt;&lt;br /&gt;If you need to reanalyze your statistics, the reanalyze task will be less resource intensive with the repeat option. Using the repeat option will only reanalyze indexes with existing histograms, and will not search for other histograms opportunities. This is the way that you will reanalyze you statistics on a regular basis.&lt;br /&gt;&lt;br /&gt;--**************************************************************&lt;br /&gt;-- REPEAT OPTION - Only re-analyze histograms for indexes &lt;br /&gt;-- that have histograms&lt;br /&gt;--&lt;br /&gt;-- Following the initial analysis, the weekly analysis &lt;br /&gt;-- job will use the “repeat” option. The repeat option &lt;br /&gt;-- tells dbms_stats that no indexes have changed, and &lt;br /&gt;-- it will only re-analyze histograms for &lt;br /&gt;-- indexes that have histograms.&lt;br /&gt;--**************************************************************&lt;br /&gt;begin&lt;br /&gt;dbms_stats.gather_schema_stats(&lt;br /&gt;ownname =&gt; 'SCOTT', &lt;br /&gt;estimate_percent =&gt; dbms_stats.auto_sample_size, &lt;br /&gt;method_opt =&gt; 'for all columns size repeat', &lt;br /&gt;degree =&gt; 7&lt;br /&gt;);&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Find histograms for foreign key columns - Many DBAs forget that the CBO must have foreign-key histograms in order to determine the optimal table join order (i.e. the ORDERED hint). &lt;br /&gt;&lt;br /&gt;Fix the cause, not the symptom - For example, whenever I see a sub-optimal order for table joins, I resist the temptation to add the ORDERED hint, and instead create histograms on the foreign keys of the join to force the CBO to make the best decision. &lt;br /&gt;&lt;br /&gt;For new features, explore the Oracle10g automatic histograms collection mechanism that interrogates v$sql_plan to see where the foreign keys are used. It claims to generate histograms when appropriate, all automatically.&lt;br /&gt;&lt;br /&gt;This is one reason that the ORDERED hint is so popular, but it has been shown that having liberal column histograms on the table columns can often aid the optimizer in making better execution plans.&lt;br /&gt;&lt;br /&gt;In sum, histograms are not just for non-unique column values that are unevenly distributed (skewed), and several noted DBA’s have suggested that more liberal use of histograms will aid the CBO is making better decisions. The dbms_stats “auto” feature detects and builds column histograms, but it has the shortcoming of being too conservative in some cases. &lt;br /&gt;&lt;br /&gt;Savvy DBA’s are now experimenting with broad-brush histograms, for all indexes columns. I first heard of this technique from Jeff Maresh (noted data warehouse consultant), who told me that he has taken to creating 10-bucket histograms for all data warehouse table columns. I heard this advice again at the IOUG conference from Arup Nanda (noted author and DBA of the year) and from Mike Ault.&lt;br /&gt;&lt;br /&gt;They are abandoning the use of the “auto” option and manually creating 20-bucket histograms across-the-board, and they claim that it can make a huge difference for databases with lots of multi-table joins in he SQL.&lt;br /&gt;&lt;br /&gt;I’ve not tried this technique yet, but when three experts make the assertion, I believe that there may be something to the new technique. The only downside, of course, is the time required to gather the column histograms and a small amount of additional storage in the data dictionary.&lt;br /&gt;&lt;br /&gt;One exciting feature of dbms_stats is the ability to automatically look for columns that should have histograms, and create the histograms. Multi-bucket histograms add a huge parsing overhead to SQL statements, and histograms should ONLY be used when the SQL will choose a different execution plan based upon the column value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5605761626377868506?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5605761626377868506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5605761626377868506' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5605761626377868506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5605761626377868506'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/oracle-histograms.html' title='Oracle Histograms'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6336840875622365837</id><published>2008-06-04T07:18:00.000-07:00</published><updated>2008-06-04T07:19:19.495-07:00</updated><title type='text'>Oracle's V$ Views</title><content type='html'>v$archive_dest&lt;br /&gt;Shows all archived redo log destinations. Use this view to find out to which place archived redo logs are copied: select dest_id,destination from v$archive_dest These values correspond to the init parameter log_archive_dest_n. &lt;br /&gt;v$archive_dest_status&lt;br /&gt;This view allows to find status and errors for each of the defined &lt;br /&gt;v$archived_log&lt;br /&gt;Displays successfully archived redo logs. shows received logs on a primary standby database. &lt;br /&gt;v$archive_gap&lt;br /&gt;Lists sequence numbers of the archived los that are known to be missing for each thread on a (physical?) standby database (highest gap only). &lt;br /&gt;v$archive_processes&lt;br /&gt;This view provides information on the archive processes. It can be used to find out if an ARCH process is active or not. &lt;br /&gt;v$controlfile&lt;br /&gt;Displays the location and status of each controlfile in the database. &lt;br /&gt;v$controlfile_record_section&lt;br /&gt;See sections in a controlfile. &lt;br /&gt;v$bh&lt;br /&gt;This dynamic view has an entry for each block in the database buffer cache. The column status can be: &lt;br /&gt;free&lt;br /&gt;This block is not in use &lt;br /&gt;xcur&lt;br /&gt;Block held exclusively by this instance &lt;br /&gt;scur&lt;br /&gt;Block held in cache, shared with other instance &lt;br /&gt;cr&lt;br /&gt;Block for consistent read &lt;br /&gt;read&lt;br /&gt;Block being read from disk &lt;br /&gt;mrec&lt;br /&gt;Block in media recovery mode &lt;br /&gt;irec&lt;br /&gt;Block in instance (crash) recovery mode &lt;br /&gt;&lt;br /&gt;v$buffer_pool&lt;br /&gt;See buffer pools. This view's column id can be joined with x$kcbwds.indx See also x$kcbwbpd &lt;br /&gt;v$buffer_pool_statistics&lt;br /&gt;v$database&lt;br /&gt;This view lets you access database information. For example, you can check (using log_mode) whether or not the database is in archivelog mode: &lt;br /&gt;ADPDB&gt;select log_mode from v$database;&lt;br /&gt;&lt;br /&gt;LOG_MODE&lt;br /&gt;------------&lt;br /&gt;ARCHIVELOG&lt;br /&gt;checkpoint_change# records the SCN of the last checkpoint. switchover_status: can be used to determine if it is possible to perform a switchover operation Only available for physical standby databases. Can be: &lt;br /&gt;NOT ALLOWED, &lt;br /&gt;SESSIONS ACTIVE, &lt;br /&gt;SWITCHOVER PENDING, &lt;br /&gt;SWITCHOVER LATENT, &lt;br /&gt;TO PRIMARY, &lt;br /&gt;TO STANDBY or &lt;br /&gt;RECOVERY NEEDED. &lt;br /&gt;See protection modes in data guard for the columns protection_mode and protection_level. database_role determines if a database is a primary or a logical standby database or a physical standby database. force_logging tells if a database is in force logging mode or not. &lt;br /&gt;v$datafile&lt;br /&gt;This view contains an entry for each datafile of the database. This view can be used to find out which datafiles must be backed up in a cold backup: select name from v$datafile &lt;br /&gt;v$datafile_header&lt;br /&gt;Various information about datafile headers. For example, if you're interested in when the a file's last checkpoint was: &lt;br /&gt;select name, checkpoint_change#, to_char(checkpoint_time, 'DD.MM.YYYY HH24:MI:SS') from v$datafile_header&lt;br /&gt;v$dataguard_status&lt;br /&gt;Shows error messages in a data guard environment. &lt;br /&gt;v$db_object_cache&lt;br /&gt;This view displays objects that are cached (pinned) in the library cache. See also dbms_shared_pool. &lt;br /&gt;v$enqueue_stat&lt;br /&gt;If there are a lot of enqueue waits "in" v$session_event or v$system_event, v$enqueue_stat allows to break down those enqueues in enqueue classes. For each such class, the gets, waits, failures and the cumulative sum of waited time can be found. &lt;br /&gt;For a list of enqueue types, refer to enqueue types in x$ksqst. The column cum_wait_time stems from x$ksqst.ksqstwtim. &lt;br /&gt;v$eventmetric&lt;br /&gt;This view is new in Oracle 10g and allows improved timing and statistics. &lt;br /&gt;v$event_name&lt;br /&gt;Contains a record for each wait event. &lt;br /&gt;v$filemetric&lt;br /&gt;This view is new in Oracle 10g and allows improved timing and statistics. &lt;br /&gt;v$filestat&lt;br /&gt;v$fixed_table&lt;br /&gt;This view contains the name of all V$, X$ and GV$ tables. In oracle 8.1.7, there are 187 different v$ tables: &lt;br /&gt;ORA81&gt; select count(*) from v where name like 'V$%';&lt;br /&gt;&lt;br /&gt;  COUNT(*)&lt;br /&gt;----------&lt;br /&gt;       185&lt;br /&gt;If you want to know, which x$ tables there are, do a select name from v$fixed_table where name like 'X$%'; &lt;br /&gt;v$fixed_view_definition&lt;br /&gt;Contains the defintion in its attribute view_definition for the views of v$fixed_table. &lt;br /&gt;v$flash_recovery_area_usage&lt;br /&gt;See also v$recovery_file_dest &lt;br /&gt;v$instance&lt;br /&gt;instance_role can be used to determine if an instance is an active instance (=primary instance) or a secondary instance (in a standby environment. dbms_utility.db_version can be used to retrieve the same version as the field version in v$instance. &lt;br /&gt;v$latch&lt;br /&gt;Oracle collects statistics for the activity of all latches and stores these in this view. Gets is the number of successful willing to wait requests for a latch. Similarly, misses is how many times a process didn't successfully request a latch. Spin_gets: number of times a latch is obtained after spinning at least once. Sleeps indicates how many times a willing to wait process slept. Waiters_woken tells how often a sleeping process was 'disturbed'. &lt;br /&gt;v$librarycache&lt;br /&gt;v$lock&lt;br /&gt;This view stores all information relating to locks in the database. The interesting columns in this view are sid (identifying the session holding or aquiring the lock), type, and the lmode/request pair. Important possible values of type are TM (DML or Table Lock), TX (Transaction), MR (Media Recovery), ST (Disk Space Transaction). Exactly one of the lmode, request pair is either 0 or 1 while the other indicates the lock mode. If lmode is not 0 or 1, then the session has aquired the lock, while it waits to aquire the lock if request is other than 0 or 1. The possible values for lmode and request are: &lt;br /&gt;1: null, &lt;br /&gt;2: Row Share (SS), &lt;br /&gt;3: Row Exclusive (SX), &lt;br /&gt;4: Share (S), &lt;br /&gt;5: Share Row Exclusive (SSX) and &lt;br /&gt;6: Exclusive(X) &lt;br /&gt;If the lock type is TM, the column id1 is the object's id and the name of the object can then be queried like so: select name from sys.obj$ where obj# = id1 A lock type of JI indicates that a materialized view is being refreshed. A more detailed example can be found here See also x$kgllk. &lt;br /&gt;v$locked_object&lt;br /&gt;Who is locking what: &lt;br /&gt;select &lt;br /&gt;  oracle_username&lt;br /&gt;  os_user_name,&lt;br /&gt;  locked_mode,&lt;br /&gt;  object_name,&lt;br /&gt;  object_type&lt;br /&gt;from &lt;br /&gt;  v$locked_object a,dba_objects b&lt;br /&gt;where &lt;br /&gt;  a.object_id = b.object_id&lt;br /&gt;v$log&lt;br /&gt;Contains information on each log group. See also online redo log. Comman values for the status column are: &lt;br /&gt;UNUSED: &lt;br /&gt;Oracle8 has never written to this group, &lt;br /&gt;CURRENT: &lt;br /&gt;This is the active group. &lt;br /&gt;ACTIVE: &lt;br /&gt;Oracle has written to this log before, it is needed for instance recovery.&lt;br /&gt;The active log is the one with the current log sequence number &lt;br /&gt;INACTIVE:&lt;br /&gt;Oracle has written to this log before; it is not needed for instance recovery. &lt;br /&gt;&lt;br /&gt;v$logfile&lt;br /&gt;This view can be queried to find the filenames, group numbers and states of redo log files. For example, to find all files of group 2, use select member from v$logfile where group# = 2 &lt;br /&gt;v$logmnr_contents&lt;br /&gt;See dbms_logmnr. &lt;br /&gt;v$log_history&lt;br /&gt;This view contains an entry for each Log Switch that occured. The column first_time indicates the time of the first entry??? On physical standby databases, this view shows applied logs. &lt;br /&gt;v$logstdby&lt;br /&gt;Can be used to verify that archived redo logs are being applied to standby databases. &lt;br /&gt;v$managed_standby&lt;br /&gt;Monitors the progress of a standby database in managed recovery mode, more exactly, it displays information about the activities of log transport service and log apply service. see here &lt;br /&gt;select process, pid, status, client_process, group# "Stdby Redo Log Gr", block# from v$managed_standby;&lt;br /&gt;client_process: the corresponding primary database process. If lgwr log transmission is chosen, one row should have client_process=LGWR. If ARCH transmission is chosen, one row should have ARCH. &lt;br /&gt;v$mystat&lt;br /&gt;This view records statistical data about the session that accesses it. Join statistic# with v$statname. &lt;br /&gt;v$sesstat is also similar to v$sysstat, except that v$sysstat accumulates the statistics as soon as a session terminates. See also recording statistics with oracle. &lt;br /&gt;v$nls_parameters&lt;br /&gt;The NLS parameters that are in effect for the session quering this view. The view NLS_SESSION_PARAMETERS is based on v$nls_parameters. See also v$nls_valid_values. &lt;br /&gt;v$nls_valid_values&lt;br /&gt;This view can be used to obtain valid values for NLS parameters such as &lt;br /&gt;supported character sets &lt;br /&gt;languages &lt;br /&gt;territories &lt;br /&gt;sorting orders &lt;br /&gt;&lt;br /&gt;v$object_usage&lt;br /&gt;v$object_usage gathers information about used (accessed) indexes when an index is monitored using alter index ... monitoring usage. See On verifying if an index is used. &lt;br /&gt;v$open_cursor&lt;br /&gt;v$option&lt;br /&gt;This view lets you see which options are installed in the server. See also dba_registry. &lt;br /&gt;v$parameter&lt;br /&gt;Lists the name-value pairs of the init.ora file (or their default, if not in the init.ora). For example, if you need to know what your block size is: &lt;br /&gt;select value from v$parameter where name = 'db_block_size'&lt;br /&gt;The columns isses_modifiable and issys_modifiable can be used to determine if a parameter can be changed at session level using alter session or at system level using alter system. A parameter is modifiable at session level if isses_modifiable = 'TRUE'. A parameter is modifiable at system level if issys_modifiable = 'DEFERRED' or issys_modifiable = 'IMMEDIATE'. However, if a parameter is changed at system level if issys_modifiable = 'DEFERRED' it only affects sessions that are started after chaning the parameter. Additionally, the alter system set ... deferred option must be used. There are also some undocumented (or hidden?) parameters. &lt;br /&gt;v$pgastat&lt;br /&gt;See also pga. Thanks to Oleg who notified me of a typo (v$pgastat instead of v$pga_stat). &lt;br /&gt;v$process&lt;br /&gt;Join v$process's addr with v$session paddr. The column traceid is equal to the value used in alter session set . &lt;br /&gt;v$pwfile_users&lt;br /&gt;Lists all users who have been granted sysdba or sysoper privileges. See adding user to a password file. &lt;br /&gt;v$recover_file&lt;br /&gt;Useful to find out which datafiles need recovery. Join with v$datafile to see filenames instead of numbers.... &lt;br /&gt;v$recovery_file_dest&lt;br /&gt;See also v$flash_recovery_area_usage &lt;br /&gt;v$reserved_words&lt;br /&gt;This view can be consulted if one is in doubt wheter a particular word is a reserved word (for example when writing PL/SQL Code or assigning a password to a user). Until 9i (is this correct?), the view only consist of two columns: keyword and length. From 10g onwards (?), it has also the columns reserved, res_type, res_attr, res_semi and duplicate. Each of these new columns can only be either 'Y' (meaning: yes) or 'N' (meaning: no) See also reserved words in SQL and reserved words in PL/SQL. &lt;br /&gt;v$resource_limit&lt;br /&gt;v$rollname&lt;br /&gt;The names of online rollback segments. This view's usn field can be joined with v$rollstat's usn field and with v$transaction's xidusn field. v$transaction can be used to track undo by session. &lt;br /&gt;v$rollstat&lt;br /&gt;Statistics for rollback segements &lt;br /&gt;v$session&lt;br /&gt;The column audsid can be joined with sys_context('userenv','SESSIONID') to find out which session is the "own one". Alternatively, dbms_support.mysid can be used. The fields module and action of v$session can be set with dbms_application_info.set_module. (See v$session_longops for an example. The field client_info can be set with dbms_application_info.set_client_info Join sid with v$sesstat if you want to get some statistical information for a particular sesssion. A record in v$session contains sid and serial#. These numbers can be used kill a session (alter system kill session). A client can set some information in client_info. For example, RMAN related sessions can be found with &lt;br /&gt;.... where client_info like 'rman%';&lt;br /&gt;What a session is waiting for can be queried with v$session_wait. However, with Oracle 10g, this is not nessessary anymore, as v$session_wait's information will be exposed within v$session as well. See also sessions. &lt;br /&gt;v$sessmetric&lt;br /&gt;This view is new in Oracle 10g and allows improved timing and statistics. &lt;br /&gt;v$session_event&lt;br /&gt;This views is similar to v$system_event. However, it breaks it down to currently connected sessions. v$session_event has also the column max_wait that shows the maximum time waited for a wait event. &lt;br /&gt;v$session_longops&lt;br /&gt;Use v$session_longops if you have a long running pl/sql procedure and want to give feedback on how far the procedure proceeded. If the following Procedure is run, it will report its progress in v$session_longops. The Procedure will also set the module attribute in v$session which makes it possible to find the sid and serial# of the session. &lt;br /&gt;create table f(g number);&lt;br /&gt;&lt;br /&gt;create or replace procedure long_proc as&lt;br /&gt;    rindex       pls_integer := dbms_application_info.set_session_longops_nohint;&lt;br /&gt;    slno         pls_integer; &lt;br /&gt;                                          -- Name of task&lt;br /&gt;    op_name      varchar2(64) := 'long_proc';&lt;br /&gt;&lt;br /&gt;    target       pls_integer := 0;        -- ie. The object being worked on&lt;br /&gt;    context      pls_integer;             -- Any info&lt;br /&gt;    sofar        number;                  -- how far proceeded&lt;br /&gt;    totalwork    number := 1000000;       -- finished when sofar=totalwork&lt;br /&gt;&lt;br /&gt;                                          -- desc of target&lt;br /&gt;    target_desc  varchar2(32) := 'A long running procedure';&lt;br /&gt;&lt;br /&gt;    units        varchar2(32) := 'inserts';                -- unit of sofar and totalwork&lt;br /&gt;  begin&lt;br /&gt;&lt;br /&gt;  dbms_application_info.set_module('long_proc',null);&lt;br /&gt;&lt;br /&gt;  dbms_application_info.set_session_longops (&lt;br /&gt;    rindex,&lt;br /&gt;    slno);&lt;br /&gt;&lt;br /&gt;  for sofar in 0..totalwork loop&lt;br /&gt;&lt;br /&gt;    insert into f values (sofar);&lt;br /&gt;&lt;br /&gt;    if mod(sofar,1000) = 0 then&lt;br /&gt;      dbms_application_info.set_session_longops (&lt;br /&gt;        rindex,&lt;br /&gt;        slno,&lt;br /&gt;        op_name,&lt;br /&gt;        target,&lt;br /&gt;        context,&lt;br /&gt;        sofar,&lt;br /&gt;        totalwork,&lt;br /&gt;        target_desc,&lt;br /&gt;        units);&lt;br /&gt;&lt;br /&gt;    end if;&lt;br /&gt;&lt;br /&gt;  end loop;&lt;br /&gt;end long_proc;&lt;br /&gt;If the procedure long_proc is run, you can issue the following query to get feedback on its progress: &lt;br /&gt;select time_remaining,sofar,elapsed_seconds &lt;br /&gt;from v$session_longops l, v$session s &lt;br /&gt;where l.sid=s.sid and l.serial# = s.serial# and s.module='long_proc'&lt;br /&gt;v$session_wait&lt;br /&gt;This views shows what wait event each session is waiting for, or what the last event was that it waited for. &lt;br /&gt;In contrast, v$session_event lists the cumulative history of events waited for in a session. The columns P1, P2 and P3 are parameters that are dependant on the event. With Oracle 10g, v$session_wait's information will be exposed within v$session as well. Since 10g, Oracle displays the v$session_wait information also in the v$session view. &lt;br /&gt;v$session_wait_history&lt;br /&gt;This view is new in Oracle 10g and allows improved timing and statistics. &lt;br /&gt;v$sesstat&lt;br /&gt;This view is similar to v$mystat except that it shows cumulated statistics for all sessions. Join sid with v$session and join statistic# with v$statname. v$sesstat is also similar to v$sysstat, except that v$sysstat accumulates the statistics as soon as a session terminates. &lt;br /&gt;v$sga&lt;br /&gt;Shows how much memory the shared global area uses. Selecting * from v$sga is roughly the same as typing show sga in sql plus with the exeption that the latter also show the total. &lt;br /&gt;v$sgastat&lt;br /&gt;Showing free space in the sga: &lt;br /&gt;select * from v$sgastat where name = 'free memory'&lt;br /&gt;v$sga_dynamic_components&lt;br /&gt;Information about SGA resize operations since startup. This view can also be used to find out the granule size of SGA components. &lt;br /&gt;v$sga_resize_ops&lt;br /&gt;v$sort_usage&lt;br /&gt;See temporary tablespaces &lt;br /&gt;v$sort_segment&lt;br /&gt;See Temporary Tablespaces &lt;br /&gt;v$spparameter&lt;br /&gt;Returns the values for the spfile. &lt;br /&gt;v$sql&lt;br /&gt;v$sql is similar to v$sqlarea, the main difference being that v$sql drills down to select * from x$kglob whereas v$sqlarea drills down to select sum from x$kglob. See also here. &lt;br /&gt;v$sqlarea&lt;br /&gt;Join v$sqlarea's address with v$session's sql_address. Find the SQL-text of currently running SQL statements: &lt;br /&gt;select sql_text from v$sqlarea where users_executing &gt; 0;&lt;br /&gt;The field version_count indicates how many versions an sql statement has. &lt;br /&gt;v$sqltext&lt;br /&gt;v$sql_plan&lt;br /&gt;variable addr varchar2(20)&lt;br /&gt;variable hash number&lt;br /&gt;variable child number&lt;br /&gt;&lt;br /&gt;exec :addr := '&amp;sqladdr'; :hash :=  &amp;hashvalue; :child := &amp;childno;&lt;br /&gt;&lt;br /&gt;select lpad(' ', 2*(level-1))||operation||' '||&lt;br /&gt;decode(id, 0, 'Cost = '||position) "OPERATION",&lt;br /&gt;options, object_name&lt;br /&gt;from v$sql_plan&lt;br /&gt;start with (address = :addr&lt;br /&gt;              and hash_value = :hash&lt;br /&gt;              and child_number = :child&lt;br /&gt;              and id=0 )&lt;br /&gt;  connect by prior id = parent_id&lt;br /&gt;          and prior address = address&lt;br /&gt;          and prior hash_value = hash_value&lt;br /&gt;          and prior child_number = child_number&lt;br /&gt;  order by id, position ;&lt;br /&gt;In order to find valid values for sqladdr, hashvalue and childno, this SQL statement can be used: &lt;br /&gt;select sql_text,address,hash_value,child_number from v$sql where users_executing &gt; 0; &lt;br /&gt;v$sql_text_with_newlines&lt;br /&gt;This view can be used to construct the entire text for each session's actual SQL statement. Use the following statement to to that: &lt;br /&gt;set serveroutput on size 1000000&lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;  v_stmt     varchar2(16000);&lt;br /&gt;  v_sql_text v$sqltext_with_newlines.sql_text%type;&lt;br /&gt;  v_sid      v$session.sid%type;&lt;br /&gt;begin&lt;br /&gt;  for r in (&lt;br /&gt;    select &lt;br /&gt;        sql_text,s.sid&lt;br /&gt;    from &lt;br /&gt;      v$sqltext_with_newlines t, &lt;br /&gt;      v$session s &lt;br /&gt;    where &lt;br /&gt;      s.sql_address=t.address&lt;br /&gt;    order by s.sid, piece) loop&lt;br /&gt;&lt;br /&gt;    v_sid := nvl(v_sid,r.sid);&lt;br /&gt;&lt;br /&gt;    if v_sid &lt;&gt; r.sid then&lt;br /&gt;      dbms_output.put_line(v_sid);&lt;br /&gt;      &lt;a href='oru_10028.html'&gt;put_line&lt;/a&gt;(v_stmt,100);&lt;br /&gt;      v_sid  := r.sid; &lt;br /&gt;      v_stmt := r.sql_text;&lt;br /&gt;    else&lt;br /&gt;      v_stmt := v_stmt || r.sql_text;&lt;br /&gt;    end if;&lt;br /&gt;    &lt;br /&gt;  end loop;&lt;br /&gt;  dbms_output.put_line(v_sid);&lt;br /&gt;  dbms_output.put_line(v_stmt,100);&lt;br /&gt;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;Thanks to Sarmad Zafar who notified me of an error in this PL/SQL Block. Note: the function put_line is found here and can be used to prevent ORU-10028. &lt;br /&gt;v$sql_bind_data&lt;br /&gt;Join cursor_num with cno of v$sql_cursor. &lt;br /&gt;v$sql_bind_capture&lt;br /&gt;New with Oracle 10g This view captures bind variables for all sessions and is faster than setting 10046 on level 4. &lt;br /&gt;v$sql_cursor&lt;br /&gt;Join parent_handle with address of v$sql or v$sqlarea. &lt;br /&gt;v$sql_workarea&lt;br /&gt;v$sql_workarea can be joined with v$sqlarea on address and hash_value, and it can be joined with v$sql on address, hash_value and child_number. &lt;br /&gt;v$standby_log&lt;br /&gt;v$statname&lt;br /&gt;Use this view to get decoded names for the statistic# field of v$mystat, v$sysstat and v$sesstat. &lt;br /&gt;v$sysaux_occupants&lt;br /&gt;v$sysaux_occupants doesn't exist in Oracle versions prior to Oracle 10g. See occupants in the sysaux tablepsaces. &lt;br /&gt;v$sysmetric&lt;br /&gt;This view is new in Oracle 10g and allows improved timing and statistics. &lt;br /&gt;v$sysmetric_history&lt;br /&gt;This view is new in Oracle 10g and allows improved timing and statistics. &lt;br /&gt;v$sysstat&lt;br /&gt;v$sysstat is similar to v$sesstat. While v$sesstat displays statitics for the current session, v$sysstat displays the cumulated statitics since startup of the database. For example, it is possible to find out the CPU time (name = 'CPU used by this session') This view is (among others) used to calculate the Hit Ratio. &lt;br /&gt;v$system_event&lt;br /&gt;This view displays the count (total_waits) of all wait events since startup of the instance. If timed_statistics is set to true, the sum of the wait times for all events are also displayed in the column time_waited. The unit of time_waited is one hundreth of a second. Since 10g, an additional column (time_waited_micro) measures wait times in millionth of a second. total_waits where event='buffer busy waits' is equal the sum of count in v$waitstat. v$enqueue_stat can be used to break down waits on the enqueue wait event. While this view totals all events in an instance, v$session_event breaks it down to all currently connected sessions. &lt;br /&gt;v$undostat&lt;br /&gt;undo tablespaces &lt;br /&gt;v$tempfile&lt;br /&gt;v$tempseg_usage&lt;br /&gt;v$tempseg_usage is a public synonym for v$sort_usage. &lt;br /&gt;v$tempstat&lt;br /&gt;v$thread&lt;br /&gt;The Oracle SID can be retrieved through select instance from v$thread &lt;br /&gt;v$timer&lt;br /&gt;This view has only one column (hsecs) which counts hundreths of seconds. Whenever it overflows four bytes, it starts again with 0. &lt;br /&gt;v$transaction&lt;br /&gt;Important fields of v$transaction are used_ublk and used_urec. They tell of how many blocks and records the undo for a transaction consists. In order to find out the name of the corresponding rollback segemnt, join the xidusn field with the usn field of v$rollname. This is demonstrated in Transactions generate undo &lt;br /&gt;v$timezone_names&lt;br /&gt;See also timezones for some values of tzabbrev. &lt;br /&gt;v$transportable_platform&lt;br /&gt;Which platforms are supported for cross platform transportable tablespaces. &lt;br /&gt;v$version&lt;br /&gt;Use this view to find out what version you actually work on: select * from v$version; &lt;br /&gt;BANNER&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production&lt;br /&gt;PL/SQL Release 8.1.7.0.0 - Production&lt;br /&gt;CORE    8.1.7.0.0       Production&lt;br /&gt;TNS for 32-bit Windows: Version 8.1.7.0.0 - Production&lt;br /&gt;NLSRTL Version 3.4.1.0.0 - Production&lt;br /&gt;v$waitstat&lt;br /&gt;total_waits where event='buffer busy waits' is equal the sum of count in v$system_event.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6336840875622365837?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6336840875622365837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6336840875622365837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6336840875622365837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6336840875622365837'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/oracles-v-views.html' title='Oracle&apos;s V$ Views'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6337489724553131222</id><published>2008-06-04T07:16:00.001-07:00</published><updated>2008-06-04T07:16:48.864-07:00</updated><title type='text'>Oracle DBA Checklist</title><content type='html'>I. Daily Procedures&lt;br /&gt;&lt;br /&gt;A. Verify all instances are up&lt;br /&gt;Make sure the database is available.  Log into each instance and run daily reports or test scripts.  Some sites may wish to automate this.&lt;br /&gt;Optional implementation: use Oracle Enterprise Manager's 'probe' event.&lt;br /&gt;B. Look for any new alert log entries&lt;br /&gt;• Connect to each managed system.&lt;br /&gt;• Use 'telnet' or comparable program.&lt;br /&gt;• For each managed instance, go to the background dump destination, usually $ORACLE_BASE/&lt;SID&gt;/bdump. Make sure to look under each managed database's SID.&lt;br /&gt;• At the prompt, use the Unix ‘tail’ command to see the  alert_&lt;SID&gt;.log, or otherwise examine the most recent entries in the file.&lt;br /&gt;• If any ORA-errors have appeared since the previous time you looked, note them in the Database Recovery Log and investigate each one. The recovery log is in &lt;file&gt;.&lt;br /&gt;C. Verify DBSNMP is running&lt;br /&gt;1. Log on to each managed machine to check for the 'dbsnmp' process.  &lt;br /&gt;For Unix:  at the command line, type ps –ef | grep dbsnmp.  There should be two dbsnmp processes running.  If not, restart DBSNMP. (Some sites have this disabled on purpose; if this is the case, remove this item from your list, or change it to "verify that DBSNMP is NOT running".)&lt;br /&gt;D. Verify success of database backup &lt;br /&gt;E. Verify success of database archiving to tape &lt;br /&gt;F. Verify enough resources for acceptable performance&lt;br /&gt;1. Verify free space in tablespaces.  &lt;br /&gt;For each instance, verify that enough free space exists in each tablespace to handle the day’s expected growth.  As of &lt;date&gt;, the minimum free space for &lt;repeat for each tablespace&gt;: [ &lt; tablespace &gt; is &lt; amount &gt; ].  When incoming data is stable, and average daily growth can be calculated, then the minimum free space should be at least &lt;time to order, get, and install more disks&gt; days’ data growth.&lt;br /&gt;a) Go to each instance, run free.sql to check free mb in tablespaces.&lt;br /&gt;Compare to the minimum free MB for that tablespace.  Note any low-space conditions and correct.&lt;br /&gt;b) Go to each instance, run space.sql to check percentage free in tablespaces.&lt;br /&gt;Compare to the minimum percent free for that tablespace.  Note any low-space conditions and correct.&lt;br /&gt;2. Verify rollback segment.&lt;br /&gt;Status should be ONLINE, not OFFLINE or FULL, except in some cases you may have a special rollback segment for large batch jobs whose normal status is OFFLINE.&lt;br /&gt;a) Optional: each database may have a list of rollback segment names and their expected statuses.&lt;br /&gt;b) For current status of each ONLINE or FULL rollback segment (by ID not by name), query on V$ROLLSTAT.&lt;br /&gt;c) For storage parameters and names of ALL rollback segment, query on DBA_ROLLBACK_SEGS.  That view’s STATUS field is less accurate than V$ROLLSTAT, however, as it lacks the PENDING OFFLINE and FULL statuses, showing these as OFFLINE and ONLINE respectively.&lt;br /&gt;3. Identify bad growth projections.&lt;br /&gt;Look for segments in the database that are running out of resources (e.g. extents) or growing at an excessive rate.  The storage parameters of these segments may need to be adjusted.  For example, if any object reached 200 as the number of current extents, AND it's an object that is supposed to get large, upgrade the max_extents to unlimited.&lt;br /&gt;a) To gather daily sizing information, run analyze5pct.sql.  If you are collecting nightly volumetrics, skip this step.&lt;br /&gt;b) To check current extents, run nr_extents.sql&lt;br /&gt;c) Query current table sizing information&lt;br /&gt;d) Query current index sizing information&lt;br /&gt;e) Query growth trends&lt;br /&gt;4. Identify space-bound objects.&lt;br /&gt;Space-bound objects’ next_extents are bigger than the largest extent that the tablespace can offer.  Space-bound objects can harm database operation.  If we get such object, first need to investigate the situation.  Then we can use ALTER TABLESPACE &lt;tablespace&gt; COALESCE.  Or add another datafile.&lt;br /&gt;a) Run spacebound.sql.  If all is well, zero rows will be returned.&lt;br /&gt;5.  Processes to review contention for CPU, memory, network or disk resources.&lt;br /&gt;a) To check CPU utilization, go to x:\web\phase2\default.htm =&gt;system metrics=&gt;CPU utilization page.  400 is the maximum CPU utilization because there are 4 CPUs on phxdev and phxprd machine.  We need to investigate if CPU utilization keeps above 350 for a while. &lt;br /&gt;&lt;br /&gt;G. Copy Archived Logs to Standby Database and Roll Forward&lt;br /&gt;If you have a Standby Database, copy the appropriate Archived Logs to the expected location on the standby machine and apply those logs (roll forward the changes) to the standby database.  This keeps the standby database up-to-date.&lt;br /&gt;&lt;br /&gt;The copying of logs, the applying of them, or both, can in some cases be automated.  If you have automated them, then your daily task should be to confirm that this happened correctly each day.&lt;br /&gt;H. Read DBA manuals for one hour &lt;br /&gt;Nothing is more valuable in the long run than that the DBA be as widely experienced, and as widely read, as possible.  Readings should include DBA manuals, trade journals, and possibly newsgroups or mailing lists.&lt;br /&gt; &lt;br /&gt;II. Nightly Procedures &lt;br /&gt;Most production databases (and many development and test databases) will benefit from having certain nightly batch processes run.&lt;br /&gt;A. Collect volumetric data&lt;br /&gt;This example collects table row counts.  This can easily be extended to other objects such as indexes, and other data such as average row sizes.  &lt;br /&gt;1. Analyze Schemas and Collect Data.&lt;br /&gt;The idea here is to use the more time consuming and more accurate ANALYZE COMPUTE command and save the results, which show up in the data dictionary, to a more permanent store.&lt;br /&gt;a) If you havent' yet, create the volumetrics table with mk_volfact.sql &lt;br /&gt;b) To gather nightly sizing information, run analyze_comp.sql. &lt;br /&gt;c) To collect the resulting statistics, run pop_vol.sql &lt;br /&gt;d) Examine the data at your leisure, probably weekly or monthly.&lt;br /&gt;I use MS Excel and an ODBC connection to examine and graph data growth.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;III. Weekly Procedures&lt;br /&gt;A. Look for objects that break rules&lt;br /&gt;For each object-creation policy (naming convention, storage parameters, etc.) have an automated check to verify that the policy is being followed.&lt;br /&gt;1. Every object in a given tablespace should have the exact same size for NEXT_EXTENT, which should match the tablespace default for NEXT_EXTENT.  As of 12/14/98, default NEXT_EXTENT for DATAHI is 1 gig (1048576 bytes), DATALO is 500 mb (524288 bytes), and INDEXES is 256 mb (262144 bytes).&lt;br /&gt;a) To check settings for NEXT_EXTENT, run nextext.sql.&lt;br /&gt;b) To check existing extents, run existext.sql&lt;br /&gt;&lt;br /&gt;2. All tables should have unique primary keys.  &lt;br /&gt;a) To check missing PK, run no_pk.sql.&lt;br /&gt;b) To check disabled PK, run disPK.sql.&lt;br /&gt;c) All primary key indexes should be unique.  Run nonuPK.sql to check.&lt;br /&gt;&lt;br /&gt;3. All indexes should use INDEXES tablespace.  Run mkrebuild_idx.sql.  &lt;br /&gt;4. Schemas should look identical between environments, especially test and production.&lt;br /&gt;a) To check data type consistency, run datatype.sql.&lt;br /&gt;b) To check other object consistency, run obj_coord.sql.&lt;br /&gt;c) Better yet, use a tool like Quest Software's Schema Manager. &lt;br /&gt;B. Look for security policy violations&lt;br /&gt;C. Look in SQL*Net logs for errors, issues&lt;br /&gt;1. Client side logs&lt;br /&gt;2. Server side logs&lt;br /&gt;D. Archive all Alert Logs to history&lt;br /&gt;&lt;br /&gt;E. Visit home pages of key vendors&lt;br /&gt;1. Oracle Corporation&lt;br /&gt;http://www.oracle.com&lt;br /&gt;http://technet.oracle.com&lt;br /&gt;http://www.oracle.com/support&lt;br /&gt;http://www.oramag.com&lt;br /&gt;2. Quest Software &lt;br /&gt;http://www.quests.com&lt;br /&gt;3. Sun Microsystems&lt;br /&gt;http://www.sun.com&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;IV. Monthly Procedures&lt;br /&gt;A. Look for Harmful Growth Rates&lt;br /&gt;1. Review changes in segment growth when compared to previous reports to identify segments with a harmful growth rate.&lt;br /&gt;B. Review Tuning Opportunities&lt;br /&gt;1. Review common Oracle tuning points such as cache hit ratio, latch contention, and other points dealing with memory management.  Compare with past reports to identify harmful trends or determine impact of recent tuning adjustments.&lt;br /&gt;C. Look for I/O Contention&lt;br /&gt;1. Review database file activity.  Compare to past output to identify trends that could lead to possible contention.&lt;br /&gt;D. Review Fragmentation&lt;br /&gt;1. Investigate fragmentation (e.g. row chaining, etc.).&lt;br /&gt;E. Project Performance into the Future&lt;br /&gt;1. Compare reports on CPU, memory, network, and disk utilization from both Oracle and the operating system to identify trends that could lead to contention for any one of these resources in the near future.&lt;br /&gt;2.  Compare performance trends to Service Level Agreement to see when the system will go out of bounds&lt;br /&gt;F. Perform Tuning and Maintenance&lt;br /&gt;1. Make the adjustments necessary to avoid contention for system resources.  This may include scheduled down time or request for additional resources.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;V. Appendix&lt;br /&gt;&lt;br /&gt;A. Daily Procedures&lt;br /&gt;1. Free.sql&lt;br /&gt;--&lt;br /&gt;-- free.sql&lt;br /&gt;--&lt;br /&gt;--   To verify free space in tablespaces&lt;br /&gt;--   Minimum amount of free space&lt;br /&gt;--   document your thresholds:&lt;br /&gt;--   &lt;tablespace_name&gt; = &lt;amount&gt; m&lt;br /&gt;--&lt;br /&gt;&lt;br /&gt;SELECT  tablespace_name, sum ( blocks ) as free_blk , trunc ( sum ( bytes ) / (1024*1024) ) as free_m&lt;br /&gt;, max ( bytes ) / (1024) as big_chunk_k, count (*) as num_chunks&lt;br /&gt;FROM dba_free_space&lt;br /&gt;GROUP BY tablespace_name&lt;br /&gt;&lt;br /&gt;2. Space.sql&lt;br /&gt;--&lt;br /&gt;-- space.sql&lt;br /&gt;--&lt;br /&gt;-- To check free, pct_free, and allocated space within a tablespace&lt;br /&gt;--&lt;br /&gt;-- 11/24/98&lt;br /&gt;&lt;br /&gt;SELECT tablespace_name, largest_free_chunk&lt;br /&gt;     , nr_free_chunks, sum_alloc_blocks, sum_free_blocks&lt;br /&gt;     , to_char(100*sum_free_blocks/sum_alloc_blocks, '09.99') || '%' &lt;br /&gt;       AS pct_free&lt;br /&gt;FROM ( SELECT tablespace_name&lt;br /&gt;            , sum(blocks) AS sum_alloc_blocks&lt;br /&gt;       FROM dba_data_files&lt;br /&gt;       GROUP BY tablespace_name&lt;br /&gt;     )&lt;br /&gt;   , ( SELECT tablespace_name AS fs_ts_name&lt;br /&gt;            , max(blocks) AS largest_free_chunk&lt;br /&gt;            , count(blocks) AS nr_free_chunks&lt;br /&gt;            , sum(blocks) AS sum_free_blocks&lt;br /&gt;               FROM dba_free_space&lt;br /&gt;               GROUP BY tablespace_name )&lt;br /&gt;WHERE tablespace_name = fs_ts_name&lt;br /&gt;3. analyze5pct.sql&lt;br /&gt;--&lt;br /&gt;-- analyze5pct.sql&lt;br /&gt;--&lt;br /&gt;-- To analyze tables and indexes quickly, using a 5% sample size&lt;br /&gt;-- (do not use this script if you are performing the overnight&lt;br /&gt;-- collection of volumetric data)&lt;br /&gt;--&lt;br /&gt;-- 11/30/98&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;   dbms_utility.analyze_schema ( '&amp;OWNER', 'ESTIMATE', NULL, 5 ) ;&lt;br /&gt;END ;&lt;br /&gt;/&lt;br /&gt;4. nr_extents.sql &lt;br /&gt;--&lt;br /&gt;-- nr_extents.sql&lt;br /&gt;--&lt;br /&gt;-- To find out any object reaching &lt;threshold&gt; &lt;br /&gt;-- extents, and manually upgrade it to allow unlimited&lt;br /&gt;-- max_extents (thus only objects we *expect* to be big&lt;br /&gt;-- are allowed to become big)&lt;br /&gt;--&lt;br /&gt;-- 11/30/98&lt;br /&gt;&lt;br /&gt;SELECT e.owner, e.segment_type , e.segment_name , count(*) as nr_extents , s.max_extents&lt;br /&gt;, to_char ( sum ( e.bytes ) / ( 1024 * 1024 ) , '999,999.90') as MB&lt;br /&gt;FROM dba_extents e , dba_segments s&lt;br /&gt;WHERE e.segment_name = s.segment_name&lt;br /&gt;GROUP BY e.owner, e.segment_type , e.segment_name , s.max_extents&lt;br /&gt;HAVING count(*) &gt; &amp;THRESHOLD &lt;br /&gt;    OR ( ( s.max_extents - count(*) ) &lt; &amp;&amp;THRESHOLD )&lt;br /&gt;ORDER BY count(*) desc&lt;br /&gt;&lt;br /&gt;5. spacebound.sql&lt;br /&gt;--&lt;br /&gt;-- spacebound.sql&lt;br /&gt;--&lt;br /&gt;-- To identify space-bound objects.  If all is well, no rows are returned.&lt;br /&gt;-- If any space-bound objects are found, look at value of NEXT extent &lt;br /&gt;-- size to figure out what happened.&lt;br /&gt;-- Then use coalesce (alter tablespace &lt;foo&gt; coalesce;).  &lt;br /&gt;-- Lastly, add another datafile to the tablespace if needed.&lt;br /&gt;--&lt;br /&gt;-- 11/30/98&lt;br /&gt;&lt;br /&gt;SELECT a.table_name, a.next_extent, a.tablespace_name&lt;br /&gt;FROM all_tables a,&lt;br /&gt;    ( SELECT tablespace_name, max(bytes) as big_chunk&lt;br /&gt;      FROM dba_free_space&lt;br /&gt;      GROUP BY tablespace_name ) f&lt;br /&gt;WHERE f.tablespace_name = a.tablespace_name&lt;br /&gt;                AND a.next_extent &gt; f.big_chunk&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;B. Nightly Procedures&lt;br /&gt;&lt;br /&gt;1. mk_volfact.sql&lt;br /&gt;-- &lt;br /&gt;-- mk_volfact.sql (only run this once to set it up; do not run it nightly!)&lt;br /&gt;-- &lt;br /&gt;-- -- Table UTL_VOL_FACTS&lt;br /&gt;&lt;br /&gt;CREATE TABLE utl_vol_facts&lt;br /&gt; (&lt;br /&gt;  table_name                 VARCHAR2(30),&lt;br /&gt;  num_rows                   NUMBER,&lt;br /&gt;  meas_dt                    DATE&lt;br /&gt; )&lt;br /&gt;TABLESPACE platab&lt;br /&gt; STORAGE   (&lt;br /&gt;      INITIAL     128k&lt;br /&gt;      NEXT        128k&lt;br /&gt;      PCTINCREASE 0&lt;br /&gt;      MINEXTENTS  1&lt;br /&gt;      MAXEXTENTS  unlimited&lt;br /&gt;   )&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;-- Public Synonym&lt;br /&gt;&lt;br /&gt;CREATE PUBLIC SYNONYM utl_vol_facts FOR &amp;OWNER..utl_vol_facts&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;-- Grants for UTL_VOL_FACTS&lt;br /&gt;&lt;br /&gt;GRANT SELECT ON utl_vol_facts TO public&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;2. analyze_comp.sql&lt;br /&gt;-- &lt;br /&gt;-- analyze_comp.sql&lt;br /&gt;-- &lt;br /&gt;BEGIN&lt;br /&gt;   sys.dbms_utility.analyze_schema ( '&amp;OWNER','COMPUTE');&lt;br /&gt;END ;&lt;br /&gt;/&lt;br /&gt;3. pop_vol.sql&lt;br /&gt;-- &lt;br /&gt;-- pop_vol.sql&lt;br /&gt;-- &lt;br /&gt;insert into utl_vol_facts&lt;br /&gt;select table_name&lt;br /&gt;     , NVL ( num_rows, 0) as num_rows&lt;br /&gt;     , trunc ( last_analyzed ) as meas_dt&lt;br /&gt;from all_tables           -- or just user_tables&lt;br /&gt;where owner in ('&amp;OWNER') -- or a comma-separated list of owners&lt;br /&gt;/&lt;br /&gt;commit&lt;br /&gt;/ &lt;br /&gt;&lt;br /&gt;C. Weekly Procedures&lt;br /&gt;&lt;br /&gt;1. nextext.sql&lt;br /&gt;--&lt;br /&gt;-- nextext.sql&lt;br /&gt;--&lt;br /&gt;-- To find tables that don't match the tablespace default for NEXT extent.&lt;br /&gt;-- The implicit rule here is that every table in a given tablespace should &lt;br /&gt;-- use the exact same value for NEXT, which should also be the tablespace's &lt;br /&gt;-- default value for NEXT.&lt;br /&gt;-- &lt;br /&gt;-- This tells us what the setting for NEXT is for these objects today.&lt;br /&gt;--&lt;br /&gt;-- 11/30/98&lt;br /&gt;&lt;br /&gt;SELECT segment_name, segment_type, ds.next_extent as Actual_Next&lt;br /&gt;, dt.tablespace_name,  dt.next_extent as Default_Next&lt;br /&gt;FROM dba_tablespaces dt, dba_segments ds&lt;br /&gt;WHERE dt.tablespace_name = ds.tablespace_name&lt;br /&gt;  AND dt.next_extent !=ds.next_extent&lt;br /&gt;AND ds.owner = UPPER ( '&amp;OWNER' )&lt;br /&gt;ORDER BY tablespace_name, segment_type, segment_name&lt;br /&gt;&lt;br /&gt;2. existext.sql&lt;br /&gt;--&lt;br /&gt;-- existext.sql&lt;br /&gt;--&lt;br /&gt;-- To check existing extents&lt;br /&gt;-- &lt;br /&gt;-- This tells us how many of each object's extents differ in size from&lt;br /&gt;-- the tablespace's default size. If this report shows a lot of different&lt;br /&gt;-- sized extents, your free space is likely to become fragmented.  If so,&lt;br /&gt;-- this tablespace is a candidate for reorganizing.&lt;br /&gt;--&lt;br /&gt;-- 12/15/98&lt;br /&gt;&lt;br /&gt;SELECT segment_name, segment_type&lt;br /&gt;, count(*) as nr_exts&lt;br /&gt;, sum ( DECODE ( dx.bytes,dt.next_extent,0,1) ) as nr_illsized_exts&lt;br /&gt;, dt.tablespace_name, dt.next_extent as dflt_ext_size&lt;br /&gt;FROM dba_tablespaces dt, dba_extents dx&lt;br /&gt;WHERE dt.tablespace_name = dx.tablespace_name&lt;br /&gt;  AND dx.owner = '&amp;OWNER'&lt;br /&gt;GROUP BY segment_name, segment_type, dt.tablespace_name, dt.next_extent&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. No_pk.sql&lt;br /&gt;--&lt;br /&gt;-- no_pk.sql&lt;br /&gt;-- &lt;br /&gt;-- To find tables without PK constraint&lt;br /&gt;--&lt;br /&gt;-- 11/2/98&lt;br /&gt;&lt;br /&gt;SELECT table_name&lt;br /&gt;FROM all_tables&lt;br /&gt;WHERE owner = '&amp;OWNER'&lt;br /&gt;MINUS&lt;br /&gt;SELECT table_name&lt;br /&gt;FROM all_constraints&lt;br /&gt;WHERE owner = '&amp;&amp;OWNER'&lt;br /&gt;AND constraint_type = 'P'&lt;br /&gt;&lt;br /&gt;4. disPK.sql&lt;br /&gt;--&lt;br /&gt;-- disPK.sql&lt;br /&gt;--&lt;br /&gt;-- To find out which primary keys are disabled&lt;br /&gt;--&lt;br /&gt;-- 11/30/98&lt;br /&gt;&lt;br /&gt;SELECT owner, constraint_name, table_name, status&lt;br /&gt;FROM all_constraints&lt;br /&gt;WHERE owner = '&amp;OWNER' AND status = 'DISABLED’ AND constraint_type = 'P'&lt;br /&gt;&lt;br /&gt;5. nonuPK.sql&lt;br /&gt;--&lt;br /&gt;--  nonuPK.sql&lt;br /&gt;-- &lt;br /&gt;-- To find tables with nonunique PK indexes.  Requires that PK names&lt;br /&gt;-- follow a naming convention.  An alternative query follows that &lt;br /&gt;-- does not have this requirement, but runs more slowly.&lt;br /&gt;--&lt;br /&gt;-- 11/2/98&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT index_name, table_name, uniqueness&lt;br /&gt;FROM all_indexes&lt;br /&gt;WHERE index_name like '&amp;PKNAME%'&lt;br /&gt;  AND owner = '&amp;OWNER' AND uniqueness = 'NONUNIQUE'&lt;br /&gt;&lt;br /&gt;SELECT c.constraint_name, i.tablespace_name, i.uniqueness&lt;br /&gt;FROM all_constraints c , all_indexes i&lt;br /&gt;WHERE c.owner = UPPER ( '&amp;OWNER' ) AND i.uniqueness = 'NONUNIQUE'&lt;br /&gt;AND c.constraint_type = 'P' AND i.index_name = c.constraint_name&lt;br /&gt;&lt;br /&gt;6. mkrebuild_idx.sql&lt;br /&gt;--&lt;br /&gt;--  mkrebuild_idx.sql&lt;br /&gt;-- &lt;br /&gt;-- Rebuild indexes to have correct storage parameters&lt;br /&gt;--&lt;br /&gt;-- 11/2/98&lt;br /&gt;&lt;br /&gt;SELECT 'alter index ' || index_name || ' rebuild '&lt;br /&gt;     , 'tablespace INDEXES storage '&lt;br /&gt;     || ' ( initial 256 K next 256 K pctincrease 0 ) ; '&lt;br /&gt;FROM all_indexes&lt;br /&gt;WHERE ( tablespace_name != 'INDEXES'&lt;br /&gt;        OR next_extent != ( 256 * 1024 ) &lt;br /&gt;      )&lt;br /&gt;  AND owner = '&amp;OWNER' &lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;7. datatype.sql&lt;br /&gt;--&lt;br /&gt;-- datatype.sql&lt;br /&gt;--&lt;br /&gt;-- To check datatype consistency between two environments&lt;br /&gt;--&lt;br /&gt;-- 11/30/98&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;   table_name,&lt;br /&gt;   column_name,&lt;br /&gt;   data_type,&lt;br /&gt;   data_length,&lt;br /&gt;   data_precision,&lt;br /&gt;   data_scale,&lt;br /&gt;   nullable&lt;br /&gt;FROM all_tab_columns -- first environment&lt;br /&gt;WHERE owner = '&amp;OWNER' &lt;br /&gt;MINUS&lt;br /&gt;SELECT&lt;br /&gt;   table_name,&lt;br /&gt;   column_name,&lt;br /&gt;   data_type,&lt;br /&gt;   data_length,&lt;br /&gt;   data_precision,&lt;br /&gt;   data_scale,&lt;br /&gt;   nullable&lt;br /&gt;FROM all_tab_columns@&amp;my_db_link  -- second environment&lt;br /&gt;WHERE owner = '&amp;OWNER2' &lt;br /&gt;order by table_name, column_name&lt;br /&gt;&lt;br /&gt;8. obj_coord.sql&lt;br /&gt;--&lt;br /&gt;-- obj_coord.sql&lt;br /&gt;--&lt;br /&gt;-- To find out any difference in objects between two instances&lt;br /&gt;--&lt;br /&gt;-- 12/08/98&lt;br /&gt;&lt;br /&gt;SELECT object_name, object_type&lt;br /&gt;FROM user_objects&lt;br /&gt;MINUS&lt;br /&gt;SELECT object_name, object_type&lt;br /&gt;FROM user_objects@&amp;my_db_link&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6337489724553131222?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6337489724553131222/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6337489724553131222' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6337489724553131222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6337489724553131222'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/oracle-dba-checklist.html' title='Oracle DBA Checklist'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-7224769438907185463</id><published>2008-06-04T07:13:00.000-07:00</published><updated>2008-06-04T07:14:40.704-07:00</updated><title type='text'>RDBMS</title><content type='html'>Databases and Database Management Systems&lt;br /&gt;Let's start from basics. What is a database? In very general terms, a database is a collection of related data. Notice the word related, this implies that the collection of letters on this page do not by themselves constitute a database. But if we think of them as a collection of letters arranged to form words, then they can be conceptualised as data in a database. Using similar reasoning, we can also say that a tome such as a telephone directory is also a database. It is a database first, because it is a collection of letters that form words and second, because it is an alphabetical listing of people's names, their addresses and their telephone numbers. How we think of a database depends on what use we want to make of the information that it contains. &lt;br /&gt;&lt;br /&gt;So far, we have talked about a database in its broadest sense. This very general definition is not what most people mean when they talk about a database. In this electronic age, the word database has become synonymous with the term "computerised database". Collins English Dictionary describes a database as "A store of a large amount of information, esp. in a form that can be handled by a computer." In this book, we will be dealing only with computerised databases. In keeping with popular trend though, we will be using the word database to refer to a computerised database. &lt;br /&gt;&lt;br /&gt;[Edit section] Storage Requirements&lt;br /&gt;A database (computerised) by itself, is not much use. The data is stored electronically on the computer's disk in a format which we humans cannot read or understand directly. What we need is some way of accessing this data and converting it into a form which we do understand. This is the job of the database management system or DBMS for short. &lt;br /&gt;&lt;br /&gt;[Edit section] Management Systems&lt;br /&gt;A DBMS is essentially a suite of programs that act as the interface between the human operator and the data held in the database. Using the DBMS, it is possible to retrieve useful information, update or delete obsolete information and add new information to the database. As well as data entry and retrieval, the DBMS plays an important role in maintaining the overall integrity of the data in the database. The simplest example of is ensuring that the values entered into the database conform to the data types that are specified. For example, in the telephone book database, the DBMS might have to ensure that each phone number entered conforms to a set format of XXX-XXXXXXX where X represents an integer. &lt;br /&gt;&lt;br /&gt;[Edit section] 2. The Database as a Collection of Tables&lt;br /&gt;[Edit section] Relational Databases and SQL&lt;br /&gt;In the early days of computerised databases, all large database systems conformed to either the network data model or the hierarchical data model. We will not be discussing the technical details of these models except to say that they are quite complex and not very flexible. One of the main drawbacks of these databases was that in order to retrieve information, the user had to have an idea of where in the database the data was stored. This meant that data processing and information retrieval was a technical job which was beyond the ability of the average office manager. In those days life was simple. data processing staff were expected to prepared the annual or monthly or weekly reports and managers were expected to formulate and implement day to day business strategy according to the information contained in the reports. Computer literate executives were rare and DP staff with business sense were even more rare. This was the state of affairs before the advent of relational databases. &lt;br /&gt;&lt;br /&gt;[Edit section] History&lt;br /&gt;The relational data model was introduced in 1970, E. F. Codd, a research fellow working for IBM, in his article `A Relational Model of Data for Large Shared Databanks'. The relational database model represented the database as a collection of tables which related to one another. &lt;br /&gt;&lt;br /&gt;Unlike network and hierarchical databases, the relational database is quite intuitive to use, with data organised into tables, columns and rows. The table is a list of rows e.g. names and telephone numbers. It is similar to how we might go about the task of jotting down the phone numbers of some of our friends, in the back of our diary for example. &lt;br /&gt;&lt;br /&gt;The relational data model consists of a number of intuitive concepts for storing any type of data in a database, along with a number of functions to manipulate the information. &lt;br /&gt;&lt;br /&gt;[Edit section] Relational Data Modeling&lt;br /&gt;The relational data model as proposed by Codd provided the basic concepts for a new database management system, the relational database management system (RDBMS). Soon after the relational model was defined, a number of relational database languages were developed and used for instructing the RDBMS. Structured Query Language being one of them. &lt;br /&gt;&lt;br /&gt;[Edit section] SQL Language&lt;br /&gt;The SQL language is so inextricably tied to relational database theory that it is impossible to discuss it without also discussing the relational data model. The next two sections briefly describe some of the concepts of this model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-7224769438907185463?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/7224769438907185463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=7224769438907185463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/7224769438907185463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/7224769438907185463'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/rdbms.html' title='RDBMS'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-2174385804636208874</id><published>2008-06-04T07:00:00.000-07:00</published><updated>2008-06-04T07:01:40.186-07:00</updated><title type='text'>Script to Generate Statspack report for a day</title><content type='html'>– generateReportScript.sql&lt;br /&gt;&lt;br /&gt;spool DayReports.sql&lt;br /&gt;&lt;br /&gt;set heading off pages 9999&lt;br /&gt;&lt;br /&gt;select ‘define begin_snap=’||snap_id||’;'||chr(10)||&lt;br /&gt;‘define end_snap=’||to_number(snap_id + 1)||’;'||chr(10)||&lt;br /&gt;‘define report_name=sp_’||to_char(snap_time,’ddmmhh24mi’)||’.txt’||chr(10)||&lt;br /&gt;‘@?/rdbms/admin/spreport;’||chr(10)&lt;br /&gt;from stats$snapshot&lt;br /&gt;where trunc(snap_time) = trunc(sysdate -1)&lt;br /&gt;order by snap_time asc;&lt;br /&gt;&lt;br /&gt;spool off&lt;br /&gt;&lt;br /&gt;I don’t have an understanding of analytic functions yet so the above script crudely just adds on 1 to the snap_id to get the end_snap for a report but if you’ve set up your site to take snapshots every 15mins then the script works fine producing the following script:&lt;br /&gt;&lt;br /&gt;– DayReports.sql&lt;br /&gt;&lt;br /&gt;define begin_snap=1621;&lt;br /&gt;define end_snap=1622;&lt;br /&gt;define report_name=sp_03060600.txt&lt;br /&gt;@?/rdbms/admin/spreport;&lt;br /&gt;&lt;br /&gt;etc…&lt;br /&gt;&lt;br /&gt;which when run as the PERFSTAT user produces the required files&lt;br /&gt;&lt;br /&gt;sp_03060600.txt&lt;br /&gt;sp_03060615.txt&lt;br /&gt;sp_03060630.txt&lt;br /&gt;sp_03060645.txt&lt;br /&gt;sp_03060700.txt&lt;br /&gt;sp_03060715.txt&lt;br /&gt;sp_03060730.txt&lt;br /&gt;sp_03060745.txt&lt;br /&gt;etc…&lt;br /&gt;&lt;br /&gt;which can then be grepped as required!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-2174385804636208874?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/2174385804636208874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=2174385804636208874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2174385804636208874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2174385804636208874'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/script-to-generate-statspack-report-for.html' title='Script to Generate Statspack report for a day'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8820434496249667491</id><published>2008-06-04T06:57:00.000-07:00</published><updated>2008-06-04T06:58:17.495-07:00</updated><title type='text'>dbms_xplan in 10g</title><content type='html'>If you’re using 9i and haven’t learned about the dbms_xplan package, then you should take a good look at it right away. It’s (usually) a much better way of getting execution plans from your system than writing your own queries against the plan_table.&lt;br /&gt;&lt;br /&gt;If you’ve been using dbms_xplan, and upgraded from 9i to 10g, make sure that you look at the new features - there are some things which are really useful, and this note is about just one of them.&lt;br /&gt;&lt;br /&gt;dbms_xplan.display_cursor()&lt;br /&gt;&lt;br /&gt;In 10g, Oracle instroduced a new function in dbms_xplan that can read the in-memory execution plan (v$sql_plan and associated structures).  The call is the display_cursor call, and takes three optional parameters, the sql_id and child_number of the sql statement you want to see the plan for, and a formatting string.&lt;br /&gt;&lt;br /&gt;The best bit of this function shows up when you look at the script that generates it($ORACLE_HOME/rdbms/admin/dbmsxpln.sql) when you decide to find out how to use the format parameter.  Here’s a “live” demo:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;set serveroutput off        &lt;br /&gt;&lt;br /&gt;select&lt;br /&gt; /*+&lt;br /&gt;  gather_plan_statistics&lt;br /&gt;  ordered use_nl(t1) index(t1)&lt;br /&gt; */&lt;br /&gt; count(t1.n2), count(t2.n2)&lt;br /&gt;from&lt;br /&gt; t2, t1&lt;br /&gt;where&lt;br /&gt; t2.n2 = 45&lt;br /&gt;and t1.n1 = t2.n1&lt;br /&gt;;        &lt;br /&gt;&lt;br /&gt;COUNT(T1.N2) COUNT(T2.N2)&lt;br /&gt;------------ ------------&lt;br /&gt;         225          225        &lt;br /&gt;&lt;br /&gt;select * from table(dbms_xplan.display_cursor(null,null,'ALLSTATS LAST'));        &lt;br /&gt;&lt;br /&gt;PLAN_TABLE_OUTPUT&lt;br /&gt;-------------------------------------&lt;br /&gt;SQL_ID  98cw5a9c0pw33, child number 0&lt;br /&gt;-------------------------------------&lt;br /&gt;select  /*+   gather_plan_statistics   ordered use_nl(t1) index(t1)  */  count(t1.n2),&lt;br /&gt;count(t2.n2) from  t2, t1 where  t2.n2 = 45 and t1.n1 = t2.n1        &lt;br /&gt;&lt;br /&gt;Plan hash value: 3795562434        &lt;br /&gt;&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;| Id  | Operation                    | Name | Starts | E-Rows | A-Rows |   A-Time   | Buffers |&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;|   1 |  SORT AGGREGATE              |      |      1 |      1 |      1 |00:00:00.01 |     146 |&lt;br /&gt;|   2 |   TABLE ACCESS BY INDEX ROWID| T1   |      1 |     15 |    225 |00:00:00.01 |     146 |&lt;br /&gt;|   3 |    NESTED LOOPS              |      |      1 |    225 |    241 |00:00:00.02 |     116 |&lt;br /&gt;|*  4 |     TABLE ACCESS FULL        | T2   |      1 |     15 |     15 |00:00:00.01 |      99 |&lt;br /&gt;|*  5 |     INDEX RANGE SCAN         | T_I1 |     15 |     15 |    225 |00:00:00.01 |      17 |&lt;br /&gt;-----------------------------------------------------------------------------------------------        &lt;br /&gt;&lt;br /&gt;Predicate Information (identified by operation id):&lt;br /&gt;---------------------------------------------------&lt;br /&gt;   4 - filter("T2"."N2"=45)&lt;br /&gt;   5 - access("T1"."N1"="T2"."N1")        &lt;br /&gt;&lt;br /&gt;If you want to call this function, you need access to several of the dynamic performance views -v$session, v$sql, v$sql_plan and v$sql_plan_statistics_all seem to cover all the options between them; and v$sql_plan_statistics_all is the most useful one.&lt;br /&gt;As you can see in the query above, I’ve not supplied an sql_id or child_number, and I’ve used the format ‘ALLSTATS LAST’. By default display_cursor reports the last statement I executed, and the effect of ‘ALLSTATS LAST’ is to report the actual execution stats alongside the predicted row counts.&lt;br /&gt;&lt;br /&gt;If you’ve ever got into Wolfgang Breitling’s ”Tuning by Cardinality Feedback” - you’ve now got a tool that can make it a lot easier.&lt;br /&gt;&lt;br /&gt;A couple of odd notes - you’ll see that I set serveroutput off. If serveroutput is on when you call this function, the last statement you will have run  will be the (hidden) call to dbms_output that follows your execution of any other statement - so you won’t get the plan and statistics.&lt;br /&gt;&lt;br /&gt;The hint /*+ gather_plan_statistics */ enables collection of rowsource execution statistics for the statement. It’s a “nearly undocumented” hint, in that the documentation seems only to exist in odd places like the script that generates the package, and as part of the output of the function call if the statistics weren’t enabled when you try to report statistics.&lt;br /&gt;&lt;br /&gt;You have to be a little careful comparing the actual and estimated row counts. They are not supposed to be the same in all cases. The estimated values are estimates for each execution of a rowsource, the actual values are the cumulative counts. So, for example, it is perfectly reasonable in line 5 to see E-rows = 15 and A-rows = 225, because line 5 starts 15 times: so 225 Actual rows = 15 starts * 15 estimated rows per start.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8820434496249667491?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8820434496249667491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8820434496249667491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8820434496249667491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8820434496249667491'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/dbmsxplan-in-10g.html' title='dbms_xplan in 10g'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-2688258506925873168</id><published>2008-06-04T03:37:00.000-07:00</published><updated>2008-06-04T03:38:59.531-07:00</updated><title type='text'>Oracle Capacity Planner</title><content type='html'>Oracle Capacity Planner is an Oracle Enterprise Manager application that allows you to collect different types of performance statistics and record that data in an historical database. You can then use Oracle Capacity Planner to analyze the historical data to plan future capacity. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;In releases prior to 9i, the Agent data gathering service (also known as the Oracle Data Gatherer) was used to collect data for presentation in real-time performance monitoring utilities and historical data. The Intelligent Agent and the data gathering service were separate services that were started and stopped independently of each other. &lt;br /&gt;&lt;br /&gt;With 9i, the data collection capabilities are integrated into the 9i Intelligent Agent. Therefore, there is no separate service that needs to be started. Furthermore, when you stop the 9i Intelligent Agent, the data gathering capabilities are disabled and not available.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Capacity Planner uses the Intelligent Agent (Agent) to collect its historical data. To collect most types of data, you must install the Agent on the system (or systems) where you want to collect data. See the Oracle Intelligent Agent User's Guide for information on managing the Agent. &lt;br /&gt;&lt;br /&gt;If you are using Oracle Capacity Planner to collect concurrent manager data, the Agent can be installed on another system. &lt;br /&gt;&lt;br /&gt;The types of performance data that Oracle Capacity Planner can collect on a system depend on the products that are installed. Table 4-1 shows the types of data that Oracle Capacity Planner can collect when various Oracle products are installed. The number of targets that appear in the Capacity Planner navigator tree will also vary, depending on the number of applications you have installed. &lt;br /&gt;&lt;br /&gt;Table 4-1 Data That Capacity Planner Can Collect When Various Oracle Products are Installed   &lt;br /&gt;Oracle Product  Oracle Concurrent Manager Data  Oracle Database Data  Node (Operating System) Data  SAP R/3 System Data  Microsoft SQL Server Data  &lt;br /&gt;Diagnostics Pack &lt;br /&gt; No &lt;br /&gt; Yes &lt;br /&gt; Yes &lt;br /&gt; No &lt;br /&gt; Yes &lt;br /&gt; &lt;br /&gt;Management Pack for Oracle Applications &lt;br /&gt; Yes &lt;br /&gt; No &lt;br /&gt; Yes &lt;br /&gt; No &lt;br /&gt; No &lt;br /&gt; &lt;br /&gt;Management Pack for SAP R/3 &lt;br /&gt; No &lt;br /&gt; No &lt;br /&gt; Yes &lt;br /&gt; Yes &lt;br /&gt; No &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;If additional products from Oracle are installed, Oracle Capacity Planner may be able to collect additional types of data not shown in Table 4-1. &lt;br /&gt;&lt;br /&gt;How Capacity Planner Collects and Stores Performance Data&lt;br /&gt;The following list identifies how Capacity Planner uses the Agent to collect performance data: &lt;br /&gt;&lt;br /&gt;The Agent collects the data at an interval you specify from within Capacity Planner. &lt;br /&gt;&lt;br /&gt;The Agent stores the data in an efficient binary form. &lt;br /&gt;&lt;br /&gt;At a specified loader interval, the data is read from this binary file and stored in a readable form in the Oracle Capacity Planner historical database. &lt;br /&gt;&lt;br /&gt;The Agent also aggregates the data by time, creating summary statistics for the data that is collected at different time intervals (hour, day, week, and so on). &lt;br /&gt;&lt;br /&gt;Over time, the Agent purges the data in the historical database, keeping only as much data as you specify. &lt;br /&gt;&lt;br /&gt;Purging the historical data allows you to have access to a current view of recent performance data for your environment and to manage the amount of stored data to avoid wasting disk space. &lt;br /&gt;&lt;br /&gt;Accessing Historical Data Through an Intermediate Host&lt;br /&gt;Oracle Performance Manager relies on the Agent to monitor a target (such as a node, a database, or a concurrent manager). Usually, the collection of the data is done on the system where the target is located. However, for some types of targets Oracle Performance Manager can also monitor data on a system by using the Agent on another system (an intermediate host). &lt;br /&gt;&lt;br /&gt;This intermediate host could be the client system where the Oracle Performance Manager is running, or any other system on the network on which the Agent is available. &lt;br /&gt;&lt;br /&gt;There are three ways to set the location of the Agent. The method you use depends on how you connect to the target. Consider the following scenarios: &lt;br /&gt;&lt;br /&gt;You connect to a database that has been discovered using the Enterprise Manager console and you are running Oracle Capacity Planner while connected to the Oracle Management Server. &lt;br /&gt;&lt;br /&gt;Capacity Planner attempts to connect to the Agent on the host where the target is located. If this connection fails or cannot be attempted because no preferred credentials have been set for the database, you will be prompted with a dialog box containing logon credentials for the database. You can use the Connection Details dialog box to specify the location of the Agent that will be used to collect performance data. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You click the Add Service button in the toolbar panel and manually add the target to the navigator. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays a Logon dialog box. This dialog box also contains a field to specify the location of the Agent that will be used to collect performance data. &lt;br /&gt;&lt;br /&gt;You select a target in the Capacity Planner navigator tree and choose Set Connection Details from the File menu. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays the Database Logon dialog box for the selected target. This dialog box also contains a field to specify the location of the Agent that will be used to collect performance data. &lt;br /&gt;&lt;br /&gt;Usage Scenarios for Oracle Capacity Planner&lt;br /&gt;Oracle Capacity Planner can perform tasks such as the following: &lt;br /&gt;&lt;br /&gt;Track the increase in the amount of used space on a disk over time and estimate when 95 percent of the space on the disk will be consumed &lt;br /&gt;&lt;br /&gt;Track the increase in the total I/O rate for a host over time, then estimate what the total I/O rate for the host will be at some future point in time &lt;br /&gt;&lt;br /&gt;Determine thresholds to set in Performance Manager by evaluating historical data gathered in Capacity Planner &lt;br /&gt;&lt;br /&gt;Provide a predefined set of data that measures performance (Oracle Recommended Collection) &lt;br /&gt;&lt;br /&gt;Publish historical data to a website where administrators and system administrators can view data that is periodically updated &lt;br /&gt;&lt;br /&gt;Display a chart that shows the number of forms sessions per user and per application; estimate how the numbers will change over a designated period of time. &lt;br /&gt;&lt;br /&gt;Starting Oracle Capacity Planner&lt;br /&gt;You can start Oracle Capacity Planner in any of the following ways: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On the Oracle Enterprise Manager console, click the Application Management drawer, then click the Capacity Planner icon. &lt;br /&gt;&lt;br /&gt;On the Oracle Enterprise Manager console, select a Concurrent Manager target, click the right mouse button, point at Related Tools in the context menu, then click Capacity Planner. &lt;br /&gt;&lt;br /&gt;On the Tools menu of the Oracle Enterprise Manager console, point to Application Management, then click Oracle Capacity Planner. &lt;br /&gt;&lt;br /&gt;From the UNIX command line, change directory to the ORACLE_HOME/bin directory (where ORACLE_HOME represents the home directory in which the Management Pack for Oracle Applications is installed), then type the following command: &lt;br /&gt;&lt;br /&gt;./oemapp cp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;From the Start menu, point to Programs, then to the Oracle Home where Oracle Enterprise Manager is installed, then to Oracle Applications, then click Capacity Planner, which displays the Capacity Planner Login dialog box. &lt;br /&gt;&lt;br /&gt;Enter the appropriate connect information for your Oracle Enterprise Manager repository, then click OK. &lt;br /&gt;&lt;br /&gt;Using Help&lt;br /&gt;When you are using Oracle Capacity Planner, you can display context-sensitive help topics. You can also display conceptual topics and task topics. &lt;br /&gt;&lt;br /&gt;To obtain context-sensitive help for an Oracle Capacity Planner panel, window, dialog box, or property page, select an item in the panel, window, dialog box, or property page, then on the Help menu, choose Window. &lt;br /&gt;&lt;br /&gt;To obtain context-sensitive help for a class, chart, or data item on a property page, select the class, chart, or data item on the property page, then take one of the following actions: &lt;br /&gt;&lt;br /&gt;Press F1. &lt;br /&gt;&lt;br /&gt;Click the Help icon on the toolbar. &lt;br /&gt;&lt;br /&gt;On the Help menu, choose Selected Item. &lt;br /&gt;&lt;br /&gt;If a help topic is not available for a class, chart, or data item, a No Help Available message is displayed when you request help. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;Not all the charts described in the appendix are available from within Oracle Capacity Planner.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To view the Contents page for the Oracle Capacity Planner help, on the Help menu, choose Contents. On the Contents page, you can: &lt;br /&gt;&lt;br /&gt;View a list of the conceptual help topics by double-clicking the Conceptual Topics book on the help system's Contents page. &lt;br /&gt;&lt;br /&gt;Conceptual topics provide conceptual or overview information of which you should be aware before performing a particular Oracle Capacity Planner task. Conceptual topics do not contain step-by-step information for performing a task. &lt;br /&gt;&lt;br /&gt;View a list of the task help topics by double-clicking the Task Topics book on the help system's Contents page. &lt;br /&gt;&lt;br /&gt;Task topics provide step-by-step instructions for accomplishing an Oracle Capacity Planner task. They do not provide conceptual information that you should be aware of before performing the task. &lt;br /&gt;&lt;br /&gt;You can access a glossary of Oracle Capacity Planner terms by double-clicking the Oracle Capacity Planner Glossary book on the Contents page. &lt;br /&gt;&lt;br /&gt;Using Oracle Capacity Planner&lt;br /&gt;You may find it helpful to think of using Oracle Capacity Planner as a two-step process: &lt;br /&gt;&lt;br /&gt;Setting up the collection of historical data &lt;br /&gt;&lt;br /&gt;See "Setting Up a Collection" for a detailed description of how to collect historical data. &lt;br /&gt;&lt;br /&gt;Analyzing the collected data &lt;br /&gt;&lt;br /&gt;See "Analyzing Collected Data" for a detailed description of how to analyze collected data. &lt;br /&gt;&lt;br /&gt;Setting Up a Collection&lt;br /&gt;To set up a historical data collection with Oracle Capacity Planner, you: &lt;br /&gt;&lt;br /&gt;Select (and connect to) the targets for which you want to collect historical data. &lt;br /&gt;&lt;br /&gt;Define the frequency of collection samples. &lt;br /&gt;&lt;br /&gt;Define the location of the historical database and the frequency at which collected data should be loaded in the historical database. &lt;br /&gt;&lt;br /&gt;Define the amount of data to be kept in the Oracle Capacity Planner database at each time interval. &lt;br /&gt;&lt;br /&gt;Select the classes of data to collect, based on what is available in the Oracle Capacity Planner navigator. &lt;br /&gt;&lt;br /&gt;Figure 4-1 shows the steps to follow when setting up a collection. For more information on each step, see the following sections. &lt;br /&gt;&lt;br /&gt;Figure 4-1 Steps for Setting Up a Collection&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration nu-3695a.gif &lt;br /&gt;Selecting Targets&lt;br /&gt;You can select one or more targets from which you want to collect historical performance statistics. For example, when you have the Management Pack for Oracle Applications installed, the target types are typically Nodes and Concurrent Managers. &lt;br /&gt;&lt;br /&gt;The procedure for selecting a target depends upon whether or not the server resides on a node that is known to the Enterprise Manager main console. A node is known to the console when it has been discovered with the Enterprise Manager console Discover Nodes command. &lt;br /&gt;&lt;br /&gt;Selecting Targets on Discovered Nodes&lt;br /&gt;To select a target on a node that has been discovered by the Enterprise Manager console: &lt;br /&gt;&lt;br /&gt;Click the Collection tab of the Oracle Capacity Planner navigator panel, which displays the Oracle Capacity Planner collection view. &lt;br /&gt;&lt;br /&gt;Double-click one of the target type folders. &lt;br /&gt;&lt;br /&gt;The Oracle Capacity Planner navigator tree displays the targets of the selected type that are known to the Oracle Enterprise Manager main console. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select the target from which you want to collect performance data and click the Connect button in the Capacity Planner toolbar, or click the plus sign (+) next to the target in the navigator. &lt;br /&gt;&lt;br /&gt;When you connect to a target in the Oracle Capacity Planner navigator panel, you may be prompted for credentials if they are required to connect to that target. If a logon dialog box appears, click Help for information on the individual fields on the dialog box. &lt;br /&gt;&lt;br /&gt;After you connect to a target, the available collection classes for that target appear in the navigator and Oracle Capacity Planner displays the Target property sheet for the selected target. For example, Figure 4-2 shows the classes that appear when you connect to a Windows NT node target. &lt;br /&gt;&lt;br /&gt;Figure 4-2 Selecting a Target in the Oracle Capacity Planner Window&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_win_serv_selected.gif &lt;br /&gt;Selecting Targets on Undiscovered Nodes &lt;br /&gt;If you double-click a target type and the target you are looking for does not appear in the target type folder, you can do one of the following: &lt;br /&gt;&lt;br /&gt;Use the Enterprise Manager console to discover the node where the target resides. &lt;br /&gt;&lt;br /&gt;This is the preferred method for adding a target to the Capacity Planner navigator panel. When you discover a node with the Enterprise Manager console, Capacity Planner saves key information about the target, such as the preferred credentials, location of the Agent, and historical database information. &lt;br /&gt;&lt;br /&gt;Add the target manually to the Capacity Planner navigator panel. &lt;br /&gt;&lt;br /&gt;When you add a target manually, the target is added for the current session of Capacity Planner only. You can start gathering data for the target, but the next time you start Capacity Planner, the target will not appear in the navigator panel. To modify collection settings or analyze data collected for the target, you will have to add the target again the next time you start Capacity Planner. &lt;br /&gt;&lt;br /&gt;To add a target manually: &lt;br /&gt;&lt;br /&gt;Select the target type for the target you want to add. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click the Add Service button in the Capacity Planner toolbar. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays a message to remind you that targets you add manually will be available for the current session of Capacity Planner only. &lt;br /&gt;&lt;br /&gt;Click Yes. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays a logon dialog box for the target. Click Help if you need information about any of the specific fields on the dialog box. &lt;br /&gt;&lt;br /&gt;After you fill in the logon credentials, click OK to connect to the target. &lt;br /&gt;&lt;br /&gt;After you connect to a target, the available collection classes for that target appear in the navigator and Oracle Capacity Planner displays the Target property sheet for the selected target (Figure 4-2). &lt;br /&gt;&lt;br /&gt;About the Target Property Sheet&lt;br /&gt;When you connect to a target, Oracle Capacity Planner displays the Target property sheet, which contains the following property pages: &lt;br /&gt;&lt;br /&gt;Collection Options page &lt;br /&gt;&lt;br /&gt;Storage Options page &lt;br /&gt;&lt;br /&gt;Purge Options page &lt;br /&gt;&lt;br /&gt;The collection, load, and purge settings you select on these pages apply to all the classes in the selected target. You cannot change these settings for a selected class; you can change them only for a selected target. &lt;br /&gt;&lt;br /&gt;Defining the Frequency of Collection Samples&lt;br /&gt;When you first connect to a target, Capacity Planner displays the Collection Options property page. The values you select on this page determine how often the Agent will collect information about the selected target and save it to disk. On the Collection Options property page, you can set the frequency of collection samples using either of these two methods: &lt;br /&gt;&lt;br /&gt;By selecting the number of data samples to collect for a specified time interval &lt;br /&gt;&lt;br /&gt;For example, to collect information 3 times every hour, select Samples per Time Interval, enter 3 in the text field, and choose Hours from the drop-down list. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_smpl_interval.gif &lt;br /&gt;By specifying the length of time between collection samples &lt;br /&gt;&lt;br /&gt;For example, to collect information every 20 minutes, select Time Between Samples, enter 20 in the text field, and choose Minutes from the drop-down list. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_time_betwn.gif &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;To configure the settings for collecting data, the Agent that will collect data for a target must be running. Normally, the Agent is located on the host where the target is located.   &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Defining the Location of the Historical Database&lt;br /&gt;After you set the frequency of collection samples, use the Storage Options tab to specify the location of the Oracle Capacity Planner historical database. This setting defines where Capacity Planner will save information collected for the selected target. When data is saved in the historical database, you can later analyze the data or use it to generate trend analyses. &lt;br /&gt;&lt;br /&gt;By default, collected data is saved in your Oracle Enterprise Manager repository. However, you can specify an alternate database for the historical data if you do not want to store historical data for the selected target in the repository. &lt;br /&gt;&lt;br /&gt;To save the data collected for a target in a location other than the Oracle Enterprise Manager repository: &lt;br /&gt;&lt;br /&gt;From the Storage Options tab, select Store historical data in alternate location. &lt;br /&gt;&lt;br /&gt;Enter the credentials for the database that will store the collection data for the target. &lt;br /&gt;&lt;br /&gt;Enter the appropriate user name, password, and target for the Oracle Capacity Planner historical database. This connection information is used by the Agent when it loads the collected data at the specified loader interval. Therefore, the target specified for the Oracle Capacity Planner historical database must be known and accessible from the host where the Agent is running. &lt;br /&gt;&lt;br /&gt;For example, if you specify MY_DB.WORLD as the historical database and your Agent is running on host MYNODE, then database MY_DB.WORLD must be reachable via Net8 or SQL*Net from host MYNODE (MY_DB.WORLD must exist in the TNSNAMES.ORA file for host MYNODE, for example). &lt;br /&gt;&lt;br /&gt;Defining the Frequency of Loading Collection Data&lt;br /&gt;After you define how often data will be collected and where the data will be stored, you can define how often the data will be loaded into the historical database. &lt;br /&gt;&lt;br /&gt;You can determine how frequently the Oracle Capacity Planner loader program loads collection data for the target using either of these two methods: &lt;br /&gt;&lt;br /&gt;Using the Per Time Interval field to specify the number of loader passes for a specified time interval &lt;br /&gt;&lt;br /&gt;Using the Time Between field to specify the length of time between loader passes &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;Although data can be collected at short time intervals (such as 5, 10, or 15 minutes), collected data is not available to you for analysis until it has been loaded into the Oracle Capacity Planner historical database. Therefore, the load interval you specify controls when the most recently collected data will be visible to you.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The collection frequency you set determines the lowest time interval for which Oracle Capacity Planner can analyze data. For example, if you want to be able to analyze data from hourly intervals, you need to set a collection frequency of at least once an hour. &lt;br /&gt;&lt;br /&gt;After you define the frequency of loading collection data, you can set a time for the next loader pass by using the Next Transfer Occurs at field: &lt;br /&gt;&lt;br /&gt;Click the value that you want to change in the date and time box. &lt;br /&gt;&lt;br /&gt;Click the up or down arrow to select a higher or lower value. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_next_transfer_field.gif &lt;br /&gt;&lt;br /&gt;If the current time is later than the time displayed for the Next Transfer Occurs at setting, click Refresh View to update the display to show the actual time of the next loader pass. &lt;br /&gt;&lt;br /&gt;Note that the values that you select on the Storage Options property page apply to all classes of data collected on the selected target. &lt;br /&gt;&lt;br /&gt;Understanding When the Loader Runs&lt;br /&gt;The loader runs at the regular time interval specified on the Storage Options property page. The time specified in the Next Transfer Occurs at field controls when the loader runs. For example, if you want the loader to run once a day at 2:00 a.m., then set the transfer interval to once per day, and set the next transfer time to the next day at 2:00 a.m. The loader will run for the first time at 2:00 a.m. the next day, and then will run once a day, each day at 2:00 a.m. &lt;br /&gt;&lt;br /&gt;You can use the Next Transfer Occurs at field to force the loader to run immediately--or as soon as possible. Simply set the next transfer time to a time earlier than the current time. &lt;br /&gt;&lt;br /&gt;Understanding How Data Aggregation Works&lt;br /&gt;As it loads data into the database, Oracle Capacity Planner automatically aggregates the data. During aggregation, Oracle Capacity Planner examines the collection samples for a given time interval, calculates an average value for that interval, then uses that average value for calculations at the next larger time interval. &lt;br /&gt;&lt;br /&gt;On each loader pass, Oracle Capacity Planner examines the time stamps of all collected data to determine whether or not the threshold for a set interval (hour, day, week, month, or year) has been crossed since the previous loader pass. If so, Oracle Capacity Planner performs an aggregation of collected data from the next smaller interval to the interval threshold just passed. Table 4-2 shows the larger time interval to which data at each time interval is aggregated. &lt;br /&gt;&lt;br /&gt;Table 4-2 Aggregation of Data from Smaller to Larger Time Intervals   &lt;br /&gt;Data at This Interval  Aggregates to This Interval  &lt;br /&gt;Minutes &lt;br /&gt; Hours &lt;br /&gt; &lt;br /&gt;Hours &lt;br /&gt; Days &lt;br /&gt; &lt;br /&gt;Days &lt;br /&gt; Weeks &lt;br /&gt; &lt;br /&gt;Weeks &lt;br /&gt; Months &lt;br /&gt; &lt;br /&gt;Months &lt;br /&gt; Years &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;An example may help clarify how Oracle Capacity Planner aggregates collection data. Suppose Oracle Capacity Planner is collecting a data sample every 10 minutes to capture the percentage of used space on a particular disk, and the loader runs once an hour. When the Oracle Capacity Planner loader runs and transfers data into the Oracle Capacity Planner database every hour, it examines the values for the percentage of used disk space in the samples collected during the previous hour, then it computes an average percentage for the samples. That average percentage is then used as the average value for the hour. &lt;br /&gt;&lt;br /&gt;At the first loader pass after midnight, Oracle Capacity Planner uses the hourly averages since midnight the previous day to compute the day's percentage of used disk space. &lt;br /&gt;&lt;br /&gt;At the first loader pass after midnight on Saturday, Oracle Capacity Planner examines the daily averages of used disk space since midnight the previous Saturday and computes an average percentage for the week. &lt;br /&gt;&lt;br /&gt;At the first loader pass after midnight on the last calendar day of the month, Oracle Capacity Planner examines the weekly averages since midnight on the last calendar day of the previous month and computes an average percentage for the month. &lt;br /&gt;&lt;br /&gt;Finally, at the first loader pass after midnight on December 31, Oracle Capacity Planner examines the last 12 monthly averages to compute a yearly average. &lt;br /&gt;&lt;br /&gt;Defining the Amount of Data to Keep&lt;br /&gt;The final step in setting up a target for historical data collection is defining the amount of data to keep. &lt;br /&gt;&lt;br /&gt;When you select a target, you can click the Purge Options tab to display the Purge Options property page. On this page, you specify the amount of data you want to store in the Oracle Capacity Planner historical database for each type of data (for example, hour data, day data, and week data). You can accept the default Purge Options property page values or choose different values. &lt;br /&gt;&lt;br /&gt;The values set on the Purge Options property page apply to all classes of data collected on the selected target. &lt;br /&gt;&lt;br /&gt;The values you specify in the data retention table (the Enter the amount of data you want to keep table on the Purge Options page) determine how far back in time you can go to analyze data for the different types of data. &lt;br /&gt;&lt;br /&gt;Suppose, for example, you always want to be able to view hour data for the previous six weeks. In this case, for the Hours Data Type row in the data retention table, you would enter 6 in the Timespan column and Weeks in the To Keep column. This tells Oracle Capacity Planner that you want to keep hour data for a 6-week period. Oracle Capacity Planner calculates 6 weeks from the current time, and the Purge Data Older Than column shows the time span for which hour data is available. Table 4-3 shows the Hours row in the data retention table with this data entered. &lt;br /&gt;&lt;br /&gt;Table 4-3 Specifying How Much Data to Keep for a Data Type &lt;br /&gt;Data Type  Timespan  To Keep  Purge Data Older Than  &lt;br /&gt;Hours &lt;br /&gt; 6 &lt;br /&gt; Weeks &lt;br /&gt; (current date minus 6 weeks) &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;For each row in the data retention table, you can choose the time span to keep data samples for that type of data by entering the desired value in the Timespan to Keep column. &lt;br /&gt;&lt;br /&gt;Applying and Reverting the Collection Settings for a Target&lt;br /&gt;When you finish setting all the options on the Target property sheet, do the following to apply your collection settings: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click Apply. &lt;br /&gt;&lt;br /&gt;If you changed the location of the historical database on the Storage Options page, Capacity Planner displays a message box reminding you that any information stored in the previous location will not be available for analysis. &lt;br /&gt;&lt;br /&gt;If you don't want to be reminded about this implication the next time you change the database location, select Don't show this message again. &lt;br /&gt;&lt;br /&gt;Click OK. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays a message stating that the options were set successfully. &lt;br /&gt;&lt;br /&gt;Click Continue to close the message box and return to the Capacity Planner main window. &lt;br /&gt;&lt;br /&gt;When you apply your collection settings, Capacity Planner sends the settings to the Agent for the selected target. Note that you cannot select data to be collected until these settings have been applied. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;At any time during the process of modifying the settings on the Target property sheet, you may revert the settings to their last saved (applied) state by clicking Revert. However, after you apply the settings, they cannot be reverted to their previous settings using the Revert button; they must be modified manually. &lt;br /&gt;&lt;br /&gt;Selecting the Classes of Data to Collect&lt;br /&gt;After you set the collection and loading options for a target, you can then select the classes of performance data that you want to collect for that target: &lt;br /&gt;&lt;br /&gt;In collection view, select and connect to the target. &lt;br /&gt;&lt;br /&gt;For more information, see "Selecting Targets" . &lt;br /&gt;&lt;br /&gt;Click the plus sign (+) next to the target to show the classes of data you can collect. &lt;br /&gt;&lt;br /&gt;Select one of the classes for the target. &lt;br /&gt;&lt;br /&gt;Figure 4-3 shows a typical collection class for a node target on Windows NT and the data sources and data items available for the class. &lt;br /&gt;&lt;br /&gt;Figure 4-3 Selecting Data Sources and Data Items for a Collection Class&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_selected_class.gif &lt;br /&gt;The following list explains classes, data items, and data sources in more detail: &lt;br /&gt;&lt;br /&gt;Classes &lt;br /&gt;&lt;br /&gt;A class is a container for a particular category of data. For example, a node (or operating system) target might include the following classes: &lt;br /&gt;&lt;br /&gt;System &lt;br /&gt;&lt;br /&gt;Processor &lt;br /&gt;&lt;br /&gt;Memory &lt;br /&gt;&lt;br /&gt;When you select a target in the navigator, Capacity Planner displays the names of the classes below the target in the tree view. &lt;br /&gt;&lt;br /&gt;You can collect data from none, some, or all displayed classes for a target. A class may also be a container for other classes, to provide logical groupings of the performance data at higher levels. For example, an I/O class may be a container for other more specific I/O classes. &lt;br /&gt;&lt;br /&gt;Data items &lt;br /&gt;&lt;br /&gt;In a class, each of the related statistics is referred to as a data item. For example, a LogicalDisk class might include the following data items: &lt;br /&gt;&lt;br /&gt;Percent Free Space &lt;br /&gt;&lt;br /&gt;Free Megabytes &lt;br /&gt;&lt;br /&gt;Current Disk Queue Length &lt;br /&gt;&lt;br /&gt;Disk Writes per Second &lt;br /&gt;&lt;br /&gt;A class can contain one or more data items. When you select a class in the navigator, the names of the data items and data sources associated with the data items are displayed on the Collection Details property page. Select the data items that you are interested in collecting. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A green check mark appears next to the name of each data item that is selected for collection. You can toggle the state of all data items between collected and not collected by clicking the Data Items column header that contains the check mark. &lt;br /&gt;&lt;br /&gt;Data sources &lt;br /&gt;&lt;br /&gt;A data source is a description of where Oracle Capacity Planner can collect the data items for a class. A class can contain one or more data sources. When you select a class in the navigator, the names of the data items and data sources associated with the class are displayed on the Collection Details property page. &lt;br /&gt;&lt;br /&gt;The type of data in the class determines the data sources for the class. For example, in a LogicalDisk class, the data sources might be the individual disks for the operating system (for example, disk1, disk2, and so on). In a CPU Utilization class, the sources are the individual CPUs for the host (for example, cpu1, cpu2, and so on). You can collect data items from one or more data sources. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you select a data source, a green check mark appears next to the name of the data source on the Collection Details property page. You can toggle the state of all data sources between collected and not collected by clicking the Data Sources column header that contains the check mark. &lt;br /&gt;&lt;br /&gt;Starting Data Collection&lt;br /&gt;After you select the data items that you want to collect from the available data sources on the Collection Details property page, click Apply to confirm your selections, or click Revert to cancel the selections. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you click Apply for a class of data, Capacity Planner marks the icon for the selected class and the selected target with a green dot in the Collection view of the navigator panel. A green dot on a collection class icon indicates that one or more data sources are selected for the class. A green dot on a target icon indicates that Capacity Planner is collecting data for one or more classes in the target. &lt;br /&gt;&lt;br /&gt;For example, in Figure 4-4, Capacity Planner is actively collecting data for the Processor, Memory, and Cache classes for node ANG-PC. Capacity Planner is not collecting data for the System collection class. &lt;br /&gt;&lt;br /&gt;Figure 4-4 Green Dots on a Target or Class Indicate Capacity Planner is Collecting Data&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_green_dots.gif &lt;br /&gt;Stopping Data Collection&lt;br /&gt;To stop collecting data for one or more data items or data sources for a collection class, follow these steps: &lt;br /&gt;&lt;br /&gt;Select the collection class in the navigator. &lt;br /&gt;&lt;br /&gt;On the Collection Details page, click on the green check marks for those data items or data sources from which you no longer want data collected, which causes the check marks to disappear. &lt;br /&gt;&lt;br /&gt;Click Apply. &lt;br /&gt;&lt;br /&gt;To stop collecting data for all data items and data sources for a collection class, follow these steps: &lt;br /&gt;&lt;br /&gt;Select the collection class in the navigator. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;On the Collection Details page, click Stop Collection. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays a message box stating that collections for the class have stopped. &lt;br /&gt;&lt;br /&gt;Click OK to close the message box and return to the Capacity Planner main window. &lt;br /&gt;&lt;br /&gt;When no data sources are selected for collection for a class of data, the icon for that class in the navigator does not display a green dot. &lt;br /&gt;&lt;br /&gt;To stop collecting data for all classes in a target: &lt;br /&gt;&lt;br /&gt;In collection view, select and connect to the target. &lt;br /&gt;&lt;br /&gt;For more information, see "Selecting Targets" . &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click Stop Collection on the Target property sheet. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays a confirmation box. &lt;br /&gt;&lt;br /&gt;Click Yes to stop collecting data for all classes in the target; click No to cancel the operation. &lt;br /&gt;&lt;br /&gt;Generating a Collection Report&lt;br /&gt;A collection report provides a summary of the collection settings for one or more targets. Capacity Planner displays the collection settings in your Web browser. In the browser, you can easily review the settings currently applied to the target or targets you selected. &lt;br /&gt;&lt;br /&gt;To display a collection report for one or more targets: &lt;br /&gt;&lt;br /&gt;In collection view, on the File menu, choose Collection Report. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays the first screen of the Collection Report Wizard. &lt;br /&gt;&lt;br /&gt;Use the Collection Report Wizard to specify the target or targets whose collection settings you want to include in the report and to generate and view the report. &lt;br /&gt;&lt;br /&gt;At any time while using the wizard, click Help for more information. &lt;br /&gt;&lt;br /&gt;When you click Finish on the last screen of the Collection Report Wizard, Capacity Planner saves the report to an HTML file and displays the report in your Web browser. &lt;br /&gt;&lt;br /&gt;Copying Collection Settings&lt;br /&gt;After you set up collection settings for one service, you can quickly copy those settings to another similar target. &lt;br /&gt;&lt;br /&gt;To copy the collections settings from one target to another: &lt;br /&gt;&lt;br /&gt;In collection view, select a target whose collection settings you want to copy. &lt;br /&gt;&lt;br /&gt;On the File menu, choose Copy Collection Settings or right mouse click on the Collection Settings from the context menu. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays the first screen of the Copy Collections Wizard. &lt;br /&gt;&lt;br /&gt;Use the Copy Collection Settings Wizard to specify the destination targets to which you would like to copy the collection settings for the selected target. &lt;br /&gt;&lt;br /&gt;From the wizard, you can also view the progress of the copy operation. At any time while you are using the Copy Collection Settings Wizard, click Help for more information. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;Any destination target you select must be running an Agent of the same type and version as the target from which you are copying your settings.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Troubleshooting Collection and Load Problems&lt;br /&gt;During the collection and load processes, errors may be encountered by the Agent. You can determine if data is not being collected or loaded by using either of these methods: &lt;br /&gt;&lt;br /&gt;Browsing the analysis data in the Oracle Capacity Planner navigator. See "Browsing the Collected Data" for more information. &lt;br /&gt;&lt;br /&gt;Accessing the historical database using SQL. See "Understanding the Oracle Capacity Planner Historical Database" for more information. &lt;br /&gt;&lt;br /&gt;If data is not being collected or loaded, you should check the status of the Agent on the host from which data is being collected. If the Agent is running, check the log file ($ORACLE_HOME/network/log/dbsnmp.log) for errors related to the collection or loading of data. See the Oracle Intelligent Agent User's Guide for additional details on the configuration of the Agent. &lt;br /&gt;&lt;br /&gt;Analyzing Collected Data&lt;br /&gt;After collected data is loaded into the Oracle Capacity Planner historical database, you can perform a variety of analyses on it. To access the analysis features of Oracle Capacity Planner, click the Analysis tab (Figure 4-5) at the bottom of the Oracle Capacity Planner navigator tree view. This displays the Oracle Capacity Planner analysis view. &lt;br /&gt;&lt;br /&gt;Figure 4-5 Clicking the Analysis Tab&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_analysis_tab.gif &lt;br /&gt;Connecting to an Oracle Capacity Planner Historical Database&lt;br /&gt;When you expand the Historical Database folder at the root of the navigator tree in analysis view, you are prompted for the logon credentials for an Oracle Capacity Planner historical database. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_root_analysis.gif &lt;br /&gt;After you connect to a historical database, the folder expands to show the targets for which data is available in that historical database. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_apps_analysis.gif &lt;br /&gt;If you store data in multiple historical databases, you must disconnect from one historical database before you can connect to a different historical database. &lt;br /&gt;&lt;br /&gt;To disconnect from the current historical database, &lt;br /&gt;&lt;br /&gt;Click the Historical Database folder at the root of the navigator tree. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click the Disconnect button in the Capacity Planner toolbar panel. &lt;br /&gt;&lt;br /&gt;To connect to a different historical database, expand the Historical Database folder again and enter the credentials for the new historical database in the resulting logon dialog box. &lt;br /&gt;&lt;br /&gt;Organization of Data in the Navigator&lt;br /&gt;When you expand a target in the navigator under the Historical Database folder, two forms of data are displayed below the target: &lt;br /&gt;&lt;br /&gt;Classes of data &lt;br /&gt;&lt;br /&gt;The classes displayed for the target are the collection classes for which data is available in the Oracle Capacity Planner historical database. You can select and view data from these classes by selecting a class in the navigator, specifying the selection criteria, and then clicking Show New Chart. These operations are the first step in creating an analysis. &lt;br /&gt;&lt;br /&gt;Analyses &lt;br /&gt;&lt;br /&gt;Below each target in the navigator is an Analyses folder, which contains predefined and user-defined analyses. Predefined analyses are provided for some targets. You can create user-defined analyses by selecting a class of data, displaying an analysis of the data, and then saving the analysis. You can also create a user-defined analysis by using an existing analysis as a template, making modifications to the analysis, and then saving the analysis under a new name. &lt;br /&gt;&lt;br /&gt;Browsing the Collected Data&lt;br /&gt;To browse the collected data for a particular target: &lt;br /&gt;&lt;br /&gt;In analysis view, expand the Historical Database folder. &lt;br /&gt;&lt;br /&gt;You are prompted for the credentials for the historical database that contains the collected data that you want to analyze. &lt;br /&gt;&lt;br /&gt;Enter your logon credentials and connect to the historical database. &lt;br /&gt;&lt;br /&gt;On the navigator panel, expand the folder for the target whose collected data you want to analyze. &lt;br /&gt;&lt;br /&gt;The navigator displays the: &lt;br /&gt;&lt;br /&gt;Names of the classes for which collected data exists in the historical database for the target &lt;br /&gt;&lt;br /&gt;An Analyses folder, which contains predefined and user-defined analyses you created for the target &lt;br /&gt;&lt;br /&gt;Viewing an Analysis for a Class of Data&lt;br /&gt;To view an analysis chart for a selected class of data: &lt;br /&gt;&lt;br /&gt;On the navigator panel, click the name of a class whose collected data you want to analyze. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays the property page for the class (Figure 4-6). &lt;br /&gt;&lt;br /&gt;To specify the selection criteria for the class of data you want to analyze, see "Specifying Selection Criteria for a Class of Data" for instructions. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click Show New Chart. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays the Analysis window, which contains two or more pages. The Chart page displays the chart. The remaining pages are Details pages. A separate Details page exists for each class from which one or more data items are included in the analysis. &lt;br /&gt;&lt;br /&gt;For information about the Analysis window, choose Window from the Analysis window Help menu. For information about modifying the analysis or changing the way the data is displayed, see "Working with Analyses" . &lt;br /&gt;&lt;br /&gt;Saving a Class Analysis as a User-Defined Analysis&lt;br /&gt;After you view an analysis for a class of data, you can save it as a user-defined analysis to view later. &lt;br /&gt;&lt;br /&gt;To save the analysis: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;While viewing the analysis chart, click Save Chart on the analysis window toolbar. &lt;br /&gt;&lt;br /&gt;Click Yes in the message box. &lt;br /&gt;&lt;br /&gt;Performance Manager places the new user-defined analysis in the Analyses folder of the navigator panel. &lt;br /&gt;&lt;br /&gt;Figure 4-6 Oracle Capacity Planner Analysis View&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_analysis_view.gif &lt;br /&gt;Specifying Selection Criteria for a Class of Data&lt;br /&gt;When you select a class in the navigator panel in analysis view, Capacity Planner displays a property sheet that contains options available for selecting data from the Oracle Capacity Planner historical database for that class. &lt;br /&gt;&lt;br /&gt;Before you display a chart of the collected data you must: &lt;br /&gt;&lt;br /&gt;Select the time aggregation level from the Time Aggregation drop-down list. &lt;br /&gt;&lt;br /&gt;For example, select Hours if you want to analyze hourly data, Days if you want to analyze daily data, and so on. &lt;br /&gt;&lt;br /&gt;In the Data Sources section, select one or more data sources whose data items you want to analyze. &lt;br /&gt;&lt;br /&gt;In the Data Items section, select one or more data items you want to analyze. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A check mark appears next to each data item that is selected for analysis. &lt;br /&gt;&lt;br /&gt;After you specify the selection criteria, there are two ways to display the data in an analysis chart: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To add the selected data to a new analysis chart, click Show New Chart, which displays the new chart. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To add the selected data to an analysis chart that is already displayed in the Analysis window, click Add to Chart, then in the Add Data to Analysis dialog box, select the name of the previously-displayed analysis chart. Note that only charts that are currently opened are displayed in the Add Data to Analysis dialog box. &lt;br /&gt;&lt;br /&gt;Viewing and Modifying User-Defined and Predefined Analyses&lt;br /&gt;You can view and modify both user-defined and predefined analyses. However, once modifications are made to a predefined analysis, the only way to save those changes is to save the analysis to a new name. This creates a new user-defined analysis and preserves the original predefined analysis. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;Not all targets provide predefined analyses.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To view an existing analysis, which makes it available for modification, follow these steps: &lt;br /&gt;&lt;br /&gt;Expand the Analysis folder for the target, which displays the existing predefined and user-defined analyses for the target. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A bar chart icon identifies a predefined analysis. Not all targets provide predefined analyses. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A bar chart and person icon identifies a user-defined analysis. You create a user-defined analysis by displaying an analysis for a class of data or displaying a predefined analysis, and then saving the analysis. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;You can limit the list of displayed analyses to only user-defined analyses by removing the check mark from the View Predefined Analyses option on the Analysis menu. When you choose the View Predefined Analyses option on the Analysis menu again, the check mark preceding the menu option is replaced, and predefined analyses are displayed again.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select a predefined analysis or user-defined analysis in the navigator panel. &lt;br /&gt;&lt;br /&gt;The Analysis Summary property page for the selected analysis is displayed in the detail panel. This property page displays the names of the targets and classes whose data is used in the analysis. &lt;br /&gt;&lt;br /&gt;To view the data sources and data items in the analysis, click the plus sign (+) next to the target icons in the Service/Source column. &lt;br /&gt;&lt;br /&gt;To view the chart for the analysis, click Show. &lt;br /&gt;&lt;br /&gt;Note that if you are opening a predefined analysis, Capacity Planner displays the Select Data Sources for Analysis dialog box. Predefined analyses are provided for some targets. Predefined analyses require you to specify the available data sources for your installation. Select the data sources you want to include in the predefined analysis and click OK. &lt;br /&gt;&lt;br /&gt;After you have opened an analysis, you can modify the contents and how they are presented. See "Working with Analyses" for more information. &lt;br /&gt;&lt;br /&gt;You can also create a copy of an analysis, rename an analysis, or delete an analysis, as explained in the next three sections. &lt;br /&gt;&lt;br /&gt;Creating a Copy of an Analysis&lt;br /&gt;You can create an analysis that is an exact copy of an existing analysis, but the copy has a different name. To do this: &lt;br /&gt;&lt;br /&gt;In analysis view, locate and expand the target that contains the analysis you want to copy. &lt;br /&gt;&lt;br /&gt;Expand the Analyses folder. &lt;br /&gt;&lt;br /&gt;Select the analysis you want to copy. &lt;br /&gt;&lt;br /&gt;On the Analysis menu, choose Create Like. &lt;br /&gt;&lt;br /&gt;In the Create Analysis Like dialog box, enter a unique name for the new analysis that you are creating and click OK. &lt;br /&gt;&lt;br /&gt;Capacity Planner creates the new copy of the analysis in the Analyses folder for the target. &lt;br /&gt;&lt;br /&gt;Renaming a User-Defined Analysis&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;You cannot rename a predefined analysis. This restriction ensures that the original predefined analysis charts are not overwritten. &lt;br /&gt;&lt;br /&gt;However, after you make changes to a predefined analysis, you can save the modified version of the predefined analysis as a user-defined chart with a new name. For more information, see "Saving the Results of a Predefined Analysis".  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To rename a user-defined chart: &lt;br /&gt;&lt;br /&gt;In analysis view, locate and expand the target that contains the analysis you want to rename. &lt;br /&gt;&lt;br /&gt;Expand the Analyses folder. &lt;br /&gt;&lt;br /&gt;Select the user-defined analysis you want to rename. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A bar-chart-and-person icon identifies user-defined analyses. &lt;br /&gt;&lt;br /&gt;On the Analysis menu, choose Rename. &lt;br /&gt;&lt;br /&gt;In the Rename Analysis dialog box, enter a unique name for the analysis you are renaming and click OK. &lt;br /&gt;&lt;br /&gt;Deleting a User-Defined Analysis&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;You cannot delete a predefined analysis.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To delete a user-defined analysis: &lt;br /&gt;&lt;br /&gt;In analysis view, locate and expand the target that contains the analysis you want to delete. &lt;br /&gt;&lt;br /&gt;Expand the Analyses folder. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A bar-chart-and-person icon identifies the user-defined analyses in the folder. &lt;br /&gt;&lt;br /&gt;Select the user-defined analysis that you want to delete. &lt;br /&gt;&lt;br /&gt;On the Analysis menu, choose Delete. &lt;br /&gt;&lt;br /&gt;In the message dialog box that prompts you to confirm the deletion, click OK. &lt;br /&gt;&lt;br /&gt;Working with Analyses&lt;br /&gt;After you have opened an analysis chart, either by selecting and showing an existing analysis or by browsing collected data to create a new analysis, the data included in that analysis is shown in the Oracle Capacity Planner Analysis window. &lt;br /&gt;&lt;br /&gt;The Analysis window contains two or more pages. The first page is called the Chart page and it displays the analysis chart. The remaining page or pages are Details pages. A separate Details page exists for each class from which one or more data items are included in the analysis. Each Details page shows the: &lt;br /&gt;&lt;br /&gt;Data sources for the data items plotted in the chart &lt;br /&gt;&lt;br /&gt;Time aggregation level of the plotted data items &lt;br /&gt;&lt;br /&gt;Value of each plotted data item each time the data item was collected during the time range for the analysis &lt;br /&gt;&lt;br /&gt;The time range for the collected data appears along the bottom of each chart, with the beginning of the time range at the left and the end of the time range at the right. &lt;br /&gt;&lt;br /&gt;Two types of lines can appear on a chart. Each solid line plots the values of a selected data item during the specified time range. Each dashed line plots the result of a trend analysis to time or trend analysis to value. See "What Is a Trend Analysis?" for more information about performing a trend analysis. &lt;br /&gt;&lt;br /&gt;The rest of this section describes other features of the Analysis window. &lt;br /&gt;&lt;br /&gt;Viewing the Value of a Data Point&lt;br /&gt;To view the value for a data point (that is, one plotted point of a data item) on a line in an analysis chart, position the cursor over the data point. If there is a point beneath the cursor, Capacity Planner displays the date, time, and value for that data point displays in a box above the point (see Figure 4-7). &lt;br /&gt;&lt;br /&gt;Figure 4-7 Viewing the Value of a Data Point&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_cursor_over_data_point.gif &lt;br /&gt;Selecting a Line&lt;br /&gt;When you view an analysis chart, you can perform certain operations after selecting a line in the chart. Most of the available operations are started by clicking a toolbar button on the analysis window after a chart line is selected. &lt;br /&gt;&lt;br /&gt;To select a line, click a data point on the line. When a line is selected, the description of the line is displayed in the status bar at the bottom of the window, and the appropriate toolbar buttons are enabled. &lt;br /&gt;&lt;br /&gt;Operations available from the toolbar are also available on a context menu. To display the context menu, click the right mouse button on a data point in a line in the analysis chart. &lt;br /&gt;&lt;br /&gt;To be sure which line is currently selected (before clicking a toolbar button), read the description of the line in the status bar. &lt;br /&gt;&lt;br /&gt;Adding a Class of Data to an Analysis&lt;br /&gt;After you open an analysis, you may want to add data from other classes to the analysis. You can use this feature to compare two different classes of data. &lt;br /&gt;&lt;br /&gt;To add a class of data to an analysis that is currently displayed in the Analysis window: &lt;br /&gt;&lt;br /&gt;Confirm that Capacity Planner is in analysis view. &lt;br /&gt;&lt;br /&gt;Select from the navigator the class of data that you want to add. &lt;br /&gt;&lt;br /&gt;Specify the selection criteria (as described in "Specifying Selection Criteria for a Class of Data") for the class. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click Add to Chart. &lt;br /&gt;&lt;br /&gt;In the Add Data to Analysis dialog box, select the name of the chart to which you want to add the data. &lt;br /&gt;&lt;br /&gt;You can add data items from multiple classes to an analysis, and you can select different aggregation levels and date ranges for each class. &lt;br /&gt;&lt;br /&gt;However, data items within a single class must share the same aggregation level and date range. If you try to add additional data items from the same class to an existing chart, you will receive a prompt, warning that the chart already contains data from this class. If you click OK, Capacity Planner will overwrite the chart with the currently selected data, aggregation levels, and date range. &lt;br /&gt;&lt;br /&gt;Modifying Selection Criteria from the Analysis Window&lt;br /&gt;From the analysis window, you can modify the selection criteria associated with any of the classes of data included in the analysis. Modify the selection criteria using one of these methods: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select a line in the analysis chart and click the Select Items toolbar button. &lt;br /&gt;&lt;br /&gt;Click the right mouse button on a data point in the line and choose Select Items from the context menu. &lt;br /&gt;&lt;br /&gt;Click the Data tab in the analysis window (as opposed to the Chart tab) and click the Select Items toolbar button. &lt;br /&gt;&lt;br /&gt;These actions display the Select Items dialog box, which contains the property sheet for the class of data associated with the selected line. This property sheet contains the selection criteria for that class of data, which you can modify and apply to the current analysis. See "Specifying Selection Criteria for a Class of Data" for more information. &lt;br /&gt;&lt;br /&gt;After you modify selection criteria, you can click either Apply or OK on the Analysis Options dialog box. If you click Apply, the changes made to the selection criteria are applied to the analysis and the updated analysis is shown. The Select Items dialog box remains displayed, and you can make other modifications to the same selection criteria, if you want. If you click OK, Capacity Planner applies the modifications to the analysis and closes the Select Items dialog box. &lt;br /&gt;&lt;br /&gt;Removing a Line from a Chart&lt;br /&gt;You can remove a line from an analysis chart by either of these methods: &lt;br /&gt;&lt;br /&gt;Select the line by clicking the right mouse button, then choose Remove Line from the context menu. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select the line, then click the Remove Line button on the analysis window toolbar. &lt;br /&gt;&lt;br /&gt;These actions remove the data for the selected data item from the chart, but not from the historical database. &lt;br /&gt;&lt;br /&gt;Excluding a Data Point from a Chart&lt;br /&gt;You can exclude a data point (that is, one plotted point of a data item) from a chart. To exclude a data point, click the right mouse button on the data point and choose Exclude Point from the context menu. &lt;br /&gt;&lt;br /&gt;Excluding a data point is useful if you know that the value of a particular data point is skewed. For example, if you know that a particular CPU-intensive program was not run at the usual time, you can remove the value for the % Processor Time data item for that time from the chart. The selected data point is removed from the chart, but the data for the data point is not removed from the historical database. &lt;br /&gt;&lt;br /&gt;After you exclude one or more data points from a line, a red X appears in the status bar when you select the line. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To later redisplay excluded data points for a selected line, click View Exclusions on the Analysis window toolbar, or click the right mouse button on the line and select View Exclusions from the context menu. &lt;br /&gt;&lt;br /&gt;These actions display the Data Point Exclusions dialog box, which displays the current list of excluded points for the selected line. You can toggle the check mark for each data point in the list. A check mark indicates that the data point is excluded from the analysis. To display an excluded data point in the analysis again, clear the check mark. &lt;br /&gt;&lt;br /&gt;When you click OK, Capacity Planner closes the Data Point Exclusions dialog box and updates the chart to include the points removed from the list of exclusions. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;Data point exclusions are not saved with an analysis.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Showing or Hiding the Chart Legend&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can control whether or not the legend is displayed in an analysis chart by toggling the Show/Hide Legend button on the analysis window toolbar. When the legend is not shown, you can identify a line by clicking it, which displays the description of the line in the analysis window status bar. &lt;br /&gt;&lt;br /&gt;Zooming and Scrolling to View More or Less Chart Data&lt;br /&gt;Depending on the date range and the number of data items and data sources you are analyzing, you may want to zoom in, zoom out, or scroll the contents of the chart window. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To view more detail or less detail, click the Zoom In and Zoom Out buttons on the Analysis Chart window toolbar. You can also zoom in by pressing the Page Down key on your keyboard or the numeric 3 on your keypad, and you can zoom out by pressing the Page Up key or the numeric 9 on your keypad. &lt;br /&gt;&lt;br /&gt;You can also zoom in on a very specific part of the chart by dragging a rectangle around the area you want to magnify (Figure 4-8). Release the mouse button to zoom in on the selected area. You can zoom back out by using the Zoom Out button Home or End key on your keyboard. &lt;br /&gt;&lt;br /&gt;Figure 4-8 Zooming in on a Selected Area of the Chart&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_zoom_rect.gif &lt;br /&gt;Often, the chart data will extend beyond the width of the Analysis Chart window. You can view the data that extends beyond the edges of the window by resizing the Analysis Chart window or by scrolling to the right or left. &lt;br /&gt;&lt;br /&gt;To scroll the Analysis chart window: &lt;br /&gt;&lt;br /&gt;Press and drag the pointer on the black scroll bar below the chart (Figure 4-9). &lt;br /&gt;&lt;br /&gt;When the portion of the chart you want to view is displayed in the Analysis Chart window, release the mouse button. &lt;br /&gt;&lt;br /&gt;Optionally, you can use the arrow keys on your keyboard to scroll left and right. Press the left arrow to scroll left and the right arrow to scroll right. If you experience a conflict with the Tab function using the left and right arrow keys, you can use the up and down arrow keys on your keyboard to scroll. Press the up arrow to scroll left (or the numeric 8 on your keypad), or the down arrow key to scroll right (or the numeric 2 on your keypad). &lt;br /&gt;&lt;br /&gt;Figure 4-9 Scroll Bar in the Analysis Chart Window&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_scroll_chart.gif &lt;br /&gt;Auto-Scaling Data&lt;br /&gt;If an analysis contains data from different classes where the scale of the data is significantly different, you may want to apply scaling to the data. Scaling normalizes the data so that all lines have a maximum value of no greater than 100. Very large data items are scaled down, and very small data items are scaled up. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To apply scaling, click Toggle Auto Scaling on the analysis window toolbar. When scaling is applied to a chart, data lines with very different scales may be visually correlated. When scaling is enabled, Capacity Planner displays the label Scaled Data along the Y-axis of the chart. If you select a line from the chart by clicking it, the scaling factor for that line is included in the status bar. &lt;br /&gt;&lt;br /&gt;What Is a Trend Analysis?&lt;br /&gt;A trend analysis infers or estimates future values by projecting and extending known values. Oracle Capacity Planner can perform the following types of trend analyses: &lt;br /&gt;&lt;br /&gt;Trend analysis to a point in time &lt;br /&gt;&lt;br /&gt;In a trend analysis to a point in time, you provide a goal time for a data item. Oracle Capacity Planner uses the specified values in the historical database to project the value of the data item at the goal time. &lt;br /&gt;&lt;br /&gt;A trend analysis to a point in time is used to answer questions such as, "How full will this disk be at the end of the year?" &lt;br /&gt;&lt;br /&gt;Trend analysis to a value &lt;br /&gt;&lt;br /&gt;In a trend analysis to a value, you provide a goal value for a data item. Oracle Capacity Planner uses the specified values in the historical database to project the time at which the data item will reach the goal value. &lt;br /&gt;&lt;br /&gt;A trend analysis to a value is used to answer questions such as, "When will our CPU utilization reach 95 percent?" &lt;br /&gt;&lt;br /&gt;As the default, the Capacity Planner Trend Analysis wizard uses the critical threshold for the metric (if one is defined) when you perform a trend to a value. &lt;br /&gt;&lt;br /&gt;Specifying and Performing a Trend Analysis&lt;br /&gt;To specify and perform a trend analysis, follow these steps: &lt;br /&gt;&lt;br /&gt;In the Analysis window, either: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Select a line by clicking a data point in the line, then click the Trend Analysis Wizard button on the toolbar. &lt;br /&gt;&lt;br /&gt;Click the right mouse button on a data point in a line, then select Trend Analysis Wizard from the context menu. &lt;br /&gt;&lt;br /&gt;Both of these methods display the Trend Analysis Wizard. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays the Trend Analysis Wizard Welcome panel that identifies the selected data on which you can conduct the trend analysis. You can click on the option box that prevents the Welcome screen from displaying in subsequent uses of the wizard. Click on Next to move to the next wizard panel. &lt;br /&gt;&lt;br /&gt;In the Date Range panel, select a date range to use as a basis for the trend analysis: &lt;br /&gt;&lt;br /&gt;Click Use only the visible date range (as currently zoomed in the chart) to use the range of dates currently visible in the analysis chart window (not including any data that extends beyond the edge of the chart window). &lt;br /&gt;&lt;br /&gt;This option is enabled only if you zoomed in to see more detail in the chart. For more information, see "Zooming and Scrolling to View More or Less Chart Data" . &lt;br /&gt;&lt;br /&gt;Click Use the date range selected for the chart to use the date range currently used for all the data in the chart (even data that extends beyond the edge of the chart window). &lt;br /&gt;&lt;br /&gt;Click Select a new chart range to select a different date range . You can designate either a recent period of time by choosing Use a recent period of time and then selecting the time increment and number of units of time to use, or you can specify a new start and end time by choosing Use a new start and end time. &lt;br /&gt;&lt;br /&gt;Click on Next to move to the next wizard panel. &lt;br /&gt;&lt;br /&gt;In the Trend Analysis Type panel of the wizard, specify which type of trend analysis you want to perform. &lt;br /&gt;&lt;br /&gt;To perform a trend analysis to a value, click the Estimate when the data item will reach the following value: and enter the numeric value for which you wish to determine the date and time. &lt;br /&gt;&lt;br /&gt;To perform a trend analysis to a future date and time, click Estimate what the value of the data item will be at the following date: and enter the time and date for which you wish to determine a value. &lt;br /&gt;&lt;br /&gt;Click on Next to move to the next wizard panel. &lt;br /&gt;&lt;br /&gt;The Summary panel displays the results of the trend analysis. Click on Finish to add the trend line to the chart. &lt;br /&gt;&lt;br /&gt;Choose Customize Annotation from the View menu to display the Annotate Trend dialog box and make changes to the annotation. Optionally, you can right mouse button click on the annotation created by the Trend Analysis wizard and then choose Customize Annotation from the context menu. &lt;br /&gt;&lt;br /&gt;Use the Annotate Trend dialog box to specify whether Capacity Planner will annotate the trend analysis (see Figure 4-10) and the appearance of the trend analysis line in the chart window. If you need information about the fields in the Annotate Trend dialog box, click Help. &lt;br /&gt;&lt;br /&gt;Figure 4-10 Annotation for a Trend Analysis&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;Text description of the illustration cp_trent_annotation.gif &lt;br /&gt;Click OK to close the Annotate Trend dialog box. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Note: &lt;br /&gt;To move the annotation box in an analysis chart, click the box, hold the mouse button down, then move the mouse to a different position on the chart. Release the mouse button when you have reached the position in the chart where you want the annotation box displayed.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Saving Changes to a User-Defined or Predefined Analysis&lt;br /&gt;You can save the changes you make to an analysis. Oracle Capacity Planner can determine if you are saving a user-defined analysis or a predefined analysis. The steps for saving your changes differ, depending on the type of analysis. &lt;br /&gt;&lt;br /&gt;Saving the Results of a User-Defined Analysis&lt;br /&gt;To save changes to a user-defined analysis: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;While viewing the analysis, click Save Chart on the analysis window toolbar. &lt;br /&gt;&lt;br /&gt;Click Yes in the message box. &lt;br /&gt;&lt;br /&gt;Your changes are saved to in the Analysis folder for the selected target using the current name of the analysis or data class. To save the analysis under a different name, choose Save As from the Analysis window File menu. &lt;br /&gt;&lt;br /&gt;Saving the Results of a Predefined Analysis&lt;br /&gt;If you modify a predefined analysis, you must provide a new name for the analysis when you save the results of the analysis. When you do this, you create a new user-defined analysis. Saving the analysis with a new name ensures that the original predefined analysis is not overwritten. &lt;br /&gt;&lt;br /&gt;To save the results of a predefined analysis: &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;While viewing the analysis, click Save Chart on the analysis window toolbar. &lt;br /&gt;&lt;br /&gt;Click Yes in the dialog box that is displayed. &lt;br /&gt;&lt;br /&gt;In the Save Analysis As dialog box, type a unique name for the user-defined analysis that will be created. &lt;br /&gt;&lt;br /&gt;Click OK in the Save Analysis As dialog box. &lt;br /&gt;&lt;br /&gt;Capacity Planner places the new user-defined chart in the Analyses folder of the navigator panel. &lt;br /&gt;&lt;br /&gt;Printing an Analysis Chart&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To print an analysis chart, click the Print Chart button in the Analysis Chart toolbar while the chart is displayed. &lt;br /&gt;&lt;br /&gt;The size of the chart on the screen determines the size of the chart in the chart printout. For example, when you print a chart that is 5 inches high and 7 inches wide on your screen, the chart will be 5 inches high and 7 inches wide in the printout. &lt;br /&gt;&lt;br /&gt;Generating a Report for an Analysis Chart&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To generate an HTML report for an analysis chart: &lt;br /&gt;&lt;br /&gt;Click the Report Chart button while the chart is displayed. &lt;br /&gt;&lt;br /&gt;Capacity Planner displays a dialog box that tells you the name of the HTML file used to display the report and where the file will be saved. &lt;br /&gt;&lt;br /&gt;Make a note of the file name and location. &lt;br /&gt;&lt;br /&gt;Click Yes to preview the chart in your Web browser, or click No if you do not want to preview the report. &lt;br /&gt;&lt;br /&gt;You can view the report later using a Web browser, or--if you have experience with Web publishing tools and techniques--you can share the report with your co-workers by publishing the HTML file and its associated graphic files on a Web server. &lt;br /&gt;&lt;br /&gt;Understanding the Oracle Capacity Planner Historical Database&lt;br /&gt;The logical structure of the Oracle Capacity Planner historical database schema was designed to facilitate querying of capacity planning data by tools other than Oracle Capacity Planner, such as Microsoft Excel. This section contains a brief description of the design of the Oracle Capacity Planner historical database schema. It is not intended to be a comprehensive description of all tables and columns in the schema. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Caution: &lt;br /&gt;Performing any modification to the Oracle Capacity Planner historical database schema (tables, columns, or indexes) or to the data itself is not recommended and is not supported. Such modifications may render your Oracle Capacity Planner historical database schema unusable as a target to load or retrieve capacity planning data.  &lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Understanding the Service Reference Table (vp_service_ref)&lt;br /&gt;The service reference table contains a list of all targets for which data has been stored in the Oracle Capacity Planner historical database. The HOST column contains the name of the host where the Agent that loaded data for the specified target (the NAME column) is located. The SVC_ID column is a column used for lookup into the class reference table, described in the following paragraph. &lt;br /&gt;&lt;br /&gt;Understanding the Class Reference Table (vp_class_ref)&lt;br /&gt;The class reference table contains a list of all collection classes for which data has been stored in the Oracle Capacity Planner historical database, for all targets. To see the list of classes for a particular target, a query should look for the SVC_ID column equal to a SVC_ID value from the service reference table, described in the previous paragraph. Such a query would produce a list of all classes for which data exists in the database for a particular target. &lt;br /&gt;&lt;br /&gt;Understanding the Data Tables&lt;br /&gt;Each class of data in the class reference table has six data tables that contain the data for that collection class. Each table contains data for a particular time aggregate, for example, hours, days, weeks, months, and years. The base table contains the raw data as it is collected at the collection frequency. Therefore, the base table does not contain any statistical aggregations. The aggregate tables contain aggregate statistics for each data item collected for that class. &lt;br /&gt;&lt;br /&gt;Data Table Names&lt;br /&gt;Data tables are named according to the first four columns of the class reference table (in reverse order) plus the aggregate. Example 4-1 shows an entry for a collection class in the class reference table. &lt;br /&gt;&lt;br /&gt;Example 4-1 Collection Class Entry in the Class Reference Table&lt;br /&gt;CLS_ID      MOD_ID     SVC_ID     IS_UDS      CONTAINER_CLASS_LABEL&lt;br /&gt;---------- ---------- ---------- ---------- -------------------------------&lt;br /&gt;         8          2          2          0 I/O&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The collection class in Example 4-1 would have the data tables shown in Example 4-2. &lt;br /&gt;&lt;br /&gt;Example 4-2 Data Tables for a Collection Class&lt;br /&gt;VP_0_2_2_8_BASE &lt;br /&gt;VP_0_2_2_8_HOUR &lt;br /&gt;VP_0_2_2_8_DAY &lt;br /&gt;VP_0_2_2_8_WEEK &lt;br /&gt;VP_0_2_2_8_MONTH &lt;br /&gt;VP_0_2_2_8_YEAR &lt;br /&gt;Data Table Contents&lt;br /&gt;The first two columns of each data table are always the Timestamp column and the Data Source Name column. The Data Source Name column is essentially the class name, for example, Logical Disk. In aggregate tables (tables other than BASE), the third column is an accuracy calculation, which is not supported in this version of Oracle Capacity Planner. &lt;br /&gt;&lt;br /&gt;All subsequent columns contain the values for the data items collected for that class, as they are actually named. In aggregate tables, these columns are prefixed with a two-character abbreviation for the aggregation statistic that the column contains. Table 4-4 shows these abbreviations and their meanings. &lt;br /&gt;&lt;br /&gt;Table 4-4 Prefixes Used for Column Names in Aggregate Tables   &lt;br /&gt;Prefix  Meaning  &lt;br /&gt;AV &lt;br /&gt; Average &lt;br /&gt; &lt;br /&gt;SM &lt;br /&gt; Sum &lt;br /&gt; &lt;br /&gt;MN &lt;br /&gt; Minimum &lt;br /&gt; &lt;br /&gt;MX &lt;br /&gt; Maximum &lt;br /&gt; &lt;br /&gt;SD &lt;br /&gt; Standard deviation &lt;br /&gt; &lt;br /&gt;VR &lt;br /&gt; Variance &lt;br /&gt; &lt;br /&gt;CT &lt;br /&gt; Count &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;These statistics are calculated for the set of data in that aggregate from the next lowest level. For example, a row in the DAY aggregate table contains statistics calculated for all entries in the HOUR table for that day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-2688258506925873168?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/2688258506925873168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=2688258506925873168' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2688258506925873168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2688258506925873168'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/oracle-capacity-planner.html' title='Oracle Capacity Planner'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6203203820344657676</id><published>2008-06-04T03:35:00.000-07:00</published><updated>2008-06-04T03:36:28.349-07:00</updated><title type='text'>Identifying Which Oracle Indexes to Rebuild</title><content type='html'>Indexes require rebuilding when deleted leaf rows appear or when the index has a suboptimal number of block gets per access. While it is tempting to write a script that rebuilds every index in the schema, bear in mind that your schema may contain many thousands of indexes, and a complete rebuild can be very time consuming. Hence, we need to develop a method to identify those indexes that will get improved performance with a rebuild. Let’s look at one method for accomplishing this task. &lt;br /&gt;&lt;br /&gt;Oracle index nodes are not physically deleted when table rows are deleted, nor are the entries removed from the index. Rather, Oracle "logically" deletes the index entry and leaves "dead" nodes in the index tree where that may be re-used if another adjacent entry is required. However, when large numbers of adjacent rows are deleted, it is highly unlikely that Oracle will have an opportunity to re-use the deleted leaf rows, and these represent wasted space in the index.  In addition to wasting space, large volumes of deleted leaf nodes will make index fast-full scans run for longer periods. &lt;br /&gt;&lt;br /&gt;These deleted leaf nodes can be easily identified by running the IDL.SQL script (shown in Listing 5-12); the output from the script is shown in Listing 5-11. &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;In Listing 5-11 we see several important statistics. &lt;br /&gt;&lt;br /&gt;The number of deleted leaf rows &lt;br /&gt;&lt;br /&gt;The term "deleted leaf node" refers to the number of index inodes that have been logically deleted as a result of row deletes. Remember that Oracle leaves "dead" index nodes in the index when rows are deleted. This is done to speed up SQL deletes, since Oracle does not have to allocate resources to rebalance the index tree when rows are deleted. &lt;br /&gt;&lt;br /&gt;Index height &lt;br /&gt;&lt;br /&gt;The height of the index refers to the number of levels that are spawned by the index as a result in row inserts. When a large amount of rows are added to a table, Oracle may spawn additional levels of an index to accommodate the new rows. Hence, an Oracle index may have four levels, but only in those areas of the index tree where the massive inserts have occurred. Oracle indexes can support many millions of entries in three levels, and any Oracle index that has four or more levels would benefit from rebuilding. &lt;br /&gt;&lt;br /&gt;Gets per index access &lt;br /&gt;&lt;br /&gt;The number of "gets" per access refers to the amount of logical I/O that is required to fetch a row with the index. As you may know, a logical "get" is not necessarily a physical I/O since much of the index may reside in the Oracle buffer cache. However, any SAP index with a number greater than 10 would probably benefit from an index rebuild. &lt;br /&gt;&lt;br /&gt;Unfortunately, Oracle does not make it easy to capture this information. In Oracle we must issue these commands: &lt;br /&gt;&lt;br /&gt;ANALYZE INDEX index_name COMPUTE STATISTICS&lt;br /&gt;ANALYZE INDEX index_name VALIDATE STRUCTURE &lt;br /&gt;&lt;br /&gt;After you analyze the report above, you may want to consider rebuilding any index where the height is more than three levels, since three levels will support millions of index entries. Note that Oracle indexes will “spawn” to a fourth level only in areas of the index where a massive insert has occurred, such that 99% of the index has three levels, but the index is reported as having four levels. &lt;br /&gt;&lt;br /&gt;We might want to rebuild an index if the “block gets” per access is greater than five, since excessive “blocks gets” indicate a fragmented b-tree structure. Another rebuild condition would be cases where deleted leaf nodes comprise more than 20% of the index nodes. As you may know, you can easily rebuild an Oracle index with the command: &lt;br /&gt;&lt;br /&gt;ALTER INDEX index_name REBUILD &lt;br /&gt;&lt;br /&gt;The SQL that created this report is shown in Listing 5-12. &lt;br /&gt;&lt;br /&gt;revsp2t&gt; cat id1.sql&lt;br /&gt;set pages 9999;&lt;br /&gt;set heading off;&lt;br /&gt;set feedback off;&lt;br /&gt;set echo off;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;spool id4.sql; &lt;br /&gt;&lt;br /&gt;select '@id2.sql' from dual; &lt;br /&gt;&lt;br /&gt;select 'analyze index '||owner||'.'||index_name||' validate structure;',&lt;br /&gt;'@id3.sql;'&lt;br /&gt;from dba_indexes&lt;br /&gt;where&lt;br /&gt;owner not in ('SYS','SYSTEM');&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;spool off; &lt;br /&gt;&lt;br /&gt;set heading on;&lt;br /&gt;set feedback on;&lt;br /&gt;set echo on;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;@id4.sql&lt;br /&gt;@id5.sql&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;revsp2t&gt; cat id2.sql&lt;br /&gt;create table temp_stats as&lt;br /&gt;select&lt;br /&gt;name ,&lt;br /&gt;most_repeated_key ,&lt;br /&gt;distinct_keys ,&lt;br /&gt;del_lf_rows ,&lt;br /&gt;height ,&lt;br /&gt;blks_gets_per_access &lt;br /&gt;from index_stats;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;revsp2t&gt; cat id3.sql&lt;br /&gt;insert into temp_stats&lt;br /&gt;(select&lt;br /&gt;name ,&lt;br /&gt;most_repeated_key ,&lt;br /&gt;distinct_keys ,&lt;br /&gt;del_lf_rows ,&lt;br /&gt;height ,&lt;br /&gt;blks_gets_per_access &lt;br /&gt;from index_stats&lt;br /&gt;); &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;id5.sql&lt;br /&gt;Rem ind_fix.sql - Shows the detals for index stats&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;set pagesize 60;&lt;br /&gt;set linesize 100;&lt;br /&gt;set echo off;&lt;br /&gt;set feedback off;&lt;br /&gt;set heading off;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;column c1 format a18;&lt;br /&gt;column c2 format 9,999,999;&lt;br /&gt;column c3 format 9,999,999;&lt;br /&gt;column c4 format 999,999;&lt;br /&gt;column c5 format 99,999;&lt;br /&gt;column c6 format 9,999;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;spool idx_report.lst; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;prompt&lt;br /&gt;prompt&lt;br /&gt;prompt ' # rep dist. # deleted   blk gets &lt;br /&gt;prompt Index keys keys leaf rows Height per access &lt;br /&gt;prompt -------------------- ------ ----- -------- ------ ----- &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select distinct&lt;br /&gt;name c1,&lt;br /&gt;most_repeated_key c2,&lt;br /&gt;distinct_keys c3,&lt;br /&gt;del_lf_Rows c4,&lt;br /&gt;height c5,&lt;br /&gt;blks_gets_per_access c6&lt;br /&gt;from temp_stats&lt;br /&gt;where&lt;br /&gt;height &gt; 3&lt;br /&gt;or&lt;br /&gt;del_lf_rows &gt; 10&lt;br /&gt;order by name;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;spool off; &lt;br /&gt;&lt;br /&gt;spool id6.sql; &lt;br /&gt;&lt;br /&gt;select 'alter index '||owner||'.'||name||' rebuild tablespace '||tablespace_name&lt;br /&gt;||';'&lt;br /&gt;from temp_stats, dba_indexes&lt;br /&gt;where&lt;br /&gt;temp_stats.name = dba_indexes.index_name&lt;br /&gt;and&lt;br /&gt;(height &gt; 3&lt;br /&gt;or&lt;br /&gt;del_lf_rows &gt; 10);v &lt;br /&gt;&lt;br /&gt;select 'analyze index '||owner||'.'||name||' compute statistics;'&lt;br /&gt;from temp_stats, dba_indexes&lt;br /&gt;where&lt;br /&gt;temp_stats.name = dba_indexes.index_name&lt;br /&gt;and&lt;br /&gt;(height &gt; 3&lt;br /&gt;or&lt;br /&gt;del_lf_rows &gt; 10);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;spool off; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Listing 5-12. The id1.sql and other scripts to produce a detailed index report&lt;br /&gt;&lt;br /&gt;Now that we have identified the candidates for an index rebuild, we can run the following script during SAP system downtime to re-build all of the indexes (see Listing 5-13). &lt;br /&gt;&lt;br /&gt;Set heading off;&lt;br /&gt;Set pages 9999;&lt;br /&gt;Spool run_rebuild.sql;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select 'alter index sapr3.'||&lt;br /&gt;index_name||&lt;br /&gt;' rebuild tablespace '||&lt;br /&gt;tablespace_name||';'&lt;br /&gt;from dba_indexes&lt;br /&gt;where owner = ‘SAPR3’;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;spool off;&lt;br /&gt;@run_rebuild&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;Listing 5-13. A script to generate the index rebuild syntax&lt;br /&gt;&lt;br /&gt;Using ALTER INDEX REBUILD to Rebuild Indexes&lt;br /&gt;&lt;br /&gt;The ALTER INDEX index_name REBUILD command is very safe way to rebuild indexes. Here is the syntax of the command: &lt;br /&gt;&lt;br /&gt;alter index index_name&lt;br /&gt;rebuild&lt;br /&gt;tablespace tablespace_name&lt;br /&gt;storage (initial new_initial next new_next freelists new_freelist_number )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Unlike the traditional method where we drop the index and recreate it, the REBUILD command does not require a full table scan of the table, and the subsequent sorting of the keys and rowids. Rather, the REBUILD command will perform the following steps: &lt;br /&gt;&lt;br /&gt;Walk the existing index to get the index keys. &lt;br /&gt;Populate temporary segments with the new tree structure. &lt;br /&gt;Once the operation has completed successfully, drop the old tree, and rename the temporary segments to the new index. &lt;br /&gt;As you can see from the steps, you can rebuild indexes without worrying that you will accidentally lose the index. If the index cannot be rebuilt for any reason, Oracle will abort the operation and leave the existing index intact. Only after the entire index has been rebuilt does Oracle transfer the index to the new b-tree. &lt;br /&gt;&lt;br /&gt;Most Oracle administrators run this script, and then select the index that they would like to rebuild. Note that the TABLESPACE clause should always be used with the ALTER INDEX REBUILD command to ensure that the index is rebuilt in the same tablespace as the existing index. Be aware that you must have enough room in that tablespace to hold all of the temporary segments required for the index rebuild, so most Oracle administrators will double-size index tablespaces with enough space for two full index trees.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6203203820344657676?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6203203820344657676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6203203820344657676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6203203820344657676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6203203820344657676'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/identifying-which-oracle-indexes-to.html' title='Identifying Which Oracle Indexes to Rebuild'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-985248199300551196</id><published>2008-06-03T04:39:00.000-07:00</published><updated>2008-06-03T04:42:43.203-07:00</updated><title type='text'>ASM - Introduction</title><content type='html'>ASM - Automatic storage management&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Introduce with Oracle 10gr1.&lt;br /&gt;&lt;br /&gt;About ASM&lt;br /&gt;&lt;br /&gt;http://www.oracle.com/database/demos/asm.html&lt;br /&gt;&lt;br /&gt;Benefits of Automatic Storage Management&lt;br /&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/B14117_01/server.101/b10743/mgmt_db.htm#sthref2270&lt;br /&gt;&lt;br /&gt;ASM provides many of the same benefits as storage technologies such as RAID or logical volume managers (LVMs). Like these technologies, ASM enables you to create a single disk group from a collection of individual disk devices. It balances I/O to the disk group across all of the devices in the disk group. It also implements striping and mirroring to improve I/O performance and data reliability.&lt;br /&gt;However, unlike RAID or LVMs, ASM implements striping and mirroring at the file level. This implementation enables you to specify different storage attributes for individual files in the same disk group. &lt;br /&gt;&lt;br /&gt;ASM - Automatic storage management&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Introduce with Oracle 10gr1.&lt;br /&gt;&lt;br /&gt;About ASM&lt;br /&gt;&lt;br /&gt;http://www.oracle.com/database/demos/asm.html&lt;br /&gt;&lt;br /&gt;Benefits of Automatic Storage Management&lt;br /&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/B14117_01/server.101/b10743/mgmt_db.htm#sthref2270&lt;br /&gt;&lt;br /&gt;ASM provides many of the same benefits as storage technologies such as RAID or logical volume managers (LVMs). Like these technologies, ASM enables you to create a single disk group from a collection of individual disk devices. It balances I/O to the disk group across all of the devices in the disk group. It also implements striping and mirroring to improve I/O performance and data reliability.&lt;br /&gt;However, unlike RAID or LVMs, ASM implements striping and mirroring at the file level. This implementation enables you to specify different storage attributes for individual files in the same disk group.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-985248199300551196?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/985248199300551196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=985248199300551196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/985248199300551196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/985248199300551196'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/asm-introduction.html' title='ASM - Introduction'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5779306469334450088</id><published>2008-06-03T04:38:00.000-07:00</published><updated>2008-06-03T04:39:11.589-07:00</updated><title type='text'>Preparing disk for ASM instance</title><content type='html'>Preparing disk for ASM instance on Windows&lt;br /&gt;&lt;br /&gt;We can use DISKPART.EXE to create primary,logical partitions and using ASMTOOL (commandline) &amp; ASMTOOLG (GUI)stamp(map) for ASM instance.&lt;br /&gt;&lt;br /&gt;Preparing Disks for ASM&lt;br /&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asmprepare.htm#BHCDCFIH&lt;br /&gt;&lt;br /&gt;Diskpart.exe&lt;br /&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/B28359_01/install.111/b28250/racstorage.htm#BABFIDGI&lt;br /&gt;&lt;br /&gt;ASMTOOL &amp; ASMTOOLG&lt;br /&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/B28359_01/install.111/b28250/racstorage.htm#sthref212&lt;br /&gt;&lt;br /&gt;Demostration&lt;br /&gt;&lt;br /&gt;E:\&gt;asmtool -list&lt;br /&gt;NTFS \Device\Harddisk0\Partition1 37997M&lt;br /&gt;NTFS \Device\Harddisk0\Partition2 38319M&lt;br /&gt;&lt;br /&gt;E:\&gt;mkdir asmdisks&lt;br /&gt;E:\&gt;cd e:\asmdisks&lt;br /&gt;E:\asmdisks&gt;asmtool -create e:\asmdisks\DISK1 512&lt;br /&gt;E:\asmdisks&gt;asmtool -create e:\asmdisks\DISK2 512&lt;br /&gt;E:\asmdisks&gt;cd c:\app\m.taj\product\11.1.0&lt;br /&gt;&lt;br /&gt;More Reference on disks preparing for ASM&lt;br /&gt;&lt;br /&gt;http://www.databasejournal.com/features/oracle/article.php/3571371&lt;br /&gt;&lt;br /&gt;http://www.databasejournal.com/img/jsc_ASM_Listing2.html&lt;br /&gt;&lt;br /&gt;Next Part &gt;&gt;&gt; ASM Instance Creation on Windows&lt;br /&gt;&lt;br /&gt;http://dbataj.blogspot.com/2008/04/asm-instance-creation.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Email this • Share on Facebook • Digg This! • Add to del.icio.us • Save to del.icio.us • Subscribe to this feed • Technorati Links • Sphere: Related Content • outside.in: geotag this story • Discuss on Newsvine • Add to Mixx! • Stumble It!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5779306469334450088?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5779306469334450088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5779306469334450088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5779306469334450088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5779306469334450088'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/preparing-disk-for-asm-instance.html' title='Preparing disk for ASM instance'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8094594174824664469</id><published>2008-06-03T04:37:00.002-07:00</published><updated>2008-06-03T04:38:26.220-07:00</updated><title type='text'>ASM Instance Creation</title><content type='html'>ASM Instance Creation on Windows&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Create INIT.ORA file for asm instance&lt;br /&gt;&lt;br /&gt;DIAGNOSTIC_DEST=C:\app\m.taj\diag&lt;br /&gt;_asm_allow_only_raw_disks= FALSE&lt;br /&gt;instance_type=asm&lt;br /&gt;remote_login_passwordfile=exclusive&lt;br /&gt;memory_target=52m&lt;br /&gt;&lt;br /&gt;Note: Minimum required parameters.&lt;br /&gt;&lt;br /&gt;C:\&gt;oradim -new -asmsid +ASM -startmode manual&lt;br /&gt;Instance created.&lt;br /&gt;&lt;br /&gt;C:\&gt;oradim -edit -asmsid +ASM -startmode a&lt;br /&gt;&lt;br /&gt;C:\&gt;oradim -edit -asmsid +ASM -syspwd change_on_install&lt;br /&gt;&lt;br /&gt;C:\&gt;set ORACLE_SID=+ASM&lt;br /&gt;&lt;br /&gt;C:\&gt;sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Tue Apr 8 11:22:47 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle. All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup pfile ='c:\init.ora';&lt;br /&gt;ASM instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area 267825152 bytes&lt;br /&gt;Fixed Size 1332584 bytes&lt;br /&gt;Variable Size 241326744 bytes&lt;br /&gt;ASM Cache 25165824 bytes&lt;br /&gt;ORA-15110: no diskgroups mounted&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; create spfile from pfile='c:\init.ora';&lt;br /&gt;&lt;br /&gt;File created.&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown&lt;br /&gt;ORA-15100: invalid or missing diskgroup name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ASM instance shutdown&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ASM instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area 267825152 bytes&lt;br /&gt;Fixed Size 1332584 bytes&lt;br /&gt;Variable Size 241326744 bytes&lt;br /&gt;ASM Cache 25165824 bytes&lt;br /&gt;ORA-15110: no diskgroups mounted&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT group_number, disk_number, mount_status, header_status, state, path FROM v$asm_disk;&lt;br /&gt;GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU STATE PATH&lt;br /&gt;&lt;br /&gt;----------- ----------- ------- ------------ -------- -------------------- 0 1 CLOSED CANDIDATE NORMAL E:\ASMDISKS\DISK2 0 0 CLOSED CANDIDATE NORMAL E:\ASMDISKS\DISK1&lt;br /&gt;&lt;br /&gt;Administratering ASM instance&lt;br /&gt;&lt;br /&gt;http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asminst.htm#CHDGDJDF&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Storage_Management/ASM_10.shtml&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next Part &gt;&gt;&gt; http://dbataj.blogspot.com/2008/04/managing-diskgroups.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Email this • Share on Facebook • Digg This! • Add to del.icio.us • Save to del.icio.us • Subscribe to this feed • Technorati Links • Sphere: Related Content • outside.in: geotag this story • Discuss on Newsvine • Add to Mixx! • Stumble It!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8094594174824664469?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8094594174824664469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8094594174824664469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8094594174824664469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8094594174824664469'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/asm-instance-creation.html' title='ASM Instance Creation'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-3199389586104419657</id><published>2008-06-03T04:37:00.001-07:00</published><updated>2008-06-03T04:37:46.884-07:00</updated><title type='text'>Managing Diskgroups</title><content type='html'>Creating Diskgroup&lt;br /&gt;1. Assign Unqiue name for each diskgroup&lt;br /&gt;2. Specify redundancy level of disk group&lt;br /&gt;There is three type of redundancy level&lt;br /&gt;1. NORMAL redundancy with 2 way mirroring&lt;br /&gt;2. HIGH redundancy with 3 way mirroring&lt;br /&gt;3. EXTERNAL redundancy with NO mirroring.&lt;br /&gt;&lt;br /&gt;3. Specify disks as belonging to specific failgroup.&lt;br /&gt;If we manually not define any failgroup for disk then Oracle automatically create failgroup for each diskgroup.&lt;br /&gt;&lt;br /&gt;4. Specify asm disks (v$asm_disk) for diskgroup.&lt;br /&gt;&lt;br /&gt;5. Optionally specify disk group attributes such as compatibility or allocation unit size.&lt;br /&gt;&lt;br /&gt;Find more http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asmdiskgrps.htm#i1009309&lt;br /&gt;&lt;br /&gt;SQL&gt; conn / as sysasm&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;SQL&gt; startup nomount&lt;br /&gt;ASM instance started&lt;br /&gt;Total System Global Area 267825152 bytes&lt;br /&gt;Fixed Size 1332584 bytes&lt;br /&gt;Variable Size 241326744 bytes&lt;br /&gt;ASM Cache 25165824 bytes&lt;br /&gt;&lt;br /&gt;Create DISKGROUP with NORMAL REDUNDANCY&lt;br /&gt;SQL&gt; CREATE DISKGROUP dgrp1 NORMAL REDUNDANCY &lt;br /&gt;2 FAILGROUP controller1 DISK &lt;br /&gt;3 'e:\asmdisks\disk1' NAME diska1, &lt;br /&gt;4 'e:\asmdisks\disk2' NAME diska2 &lt;br /&gt;5 FAILGROUP controller2 DISK &lt;br /&gt;6 'e:\asmdisks\disk3' NAME diska3;&lt;br /&gt;Diskgroup created.&lt;br /&gt;&lt;br /&gt;SQL&gt; select group_number, &lt;br /&gt;2 name, &lt;br /&gt;3 type, &lt;br /&gt;4 total_mb, &lt;br /&gt;5 free_mb &lt;br /&gt;6 from v$asm_diskgroup;&lt;br /&gt;GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB&lt;br /&gt;------------ ------------------------------ ------ ---------- ------&lt;br /&gt;1 DGRP1 NORMAL 1536 1432&lt;br /&gt;&lt;br /&gt;ADD NEW DISK in exiting DISKGROUP dgrp1&lt;br /&gt;SQL&gt; alter diskgroup dgrp1 add disk 'e:\asmdisks\disk4';&lt;br /&gt;Diskgroup altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select group_number, &lt;br /&gt;2 name, &lt;br /&gt;3 type, &lt;br /&gt;4 total_mb, &lt;br /&gt;5 free_mb &lt;br /&gt;6 from v$asm_diskgroup;&lt;br /&gt;GROUP_NUMBER NAME TYPE TOTAL_MB FREE_MB&lt;br /&gt;------------ ------------------------------ ------ ---------- ------&lt;br /&gt;1 DGRP1 NORMAL 2048 1940&lt;br /&gt;&lt;br /&gt;Managing Capacity in Disk Groups&lt;br /&gt;When ASM provides redundancy, such as when you create a disk group with NORMAL or HIGH redundancy, you must have sufficient capacity in each disk group to manage a re-creation of data that is lost after a failure of one or two failure groups. After one or more disks fail, the process of restoring redundancy for all data requires space from the surviving disks in the disk group. If not enough space remains, then some files might end up with reduced redundancy.&lt;br /&gt;&lt;br /&gt;Find more http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asmdiskgrps.htm#CHDGGGAD&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Negative Values of USABLE_FILE_MB&lt;br /&gt;Due to the relationship between FREE_MB, REQUIRED_MIRROR_FREE_MB, and USABLE_FILE_MB, USABLE_FILE_MB can become negative. Although this is not necessarily a critical situation, it does mean that: &lt;br /&gt;Depending on the value of FREE_MB, you may not be able to create new files.&lt;br /&gt;&lt;br /&gt;The next failure might result in files with reduced redundancy.&lt;br /&gt;&lt;br /&gt;If USABLE_FILE_MB becomes negative, it is strongly recommended that you add more space to the disk group as soon as possible.&lt;br /&gt;&lt;br /&gt;When Should External, Normal, or High Redundancy Be Used?&lt;br /&gt;&lt;br /&gt;ASM mirroring runs on the database server and Oracle recommends to off load this processing to the storage hardware RAID controller by using external redundancy. You can use normal redundancy in the following scenarios:&lt;br /&gt;&lt;br /&gt;Storage system does not have RAID controller&lt;br /&gt;&lt;br /&gt;Mirroring across storage arrays&lt;br /&gt;&lt;br /&gt;Extended cluster configurations&lt;br /&gt;&lt;br /&gt;In general, ASM mirroring is the Oracle alternative to third party logical volume managers. ASM mirroring eliminates the need to deploy additional layers of software complexity in your Oracle database environment.&lt;br /&gt;&lt;br /&gt;Find more http://download.oracle.com/docs/cd/B28359_01/server.111/b31107/asmdiskgrps.htm#CHDHDGDI&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-3199389586104419657?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/3199389586104419657/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=3199389586104419657' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3199389586104419657'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3199389586104419657'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/managing-diskgroups.html' title='Managing Diskgroups'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8041691344818133688</id><published>2008-06-03T04:36:00.000-07:00</published><updated>2008-06-03T04:37:00.928-07:00</updated><title type='text'>Migrating Databases From NON-ASM to ASM</title><content type='html'>1. First need to set below parameter for controlfile,datafile or FRA.&lt;br /&gt;&lt;br /&gt;NOTE: I have two disk group here i am using "DGRP2" disk group.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set control_files='+DGRP2' scope=spfile;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter system set db_create_file_dest='+DGRP2' scope=spfile;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter system set db_recovery_file_dest='+DGRP2' scope=spfile;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Create New controlfile , datafile or spfile in ASM diskgroup.&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;&lt;br /&gt;Database closed.&lt;br /&gt;&lt;br /&gt;Database dismounted.&lt;br /&gt;&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup nomount&lt;br /&gt;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 263639040 bytes&lt;br /&gt;&lt;br /&gt;Fixed Size 1332552 bytes&lt;br /&gt;&lt;br /&gt;Variable Size 218106552 bytes&lt;br /&gt;&lt;br /&gt;Database Buffers 37748736 bytes&lt;br /&gt;&lt;br /&gt;Redo Buffers 6451200 bytes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connect with RMAN session.&lt;br /&gt;&lt;br /&gt;C:\&gt;RMAN target=sys&lt;br /&gt;Recovery Manager: Release 11.1.0.6.0 - Production on Thu Apr 17 10:12:53 2008&lt;br /&gt;Copyright (c) 1982, 2007, Oracle. All rights reserved.&lt;br /&gt;target database Password:connected to target database: TEST (not mounted)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Restore Controlfile.&lt;br /&gt;&lt;br /&gt;RMAN&gt; restore controlfile from 'C:\app\m.try\oradata\test\CONTROL01.ctl';&lt;br /&gt;Starting restore at 17-APR-08using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=151 device type=DISK&lt;br /&gt;channel ORA_DISK_1: copied control file copyoutput file name=+DGRP2/test/controlfile/current.256.652270419Finished restore at 17-APR-08&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; alter database mount;&lt;br /&gt;database mountedreleased channel: ORA_DISK_1&lt;br /&gt;&lt;br /&gt;Take backup of database which we use for ASM diskgroup.&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup as copy database format '+DGRP2';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Starting backup at 17-APR-08allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=151 device type=DISKchannel ORA_DISK_1: starting datafile copyinput datafile file number=00001 name=C:\APP\M.try\ORADATA\TEST\SYSTEM01.DBFoutput file name=+DGRP2/test/datafile/system.257.652270565 tag=TAG20080417T101550 RECID=1 STAMP=652270748channel ORA_DISK_1: datafile copy complete, elapsed time: 00:03:06channel ORA_DISK_1: starting datafile copyinput datafile file number=00002 name=C:\APP\M.try\ORADATA\TEST\SYSAUX01.DBFoutput file name=+DGRP2/test/datafile/sysaux.258.652270761 tag=TAG20080417T101550 RECID=2 STAMP=652270908channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:35channel ORA_DISK_1: starting datafile copyinput datafile file number=00003 name=C:\APP\M.try\ORADATA\TEST\UNDOTBS01.DBFoutput file name=+DGRP2/test/datafile/undotbs1.259.652270927 tag=TAG20080417T101550 RECID=3 STAMP=652270952channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:35channel ORA_DISK_1: starting datafile copycopying current control fileoutput file name=+DGRP2/test/controlfile/backup.260.652270971 tag=TAG20080417T101550 RECID=4 STAMP=652270975channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07channel ORA_DISK_1: starting datafile copyinput datafile file number=00004 name=C:\APP\M.try\ORADATA\TEST\USERS01.DBFoutput file name=+DGRP2/test/datafile/users.261.652270989 tag=TAG20080417T101550 RECID=5 STAMP=652270991channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setincluding current SPFILE in backup setchannel ORA_DISK_1: starting piece 1 at 17-APR-08channel ORA_DISK_1: finished piece 1 at 17-APR-08piece handle=+DGRP2/test/backupset/2008_04_17/nnsnf0_tag20080417t101550_0.262.652271003 tag=TAG20080417T101550 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:02Finished backup at 17-APR-08&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; switch database to copy;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;datafile 1 switched to datafile copy "+DGRP2/test/datafile/system.257.652270565"&lt;br /&gt;datafile 2 switched to datafile copy "+DGRP2/test/datafile/sysaux.258.652270761"&lt;br /&gt;datafile 3 switched to datafile copy "+DGRP2/test/datafile/undotbs1.259.652270927"&lt;br /&gt;datafile 4 switched to datafile copy "+DGRP2/test/datafile/users.261.652270989"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Again connect to sqlplus session and perform incomplete recovery&lt;br /&gt;&lt;br /&gt;C:\&gt;sqlplus sys/oracle as sysdba&lt;br /&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Thu Apr 17 10:26:24 2008&lt;br /&gt;Copyright (c) 1982, 2007, Oracle. All rights reserved.&lt;br /&gt;Connected to:Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database using backup controlfile until cancel;&lt;br /&gt;&lt;br /&gt;ORA-00279: change 1071679 generated at 04/17/2008 10:11:10 needed for thread 1ORA-00289: suggestion : +DGRP2ORA-15173: entry 'ARCHIVELOG' does not exist in directory 'TEST'ORA-00280: change 1071679 for thread 1 is in sequence #14&lt;br /&gt;Specify log: {=suggested filename AUTO CANCEL}&lt;br /&gt;&lt;br /&gt;CANCEL&lt;br /&gt;&lt;br /&gt;Media recovery cancelled.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OPEN database with RESETLOGS option.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Drop old tempfile and create new tempfile in existing temp tablespace&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database tempfile 'c:\app\m.try\oradata\test\temp01.dbf' 2 drop including datafiles;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace temp add tempfile size 512m 2 autoextend on next 250m maxsize unlimited;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select tablespace_name, file_name, bytes from dba_temp_files;&lt;br /&gt;TABLESPACE_NAME FILE_NAME BYTES------------------------------ ------------------------------ ----------TEMP +DGRP2/test/tempfile/temp.266. 536870912 652271571&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Recreate All redolog group on ASM diskgroup&lt;br /&gt;&lt;br /&gt;SQL&gt; select a.group#, a.member, b.bytes &lt;br /&gt;&lt;br /&gt;2 from v$logfile a, v$log b where a.group# = b.group#;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;GROUP# MEMBER BYTES&lt;br /&gt;&lt;br /&gt;---------- ------------------------------------ --------- &lt;br /&gt;&lt;br /&gt;3 C:\APP\M.try\ORADATA\TEST\REDO03.LOG 52428800&lt;br /&gt;2 C:\APP\M.try\ORADATA\TEST\REDO02.LOG 52428800&lt;br /&gt;1 C:\APP\M.try\ORADATA\TEST\REDO01.LOG 52428800&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select group#,status from v$log;&lt;br /&gt;GROUP# STATUS&lt;br /&gt;&lt;br /&gt;---------- ---------------- &lt;br /&gt;&lt;br /&gt;1 CURRENT &lt;br /&gt;&lt;br /&gt;2 UNUSED &lt;br /&gt;&lt;br /&gt;3 UNUSED&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select group#,status from v$log;&lt;br /&gt;GROUP# STATUS&lt;br /&gt;&lt;br /&gt;---------- ---------------- &lt;br /&gt;&lt;br /&gt;1 ACTIVE &lt;br /&gt;&lt;br /&gt;2 ACTIVE &lt;br /&gt;&lt;br /&gt;3 CURRENT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database drop logfile group 1;&lt;br /&gt;&lt;br /&gt;alter database drop logfile group 1*ERROR at line 1:ORA-01624: log 1 needed for crash recovery of instance test (thread 1)ORA-00312: online log 1 thread 1: 'C:\APP\M.try\ORADATA\TEST\REDO01.LOG'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you get above error message then set checkpoint with below command.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system checkpoint global;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter database drop logfile group 1;&lt;br /&gt;Database altered.&lt;br /&gt;SQL&gt; alter database add logfile group 1 size 10m;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system checkpoint global;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter database drop logfile group 2;&lt;br /&gt;Database altered.&lt;br /&gt;SQL&gt; alter database add logfile group 2 size 10m;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system checkpoint global;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter database drop logfile group 3;&lt;br /&gt;Database altered.&lt;br /&gt;SQL&gt; alter database add logfile group 3 size 10m;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; column member format a30&lt;br /&gt;&lt;br /&gt;SQL&gt; select a.group#, a.member, b.bytes &lt;br /&gt;&lt;br /&gt;2 from v$logfile a, v$log b where a.group# = b.group#;&lt;br /&gt;GROUP# MEMBER BYTES&lt;br /&gt;&lt;br /&gt;---------- ------------------------------ ---------- &lt;br /&gt;&lt;br /&gt;3 +DGRP2/test/onlinelog/group_3. 10485760 277.652273117&lt;br /&gt;2 +DGRP2/test/onlinelog/group_2. 10485760 274.652273019&lt;br /&gt;1 +DGRP2/test/onlinelog/group_1. 10485760 271.652272977&lt;br /&gt;1 +DGRP2/test/onlinelog/group_1. 10485760 272.652272979&lt;br /&gt;2 +DGRP2/test/onlinelog/group_2. 10485760 275.652273021&lt;br /&gt;3 +DGRP2/test/onlinelog/group_3. 10485760 278.652273119&lt;br /&gt;6 rows selected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Recreate SPFILE on ASM diskgroup&lt;br /&gt;&lt;br /&gt;SQL&gt; create pfile='c:\initTEST.ora' from spfile;&lt;br /&gt;File created.&lt;br /&gt;SQL&gt; create spfile='+DGRP2/spfileTEST.ora' from pfile='c:\initTEST.ora';&lt;br /&gt;File created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. Detele all backup copy from RMAN&lt;br /&gt;&lt;br /&gt;RMAN&gt; delete noprompt force copy;&lt;br /&gt;&lt;br /&gt;Find more details&lt;br /&gt;&lt;br /&gt;http://www.idevelopment.info/data/Oracle/DBA_tips/Automatic_Storage_Management/ASM_33.shtml#Overview&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8041691344818133688?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8041691344818133688/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8041691344818133688' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8041691344818133688'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8041691344818133688'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/migrating-databases-from-non-asm-to-asm.html' title='Migrating Databases From NON-ASM to ASM'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6418445291894971780</id><published>2008-06-03T04:35:00.000-07:00</published><updated>2008-06-03T04:36:00.894-07:00</updated><title type='text'>DBA Interview Questions</title><content type='html'>“A person who’s responsible to handle and maintain database called DBA”&lt;br /&gt;Means DBA position is very Hard, though, sensitive and confidential.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We can divide Oracle DBA interview in Four Major part.&lt;br /&gt;1. Oracle Database Administration&lt;br /&gt;2. Oracle Database Backup &amp; Recovery Administration&lt;br /&gt;3. Oracle Database Performance Tuning&lt;br /&gt;4. Oracle Database Advanced administration&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Oracle Database Administration&lt;br /&gt;1. How to install Oracle Database Software on Different platforms? &lt;br /&gt;Above point include Oracle Database Server or Client installation on different flavor like LINUX/SORALIS/UNIX/WINDOWS etc. so whenever you are going for interview must go through each installation guide.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. How to Create Database?&lt;br /&gt;There is two option for create DATABASE.&lt;br /&gt;1. DBCA or 2. MANUALLY&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. How to create tablespace? &lt;br /&gt;In above point we can include TABLESPACE type, DATAFILE size or AUTOEXTEND option.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. How to configure Oracle Client to connect to Oracle Server?&lt;br /&gt;In Above point we need to create TNS_ENTRY for database client through NETCA tools.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. Database User Management&lt;br /&gt;In above point we need to do User Creation, Specific permission on database according user needs. User profile creation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6. Database Security&lt;br /&gt;In above point we need to do Database Auditing, User Logon, Logoff information.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Oracle Database Backup &amp; Recovery Administration&lt;br /&gt;1. What is your backup strategy for database backup?&lt;br /&gt;It is depends on many factor.&lt;br /&gt;1. Database size It is in MB, GB or TB&lt;br /&gt;2. Database type It is OLTP or DSS&lt;br /&gt;3. Database availability It is 24x7&lt;br /&gt;So whenever we design backup strategy for database keeps in mind above points. Because Oracle Expert Mr. Tom kyte said “We can FIX everything except BAD DATABASE BACKUP”.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. What is your backup method for database backup?&lt;br /&gt;It is also depend on condition.&lt;br /&gt;1. Backup Type COLD backup or HOT backup&lt;br /&gt;2. Backup Method RMAN or USER MANAGED&lt;br /&gt;3. Backup Interval Every Day, Every Week, Every Month.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Corp. recommended to use RMAN (server managed) backup method for database backup but we can also use USER MANAGED backup if applicable.&lt;br /&gt;NOTE: Always RUN production database in ARCHIVELOG mode.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After set proper backup strategy now practice on database recovery because interviewer must ask question about recovery side.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;“Database Recovery is depend on Database backup”&lt;br /&gt;There are so many or different types of recovery so we can divide recovery area in following.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How many types of recovery we can perform?&lt;br /&gt;1. When datafile is lost&lt;br /&gt;2. when controlfile is lost&lt;br /&gt;3. when online redolog file is lost&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Above three files is most important file for database if we lost them then we needed to perform recovery.&lt;br /&gt;1. We can perform recovery at DATABASE level when complete database is lost.&lt;br /&gt;2. We can perform recovery at TABLESPACE level when tablespace is lost.&lt;br /&gt;3. We can perform recovery at DATAFILE level when datafile is lost.&lt;br /&gt;4. We can perform recovery at DATA BLOCK level when any block is corrupted.&lt;br /&gt;5. We can Multiplex CONTROLFILE or REDOLOG file for protect against LOST. &lt;br /&gt;&lt;br /&gt;And suppose still we lost all controlfile or redolog files then recovery depends on many conditions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NOTE: Before going for interview must go through backup and recovery user guide.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Oracle Database Performance tuning administration&lt;br /&gt;This is third big area where most of DBA questions come.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For database tuning we need years of experience. But we can start with bottom.&lt;br /&gt;1. What is database background process like DBRW, LGWR, CKPT SMON, PMON etc? 2. What is database memory area means SGA or PGA size?&lt;br /&gt;3. What are database activities?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For above question oracle providing same diagnostic tools&lt;br /&gt;1. STATPACK or AWR report&lt;br /&gt;2. Tkprof&lt;br /&gt;3. SQL trace&lt;br /&gt;4. AUTO TRACE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Above are same tool to use find out bottleneck of slow database performance so we must know below things about this tools&lt;br /&gt;1. How to use?&lt;br /&gt;2. How to understand?&lt;br /&gt;3. How to use these tools to solve database performance issue.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Above question is simple but answer is difficult because answer want practical or years of experience in database.&lt;br /&gt;Note: Search on Google or visit OTN site for starting.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Oracle Database advanced administration&lt;br /&gt;Oracle Advanced Features&lt;br /&gt;1. Data Guard&lt;br /&gt;2. RAC system&lt;br /&gt;3. Stream&lt;br /&gt;4. Partitioning&lt;br /&gt;5. ASM&lt;br /&gt;6. Others&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DBA interviewer should ask question above points but it is also depend on DBA position because above points will include in senior level position.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6418445291894971780?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6418445291894971780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6418445291894971780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6418445291894971780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6418445291894971780'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/dba-interview-questions.html' title='DBA Interview Questions'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-817874269464931147</id><published>2008-06-03T04:33:00.000-07:00</published><updated>2008-06-03T04:34:11.782-07:00</updated><title type='text'>History of Oracle Technology Introductions</title><content type='html'>Oracle Database Products &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Oracle Server/ Standard Edition&lt;br /&gt;Version of Oracle server for a small number of users and a smaller database&lt;br /&gt;Oracle Enterprise Edition&lt;br /&gt;Version of Oracle for a large number of users or a large database with advanced features for extensibility, performance, and management&lt;br /&gt;Oracle Personal Edition&lt;br /&gt;Single-user version of Oracle typically used for development of applications for deployment on other Oracle versions&lt;br /&gt;Oracle Lite&lt;br /&gt;Lightweight database engine for mobile computing on notebooks and handheld devices&lt;br /&gt;&lt;br /&gt;History of Oracle Technology Introductions &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1979 &lt;br /&gt;&lt;br /&gt;Oracle Release 2--the first commercially available relational database to use SQL &lt;br /&gt;&lt;br /&gt;1983&lt;br /&gt;&lt;br /&gt;Single code base for Oracle across multiple platforms &lt;br /&gt;&lt;br /&gt;1984 &lt;br /&gt;&lt;br /&gt;Portable toolset &lt;br /&gt;&lt;br /&gt;1986 &lt;br /&gt;&lt;br /&gt;Client/server Oracle relational database &lt;br /&gt;&lt;br /&gt;1987 &lt;br /&gt;&lt;br /&gt;CASE and 4GL toolset &lt;br /&gt;&lt;br /&gt;1988 &lt;br /&gt;&lt;br /&gt;Oracle Financial Applications built on relational database &lt;br /&gt;&lt;br /&gt;1989 &lt;br /&gt;&lt;br /&gt;Oracle6 1991 Oracle Parallel Server on massively parallel platforms &lt;br /&gt;&lt;br /&gt;1993 &lt;br /&gt;&lt;br /&gt;Oracle7 with cost-based optimizer &lt;br /&gt;&lt;br /&gt;1994 &lt;br /&gt;&lt;br /&gt;Oracle Version 7.1 generally available: parallel operations including query, load, and create index &lt;br /&gt;&lt;br /&gt;1996 &lt;br /&gt;&lt;br /&gt;Universal database with extended SQL via cartridges, thin client, and application server &lt;br /&gt;&lt;br /&gt;1997 &lt;br /&gt;&lt;br /&gt;Oracle8 generally available: including object-relational and Very Large Database (VLDB) features &lt;br /&gt;&lt;br /&gt;1999 &lt;br /&gt;&lt;br /&gt;Oracle8i generally available: Java Virtual Machine ( JVM) in the database &lt;br /&gt;&lt;br /&gt;2000 &lt;br /&gt;&lt;br /&gt;Oracle9i Application Server generally available: Oracle tools integrated in middle tier &lt;br /&gt;&lt;br /&gt;2001 &lt;br /&gt;&lt;br /&gt;Oracle9i Database Server generally available: Real Application Clusters, Advanced Analytic Services&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-817874269464931147?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/817874269464931147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=817874269464931147' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/817874269464931147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/817874269464931147'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/history-of-oracle-technology.html' title='History of Oracle Technology Introductions'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-4060620634412565945</id><published>2008-06-03T04:32:00.001-07:00</published><updated>2008-06-03T04:32:55.095-07:00</updated><title type='text'>Tablespace Size</title><content type='html'>SQL&gt; select tablespace_name, 'Mb'||' '||round(sum(bytes/1024/1024)) "Used_Size"&lt;br /&gt;&lt;br /&gt;2 from dba_data_files&lt;br /&gt;3 group by tablespace_name;&lt;br /&gt;&lt;br /&gt;TABLESPACE_NAME Used_Size&lt;br /&gt;------------------------------ -------------------------------------------&lt;br /&gt;DENI Mb 3&lt;br /&gt;EXAMPLE Mb 150&lt;br /&gt;SYSAUX Mb 310&lt;br /&gt;SYSTEM Mb 450&lt;br /&gt;UNDOTBS1 Mb 875&lt;br /&gt;USERS1 Mb 3629&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; select tablespace_name, 'Mb'||' '||round(sum(bytes/1024/1024)) "Free_Size"&lt;br /&gt;&lt;br /&gt;2 from dba_free_space&lt;br /&gt;3 group by tablespace_name;&lt;br /&gt;&lt;br /&gt;TABLESPACE_NAME Free_Size&lt;br /&gt;------------------------------ -------------------------------------------&lt;br /&gt;DENI Mb 3&lt;br /&gt;EXAMPLE Mb 70&lt;br /&gt;SYSAUX Mb 19&lt;br /&gt;SYSTEM Mb 4&lt;br /&gt;UNDOTBS1 Mb 867&lt;br /&gt;USERS1 Mb 1&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-4060620634412565945?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/4060620634412565945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=4060620634412565945' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4060620634412565945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4060620634412565945'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/tablespace-size.html' title='Tablespace Size'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-1336751504456324914</id><published>2008-06-03T04:31:00.001-07:00</published><updated>2008-06-03T04:31:24.759-07:00</updated><title type='text'>utl_file plsql package.</title><content type='html'>Note:&lt;br /&gt;&lt;br /&gt;1.2 use the CREATE DIRECTORY feature instead of UTL_FILE_DIR for directory access verification.&lt;br /&gt;&lt;br /&gt;2.Up to 8i, Oracle refused to access a file that is not pointed to in the utl_file_dir parameter in&lt;br /&gt;the init.ora file.&lt;br /&gt;In Oracle 9i, in order to access a file, either the utl_file_dir parameter must be set, or one has to create a directory.&lt;br /&gt;&lt;br /&gt;3.First Availability&lt;br /&gt;Oracle Version : 7.3.4&lt;br /&gt;&lt;br /&gt;4.The UTL_FILE package is similar to the client-side TEXT_IO package currently provided by Oracle Procedure Builder. Restrictions for a server implementation require some API differences between UTL_FILE and TEXT_IO. In PL/SQL file I/O, errors are returned using PL/SQL exceptions.&lt;br /&gt;&lt;br /&gt;5.Open Mode.&lt;br /&gt;1.A append&lt;br /&gt;2.R read&lt;br /&gt;3.W write&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-1336751504456324914?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/1336751504456324914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=1336751504456324914' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1336751504456324914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1336751504456324914'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/utlfile-plsql-package.html' title='utl_file plsql package.'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8901749290072474744</id><published>2008-06-03T04:30:00.000-07:00</published><updated>2008-06-03T04:31:02.480-07:00</updated><title type='text'>expdp Export Datapump.</title><content type='html'>Note :&lt;br /&gt;1. before export ur database estimate size about export dump file.&lt;br /&gt;used.&lt;br /&gt;&lt;br /&gt;"ESTIMATE_ONLY" = Y parameter.&lt;br /&gt;eg: cmd&gt;expdp system/oracle schemas=HR directory=data nologfile=y estimate_only=y&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8901749290072474744?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8901749290072474744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8901749290072474744' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8901749290072474744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8901749290072474744'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/expdp-export-datapump.html' title='expdp Export Datapump.'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-2774933207715555646</id><published>2008-06-03T04:29:00.000-07:00</published><updated>2008-06-03T04:30:37.646-07:00</updated><title type='text'>dbms_logmnr package</title><content type='html'>Note - &lt;br /&gt;&lt;br /&gt;1.You must have the EXECUTE_CATALOG_ROLE role to use the DBMS_LOGMNR package.&lt;br /&gt;&lt;br /&gt;2.After you have created a dictionary file with DBMS_LOGMNR_D, you can begin analyzing archived redo logs. &lt;br /&gt;&lt;br /&gt;The DBMS_LOGMNR_D package contains the LogMiner procedures, DBMS_LOGMNR_D.BUILD and DBMS_LOGMNR_D.SET_TABLESPACE.The DBMS_LOGMNR_D.BUILD procedure extracts the dictionary to either the redo logs or to a flat file. This information is saved in preparation for future analysis of redo logs using the LogMiner tool. The DBMS_LOGMNR_D.SET_TABLESPACE procedure re-creates all LogMiner tables in an alternate tablespace.&lt;br /&gt;&lt;br /&gt;3.The DBMS_LOGMNR_D.BUILD procedure will not run if there are any ongoing DDL operations. &lt;br /&gt;&lt;br /&gt;4.1When extracting a dictionary to a flat file, the procedure queries the dictionary tables of the current database and creates a text-based file containing the contents of the tables. To extract a dictionary to a flat file, the following conditions must be met: &lt;br /&gt;&lt;br /&gt;1.The dictionary file must be created from the same database that generated the redo logs you want to analyze &lt;br /&gt;&lt;br /&gt;2.You must specify a directory for use by the PL/SQL procedure. To do so, set the initialization parameter UTL_FILE_DIR in the init.ora file. For example: UTL_FILE_DIR = /oracle/dictionary&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you do not set this parameter, the procedure will fail.&lt;br /&gt;You must ensure that no DDL operations occur while the dictionary build is running. Otherwise, the dictionary file may not contain a consistent snapshot of the data dictionary&lt;br /&gt;&lt;br /&gt;4.2To extract a dictionary file to the redo logs, the following conditions must be met: &lt;br /&gt;&lt;br /&gt;1.The DBMS_LOGMNR_D.BUILD procedure must be run on a system that is running Oracle9i or later &lt;br /&gt;&lt;br /&gt;2.Archiving mode must be enabled in order to generate usable redo&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.The dictionary redo files must be created from the same database that generated the redo logs you want to analyze &lt;br /&gt;&lt;br /&gt;Example 1: Extracting the Dictionary to a Flat File&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add supplemental log data;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; execute dbms_logmnr_d.build(options =&gt; dbms_logmnr_d.store_in_redo_logs);&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;yet to be complete.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-2774933207715555646?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/2774933207715555646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=2774933207715555646' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2774933207715555646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2774933207715555646'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/dbmslogmnr-package.html' title='dbms_logmnr package'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8261951615610289639</id><published>2008-06-03T04:28:00.002-07:00</published><updated>2008-06-03T04:29:20.449-07:00</updated><title type='text'>Flashback Oracle10gR1 10.1.0.2.0</title><content type='html'>Using Flashback Drop and Managing the Recycle Bin&lt;br /&gt;A user can view his objects in the recycle bin using the following statement:&lt;br /&gt;SELECT * FROM RECYCLEBIN;&lt;br /&gt;&lt;br /&gt;When you drop a tablespace including its contents, the objects in the tablespace are not placed in the recycle bin and the database purges any entries in the recycle bin for objects located in the tablespace. The database also purges any recycle bin entries for objects in a tablespace when you drop the tablespace, not including contents, and the tablespace is otherwise empty. Likewise:When you drop a user, any objects belonging to the user are not placed in the recycle bin and any objects in the recycle bin are purged.When you drop a cluster, its member tables are not placed in the recycle bin and any former member tables in the recycle bin are purged.When you drop a type, any dependent objects such as subtypes are not placed in the recycle bin and any former dependent objects in the recycle bin are purged.&lt;br /&gt;&lt;br /&gt;When a dropped table is moved to the recycle bin, the table and its associated objects are given system-generated names.&lt;br /&gt;The renaming convention is as follows:BIN$unique_id$version&lt;br /&gt;&lt;br /&gt;where:unique_id is a 26-character globally unique identifier for this object, which makes the recycle bin name unique across all databasesversion is a version number assigned by the database&lt;br /&gt;You can query objects that are in the recycle bin, just as you can query other objects. However, you must specify the name of the object as it is identified in the recycle bin. For example:&lt;br /&gt;&lt;br /&gt;SQL&gt; create table hr ( name varchar2(20));&lt;br /&gt;Table created.&lt;br /&gt;SQL&gt; drop table hr;&lt;br /&gt;Table dropped.&lt;br /&gt;SQL&gt; select * from recyclebin;&lt;br /&gt;OBJECT_NAME ORIGINAL_NAME&lt;br /&gt;OPERATION&lt;br /&gt;------------------------------ -------------------------------- &lt;br /&gt;---------&lt;br /&gt;TYPE TS_NAME CREATETIME&lt;br /&gt;------------------------- ------------------------------ -------------------&lt;br /&gt;DROPTIME DROPSCN PARTITION_NAME CAN CAN&lt;br /&gt;------------------- ---------- -------------------------------- --- --- &lt;br /&gt;RELATED BASE_OBJECT PURGE_OBJECT SPACE&lt;br /&gt;---------- ----------- ------------ ----------&lt;br /&gt;BIN$74ANPU11QhWw15ah+JM2gQ==$0 HR &lt;br /&gt;DROPTABLE USERS 2006-11-16:17:56:252006-11-16:17:56:34 &lt;br /&gt;445402 YES YES &lt;br /&gt;50424 50424 50424 8&lt;br /&gt;&lt;br /&gt;SQL&gt; show recyclebin&lt;br /&gt;ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE&lt;br /&gt;DROP TIME&lt;br /&gt;---------------- ------------------------------ ------------ -------------------&lt;br /&gt;HR BIN$74ANPU11QhWw15ah+JM2gQ==$0 TABLE &lt;br /&gt;2006-11-16:17:56:34&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from "BIN$74ANPU11QhWw15ah+JM2gQ==$0";&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;Restoring Tables from the Recycle Bin&lt;br /&gt;SQL&gt; flashback table hr to before drop rename to scott;&lt;br /&gt;Flashback complete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can directly drop table using "purge" cluase.&lt;br /&gt;if use "purge" clause then object not goes in recyclebin. it will delete parmanently.&lt;br /&gt;&lt;br /&gt;SQL&gt; drop table scott purge;&lt;br /&gt;Table dropped.&lt;br /&gt;&lt;br /&gt;You can also "purge" recyclebin&lt;br /&gt;SQL&gt; show recyclebin;ORIGINAL NAME RECYCLEBIN NAME OBJECT TYPE DROP TIME---------------- ------------------------------ ------------ -------------------&lt;br /&gt;SCOTT BIN$QFb9kDMkRq2RpWJjjW9+ug==$0 TABLE 2006-11-16:18:14:26&lt;br /&gt;SQL&gt; purge recyclebin;&lt;br /&gt;Recyclebin purged.&lt;br /&gt;SQL&gt; show recyclebin;&lt;br /&gt;&lt;br /&gt;****************************************&lt;br /&gt;Oracle Flashback Table: Returning Individual Tables to Past States&lt;br /&gt;&lt;br /&gt;Row movement must be enabled on the table for which you are issuing the FLASHBACK TABLE statement. You can enable row movement with the following SQL statement&lt;br /&gt;SQL&gt; conn hr/hrConnected.&lt;br /&gt;SQL&gt; create table big_table as select * from all_objects;&lt;br /&gt;Table created.&lt;br /&gt;SQL&gt; alter table big_table enable row movement;&lt;br /&gt;Table altered.&lt;br /&gt;SQL&gt; alter session set nls_date_format = 'hh24:mi:ss';&lt;br /&gt;Session altered.&lt;br /&gt;SQL&gt; select sysdate from dual;&lt;br /&gt;SYSDATE&lt;br /&gt;--------&lt;br /&gt;18:43:49&lt;br /&gt;SQL&gt; select count(*) from big_table;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;46335&lt;br /&gt;SQL&gt; delete from big_table where rownum &lt;= 445; 445 rows deleted. SQL&gt; commit;&lt;br /&gt;Commit complete.&lt;br /&gt;SQL&gt; flashback table big_table to TIMESTAMP 2 to_timestamp ( '2006-11-16 18:44:00','YYYY-MM-DD HH24:MI:SS');&lt;br /&gt;Flashback complete.&lt;br /&gt;SQL&gt; select count(*) from big_table;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;46335&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Flashback Query &lt;br /&gt;&lt;br /&gt;you must choose an undo retention interval that is long enough to enable users to construct a snapshot of the database for the oldest version of the database that they are interested in.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; conn sys as sysdba&lt;br /&gt;Enter password:&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; alter system set undo_retention = 3600;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; conn hr/hr&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; alter session set nls_date_format = 'hh24:mi:ss';&lt;br /&gt;Session altered.&lt;br /&gt;SQL&gt; select sysdate from dual;&lt;br /&gt;SYSDATE&lt;br /&gt;--------&lt;br /&gt;19:04:49&lt;br /&gt;SQL&gt; create table hrtest ( no number, name varchar2(20));&lt;br /&gt;Table created.&lt;br /&gt;SQL&gt; begin&lt;br /&gt;2 insert into hrtest values ( 1, 'aaa');&lt;br /&gt;3 insert into hrtest values ( 2, 'bbb');&lt;br /&gt;4 insert into hrtest values ( 3, 'ccc');&lt;br /&gt;5 end;&lt;br /&gt;6 /&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;SQL&gt; commit;&lt;br /&gt;Commit complete.&lt;br /&gt;SQL&gt; select sysdate from dual;&lt;br /&gt;SYSDATE&lt;br /&gt;--------&lt;br /&gt;19:06:23&lt;br /&gt;SQL&gt; delete from hrtest where name = 'ccc';&lt;br /&gt;1 row deleted.&lt;br /&gt;SQL&gt; commit;&lt;br /&gt;Commit complete.&lt;br /&gt;SQL&gt; select * from hrtest;&lt;br /&gt;NO NAME&lt;br /&gt;---------- --------------------&lt;br /&gt;1 aaa&lt;br /&gt;2 bbb&lt;br /&gt;&lt;br /&gt;SQL&gt; edWrote file afiedt.buf&lt;br /&gt;1 select * from hrtest AS OF TIMESTAMP 2 to_timestamp ('2006-11-16 19:06:23','YYYY-MM-DD HH24:MI:SS')&lt;br /&gt;3* where name = 'ccc'&lt;br /&gt;4 /&lt;br /&gt;NO NAME&lt;br /&gt;---------- --------------------&lt;br /&gt;3 ccc&lt;br /&gt;SQL&gt; insert into hrtest 2 ( select * from hrtest AS OF TIMESTAMP 3 to_timestamp ('2006-11-16 19:06:23','YYYY-MM-DD HH24:MI:SS')&lt;br /&gt;4 where name = 'ccc');&lt;br /&gt;1 row created.&lt;br /&gt;SQL&gt; select * from hrtest;&lt;br /&gt;NO NAME&lt;br /&gt;---------- --------------------&lt;br /&gt;1 aaa&lt;br /&gt;2 bbb&lt;br /&gt;3 ccc&lt;br /&gt;&lt;br /&gt;x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x&lt;br /&gt;SQL&gt; create table SCN_TEST (no number, name varchar2(20));&lt;br /&gt;&lt;br /&gt;Table created.&lt;br /&gt;&lt;br /&gt;SQL&gt; insert into scn_test values (1,'a');&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;SQL&gt; insert into scn_test values (2,'b');&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;SQL&gt; insert into scn_test values (3,'c');&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;&lt;br /&gt;SQL&gt; select * from scn_test;&lt;br /&gt;&lt;br /&gt;NO NAME&lt;br /&gt;---------- --------------------&lt;br /&gt;1 a&lt;br /&gt;2 b&lt;br /&gt;3 c&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter undo_retention&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;undo_retention integer 22719&lt;br /&gt;SQL&gt; select dbms_flashback.get_system_change_number from dual;&lt;br /&gt;&lt;br /&gt;GET_SYSTEM_CHANGE_NUMBER&lt;br /&gt;------------------------&lt;br /&gt;15893109&lt;br /&gt;&lt;br /&gt;SQL&gt; delete from scn_test where no = 2;&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;&lt;br /&gt;SQL&gt; select * from scn_test AS OF SCN 15893109 where no = 2;&lt;br /&gt;&lt;br /&gt;NO NAME&lt;br /&gt;---------- --------------------&lt;br /&gt;2 b&lt;br /&gt;&lt;br /&gt;SQL&gt; insert into scn_test ( select * from scn_test AS OF SCN 15893109&lt;br /&gt;2 where no = 2);&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;&lt;br /&gt;SQL&gt; select * from scn_test;&lt;br /&gt;&lt;br /&gt;NO NAME&lt;br /&gt;---------- --------------------&lt;br /&gt;1 a&lt;br /&gt;3 c&lt;br /&gt;2 b&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;************************&lt;br /&gt;&lt;br /&gt;Using Flashback Version Query&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from hrtest;&lt;br /&gt;NO NAME&lt;br /&gt;---------- -------------------- &lt;br /&gt;1 aaa &lt;br /&gt;2 bbb &lt;br /&gt;3 ccc&lt;br /&gt;SQL&gt; begin &lt;br /&gt;2 insert into hrtest values ( 4, 'ddd'); &lt;br /&gt;3 insert into hrtest values ( 5, 'eee'); &lt;br /&gt;4 commit; &lt;br /&gt;5 end; &lt;br /&gt;6 /&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; select sysdate from dual;&lt;br /&gt;SYSDATE&lt;br /&gt;--------&lt;br /&gt;19:35:26&lt;br /&gt;SQL&gt; select sysdate from dual;&lt;br /&gt;SYSDATE&lt;br /&gt;--------&lt;br /&gt;19:38:57&lt;br /&gt;SQL&gt; delete from hrtest where rownum &lt;= 3;&lt;br /&gt;3 rows deleted.&lt;br /&gt;SQL&gt; commit;&lt;br /&gt;Commit complete.&lt;br /&gt;SQL&gt; begin &lt;br /&gt;2 update hrtest set no = 0; &lt;br /&gt;3 commit; &lt;br /&gt;4 end;&lt;br /&gt;5 /&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;SQL&gt; select sysdate from dual;&lt;br /&gt;SYSDATE&lt;br /&gt;--------&lt;br /&gt;19:48:42&lt;br /&gt;SQL&gt; select * from hrtest;&lt;br /&gt;NO NAME&lt;br /&gt;---------- -------------------- &lt;br /&gt;0 ddd &lt;br /&gt;0 eee&lt;br /&gt;SQL&gt; ed&lt;br /&gt;Wrote file afiedt.buf&lt;br /&gt;1 SELECT versions_startscn, versions_starttime,&lt;br /&gt;2 versions_endscn, versions_endtime, &lt;br /&gt;3 versions_xid, versions_operation,&lt;br /&gt;4 hrtest.* &lt;br /&gt;5 FROM hrtest &lt;br /&gt;6 VERSIONS BETWEEN TIMESTAMP &lt;br /&gt;7 TO_TIMESTAMP('2006-11-16 19:35:00', 'YYYY-MM-DD HH24:MI:SS') &lt;br /&gt;8 AND TO_TIMESTAMP('2006-11-16 19:48:00', 'YYYY-MM-DD HH24:MI:SS')&lt;br /&gt;9* WHERE name in ('aaa','bbb','ccc');&lt;br /&gt;&lt;br /&gt;SQL&gt; column versions_starttime format a25&lt;br /&gt;SQL&gt; column versions_endtime format a25&lt;br /&gt;SQL&gt; /&lt;br /&gt;VERSIONS_STARTSCN VERSIONS_STARTTIME &lt;br /&gt;VERSIONS_ENDSCN&lt;br /&gt;----------------- ------------------------- &lt;br /&gt;---------------&lt;br /&gt;VERSIONS_ENDTIME VERSIONS_XID V NO NAME&lt;br /&gt;------------------------- ---------------- - ---------- -------------------- 449718 16-NOV-06 07.39.10 PM &lt;br /&gt;04000E0028000000 D 3 ccc&lt;br /&gt;449718 16-NOV-06 07.39.10 PM &lt;br /&gt;04000E0028000000 D 2 bbb&lt;br /&gt;449718 16-NOV-06 07.39.10 PM &lt;br /&gt;04000E0028000000 D 1 aaa&lt;br /&gt;44971816-NOV-06 07.39.10 PM &lt;br /&gt;1 aaa&lt;br /&gt;&lt;br /&gt;44971816-NOV-06 07.39.10 PM &lt;br /&gt;2 bbb&lt;br /&gt;&lt;br /&gt;44971816-NOV-06 07.39.10 PM&lt;br /&gt;3 ccc&lt;br /&gt;6 rows selected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8261951615610289639?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8261951615610289639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8261951615610289639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8261951615610289639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8261951615610289639'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/flashback-oracle10gr1-101020.html' title='Flashback Oracle10gR1 10.1.0.2.0'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8154578239746373258</id><published>2008-06-03T04:28:00.001-07:00</published><updated>2008-06-03T04:28:35.055-07:00</updated><title type='text'>RMAN-06054: media recovery requesting unknown log: thread x seq xxx lowscn xxxxxx</title><content type='html'>SQL&gt; conn / as sysdba&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode&lt;br /&gt;Archive Mode&lt;br /&gt;Automatic archival Enabled&lt;br /&gt;Archive destination USE_DB_RECOVERY_FILE_DEST&lt;br /&gt;Oldest online log sequence 23&lt;br /&gt;Next log sequence to archive 25&lt;br /&gt;Current log sequence 25&lt;br /&gt;&lt;br /&gt;**********************************************************&lt;br /&gt;SQL&gt; host rman target=sys&lt;br /&gt;Recovery Manager: Release 10.1.0.2.0 - ProductionCopyright (c) 1995, 2004,&lt;br /&gt;Oracle. All rights reserved.&lt;br /&gt;target database&lt;br /&gt;Password:&lt;br /&gt;connected to target database: ORCL (DBID=1134976990)&lt;br /&gt;&lt;br /&gt;RMAN&gt; show all;&lt;br /&gt;using target database controlfile instead of recovery catalog&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 BACKUP TYPE TO BACKUPSET; # 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 ARCHIVELOG DELETION POLICY TO NONE; # default&lt;br /&gt;CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLE\PRODUCT\10.1.0\DB_1\DATABASE\SNCFORCL.ORA'; # default&lt;br /&gt;&lt;br /&gt;****************************&lt;br /&gt;RMAN&gt; configure controlfile autobackup on;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;*************************************&lt;br /&gt;&lt;br /&gt;RMAN&gt; run&lt;br /&gt;2&gt; {&lt;br /&gt;3&gt; allocate channel c1 device type disk;&lt;br /&gt;4&gt; backup database plus archivelog;&lt;br /&gt;5&gt; }&lt;br /&gt;&lt;br /&gt;allocated channel: c1channel c1: sid=200 devtype=DISKStarting backup at 23-NOV-06current log archivedStarting backup at 23-NOV-06current log archivedchannel c1: starting archive log backupsetchannel c1: specifying archive log(s) in backup setinput archive log thread=1 sequence=25 recid=1 stamp=607282901channel c1: starting piece 1 at 23-NOV-06channel c1: finished piece 1 at 23-NOV-06piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2006_11_23\O1_MF_ANNNN_TAG20061123T174141_2PC98Y2P_.BKP comment=NONEchannel c1: backup set complete, elapsed time: 00:00:11&lt;br /&gt;Finished backup at 23-NOV-06Starting backup at 23-NOV-06channel c1: starting full datafile backupsetchannel c1: specifying datafile(s) in backupsetinput datafile fno=00001 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBFinput datafile fno=00003 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSAUX01.DBFinput datafile fno=00005 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\EXAMPLE01.DBFinput datafile fno=00002 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\UNDOTBS01.DBFinput datafile fno=00004 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBFchannel c1: starting piece 1 at 23-NOV-06channel c1: finished piece 1 at 23-NOV-06piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2006_11_23\O1_MF_NNNDF_TAG20061123T174153_2PC992LS_.BKP comment=NONEchannel c1: backup set complete, elapsed time: 00:01:33Finished backup at 23-NOV-06Starting backup at 23-NOV-06current log archivedchannel c1: starting archive log backupsetchannel c1: specifying archive log(s) in backup setinput archive log thread=1 sequence=26 recid=2 stamp=607283007channel c1: starting piece 1 at 23-NOV-06channel c1: finished piece 1 at 23-NOV-06piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2006_11_23\O1_MF_ANNNN_TAG20061123T174328_2PC9D278_.BKP comment=NONEchannel c1: backup set complete, elapsed time: 00:00:02Finished backup at 23-NOV-06Starting Control File and SPFILE Autobackup at 23-NOV-06piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2006_11_23\O1_MF_S_607283011_2PC9D4X7_.BKP comment=NONE&lt;br /&gt;Finished Control File and SPFILE Autobackup at 23-NOV-06released channel: c1&lt;br /&gt;&lt;br /&gt;********************************************************&lt;br /&gt;C:\&gt;del d:\oracle\product\10.1.0\oradata\orcl\*.dbf&lt;br /&gt;C:\&gt;del d:\oracle\product\10.1.0\oradata\orcl\*.ctl&lt;br /&gt;C:\&gt;del d:\oracle\product\10.1.0\oradata\orcl\*.log&lt;br /&gt;&lt;br /&gt;**********************************************************&lt;br /&gt;C:\&gt;sqlplus "sys as sysdba"&lt;br /&gt;SQL*Plus: Release 10.1.0.2.0 - Production on Thu Nov 23 17:47:56 2006Copyright (c) 1982, 2004,&lt;br /&gt;Oracle. All rights reserved.&lt;br /&gt;Enter password:&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 171966464&lt;br /&gt;bytesFixed Size 787988 bytes&lt;br /&gt;Variable Size 145488364 bytes&lt;br /&gt;Database Buffers 25165824 bytes&lt;br /&gt;Redo Buffers 524288 bytes&lt;br /&gt;&lt;br /&gt;ORA-00205: error in identifying controlfile, check alert log for more info&lt;br /&gt;&lt;br /&gt;*************************************&lt;br /&gt;&lt;br /&gt;SQL&gt; host rman target=sys&lt;br /&gt;Recovery Manager: Release 10.1.0.2.0 - ProductionCopyright (c) 1995, 2004,&lt;br /&gt;Oracle. All rights reserved.&lt;br /&gt;target database Password:connected to target database: orcl (not mounted)&lt;br /&gt;&lt;br /&gt;**********************************************&lt;br /&gt;&lt;br /&gt;RMAN&gt; restore controlfile from autobackup;&lt;br /&gt;Starting restore at 23-NOV-06using channel ORA_DISK_1recovery area destination: D:\oracle\product\10.1.0\flash_recovery_areadatabase name (or lock name space) used for search: ORCLchannel ORA_DISK_1: autobackup found in the recovery areachannel ORA_DISK_1: autobackup found: D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2006_11_23\O1_MF_S_607283011_2PC9D4X7_.BKPchannel ORA_DISK_1: controlfile restore from autobackup completeoutput filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL01.CTLoutput filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL02.CTLoutput filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL03.CTLFinished restore at 23-NOV-06&lt;br /&gt;&lt;br /&gt;****************************************&lt;br /&gt;&lt;br /&gt;RMAN&gt; alter database mount;database mountedreleased channel: ORA_DISK_1&lt;br /&gt;&lt;br /&gt;****************************************&lt;br /&gt;&lt;br /&gt;RMAN&gt; run&lt;br /&gt;2&gt; {&lt;br /&gt;3&gt; restore database;&lt;br /&gt;4&gt; recover database;&lt;br /&gt;5&gt; }&lt;br /&gt;&lt;br /&gt;Starting restore at 23-NOV-06Starting implicit crosscheck backup at 23-NOV-06allocated channel: ORA_DISK_1channel ORA_DISK_1: sid=214 devtype=DISKCrosschecked 3 objectsFinished implicit crosscheck backup at 23-NOV-06Starting implicit crosscheck copy at 23-NOV-06using channel ORA_DISK_1Finished implicit crosscheck copy at 23-NOV-06searching for all files in the recovery areacataloging files...cataloging done&lt;br /&gt;&lt;br /&gt;List of Cataloged Files&lt;br /&gt;=======================&lt;br /&gt;File Name: D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\AUTOBACKUP\2006_11_23\O1_MF_S_607283011_2PC9D4X7_.BKPusing channel ORA_DISK_1channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00001 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBFrestoring datafile 00002 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\UNDOTBS01.DBFrestoring datafile 00003 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSAUX01.DBFrestoring datafile 00004 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBFrestoring datafile 00005 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\EXAMPLE01.DBFchannel ORA_DISK_1: restored backup piece 1piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2006_11_23\O1_MF_NNNDF_TAG20061123T174153_2PC992LS_.BKP tag=TAG20061123T174153channel ORA_DISK_1: restore completeFinished restore at 23-NOV-06Starting recover at 23-NOV-06using channel ORA_DISK_1starting media recoveryarchive log thread 1 sequence 26 is already on disk as file D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2006_11_23\O1_MF_1_26_2PC9CZF4_.ARCarchive log filename=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2006_11_23\O1_MF_1_26_2PC9CZF4_.ARC thread=1 sequence=26unable to find archive logarchive log thread=1 sequence=27RMAN-00571: ===========================================================&lt;br /&gt;RMAN-00569:&lt;br /&gt;=============== ERROR MESSAGE STACK FOLLOWS ===============&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-03002: failure of recover command at 11/23/2006 17:53:44RMAN-06054: media recovery requesting unknown log: thread 1 seq 27 lowscn 434810&lt;br /&gt;&lt;br /&gt;**************************************&lt;br /&gt;&lt;br /&gt;Note : RMAN-06054: media recovery requesting unknown log: thread string seq string lowscn string Cause: Media recovery is requesting a log whose existance is not recorded in the recovery catalog or control file.Action: If a copy of the log is available, then add it to the recovery catalog and/or control file via a CATALOG command and then retry the RECOVER command. If not, then a point in time recovery up to the missing log is the only alternative and database can be opened using ALTER DATABASE OPEN RESETLOGS command.&lt;br /&gt;&lt;br /&gt;******************************************************&lt;br /&gt;&lt;br /&gt;RMAN&gt; run&lt;br /&gt;2&gt; {&lt;br /&gt;3&gt; SET UNTIL SEQUENCE 27 THREAD 1;&lt;br /&gt;4&gt; RESTORE DATABASE;&lt;br /&gt;5&gt; RECOVER DATABASE;&lt;br /&gt;6&gt; ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;7&gt; }&lt;br /&gt;&lt;br /&gt;executing command: SET until clauseStarting restore at 23-NOV-06using channel ORA_DISK_1channel ORA_DISK_1: starting datafile backupset restorechannel ORA_DISK_1: specifying datafile(s) to restore from backup setrestoring datafile 00001 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBFrestoring datafile 00002 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\UNDOTBS01.DBFrestoring datafile 00003 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSAUX01.DBFrestoring datafile 00004 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBFrestoring datafile 00005 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\EXAMPLE01.DBFchannel ORA_DISK_1: restored backup piece 1piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\BACKUPSET\2006_11_23\O1_MF_NNNDF_TAG20061123T174153_2PC992LS_.BKP tag=TAG20061123T174153channel ORA_DISK_1: restore completeFinished restore at 23-NOV-06Starting recover at 23-NOV-06using channel ORA_DISK_1starting media recoveryarchive log thread 1 sequence 26 is already on disk as file D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2006_11_23\O1_MF_1_26_2PC9CZF4_.ARCarchive log filename=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2006_11_23\O1_MF_1_26_2PC9CZF4_.ARC thread=1 sequence=26media recovery completeFinished recover at 23-NOV-06database opened&lt;br /&gt;&lt;br /&gt;*************************************&lt;br /&gt;&lt;br /&gt;RMAN&gt; QUIT&lt;br /&gt;&lt;br /&gt;Recovery Manager complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; select status from v$instance;&lt;br /&gt;STATUS&lt;br /&gt;------------&lt;br /&gt;OPEN&lt;br /&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode Archive Mode&lt;br /&gt;Automatic archival EnabledArchive destination USE_DB_RECOVERY_FILE_DEST&lt;br /&gt;Oldest online log sequence 0&lt;br /&gt;Next log sequence to archive 1&lt;br /&gt;Current log sequence 1&lt;br /&gt;&lt;br /&gt;SQL&gt; --take complete consistent bkp of ur database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8154578239746373258?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8154578239746373258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8154578239746373258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8154578239746373258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8154578239746373258'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/rman-06054-media-recovery-requesting.html' title='RMAN-06054: media recovery requesting unknown log: thread x seq xxx lowscn xxxxxx'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5908871383769748467</id><published>2008-06-03T04:26:00.001-07:00</published><updated>2008-06-03T04:26:58.658-07:00</updated><title type='text'>Logical_bkp_EXPORT_linux</title><content type='html'>Oracle Version : 10.1.3.0.0&lt;br /&gt;OS System : Linux Ver 3&lt;br /&gt;-----------------------------&lt;br /&gt;&lt;br /&gt;Export_bkp_scheduling on linux server.&lt;br /&gt;-------------------------------------&lt;br /&gt;shell script for backup.&lt;br /&gt;-----------------------&lt;br /&gt;&lt;br /&gt;oracle@oracle]$vi expbkp.sh &lt;br /&gt;#press i or a ( for insert mode)&lt;br /&gt;&lt;br /&gt;#!/bin/bash&lt;br /&gt;ORACLE_HOME= /db/app/oracle/orahome #put_oracle_home_path&lt;br /&gt;export ORACLE_HOME &lt;br /&gt;export PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;&lt;br /&gt;#for system date with dmp file.&lt;br /&gt;value= ` date '%d%m%y'`&lt;br /&gt;exp userid/pwd file=file_name$value.dmp log=log_name$value.log&lt;br /&gt;&lt;br /&gt;#type shift + zz for file closing.&lt;br /&gt;shift+ZZ&lt;br /&gt;-----------------------------------------&lt;br /&gt;oracle@oracle]$cat expbkp.sh # check expbkp.sh file contents.&lt;br /&gt;--------------------------------------------------------&lt;br /&gt;Schedule ur backup according ur time Eg&gt; every night 10 pm. for scheduling use "CRONTAB" utility.&lt;br /&gt;&lt;br /&gt;-------------------------------------&lt;br /&gt;oracle@oracle]$crontab -e #for create new crontab file.&lt;br /&gt;#press i or a for insert mode&lt;br /&gt;0 20 * * * /db/app/expbkp.sh #give compete path of ur .sh ( bkp script file).&lt;br /&gt;&lt;br /&gt;------------------------------------------&lt;br /&gt;oracle@oracle]$crontab -l ( for check crontab file)&lt;br /&gt;oracle@oracle]$crontab -r ( for delete crontab file entry )&lt;br /&gt;----------------------------------------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5908871383769748467?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5908871383769748467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5908871383769748467' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5908871383769748467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5908871383769748467'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/logicalbkpexportlinux.html' title='Logical_bkp_EXPORT_linux'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-3895224757415766170</id><published>2008-06-03T04:25:00.000-07:00</published><updated>2008-06-03T04:26:01.943-07:00</updated><title type='text'>Change User/Schema Name.</title><content type='html'>Change Oracle Schema Name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; host exp system/oracle owner=scott file=c:\scottschema.dmp log=c:\scott.log&lt;br /&gt;Export: Release 10.1.0.2.0 - Production on Tue Dec 12 09:36:37 2006&lt;br /&gt;Copyright (c) 1982, 2004, Oracle.&lt;br /&gt;All rights reserved.&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -&lt;br /&gt;ProductionWith the Partitioning, OLAP and Data Mining options&lt;br /&gt;Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set&lt;br /&gt;About to export specified users ....&lt;br /&gt;exporting pre-schema procedural objects and actions.&lt;br /&gt;exporting foreign function library names for user SCOTT.&lt;br /&gt;exporting PUBLIC type synonyms.&lt;br /&gt;exporting private type synonyms.&lt;br /&gt;exporting object type definitions for user SCOTT&lt;br /&gt;About to export SCOTT's objects ....&lt;br /&gt;exporting database links.&lt;br /&gt;exporting sequence numbers.&lt;br /&gt;exporting cluster definitions.&lt;br /&gt;about to export SCOTT's tables via Conventional Path .... .&lt;br /&gt;exporting table A 0 rows exported. .&lt;br /&gt;exporting table ABCDEFGHIJKLMNOPQRSTUVWXYZ 0 rows exported. .&lt;br /&gt;exporting table ABCDEFGHIJKLMNOPQRSTUVWXYZ1234 0 rows exported. .&lt;br /&gt;exporting table A_12345678901234567890123456$# 0 rows exported. .&lt;br /&gt;exporting table B 100 rows exported. .&lt;br /&gt;exporting table BIG 46968 rows exported. .&lt;br /&gt;exporting table BIG_TABLE 46967 rows exported. .&lt;br /&gt;exporting table BONUS 0 rows exported. .&lt;br /&gt;exporting table C 1000 rows exported. .&lt;br /&gt;exporting table D 1000 rows exported. .&lt;br /&gt;exporting table DEPT 4 rows exported. .&lt;br /&gt;exporting table E 1000 rows exported. .&lt;br /&gt;exporting table EMP 14 rows exported. .&lt;br /&gt;exporting table FINAL_OUTPUT. .&lt;br /&gt;exporting table Q 10000 rows exported. .&lt;br /&gt;exporting table SALGRADE 5 rows exported. .&lt;br /&gt;exporting table T 1000 rows exported. .&lt;br /&gt;exporting table TEST 7 rows exported.&lt;br /&gt;exporting synonyms.&lt;br /&gt;exporting views.&lt;br /&gt;exporting stored procedures.&lt;br /&gt;exporting operators.&lt;br /&gt;exporting referential integrity constraints.&lt;br /&gt;exporting triggers. exporting indextypes.&lt;br /&gt;exporting bitmap, functional and extensible indexes.&lt;br /&gt;exporting posttables actions.&lt;br /&gt;exporting materialized views.&lt;br /&gt;exporting snapshot logs.&lt;br /&gt;exporting job queues.&lt;br /&gt;exporting refresh groups and children.&lt;br /&gt;exporting dimensions.&lt;br /&gt;exporting post-schema procedural objects and actions.&lt;br /&gt;exporting statistics&lt;br /&gt;Export terminated successfully without warnings.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select user_id,username from user_users;&lt;br /&gt;USER_ID USERNAME&lt;br /&gt;---------- ------------------------------&lt;br /&gt;57 SCOTT&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from session_privs;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;81&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from session_roles;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;6&lt;br /&gt;&lt;br /&gt;SQL&gt; set echo off&lt;br /&gt;SQL&gt; set feedback off&lt;br /&gt;SQL&gt; set heading off&lt;br /&gt;&lt;br /&gt;SQL&gt; spool c:\scottpriv.sql&lt;br /&gt;&lt;br /&gt;SQL&gt; select 'grant '||privilege||' to newscott;' from session_privs;&lt;br /&gt;........&lt;br /&gt;&lt;br /&gt;SQL&gt;spool off&lt;br /&gt;&lt;br /&gt;SQL&gt; spool c:\scottroles.sql&lt;br /&gt;&lt;br /&gt;SQL&gt; select 'grant '||role||' to newscott;' from session_roles;&lt;br /&gt;grant CONNECT to newscott;&lt;br /&gt;grant RESOURCE to newscott;&lt;br /&gt;grant IMP_FULL_DATABASE to newscott;&lt;br /&gt;grant SELECT_CATALOG_ROLE to newscott;&lt;br /&gt;grant HS_ADMIN_ROLE to newscott;&lt;br /&gt;grant EXECUTE_CATALOG_ROLE to newscott;&lt;br /&gt;&lt;br /&gt;SQL&gt; spool off&lt;br /&gt;SQL&gt; set heading on&lt;br /&gt;SQL&gt; set feedback on&lt;br /&gt;SQL&gt; set echo on&lt;br /&gt;&lt;br /&gt;SQL&gt; select default_tablespace from user_users;&lt;br /&gt;DEFAULT_TABLESPACE&lt;br /&gt;------------------------------&lt;br /&gt;TEST&lt;br /&gt;1 row selected.&lt;br /&gt;SQL&gt; conn system/oracleConnected.&lt;br /&gt;&lt;br /&gt;SQL&gt; create user newscott identified by newscott default tablespace test;&lt;br /&gt;User created.&lt;br /&gt;&lt;br /&gt;SQL&gt;@c:\scottpriv.sql &lt;&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;@c:\scottroles.sql &lt;&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; host imp system/oracle fromuser=scott touser=newscott file=c:\scottschema.dmp log=scottimp.log&lt;br /&gt;Import: Release 10.1.0.2.0 - Production on Tue Dec 12 09:54:39 2006Copyright (c) 1982, 2004, Oracle.&lt;br /&gt;All rights reserved.Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - ProductionWith the Partitioning, OLAP and Data Mining optionsExport file created by EXPORT:V10.01.00 via conventional pathimport done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set. importing SCOTT's objects into NEWSCOTT. .&lt;br /&gt;importing table "A" 0 rows imported. . importing table "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 0 rows imported. .&lt;br /&gt;importing table "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234" 0 rows imported&lt;br /&gt;........&lt;br /&gt;&lt;br /&gt;SQL&gt;drop user scott cascade;&lt;br /&gt;&lt;br /&gt;SQL&gt; select username,user_id from user_users;&lt;br /&gt;USERNAME USER_ID&lt;br /&gt;------------------------------ ----------&lt;br /&gt;NEWSCOTT 5&lt;br /&gt;81 row selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from session_privs;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;81&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;SQL&gt; select count(*) from session_roles;&lt;br /&gt;COUNT(*)&lt;br /&gt;----------&lt;br /&gt;6&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/2016638674107330364-3895224757415766170?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/3895224757415766170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=3895224757415766170' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3895224757415766170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3895224757415766170'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/change-userschema-name.html' title='Change User/Schema Name.'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6427169867561089512</id><published>2008-06-03T04:24:00.000-07:00</published><updated>2008-06-03T04:25:26.599-07:00</updated><title type='text'>Duplicating a Database with RMAN</title><content type='html'>Operating Environment Windows XP Prof. SP-2&lt;br /&gt;Oracle Release / Version 10.1.0.2.0 Enterprise Edition &lt;br /&gt;ORACLE_BASE d:\oracle&lt;br /&gt;ORACLE_HOME d:\oracle\product\10.1.0&lt;br /&gt;Target Database SID ORA101&lt;br /&gt;Duplicate Database SID TESTDB &lt;br /&gt;RMAN Catalog Database No recovery catalog. Using control file. &lt;br /&gt;Archive Log Mode Enabled&lt;br /&gt;-----------------------------------------------------------------------------------------------&lt;br /&gt;1.Create password File for duplicate database &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\&gt;orapwd file=d:\oracle\product\10.1.0\db_2\database\pwdtestdb.ora password=oracle entries=5 force=y&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;2.Create Init.ora file for duplicate database. copy init.ora file from target database (ora101) and edit.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; create pfile='d:\oracle\product\10.1.0\db_2\database\initTESTDB.ora' from spfile;&lt;br /&gt;File created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#Minimum Changes in init.ora file&lt;br /&gt;db_file_name_convert = ('d:\oracle\product\10.1.0\oradata\ORA101','d:\oracle\product\10.1.0\oradata\TESTDB')&lt;br /&gt;log_file_name_convert = ('d:\oracle\product\10.1.0\oradata\ORA101','d:\oracle\product\10.1.0\oradata\TESTDB')&lt;br /&gt;background_dump_dest='D:\oracle\product\10.1.0\admin\testdb\bdump'&lt;br /&gt;control_files='D:\oracle\product\10.1.0\oradata\testdb\control01.ctl','D:\oracle\product\10.1.0\oradata\testdb\control02.ctl','D:\oracle\product\10.1.0\oradata\testdb\control03.ctl'&lt;br /&gt;core_dump_dest='D:\oracle\product\10.1.0\admin\testdb\cdump'&lt;br /&gt;db_name='testdb'&lt;br /&gt;dispatchers='(PROTOCOL=TCP)(SERVICE=testdbXDB)'&lt;br /&gt;user_dump_dest='D:\oracle\product\10.1.0\admin\testdb\udump'&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------------------------------------&lt;br /&gt;3.Create / Start the Auxiliary Instance (Duplicate Database)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Create all required directory.&lt;br /&gt;C:\&gt;mkdir d:\oracle\product\10.1.0\admin\TESTDB\bdump&lt;br /&gt;C:\&gt;mkdir d:\oracle\product\10.1.0\admin\TESTDB\cdump&lt;br /&gt;C:\&gt;mkdir d:\oracle\product\10.1.0\admin\TESTDB\udump&lt;br /&gt;C:\&gt;mkdir d:\oracle\product\10.1.0\admin\TESTDB\pfile&lt;br /&gt;C:\&gt;mkdir d:\oracle\product\10.1.0\admin\TESTDB\scripts&lt;br /&gt;C:\&gt;mkdir d:\oracle\product\10.1.0\oradata\TESTDB&lt;br /&gt;&lt;br /&gt;C:\&gt;ORADIM -NEW -SID TESTDB&lt;br /&gt;Instance created.&lt;br /&gt;C:\&gt;set ORACLE_SID=TESTDB&lt;br /&gt;C:\&gt;SQLPLUS "/ AS SYSDBA"&lt;br /&gt;SQL*Plus: Release 10.1.0.2.0 - Production on Mon Dec 25 12:15:14 2006&lt;br /&gt;Copyright (c) 1982, 2004, Oracle. All rights reserved.&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;SQL&gt; create spfile from pfile='d:\oracle\product\10.1.0\db_2\database\initTESTDB.ORA';&lt;br /&gt;File created.&lt;br /&gt;SQL&gt; startup force nomount;&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Total System Global Area 180355072 bytes&lt;br /&gt;Fixed Size 788028 bytes&lt;br /&gt;Variable Size 145488324 bytes&lt;br /&gt;Database Buffers 33554432 bytes&lt;br /&gt;Redo Buffers 524288 bytes&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;4.Mount or Open Target Database.(ora101)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\&gt;sqlplus sys/oracle@ora101 as sysdba&lt;br /&gt;SQL*Plus: Release 10.1.0.2.0 - Production on Mon Dec 25 16:33:33 2006&lt;br /&gt;Copyright (c) 1982, 2004, Oracle. All rights reserved.&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;SQL&gt; select status from v$instance;&lt;br /&gt;STATUS&lt;br /&gt;------------&lt;br /&gt;OPEN&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------&lt;br /&gt;5.Make sure you have valid Target Database backup and Archive redo logs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\&gt;rman target sys@ora101&lt;br /&gt;Recovery Manager: Release 10.1.0.2.0 - Production&lt;br /&gt;Copyright (c) 1995, 2004, Oracle. All rights reserved.&lt;br /&gt;target database Password:connected to target database: ORA101 (DBID=5128390)&lt;br /&gt;RMAN&gt; configure controlfile autobackup on;&lt;br /&gt;using target database controlfile instead of recovery catalog&lt;br /&gt;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;RMAN&gt; run&lt;br /&gt;2&gt; {&lt;br /&gt;3&gt; backup database;&lt;br /&gt;4&gt; backup archivelog all;&lt;br /&gt;5&gt; }&lt;br /&gt;Starting backup at 25-DEC-06&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=131 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: starting full datafile backupset&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;br /&gt;input datafile fno=00001 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\SYSTEM01.DBF&lt;br /&gt;input datafile fno=00003 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\SYSAUX01.DBF&lt;br /&gt;input datafile fno=00005 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\EXAMPLE01.DBF&lt;br /&gt;input datafile fno=00002 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\UNDOTBS01.DBF&lt;br /&gt;input datafile fno=00004 name=D:\ORACLE\PRODUCT\10.1.0\ORADATA\ORA101\USERS01.DBF&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 25-DEC-06&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 25-DEC-06&lt;br /&gt;piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\BACKUPSET\2006_12_25\O1_MF_NNNDF_TAG20061225T164042_2RZKPF0Z_.BKP comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:01:36&lt;br /&gt;Finished backup at 25-DEC-06&lt;br /&gt;Starting backup at 25-DEC-06&lt;br /&gt;current log archived&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: starting archive log backupset&lt;br /&gt;channel ORA_DISK_1: specifying archive log(s) in backup set&lt;br /&gt;input archive log thread=1 sequence=7 recid=1 stamp=610113930&lt;br /&gt;input archive log thread=1 sequence=8 recid=2 stamp=610117104&lt;br /&gt;input archive log thread=1 sequence=9 recid=3 stamp=610120818&lt;br /&gt;input archive log thread=1 sequence=10 recid=4 stamp=610124804&lt;br /&gt;input archive log thread=1 sequence=11 recid=5 stamp=610129547&lt;br /&gt;input archive log thread=1 sequence=12 recid=6 stamp=610130542&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 25-DEC-06&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 25-DEC-06&lt;br /&gt;piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\BACKUPSET\2006_12_25\O1_MF_ANNNN_TAG20061225T164224_2RZKSLN0_.BKP comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:17&lt;br /&gt;Finished backup at 25-DEC-06&lt;br /&gt;Starting Control File and SPFILE Autobackup at 25-DEC-06&lt;br /&gt;piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\AUTOBACKUP\2006_12_25\O1_MF_S_610130562_2RZKT33X_.BKP comment=NONE&lt;br /&gt;Finished Control File and SPFILE Autobackup at 25-DEC-06&lt;br /&gt;RMAN&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;6.Configure TNSNAMES.ORA file for duplicate database. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#TNSNAMES.ORA (ORACLEHOME/NETWORK/ADMIN&lt;br /&gt;TESTDB =&lt;br /&gt;(DESCRIPTION =&lt;br /&gt;(ADDRESS_LIST =&lt;br /&gt;(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.100.64)(PORT = 1521))&lt;br /&gt;)&lt;br /&gt;(CONNECT_DATA =&lt;br /&gt;(SERVICE_NAME = testdb)&lt;br /&gt;)&lt;br /&gt;)&lt;br /&gt;#LISTENER.ORA ( ORACLEHOME/NETWORK/ADMIN&lt;br /&gt;(SID_LIST=&lt;br /&gt;(SID_DESC=&lt;br /&gt;(ORACLE_HOME=d:\oracle\product\10.1.0\db_2)&lt;br /&gt;(SID_NAME=testdb)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;cmd&gt;lsnrctl reload&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------------------------&lt;br /&gt;7.Connect to RMAN. (Duplicate Database with Different directory structure.)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\&gt;rman TARGET=sys/oracle@ora101 AUXILIARY=sys/oracle@testdb&lt;br /&gt;Recovery Manager: Release 10.1.0.2.0 - Production&lt;br /&gt;Copyright (c) 1995, 2004, Oracle. All rights reserved.&lt;br /&gt;connected to target database: ORA101 (DBID=5128390)&lt;br /&gt;connected to auxiliary database: testdb (not mounted)&lt;br /&gt;&lt;br /&gt;RMAN&gt;&lt;br /&gt;run&lt;br /&gt;2&gt; {&lt;br /&gt;3&gt; allocate auxiliary channel c1 device type DISK;&lt;br /&gt;4&gt; allocate auxiliary channel c2 device type DISK;&lt;br /&gt;5&gt; allocate auxiliary channel c3 device type DISK;&lt;br /&gt;6&gt; DUPLICATE target database to TESTDB;&lt;br /&gt;7&gt;&lt;br /&gt;}&lt;br /&gt;allocated channel: c1channel c1: sid=160 devtype=DISK&lt;br /&gt;allocated channel: c2channel c2: sid=159 devtype=DISK&lt;br /&gt;allocated channel: c3channel c3: sid=158 devtype=DISK&lt;br /&gt;Starting Duplicate Db at 25-DEC-06&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;set until scn 380106;&lt;br /&gt;set newname for datafile 1 to&lt;br /&gt;"D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSTEM01.DBF";&lt;br /&gt;set newname for datafile 2 to&lt;br /&gt;"D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\UNDOTBS01.DBF";&lt;br /&gt;set newname for datafile 3 to&lt;br /&gt;"D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSAUX01.DBF";&lt;br /&gt;set newname for datafile 4 to&lt;br /&gt;"D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\USERS01.DBF";&lt;br /&gt;set newname for datafile 5 to "D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\EXAMPLE01.DBF";&lt;br /&gt;restore&lt;br /&gt;check readonly&lt;br /&gt;clone database&lt;br /&gt;;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;executing command: SET until clause&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;Starting restore at 25-DEC-06&lt;br /&gt;channel c1: starting datafile backupset restore&lt;br /&gt;channel c1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSTEM01.DBF&lt;br /&gt;restoring datafile 00002 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\UNDOTBS01.DBF&lt;br /&gt;restoring datafile 00003 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSAUX01.DBF&lt;br /&gt;restoring datafile 00004 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\USERS01.DBF&lt;br /&gt;restoring datafile 00005 to D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\EXAMPLE01.DBF&lt;br /&gt;channel c1: restored backup piece 1&lt;br /&gt;piece handle=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\BACKUPSET\2006_12_25\O1_MF_NNNDF_TAG20061225T164042_2RZKPF0Z_.BKP tag=TAG20061225T164042channel c1: restore complete&lt;br /&gt;Finished restore at 25-DEC-06&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTDB" RESETLOGS ARCHIVELOG&lt;br /&gt;MAXLOGFILES 16&lt;br /&gt;MAXLOGMEMBERS 3&lt;br /&gt;MAXDATAFILES 100&lt;br /&gt;MAXINSTANCES 8&lt;br /&gt;MAXLOGHISTORY 454&lt;br /&gt;LOGFILE&lt;br /&gt;GROUP 1 ( 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\REDO01.LOG' ) SIZE 10 M REUSE,&lt;br /&gt;GROUP 2 ( 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\REDO02.LOG' ) SIZE 10 M REUSE,&lt;br /&gt;GROUP 3 ( 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\REDO03.LOG' ) SIZE 10 M REUSE&lt;br /&gt;DATAFILE&lt;br /&gt;'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSTEM01.DBF'&lt;br /&gt;CHARACTER SET WE8MSWIN1252&lt;br /&gt;&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;switch clone datafile all&lt;br /&gt;;&lt;br /&gt;}executing Memory Script&lt;br /&gt;datafile 2 switched to datafile copy&lt;br /&gt;input datafilecopy recid=1 stamp=610136063 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\UNDOTBS01.DBF&lt;br /&gt;datafile 3 switched to datafile copy&lt;br /&gt;input datafilecopy recid=2 stamp=610136063 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSAUX01.DBF&lt;br /&gt;datafile 4 switched to datafile copy&lt;br /&gt;input datafilecopy recid=3 stamp=610136063 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\USERS01.DBF&lt;br /&gt;datafile 5 switched to datafile copy&lt;br /&gt;input datafilecopy recid=4 stamp=610136064 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\EXAMPLE01.DBF&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;set until scn 380106;&lt;br /&gt;recover&lt;br /&gt;clone database&lt;br /&gt;delete archivelog ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;executing command: SET until clause&lt;br /&gt;Starting recover at 25-DEC-06&lt;br /&gt;starting media recovery&lt;br /&gt;archive log thread 1 sequence 12 is already on disk as file D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\ARCHIVELOG\2006_12_25\O1_MF_1_12_2RZKSFPG_.ARCarchive log thread 1 sequence 13 is already on disk as file D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\ARCHIVELOG\2006_12_25\O1_MF_1_13_2RZPF26C_.ARCarchive log filename=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\ARCHIVELOG\2006_12_25\O1_MF_1_12_2RZKSFPG_.ARC thread=1 sequence=12archive log filename=D:\ORACLE\PRODUCT\10.1.0\FLASH_RECOVERY_AREA\ORA101\ARCHIVELOG\2006_12_25\O1_MF_1_13_2RZPF26C_.ARC thread=1 sequence=13&lt;br /&gt;media recovery complete&lt;br /&gt;Finished recover at 25-DEC-06&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;shutdown clone;&lt;br /&gt;startup clone nomount ;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;database dismounted&lt;br /&gt;Oracle instance shut down&lt;br /&gt;connected to auxiliary database (not started)&lt;br /&gt;Oracle instance started&lt;br /&gt;Total System Global Area 180355072 bytes&lt;br /&gt;Fixed Size 788028 bytes&lt;br /&gt;Variable Size 145488324 bytes&lt;br /&gt;Database Buffers 33554432 bytes&lt;br /&gt;Redo Buffers 524288 bytes&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTDB" RESETLOGS ARCHIVELOG&lt;br /&gt;MAXLOGFILES 16&lt;br /&gt;MAXLOGMEMBERS 3&lt;br /&gt;MAXDATAFILES 100&lt;br /&gt;MAXINSTANCES 8&lt;br /&gt;MAXLOGHISTORY 454&lt;br /&gt;LOGFILE&lt;br /&gt;GROUP 1 ( 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\REDO01.LOG' ) SIZE 10 M REUSE,&lt;br /&gt;GROUP 2 ( 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\REDO02.LOG' ) SIZE 10 M REUSE,&lt;br /&gt;GROUP 3 ( 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\REDO03.LOG' ) SIZE 10 M REUSE&lt;br /&gt;DATAFILE 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSTEM01.DBF'&lt;br /&gt;CHARACTER SET WE8MSWIN1252&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;catalog clone datafilecopy "D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\UNDOTBS01.DBF";&lt;br /&gt;catalog clone datafilecopy "D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSAUX01.DBF";&lt;br /&gt;catalog clone datafilecopy "D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\USERS01.DBF";&lt;br /&gt;catalog clone datafilecopy "D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\EXAMPLE01.DBF";&lt;br /&gt;switch clone datafile all;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\UNDOTBS01.DBF recid=1 stamp=610136100&lt;br /&gt;cataloged datafile copydatafile copy filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSAUX01.DBF recid=2 stamp=610136100&lt;br /&gt;cataloged datafile copydatafile copy filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\USERS01.DBF recid=3 stamp=610136101&lt;br /&gt;cataloged datafile copydatafile copy filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\EXAMPLE01.DBF recid=4 stamp=610136102&lt;br /&gt;datafile 2 switched to datafile copyinput datafilecopy recid=1 stamp=610136100 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\UNDOTBS01.DBFdatafile 3 switched to datafile copyinput datafilecopy recid=2 stamp=610136100 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\SYSAUX01.DBFdatafile 4 switched to datafile copyinput datafilecopy recid=3 stamp=610136101 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\USERS01.DBFdatafile 5 switched to datafile copyinput datafilecopy recid=4 stamp=610136102 filename=D:\ORACLE\PRODUCT\10.1.0\ORADATA\TESTDB\EXAMPLE01.DBF&lt;br /&gt;contents of Memory Script:&lt;br /&gt;{&lt;br /&gt;Alter clone database open resetlogs;&lt;br /&gt;}&lt;br /&gt;executing Memory Script&lt;br /&gt;database opened&lt;br /&gt;Finished Duplicate Db at 25-DEC-06&lt;br /&gt;RMAN&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;8.Create Tempfile for Temporary Tbs. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\&gt;SQLPLUS SYS/ORACLE@TESTDB AS SYSDBA&lt;br /&gt;SQL*Plus: Release 10.1.0.2.0 - Production on Mon Dec 25 18:25:16 2006&lt;br /&gt;Copyright (c) 1982, 2004, Oracle. All rights reserved.&lt;br /&gt;Connected to:Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 -&lt;br /&gt;ProductionWith the Partitioning, OLAP and Data Mining options&lt;br /&gt;SQL&gt; alter tablespace temp add tempfile&lt;br /&gt;2 'd:\oracle\product\10.1.0\oradata\TESTDB\temp01.dbf' size 10m;&lt;br /&gt;Tablespace altered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6427169867561089512?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6427169867561089512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6427169867561089512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6427169867561089512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6427169867561089512'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/duplicating-database-with-rman.html' title='Duplicating a Database with RMAN'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-969670651267808992</id><published>2008-06-03T04:23:00.000-07:00</published><updated>2008-06-03T04:24:32.843-07:00</updated><title type='text'>Copy Table From OneDB to AnotherDB</title><content type='html'>You can use Three Method.&lt;br /&gt;1.Database link&lt;br /&gt;2.Export or Import&lt;br /&gt;3.Copy Command.&lt;br /&gt;&lt;br /&gt;------------------------------------------&lt;br /&gt;1.Database link&lt;br /&gt;sql&gt;conn u1/u1@db2&lt;br /&gt;sql&gt;create table a as select * from all_objects where rownum &lt;= 10; table created. For database link you have "database link" or "create session" privs. sql&gt;conn u1/u1@db1&lt;br /&gt;connected&lt;br /&gt;sql&gt;create database link db2&lt;br /&gt;connect to u1&lt;br /&gt;identified by u1&lt;br /&gt;using 'db2';&lt;br /&gt;database link created&lt;br /&gt;sql&gt;create table t as select * from a@db2;&lt;br /&gt;table created&lt;br /&gt;sql&gt;select count(*) from t;&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;2.Through Export or Import Utilities.&lt;br /&gt;------------------------------------&lt;br /&gt;SQL&gt; conn a1/a1@db1&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; create table d as select * from all_objects where rownum &lt;= 10; Table created. SQL&gt; host exp a1/a1@db1 tables=d file=d:\oracle\d.dmp log=d:\oracle\d.log&lt;br /&gt;Export: Release 10.1.0.2.0 - Production on Sat Dec 23 18:24:52 2006&lt;br /&gt;Copyright (c) 1982, 2004, Oracle. All rights reserved.&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc&lt;br /&gt;tion&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set&lt;br /&gt;About to export specified tables via Conventional Path ...&lt;br /&gt;. . exporting table D 10 rows exported&lt;br /&gt;Export terminated successfully without warnings.&lt;br /&gt;SQL&gt; conn a1/a1@db2&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; host imp a1/a1@db2 fromuser=a1 touser=a1 file=d:\oracle\d.dmp log=d:\oracle&lt;br /&gt;\d.log ignore=y&lt;br /&gt;Import: Release 10.1.0.2.0 - Production on Sat Dec 23 18:25:58 2006&lt;br /&gt;Copyright (c) 1982, 2004, Oracle. All rights reserved.&lt;br /&gt;Connected to: Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Produc&lt;br /&gt;tion&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;Export file created by EXPORT:V10.01.00 via conventional path&lt;br /&gt;import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set&lt;br /&gt;. . importing table "D" 10 rows imported&lt;br /&gt;Import terminated successfully without warnings.&lt;br /&gt;------------------------------------------------------&lt;br /&gt;3.Through Copy Command. &lt;br /&gt;----------------------&lt;br /&gt;SQL&gt; conn a1/a1@db1&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; create table m as select * from all_objects where rownum &lt;= 10; Table created. SQL&gt; con a1/a1@db2&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; copy from a1/a1@db1 to a1/a1@db2 -&lt;br /&gt;&gt; create m -&lt;br /&gt;&gt; using select * from m;&lt;br /&gt;Array fetch/bind size is 15. (arraysize is 15)&lt;br /&gt;Will commit when done. (copycommit is 0)&lt;br /&gt;Maximum long size is 80. (long is 80)&lt;br /&gt;Table M created.&lt;br /&gt;10 rows selected from a1@db1.&lt;br /&gt;10 rows inserted into M.&lt;br /&gt;10 rows committed into M at a1@db2.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-969670651267808992?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/969670651267808992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=969670651267808992' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/969670651267808992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/969670651267808992'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/copy-table-from-onedb-to-anotherdb.html' title='Copy Table From OneDB to AnotherDB'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-3026689422920046773</id><published>2008-06-03T04:20:00.001-07:00</published><updated>2008-06-03T04:20:24.604-07:00</updated><title type='text'>Clone DB on New Host with HotBkp</title><content type='html'>Source Database: Windows XP/Oracle 10gr1&lt;br /&gt;Target Database: Windows 2003/Oracle 10gr1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Source Database:&lt;br /&gt;&lt;br /&gt;1. Take Controlfile Backup&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set tracefile_identifier=my_bkp_control_file;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database backup controlfile to trace;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; --check udump folder ($ORACLE_HOME/admin/udump)&lt;br /&gt;SQL&gt; --filename :: _ora_xxx_my_bkp_control_file.trc&lt;br /&gt;&lt;br /&gt;2. Take datafiles backup&lt;br /&gt;SQL&gt; alter database begin backup;&lt;br /&gt;&lt;br /&gt;SQL&gt; --copy all *.dbf files to BACKUP folder&lt;br /&gt;Note: except TEMP tbs&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database end backup;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;Note: Must Switch logfile after end backup command&lt;br /&gt;&lt;br /&gt;3. Create init.ora from spfile&lt;br /&gt;&lt;br /&gt;SQL&gt; create pfile='c:\tmp\init.ora' from spfile;&lt;br /&gt;&lt;br /&gt;Target Database:&lt;br /&gt;1. Change Below parameters location in init.ora file&lt;br /&gt;bdump,udump,cdump&lt;br /&gt;log_archive_dest_n&lt;br /&gt;control_files&lt;br /&gt;&lt;br /&gt;2. Restore datafile and controlfile and init.ora backup to target database&lt;br /&gt;&lt;br /&gt;3. Set ORACLE_SID=[sid]&lt;br /&gt;C:\&gt;set oracle_sid=orcl&lt;br /&gt;&lt;br /&gt;4. Create Oracle Services through ORADIM utility&lt;br /&gt;C:\&gt;oradim -new -sid orcl -startmode auto&lt;br /&gt;Instance created.&lt;br /&gt;&lt;br /&gt;5. Create Password File&lt;br /&gt;C:\&gt;orapwd file=d:\oracle\product\10.1.0\db_1\database\pwdorcl.ora password=oracle entries=5&lt;br /&gt;&lt;br /&gt;5. startup instance with nomount through init.ora file.&lt;br /&gt;C:\&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.1.0.5.0 - Production on Sun Sep 2 16:35:10 2007&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle. All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn sys as sysdba&lt;br /&gt;Enter password:&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;SQL&gt; startup nomount pfile='d:\orcl\admin\pfile\init.ora';&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 285212672 bytes&lt;br /&gt;Fixed Size 789060 bytes&lt;br /&gt;Variable Size 90437052 bytes&lt;br /&gt;Database Buffers 192937984 bytes&lt;br /&gt;Redo Buffers 1048576 bytes&lt;br /&gt;&lt;br /&gt;6. Create controlfile from trace file&lt;br /&gt;Note: Create Controlfile with RESETLOGS Options&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS ARCHIVELOG&lt;br /&gt;2 MAXLOGFILES 16&lt;br /&gt;3 MAXLOGMEMBERS 3&lt;br /&gt;4 MAXDATAFILES 100&lt;br /&gt;5 MAXINSTANCES 8&lt;br /&gt;6 MAXLOGHISTORY 454&lt;br /&gt;7 LOGFILE&lt;br /&gt;8 GROUP 1 'd:\ORCL\oradata\REDO01.LOG' SIZE 10M,&lt;br /&gt;9 GROUP 2 'd:\ORCL\oradata\REDO02.LOG' SIZE 10M,&lt;br /&gt;10 GROUP 3 'd:\ORCL\oradata\REDO03.LOG' SIZE 10M&lt;br /&gt;11 -- STANDBY LOGFILE&lt;br /&gt;12 DATAFILE&lt;br /&gt;13 'd:\ORCL\oradata\SYSTEM01.DBF',&lt;br /&gt;14 'd:\ORCL\oradata\UNDOTBS01.DBF',&lt;br /&gt;15 'd:\ORCL\oradata\SYSAUX01.DBF',&lt;br /&gt;16 'd:\ORCL\oradata\USERS01.DBF'&lt;br /&gt;17 CHARACTER SET WE8MSWIN1252;&lt;br /&gt;&lt;br /&gt;Control file created.&lt;br /&gt;&lt;br /&gt;7. apply neccessary archivelog file&lt;br /&gt;SQL&gt; recover database using backup controlfile;&lt;br /&gt;ORA-00279: change 529461 generated at 09/03/2007 12:54:37 needed for thread 1&lt;br /&gt;ORA-00289: suggestion : D:\ORCL\ARC\LOG_1_29_632229757.ARC&lt;br /&gt;ORA-00280: change 529461 for thread 1 is in sequence #29&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {=suggested | filename | AUTO | CANCEL}&lt;br /&gt;AUTO&lt;br /&gt;ORA-00279: change 529600 generated at 09/03/2007 12:59:51 needed for thread 1&lt;br /&gt;ORA-00289: suggestion : D:\ORCL\ARC\LOG_1_30_632229757.ARC&lt;br /&gt;ORA-00280: change 529600 for thread 1 is in sequence #30&lt;br /&gt;ORA-00278: log file 'D:\ORCL\ARC\LOG_1_29_632229757.ARC' no longer needed for&lt;br /&gt;this recovery&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ORA-00308: cannot open archived log 'D:\ORCL\ARC\LOG_1_30_632229757.ARC'&lt;br /&gt;ORA-27041: unable to open file&lt;br /&gt;OSD-04002: unable to open file&lt;br /&gt;O/S-Error: (OS 2) The system cannot find the file specified.&lt;br /&gt;&lt;br /&gt;8. Perform Incomplete Recovery with UNTIL CANCEL&lt;br /&gt;SQL&gt; recover database using backup controlfile until cancel;&lt;br /&gt;ORA-00279: change 529600 generated at 09/03/2007 12:59:51 needed for thread 1&lt;br /&gt;ORA-00289: suggestion : D:\ORCL\ARC\LOG_1_30_632229757.ARC&lt;br /&gt;ORA-00280: change 529600 for thread 1 is in sequence #30&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {=suggested | filename | AUTO | CANCEL}&lt;br /&gt;CANCEL&lt;br /&gt;Media recovery cancelled.&lt;br /&gt;&lt;br /&gt;9. Open database with resetlogs&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: All archivelog files needed after database backup for recovery.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-3026689422920046773?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/3026689422920046773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=3026689422920046773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3026689422920046773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3026689422920046773'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/clone-db-on-new-host-with-hotbkp.html' title='Clone DB on New Host with HotBkp'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6725956791629825812</id><published>2008-06-03T04:19:00.002-07:00</published><updated>2008-06-03T04:20:00.849-07:00</updated><title type='text'>remote_login_passwordfile</title><content type='html'>What is "remote_login_passwordfile" parameter and why we use" ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We have two options for Super User "SYS" password authentication &lt;br /&gt;&lt;br /&gt;1. Operating System authentication&lt;br /&gt;2. Password file authentication&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Password file authentication&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When we use password file authentication then we have to create PASSWORD FILE for SYS user.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to create password file ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;commandpromt&gt;orapwd file=$ORACLE_HOME/database/orapwd.ora password=pwd entries=n force=y/n&lt;br /&gt;&lt;br /&gt;Note: &lt;br /&gt;entries=n "maximum number of distinct DBAs and OPERs (opt)"&lt;br /&gt;force=y ""y" if password file already created"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When use "REMOTE_LOGIN_PASSWORDFILE" file parameter&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When we using Password file authentication for "sys" user then we have to use "remote_login_password" parameter.&lt;br /&gt;&lt;br /&gt;There are three value for this parameters&lt;br /&gt;&lt;br /&gt;1. EXCLUSIVE&lt;br /&gt;&lt;br /&gt;This is default value. if parameter set "exclusive" then we can use password file for authentication and connect to remote machine with sys user.Only an EXCLUSIVE file can contain the names of users other than SYS. Using an EXCLUSIVE password file lets you grant SYSDBA and SYSOPER system privileges to individual users and have them connect as themselves.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. NONE&lt;br /&gt;&lt;br /&gt;If this parameter set "NONE" means passwordfile doesn't exists&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. SHARED&lt;br /&gt;&lt;br /&gt;A SHARED password file can be used by multiple databases running on the same server. However, the only user recognized by a SHARED password file is SYS. You cannot add users to a SHARED password file. All users needing SYSDBA or SYSOPER system privileges must connect using the same name, SYS, and password. This option is useful if you have a single DBA administering multiple databases.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: In documentation "remote_login_passwordfile" default value is 'NONE' but when we create database through DBCA then it will take 'EXCLUSIVE' as default value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6725956791629825812?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6725956791629825812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6725956791629825812' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6725956791629825812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6725956791629825812'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/remoteloginpasswordfile.html' title='remote_login_passwordfile'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5996046168434913513</id><published>2008-06-03T04:19:00.001-07:00</published><updated>2008-06-03T04:19:37.261-07:00</updated><title type='text'>Multiple Temporary Tablespaces: Using Tablespace Groups</title><content type='html'>Multiple Temporary Tablespaces: Using Tablespace Groups&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can create a temporary tablespace group that can be specifically assigned to users in the same way that a single temporary tablespace is assigned. A tablespace group can also be specified as the default temporary tablespace for the database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A tablespace group has the following characteristics:&lt;br /&gt;&lt;br /&gt;1. It contains at least one tablespace. There is no explicit limit on the maximum number of tablespaces that are contained in a group.&lt;br /&gt;&lt;br /&gt;2. It shares the namespace of tablespaces, so its name cannot be the same as any tablespace.&lt;br /&gt;&lt;br /&gt;3. You can specify a tablespace group name wherever a tablespace name would appear when you assign a default temporary tablespace for the database or a temporary tablespace for a user.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to create temporary tablespace group&lt;br /&gt;&lt;br /&gt;Note: You do not explicitly create a tablespace group. Rather, it is created implicitly when you assign the first temporary tablespace to the group. The group is deleted when the last temporary tablespace it contains is removed from it.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER TABLESPACE temp TABLESPACE GROUP group1;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE TEMPORARY TABLESPACE temp1&lt;br /&gt;2 TEMPFILE 'c:\oracle\product\10.1.0\oradata\temp02.dbf' size 5m&lt;br /&gt;3 TABLESPACE GROUP group2;&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;SQL&gt; desc dba_tablespace_groups;&lt;br /&gt;Name Null? Type&lt;br /&gt;----------------------------------------- -------- ----------------------------&lt;br /&gt;&lt;br /&gt;GROUP_NAME NOT NULL VARCHAR2(30)&lt;br /&gt;TABLESPACE_NAME NOT NULL VARCHAR2(30)&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from dba_tablespace_groups;&lt;br /&gt;&lt;br /&gt;GROUP_NAME TABLESPACE_NAME&lt;br /&gt;------------------------------ ------------------------------&lt;br /&gt;GROUP1 TEMP&lt;br /&gt;GROUP2 TEMP1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to change TABLESPACE GROUP&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from dba_tablespace_groups;&lt;br /&gt;&lt;br /&gt;GROUP_NAME TABLESPACE_NAME&lt;br /&gt;------------------------------ ------------------------------&lt;br /&gt;GROUP1 TEMP&lt;br /&gt;GROUP2 TEMP1&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER TABLESPACE temp1 TABLESPACE GROUP group1;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from dba_tablespace_groups;&lt;br /&gt;&lt;br /&gt;GROUP_NAME TABLESPACE_NAME&lt;br /&gt;------------------------------ ------------------------------&lt;br /&gt;GROUP1 TEMP&lt;br /&gt;GROUP1 TEMP1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to assign TABLESPACE GROUP to particular user.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select temporary_tablespace&lt;br /&gt;2 from dba_users&lt;br /&gt;3 where username = 'SCOTT';&lt;br /&gt;&lt;br /&gt;TEMPORARY_TABLESPACE&lt;br /&gt;------------------------------&lt;br /&gt;GROUP1&lt;br /&gt;&lt;br /&gt;SQL&gt; alter user scott temporary tablespace group2;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to delete temporary tablespace groups&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from dba_tablespace_groups;&lt;br /&gt;&lt;br /&gt;GROUP_NAME TABLESPACE_NAME&lt;br /&gt;------------------------------ ------------------------------&lt;br /&gt;GROUP1 TEMP&lt;br /&gt;GROUP2 TEMP1&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace temp1 tablespace group '';&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from dba_tablespace_groups;&lt;br /&gt;&lt;br /&gt;GROUP_NAME TABLESPACE_NAME&lt;br /&gt;------------------------------ ------------------------------&lt;br /&gt;GROUP1 TEMP&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to Assigning a Tablespace Group as the Default Temporary Tablespace&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from dba_tablespace_groups;&lt;br /&gt;&lt;br /&gt;GROUP_NAME TABLESPACE_NAME&lt;br /&gt;------------------------------ ------------------------------&lt;br /&gt;GROUP1 TEMP&lt;br /&gt;GROUP1 TEMP1&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database ORCL default temporary tablespace group1;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using a tablespace group, rather than a single temporary tablespace, can alleviate problems caused where one tablespace is inadequate to hold the results of a sort, particularly on a table that has many partitions. A tablespace group enables parallel execution servers in a single parallel operation to use multiple temporary tablespaces.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5996046168434913513?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5996046168434913513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5996046168434913513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5996046168434913513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5996046168434913513'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/multiple-temporary-tablespaces-using.html' title='Multiple Temporary Tablespaces: Using Tablespace Groups'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-710902859321576445</id><published>2008-06-03T04:18:00.004-07:00</published><updated>2008-06-03T04:19:07.870-07:00</updated><title type='text'>Renaming Tablespaces</title><content type='html'>Renaming Tablespaces&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Using the RENAME TO clause of the ALTER TABLESPACE, you can rename a permanent or temporary tablespace.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace users RENAME TO userts;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When you rename a tablespace the database updates all references to the tablespace name in the data dictionary, control file, and (online) datafile headers. The database does not change the tablespace ID so if this tablespace were, for example, the default tablespace for a user, then the renamed tablespace would show as the default tablespace for the user in the DBA_USERS view.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following affect the operation of this statement:&lt;br /&gt;&lt;br /&gt;The COMPATIBLE parameter must be set to 10.0 or higher.&lt;br /&gt;&lt;br /&gt;If the tablespace being renamed is the SYSTEM tablespace or the SYSAUX tablespace, then it will not be renamed and an error is raised.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace system RENAME TO system1;&lt;br /&gt;alter tablespace system RENAME TO system1&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-00712: cannot rename system tablespace&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace sysaux RENAME TO system1;&lt;br /&gt;alter tablespace sysaux RENAME TO system1&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-13502: Cannot rename SYSAUX tablespace&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If any datafile in the tablespace is offline, or if the tablespace is offline, then the tablespace is not renamed and an error is raised.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace userts RENAME TO users;&lt;br /&gt;alter tablespace userts RENAME TO users&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01135: file 4 accessed for DML/query is offline&lt;br /&gt;ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBF'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the tablespace is read only, then datafile headers are not updated. This should not be regarded as corruption; instead, it causes a message to be written to the alert log indicating that datafile headers have not been renamed. The data dictionary and control file are updated.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace userts read only;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace userts RENAME TO users;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;alert_orcl.log&lt;br /&gt;Sat Sep 08 19:52:42 2007&lt;br /&gt;alter tablespace userts RENAME TO users&lt;br /&gt;Tablespace 'USERTS' is renamed to 'USERS'.&lt;br /&gt;Tablespace name change is not propagated to file headers because the tablespace is read only.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the tablespace is the default temporary tablespace, then the corresponding entry in the database properties table is updated and the DATABASE_PROPERTIES view shows the new name.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select property_value&lt;br /&gt;2 from database_properties&lt;br /&gt;3 where property_name like '%TEMP%';&lt;br /&gt;&lt;br /&gt;PROPERTY_VALUE&lt;br /&gt;------------------------------------------------&lt;br /&gt;&lt;br /&gt;TEMP2&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace temp2 rename to temp;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select property_value&lt;br /&gt;2 from database_properties&lt;br /&gt;3 where property_name like '%TEMP%';&lt;br /&gt;&lt;br /&gt;PROPERTY_VALUE&lt;br /&gt;------------------------------------------------&lt;br /&gt;&lt;br /&gt;TEMP&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If a traditional initialization parameter file (PFILE) is being used then a message is written to the alert file stating that the initialization parameter file must be manually changed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; --when we rename undo tablespace and instance is startup with PFILE then&lt;br /&gt;SQL&gt; --rename entry is recorded in alert_sid.log file.&lt;br /&gt;SQL&gt; show parameter spfile&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;spfile string&lt;br /&gt;SQL&gt; --database is startup from pfile&lt;br /&gt;SQL&gt; alter tablespace undotbs1 rename to undotbs;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;Sat Sep 08 20:14:52 2007&lt;br /&gt;Tablespace 'UNDOTBS1' is renamed to 'UNDOTBS'.&lt;br /&gt;PFILE is being used. It must be manually modified to reflect the new tablespace name if the old tablespace name is specified as UNDO_TABLESPACE in the PFILE.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-710902859321576445?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/710902859321576445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=710902859321576445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/710902859321576445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/710902859321576445'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/renaming-tablespaces.html' title='Renaming Tablespaces'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5757376705795739719</id><published>2008-06-03T04:18:00.003-07:00</published><updated>2008-06-03T04:18:44.814-07:00</updated><title type='text'>Dropping a Database</title><content type='html'>Dropping a database involves removing its datafiles, redo log files, control files, and initialization parameter files. The DROP DATABASE statement deletes all control files and all other database files listed in the control file. To use the DROP DATABASE statement successfully, all of the following conditions must apply:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The database must be mounted and closed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select status from v$instance;&lt;br /&gt;&lt;br /&gt;STATUS&lt;br /&gt;------------&lt;br /&gt;MOUNTED&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The database must be mounted as RESTRICTED.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select logins from v$instance;&lt;br /&gt;&lt;br /&gt;LOGINS&lt;br /&gt;----------&lt;br /&gt;RESTRICTED&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The DROP DATABASE statement has no effect on archived log files, nor does it have any effect on copies or backups of the database. It is best to use RMAN to delete such files. If the database is on raw disks, the actual raw disk special files are not deleted.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; drop database;&lt;br /&gt;&lt;br /&gt;Database dropped.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: Manually delete below folder.&lt;br /&gt;1. $ORACLE_BASE/oradata/[sid]&lt;br /&gt;2. $ORACLE_BASE/admin/[sid]&lt;br /&gt;3. $ORACLE_BASE/flash_recovery_area/[sid]&lt;br /&gt;4. If database created through DBCA then you have to also delete ORACLE_SID through DBCA otherwise you will get error message when you create new database with same ORACLE_SID.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5757376705795739719?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5757376705795739719/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5757376705795739719' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5757376705795739719'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5757376705795739719'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/dropping-database.html' title='Dropping a Database'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-1976409546631298137</id><published>2008-06-03T04:18:00.001-07:00</published><updated>2008-06-03T04:18:21.490-07:00</updated><title type='text'>How to Enable ARCHIVELOG mode</title><content type='html'>Benefits of ARCHIVELOG mode.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. We can able to take database backup ONLINE.&lt;br /&gt;2. No Need to Down Oracle DB Server&lt;br /&gt;3. We can better Manage our Backup Policy through RMAN&lt;br /&gt;4. Limited DBA task&lt;br /&gt;5. We can able to RECOVER our database point-in-time&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How can enable ARCHIVELOG MODE in 9iR1.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When we create new database then database is created NOARCHIVELOG mode by default.&lt;br /&gt;&lt;br /&gt;shutdown database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;shutdown immediate;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Edit below parameters in pfile(init.ora) file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. LOG_ARCHIVE_START=TRUE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Create New SPFILE from Modified pfile(init.ora)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; create SPFILE from PFILE;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Startup Database in Mount Mode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Change Database log mode from NOARCHIVELOG to ARCHIVELOG&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database archivelog;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Open DB for normal use&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;check archive log status&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Database log mode Archive Mode&lt;br /&gt;Automatic archival Enabled&lt;br /&gt;Archive destination C:\Oracle\product\RDBMS&lt;br /&gt;Oldest online log sequence 0&lt;br /&gt;Next log sequence to archive 1&lt;br /&gt;Current log sequence 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Default Archivelog destination is :$ORACLE_HOME/rdbms.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How can enable ARCHIVELOG MODE in 10gr1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In 10g Archivelog mode enabling is easy becuase we need to just turn DB log mode and archive log is automatic start.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;shutdown database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;startup database in mount mode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Change DB log mode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database archivelog;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Open DB for normal use&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;check archivelog status&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Default Archive log destination.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. 10g introduce new feature called FRA (flashback recovery area) so all archivelog files created in FRA.&lt;br /&gt;&lt;br /&gt;2. If your not using FRA then all files created in $ORACLE_HOME/database&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We can check database archivelog mode through below query&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; select log_mode from v$database;&lt;br /&gt;or&lt;br /&gt;SQL&gt; archive log list&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-1976409546631298137?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/1976409546631298137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=1976409546631298137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1976409546631298137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1976409546631298137'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/how-to-enable-archivelog-mode.html' title='How to Enable ARCHIVELOG mode'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-3744873476720702129</id><published>2008-06-03T04:17:00.000-07:00</published><updated>2008-06-03T04:18:02.926-07:00</updated><title type='text'>Datafile Recovery</title><content type='html'>Database Oracle 10gr1 &lt;br /&gt;Backup Method "user managed"&lt;br /&gt;Archivelog "ENABLE"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When Any datafile is lost due to media failure then through below procedure we can perform media recovery.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Requirements&lt;br /&gt;Recent Valid Database Backup&lt;br /&gt;All archivelog after backup.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Due to Media failure database goes down and everything stop then after fix media problem and trying to open Oracle Database&lt;br /&gt;&lt;br /&gt;SQL&gt; conn sys as sysdba&lt;br /&gt;Enter password:&lt;br /&gt;Connected.&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown abort; ---Dummy purpose use ABORT option.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;Trying to open database&lt;br /&gt;&lt;br /&gt;SQL&gt; startup&lt;br /&gt;&lt;br /&gt;But suddenly get below errors message.&lt;br /&gt;&lt;br /&gt;ORA-01157: cannot identify/lock data file 4 - see DBWR trace file&lt;br /&gt;ORA-01110: data file 4: 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBF'&lt;br /&gt;&lt;br /&gt;Check v$recover_file for more infomation&lt;br /&gt;&lt;br /&gt;SQL&gt; column error format a25&lt;br /&gt;SQL&gt; /&lt;br /&gt;&lt;br /&gt;FILE# ONLINE ONLINE_ ERROR CHANGE# TIME&lt;br /&gt;---------- ------- ------- ------------------------- ---------- ---------&lt;br /&gt;4 ONLINE ONLINE FILE NOT FOUND 0&lt;br /&gt;&lt;br /&gt;Note: Error column indicate "file not found" means due to media failure we lost our user datafile.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Restore User Datafile from BACKUP LOCATION.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; set autorecovery on&lt;br /&gt;&lt;br /&gt;Note: Oracle Corp. recommended set autorecovery on before perform recovery.&lt;br /&gt;&lt;br /&gt;SQL&gt; recover tablespace users;&lt;br /&gt;ORA-00279: change 1308298 generated at 09/10/2007 11:19:22 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;C:\ORACLE\PRODUCT\10.1.0\DB_1\RDBMS\ARC00140_0632336321.001&lt;br /&gt;ORA-00280: change 1308298 for thread 1 is in sequence #140&lt;br /&gt;[output cut]&lt;br /&gt;Log applied.&lt;br /&gt;Media recovery complete.&lt;br /&gt;&lt;br /&gt;Note: All neccessary ARCHIVELOG files applied automatically and media recovery is complete.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;Now open database for normal use.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-3744873476720702129?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/3744873476720702129/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=3744873476720702129' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3744873476720702129'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3744873476720702129'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/datafile-recovery.html' title='Datafile Recovery'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6796429479202984642</id><published>2008-06-03T04:16:00.004-07:00</published><updated>2008-06-03T04:17:12.360-07:00</updated><title type='text'>Cold Backup with RMAN</title><content type='html'>Database Cold/offline Backup with RMAN&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Database Require in mount mode when cold backup taken through RMAN.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\&gt; set ORACLE_SID=sidname&lt;br /&gt;C:\&gt; rman TARGET=SYS&lt;br /&gt;&lt;br /&gt;RMAN&gt; run&lt;br /&gt;{&lt;br /&gt;#shutdown database and startup with mount mode for backup.&lt;br /&gt;shutdown immediate;&lt;br /&gt;startup mount;&lt;br /&gt;#perform full database backup&lt;br /&gt;backup database;&lt;br /&gt;#open database for normal use&lt;br /&gt;sql 'alter database open';&lt;br /&gt;#backup current controlfile&lt;br /&gt;backup current controlfile;&lt;br /&gt;sql 'alter database backup controlfile to TRACE';&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6796429479202984642?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6796429479202984642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6796429479202984642' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6796429479202984642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6796429479202984642'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/cold-backup-with-rman.html' title='Cold Backup with RMAN'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-256936203153350185</id><published>2008-06-03T04:16:00.003-07:00</published><updated>2008-06-03T04:16:39.713-07:00</updated><title type='text'>All redolog group lost</title><content type='html'>Oracle Database: 10gr1&lt;br /&gt;OS: Windows XP&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Due to media failure if we lost all redolog group then recovery depand on database closed condition&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When database cloase CONSISTENTLY OR CLEANLY&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;&lt;br /&gt;SQL&gt; host del c:\oracle\product\10.1.0\oradata\noorcl\*.log&lt;br /&gt;&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 285212672 bytes&lt;br /&gt;Fixed Size 789060 bytes&lt;br /&gt;Variable Size 90961340 bytes&lt;br /&gt;Database Buffers 192937984 bytes&lt;br /&gt;Redo Buffers 524288 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;&lt;br /&gt;ORA-00313: open failed for members of log group 1 of thread 1&lt;br /&gt;ORA-00312: online log 1 thread 1:&lt;br /&gt;'C:\ORACLE\PRODUCT\10.1.0\ORADATA\NOORCL\REDO01.LOG'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database until cancel;&lt;br /&gt;Media recovery complete.&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;When shutdown close with INCONSISTENT or DIRTY stage&lt;br /&gt;SQL&gt; shutdown abort;&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;all redolog files lost due to media failure.&lt;br /&gt;SQL&gt; host del c:\oracle\product\10.1.0\oradata\noorcl\*.log&lt;br /&gt;&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 285212672 bytes&lt;br /&gt;Fixed Size 789060 bytes&lt;br /&gt;Variable Size 90961340 bytes&lt;br /&gt;Database Buffers 192937984 bytes&lt;br /&gt;Redo Buffers 524288 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;ORA-00313: open failed for members of log group 3 of thread 1&lt;br /&gt;ORA-00312: online log 3 thread 1:&lt;br /&gt;'C:\ORACLE\PRODUCT\10.1.0\ORADATA\NOORCL\REDO03.LOG'&lt;br /&gt;ORA-27041: unable to open file&lt;br /&gt;OSD-04002: unable to open file&lt;br /&gt;O/S-Error: (OS 2) The system cannot find the file specified.&lt;br /&gt;&lt;br /&gt;SQL&gt; --now becuase database close was inconsistent so we have to restore last va&lt;br /&gt;lid backup and open database with resetlogs options.&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;ORA-01109: database not open&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;Restore last valid backup&lt;br /&gt;SQL&gt; host copy c:\backup\noorcl\*.* c:\oracle\product\10.1.0\oradata\noorcl\&lt;br /&gt;c:\backup\noorcl\CONTROL01.CTL&lt;br /&gt;c:\backup\noorcl\CONTROL02.CTL&lt;br /&gt;c:\backup\noorcl\CONTROL03.CTL&lt;br /&gt;c:\backup\noorcl\SYSAUX01.DBF&lt;br /&gt;c:\backup\noorcl\SYSTEM01.DBF&lt;br /&gt;c:\backup\noorcl\TEMP01.DBF&lt;br /&gt;c:\backup\noorcl\UNDOTBS01.DBF&lt;br /&gt;c:\backup\noorcl\USERS01.DBF&lt;br /&gt;8 file(s) copied.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup mount&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 285212672 bytes&lt;br /&gt;Fixed Size 789060 bytes&lt;br /&gt;Variable Size 90961340 bytes&lt;br /&gt;Database Buffers 192937984 bytes&lt;br /&gt;Redo Buffers 524288 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;SQL&gt; recover database until cancel&lt;br /&gt;Media recovery complete.&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-256936203153350185?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/256936203153350185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=256936203153350185' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/256936203153350185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/256936203153350185'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/all-redolog-group-lost.html' title='All redolog group lost'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-9065196522561488276</id><published>2008-06-03T04:16:00.001-07:00</published><updated>2008-06-03T04:16:15.993-07:00</updated><title type='text'>Control file Backup Option</title><content type='html'>Controlfile Backup Option&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;when database running in NO ARCHIVE LOG MODE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Shutdown database with immediate,transactional,normal option.&lt;br /&gt;2. through OS copy command copy controlfiles to backup location&lt;br /&gt;3. startup database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;when database running in ARCHIVELOG MODE&lt;br /&gt;&lt;br /&gt;Text based controlfile backup&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set tracefile_identifier = ctrlbkp;&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database backup controlfile to trace;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;Note &lt;br /&gt;1. Tracefile created with tracefile_identifier name like "ORA_SID_XXX_ctrlbkp.trc".&lt;br /&gt;2. Above created backup controlfile is text file.&lt;br /&gt;&lt;br /&gt;Exact copy or binary controlfile backup&lt;br /&gt;&lt;br /&gt;alter database backup controlfile to 'PATH';&lt;br /&gt;&lt;br /&gt;Note&lt;br /&gt;Above statement created binary format controlfile backup.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-9065196522561488276?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/9065196522561488276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=9065196522561488276' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/9065196522561488276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/9065196522561488276'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/control-file-backup-option.html' title='Control file Backup Option'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8759043905362713423</id><published>2008-06-03T04:15:00.001-07:00</published><updated>2008-06-03T04:15:55.538-07:00</updated><title type='text'>ORA-19809: limit exceeded for recovery files</title><content type='html'>When we are trying to connect to database then getting below error message.&lt;br /&gt;Database 10gr1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; conn system/oracle@orcl&lt;br /&gt;&lt;br /&gt;ORA-00257: archiver error. Connect internal only, until freed. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: When check alert_sid.log file and come to know flash_recovery_area is full.&lt;br /&gt;then increase "db_recovery_file_dest_size" parameter value&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set db_recovery_file_dest_size =6g;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;alter database open&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-16038: log 1 sequence# 20351 cannot be archived&lt;br /&gt;ORA-19809: limit exceeded for recovery files&lt;br /&gt;ORA-00312: online log 1 thread 1: 'D:\ORACLE\PRODUCT\10.1.0\ORADATA\REDO01.LOG'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: After increase "db_recovery_file_dest_size" parameter value getting above error.&lt;br /&gt;&lt;br /&gt;So need to check flash_recovery_area V$recovery_file_dest for how much space needed.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NAME SPACE USED&lt;br /&gt;---------------------------------------- ---------- ----------&lt;br /&gt;D:\oracle\product\10.1.0\Flash_recovery 6144 8603&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: need to increase more 3 gb size in flash_recovery_area.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set db_recovery_file_dest_size = 10g;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8759043905362713423?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8759043905362713423/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8759043905362713423' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8759043905362713423'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8759043905362713423'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/ora-19809-limit-exceeded-for-recovery.html' title='ORA-19809: limit exceeded for recovery files'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5725804131089091895</id><published>2008-06-03T04:14:00.000-07:00</published><updated>2008-06-03T04:15:22.901-07:00</updated><title type='text'>Sending-email-from-an-Oracle-10g-Server</title><content type='html'>When we configure Oracle E-MAIL notification method through OEM then it is not include notification for DB shutdown or startup events. For these two events we have to configure manually.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connect sys as sysdba user and run two scripts for install and configure utl_mail package&lt;br /&gt;&lt;br /&gt;SQL&gt; conn sys@orcl as sysdba&lt;br /&gt;Enter password: ******&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; @c:\oracle\product\10.1.0\db_1\rdbms\admin\utlmail.sql&lt;br /&gt;&lt;br /&gt;Package created.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Synonym created.&lt;br /&gt;&lt;br /&gt;SQL&gt; @c:\oracle\product\10.1.0\db_1\rdbms\admin\prvtmail.plb;&lt;br /&gt;&lt;br /&gt;Package body created.&lt;br /&gt;&lt;br /&gt;No errors.&lt;br /&gt;&lt;br /&gt;Set SMTP_OUT_SERVER parameter for smtp_exchange_server. This parameter is not modifiable means we have to bounce our database to set this parameter&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set smtp_out_server = 'smtp_exchange_server_name' scope=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&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&lt;br /&gt;&lt;br /&gt;Grant EXECUTE privs to user which use utl_mail package.&lt;br /&gt;&lt;br /&gt;SQL&gt; grant execute on utl_mail to scott;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;Create two trigger for startup and shutdown event on database which send us email notification&lt;br /&gt;&lt;br /&gt;SQL&gt; create or replace trigger scott.db_shutdown&lt;br /&gt;2 before shutdown on database&lt;br /&gt;3 begin&lt;br /&gt;4 sys.utl_mail.send (&lt;br /&gt;5 sender =&gt;'try@yahoo.com',&lt;br /&gt;6 recipients =&gt;'star_try@yahoo.com',&lt;br /&gt;7 subject =&gt; 'Oracle Database Server DOWN',&lt;br /&gt;8 message =&gt; 'May be DB Server Down for maintenance’||&lt;br /&gt;‘ but also contact to DBA for further details. ’&lt;br /&gt;9 );&lt;br /&gt;10 end;&lt;br /&gt;11 /&lt;br /&gt;&lt;br /&gt;Trigger created.&lt;br /&gt;&lt;br /&gt;SQL&gt; create or replace trigger scott.db_startup&lt;br /&gt;2 after startup on database&lt;br /&gt;3 begin&lt;br /&gt;4 sys.utl_mail.send (&lt;br /&gt;5 sender =&gt;'try@yahoo.com',&lt;br /&gt;6 recipients =&gt;'star_try@yahoo.com',&lt;br /&gt;7 subject =&gt; 'Oracle Database Server UP',&lt;br /&gt;8 message =&gt; 'DB Server OPEN for normal use.'&lt;br /&gt;9 );&lt;br /&gt;10 end;&lt;br /&gt;11 /&lt;br /&gt;&lt;br /&gt;Trigger created.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5725804131089091895?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5725804131089091895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5725804131089091895' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5725804131089091895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5725804131089091895'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/sending-email-from-oracle-10g-server.html' title='Sending-email-from-an-Oracle-10g-Server'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-4742978522342192457</id><published>2008-06-03T04:13:00.001-07:00</published><updated>2008-06-03T04:13:58.751-07:00</updated><title type='text'>Querying V$ Views to Obtain Backup Information</title><content type='html'>Before making a backup, you must identify all the files in your database and decide what to back up. Several V$ views can provide the necessary information.&lt;br /&gt;&lt;br /&gt;Listing Database Files Before a Backup&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select name from v$datafile&lt;br /&gt;union all&lt;br /&gt;select member from v$logfile&lt;br /&gt;union all&lt;br /&gt;select name from v$controlfile;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Determining Datafile Status for Online Tablespace Backups&lt;br /&gt;&lt;br /&gt;You can check V$BACKUP views to determine datafile is part of backup or not.&lt;br /&gt;it is also usefull when you database startup after instance failure through this view you can know datafile is part of online backup when database is open.&lt;br /&gt;&lt;br /&gt;V$backup view is not useful when current controlfile is created from restored backup or RE-CREATE statment becuase it is not content information about backup datafile.&lt;br /&gt;&lt;br /&gt;Through below query we can know status of datafile backup status&lt;br /&gt;&lt;br /&gt;SELECT t.name AS "TB_NAME", d.file# as "DF#", d.name AS "DF_NAME", b.status&lt;br /&gt;FROM V$DATAFILE d, V$TABLESPACE t, V$BACKUP b&lt;br /&gt;WHERE d.TS#=t.TS#&lt;br /&gt;AND b.FILE#=d.FILE#&lt;br /&gt;AND b.STATUS='ACTIVE'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-4742978522342192457?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/4742978522342192457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=4742978522342192457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4742978522342192457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4742978522342192457'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/querying-v-views-to-obtain-backup.html' title='Querying V$ Views to Obtain Backup Information'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-2871843156061387966</id><published>2008-06-03T04:12:00.000-07:00</published><updated>2008-06-03T04:13:36.927-07:00</updated><title type='text'>Making User-Managed Backups of Online/Offline Tablespaces and Datafiles</title><content type='html'>We can take all or individual datafiles backup when database is open but the procedure is differs depending on whether the online tablespace is READ-WRITE or READ-ONLY mode.&lt;br /&gt;&lt;br /&gt;Note: You should not backup temporary tablespace&lt;br /&gt;&lt;br /&gt;Tablespace is READ-WRITE mode.&lt;br /&gt;we must put tablespace in backup mode when tablespace is read-write mode, online and database is open.&lt;br /&gt;&lt;br /&gt;alter tablespace tablespace_name begin backup;&lt;br /&gt;through OS utility copy datafiles to backup location&lt;br /&gt;alter tablespace tablespace_name end backup;&lt;br /&gt;alter system archive log current;&lt;br /&gt;&lt;br /&gt;For multiple tablespace backup we can use &lt;br /&gt;&lt;br /&gt;alter database begin backup;&lt;br /&gt;through OS utility copy all datafiles to backup location&lt;br /&gt;alter database end backup;&lt;br /&gt;alter system archive log current;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ending a Backup After an Instance Failure or SHUTDOWN ABORT&lt;br /&gt;&lt;br /&gt;During backup period if database instance failure or power failure or shutdown abort command is issue. and when we try to open database after fix mention error then we will get below error message&lt;br /&gt;&lt;br /&gt;ORA-01113: file 1 needs media recovery&lt;br /&gt;ORA-01110: data file 1: 'C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\SYSTEM01.DBF'&lt;br /&gt;&lt;br /&gt;Then first check V$BACKUP views.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$backup;&lt;br /&gt;&lt;br /&gt;FILE# STATUS CHANGE# TIME&lt;br /&gt;---------- ------------------ ---------- ---------&lt;br /&gt;1 ACTIVE 3224323 27-SEP-07&lt;br /&gt;2 ACTIVE 3224323 27-SEP-07&lt;br /&gt;3 ACTIVE 3224323 27-SEP-07&lt;br /&gt;4 ACTIVE 3224323 27-SEP-07&lt;br /&gt;&lt;br /&gt;All datafiles is still in backup mode...oh, so we need to take out all datafiles from backup mode.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database end backup;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$backup;&lt;br /&gt;&lt;br /&gt;FILE# STATUS CHANGE# TIME&lt;br /&gt;---------- ------------------ ---------- ---------&lt;br /&gt;1 NOT ACTIVE 3224323 27-SEP-07&lt;br /&gt;2 NOT ACTIVE 3224323 27-SEP-07&lt;br /&gt;3 NOT ACTIVE 3224323 27-SEP-07&lt;br /&gt;4 NOT ACTIVE 3224323 27-SEP-07&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;&lt;br /&gt;Keep in mind&lt;br /&gt;&lt;br /&gt;1. Do not use ALTER DATABASE END BACKUP if you have restored any of the affected files from a backup.&lt;br /&gt;&lt;br /&gt;2. We can only use "alter database end backup" statement when database is mount mode.&lt;br /&gt;&lt;br /&gt;3. We can also use "RECOVER DATABASE" command instead of "alter database end backup" statement but it is slow process.&lt;br /&gt;&lt;br /&gt;Making User-Managed Backups of Read-Only Tablespaces&lt;br /&gt;&lt;br /&gt;We tablespace is READ-ONLY mode then no need to put tablespace in BACKUP mode. becuase oracle server already prevent to make changes on tablespace.&lt;br /&gt;&lt;br /&gt;Making User-Managed Backups of Offline Tablespaces and Datafiles &lt;br /&gt;We can take all or individual tablespace backup while tablespace is OFFLINE. and all other tablespace is remain available and open for systemwide use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Procedure&lt;br /&gt;&lt;br /&gt;Identify datafiles associate with tablespace&lt;br /&gt;&lt;br /&gt;SQL&gt; select tablespace_name,file_name&lt;br /&gt;2 from dba_data_files&lt;br /&gt;3 where tablespace_name = 'USERS';&lt;br /&gt;&lt;br /&gt;TABLESPACE_NAME FILE_NAME&lt;br /&gt;-------------------- --------------------------------------------------&lt;br /&gt;USERS C:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\USERS01.DBF&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace users offline normal;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; --copy datafiles to backup location&lt;br /&gt;SQL&gt; alter tablespace users online;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system archive log current;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Keep in mind&lt;br /&gt;&lt;br /&gt;1. We can't take system tablespace or any active undo segment tablespace OFFLINE.&lt;br /&gt;2. Assume that a table is in tablespace Primary and its index is in tablespace Index. Taking tablespace Index offline while leaving tablespace Primary online can cause errors when DML is issued against the indexed tables located in Primary. The problem only manifests when the access method chosen by the optimizer needs to access the indexes in the Index tablespace.&lt;br /&gt;3. If you took the tablespace offline using temporary or immediate priority, then you cannot bring the tablespace online unless you perform tablespace recovery.&lt;br /&gt;&lt;br /&gt;Posted by Mohammed Taj at 12:33:00 PM 0 comments   &lt;br /&gt;Labels: User Managed Backup &lt;br /&gt;Making User-Managed Backups of the Whole Database &lt;br /&gt;We can take two types of backup &lt;br /&gt;1. Consistent / coldbackup / offline &lt;br /&gt;2. Inconsistent / hotbackup / online&lt;br /&gt;&lt;br /&gt;How to take consistent backup and what is consistent backup.&lt;br /&gt;&lt;br /&gt;Consistent backup means all datafile , controlfile, redolog file having same SCN number. and consistent must be taken after database shutdown with NORMAL, TRANSACTIONAL, IMMEDIATE options.&lt;br /&gt;&lt;br /&gt;For consistent backup no need to operate database in archivelog mode or we can say if database running in no archivelog mode then we can use COLDBACKUP/CONSISTENT/OFFLINE backup method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Procedure&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. shutdown IMMEDIATE;&lt;br /&gt;2. COPY ALL *.dbf, *.log, *.ctl files&lt;br /&gt;3. COPY spfilesid.ora,initsid.ora files&lt;br /&gt;4. startup &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Inconsistent or hotbackup or online backup&lt;br /&gt;&lt;br /&gt;When database availability require 24x7 so we have to use ONLINE backup method.&lt;br /&gt;and when we take online backup that backup called is inconsistent backup.&lt;br /&gt;for online backup database MUST BE running in archivelog mode.&lt;br /&gt;&lt;br /&gt;Control files play a crucial role in database restore and recovery. For databases running in ARCHIVELOG mode, Oracle Corporation recommends that you back up control files with the ALTER DATABASE BACKUP CONTROLFILE TO 'filename' statement.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Procedure&lt;br /&gt;&lt;br /&gt;Hotbackup on Linux&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-2871843156061387966?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/2871843156061387966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=2871843156061387966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2871843156061387966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2871843156061387966'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/making-user-managed-backups-of.html' title='Making User-Managed Backups of Online/Offline Tablespaces and Datafiles'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5425468015208352118</id><published>2008-06-03T04:11:00.001-07:00</published><updated>2008-06-03T04:11:41.260-07:00</updated><title type='text'>Making User-Managed Backups</title><content type='html'>Making User-Managed Backups of Archived Redo Logs&lt;br /&gt;&lt;br /&gt;To save disk space in our primary location, we may need to backup archived log file to tape drive or alternative disk.&lt;br /&gt;if we have multiple archivelog location then only back up one copy of each log sequence number.&lt;br /&gt;&lt;br /&gt;To back up archived redo logs:&lt;br /&gt;To determine which archived redo log files that the database has generated&lt;br /&gt;&lt;br /&gt;SELECT THREAD#,SEQUENCE#,NAME FROM V$ARCHIVED_LOG;&lt;br /&gt;&lt;br /&gt;NOte: backup up copy of archivelog through OS utility.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Making Logical Backups with Oracle Export Utilities&lt;br /&gt;&lt;br /&gt;Oracle import and export utilities move Oracle data in and out of Oracle databases. Export utilities write exported database objects to operating system files in an Oracle-proprietary format. Import utilities can read the files produced by export utilities and re-create database objects. Logical exports of data can be a useful supplement to physical database backups in some situations, especially in backing up recovery catalog databases.&lt;br /&gt;&lt;br /&gt;There are two sets of Oracle database import and export utilities: Original Import and Export (which were used in previous releases(&lt;= 10g) and Data Pump Import and Export (new for Oracle Database Release 10g). The Data Pump utilities offer better performance and more complete support of features of Oracle Database Release 10g. &lt;br /&gt;&lt;br /&gt;Export&lt;br /&gt;Import&lt;br /&gt;Export Dump Pump&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Making User-Managed Backups of Miscellaneous Oracle Files&lt;br /&gt;&lt;br /&gt;Always back up initialization parameter files, networking and configuration files, and password files. If a media failure destroys these files, then you may have difficulty re-creating your environment. For example, if you back up the database and server parameter file but do not back up the networking files, then you can restore and recover the database but will not be able to authenticate users through Oracle Net until you re-create the networking files.&lt;br /&gt;&lt;br /&gt;INIT PARAMETER FILES&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Keeping Records of Current and Backup Database Files&lt;br /&gt;&lt;br /&gt;One of the most important aspects of user-managed backup and recovery is keeping records of all current database files as well as the backups of these files. For example, you should have records for the location of the following files:&lt;br /&gt;&lt;br /&gt;Datafiles and control files &lt;br /&gt;Online and archived redo logs (note that online logs are never backed up) &lt;br /&gt;Initialization parameter files &lt;br /&gt;Password files &lt;br /&gt;Networking-related files&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Recording the Locations of Datafiles, Control Files, and Online Redo Logs&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select name from v$datafile&lt;br /&gt;union all&lt;br /&gt;select name from v$controlfile&lt;br /&gt;union all&lt;br /&gt;select member from v$logfile;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Recording the Locations of Archived Redo Logs&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT NAME, VALUE&lt;br /&gt;FROM V$PARAMETER&lt;br /&gt;WHERE NAME LIKE 'log_archive_dest_%'&lt;br /&gt;AND VALUE IS NOT NULL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Determine the format for archived logs by running SHOW as follows&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SHOW PARAMETER LOG_ARCHIVE_FORMAT&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5425468015208352118?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5425468015208352118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5425468015208352118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5425468015208352118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5425468015208352118'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/making-user-managed-backups.html' title='Making User-Managed Backups'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-4915068857271195047</id><published>2008-06-03T04:10:00.001-07:00</published><updated>2008-06-03T04:10:45.639-07:00</updated><title type='text'>Autotrace in SQLPLUS</title><content type='html'>What is AUTOTRACE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In SQL*Plus you can automatically get a report on the execution path used by the SQL optimizer and the statement execution statistics. The report is generated after a successful SQL DML statement, such as SELECT, DELETE, UPDATE or INSERT. It is useful for monitoring and tuning the performance of these DML statements.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to configure AUTOTRACE in SQLPLUS for database user&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Change directory path and connect with SYSTEM user to database&lt;br /&gt;C:\&gt;cd c:\oracle\product\10.1.0\db_1\rdbms\admin&lt;br /&gt;&lt;br /&gt;C:\Oracle\product\10.1.0\Db_1\RDBMS\ADMIN&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.0.1.0.1 - Production on Tue Oct 16 17:08:20 2007&lt;br /&gt;&lt;br /&gt;(c) Copyright 2001 Oracle Corporation. All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn system/manager&lt;br /&gt;Connected.&lt;br /&gt;&lt;br /&gt;2. run UTLXPLAN.SQL script for plan table.&lt;br /&gt;SQL&gt; @utlxplan.sql&lt;br /&gt;&lt;br /&gt;3. Create public synonym for plan table or grant all privilege.&lt;br /&gt;SQL&gt; create public synonym plan_table for plan_table;&lt;br /&gt;&lt;br /&gt;SQL&gt; grant all on plan_table to public;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;4. Exit and again change directory path and connect with SYS user to database&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle9i Enterprise Edition Release 9.0.1.1.1 - Production&lt;br /&gt;With the Partitioning option&lt;br /&gt;JServer Release 9.0.1.1.1 - Production&lt;br /&gt;&lt;br /&gt;C:\Oracle\product\10.1.0\Db_1\RDBMS\ADMIN&gt;cd\&lt;br /&gt;&lt;br /&gt;C:\&gt;cd c:\oracle\product\10.1.0\db_1\sqlplus\admin&lt;br /&gt;&lt;br /&gt;C:\Oracle\product\10.1.0\Db_1\sqlplus\admin&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.0.1.0.1 - Production on Tue Oct 16 17:12:07 2007&lt;br /&gt;&lt;br /&gt;(c) Copyright 2001 Oracle Corporation. All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn sys as sysdba&lt;br /&gt;Enter password:&lt;br /&gt;Connected.&lt;br /&gt;&lt;br /&gt;5. run plustrce script and script must be run with SYS user.&lt;br /&gt;SQL&gt; @plustrce&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; drop role plustrace;&lt;br /&gt;&lt;br /&gt;Role dropped.&lt;br /&gt;&lt;br /&gt;SQL&gt; create role plustrace;&lt;br /&gt;&lt;br /&gt;Role created.&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; grant select on v_$sesstat to plustrace;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;SQL&gt; grant select on v_$statname to plustrace;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;SQL&gt; grant select on v_$mystat to plustrace;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;SQL&gt; grant plustrace to dba with admin option;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;SQL&gt; set echo off&lt;br /&gt;&lt;br /&gt;6. Grant plustrace role to public.&lt;br /&gt;SQL&gt; grant plustrace to public;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Configuring the Autotrace Report&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SET AUTOTRACE OFF - No AUTOTRACE report is generated. This is the&lt;br /&gt;default. &lt;br /&gt;SET AUTOTRACE ON EXPLAIN - The AUTOTRACE report shows only the optimizer&lt;br /&gt;execution path. &lt;br /&gt;SET AUTOTRACE ON STATISTICS - The AUTOTRACE report shows only the SQL&lt;br /&gt;statement execution statistics. &lt;br /&gt;SET AUTOTRACE ON - The AUTOTRACE report includes both the&lt;br /&gt;optimizer execution path and the SQL&lt;br /&gt;statement execution statistics. &lt;br /&gt;SET AUTOTRACE TRACEONLY - Like SET AUTOTRACE ON, but suppresses the&lt;br /&gt;printing of the user's query output, if any.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Database Statistics for SQL Statements&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;recursive calls&lt;br /&gt;Number of recursive calls generated at both the user and system level. Oracle maintains tables used for internal processing. When Oracle needs to make a change to these tables, it internally generates an internal SQL statement, which in turn generates a recursive call.&lt;br /&gt;&lt;br /&gt;db block gets&lt;br /&gt;Number of times a CURRENT block was requested.&lt;br /&gt;&lt;br /&gt;consistent gets&lt;br /&gt;Number of times a consistent read was requested for a block.&lt;br /&gt;&lt;br /&gt;physical reads&lt;br /&gt;Total number of data blocks read from disk. This number equals the value of "physical reads direct" plus all reads into buffer cache.&lt;br /&gt;&lt;br /&gt;redo size&lt;br /&gt;Total amount of redo generated in bytes.&lt;br /&gt;&lt;br /&gt;bytes sent via SQL*Net to client&lt;br /&gt;Total number of bytes sent to the client from the foreground processes.&lt;br /&gt;&lt;br /&gt;bytes received via SQL*Net from client&lt;br /&gt;Total number of bytes received from the client over Oracle Net.&lt;br /&gt;&lt;br /&gt;SQL*Net roundtrips to/from client&lt;br /&gt;Total number of Oracle Net messages sent to and received from the client.&lt;br /&gt;&lt;br /&gt;sorts (memory)&lt;br /&gt;Number of sort operations that were performed completely in memory and did not require any disk writes.&lt;br /&gt;&lt;br /&gt;sorts (disk)&lt;br /&gt;Number of sort operations that required at least one disk write.&lt;br /&gt;&lt;br /&gt;rows processed&lt;br /&gt;Number of rows processed during the operation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;EXAMPLE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; set autotrace on&lt;br /&gt;SQL&gt; select * from dept;&lt;br /&gt;&lt;br /&gt;DEPTNO DNAME LOC&lt;br /&gt;---------- -------------- -------------&lt;br /&gt;10 ACCOUNTING NEW YORK&lt;br /&gt;20 RESEARCH DALLAS&lt;br /&gt;30 SALES CHICAGO&lt;br /&gt;40 OPERATIONS BOSTON&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;0 SELECT STATEMENT Optimizer=CHOOSE&lt;br /&gt;1 0 TABLE ACCESS (FULL) OF 'DEPT'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Statistics&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;0 recursive calls&lt;br /&gt;2 db block gets&lt;br /&gt;2 consistent gets&lt;br /&gt;0 physical reads&lt;br /&gt;0 redo size&lt;br /&gt;702 bytes sent via SQL*Net to client&lt;br /&gt;503 bytes received via SQL*Net from client&lt;br /&gt;2 SQL*Net roundtrips to/from client&lt;br /&gt;0 sorts (memory)&lt;br /&gt;0 sorts (disk)&lt;br /&gt;4 rows processed&lt;br /&gt;&lt;br /&gt;SQL&gt; set autotrace traceonly&lt;br /&gt;SQL&gt; select * from dept;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;0 SELECT STATEMENT Optimizer=CHOOSE&lt;br /&gt;1 0 TABLE ACCESS (FULL) OF 'DEPT'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Statistics&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;0 recursive calls&lt;br /&gt;2 db block gets&lt;br /&gt;2 consistent gets&lt;br /&gt;0 physical reads&lt;br /&gt;0 redo size&lt;br /&gt;702 bytes sent via SQL*Net to client&lt;br /&gt;503 bytes received via SQL*Net from client&lt;br /&gt;2 SQL*Net roundtrips to/from client&lt;br /&gt;0 sorts (memory)&lt;br /&gt;0 sorts (disk)&lt;br /&gt;4 rows processed&lt;br /&gt;&lt;br /&gt;SQL&gt; set autotrace trace explain&lt;br /&gt;SQL&gt; select * from dept;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;0 SELECT STATEMENT Optimizer=CHOOSE&lt;br /&gt;1 0 TABLE ACCESS (FULL) OF 'DEPT'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; set autotrace trace statistics&lt;br /&gt;SQL&gt; select * from dept;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Statistics&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;0 recursive calls&lt;br /&gt;2 db block gets&lt;br /&gt;2 consistent gets&lt;br /&gt;0 physical reads&lt;br /&gt;0 redo size&lt;br /&gt;702 bytes sent via SQL*Net to client&lt;br /&gt;503 bytes received via SQL*Net from client&lt;br /&gt;2 SQL*Net roundtrips to/from client&lt;br /&gt;0 sorts (memory)&lt;br /&gt;0 sorts (disk)&lt;br /&gt;4 rows processed&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-4915068857271195047?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/4915068857271195047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=4915068857271195047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4915068857271195047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4915068857271195047'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/autotrace-in-sqlplus.html' title='Autotrace in SQLPLUS'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-4098320797657256200</id><published>2008-06-03T04:09:00.000-07:00</published><updated>2008-06-03T04:10:16.625-07:00</updated><title type='text'>EXECUTION PLAN</title><content type='html'>To run a DML statement, Oracle might need to perform many steps. Each of these steps either retrieves rows of data physically from the database or prepares them in some way for the user issuing the statement. The combination of the steps Oracle uses to run a statement is called an execution plan. An execution plan includes an access method for each table that the statement accesses and an ordering of the tables (the join order). The steps of the execution plan are not performed in the order in which they are numbered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to generate execution plan ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are three ways to view execution plan &lt;br /&gt;&lt;br /&gt;1. Through AUTOTRACE&lt;br /&gt;&lt;br /&gt;SQL&gt; set autotrace trace exp&lt;br /&gt;SQL&gt; select * from emp;&lt;br /&gt;&lt;br /&gt;Execution Plan&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=3 Card=14 Bytes=51&lt;br /&gt;8)&lt;br /&gt;&lt;br /&gt;1 0 TABLE ACCESS (FULL) OF 'EMP' (TABLE) (Cost=3 Card=14 Bytes&lt;br /&gt;=518)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Through DBMS_XPLAN package&lt;br /&gt;&lt;br /&gt;SQL&gt; explain plan for select * from emp;&lt;br /&gt;&lt;br /&gt;Explained.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from table(dbms_xplan.display);&lt;br /&gt;&lt;br /&gt;PLAN_TABLE_OUTPUT&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Plan hash value: 3956160932&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;| 0 | SELECT STATEMENT | | 14 | 518 | 3 (0)| 00:00:01 |&lt;br /&gt;| 1 | TABLE ACCESS FULL| EMP | 14 | 518 | 3 (0)| 00:00:01 |&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;8 rows selected.&lt;br /&gt;&lt;br /&gt;3. Through trace file (trace event 10046,sql_trace=true) and format trace file through TKPROF utility.&lt;br /&gt;&lt;br /&gt;What is 10046 trace events&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;whenever we want to tune any sql statement and want to know about waits and bind variable ...then we can use 10046 trace events. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to use 10046 trace events&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;First define trace identifier for generated trace files so we can easily identify our trace files in UDUMP folder.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set tracefile_identifier='MYSESSION';&lt;br /&gt;&lt;br /&gt;Enable 10046 tracing.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set events '10046 trace name context forever, level 8';&lt;br /&gt;&lt;br /&gt;Now execute SQL Statements...&lt;br /&gt;&lt;br /&gt;select e.empno, e.ename, d.dname, d.deptno&lt;br /&gt;from emp e , dept d&lt;br /&gt;where e.deptno = d.deptno;&lt;br /&gt;&lt;br /&gt;Disable 10046 tracing.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set events '10046 trace name context off';&lt;br /&gt;&lt;br /&gt;Check UDUMP directory for generated trace file.&lt;br /&gt;file name like "XXXX_MYSESSION.TRC"&lt;br /&gt;&lt;br /&gt;C:\Oracle\admin\ora9i\udump&gt;dir *MYSESSION.trc&lt;br /&gt;&lt;br /&gt;Now generated trace file is RAW trace file and very hard to read and understand ...so through TKPROF utility create readable output file for generated trace file.&lt;br /&gt;&lt;br /&gt;C:\Oracle\admin\ora9i\udump&gt;tkprof ORA01904_MYSESSION.TRC c:\output.log&lt;br /&gt;&lt;br /&gt;TKPROF: Release 10.1.0.5.0 - Production on Wed Oct 17 19:01:44 2007&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle. All rights reserved.&lt;br /&gt;&lt;br /&gt;Open c:\output.log file and analyze it. below is content of output.log file&lt;br /&gt;&lt;br /&gt;select e.empno, e.ename, d.dname, d.deptno&lt;br /&gt;from emp e , dept d&lt;br /&gt;where e.deptno = d.deptno&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;call count cpu elapsed disk query current rows&lt;br /&gt;------- ------ -------- ---------- ---------- ---------- ---------- ----------&lt;br /&gt;Parse 1 0.29 0.31 2 0 2 0&lt;br /&gt;Execute 1 0.00 0.00 0 0 0 0&lt;br /&gt;Fetch 2 0.00 0.00 3 30 2 14&lt;br /&gt;------- ------ -------- ---------- ---------- ---------- ---------- ----------&lt;br /&gt;total 4 0.29 0.31 5 30 4 14&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Misses in library cache during parse: 1&lt;br /&gt;Optimizer mode: CHOOSE&lt;br /&gt;Parsing user id: 66 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---Below is execution plan&lt;br /&gt;&lt;br /&gt;Rows Row Source Operation&lt;br /&gt;------- ---------------------------------------------------&lt;br /&gt;14 NESTED LOOPS &lt;br /&gt;14 TABLE ACCESS FULL EMP &lt;br /&gt;14 TABLE ACCESS BY INDEX ROWID DEPT &lt;br /&gt;14 INDEX UNIQUE SCAN (object id 32119)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---Waits time information.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Elapsed times include waiting on following events:&lt;br /&gt;Event waited on Times Max. Wait Total Waited&lt;br /&gt;---------------------------------------- Waited ---------- ------------&lt;br /&gt;SQL*Net message to client 2 0.00 0.00&lt;br /&gt;db file sequential read 3 0.00 0.00&lt;br /&gt;SQL*Net message from client 2 56.49 56.51&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;10046 Trace Level&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Level 1 &lt;br /&gt;Basic trace level. Like the standard SQL_TRACE trace file. Provides statistics for parse, execute, fetch, commit and rollback database calls. &lt;br /&gt;&lt;br /&gt;Level 4 &lt;br /&gt;Displays bind variables &lt;br /&gt;&lt;br /&gt;Level 8 &lt;br /&gt;Displays wait statistics &lt;br /&gt;&lt;br /&gt;Level 12 &lt;br /&gt;Displays wait statistics and bind variables&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-4098320797657256200?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/4098320797657256200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=4098320797657256200' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4098320797657256200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/4098320797657256200'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/execution-plan.html' title='EXECUTION PLAN'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8573053364471728751</id><published>2008-06-03T04:08:00.000-07:00</published><updated>2008-06-03T04:09:03.865-07:00</updated><title type='text'>Interpreting Your Statspack Report</title><content type='html'>The Statspack Header&lt;br /&gt;The beginning of the statspack report shows you some basic information about your instance including the database name, instance name, DB ID, version, host and the start and end times of the snapshots used in your report. Here is an example:&lt;br /&gt;&lt;br /&gt;STATSPACK report for&lt;br /&gt;&lt;br /&gt;DB Name         DB Id    Instance     Inst Num Release     Cluster Host&lt;br /&gt;------------ ----------- ------------ -------- ----------- ------- ------------&lt;br /&gt;ORCL          2586436430 ORCL                1 9.2.0.4.0   NO      localhost&lt;br /&gt;&lt;br /&gt;      Snap Id     Snap Time      Sessions Curs/Sess Comment&lt;br /&gt;      ------- ------------------ -------- --------- -------------------&lt;br /&gt;Begin Snap:    4873 13-Dec-05 05:00:05      110      37.4&lt;br /&gt;  End Snap:    4875 13-Dec-05 07:00:04      651     203.7&lt;br /&gt;   Elapsed:              119.98 (mins)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cache Sizes&lt;br /&gt;The next section, Cache Sizes, shows you some of your instance settings including: Buffer Cache (DB_CACHE_SIZE), Standard Block Size (DB_BLOCK_SIZE), Shared Pool Size (SHARED_POOL_SIZE), and Log Buffer (LOG_BUFFER). These are all instance parameters which you can modify in your spfile/pfile. :&lt;br /&gt;&lt;br /&gt;Cache Sizes (end)&lt;br /&gt;~~~~~~~~~~~~~~~~~&lt;br /&gt;               Buffer Cache:     3,008M      Std Block Size:         8K&lt;br /&gt;           Shared Pool Size:     1,920M          Log Buffer:    10,240K&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Load Profile&lt;br /&gt;The "Load Profile" section shows you the load on your instance per second and per transaction. You can compare this section between two Statspack Reports to see how the load on your instance is increasing or decreasing over time.&lt;br /&gt;&lt;br /&gt;Redo Size &amp; Block Changes Increase: If you see an increase here then more DML statements are taking place (meaning your users are doing more INSERTs, UPDATEs, and DELETEs than before. &lt;br /&gt;Load Profile&lt;br /&gt;~~~~~~~~~~~~                            Per Second       Per Transaction&lt;br /&gt;                                   ---------------       ---------------&lt;br /&gt;                  Redo size:            352,535.71              8,517.66&lt;br /&gt;              Logical reads:            202,403.30              4,890.29&lt;br /&gt;              Block changes:              2,713.47                 65.56&lt;br /&gt;             Physical reads:                 44.22                  1.07&lt;br /&gt;            Physical writes:                 27.46                  0.66&lt;br /&gt;                 User calls:                787.32                 19.02&lt;br /&gt;                     Parses:                301.40                  7.28&lt;br /&gt;                Hard parses:                  0.05                  0.00&lt;br /&gt;                      Sorts:                317.78                  7.68&lt;br /&gt;                     Logons:                  0.10                  0.00&lt;br /&gt;                   Executes:              2,975.84                 71.90&lt;br /&gt;               Transactions:                 41.39&lt;br /&gt;&lt;br /&gt;  % Blocks changed per Read:    1.34    Recursive Call %:    87.43&lt;br /&gt; Rollback per transaction %:   27.56       Rows per Sort:     7.22&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instance Efficiency Percentages&lt;br /&gt;The "Instance Efficiency Percentages" section is very useful. It gives you an overview of your instance health. Anytime you make instance parameter changes you should take a look to see if this affects your instance efficiency in any way. Here is a description of some of the fields (Note, as stated in the statspack report, your goal here is to have these percentages be as close to 100% as possible): &lt;br /&gt;Buffer Nowait %: This is the percentage of time that the instance made a call to get a buffer (all buffer types are included here) and that buffer was made available immediately (meaning it didn't have to wait for the buffer...hence "Buffer Nowait").&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Buffer Hit %: This means that when a request for a buffer took place, the buffer was available in memory and physical disk I/O did not need to take place.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Library Hit %: If your Library Hit percentage is low it could mean that your shared pool size is too small or that the bind variables are not being used (or at least being used properly).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Execute to Parse %: This is the formula used to get this percentage: &lt;br /&gt;round(100*(1-parsevalue/executevalue),2)&lt;br /&gt;So, if you run some SQL and it has to be parsed every time you execute it (because no plan exists for this statement) then your percentage would be 0%. The more times that your SQL statement can reuse an existing plan the higher your Execute to Parse ratio is. &lt;br /&gt;&lt;br /&gt;One way to increase your parse ratio is to use bind variables. This allows the same plan to be used for multiple SQL statements. The only thing that changes in the SQL is the parameters used in your statement's WHERE clause. For Java/JDBC Programmers that means using PreparedStatements as opposed to regular Statements. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Parse CPU to Parse Elapsd %: Generally, this is a measure of how available your CPU cycles were for SQL parsing. If this is low, you may see "latch free" as one of your top wait events.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Redo NoWait %: You guessed it...the instance didn't have to wait to use the redo log if this is 100%.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In-memory Sort %: This means the instance could do its sorts in memory as opposed to doing physical I/O...very good. You don't want to be doing your sorts on disk...especially in an OLTP system. Try increasing your SORT_AREA_SIZE or PGA_AGGREGATE_TARGET in your spfile/pfile to see if that helps if your in-memory sorting is not between 95% and 100%. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Soft Parse %: This is an important one...at least for OLTP systems. This means that your SQL is being reused. If this is low (not between 95% and 100%) then make sure that you're using bind variables in the application and that they're being used properly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Latch Hit %: This should be pretty close to 100%; if it's not then check out what your top wait events are to try to fix the problem (pay specific attention to 'latch free' event). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instance Efficiency Percentages (Target 100%)&lt;br /&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;            Buffer Nowait %:  100.00       Redo NoWait %:  100.00&lt;br /&gt;            Buffer  Hit   %:   99.98    In-memory Sort %:  100.00&lt;br /&gt;            Library Hit   %:  100.04        Soft Parse %:   99.98&lt;br /&gt;         Execute to Parse %:   89.87         Latch Hit %:   94.99&lt;br /&gt;Parse CPU to Parse Elapsd %:   75.19     % Non-Parse CPU:   99.46&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Top 5 Timed Events (Called "Top 5 Wait Events" in 8i)&lt;br /&gt;This section is crucial in determining what some of the performance drains in your database are. It will actually tell you the amount of time the instance spent waiting. Here are some common reasons for high wait events: &lt;br /&gt;DB file scattered read: This can be seen fairly often. Usually, if this number is high, then it means there are a lot of full tablescans going on. This could be because you need indexes or the indexes you do have are not not being used. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DB file sequential read: This could indicate poor joining orders in your SQL or waiting for writes to 'temp' space. It could mean that a lot of index reads/scans are going on. Depending on the problem it may help to tune PGA_AGGREGATE_TARGET and/or DB_CACHE_SIZE. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CPU Time: This could be completely normal. However, if this is your largest wait event then it could mean that you have some CPU intensive SQL going on. You may want to examine some of the SQL further down in the Statspack report for SQL statements that have large CPU Time. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL*Net more data to client: This means the instance is sending a lot of data to the client. You can decrease this time by having the client bring back less data. Maybe the application doesn't need to bring back as much data as it is. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;log file sync: A Log File Sync happens each time a commit takes place. If there are a lot of waits in this area then you may want to examine your application to see if you are committing too frequently (or at least more than you need to). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Logfile buffer space: This happens when the instance is writing to the log buffer faster than the log writer process can actually write it to the redo logs. You could try getting faster disks but you may want to first try increasing the size of your redo logs; that could make a big difference (and doesn't cost much). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Logfile switch: This could mean that your committed DML is waiting for a logfile switch to occur. Make sure your filesystem where your archive logs reside are not getting full. Also, the DBWR process may not be fast enough for your system so you could add more DBWR processes or make your redo logs larger so log switches are not needed as much. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Top 5 Timed Events&lt;br /&gt;~~~~~~~~~~~~~~~~~~                                                     % Total&lt;br /&gt;Event                                               Waits    Time (s) Ela Time&lt;br /&gt;-------------------------------------------- ------------ ----------- --------&lt;br /&gt;db file sequential read                           187,787         906    88.60&lt;br /&gt;SQL*Net more data to client                        49,707          57     5.55&lt;br /&gt;CPU time                                                           54     5.33&lt;br /&gt;log file parallel write                             1,011           2      .22&lt;br /&gt;latch free                                          6,226           2      .16&lt;br /&gt;          -------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The SQL Sections (Buffer Gets, Disk Reads, Executions, and Parse Counts)&lt;br /&gt;The following sections show you the Top SQL (or 'worst performing' SQL) grouped by four sections: Buffer Gets, Disk Reads, Executions, and Parse Counts. You'll want to review the top SQL statements in each of these sections to see if they can be tuned better. These sections are a great way to how many times the SQL is being executed, how much CPU time is being used to execute them, and the total time for the statement to execute. &lt;br /&gt;SQL ordered by Parse Calls for DB: ORCL  Instance: ORCL  Snaps: 4873 -4875&lt;br /&gt;-&gt; End Parse Calls Threshold:      1000&lt;br /&gt;&lt;br /&gt;                           % Total&lt;br /&gt; Parse Calls  Executions   Parses  Hash Value&lt;br /&gt;------------ ------------ -------- ----------&lt;br /&gt;     144,300      144,300     6.65 4199666855&lt;br /&gt;Module: JDBC Thin Client&lt;br /&gt;select parameter, value from nls_session_parameters&lt;br /&gt;&lt;br /&gt;Note: If you take the hash value for the SQL statement, then you run the ORACLE_HOME/rdbms/admin/sprepsql.sql script, and enter the hash value when it prompts you it will pull up the Execution Plan for that SQL statement. Pretty Cool!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instance Activity Stats&lt;br /&gt;This section may provide some insight into some potential performance problems that were not as easily visible from previous sections in the report. This section is also useful when comparing statspack reports from the same timeframes on different days. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tablespace and Data File I/O Statistics&lt;br /&gt;These sections help give you some visibility into I/O rolled up to the tablespace level and I/O stats on your data files. &lt;br /&gt;Tablespace IO Stats for DB: ORCL  Instance: ORCL  Snaps: 4873 -4875&lt;br /&gt;-&gt;ordered by IOs (Reads + Writes) desc&lt;br /&gt;&lt;br /&gt;Tablespace&lt;br /&gt;------------------------------&lt;br /&gt;                 Av      Av     Av                    Av        Buffer Av Buf&lt;br /&gt;         Reads Reads/s Rd(ms) Blks/Rd       Writes Writes/s      Waits Wt(ms)&lt;br /&gt;-------------- ------- ------ ------- ------------ -------- ---------- ------&lt;br /&gt;UNDOTBS&lt;br /&gt;           146       0    5.8     1.0      117,119       16     50,681    1.3&lt;br /&gt;APP1&lt;br /&gt;        19,395       3   10.5     1.0       32,613        5      1,886    2.8&lt;br /&gt;INDEX1&lt;br /&gt;        36,919       5    0.7     6.3          977        0        526    5.0&lt;br /&gt;APP2&lt;br /&gt;         6,969       1   11.7     1.0       13,559        2      2,513    2.5&lt;br /&gt;SYSTEM&lt;br /&gt;        15,056       2    0.8     1.8          360        0         13    3.8&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8573053364471728751?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8573053364471728751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8573053364471728751' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8573053364471728751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8573053364471728751'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/interpreting-your-statspack-report.html' title='Interpreting Your Statspack Report'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-8502132491671415662</id><published>2008-06-03T04:06:00.000-07:00</published><updated>2008-06-03T04:08:25.471-07:00</updated><title type='text'>AWR Report/Snapshot</title><content type='html'>Prior Oracle 10g we use STATSPACK report to analyze instance health for performance. but now in 10g we use AWR(automatic workload repository) report to analyze Oracle Database health.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to generate AWR report ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It is very easy to generate AWR report in Oracle 10g.&lt;br /&gt;&lt;br /&gt;We have to run just one sql script to generate AWR report.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There is TWO sql script to create AWR report.&lt;br /&gt;1. awrrpt.sql&lt;br /&gt;If we have only One Oracle Database then run awrrpt.sql sql script.&lt;br /&gt;&lt;br /&gt;2. awrrpti.sql&lt;br /&gt;If we have more than One Oracle Instance (Like RAC) then run awrrpti.sql script so that we can particular instance for awr report creation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Location of AWR report sql script&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/rdbms/admin&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Example Of AWR report&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;AWR report Example&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;What is default interval period between two awr report ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;AWR report generate automatically for database every 1 hr interval period.&lt;br /&gt;But Recommanded is 15 Minutes is enough in two snapshot for better performance bottleneck.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to Manage &amp; change interval period for awr report ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There is two to modify or changes in AWR report.&lt;br /&gt;1. Manually ---&gt; through DBMS_WORKLOAD_REPOSITORY plsql package&lt;br /&gt;&lt;br /&gt;2. GUI ----&gt; OEM (Oracle Enterprise Manager)&lt;br /&gt;Login to OEM ---&gt; Administration Tag ----&gt; Workload Section ---&gt;AUTOMATIC WORKLOAD REPOSITORY&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to Interpreting with AWR report ?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Below is Main Section in AWR report for concern.&lt;br /&gt;&lt;br /&gt;Load Profile&lt;br /&gt;&lt;br /&gt;In this section we know about Logical Read, Physical Read, Soft Parse, Hard Parse&lt;br /&gt;&lt;br /&gt;Instance Efficiency Percentages&lt;br /&gt;&lt;br /&gt;Many Oracle Guru's is not recommended to trust on Instance percentage ratio. becuase suppose if your instance percentage show BUFFER CAHCE HIT RATIO is 100% it is not sign for your database is very fast and running smootly.&lt;br /&gt;&lt;br /&gt;Top 5 Timed Events&lt;br /&gt;&lt;br /&gt;It is very important section in AWR report.&lt;br /&gt;through this we can know most five wait event is effecting database performance.&lt;br /&gt;&lt;br /&gt;Oracle Wait Event&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL Statistics&lt;br /&gt;&lt;br /&gt;It this section we will know about Execution time, cpu used, logical &amp; physical read for top most sql statement.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Advisory Statistics&lt;br /&gt;&lt;br /&gt;In this section we will get advice for PGA, BUFFER CACHE, SHARED POOL, JAVA POOL size for better performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-8502132491671415662?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/8502132491671415662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=8502132491671415662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8502132491671415662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/8502132491671415662'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/awr-reportsnapshot.html' title='AWR Report/Snapshot'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-3735092118861926206</id><published>2008-06-03T04:05:00.004-07:00</published><updated>2008-06-03T04:06:49.127-07:00</updated><title type='text'>Active Session History (ASH)</title><content type='html'>Oracle 10gr2 Introduce new option for capture performance problem.ASH  Active session History What is ASH ?Whenever you want to know information about blocker and waiter identifiers and their associated transaction IDs and SQL.About V$ACTIVE_SESSION_HISTORY1. The V$ACTIVE_SESSION_HISTORY view provides sampled session activity in the instance. 2. Active sessions are sampled every second and are stored in a circular buffer in SGA. 3. Any session that is connected to the database and is waiting for an event that does not belong to the Idle wait class is considered as an active session. 4. This includes any session that was on the CPU at the time of sampling.5. Each session sample is a set of rows and the V$ACTIVE_SESSION_HISTORY view returns one row for each active session per sample, returning the latest session sample rows first. Because the active session samples are stored in a circular buffer in SGA, the greater the system activity, the smaller the number of seconds of session activity that can be stored in the circular buffer. This means that the duration for which a session sample appears in the V$ view, or the number of seconds of session activity that is displayed in the V$ view, is completely dependent on the database activity.6. Using the Active Session History enables you to examine and perform detailed analysis on both current data in the V$ACTIVE_SESSION_HISTORY view 7. Historical data in the DBA_HIST_ACTIVE_SESS_HISTORY view, SQL identifier of SQL statementWhat information provide ASH view ?1. Object number, file number, and block number2. Wait event identifier and parameters3. Session identifier and session serial number4. Module and action name5. Client identifier of the session6. Service hash identifierHow to generate ASH report ?It is New feature of 10GR2(10.2.0.1.0)For report creation we have to use ASHRPT.SQL script.Located: In $ORACLE_HOME/rdbms/admin folderHow to run ASHRPT.SQL scriptTo generate a text report of ASH information, run the ashrpt.sql script at the SQL prompt:@$ORACLE_HOME/rdbms/admin/ashrpt.sqlFirst, you need to specify whether you want an HTML or a text report.Enter value for report_type: textSpecify the time frame to collect ASH information by first specifying the begin time in minutes prior to the system date.Enter value for begin_time: -10Note: here you have to just put number in minutes eg: 10 for 10 minutesNext, enter the duration in minutes that the report for which you want to capture ASH information from the begin time. The default duration of system date minus begin time is accepted in the following example:Enter value for duration:Note: left blank for default value. Default value is SYSDATEThe report in this example will gather ASH information beginning from 10 minutes before the current time and ending at the current time. Next, accept the default report name or enter a report name. The default name is accepted in the following example:Enter value for report_name: Using the report name ashrpt_1_0310_0131.txtNote: Left it blank for default value.The session history report is generated.For Futhere Detail please check metalink note: 243132.1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-3735092118861926206?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/3735092118861926206/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=3735092118861926206' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3735092118861926206'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3735092118861926206'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/active-session-history-ash.html' title='Active Session History (ASH)'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6413344075603789188</id><published>2008-06-03T04:05:00.003-07:00</published><updated>2008-06-03T04:05:55.328-07:00</updated><title type='text'>System Statistics</title><content type='html'>System statistics describe the system's hardware characteristics, such as I/O and CPU performance and utilization, to the query optimizer. Why gather SYSTEM STATISTICS ?When choosing an execution plan, then opitmizer estimate the I/O and CPU resources required for each query.System statistics enable the query optimizer to more accurately estimate I/O and CPU costs, enabling the query optimizer to choose a better execution plan.It is important to gather system statistics ?System statistics give accurate cost for sql query so optimizer take good decision.If you have good statistics then query take good decision and database performance is increase.Many Oracle Guru's and Oracle Corp. Also recommended to gather system statistics.How Gather System Statistics ?Through DBMS_STATS package we can gather system statisticsStep1SQL&gt; exec dbms_stats.gather_system_stats('Start');Step2SQL&gt;--Wait for some time ...it will 1 hr minimum or 2 hr or whole day according database load.Step3SQL exec dbms_stats.gather_system_stats('Stop');Keep in mind.1. User must granted DBA privilege role for gather system statistics.2. After gather system statistics... Unlike table, index, or column statistics, Oracle does not invalidate already parsed SQL statements when system statistics get updated. All new SQL statements are parsed using new statistics.3. Always Gather System statistics During Heavy Peak Load.Where check gather system statistics data information ?After Gather system statictics query sys.aux_stats$ view.SQL&gt; select pname, pval1 from sys.aux_stats$;PNAME PVAL1------------------------------ ----------STATUSDSTARTDSTOPFLAGS 1CPUSPEEDNW 904.86697IOSEEKTIM 10IOTFRSPEED 4096SREADTIM .995MREADTIM 1.701CPUSPEED 1268MBRC 16MAXTHRSLAVETHR13 rows selected.Note: CPUSPEEDNW,IOSEEKTIM,IOTFRSPEED is New column comes with Oracle 10g. and these columns already populated before gather system statistics.SREADTIMSingle block read time is the average time to read a single block randomly.MREADTIMMultiblock read is the average time to read a multiblock sequentially.MBRCMultiblock count is the average multiblock read count sequentially.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6413344075603789188?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6413344075603789188/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6413344075603789188' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6413344075603789188'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6413344075603789188'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/system-statistics.html' title='System Statistics'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-7374709421095652948</id><published>2008-06-03T04:05:00.001-07:00</published><updated>2008-06-03T04:05:36.452-07:00</updated><title type='text'>Oracle Latch</title><content type='html'>What is Latch ?A mechanism to protect shared data structures in the System Global Area.For Example: latches protect the list of users currently accessing the database and protect the data structures describing the blocks in the buffer cache.A server or background process acquires a latch for a very short time while manipulating or looking at one of these structures.During DB performance we will see LATCH event ...so what is latch event and how many types of latch events ?A latch is a low-level internal lock used by Oracle to protect memory structures.The latch free event is updated when a server process attempts to get a latch, and the latch is unavailable on the first attempt.Most Popular latch wait event are ...&lt;br /&gt;1. Latch: library cache or Latch: shared poolBelow is Possible causes for above both latch events.1. Lack of statement reuse2. Statements not using bind variables3. Insufficient size of application cursor cache4. Cursors closed explicitly after each execution5. Frequent logon/logoffs6. Underlying object structure being modified (for example truncate)7. Shared pool too smallBelow is Possible suggestion for aviod above both latch events.1. Increase SHARED_POOL_SIZE parameter value.2. Modify Frontend application to use BIND VARIABLE3. Use CURSOR_SHARING='force' (for temporary basis)2. Latch: cache buffers lru chainPossible Causes1. Inefficient SQL that accesses incorrect indexes iteratively (large index range scans) or many full table scans. 2. DBWR not keeping up with the dirty workload; hence, foreground process spends longer holding the latch looking for a free buffer3. Cache may be too smallPossible Suggestion1. Look for: Statements with very high logical I/O or physical I/O, using unselective indexes2. Increase DB_CACHE_SIZE parameter value.3. The cache buffers lru chain latches protect the lists of buffers in the cache. When adding, moving, or removing a buffer from a list, a latch must be obtained.For symmetric multiprocessor (SMP) systems, Oracle automatically sets the number of LRU latches to a value equal to one half the number of CPUs on the system. For non-SMP systems, one LRU latch is sufficient.Contention for the LRU latch can impede performance on SMP machines with a large number of CPUs. LRU latch contention is detected by querying V$LATCH, V$SESSION_EVENT, and V$SYSTEM_EVENT. To avoid contention, consider tuning the application, bypassing the buffer cache for DSS jobs, or redesigning the application.Latch: cache buffers chainsPossible Causes1. Repeated access to a block (or small number of blocks), known as a hot block2. From AskTom:Contention for these latches can be caused by:- Very long buffer chains.- very very heavy access to the same blocks.Possible Suggestion1. From AskTom:When I see this, I try to see what SQL the waiters are trying to execute. Many times, what I find, is they are all running the same query for the same data (hot blocks). If you find such a query -- typically it indicates a query that might need to be tuned (to access less blocks hence avoiding the collisions).If it is long buffer chains, you can use multiple buffer pools to spread things out. You can use DB_BLOCK_LRU_LATCHES to increase the number of latches. You can use both together.The cache buffers chains latches are used to protect a buffer list in the buffer cache. These latches are used when searching for, adding, or removing a buffer from the buffer cache. Contention on this latch usually means that there is a block that is greatly contended for (known as a hot block).To identify the heavily accessed buffer chain, and hence the contended for block, look at latch statistics for the cache buffers chains latches using the view V$LATCH_CHILDREN. If there is a specific cache buffers chains child latch that has many more GETS, MISSES, and SLEEPS when compared with the other child latches, then this is the contended for child latch.This latch has a memory address, identified by the ADDR column. Use the value in the ADDR column joined with the X$BH table to identify the blocks protected by this latch. For example, given the address (V$LATCH_CHILDREN.ADDR) of a heavily contended latch, this queries the file and block numbers:SELECT OBJ data_object_id, FILE#, DBABLK,CLASS, STATE, TCHFROM X$BHWHERE HLADDR = 'address of latch'ORDER BY TCH;X$BH.TCH is a touch count for the buffer. A high value for X$BH.TCH indicates a hot block.Many blocks are protected by each latch. One of these buffers will probably be the hot block. Any block with a high TCH value is a potential hot block. Perform this query a number of times, and identify the block that consistently appears in the output. After you have identified the hot block, query DBA_EXTENTS using the file number and block number, to identify the segment.After you have identified the hot block, you can identify the segment it belongs to with the following query:SELECT OBJECT_NAME, SUBOBJECT_NAMEFROM DBA_OBJECTSWHERE DATA_OBJECT_ID = &amp;obj;In the query, &amp;amp;obj is the value of the OBJ column in the previous query on X$BH.5. Latch: row cache objectsThe row cache objects latches protect the data dictionary.Suggestion: Increase SHARED_POOL_SIZE parameter to avoid this latch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-7374709421095652948?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/7374709421095652948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=7374709421095652948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/7374709421095652948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/7374709421095652948'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/oracle-latch.html' title='Oracle Latch'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6370738938390737347</id><published>2008-06-03T04:04:00.001-07:00</published><updated>2008-06-03T04:04:45.603-07:00</updated><title type='text'>Materialized view for Data Warehouse</title><content type='html'>What is materialized view?1. Materialized view is normal database object like “table,index”2. It is basically use for Data warehouse or Replication purpose.3. Snapshot is synonym for materialized view.4. A materialized view can be stored in the same database as its base tables or in a different database5. A materialized view provides access to table data by storing the results of a query in a separate schema object. Unlike an ordinary view, which does not take up any storage space or contain any data, a materialized view contains the rows resulting from a query against one or more base tables or views.6. A materialized view improve response time through query rewrite or reduce execution time.Note: Query rewrite is a mechanism where Oracle or applications from the end user or database transparently improve query response time, by automatically rewriting the SQL query to use the materialized view instead of accessing the original tables. Query rewrites are particularly useful in a data warehouse environment.What is syntax for materialized view?Create materialized view “materialized_view_name”Build [immediate / deferred]Refresh [fash [on commit / demand]]Enable query rewriteAs Sql statement/Now Details explanation about syntax 1. Create materialized view “name’I hope it is understood because self explanatory2. Build [immediate / deferred]1. Build immediate -- &gt; materialized view populate with data on creation time from tables.2. Build deferred --- &gt; materialized view not populate with data on creation time, we have to populate later.Eg: With build immediatecreate materialized view mymview1build immediateasselect ename,sum(sal) from emp group by ename;SQL&gt; select count(*) from emp;COUNT(*)----------14Note: materialized view populate with data on creation time.With build deferredcreate materialized view mymview2build deferredasselect ename,sum(sal) from emp group by ename;SQL&gt; select count(*) from mymview2;COUNT(*)----------0Note: materialized view not populate with data on creation time, we have to populate manually through DBMS_MVIEW.RERESH package.3. Refresh [fast [on commit / demand]]Refresh is method for populate materialized view with data whenever made changes in their base tables.There are five refresh method for materialized view1. refresh fast (materialized view log needed)2. refresh on commit3. refresh on demandWhat is materialized view log?A materialized view log is a schema object that records changes to a master table's data so that a materialized view defined on the master table can be refreshed incrementally.Each materialized view log is associated with a single master table. The materialized view log resides in the same database and schema as its master table.Eg:With refresh on commitSQL&gt; select count(*) from emp;COUNT(*)----------14SQL&gt; create materialized view MYVIEW12 build immediate3 refresh on commit4 enable query rewrite5 as6 select ename, sum(sal) from emp group by ename;Materialized view created.SQL&gt; select count(*) from myview1;COUNT(*)----------14SQL&gt; insert into emp (empno,ename,sal) values(1754,'TAJ',2500);1 row created.SQL&gt; commit;Commit complete.SQL&gt; select count(*) from myview1;COUNT(*)----------15With refresh on commitSQL&gt; select count(*) from emp;COUNT(*)----------15SQL&gt; create materialized view MYVIEW52 build immediate3 refresh on demand4 enable query rewrite5 as6 select ename,sum(sal) from emp group by ename;Materialized view created.SQL&gt; select count(*) from myview5;COUNT(*)----------15SQL&gt; insert into emp (empno,ename,sal)values(1100,'xyz',1000);1 row created.SQL&gt; commit;Commit complete.SQL&gt; select count(*) from emp;COUNT(*)----------16SQL&gt; select count(*) from myview5;COUNT(*)----------15SQL&gt; exec dbms_mview.refresh('MYVIEW5');PL/SQL procedure successfully completed.SQL&gt; select count(*) from myview5;COUNT(*)----------16Whenever any changes made in base tables and perform commit then materialized view refreshed.4. Enable query rewriteA materialized view is like a query with a result that is materialized and stored in a table. When a user query is found compatible with the query associated with a materialized view, the user query can be rewritten in terms of the materialized view. This technique improves the execution of the user query, because most of the query result has been precomputed. The query transformer looks for any materialized views that are compatible with the user query and selects one or more materialized views to rewrite the user query. The use of materialized views to rewrite a query is cost-based. That is, the query is not rewritten if the plan generated without the materialized views has a lower cost than the plan generated with the materialized views.Note: query_rewrite_enabled=true AND query_rewrite_integrity=enforced must be set to use query rewrite feature5. How Materialized view improve query performance.Let’s check with demo 1. Create Big Table :)SQL&gt; create table big2 as select * from all_objects3 union all4 select * from all_objects5 union all6 select * from all_objects7 union all8 select * from all_objects9 union all10 select * from all_objects;Table created.SQL&gt; select count(*) from big;COUNT(*)----------1889952. Now execute below query and check query statisticsSQL&gt; alter system flush shared_pool;System altered.SQL&gt; set autotrace traceonlySQL&gt; set timing onSQL&gt; select owner,count(*) from big group by owner;12 rows selected.Elapsed: 00:00:00.01Execution Plan----------------------------------------------------------0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=624 Card=188024 Bytes=3196408)1 0 SORT (GROUP BY) (Cost=624 Card=188024 Bytes=3196408)2 1 TABLE ACCESS (FULL) OF 'BIG' (TABLE) (Cost=598 Card=188024 Bytes=3196408)Statistics----------------------------------------------------------957 recursive calls0 db block gets2844 consistent gets---- &gt; too big :)0 physical reads0 redo size1028 bytes sent via SQL*Net to client504 bytes received via SQL*Net from client2 SQL*Net roundtrips to/from client10 sorts (memory)0 sorts (disk)12 rows processed3. Now Create materialized view and try SQL&gt; create materialized view MYVIEWBIG2 build immediate3 refresh on commit4 enable query rewrite5 as6 select owner,count(*) from big group by owner;Materialized view created.SQL&gt; alter system flush shared_pool;System altered.SQL&gt; set autotrace traceonlySQL&gt; set timing onSQL&gt; select owner,count(*) from big group by owner;12 rows selected.Elapsed: 00:00:00.01Execution Plan----------------------------------------------------------0 SELECT STATEMENT Optimizer=ALL_ROWS (Cost=3 Card=12 Bytes=360)1 0 MAT_VIEW REWRITE ACCESS (FULL) OF 'MYVIEWBIG' (MAT_VIEW REWRITE) (Cost=3 Card=12 Bytes=360)Statistics----------------------------------------------------------7356 recursive calls0 db block gets1313 consistent gets --- &gt; just less then half :) 0 physical reads0 redo size1028 bytes sent via SQL*Net to client504 bytes received via SQL*Net from client2 SQL*Net roundtrips to/from client49 sorts (memory)0 sorts (disk)12 rows processed4. What Privileges Need for materialized view ?To create a materialized view in your own schema, you must have the CREATE MATERIALIZED VIEW privilege and the SELECT privilege to any tables referenced that are in another schema. To create a materialized view in another schema, you must have the CREATE ANY MATERIALIZED VIEW privilege and the owner of the materialized view needs SELECT privileges to the tables referenced if they are from another schema. Moreover, if you enable query rewrite on a materialized view that references tables outside your schema, you must have the GLOBAL QUERY REWRITE privilege or the QUERY REWRITE object privilege on each table outside your schema.5. How to check Status of a Materialized View?SQL&gt; select mview_name,query,rewrite_enabled,refresh_mode,build_mode,staleness,compile_state2 from user_mviews;MVIEW_NAME QUERY R REFRES BUILD_MOD STALENESS COMPILE_ST---------- -------------------- - ------ --------- ---------- ----------MYBIG select owner, count( Y DEMAND IMMEDIATE NEEDS_COMP NEEDS_COMP*) from big group by ILE ILEownerMYMVIEW2 select ename,sum(sal N DEMAND DEFERRED UNUSABLE NEEDS_COMP) from emp group by ILEenameMYVIEW5 select ename,sum(sal Y DEMAND IMMEDIATE FRESH VALID) from emp group byenameMYMVIEW3 select ename,sum(sal Y COMMIT IMMEDIATE UNUSABLE VALID) from emp group byenameMYVIEW1 select ename, sum(sa Y COMMIT IMMEDIATE FRESH VALIDl) from emp group byExplanation:MVIEW_NAME -------- &gt; Materialized View nameQUERY ------------- &gt; Query that defines the materialized viewREFRESH_ENABLED --- &gt; If query_rewrite_enabled=TRUE then value is “Y” otherwise “N”REFRESH_MODE ------ &gt; DEMAND, COMMIT, NEVERBUILD_MODE -------- &gt; IMMEDIATE, DEFERREDSTALENESS --------- &gt; Relationship between the contents of the materialized view and the contents of the materialized view's masters.COMPILE_STATE ----- &gt; Validity of the materialized view with respect to the objects upon which it dependsVALID -&gt; No objects depends has changed since the last validationNEED_COMPILE -&gt; Some objects depends materialized view has changed an “alter materialized view … compile;” statement is required to validate this materialized view&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6370738938390737347?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6370738938390737347/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6370738938390737347' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6370738938390737347'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6370738938390737347'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/materialized-view-for-data-warehouse.html' title='Materialized view for Data Warehouse'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5421618303859859473</id><published>2008-06-03T04:01:00.000-07:00</published><updated>2008-12-12T15:20:07.411-08:00</updated><title type='text'>Master Replication</title><content type='html'>What is Advance Replication?Replication is the process of copying and maintaining &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink1" onmouseover="adlinkMouseOver(event,this,1);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,1);" onmouseout="adlinkMouseOut(event,this,1);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;database objects&lt;/a&gt;, such as tables, in multiple databases that make up a distributed database &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink2" onmouseover="adlinkMouseOver(event,this,2);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,2);" onmouseout="adlinkMouseOut(event,this,2);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;system&lt;/a&gt;. Changes applied at one site are captured and stored locally before being forwarded and applied at each of the remote locations. Advanced Replication is a fully integrated feature of the Oracle &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink3" onmouseover="adlinkMouseOver(event,this,3);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,3);" onmouseout="adlinkMouseOut(event,this,3);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;server&lt;/a&gt;; it is not a separate server.Replication uses distributed database &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink4" onmouseover="adlinkMouseOver(event,this,4);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,4);" onmouseout="adlinkMouseOut(event,this,4);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;technology&lt;/a&gt; to share data between multiple sites, but a replicated &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink5" onmouseover="adlinkMouseOver(event,this,5);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,5);" onmouseout="adlinkMouseOut(event,this,5);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;database&lt;/a&gt; and a distributed database are not the same. In a distributed database, data is available at many locations, but a particular table resides at only one location. For example, the employees table resides at only the ny.world database in a distributed &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink6" onmouseover="adlinkMouseOver(event,this,6);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,6);" onmouseout="adlinkMouseOut(event,this,6);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;database system&lt;/a&gt; that also includes the hk.world and la.world databases. Replication means that the same data is available at multiple locations. For example, the employees table is available at ny.world, hk.world, and la.world.Some of the common reasons for using replication are:&lt;br /&gt;AvailabilityReplication improves the availability of &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink7" onmouseover="adlinkMouseOver(event,this,7);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,7);" onmouseout="adlinkMouseOut(event,this,7);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;applications&lt;/a&gt; because it provides them with alternative &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink8" onmouseover="adlinkMouseOver(event,this,8);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,8);" onmouseout="adlinkMouseOut(event,this,8);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;data access&lt;/a&gt; options. If one site becomes unavailable, then users can continue to query or even update the remaining locations. In other words, replication provides excellent failover protection.PerformanceReplication provides fast, local access to shared data because it balances activity over multiple sites. Some users can access one server while other users access different servers, thereby reducing the load at all servers. Also, users can &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink9" onmouseover="adlinkMouseOver(event,this,9);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,9);" onmouseout="adlinkMouseOut(event,this,9);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;access data&lt;/a&gt; from the replication site that has the lowest access cost, which is typically the site that is geographically closest to them.Disconnected computingA materialized view is a complete or partial copy (replica) of a target table from a single point in time. Materialized views enable users to work on a subset of a database while disconnected from the central &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink10" onmouseover="adlinkMouseOver(event,this,10);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,10);" onmouseout="adlinkMouseOut(event,this,10);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;database server&lt;/a&gt;. Later, when a connection is established, users can synchronize (refresh) materialized views &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink11" onmouseover="adlinkMouseOver(event,this,11);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,11);" onmouseout="adlinkMouseOut(event,this,11);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;on demand&lt;/a&gt;. When users refresh materialized views, they update the central database with all of their changes, and they receive any changes that may have happened while they were disconnected.&lt;a class="kLink" oncontextmenu="return false;" id="KonaLink12" onmouseover="adlinkMouseOver(event,this,12);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,12);" onmouseout="adlinkMouseOut(event,this,12);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;Network&lt;/a&gt; load reductionReplication can be used to distribute data over multiple regional locations. Then, applications can access various regional servers instead of accessing one central server. This configuration can reduce network load dramatically.Architecture of advance replication&lt;a href="http://3.bp.blogspot.com/_laYcwaJBJNw/Ry8QLSwcCqI/AAAAAAAAATk/ZWJXU33bclA/s1600-h/rarovera.gif"&gt;&lt;/a&gt;There are two types of Advance Replication&lt;br /&gt;1. Multimaster Replication2. Materialized view replication1. Multimaster replicationStart --- &gt; set up master site --- &gt; Select object for replication --- &gt; Create Group for selected objects --- &gt; if conflict possible then configure conflict resolution ---&gt; end2. Materialized view replicationStart --- &gt; set up master site -- &gt; set up materialized view site --- &gt; create materialized view group --- &gt; endNote: In Detail explanation is Part-II, III.Replication SitesA replication group can exist at multiple replication sites. Replication environments support two basic types of sites: master sites and materialized view sites. One site can be both a master site for one replication group and a materialized view site for a different replication group. However, one site cannot be both the master site and the materialized view site for the same replication group.The differences between master sites and materialized view sites are the following:Replication Group1. A replication group at a master site is more specifically referred to as a master group.2. A replication group at a materialized view site is based on a master group and is more specifically referred to as a materialized view group.Replication Objects1. A master site maintains a complete copy of all objects in a replication group,Example: if the hr_repg master group contains the table’s employees and departments, then all of the master sites participating in a master group must maintain a complete copy of employees and departments.2. Materialized views at a materialized view site can contain all or a subset of the table data within a master group.Example: one materialized view site might contain only a materialized view of the employees table, while another materialized view site might contain materialized views of both the employees and departments tables.Communication with master sites1. All master sites in a multimaster replication environment communicate directly with one another to continually propagate data changes in the replication group2. Materialized view sites contain an image, or materialized view, of the table data from a certain point in time.Replication ObjectsA replication object is a database object existing on &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink13" onmouseover="adlinkMouseOver(event,this,13);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,13);" onmouseout="adlinkMouseOut(event,this,13);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;multiple servers&lt;/a&gt; in a distributed database system. In a replication environment, any updates made to a replication object at one site are applied to the copies at all other sites. Advanced Replication enables you to replicate the following types of objects:• Tables • Indexes • Views and Object Views • Packages and Package Bodies • Procedures and Functions • User-Defined Types and Type Bodies • Triggers • Synonyms • Index types • User-Defined Operators Replication GroupsIn a replication environment, Oracle manages replication objects using replication groups. A replication group is a collection of replication objects that are logically related.By organizing related database objects within a replication group, it is easier to administer many objects together. Typically, you create and use a replication group to organize the schema objects necessary to support a particular &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink14" onmouseover="adlinkMouseOver(event,this,14);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,14);" onmouseout="adlinkMouseOut(event,this,14);" href="http://dbataj.blogspot.com/2007/11/advance-replication-part-i-introduction.html#" target="_top"&gt;database application&lt;/a&gt;. However, replication groups and schemas do not need to correspond with one another. A replication group can contain objects from multiple schemas, and a single schema can have objects in multiple replication groups. However, each replication object can be a member of only one replication group.&lt;br /&gt;Here I explain only Multimaster replication.1. Multimaster replication includes multiple master sites, where each master site operates as an equal peer.2. Multimaster replication, also known as peer-to-peer or n-way replication, is comprised of multiple master sites equally participating in an update-anywhere model.3. Oracle &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink9" onmouseover="adlinkMouseOver(event,this,9);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,9);" onmouseout="adlinkMouseOut(event,this,9);" href="http://dbataj.blogspot.com/search?updated-min=2007-01-01T00%3A00%3A00%2B04%3A00&amp;amp;updated-max=2008-01-01T00%3A00%3A00%2B04%3A00&amp;amp;max-results=50#" target="_top"&gt;database servers&lt;/a&gt; operating as master sites in a multimaster replication environment automatically work to converge the data of all table replicas, and ensure global transaction consistency and data integrity.4. Conflict resolution is independently handled at each of the master sites.5. Multimaster replication provides complete replicas of each replicated table at each of the master sites.&lt;a href="http://2.bp.blogspot.com/_laYcwaJBJNw/RzFyGiwcCrI/AAAAAAAAATs/g3HEJMwzVvc/s1600-h/repln00a.gif"&gt;&lt;/a&gt;Why Use Multimaster Replication?From a very basic point of view, replication is used to make sure that data is available when and where you need it.But some of possibilities when we use multimaster replication are FailoverMultimaster replication can be used to protect the availability of a mission critical database. For example, a multimaster replication environment can replicate data in your database to establish a failover site should the primary site become unavailable due to system or network outages. Such a failover site also can serve as a fully functional database to support application access when the primary site is concurrently operational.Load BalancingMultimaster replication is useful for transaction processing applications that require multiple points of access to database information for the following purposes:1. Distributing a heavy application load 2. Ensuring continuous availability 3. Providing more localized data accessMultimaster Replication ProcessThere are two types of multimaster replication: asynchronous and synchronous.asynchronousAsynchronous replication, often referred to as store-and-forward replication, captures any local changes, stores them in a queue, and, at regular intervals, propagates and applies these changes at remote sites. With this form of replication, there is a period of time before all sites achieve data convergence.synchronousSynchronous replication, also known as real-time replication, applies any changes or executes any replicated procedures at all sites participating in the replication environment as part of a single transaction. If the data manipulation language (DML) statement or procedure fails at any site, then the entire transaction rolls back. Synchronous replication ensures data consistency at all sites in real-time.Note: You can change the propagation mode from asynchronous to synchronous or vice versa for a master site.How to setup Master sites?Set below parametersglobal_namesalter system set global_names=TRUE;job_queue_processesalter system set job_queue_processes = 1;Considerations for Replicated TablesPrimary KeysIf possible, each replicated table should have a primary key. Where a primary key is not possible, each replicated table must have a set of columns that can be used as a unique identifier for each row of the table.Foreign KeysWhen replicating tables with foreign key referential constraints, Oracle Corporation recommends that you always index foreign key columns and replicate these indexes, unless no updates and deletes are allowed in the parent table. Indexes are not replicated automatically. To replicate an index, add it to the master group containing its table using either the Replication Management tool or the CREATE_MASTER_REPOBJECT procedure in the DBMS_REPCAT package.Create DB for replicationHere I created three databases for replicationdb01db02Setting up DB01 master site&lt;br /&gt;Step 1 Connect as SYSTEM at a master site at DB01SQL&gt; conn system/oracle@db01Connected.Step 2 Create the replication administrator at DB01SQL&gt; CREATE USER repadmin IDENTIFIED BY repadmin;User created.Step 3 Grant privileges to the replication administrator at DB01SQL&gt; BEGIN2 DBMS_REPCAT_ADMIN.GRANT_ADMIN_ANY_SCHEMA (3 username =&gt; 'repadmin');4 END;5 /PL/SQL procedure successfully completed.Note: This privilege to create and manage a replicated enviourmentsSQL&gt; GRANT SELECT ANY DICTIONARY TO repadmin;Grant succeeded.Note: If you want your repadmin to be able to connect to the Replication Management tool,then grant SELECT ANY DICTIONARY to repadmin:Step 4 Register the propagator at DB01SQL&gt; BEGIN2 DBMS_DEFER_SYS.REGISTER_PROPAGATOR (3 username =&gt; 'repadmin');4 END;5 /PL/SQL procedure successfully completed.Note: The propagator is responsible for propagating the deferred transaction queue to other master sites.Step 5 Register the receiver at DB01SQL&gt; BEGIN2 DBMS_REPCAT_ADMIN.REGISTER_USER_REPGROUP (3 username =&gt; 'repadmin',4 privilege_type =&gt; 'receiver',5 list_of_gnames =&gt; NULL);6 END;7 /PL/SQL procedure successfully completed.Note: The receiver receives the propagated deferred transactions sent by the propagator from other master sites.Step 6 Schedule purge at master site at DB01SQL&gt; CONNECT repadmin/repadmin@db01Connected.SQL&gt;SQL&gt; BEGIN2 DBMS_DEFER_SYS.SCHEDULE_PURGE (3 next_date =&gt; SYSDATE,4 interval =&gt; 'SYSDATE + 1/24',5 delay_seconds =&gt; 0);6 END;7 /PL/SQL procedure successfully completed.Note: In order to keep the size of the deferred transaction queue in check, you should purge successfully completed deferred transactions. The SCHEDULE_PURGE procedure automates the purge process for you. You must execute this procedure as the replication administrator.Note: Repeat above 6 steps in database DB02 master sites.Step-2 Create Scheduled Links between the Master Sites&lt;br /&gt;Step 1 Create database links between master sites.The database links provide the necessary distributed mechanisms to allow the different replication sites to replicate data among themselves. Before you create any private database links, you must create the public database links that each private database link will use. You then must create a database link between all replication administrators at each of the master sites that you have set up.SQL&gt; conn system/oracle@db01Connected.SQL&gt; create public database link db02 using 'db02';Database link created.SQL&gt; conn repadmin/repadmin@db01Connected.SQL&gt; create database link db02 connect to repadmin identified by repadmin;Database link created.SQL&gt; conn system/oracle@db02Connected.SQL&gt; create public database link db01 using 'db01';Database link created.SQL&gt; conn repadmin/repadmin@db02Connected.SQL&gt; create database link db01 connect to repadmin identified by repadmin;Database link created.Step 2 Define a schedule for each database link to create scheduled links.Create a scheduled link by defining a database link when you execute the SCHEDULE_PUSH procedure. The scheduled link determines how often your deferred transaction queue is propagated to each of the other master sites. You need to execute the SCHEDULE_PUSH procedure for each database link that you created in Step 1. The database link is specified in the destination parameter of the SCHEDULE_PUSH procedure.Even when using Oracle's asynchronous replication mechanisms, you can configure a scheduled link to simulate continuous, real-time replication. The scheduled links in this example simulate continuous replication.SQL&gt; conn repadmin/repadmin@db01Connected.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_DEFER_SYS.SCHEDULE_PUSH (3 destination =&gt; 'DB02',4 interval =&gt; 'SYSDATE + (1/144)',5 next_date =&gt; SYSDATE,6 parallelism =&gt; 1,7 execution_seconds =&gt; 1500,8 delay_seconds =&gt; 1200);9* END;SQL&gt; /PL/SQL procedure successfully completed.SQL&gt; conn repadmin/repadmin@db02Connected.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_DEFER_SYS.SCHEDULE_PUSH (3 destination =&gt; 'DB01',4 interval =&gt; 'SYSDATE + (1/144)',5 next_date =&gt; SYSDATE,6 parallelism =&gt; 1,7 execution_seconds =&gt; 1500,8 delay_seconds =&gt; 1200);9* END;SQL&gt; /PL/SQL procedure successfully completed.Step-3 Create Master Group&lt;br /&gt;Here I am using SCOTT schema and their objects for replicate purpose because SCOTT schema exists in Default Oracle installation.Objects which use for replication in scott schema.1. DEPT - table2. EMP - tablePrimary key must exists on each table which use for replication.Note: If DB version is 10g then first unlock scott account;Step-1 Unlock Scott Schema and reset schema password or Create New Schema for replication.Step 2 Create the master groupSQL&gt; conn repadmin/repadmin@db01Connected.SQL&gt; begin2 dbms_repcat.create_master_repgroup (3 gname =&gt; 'scott_repg');4 end;5 /PL/SQL procedure successfully completed.Note: This step must be completed by the replication administrator.Step 3 Add objects to master group.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.CREATE_MASTER_REPOBJECT (3 gname =&gt; 'scott_repg',4 type =&gt; 'TABLE',5 oname =&gt; 'EMP',6 sname =&gt; 'scott',7 use_existing_object =&gt; TRUE,8 copy_rows =&gt; FALSE);9* END;SQL&gt; /PL/SQL procedure successfully completed.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.CREATE_MASTER_REPOBJECT (3 gname =&gt; 'scott_repg',4 type =&gt; 'TABLE',5 oname =&gt; 'DEPT',6 sname =&gt; 'scott',7 use_existing_object =&gt; TRUE,8 copy_rows =&gt; FALSE);9* END;SQL&gt; /PL/SQL procedure successfully completed.Note: Use the CREATE_MASTER_REPOBJECT procedure to add an object to your master group. In most cases, you probably will be adding tables and indexes to your master group, but you can also add procedures, views, synonyms, and so on.Step 4 Add additional master sites.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.ADD_MASTER_DATABASE (3 gname =&gt; 'scott_repg',4 master =&gt; 'DB02',5 use_existing_objects =&gt; TRUE,6 copy_rows =&gt; FALSE,7 propagation_mode =&gt; 'ASYNCHRONOUS');8* END;SQL&gt; /PL/SQL procedure successfully completed.Note: You should wait until db02 appears in the DBA_REPSITES view before continuing. Execute the following SELECT statement in another SQL*Plus session to make sure that db02 has appeared:SQL&gt; conn repadmin/repadmin@db01Connected.SQL&gt; SELECT DBLINK FROM DBA_REPSITES WHERE GNAME = 'SCOTT_REPG';DBLINK------------------------------------------------------------------DB01DB02Note:1. In this example, the use_existing_objects parameter in the ADD_MASTER_DATABASE procedure is set to TRUE because it is assumed that the scott schema already exists at all master sites. In other words, it is assumed that the objects in the scott schema are precreated at all master sites. Also, the copy_rows parameter is set to FALSE because it is assumed that the identical data is stored in the tables at each master site.2. Here I am using replication Process is “ASYNCHRONOUS”.3. Here I am skip “conflict resolution methods”Note: Repeat Step-3 at DB02 master site.Step 5 Generate replication support.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT (3 sname =&gt; 'scott',4 oname =&gt; 'emp',5 type =&gt; 'TABLE',6 min_communication =&gt; TRUE);7* END;SQL&gt; /PL/SQL procedure successfully completed.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT (3 sname =&gt; 'scott',4 oname =&gt; 'dept',5 type =&gt; 'TABLE',6 min_communication =&gt; TRUE);7* END;SQL&gt; /PL/SQL procedure successfully completed.Note: You should wait until the DBA_REPCATLOG view is empty before resuming master activity. Execute the following SELECT statement to monitor your DBA_REPCATLOG view:SQL&gt; SELECT COUNT(*) FROM DBA_REPCATLOG WHERE GNAME = 'SCOTT_REPG';COUNT(*)----------0Step-6 Start replication.After creating your master group, adding replication objects, generating replication support, and adding additional master databases, you need to start replication activity. Use the RESUME_MASTER_ACTIVITY procedure to "turn on" replication for the specified master group.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.RESUME_MASTER_ACTIVITY (3 gname =&gt; 'scott_repg');4* END;SQL&gt; /PL/SQL procedure successfully completed.Here we complete multimaster replication procedure.Now let check what we did is correct or not :)Connect with scott to db01 and insert new rows in dept table and commit;SQL&gt; conn scott/tiger@db01Connected.SQL&gt; select * from dept;DEPTNO DNAME LOC---------- -------------- -------------10 ACCOUNTING NEW YORK20 RESEARCH DALLAS30 SALES CHICAGO40 OPERATIONS BOSTONSQL&gt; insert into dept values (50,'DUMMY','DUMMY');1 row created.SQL&gt; commit;Commit complete.SQL&gt; select * from dept;DEPTNO DNAME LOC---------- -------------- -------------10 ACCOUNTING NEW YORK20 RESEARCH DALLAS30 SALES CHICAGO40 OPERATIONS BOSTON50 DUMMY DUMMY--- New row--Wait some time ...and connect scott to db02 database and check that new row replicate in dept table.SQL&gt; conn scott/tiger@db02Connected.SQL&gt; select * from dept;DEPTNO DNAME LOC---------- -------------- -------------10 ACCOUNTING NEW YORK20 RESEARCH DALLAS30 SALES CHICAGO40 OPERATIONS BOSTON50 DUMMY DUMMY --- New rowNote: you can perform any DML operation on Master Definition site “db01” and commit. Changes will update in DB02 site and if you perform any changes in DB02 db then update will changes in DB01 vice versa.SQL&gt; conn scott/tiger@db02Connected.SQL&gt; select count(*) from dept;COUNT(*)----------5--Delete One row in dept table “db02”.SQL&gt; delete dept where dname = 'DUMMY';1 row deleted.SQL&gt; commit;Commit complete.SQL&gt; select count(*) from dept;COUNT(*)----------4SQL&gt; disconnSQL&gt; conn scott/tiger@db01Connected.SQL&gt; select count(*) from dept;COUNT(*)----------4Altering a Replicated Object&lt;br /&gt;Step 1 Connect to the master definition site as the replication administrator.SQL&gt; conn repadmin/repadmin@db01Connected.Step 2 If necessary, then quiesce the master group.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.SUSPEND_MASTER_ACTIVITY (3 gname =&gt; 'scott_repg');4* END;5 /PL/SQL procedure successfully completed.Step 3 In a separate SQL*Plus session, check the status of the master group you are quiescing.Do not proceed until the group's status is QUIESCED.SQL&gt; SELECT GNAME, STATUS FROM DBA_REPGROUP;GNAME STATUS------------------------------ ---------SCOTT_REPG QUIESCING Step 4 Alter the replicated object.SQL&gt; EDWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.ALTER_MASTER_REPOBJECT (3 sname =&gt; 'SCOTT',4 oname =&gt; 'dept',5 type =&gt; 'TABLE',6 ddl_text =&gt; 'ALTER TABLE SCOTT.DEPT ADD (timestamp DATE)');7* END;SQL&gt; /PL/SQL procedure successfully completed.Note: Add Timestamp column in scott.dept@db01 tableStep 5 Regenerate replication support for the altered object.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.GENERATE_REPLICATION_SUPPORT (3 sname =&gt; 'scott',4 oname =&gt; 'dept',5 type =&gt; 'TABLE',6 min_communication =&gt; TRUE);7* END;8 /PL/SQL procedure successfully completed.Step 6 In a separate SQL*Plus session, check if DBA_REPCATLOG is empty.SQL&gt; select count(*) from dba_repcatlog;COUNT(*)----------0Note: Do not proceed until this view is empty.Step 7 Resume replication activity.SQL&gt; edWrote file afiedt.buf1 BEGIN2 DBMS_REPCAT.RESUME_MASTER_ACTIVITY (3 gname =&gt; 'scott_repg');4* END;SQL&gt; /PL/SQL procedure successfully completed.Now check dept table in both database at “db01” or “db02”.SQL&gt; conn scott/tiger@db01Connected.SQL&gt; desc deptName Null? Type----------------------------------------- -------- -------------------DEPTNO NOT NULL NUMBER(2)DNAME VARCHAR2(14)LOC VARCHAR2(13)TIMESTAMP DATESQL&gt; conn scott/tiger@db02Connected.SQL&gt; desc deptName Null? Type----------------------------------------- -------- -------------------DEPTNO NOT NULL NUMBER(2)DNAME VARCHAR2(14)LOC VARCHAR2(13)TIMESTAMP DATEListing the Master Sites Participating in a Master Group&lt;br /&gt;Here I created two DB, one is master definition site and other is Master site.Through below query we can fintout which one is master definition site or which is master site.SQL&gt; conn repadmin/repadmin@db01Connected.SQL&gt; COLUMN GNAME HEADING 'Master Group' FORMAT A20SQL&gt; COLUMN DBLINK HEADING 'Sites' FORMAT A25SQL&gt; COLUMN MASTERDEF HEADING 'MasterDefinitionSite?' FORMAT A10SQL&gt; SELECT GNAME, DBLINK, MASTERDEF2 FROM DBA_REPSITES3 WHERE MASTER = 'Y'4 AND GNAME NOT IN (SELECT GNAME FROM DBA_REPSITES WHERE SNAPMASTER = 'Y')5 ORDER BY GNAME;MasterDefinitionMaster Group Sites Site?-------------------- ------------------------- ----------SCOTT_REPG DB02 NSCOTT_REPG DB01 YNote: DB02 is master site and DB01 is master definition site.&lt;br /&gt;What is Advance Replication?Replication is the process of copying and maintaining database objects, such as tables, in multiple databases that make up a distributed database system. Changes applied at one site are captured and stored locally before being forwarded and applied at each of the remote locations. Advanced Replication is a fully integrated feature of the Oracle server; it is not a separate server.Replication uses distributed database technology to share data between multiple sites, but a replicated database and a distributed database are not the same. In a distributed database, data is available at many locations, but a particular table resides at only one location. For example, the employees table resides at only the ny.world database in a distributed database system that also includes the hk.world and la.world databases. Replication means that the same data is available at multiple locations. For example, the employees table is available at ny.world, hk.world, and la.world.Some of the common reasons for using replication are:&lt;br /&gt;AvailabilityReplication improves the availability of applications because it provides them with alternative data access options. If one site becomes unavailable, then users can continue to query or even update the remaining locations. In other words, replication provides excellent failover protection.PerformanceReplication provides fast, local access to shared data because it balances activity over multiple sites. Some users can access one server while other users access different servers, thereby reducing the load at all servers. Also, users can access data from the replication site that has the lowest access cost, which is typically the site that is geographically closest to them.Disconnected computingA materialized view is a complete or partial copy (replica) of a target table from a single point in time. Materialized views enable users to work on a subset of a database while disconnected from the central database server. Later, when a connection is established, users can synchronize (refresh) materialized views on demand. When users refresh materialized views, they update the central database with all of their changes, and they receive any changes that may have happened while they were disconnected.Network load reductionReplication can be used to distribute data over multiple regional locations. Then, applications can access various regional servers instead of accessing one central server. This configuration can reduce network load dramatically.Architecture of advance replication&lt;a href="http://3.bp.blogspot.com/_laYcwaJBJNw/Ry8QLSwcCqI/AAAAAAAAATk/ZWJXU33bclA/s1600-h/rarovera.gif"&gt;&lt;/a&gt;There are two types of Advance Replication&lt;br /&gt;1. Multimaster Replication2. Materialized view replication1. Multimaster replicationStart --- &gt; set up master site --- &gt; Select object for replication --- &gt; Create Group for selected objects --- &gt; if conflict possible then configure conflict resolution ---&gt; end2. Materialized view replicationStart --- &gt; set up master site -- &gt; set up materialized view site --- &gt; create materialized view group --- &gt; endNote: In Detail explanation is Part-II, III.Replication SitesA replication group can exist at multiple replication sites. Replication environments support two basic types of sites: master sites and materialized view sites. One site can be both a master site for one replication group and a materialized view site for a different replication group. However, one site cannot be both the master site and the materialized view site for the same replication group.The differences between master sites and materialized view sites are the following:Replication Group1. A replication group at a master site is more specifically referred to as a master group.2. A replication group at a materialized view site is based on a master group and is more specifically referred to as a materialized view group.Replication Objects1. A master site maintains a complete copy of all objects in a replication group,Example: if the hr_repg master group contains the table’s employees and departments, then all of the master sites participating in a master group must maintain a complete copy of employees and departments.2. Materialized views at a materialized view site can contain all or a subset of the table data within a master group.Example: one materialized view site might contain only a materialized view of the employees table, while another materialized view site might contain materialized views of both the employees and departments tables.Communication with master sites1. All master sites in a multimaster replication environment communicate directly with one another to continually propagate data changes in the replication group2. Materialized view sites contain an image, or materialized view, of the table data from a certain point in time.Replication ObjectsA replication object is a database object existing on multiple servers in a distributed database system. In a replication environment, any updates made to a replication object at one site are applied to the copies at all other sites. Advanced Replication enables you to replicate the following types of objects:• Tables • Indexes • Views and Object Views • Packages and Package Bodies • Procedures and Functions • User-Defined Types and Type Bodies • Triggers • Synonyms • Index types • User-Defined Operators Replication GroupsIn a replication environment, Oracle manages replication objects using replication groups. A replication group is a collection of replication objects that are logically related.By organizing related database objects within a replication group, it is easier to administer many objects together. Typically, you create and use a replication group to organize the schema objects necessary to support a particular database application. However, replication groups and schemas do not need to correspond with one another. A replication group can contain objects from multiple schemas, and a single schema can have objects in multiple replication groups. However, each replication object can be a member of only one replication group.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5421618303859859473?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5421618303859859473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5421618303859859473' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5421618303859859473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5421618303859859473'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/master-replication.html' title='Master Replication'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6329271855065106292</id><published>2008-06-03T03:59:00.001-07:00</published><updated>2008-06-03T03:59:42.031-07:00</updated><title type='text'>Index Fragmentation / Rebuild</title><content type='html'>First analyze index&lt;br /&gt;SQL&gt;analyze index INDEX_NAME validate structure;Then query INDEX_STATS view1. If del_lf_rows/lf_rows is &gt; .2 then index should be rebuild.2. If height is 4 then index should be rebuild.3. If lf_rows is lower than lf_blks then index should be rebuild.&lt;br /&gt;SQL&gt; column status format a10SQL&gt; select trunc((del_lf_rows/lf_rows)*100,2)'%' "status" from index_stats;status----------21.83%How to remove index fragmentation?There are two way to remove fragmentation.1. index coalesce2. index rebuildWhat is difference between coalesce and rebuild please go through below link for more details&lt;a href="http://download.oracle.com/docs/cd/B14117_01/server.101/b10739/indexes.htm#g1007548" z9gy_="0" nztue="0"&gt;http://download.oracle.com/docs/cd/B14117_01/server.101/b10739/indexes.htm#g1007548&lt;/a&gt;&lt;br /&gt;SQL&gt; alter index IDX_OBJ_ID coalesce;SQL&gt; alter index IDX_OBJ_ID rebuild;SQL&gt; alter index IDX_OBJ_ID rebuild online;Note: If any DML statement is running on base table then we have to use ONLINE keyword with index rebuilding.&lt;br /&gt;SQL&gt; analyze index idx_obj_id validate structure;Index analyzed.SQL&gt; select trunc((del_lf_rows/lf_rows)*100,2)'%' "status" from index_stats;status-------40.85%SQL&gt; alter index IDX_OBJ_ID rebuild online;Index altered.SQL&gt; analyze index idx_obj_id validate structure;Index analyzed.SQL&gt; select trunc((del_lf_rows/lf_rows)*100,2)'%' "status" from index_stats;status--------0%Note: Index rebuild when index is fragmented or it is needed, otherwise index rebuilding is myth for &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink5" onmouseover="adlinkMouseOver(event,this,5);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,5);" onmouseout="adlinkMouseOut(event,this,5);" href="http://dbataj.blogspot.com/search?updated-min=2007-01-01T00%3A00%3A00%2B04%3A00&amp;amp;updated-max=2008-01-01T00%3A00%3A00%2B04%3A00&amp;amp;max-results=50#" target="_top"&gt;improve performance&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6329271855065106292?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6329271855065106292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6329271855065106292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6329271855065106292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6329271855065106292'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/index-fragmentation-rebuild.html' title='Index Fragmentation / Rebuild'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-2093306381148043297</id><published>2008-06-03T03:58:00.000-07:00</published><updated>2008-06-03T03:59:02.692-07:00</updated><title type='text'>Data file fragmentation and Data file resize</title><content type='html'>There is no fragmentation at datafile level but sometime datafile is created in big size and actually data in datafile is very less then we can resize datafile to reduce database size.We can reduce datafile size upto HWM (High Water Mark)&lt;br /&gt;SQL&gt; select df.file_name,round(df.bytes/1024/1024) TotalSize,fs.FreeSizefrom dba_data_files df,(select file_id,round(sum(bytes/1024/1024)) FreeSizefrom dba_free_spacegroup by file_id) fswhere df.file_id=fs.file_id(+)order by 2,3 descFILE_NAME TOTALSIZE FREESIZE-------------------------------------------------- ---------- ----------D:\ORACLE\PRODUCT\10.1.0\ORADATA\USERS01.DBF 46 1D:\BIG01.DBF 100 100D:\ORACLE\PRODUCT\10.1.0\ORADATA\UNDOTBS01.DBF 465 436D:\ORACLE\PRODUCT\10.1.0\ORADATA\SYSTEM01.DBF 620 63D:\ORACLE\PRODUCT\10.1.0\ORADATA\SYSAUX01.DBF 700 32Note: Size in MB (Mega Bytes)Two datafiles which we can reduce 1.big01.dbf 2.undotbs01.dbf&lt;br /&gt;SQL&gt; alter databasedatafile ‘d:\big01.dbf’ resize 50m;Database altered.SQL&gt; alter databasedatafile 'd:\oracle\product\10.1.0\oradata\undotbs01.dbf' resize 100m;alter database*ERROR at line 1:ORA-03297: file contains used data beyond requested RESIZE : ORA-03297 error happens because we are trying to reduce datafile below HWM and it is not possible. Go through above link and check from where you can reduce datafile size.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-2093306381148043297?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/2093306381148043297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=2093306381148043297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2093306381148043297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2093306381148043297'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/data-file-fragmentation-and-data-file.html' title='Data file fragmentation and Data file resize'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-2502724667489377389</id><published>2008-06-03T03:57:00.002-07:00</published><updated>2008-06-03T03:58:08.558-07:00</updated><title type='text'>OS Authentication</title><content type='html'>• Once authenticated by the operating system, users can connect to Oracle more conveniently, without specifying a user name or password. For example, an operating-system-authenticated user can invoke SQL*Plus and skip the user name and password prompts by entering the following:SQLPLUS / • With control over user authentication centralized in the operating system, Oracle need not store or manage user passwords, though it still maintains user names in the database.• Audit trails in the database and operating system use the same user names.Note: When an operating system is used to authenticate database users, managing distributed database environments and database links requires special care.OS Authentication Configuration Steps&lt;br /&gt;1. Create OS user2. Set below parameters.alter system set os_authent_prefix = ‘OPS$’ scope=spfile;Note: Default parameter value is “OPS$” If OS user is member of &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink4" onmouseover="adlinkMouseOver(event,this,4);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,4);" onmouseout="adlinkMouseOut(event,this,4);" href="http://dbataj.blogspot.com/search?updated-min=2007-01-01T00%3A00%3A00%2B04%3A00&amp;amp;updated-max=2008-01-01T00%3A00%3A00%2B04%3A00&amp;amp;max-results=50#" target="_top"&gt;domain&lt;/a&gt; group then also set below parameter.alter system set remote_os_authent=TRUE scope=spfile;Note: Default parameter value is FALSE, 3. Edit sqlnet.ora file and set below line to NTS Sqlnet.authentication_services=(NTS)4. Bounce databaseshutdown immediatestartup5. Create Oracle User for OS authenticationFirst check OS usernameselect sys_context(‘USERENV’,’OS_USER’) from dual;create user “OPS$USERNAME” identified by EXTERNALLY;Note: Oracle username is must be same as OS user name and must be started with “OPS$”.6. Test to connect through OS authenticationsqlplus /&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-2502724667489377389?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/2502724667489377389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=2502724667489377389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2502724667489377389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/2502724667489377389'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/os-authentication.html' title='OS Authentication'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5071953934704604576</id><published>2008-06-03T03:57:00.001-07:00</published><updated>2008-06-03T03:57:40.417-07:00</updated><title type='text'>Relocate Database Files</title><content type='html'>Three files is called database files1. Datafiles &amp;amp; Tempfiles2. Control files3. Redo log files&lt;br /&gt;Sometime we need to move database files from old to new location.How to move DATAFILES from old to new locationExcept SYSTEM,UNDO &amp;amp; TEMP tablespaceStep:1. Take tablespace offlinealter tablespace tbsname OFFLINE;2. through OS command MOVE datafiles from old to new location.mv 'old location' to 'new location'3. rename datafiles in database.alter database rename file 'old location' to 'new location';4. Take tablespace ONLINEalter tablespace tbsname ONLINE;For SYSTEM or UNDO tablespaceStep:1. shutdown databaseshutdown immediate;2. move datafile old to new location through OS command.mv old location new location3. startup database with mount stage.startup mount;4. rename datafile in databasealter databaserename file 'old location' to 'new location';5. open database for normal usealter database open;We can't relocate tempfile, if we need to relocate tempfile then best option is recreate temp tablespace with new location.How to move REDO LOG MEMBER from old to new location&lt;br /&gt;Step:1. shutdown databaseshutdown immediate;2. mv redo log member from old to new locationmv oldlocation newlocation3. startup database with mount stagestartup mount;4. rename redo log member in databasealter database rename file 'old location' to 'new location';5. open database for normal usealter database open;How to move control file old to new location&lt;br /&gt;Step:1. shutdown databaseshutdown immediate;2. mv controlfile to old to new locationmv old location new location3. edit CONTROL_FILES parameter in pfile and change location from old to newCONTROL_FILES='new location'4. recreate SPFILE from PFILEcreate spfile from pfile;5. startup databasestartup;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5071953934704604576?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5071953934704604576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5071953934704604576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5071953934704604576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5071953934704604576'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/relocate-database-files.html' title='Relocate Database Files'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-3133750030081831098</id><published>2008-06-03T03:56:00.000-07:00</published><updated>2008-06-03T03:57:12.540-07:00</updated><title type='text'>Recovery Catalog</title><content type='html'>What is recovery catalog?Recovery catalog is external database which use to store RMAN repositoryWhat is RMAN repository?RMAN repository is collection of target database which store information about RMAN backup, recovery and maintenance.When recovery catalog is not in used then where RMAN repository stored?When recovery catalog is not in used then RMAN repository store in CONTROLFILE.Where we create recovery catalog?We have two option for it.1. We can create recovery catalog on target database through create separate tablespace for recovery catalog.Or2. We can create separate &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink2" onmouseover="adlinkMouseOver(event,this,2);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,2);" onmouseout="adlinkMouseOut(event,this,2);" href="http://dbataj.blogspot.com/search?updated-min=2007-01-01T00%3A00%3A00%2B04%3A00&amp;amp;updated-max=2008-01-01T00%3A00%3A00%2B04%3A00&amp;amp;max-results=50#" target="_top"&gt;database&lt;/a&gt; for recovery catalog.NOTE: if we have more than one database then separate database for recovery catalog is recommended instead of separate tablespace.How recovery catalog store information about RMAN repository?After creation of recovery catalog we have to manually register each target database to recovery catalog.Should we need to take backup of recovery catalog?Yes, We must take backup of recovery catalog because recovery catalog store most important information about RMAN backup, recovery and RMAN configuration if we lost recovery catalog then we can’t get those information so it is always recommended to take recovery catalog backup.How take recovery catalog backup?1. If recovery catalog created as separate tablespace on target databaseThen just export recovery catalog tablespace and store in backup drive.2. If recovery catalog created as separate database.Then we can use any backup method which we use for target database for instance we can use user managed backup or we can also use RMAN method.Is there any view for query information about recovery catalog?Yes, actually for recovery catalog we need to create separate user. And after user and recovery catalog creation there is some view created in recovery catalog users with RC_ prefix. For instance: RC_DATABASE How to configure recovery catalog for target database?There are three steps for recovery catalog configuration.1. Configure the database that will content the recovery catalog,2. Create owner for recovery catalog3. Create recovery catalog &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink3" onmouseover="adlinkMouseOver(event,this,3);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,3);" onmouseout="adlinkMouseOut(event,this,3);" href="http://dbataj.blogspot.com/search?updated-min=2007-01-01T00%3A00%3A00%2B04%3A00&amp;amp;updated-max=2008-01-01T00%3A00%3A00%2B04%3A00&amp;amp;max-results=50#" target="_top"&gt;SQL&lt;/a&gt;&gt; conn sys@dev as sysdbaEnter password:Connected.SQL&gt; create tablespace CATDB2 datafile 'c:\oracle\catdb01.dbf' size 10m;Tablespace created.NOTE: Here I am create separate tablespace for recovery catalog on target database.SQL&gt;conn sys@dev as sysdbaConnected.SQL&gt; create user CATDB2 identified by CATDB3 default tablespace CATDB;NOTE: Owner for recovery catalogSQL&gt; grant connect,resource to catdb;Grant succeeded.SQL&gt; grant recovery_catalog_owner to CATDB;Grant succeeded.NOTE: Grant the RECOVERY_CATALOG_OWNER role to the schema owner. This role provides the user with all privileges required to maintain and query the recovery catalog.C:\&gt;rmanRecovery Manager: Release 10.1.0.5.0 - ProductionCopyright (c) 1995, 2004, Oracle. All rights reserved.RMAN&gt; connect catalog catdb/catdb@devconnected to recovery catalog databaserecovery catalog is not installedRMAN&gt; create catalog tablespace CATDB;recovery catalog createdNOTE: now recovery catalog is created.SQL&gt; conn catdb/catdb@devConnected.SQL&gt; select table_name from user_tables where rownum =1;TABLE_NAME------------------------------RCVERNOTE: after recovery catalog creation we can check all recovery catalog views is created in recovery catalog owner.What we do after create recovery catalog?Now just register target database to recovery catalog and store RMAN repository in recovery catalog.C:\&gt;rman target sys@dev catalog catdb/catdb@devRecovery Manager: Release 10.1.0.5.0 - ProductionCopyright (c) 1995, 2004, Oracle. All rights reserved.target database Password:connected to target database: DEV (DBID=3718891706)connected to recovery catalog databaseRMAN&gt; register database;database registered in recovery catalogstarting full resync of recovery catalogfull resync completeNOTE: “target sys@dev” is use for target database which we want to register to recovery catalog through recovery catalog owner “catdb/catdb@dev”.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-3133750030081831098?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/3133750030081831098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=3133750030081831098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3133750030081831098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3133750030081831098'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/recovery-catalog.html' title='Recovery Catalog'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-3073276018212786539</id><published>2008-06-03T03:55:00.000-07:00</published><updated>2008-06-03T03:56:32.791-07:00</updated><title type='text'>Redo Log File Status</title><content type='html'>Redo log file is very crucial for &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink1" onmouseover="adlinkMouseOver(event,this,1);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,1);" onmouseout="adlinkMouseOut(event,this,1);" href="http://dbataj.blogspot.com/search?updated-min=2007-01-01T00%3A00%3A00%2B04%3A00&amp;amp;updated-max=2008-01-01T00%3A00%3A00%2B04%3A00&amp;amp;max-results=50#" target="_top"&gt;database recovery&lt;/a&gt;...and most of time we confuse about "status" of v$log file for redo log files.&lt;br /&gt;1. UNUSEDWhenever you create any redo log file ...that time v$log view showing status "UNUSED"2. CURRENTAfter Creation when redo log "lgwr" process use that file ....that time v$log view showing status "CURRENT"3. ACTIVEIf database running in archivelog mode then after log switch "arch" process use log file and create archivelog file that time v$Log file view showing status "ACTIVE"4. CLEARINGWhenever any log file is corrupted or missing ( which is not "active" or not "current") then we use "alter database clear logfile" statement to recreate corrupted log file ... that time v$log view showing status "CLEARING" after clearing it is showing "UNUSED"5. INACTIVEDuring archivelog file creation v$log view showing status "ACTIVE" and when archivelog file is created then it is showing "INACTIVE" for particular one redo log file at a time.6. CLEARING_CURRENTIf any error occured during "alter database clear logfile" then v$log file view showing "CLEARING_CURRENT".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-3073276018212786539?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/3073276018212786539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=3073276018212786539' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3073276018212786539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/3073276018212786539'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/redo-log-file-status.html' title='Redo Log File Status'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-6981534307460068844</id><published>2008-06-03T03:53:00.000-07:00</published><updated>2008-06-03T03:54:07.573-07:00</updated><title type='text'>During Import table created in wrong tablespace.</title><content type='html'>During import table is created in other than default tablespace is happen what is reason.Suppose we have two databases.1. Orcl2. HgcNow i created one table in ORCL database in SYSTEM tablespace.&lt;br /&gt;SQL&gt; create table test_orcl ( no number) tablespace SYSTEM;Table created.Now in HGC database i import above created table in user default tablespace.&lt;br /&gt;SQL&gt; conn system/oracle@hgcConnected.SQL&gt; alter user scott default tablespace USERS;User altered.NOTE: 1. I assign default tablespace "USERS" to scott user which import table.2. Scott user having "connect" &amp;amp; "resource" role privilegesQuestion: NOW TELL me during IMPORT in which tablespace "USERS" or "SYSTEM" tbs table "test_orcl" created ?NOW guess your answer..we will check later ...&lt;br /&gt;SQL&gt; conn scott/tiger@OrclConnected.SQL&gt; host exp scott/tiger@Orcl file=c:\test_orcl.dmp tables=test_orclExport: Release 10.1.0.5.0 - Production on Wed Jan 2 11:59:18 2008Copyright (c) 1982, 2005, Oracle. All rights reserved.. . exporting table TEST_ORCL 0 rows exportedExport terminated successfully without warnings.NOW import table in HGC database.&lt;br /&gt;SQL&gt; conn scott/tiger@HGCConnected.SQL&gt; host imp scott/tiger@HGC file=c:\test_orcl.dmp fromuser=scott touser=scottImport: Release 10.1.0.5.0 - Production on Wed Jan 2 12:02:26 2008Copyright (c) 1982, 2005, Oracle. All rights reserved.. . importing table "TEST_ORCL" 0 rows importedImport terminated successfully without warnings.now we check in which tablespace table is created ?&lt;br /&gt;SQL&gt; select table_name,tablespace_name2 from user_tables3 where table_name='TEST_ORCL';TABLE_NAME TABLESPACE_NAME------------------------------ ------------------------------TEST_ORCL SYSTEMofh table is created in SYSTEM tablespace instead of user default tablespace means "USERS' why it so ?Again import table but now make one changes ...1. Revoke "resource" role and grant explicit quota on tablespace to user.&lt;br /&gt;SQL&gt; conn system/oracle@hgcConnected.SQL&gt; revoke resource from scott;Revoke succeeded.SQL&gt; alter user scott quota 100m on users;User altered.NOW import again...&lt;br /&gt;SQL&gt; conn scott/tiger@hgcConnected.SQL&gt; drop table test_orcl purge;Table dropped.SQL&gt; host imp scott/tiger@HGC file=c:\test_orcl.dmp fromuser=scott touser=scottImport: Release 10.1.0.5.0 - Production on Wed Jan 2 12:06:51 2008Copyright (c) 1982, 2005, Oracle. All rights reserved.. . importing table "TEST_ORCL" 0 rows importedImport terminated successfully without warnings.SQL&gt; select table_name,tablespace_name2 from user_tables3 where table_name='TEST_ORCL';TABLE_NAME TABLESPACE_NAME------------------------------ ------------------------------TEST_ORCL USERSBut what is actual reason...?1. Resource role having "unlimited tablespace" privileges means database user have quota on all tablespace in database if user having "unlimited tablespace" privileges.2. table is created in "system" tablespace becuase tables is actually created in SYSTEM tablespace on "ORCL" database during first time creation.&lt;br /&gt;Export file created by EXPORT:V10.01.00 via conventional pathimport done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set"CREATE TABLE "TEST_ORCL" ("NO" NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 1 MA""XTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL ""DEFAULT) TABLESPACE "SYSTEM" LOGGING NOCOMPRESS". . skipping table "TEST_ORCL"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-6981534307460068844?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/6981534307460068844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=6981534307460068844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6981534307460068844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/6981534307460068844'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/during-import-table-created-in-wrong.html' title='During Import table created in wrong tablespace.'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-7456408008163058089</id><published>2008-06-03T03:52:00.001-07:00</published><updated>2008-06-03T03:52:39.608-07:00</updated><title type='text'>How to Drop Datafile from tablespace</title><content type='html'>How to Drop Datafile from tablespace.Datafile is physical part of database and it is take storage device /file system to store/save oracle data.Whenever datafile grow more space needed, sametime unwanted datafile created, sametime datafile created in wrong tablespace then we need to drop datafile.Below is overview to drop a datafile from tablespace NOTE: Use below procedure after test on TESTING database.Oracle 8iThere is no direct sql command to drop datafile from tablespace.In that case we need to drop tablespace after move all data to new tablespace.1. create new tablespace2. move all table to new tablespace3. move all index to new tablespace4. move all other objects to new tablespace5. drop old tablespace with including contents;6. through OS command remove all datafiles belongs to droped tablespace.Oracle 9ir1Again There is no direct sql command to drop datafile from tablespace.In that case we need to drop tablespace after move all data to new tablespace.1. create new tablespace2. move all table to new tablespace3. move all index to new tablespace4. move all other objects to new tablespace5. drop old tablespace with including contents and datafiles;NOTE: Oracle9ir1 is introduce “and datafiles” clause with drop tablespace statement which remove datafiles from file system.Oracle 9ir2Again There is no direct sql command to drop datafile from tablespace.In that case we need to drop tablespace after move all data to new tablespace.1. create new tablespace2. move all table to new tablespace3. move all index to new tablespace4. move all other objects to new tablespace5. drop old tablespace with including contents and datafiles;But we can drop TEMPFILE through below statement.SQL&gt; alter database tempfile ‘/u02/oracle/temp01.dbf’ drop including datafiles;[not tested]Oracle 10gr1Same like Oracle 9ir2Oracle 10gr2Now in 10gr2 oracle introduce to drop datafile or tempfile from tablespace through single sql command with few restrictions.From Oracle Documentation:You use the DROP DATAFILE and DROP TEMPFILE clauses of the ALTER TABLESPACE command to drop a single datafile or tempfile. The datafile must be empty. (A datafile is considered to be empty when no extents remain allocated from it.) When you drop a datafile or tempfile, references to the datafile or tempfile are removed from the data dictionary and control files, and the physical file is deleted from the file system or Automatic Storage Management (ASM) disk group.Datafiles:Alter tablespace data DROP DATAFILE ‘/u02/data01.dbf’;Tempfiles:Alter tablespace temp DROP TEMPFILE ‘/u02/temp01.dbf’;Restrictions for drop datafilesThe following are restrictions for dropping datafiles and tempfiles:• The database must be open.• If a datafile is not empty, it cannot be dropped.If you must remove a datafile that is not empty and that cannot be made empty by dropping schema objects, you must drop the tablespace that contains the datafile.• You cannot drop the first or only datafile in a tablespace.This means that DROP DATAFILE cannot be used with a bigfile tablespace.• You cannot drop datafiles in a read-only tablespace.• You cannot drop datafiles in the SYSTEM tablespace.• If a datafile in a locally managed tablespace is offline, it cannot be droppedOracle 11gr1Same like Oracle 10gr2Reference:&lt;a href="http://www.akadia.com/services/ora_remove_datafile.html"&gt;http://www.akadia.com/services/ora_remove_datafile.html&lt;/a&gt;&lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/dfiles.htm#sthref1396"&gt;http://download.oracle.com/docs/cd/B19306_01/server.102/b14231/dfiles.htm#sthref1396&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-7456408008163058089?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/7456408008163058089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=7456408008163058089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/7456408008163058089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/7456408008163058089'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/how-to-drop-datafile-from-tablespace.html' title='How to Drop Datafile from tablespace'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-5572320019206480560</id><published>2008-06-03T03:51:00.000-07:00</published><updated>2008-06-03T03:52:05.792-07:00</updated><title type='text'>Database &amp; Patch set Upgrade</title><content type='html'>Database &amp;amp; patch upgrade is one of the most important work for Database Administrator.Before going further first understand what are “upgrade” &amp;amp; “migration” &amp;amp; “patch set” &amp;amp; “CPU patch” word.Upgrade:Usually use for oracle database upgrade.Eg: upgrade from oracle 9i to oracle 10g.Migration:Usually use for migrate non oracle database to oracle database.Eg: From SQL server database to oracle databasePatch set:There are two types of patch upgrade 1. Patch set updateFrom one oracle version to another oracle version Eg: oracle 9i to oracle 10gNOTE: Patch set based on oracle base release Eg: oracle 10gr1 (10.1.0.2.0) and for 10gr2 (10.2.0.1.0)2. CPU patch (Critical Patch update)Patches is apply for fix database bug suppose after apply latest patch set for current release if there is any bug occur then oracle release cpu patches in regular interval to fix those bug.Eg: oracle 10gr1 base rel: 10.1.0.2.0, Latest Patch set: 10.1.0.5.0, Latest CPU patch: Jan-08 CPU patch for 10.1.0.5.0NOTE: CPU patch based on latest patch set.For more info: &lt;a href="http://www.oracle.com/technology/deploy/security/alerts.htm"&gt;http://www.oracle.com/technology/deploy/security/alerts.htm&lt;/a&gt;How to upgrade database to oracle 10gr2?Determine the Upgrade Path to the New Oracle Database 10g Release&lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/preup.htm#i1007814"&gt;http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/preup.htm#i1007814&lt;/a&gt;Before upgrading process we need to define upgrade methodThere are four methods to upgrade our database1. DBUA (Database upgrade assistant)2. Manually upgrade3. Export/Import4. Data copying&lt;a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/preup.htm#i694345"&gt;http://download.oracle.com/docs/cd/B19306_01/server.102/b14238/preup.htm#i694345&lt;/a&gt;Patch set upgrade example:1. From oracle 9ir2 (9.2.0.2 to 9.2.0.8) on Windows &lt;a href="http://babudba.blogspot.com/2007/11/patch-installation.html"&gt;http://babudba.blogspot.com/2007/11/patch-installation.html&lt;/a&gt;2. From oracle 9ir2 (9.2.0.1 to 9.2.0.7) on Solaris &lt;a href="http://sabdarsyed.blogspot.com/2007/02/upgrade-oracle-database-9201-to-9207-on.html"&gt;http://sabdarsyed.blogspot.com/2007/02/upgrade-oracle-database-9201-to-9207-on.html&lt;/a&gt;3. From oracle 10gr1 (10.1.0.2 to 10.1.0.5) on windows&lt;a href="http://dbataj.blogspot.com/2007/06/upgrading-database-from-101020-to.html"&gt;http://dbataj.blogspot.com/2007/06/upgrading-database-from-101020-to.html&lt;/a&gt;4. From oracle 10gr2 (10.2.0.2 to 10.2.0.3) on windows&lt;a href="http://babudba.blogspot.com/2007/11/upgrade-oracle-10202-to-10203.html"&gt;http://babudba.blogspot.com/2007/11/upgrade-oracle-10202-to-10203.html&lt;/a&gt;5. From oracle 10gr2 (10.2.0.1 to 10.2.0.3) on Linux&lt;a href="http://sabdarsyed.blogspot.com/2007/03/upgrading-oracle-database-server-10g.html"&gt;http://sabdarsyed.blogspot.com/2007/03/upgrading-oracle-database-server-10g.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-5572320019206480560?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/5572320019206480560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=5572320019206480560' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5572320019206480560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/5572320019206480560'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/database-patch-set-upgrade.html' title='Database &amp; Patch set Upgrade'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-1499872083228011004</id><published>2008-06-03T03:50:00.000-07:00</published><updated>2008-12-12T15:20:07.497-08:00</updated><title type='text'>Critical Patch Update</title><content type='html'>Example : Below procedure based on our test enviourment if you follow this instruction please go through README.&lt;a class="kLink" oncontextmenu="return false;" id="KonaLink0" onmouseover="adlinkMouseOver(event,this,0);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,0);" onmouseout="adlinkMouseOut(event,this,0);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;TXT file&lt;/a&gt; comes with PATCH SET.Patch Installation Procedures for Oracle Database Release 10.1.0.5Patch Number : p5907304_10105_WINNT.zip&lt;a class="kLink" oncontextmenu="return false;" id="KonaLink1" onmouseover="adlinkMouseOver(event,this,1);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,1);" onmouseout="adlinkMouseOut(event,this,1);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;SYSTEM&lt;/a&gt; Overview&lt;br /&gt;Platforms : Windows XP SP2Database : 10.1.0.5.0OPatch Utility InformationYou must use the OPatch utility release 1.0.0.0.57 or later. You can download it from OracleMetaLink with patch 2617419.Check Oracle Inventory SetupC:\&gt;set ORACLE_SID=ORCLC:\&gt;set ORACLE_HOME=c:\oracle\product\10.1.0\db_1C:\&gt;cd c:\oracle\product\10.1.0\db_1\opatchC:\Oracle\product\10.1.0\Db_1\OPatch&gt;opatch lsinventoryOracle Interim Patch Installer version 1.0.0.0.53Note: if Opatch utility version is &lt;= 1.0.0.0.53 then you have to download OPATCH utility from metalink site.[output cut]Oracle Home = c:\oracle\product\10.1.0\db_1Location of Oracle Universal Installer components = C:\oracle\product\10.1.0\db_1\ouiLocation of OraInstaller.jar = "C:\oracle\product\10.1.0\db_1\oui\jlib"Oracle Universal Installer shared library = C:\oracle\product\10.1.0\db_1\oui\lib\win32\oraInstaller.dllLocation of Oracle Inventory Pointer = N/ALocation of Oracle Inventory = C:\oracle\product\10.1.0\db_1\inventoryPath to &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink2" onmouseover="adlinkMouseOver(event,this,2);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,2);" onmouseout="adlinkMouseOut(event,this,2);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;Java&lt;/a&gt; = "C:\oracle\product\10.1.0\db_1\jre\1.4.2\bin\java.exe"Log file = c:\oracle\product\10.1.0\db_1/.patch_storage//*.logCreating log file "C:\oracle\product\10.1.0\db_1\.patch_storage\LsInventory__06-13-2007_20-18-49.log"Result:There is no Interim PatchOPatch succeeded.OPatch returns with &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink3" onmouseover="adlinkMouseOver(event,this,3);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,3);" onmouseout="adlinkMouseOut(event,this,3);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;error code&lt;/a&gt; = 0Preinstallation Instructions1. Ensure that your Oracle Database installation is the same release for which you are applying this patch.2. Back up the current database that is installed--&gt;ORACLE_HOME or ORA INVENTORY3. Perform a clean shutdown of all Oracle servicesC:\&gt;net stop OracleServiceORCLThe following services are dependent on the OracleServiceORCL service.Stopping the OracleServiceORCL service will also stop these services.OracleDBConsoleorclDo you want to continue this operation? (Y/N) [N]: YThe OracleDBConsoleorcl service is stopping...............The OracleDBConsoleorcl service was stopped successfully.The OracleServiceORCL service is stopping...........The OracleServiceORCL service was stopped successfully.C:\&gt;net stop OracleServiceCATDBThe OracleServiceCATDB service is stopping......The OracleServiceCATDB service was stopped successfully.C:\&gt;LSNRCTL stopLSNRCTL for 32-bit Windows: Version 10.1.0.5.0 - Production on 13-JUN-2007 20:30:30Copyright (c) 1991, 2004, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))The command completed successfullyC:\&gt;net stop OracleCSServiceThe OracleCSService service was stopped successfully.C:\&gt;net stop OracleOraDb10g_home1iSQL*Plus..The OracleOraDb10g_home1iSQL*Plus service was stopped successfully.4. Set the PERL5LIB and PATH &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink4" onmouseover="adlinkMouseOver(event,this,4);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,4);" onmouseout="adlinkMouseOut(event,this,4);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;environment variables&lt;/a&gt; to point to Perl in Oracle Home C:\&gt;set PERL5LIB=C:\oracle\product\10.1.0\db_1\perl\5.6.1\lib;%PERL5LIB%C:\&gt;set PATH=C:\oracle\product\10.1.0\db_1\perl\5.6.1\bin\MSWin32-x86;%PATH%5. set ORACLE_HOME variableC:\&gt;set ORACLE_HOME=c:\oracle\product\10.1.0\db_16. Check if the java and jar executables are present in your Oracle Home--&gt;JAVA = %ORACLE_HOME%\jre\\bin--&gt;JAR = %ORACLE_HOME%\jdk\bin7. Go to directory where download the patchC:\Oracle\product\10.1.0\Db_1\OPatch&gt;opatch apply c:\5907304&lt;a href="http://1.bp.blogspot.com/_laYcwaJBJNw/RnAf5sqYkAI/AAAAAAAAARw/ZR_NqmHU3p4/s1600-h/clip_image002.jpg"&gt;&lt;/a&gt;Post Installation Instructions1. Start All Oracle Services.C:\&gt;net start OracleServiceORCLC:\&gt;net start OracleServiceCATDBC:\&gt;set ORACLE_SID=orclC:\&gt;emctl start dbconsoleC:\&gt;LSNRCTL startC:\&gt;net start OracleCSServiceC:\&gt;net start OracleOraDb10g_home1iSQL*Plus2. For each &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink5" onmouseover="adlinkMouseOver(event,this,5);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,5);" onmouseout="adlinkMouseOut(event,this,5);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;database&lt;/a&gt; instance running out of the ORACLE_HOME being patched, connect to the database using SQL*Plus as SYSDBA and run catcpu.&lt;a class="kLink" oncontextmenu="return false;" id="KonaLink6" onmouseover="adlinkMouseOver(event,this,6);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,6);" onmouseout="adlinkMouseOut(event,this,6);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;sql&lt;/a&gt; as follows:C:\&gt;rem go to CPU directoryC:\&gt;CD C:\oracle\product\10.1.0\db_1\&lt;a class="kLink" oncontextmenu="return false;" id="KonaLink7" onmouseover="adlinkMouseOver(event,this,7);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,7);" onmouseout="adlinkMouseOut(event,this,7);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;CPU&lt;/a&gt;\CPUApr2007C:\Oracle\product\10.1.0\Db_1\cpu\cpuapr2007&gt;sqlplus /nologSQL*Plus: Release 10.1.0.5.0 - Production on Thu Jun 14 08:21:34 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL&gt; conn sys as sysdbaEnter password:Connected.SQL&gt; select instance_name from v$instance;INSTANCE_NAME----------------orclSQL&gt; shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.SQL&gt; STARTUP MIGRATEORACLE instance started.Total System Global Area 356515840 bytesFixed Size 789400 bytesVariable Size 330036328 bytesDatabase Buffers 25165824 bytesRedo Buffers 524288 bytesDatabase mounted.Database opened.SQL&gt; @CATCPU.SQL[OUTPUT CUT]SQL&gt; SHUTDOWN IMMEDIATE;Database closed.Database dismounted.ORACLE instance shut down.SQL&gt; quitIf catcpu.sql reports any Invalid Objects, compile the invalid objects as followsC:\&gt;cd C:\oracle\product\10.1.0\db_1\rdbms\adminC:\Oracle\product\10.1.0\Db_1\RDBMS\ADMIN&gt;sqlplus /nologSQL*Plus: Release 10.1.0.5.0 - Production on Thu Jun 14 08:47:26 2007Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL&gt; conn sys as sysdbaEnter password:Connected to an idle instance.SQL&gt; STARTUPORACLE instance started.Total System Global Area 356515840 bytesFixed Size 789400 bytesVariable Size 330036328 bytesDatabase Buffers 25165824 bytesRedo Buffers 524288 bytesDatabase mounted.Database opened.SQL&gt; @utlprp.sql 0SQL&gt; select OBJECT_NAME from dba_objects where status = 'INVALID';no rows selected3. If any databases have been created without using DBCA (that is, using the command line), and you need to &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink8" onmouseover="adlinkMouseOver(event,this,8);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,8);" onmouseout="adlinkMouseOut(event,this,8);" href="http://dbataj.blogspot.com/2007/06/critical-patch-update.html#" target="_top"&gt;monitor&lt;/a&gt; such a database by using Oracle Enterprise Manager 10g, follow these steps:&gt; sqlplus SYS / AS SYSDBASQL&gt; ALTER USER DBSNMP ACCOUNT UNLOCKSQL&gt; PASSWORD DBSNMPChanging password for DBSNMPNew password: new_passwordRetype new password: new_password&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-1499872083228011004?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/1499872083228011004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=1499872083228011004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1499872083228011004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/1499872083228011004'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/critical-patch-update.html' title='Critical Patch Update'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-527294754488767301</id><published>2008-06-03T03:49:00.001-07:00</published><updated>2008-06-03T03:49:31.967-07:00</updated><title type='text'>Connecting with sys user with Or without pwd</title><content type='html'>As we know "SYS" &amp;amp; "SYSDBA" is superuser privilege in oracle database.There is two method to connect SYSDBA user.&lt;br /&gt;1. WITH PASSWORD2. WITHOUT PASSWORDFor example:SQL&gt; CONN / AS SYSDBA ---without passwordFor without password need follow thing to be done.&lt;br /&gt;1. Oracle Database User must have SYSDBA privileges.2. Operating System User must add in DBA group.On windows: ORA_DBA group On linux: DBA group3. In sqlnet.ora file must content "NTS" in below lineSQLNET.AUTHENTICATION_SERVICES=(NTS)For example:SQL&gt; CONN SYS/PWD AS SYSDBA --- with password or prevent to connect without password.&lt;br /&gt;1. Remove OS user from DBA group2. Edit sqlnet.ora file and change "NONE" to "NTS" in below lineSQLNET.AUTHENTICATION_SERVICES=(NONE)Default Value is NTS when sqlnet.ora file created.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2016638674107330364-527294754488767301?l=pdpshetty.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pdpshetty.blogspot.com/feeds/527294754488767301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2016638674107330364&amp;postID=527294754488767301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/527294754488767301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2016638674107330364/posts/default/527294754488767301'/><link rel='alternate' type='text/html' href='http://pdpshetty.blogspot.com/2008/06/connecting-with-sys-user-with-or.html' title='Connecting with sys user with Or without pwd'/><author><name>PDPSHETTY</name><uri>http://www.blogger.com/profile/10047910922161722628</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp3.blogger.com/_FMCn9lkr7aY/SCBCl2DeHcI/AAAAAAAAACw/Vqd6BWhER5U/S220/pshetty.jpeg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2016638674107330364.post-2865155853385934650</id><published>2008-06-03T03:46:00.000-07:00</published><updated>2008-06-03T03:48:22.594-07:00</updated><title type='text'>Oracle Streams Setup between two database</title><content type='html'>OverviewDatabase Version: 10.1.0.5.0Windows XP sp2&lt;br /&gt;Database Name and TNS nameDB1, db1 (source)DB2, db2 (target)&lt;br /&gt;Set up below parameters on both databases (db1, db2)&lt;br /&gt;1. Enable ARCHIVELOG MODE on both databaseReference: &lt;a href="http://dbatry.blogspot.com/2007/09/how-to-enable-archivelog-mode.html"&gt;http://dbatry.blogspot.com/2007/09/how-to-enable-archivelog-mode.html&lt;/a&gt;&lt;br /&gt;2. Create Stream administrator UserSource Database: DB1SQL&gt; conn &lt;a href="mailto:sys@db1"&gt;sys@db1&lt;/a&gt; as sysdbaEnter password:Connected.SQL&gt; create user strmadmin identified by strmadmin;&lt;br /&gt;User created.&lt;br /&gt;SQL&gt; grant connect, resource, dba to strmadmin;&lt;br /&gt;Grant succeeded.&lt;br /&gt;SQL&gt; begin dbms_streams_auth.grant_admin_privilege2 (grantee =&gt; 'strmadmin',3 grant_privileges =&gt; true);4 end;5 /&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;SQL&gt; grant select_catalog_role, select any dictionary to strmadmin;&lt;br /&gt;Grant succeeded.&lt;br /&gt;Target Database: DB2SQL&gt; conn &lt;a href="mailto:sys@db2"&gt;sys@db2&lt;/a&gt; as sysdbaEnter password:Connected.SQL&gt; create user strmadmin identified by strmadmin;&lt;br /&gt;User created.&lt;br /&gt;SQL&gt; grant connect, resource, dba to strmadmin;&lt;br /&gt;Grant succeeded.&lt;br /&gt;SQL&gt; begin dbms_streams_auth.grant_admin_privilege2 (grantee =&gt; 'strmadmin',3 grant_privileges =&gt; true);4 end;5 /&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;SQL&gt; grant select_catalog_role, select any dictionary to strmadmin;&lt;br /&gt;Grant succeeded.&lt;br /&gt;3. Setup INIT parametersSource Database: DB1SQL&gt; conn &lt;a href="mailto:sys@db1"&gt;sys@db1&lt;/a&gt; as sysdbaEnter password:Connected.SQL&gt; alter system set global_names=true;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter system set streams_pool_size = 100 m;&lt;br /&gt;System altered.&lt;br /&gt;Target Database: DB2SQL&gt; conn &lt;a href="mailto:sys@db2"&gt;sys@db2&lt;/a&gt; as sysdbaEnter password:Connected.SQL&gt; alter system set global_names=true;&lt;br /&gt;System altered.&lt;br /&gt;SQL&gt; alter system set streams_pool_size = 100 m;&lt;br /&gt;System altered.&lt;br /&gt;4. Create Database Link Target Database: DB1SQL&gt; conn &lt;a href="mailto:strm
