<?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-22603407</id><updated>2011-12-30T14:46:08.946+05:30</updated><category term='Address Windowing Extensions (AWE)'/><category term='Performance'/><category term='Installation of Oracle 10G on Solaris'/><category term='Manually un-installed Oracle 10g'/><category term='Cool Scripts'/><category term='Tuning Database Buffer Cache'/><category term='Generate Tablespace Usage Report - Script'/><category term='split'/><category term='Upgradation'/><category term='Samba share'/><category term='Oracle DBA Checklist'/><category term='Autostart/stop DB'/><category term='cron schedule'/><category term='FTP'/><category term='Installation of Oracle 10G on Linux'/><category term='Links'/><category term='Tuning a SQL Statement'/><category term='11G Overview'/><category term='rman'/><category term='Patches'/><category term='VLM'/><category term='AUTOMATIC SHARED MEMORY MANAGEMENT'/><category term='Kernel Configuration'/><category term='hmhpmu'/><category term='Installation'/><title type='text'>Sridhar's oracle page</title><subtitle type='html'>Hey all, this is where I will put random stuff I have no better place to put. A lot of this stuff will be stuff I wanted to write down somewhere for my own reference and didn't know where.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default?start-index=101&amp;max-results=100'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>116</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-22603407.post-6278941553649706533</id><published>2010-04-13T14:59:00.003+05:30</published><updated>2010-04-13T15:06:50.518+05:30</updated><title type='text'>How to know your Oracle database is  32bit or 64bit?</title><content type='html'>&lt;strong&gt;Method 1:&lt;/strong&gt;&lt;br /&gt;oracle &gt;cd $ORACLE_HOME/bin&lt;br /&gt;oracle &gt;file oracle&lt;br /&gt;oracle:         ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not stripped&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Method 2:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;oracle &gt;sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.0.1.4.0 - Production on Tue Apr 13 09:21:49 2010&lt;br /&gt;&lt;br /&gt;(c) Copyright 2001 Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle9i Enterprise Edition Release 9.0.1.5.0 - Production&lt;br /&gt;With the Partitioning option&lt;br /&gt;JServer Release 9.0.1.4.0 - Production&lt;br /&gt;&lt;br /&gt;SQL&gt; select&lt;br /&gt;   length(addr)*4 || '-bits' word_length&lt;br /&gt;from&lt;br /&gt;   v$process&lt;br /&gt;where&lt;br /&gt;   ROWNUM =1;  2    3    4    5    6&lt;br /&gt;&lt;br /&gt;WORD_LENGTH&lt;br /&gt;---------------------------------------------&lt;br /&gt;32-bits&lt;br /&gt;&lt;br /&gt;The third and the simplest one is while you connect to your database if you find any mentioning of the Platform it is 64bit and if not its 32 bits ;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;64 BITS:&lt;br /&gt;&lt;br /&gt;oracle &gt;sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Tue Apr 13 05:35:30 2010&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production&lt;br /&gt;With the Partitioning, OLAP, Data Mining and Real Application Testing options&lt;br /&gt;&lt;br /&gt;32BITS:&lt;br /&gt;&lt;br /&gt;oracle &gt;sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.0.1.4.0 - Production on Tue Apr 13 09:21:49 2010&lt;br /&gt;(c) Copyright 2001 Oracle Corporation.  All rights reserved.&lt;br /&gt;Connected to:&lt;br /&gt;Oracle9i Enterprise Edition Release 9.0.1.5.0 - Production&lt;br /&gt;With the Partitioning option&lt;br /&gt;JServer Release 9.0.1.4.0 - Production&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6278941553649706533?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6278941553649706533/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6278941553649706533' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6278941553649706533'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6278941553649706533'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2010/04/how-to-know-your-oracle-database-is.html' title='How to know your Oracle database is  32bit or 64bit?'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-58427755919045742</id><published>2009-09-08T11:02:00.001+05:30</published><updated>2009-09-08T11:05:05.415+05:30</updated><title type='text'>TNS-00516: Permission denied, Solaris Error: 13: Permission denied</title><content type='html'>Last week our Unix Adminstrators has moved the data related to our Oracle database from a UFS filesystem to a ZFS filesystem on Solaris.&lt;br /&gt;Once the move is completed, when we tried to start the databases and listeners on the server, the databases started normally but we got problems starting the Listeners. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Problem:&lt;br /&gt;DBA TEST ZONE&gt; lsnrctl start LISTENER_ORA8&lt;br /&gt;&lt;br /&gt;LSNRCTL for Solaris: Version 8.0.6.0.0 - Production on 07-SEP-09 10:52:35&lt;br /&gt;&lt;br /&gt;(c) Copyright 1999 Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Starting /usr/app/oracle/product/8.0.6/bin/tnslsnr: please wait...&lt;br /&gt;&lt;br /&gt;TNSLSNR for Solaris: Version 8.0.6.0.0 - Production&lt;br /&gt;System parameter file is /usr/app/oracle/product/8.0.6/network/admin/listener.ora&lt;br /&gt;Log messages written to /usr/app/oracle/product/8.0.6/network/log/listener_ora8.log&lt;br /&gt;Attempted to listen on: (DESCRIPTION=(CONNECT_TIMEOUT=10)(ADDRESS=(PROTOCOL=IPC)(KEY=test8)))&lt;br /&gt;TNS-12546: TNS:permission denied&lt;br /&gt; TNS-12560: TNS:protocol adapter error&lt;br /&gt;  TNS-00516: Permission denied&lt;br /&gt;   Solaris Error: 13: Permission denied&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The Fix:&lt;br /&gt;The Unix permissions for the hidden directory /tmp/.oracle should be:&lt;br /&gt;drwxrwxrwx&lt;br /&gt;&lt;br /&gt;Change the permissions on the .oracle directory:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DBA TEST ZONE&gt; ls -lad /tmp/.oracle /var/tmp/.oracle&lt;br /&gt;/tmp/.oracle: No such file or directory&lt;br /&gt;drwxr-xr-x   2 root     root           2 Aug 21 02:05 /var/tmp/.oracle&lt;br /&gt;&lt;br /&gt;give full permisions to this file:&lt;br /&gt;&lt;br /&gt;DBA TEST ZONE&gt;  ls -lad /var/tmp/.oracle&lt;br /&gt;drwxrwxrwx   2 root     root           2 Aug 21 02:05 /var/tmp/.oracle&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now again retried to start the Listener:&lt;br /&gt;&lt;br /&gt;DBA TEST ZONE&gt; lsnrctl start LISTENER_ORA8&lt;br /&gt;&lt;br /&gt;LSNRCTL for Solaris: Version 8.0.6.0.0 - Production on 07-SEP-09 10:57:49&lt;br /&gt;&lt;br /&gt;(c) Copyright 1999 Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Starting /usr/app/oracle/product/8.0.6/bin/tnslsnr: please wait...&lt;br /&gt;&lt;br /&gt;TNSLSNR for Solaris: Version 8.0.6.0.0 - Production&lt;br /&gt;System parameter file is /usr/app/oracle/product/8.0.6/network/admin/listener.ora&lt;br /&gt;Log messages written to /usr/app/oracle/product/8.0.6/network/log/listener_ora8.log&lt;br /&gt;Listening on: (ADDRESS=(PROTOCOL=ipc)(DEV=8)(KEY=test8))&lt;br /&gt;Listening on: (ADDRESS=(PROTOCOL=tcp)(DEV=13)(HOST=10.52.51.61)(PORT=1526))&lt;br /&gt;&lt;br /&gt;Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=test8))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     LISTENER_ORA8&lt;br /&gt;Version                   TNSLSNR for Solaris: Version 8.0.6.0.0 - Production&lt;br /&gt;Start Date                07-SEP-09 10:57:52&lt;br /&gt;Uptime                    0 days 0 hr. 0 min. 0 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;Security                  OFF&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   /usr/app/oracle/product/8.0.6/network/admin/listener.ora&lt;br /&gt;Listener Log File         /usr/app/oracle/product/8.0.6/network/log/listener_ora8.log&lt;br /&gt;Services Summary...&lt;br /&gt;  test8         has 1 service handler(s)&lt;br /&gt;The command completed successfully&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-58427755919045742?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/58427755919045742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=58427755919045742' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/58427755919045742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/58427755919045742'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/09/tns-00516-permission-denied-solaris.html' title='TNS-00516: Permission denied, Solaris Error: 13: Permission denied'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8144776087110247618</id><published>2009-06-22T16:26:00.003+05:30</published><updated>2009-06-22T16:36:57.545+05:30</updated><title type='text'>Delete files of a particular date.</title><content type='html'>Quick and efficient.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remove -&gt; ls -ltr | grep "May 23" | awk '{print "rm "$9" /disk1/oradata/arch/"}' | more&lt;br /&gt;&lt;br /&gt;above command will list all the files that are having May 23 date as below:&lt;br /&gt;&lt;br /&gt;rm orcl_R676045126_T1_S29396.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29397.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29398.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29399.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29400.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29401.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29402.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29403.arc.gz&lt;br /&gt;rm orcl_R676045126_T1_S29404.arc.gz&lt;br /&gt;&lt;br /&gt;Command for actually doing the job i.e delete files:&lt;br /&gt;&lt;br /&gt;Remove -&gt; ls -ltr | grep "May 23" | awk '{print "rm "$9" /disk1/oradata/arch/"}' | sh –x&lt;br /&gt;&lt;br /&gt;Use this carefully. Check twice before issuing the command, because sh –x will execute the output. i.e delete all files without a prompt.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8144776087110247618?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8144776087110247618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8144776087110247618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8144776087110247618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8144776087110247618'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/06/move-copy-or-delete-files-of-particular.html' title='Delete files of a particular date.'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-601713593475607314</id><published>2009-04-22T12:46:00.002+05:30</published><updated>2009-04-22T12:51:15.253+05:30</updated><title type='text'>Changing the archivelog destination online.</title><content type='html'>Couple of days back received a high priority ticket developers saying not able to connect to database&lt;br /&gt;&lt;br /&gt;hard working people they work on saturdays and sundays and make us also do the hard work :(&lt;br /&gt;&lt;br /&gt;they are getting an error ORA-00257: archiver error. Connect internal only, until freed. &lt;br /&gt;&lt;br /&gt;Found the following error in the alertlog file:&lt;br /&gt;&lt;br /&gt;Sat Apr 11 05:20:00 2009&lt;br /&gt;ARC0: Archiving not possible: No primary destinations&lt;br /&gt;ARC0: Failed to archive thread 1 sequence 2029 (4)&lt;br /&gt;&lt;br /&gt;When I checked for details from the database I can see the following:&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$instance;&lt;br /&gt;&lt;br /&gt;INSTANCE_NUMBER INSTANCE_NAME&lt;br /&gt;--------------- ----------------&lt;br /&gt;HOST_NAME&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT&lt;br /&gt;----------------- --------- ------------ --- ---------- ------- ---------------&lt;br /&gt;LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO&lt;br /&gt;---------- --- ----------------- ------------------ --------- ---&lt;br /&gt;              1 devdb2&lt;br /&gt;sun-boxdb1&lt;br /&gt;10.2.0.2.0        10-APR-09 OPEN         NO           1 &lt;strong&gt;FAILED&lt;/strong&gt;  ARCHIVE LOG&lt;br /&gt;ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            /mounts/devdb2_arch/devdb2&lt;br /&gt;Oldest online log sequence     2029&lt;br /&gt;Next log sequence to archive   2029&lt;br /&gt;Current log sequence           2031&lt;br /&gt;&lt;br /&gt;Thought may be the archive destination mount is full but shocked coz I cannot see the mount point. &lt;br /&gt;Then I realized the mistake that I not 'I' "they" made the earlier day when we moved the database to the new Sun box.&lt;br /&gt;&lt;br /&gt;Our Storage guys forgot to mount the archive Mount point.&lt;br /&gt;I actually prefer seperate mount points for Data,Arch and Temp :)&lt;br /&gt;&lt;br /&gt;Dont ask me why I did not checked when I was making the database up..its a friday evening guys...&lt;br /&gt;But did not know how the database was up without the archive mount point destination specified.&lt;br /&gt;&lt;br /&gt;So for immediate resolution had to change the archive destination "the day is  SATURDAY and storage guys available on saturday??? no way!!! don't look for them"&lt;br /&gt;&lt;br /&gt;Did the following:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set log_archive_dest_1='LOCATION=/mounts/devdb2_temp/devdb2/arch/';&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system archive log all;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode              Archive Mode&lt;br /&gt;Automatic archival             Enabled&lt;br /&gt;Archive destination            /mounts/devdb2_temp/devdb2/arch/&lt;br /&gt;Oldest online log sequence     2031&lt;br /&gt;Next log sequence to archive   2033&lt;br /&gt;Current log sequence           2033&lt;br /&gt;SQL&gt;  select * from v$instance;&lt;br /&gt;&lt;br /&gt;INSTANCE_NUMBER INSTANCE_NAME&lt;br /&gt;--------------- ----------------&lt;br /&gt;HOST_NAME&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_WAIT&lt;br /&gt;----------------- --------- ------------ --- ---------- ------- ---------------&lt;br /&gt;LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST BLO&lt;br /&gt;---------- --- ----------------- ------------------ --------- ---&lt;br /&gt;              1 devdb2&lt;br /&gt;sun-boxdb1&lt;br /&gt;10.2.0.2.0        10-APR-09 OPEN         NO           1 STARTED&lt;br /&gt;ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL    NO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;And you can see that all the errors are cleared in the alertlog file:&lt;br /&gt;&lt;br /&gt;Sat Apr 11 05:20:03 2009&lt;br /&gt;ARC1: Archiving not possible: No primary destinations&lt;br /&gt;ARC1: Failed to archive thread 1 sequence 2029 (4)&lt;br /&gt;Sat Apr 11 05:20:06 2009&lt;br /&gt;ALTER SYSTEM SET log_archive_dest_1='LOCATION=/mounts/devdb2_temp/devdb2/arch/' SCOPE=BOTH;&lt;br /&gt;Sat Apr 11 05:20:07 2009&lt;br /&gt;Archiver process freed from errors. No longer stopped&lt;br /&gt;Sat Apr 11 05:20:09 2009&lt;br /&gt;Thread 1 advanced to log sequence 2032&lt;br /&gt;  Current log# 3 seq# 2032 mem# 0: /mounts/devdb2_data/devdb2/redo03.log&lt;br /&gt;Sat Apr 11 05:20:29 2009&lt;br /&gt;Thread 1 advanced to log sequence 2033&lt;br /&gt;  Current log# 1 seq# 2033 mem# 0: /mounts/devdb2_data/devdb2/redo01.log&lt;br /&gt;~&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happies endingss&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-601713593475607314?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/601713593475607314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=601713593475607314' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/601713593475607314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/601713593475607314'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/04/changing-archivelog-destination-online.html' title='Changing the archivelog destination online.'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-506773955861646565</id><published>2009-01-29T12:59:00.003+05:30</published><updated>2009-01-29T13:11:27.836+05:30</updated><title type='text'>Monitoring Temp Tablespace Use</title><content type='html'>This query shows the current usage of the temporary tablespace.&lt;br /&gt;&lt;br /&gt;This is very useful to monitor if you are getting &lt;strong&gt;ORA-1652: unable to extend temp segment&lt;/strong&gt; errors, as well as for monitoring the use of space in your temp tablespace. &lt;br /&gt;&lt;br /&gt;select sess.USERNAME, sess.sid, sess.OSUSER, su.segtype, &lt;br /&gt;su.segfile#, su.segblk#, su.extents, su.blocks&lt;br /&gt;from v$sort_usage su, v$session sess&lt;br /&gt;where sess.sql_address=su.sqladdr and sess.sql_hash_value=su.sqlhash ;&lt;br /&gt;&lt;br /&gt;You can compare the EXTENTS and BLOCKS columns above to the total available segments and blocks by querying V$TEMP_EXTENT_POOL. &lt;br /&gt;&lt;br /&gt;select * from v$temp_extent_pool;&lt;br /&gt;&lt;br /&gt;The EXTENTS_CACHED are the total number of extents cached -- following an ora-1652, this will be the max number of extents available. The EXTENTS_USED column lets you know the total number of extents currently in use.&lt;br /&gt; &lt;br /&gt;In a TEMPORARY temporary tablespace (ie. one with a TEMPORARY datafile), all the space in the datafile is reserved for temporary sort segments. (In a well-managed database, this is of course true for non-TEMPORARY temp tablespaces as well). &lt;br /&gt;&lt;br /&gt;Extent management should be set to LOCAL UNIFORM with a size corresponding to SORT_AREA_SIZE. In this case, it's easy to see how many temp extents will fit in the temporary tablespace: &lt;br /&gt;&lt;br /&gt;SELECT dtf.file_id, dtf.bytes/dt.INITIAL_EXTENT max_extents_allowed &lt;br /&gt;from dba_temp_files dtf, dba_tablespaces dt&lt;br /&gt;where dtf.tablespace_name='TEMPORARY_DATA' and &lt;br /&gt;dtf.tablespace_name=dt.TABLESPACE_NAME;&lt;br /&gt;&lt;br /&gt;To know the corresponding Temp tablespace - datafile name and Total bytes allocated:&lt;br /&gt;&lt;br /&gt;select name,bytes/1024/1024 from v$tempfile;&lt;br /&gt;&lt;br /&gt;To know the exact Temp tablespace details like name, total blocks allocated,used blocks and free blocks:&lt;br /&gt;&lt;br /&gt;select tablespace_name,(total_blocks*8)/1024,(used_blocks*8)/1024,(free_blocks*8)/1024 from v$sort_segment;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-506773955861646565?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/506773955861646565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=506773955861646565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/506773955861646565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/506773955861646565'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/01/monitoring-temp-tablespace-use.html' title='Monitoring Temp Tablespace Use'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6410167119478062786</id><published>2009-01-29T12:05:00.002+05:30</published><updated>2009-01-29T12:08:41.472+05:30</updated><title type='text'>Resizing Logfiles</title><content type='html'>The best way to resize logfiles is by creating new logfile groups in the new size, then dropping the old logfile groups. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example:&lt;/strong&gt; &lt;br /&gt;&lt;br /&gt;SYS&gt; select group#,member from v$logfile;&lt;br /&gt;&lt;br /&gt;    GROUP#  MEMBER&lt;br /&gt;---------- ----------------------------------------&lt;br /&gt;&lt;br /&gt;         1  D:\DATABASE\TRN3\LOGTRN3_1A.LGF&lt;br /&gt;         1  F:\DATABASE\TRN3\LOGTRN3_1A.LGF&lt;br /&gt;         2  D:\DATABASE\TRN3\LOGTRN3_2A.LGF&lt;br /&gt;         2  F:\DATABASE\TRN3\LOGTRN3_2A.LGF&lt;br /&gt;         3  D:\DATABASE\TRN3\LOGTRN3_3A.LGF&lt;br /&gt;         3  F:\DATABASE\TRN3\LOGTRN3_3A.LGF&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;br /&gt;&lt;br /&gt;SYS&gt;  alter database add logfile group 4&lt;br /&gt;  2  ('d:\database\trn3\logtrn3_4a.lgf','f:\database\trn3\logtrn3_4b.lgf')&lt;br /&gt;  3* size 10240K&lt;br /&gt;SYS&gt; /&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SYS&gt;  alter database add logfile group 5&lt;br /&gt;  2  ('d:\database\trn3\logtrn3_5a.lgf','f:\database\trn3\logtrn3_5b.lgf')&lt;br /&gt;  3* size 10240K&lt;br /&gt;SYS&gt; /&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SYS&gt;  alter database add logfile group 6&lt;br /&gt;  2  ('d:\database\trn3\logtrn3_6a.lgf','f:\database\trn3\logtrn3_6b.lgf')&lt;br /&gt;  3* size 10240K&lt;br /&gt;SYS&gt; /&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SYS&gt; select group#, status from v$log;&lt;br /&gt;&lt;br /&gt;    GROUP# STATUS&lt;br /&gt;---------- ----------------&lt;br /&gt;         1 CURRENT&lt;br /&gt;         2 INACTIVE&lt;br /&gt;         3 INACTIVE&lt;br /&gt;         4 UNUSED&lt;br /&gt;         5 UNUSED&lt;br /&gt;         6 UNUSED&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;br /&gt;&lt;br /&gt;SYS&gt; alter database drop logfile group 2;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SYS&gt; alter database drop logfile group 3;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SYS&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SYS&gt;  select group#, status from v$log;&lt;br /&gt;&lt;br /&gt;    GROUP# STATUS&lt;br /&gt;---------- ----------------&lt;br /&gt;         1 ACTIVE&lt;br /&gt;         4 CURRENT&lt;br /&gt;         5 UNUSED&lt;br /&gt;         6 UNUSED&lt;br /&gt;&lt;br /&gt;SYS&gt; alter system switch logfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SYS&gt; select group#, status from v$log;&lt;br /&gt;&lt;br /&gt;    GROUP# STATUS&lt;br /&gt;---------- ----------------&lt;br /&gt;         1 INACTIVE&lt;br /&gt;         4 ACTIVE&lt;br /&gt;         5 CURRENT&lt;br /&gt;         6 UNUSED&lt;br /&gt;&lt;br /&gt;SYS&gt; alter database drop logfile group 1;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SYS&gt;  select group#, status from v$log;&lt;br /&gt;&lt;br /&gt;    GROUP# STATUS&lt;br /&gt;---------- ----------------&lt;br /&gt;         4 INACTIVE&lt;br /&gt;         5 CURRENT&lt;br /&gt;         6 UNUSED&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6410167119478062786?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6410167119478062786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6410167119478062786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6410167119478062786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6410167119478062786'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/01/resizing-logfiles.html' title='Resizing Logfiles'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-9184485258803165190</id><published>2009-01-16T08:24:00.000+05:30</published><updated>2009-01-16T08:25:19.698+05:30</updated><title type='text'>Tarballs</title><content type='html'>To collect a bunch of files and directories together, use tar. &lt;br /&gt;&lt;br /&gt;For example, to tar up your entire home directory and put the tarball into /tmp, do this &lt;br /&gt;&lt;br /&gt;$ cd ~srees&lt;br /&gt;$ cd .. # go one dir above dir you want to tar&lt;br /&gt;$ tar cvf /tmp/srees.backup.tar srees&lt;br /&gt;&lt;br /&gt;By convention, use .tar as the extension. To untar this file use &lt;br /&gt;&lt;br /&gt;$ cd /tmp&lt;br /&gt;$ tar xvf srees.backup.tar&lt;br /&gt;&lt;br /&gt;tar untars things in the current directory! &lt;br /&gt;&lt;br /&gt;After running the untar, you will find a new directory, /tmp/srees, that is a copy of your home directory. &lt;br /&gt;Note that the way you tar things up dictates the directory structure when untarred. &lt;br /&gt;The fact that I mentioned srees in the tar creation means that I'll have that dir when untarred. &lt;br /&gt;&lt;br /&gt;In contrast, the following will also make a copy of my home directory, but without having a srees root dir: &lt;br /&gt;&lt;br /&gt;$ cd ~srees&lt;br /&gt;$ tar cvf /tmp/srees.backup.tar *&lt;br /&gt;&lt;br /&gt;It is a good idea to tar things up with a root directory so that &lt;br /&gt;when you untar you don't generate a million files in the current directly. &lt;br /&gt;&lt;br /&gt;To see what's in a tarball, use &lt;br /&gt;&lt;br /&gt;$ tar tvf /tmp/srees.backup.tar&lt;br /&gt;&lt;br /&gt;Most of the time you can save space by using the z argument. &lt;br /&gt;&lt;br /&gt;The tarball will then be gzip'd and you should use file extension .tar.gz: &lt;br /&gt;&lt;br /&gt;$ cd ~srees&lt;br /&gt;$ cd .. # go one dir above dir you want to tar&lt;br /&gt;$ tar cvfz /tmp/srees.backup.tar.gz srees&lt;br /&gt;&lt;br /&gt;Unzipping requires the z argument also: &lt;br /&gt;&lt;br /&gt;$ cd /tmp&lt;br /&gt;$ tar xvfz srees.backup.tar.gz&lt;br /&gt;&lt;br /&gt;If you have a big file to compress, use gzip: &lt;br /&gt;&lt;br /&gt;$ gzip bigfile&lt;br /&gt;&lt;br /&gt;After execution, your file will have been renamed bigfile.gz. &lt;br /&gt;&lt;br /&gt;To uncompress, use &lt;br /&gt;&lt;br /&gt;$ gzip -d bigfile.gz&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To display a text file that is currently gzip'd, use zcat: &lt;br /&gt;&lt;br /&gt;$ zcat bigfile.gz&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-9184485258803165190?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/9184485258803165190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=9184485258803165190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/9184485258803165190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/9184485258803165190'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/01/tarballs.html' title='Tarballs'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6550083931909006304</id><published>2009-01-16T07:37:00.002+05:30</published><updated>2009-01-16T11:42:15.648+05:30</updated><title type='text'>nohup Execute Commands After You Exit From a Shell Prompt</title><content type='html'>Most of the time you login into remote server via ssh. If you start a shell script or command and you exit (abort remote connection), the process / command will get killed. Sometime job or command takes a long time. If you are not sure when the job will finish, then it is better to leave job running in background. However, if you logout the system, the job will be stopped. What do you do?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;nohup command&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Answer is simple, use nohup utility which allows to run command./process or shell script that can continue running in the background after you log out from a shell:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;nohup Syntax:&lt;/strong&gt;&lt;br /&gt;nohup command-name &amp;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Where,&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;command-name &lt;/strong&gt;: is name of shell script or command name. You can pass argument to command or a shell script. &lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&amp; &lt;/strong&gt;: nohup does not automatically put the command it runs in the background; you must do that explicitly, by ending the command line with an &amp; symbol. &lt;br /&gt;&lt;br /&gt;nohup command example&lt;br /&gt;&lt;br /&gt;Eg.&lt;br /&gt;# nohup exp system/password@dbname file=exp_dbname_date.dmp log=exp_dbname_date.log full=y &amp;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;# vi exp_script.sh&lt;br /&gt;exp system/password@dbname file=exp_dbname_date.dmp log=exp_dbname_date.log full=y&lt;br /&gt;:wq&lt;br /&gt;&lt;br /&gt;# ls –l&lt;br /&gt;Check the permissions if that has execute permissions&lt;br /&gt;#chomod 755 exp_script.sh&lt;br /&gt;&lt;br /&gt;# nohup ./exp_script.sh &amp;&lt;br /&gt;&lt;br /&gt;this ensures of the completion of the Job even if the session terminates... :-)&lt;br /&gt;&lt;br /&gt;Checking the Job progress cab be done using:&lt;br /&gt;&lt;br /&gt;tail -f nohup.out&lt;br /&gt;ctrl c -- to end the checking.&lt;br /&gt;&lt;br /&gt;Some more good options for completing jobs without or when session terminations occur:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Option 1:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can use the below script to keep your session alive with a simple while loop to run infinite loop.&lt;br /&gt;&lt;br /&gt;#while true&lt;br /&gt;&gt;do&lt;br /&gt;&gt;echo " Exp going on"&lt;br /&gt;&gt;sleep 200&lt;br /&gt;&gt;done&lt;br /&gt;&lt;br /&gt;Here you will not get prompt till you press Ctl + c (^c). This process will keep your session alive till you press enter.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Option 2:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;You can run exp_script.sh script to queue (one minute) later execution:&lt;br /&gt;&lt;br /&gt;$ echo "exp_script.sh" | at now + 1 minute&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6550083931909006304?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6550083931909006304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6550083931909006304' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6550083931909006304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6550083931909006304'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/01/nohup-execute-commands-after-you-exit.html' title='nohup Execute Commands After You Exit From a Shell Prompt'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-5522349377548558288</id><published>2009-01-16T07:11:00.002+05:30</published><updated>2009-01-16T07:18:47.545+05:30</updated><title type='text'>To calculate the export dump file size without actually exporting in Oracle 10G and above</title><content type='html'>Many times DBAs' may need to know the size of the export dump file size before starting the actual export of the database. This has become easy with the datapump option from Oracle version 10G.&lt;br /&gt;&lt;br /&gt;Just give the following command:&lt;br /&gt;&lt;br /&gt;expdp system full=y ESTIMATE_ONLY=Y NOLOGFILE=Y&lt;br /&gt;&lt;br /&gt;for more options see &lt;br /&gt;&lt;br /&gt;expdp help=y  -- from your command prompt.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-5522349377548558288?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/5522349377548558288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=5522349377548558288' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5522349377548558288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5522349377548558288'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2009/01/to-calculate-export-dump-file-size.html' title='To calculate the export dump file size without actually exporting in Oracle 10G and above'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4161043648634850051</id><published>2008-12-24T06:52:00.001+05:30</published><updated>2008-12-24T06:52:55.070+05:30</updated><title type='text'>Automtic and Manually sized Components of SGA</title><content type='html'>DB_CACHE_SIZE, &lt;br /&gt;SHARED_POOL_SIZE, &lt;br /&gt;LARGE_POOL_SIZE and &lt;br /&gt;JAVA_POOL_SIZE are automatic sized components. &lt;br /&gt;&lt;br /&gt;The parameter SGA_TARGET specifies the total size of all SGA components. &lt;br /&gt;If SGA_TARGET is set to a value greater than zero then above components are automatically sized.&lt;br /&gt;&lt;br /&gt;On the other hand, &lt;br /&gt;&lt;br /&gt;LOG_BUFFER, &lt;br /&gt;BUFFER_POOL_KEEP, &lt;br /&gt;BUFFER_POOL_RECYCLE, &lt;br /&gt;DB_nK_CACHE_SIZE other than DB_CACHE_SIZE, &lt;br /&gt;STREAMS_POOL_SIZE , &lt;br /&gt;Fixed SGA and &lt;br /&gt;other internal components are manually sized components.&lt;br /&gt;&lt;br /&gt;However setting the value to manually sized components automatically reduce the value from SGA_TARGET if SGA_TARGET is set to value greater than zero.&lt;br /&gt;&lt;br /&gt;When SGA_TARGET&gt;0 then automatic sized components of SGA are automatically allocated and this is called Automatic Shared Memory Management.&lt;br /&gt;&lt;br /&gt;Both the automatic and manually sized components of SGA are dynamic components because they dynamically can be changed. &lt;br /&gt;&lt;br /&gt;You can see them from V$SGA_DYNAMIC_COMPONENTS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4161043648634850051?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4161043648634850051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4161043648634850051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4161043648634850051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4161043648634850051'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/12/automtic-and-manually-sized-components.html' title='Automtic and Manually sized Components of SGA'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6596083222949007365</id><published>2008-12-24T06:42:00.000+05:30</published><updated>2008-12-24T06:44:08.450+05:30</updated><title type='text'>Simple Restore and Recovery process using RMAN on a Windows box.</title><content type='html'>C:\&gt;set oracle_sid=SDR&lt;br /&gt;&lt;br /&gt;C:\&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.2.0.4.0 - Production on Wed Dec 17 05:16:07 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn sys/sys as sysdba&lt;br /&gt;Connected to an idle instance&lt;br /&gt;SQL&gt; startup pfile=c:\oracle\database\initSDR.ora nomount&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area  202448548 bytes&lt;br /&gt;Fixed Size                   454308 bytes&lt;br /&gt;Variable Size             159383552 bytes&lt;br /&gt;Database Buffers           41943040 bytes&lt;br /&gt;Redo Buffers                 667648 bytes&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C:\oracle\bin&gt;rman&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 9.2.0.4.0 - Production&lt;br /&gt;&lt;br /&gt;Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect target sys/sys&lt;br /&gt;&lt;br /&gt;connected to target database: SDR (not mounted)&lt;br /&gt;&lt;br /&gt;RMAN&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RUN&lt;br /&gt; {&lt;br /&gt;   SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\Backup\RMAN\SDR\%F';&lt;br /&gt;   RESTORE CONTROLFILE FROM 'D:\Backup\RMAN\SDR\C-3180286864-20081215-00';&lt;br /&gt;   ALTER DATABASE MOUNT;&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 CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'D:\Backup\RMAN\SDR\%F';&lt;br /&gt;4&gt;    RESTORE CONTROLFILE FROM 'D:\Backup\RMAN\SDR\C-3180286864-20081215-00';&lt;br /&gt;5&gt;    ALTER DATABASE MOUNT;&lt;br /&gt;6&gt; }&lt;br /&gt;&lt;br /&gt;executing command: SET CONTROLFILE AUTOBACKUP FORMAT&lt;br /&gt;using target database controlfile instead of recovery catalog&lt;br /&gt;&lt;br /&gt;Starting restore at 17-DEC-08&lt;br /&gt;&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=13 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: restoring controlfile&lt;br /&gt;channel ORA_DISK_1: restore complete&lt;br /&gt;replicating controlfile&lt;br /&gt;input filename=D:\ORACLE\ORADATA\SDR\CONTROL01.CTL&lt;br /&gt;output filename=D:\ORACLE\ORADATA\SDR\CONTROL02.CTL&lt;br /&gt;output filename=C:\ORACLE\ORADATA\SDR\CONTROL03.CTL&lt;br /&gt;Finished restore at 17-DEC-08&lt;br /&gt;&lt;br /&gt;database mounted&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; restore archivelog from time '14-DEC-08';&lt;br /&gt;&lt;br /&gt;Starting restore at 17-DEC-08&lt;br /&gt;&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: starting archive log restore to default destination&lt;br /&gt;channel ORA_DISK_1: restoring archive log&lt;br /&gt;archive log thread=1 sequence=209&lt;br /&gt;channel ORA_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=D:\BACKUP\RMAN\SDR\92K28SQ3_1_1 tag=ORACLESRVR - SDR_12140803&lt;br /&gt;0002 params=NULL&lt;br /&gt;channel ORA_DISK_1: restore complete&lt;br /&gt;channel ORA_DISK_1: starting archive log restore to default destination&lt;br /&gt;channel ORA_DISK_1: restoring archive log&lt;br /&gt;archive log thread=1 sequence=210&lt;br /&gt;channel ORA_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=D:\BACKUP\RMAN\SDR\95K2BH5F_1_1 tag=ORACLESRVR - SDR_12150803&lt;br /&gt;0005 params=NULL&lt;br /&gt;channel ORA_DISK_1: restore complete&lt;br /&gt;Finished restore at 17-DEC-08&lt;br /&gt;&lt;br /&gt;RMAN&gt; restore database;&lt;br /&gt;&lt;br /&gt;Starting restore at 17-DEC-08&lt;br /&gt;&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to D:\ORACLE\ORADATA\SDR\SYSTEM01.DBF&lt;br /&gt;restoring datafile 00002 to D:\ORACLE\ORADATA\SDR\UNDOTBS01.DBF&lt;br /&gt;restoring datafile 00003 to D:\ORACLE\ORADATA\SDR\CWMLITE01.DBF&lt;br /&gt;restoring datafile 00004 to D:\ORACLE\ORADATA\SDR\DRSYS01.DBF&lt;br /&gt;restoring datafile 00005 to D:\ORACLE\ORADATA\SDR\EXAMPLE01.DBF&lt;br /&gt;restoring datafile 00006 to D:\ORACLE\ORADATA\SDR\INDX01.DBF&lt;br /&gt;restoring datafile 00007 to D:\ORACLE\ORADATA\SDR\ODM01.DBF&lt;br /&gt;restoring datafile 00008 to D:\ORACLE\ORADATA\SDR\TOOLS01.DBF&lt;br /&gt;restoring datafile 00009 to D:\ORACLE\ORADATA\SDR\USERS01.DBF&lt;br /&gt;restoring datafile 00010 to D:\ORACLE\ORADATA\SDR\XDB01.DBF&lt;br /&gt;restoring datafile 00011 to D:\ORACLE\ORADATA\SDR\SDRD.ORA&lt;br /&gt;restoring datafile 00012 to D:\ORACLE\ORADATA\SDR\SDRI.ORA&lt;br /&gt;channel ORA_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=D:\BACKUP\RMAN\SDR\94K2BGV8_1_1 tag=ORACLESRVR - SDR_12150803&lt;br /&gt;0005 params=NULL&lt;br /&gt;channel ORA_DISK_1: restore complete&lt;br /&gt;Finished restore at 17-DEC-08&lt;br /&gt;&lt;br /&gt;RMAN&gt; recover database until logseq 0 thread 1;&lt;br /&gt;&lt;br /&gt;Starting recover at 17-DEC-08&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;media recovery complete&lt;br /&gt;&lt;br /&gt;Finished recover at 17-DEC-08&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; open resetlogs database;&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;&lt;br /&gt;RMAN&gt;exit&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6596083222949007365?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6596083222949007365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6596083222949007365' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6596083222949007365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6596083222949007365'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/12/simple-restore-and-recovery-process.html' title='Simple Restore and Recovery process using RMAN on a Windows box.'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-3843308832434983779</id><published>2008-12-24T06:18:00.003+05:30</published><updated>2009-01-06T16:14:19.891+05:30</updated><title type='text'>Restore and Recover a database using a HOT Backup and lost archivelog files.</title><content type='html'>You can say it as a &lt;strong&gt;Dummy Recovery&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;$ pwd&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata&lt;br /&gt;&lt;br /&gt;$ mkdir edr_arch edr_data edr_temp&lt;br /&gt;$ pwd&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp&lt;br /&gt;$ ls&lt;br /&gt;$ mkdir adump bdump cdump create email tmpfiles udump&lt;br /&gt;$&lt;br /&gt;$ pwd&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/admin/edr&lt;br /&gt;&lt;br /&gt;ln -s /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/adump&lt;br /&gt;ln -s /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/bdump&lt;br /&gt;ln -s /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/cdump&lt;br /&gt;ln -s /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/create&lt;br /&gt;ln -s /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/email&lt;br /&gt;ln -s /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/tmpfiles&lt;br /&gt;ln -s /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/udump&lt;br /&gt;&lt;br /&gt;$ pwd&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data&lt;br /&gt;Restore or copy all your backup files accordingly.&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;strong&gt;My Controlfile Script&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;CREATE CONTROLFILE SET DATABASE "edr" RESETLOGS NOARCHIVELOG&lt;br /&gt;    MAXLOGFILES 16&lt;br /&gt;    MAXLOGMEMBERS 2&lt;br /&gt;    MAXDATAFILES 30&lt;br /&gt;    MAXINSTANCES 1&lt;br /&gt;    MAXLOGHISTORY 2268&lt;br /&gt;LOGFILE&lt;br /&gt;  GROUP 1 '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/logedr1.ora'  SIZE 200M,&lt;br /&gt;  GROUP 2 '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/logedr2.ora'  SIZE 200M,&lt;br /&gt;  GROUP 3 '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/logedr3.ora'  SIZE 200M,&lt;br /&gt;  GROUP 4 '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/logedr4.ora'  SIZE 200M,&lt;br /&gt;  GROUP 5 '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/logedr5.ora'  SIZE 200M&lt;br /&gt;DATAFILE&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edr_system.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edr_users.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edr_tools.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/RBS.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrDATA_D.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrDATA_I.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrMETA_D.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrMETA_.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrUSERS.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/CUSTOM_INDEX.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/DBA.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/GCMDB.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/PREFSTAT.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrcode.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrcode_I.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/RCX_OTHER.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/EXPORT_D.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrDATA_D2.dbf.dbf',&lt;br /&gt;  '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edrDATA_D3.dbf'&lt;br /&gt;CHARACTER SET WE8MSWIN1252&lt;br /&gt;;&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;strong&gt;My Pfile&lt;/strong&gt;:&lt;br /&gt;&lt;br /&gt;# Instance self registration parameters&lt;br /&gt;instance_name           = edr&lt;br /&gt;service_names           = edrserver&lt;br /&gt;db_name                 = "edr"&lt;br /&gt;db_domain               = oracle.com&lt;br /&gt;#db_files               = 1000&lt;br /&gt;db_block_size           = 8192&lt;br /&gt;db_file_multiblock_read_count = 8&lt;br /&gt;&lt;br /&gt;compatible              = "9.2.0.1.0"&lt;br /&gt;&lt;br /&gt;# db_cache_size replaces the earlier db_block_buffers&lt;br /&gt;&lt;br /&gt;db_cache_size  = 8m&lt;br /&gt;#db_cache_size   = 10485760000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# Optional additional block sizes available in Oracle 9i&lt;br /&gt;#      You cannot set db_Nk_cache_size for N = DB_BLOCK_SIZE&lt;br /&gt;# db_2k_cache_size      = m&lt;br /&gt;# db_4k_cache_size      = m&lt;br /&gt;# db_16k_cache_size     = m&lt;br /&gt;# db_32k_cache_size     = m&lt;br /&gt;&lt;br /&gt;shared_pool_size       = 20M&lt;br /&gt;#shared_pool_size       = 419430400&lt;br /&gt;#log_buffer             = 163840&lt;br /&gt;log_buffer              = 20070400&lt;br /&gt;&lt;br /&gt;# Optional settings for dynamic SGA and PGA's&lt;br /&gt;# sga_max_size  =&lt;br /&gt;sga_max_size  = 2728640000&lt;br /&gt;&lt;br /&gt;pga_aggregate_target = 380M&lt;br /&gt;#pga_aggregate_target = 419430400&lt;br /&gt;&lt;br /&gt;# Eliminates the need for the _area_size parameters.&lt;br /&gt;&lt;br /&gt;# To eliminate the need for Rollback segments we set the following Automatic UNDO&lt;br /&gt;# parameters, and we don't set ROLLBACK_SEGMENTS&lt;br /&gt;#UNDO_RETENTION = 90            # Measured in Seconds controls undo segment size.&lt;br /&gt;#UNDO_MANAGEMENT = AUTO&lt;br /&gt;#UNDO_TABLESPACE = UNDOTBS&lt;br /&gt;#UNDO_SUPPRESS_ERRORS = TRUE    # Kills error messages for rollback segment operations&lt;br /&gt;&lt;br /&gt;control_files =         ("/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/control01.ctl",&lt;br /&gt;                        "/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/control02.ctl")&lt;br /&gt;log_archive_start       = false&lt;br /&gt;log_archive_dest_1      = "location=/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_arch/"&lt;br /&gt;log_archive_format      = edr_arch%S.arc&lt;br /&gt;background_dump_dest    = /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/bdump&lt;br /&gt;core_dump_dest          = /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/cdump&lt;br /&gt;user_dump_dest          = /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/udump&lt;br /&gt;audit_file_dest         = /uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/adump&lt;br /&gt;&lt;br /&gt;#remote_os_authent      = true&lt;br /&gt;#os_authent_prefix      = "OPS$"&lt;br /&gt;&lt;br /&gt;open_cursors            = 3000&lt;br /&gt;max_enabled_roles       = 148&lt;br /&gt;&lt;br /&gt;#optimizer_mode         = choose&lt;br /&gt;#nls_language           = american&lt;br /&gt;#nls_date_format        = DD-MON-RRRR&lt;br /&gt;#nls_date_language      = american&lt;br /&gt;&lt;br /&gt;timed_statistics=TRUE&lt;br /&gt;#hash_join_enabled=TRUE&lt;br /&gt;#optimizer_features_enable = 9.2.0.1.0&lt;br /&gt;#query_rewrite_enabled=FALSE&lt;br /&gt;#star_transformation_enabled=FALSE&lt;br /&gt;#java_pool_size=20M&lt;br /&gt;#large_pool_size=200M&lt;br /&gt;#large_pool_size= 209715200&lt;br /&gt;#processes=500&lt;br /&gt;#fast_start_mttr_target=300&lt;br /&gt;#audit_trail=TRUE&lt;br /&gt;#max_rollback_segments=50&lt;br /&gt;#sort_area_size=67108864&lt;br /&gt;#workarea_size_policy = AUTo&lt;br /&gt;#remote_login_passwordfile=exclusive&lt;br /&gt;#log_archive_start=TRUE&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;ORACLE_SID set to: edr.&lt;br /&gt;ORACLE_HOME set to: /uo1/oracle/app/product/9.2.0.1.0.&lt;br /&gt;&lt;br /&gt;startup nomount pfile=/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/pfile/initedr.ora&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;ORACLE_SID set to: edr.&lt;br /&gt;ORACLE_HOME set to: /uo1/oracle/app/product/9.2.0.1.0.&lt;br /&gt;&lt;br /&gt;$ sqlplus "/as sysdba"&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.2.0.1.0 - Production on Tue Dec 23 08:20:07 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup nomount pfile=/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/pfile/initedr.ora&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 2738868712 bytes&lt;br /&gt;Fixed Size                   733672 bytes&lt;br /&gt;Variable Size            2701131776 bytes&lt;br /&gt;Database Buffers           16777216 bytes&lt;br /&gt;Redo Buffers               20226048 bytes&lt;br /&gt;SQL&gt; @cr8ctl.sql&lt;br /&gt;&lt;br /&gt;Control file created.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;alter database open resetlogs&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01195: online backup of file 1 needs more recovery to be consistent&lt;br /&gt;ORA-01110: data file 1:&lt;br /&gt;'/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edr_system.dbf'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database until cancel using backup controlfile;&lt;br /&gt;ORA-00279: change 8469459547375 generated at 12/03/2008 22:00:03 needed for&lt;br /&gt;thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_arch/edr_arch0000006653.arc&lt;br /&gt;ORA-00280: change 8469459547375 for thread 1 is in sequence #6653&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Here Here.. I lost my archivelog files&lt;/strong&gt;..remember...so trying my luck with the online redolog files:&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/log1aedr.rdo&lt;br /&gt;ORA-00310: archived log contains sequence 2370; sequence 6653 required&lt;br /&gt;ORA-00334: archived log:&lt;br /&gt;'/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/log1aedr.rdo'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below&lt;br /&gt;ORA-01195: online backup of file 1 needs more recovery to be consistent&lt;br /&gt;ORA-01110: data file 1:&lt;br /&gt;'/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edr_system.dbf'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database until cancel using backup controlfile;&lt;br /&gt;ORA-00279: change 8469459547375 generated at 12/03/2008 22:00:03 needed for&lt;br /&gt;thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_arch/edr_arch0000006653.arc&lt;br /&gt;ORA-00280: change 8469459547375 for thread 1 is in sequence #6653&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/log2aedr.rdo&lt;br /&gt;ORA-00310: archived log contains sequence 2371; sequence 6653 required&lt;br /&gt;ORA-00334: archived log:&lt;br /&gt;'/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/log2aedr.rdo'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below&lt;br /&gt;ORA-01195: online backup of file 1 needs more recovery to be consistent&lt;br /&gt;ORA-01110: data file 1:&lt;br /&gt;'/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edr_system.dbf'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database until cancel using backup controlfile;&lt;br /&gt;ORA-00279: change 8469459547375 generated at 12/03/2008 22:00:03 needed for&lt;br /&gt;thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_arch/edr_arch0000006653.arc&lt;br /&gt;ORA-00280: change 8469459547375 for thread 1 is in sequence #6653&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/log3aedr.rdo&lt;br /&gt;ORA-00310: archived log contains sequence 2369; sequence 6653 required&lt;br /&gt;ORA-00334: archived log:&lt;br /&gt;'/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/log3aedr.rdo'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below&lt;br /&gt;ORA-01195: online backup of file 1 needs more recovery to be consistent&lt;br /&gt;ORA-01110: data file 1:&lt;br /&gt;'/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/edr_system.dbf'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database until cancel using backup controlfile;&lt;br /&gt;ORA-00279: change 8469459547375 generated at 12/03/2008 22:00:03 needed for&lt;br /&gt;thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_arch/edr_arch0000006653.arc&lt;br /&gt;ORA-00280: change 8469459547375 for thread 1 is in sequence #6653&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_data/logedr1.ora&lt;br /&gt;&lt;strong&gt;Log applied.&lt;br /&gt;Media recovery complete.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Hurrah&lt;/strong&gt;..done. This redolog has the change it required.&lt;br /&gt;&lt;br /&gt;**The redologs are also backedup along with the other files.&lt;br /&gt;SQL&gt; alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;And the database is up.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$instance;&lt;br /&gt;&lt;br /&gt;INSTANCE_NUMBER INSTANCE_NAME&lt;br /&gt;--------------- ----------------&lt;br /&gt;HOST_NAME&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_&lt;br /&gt;----------------- --------- ------------ --- ---------- ------- -----------&lt;br /&gt;LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST&lt;br /&gt;---------- --- ----------------- ------------------ ---------&lt;br /&gt;              1 edr&lt;br /&gt;edrserver&lt;br /&gt;9.2.0.1.0         23-DEC-08 OPEN         NO           1 STOPPED&lt;br /&gt;ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production&lt;br /&gt;JServer Release 9.2.0.1.0 - Production&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&lt;br /&gt;--------------------------------------------------------------------------------------------------------&lt;br /&gt;Then some more things to make my restore activity complete:&lt;br /&gt;&lt;br /&gt;        SQL&gt; shutdown immediate;&lt;br /&gt; SQL&gt; startup mount;&lt;br /&gt; SQL&gt; alter database archivelog;&lt;br /&gt; sQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;create spfile from pfile;&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 2738868712 bytes&lt;br /&gt;Fixed Size                   733672 bytes&lt;br /&gt;Variable Size            2701131776 bytes&lt;br /&gt;Database Buffers           16777216 bytes&lt;br /&gt;Redo Buffers               20226048 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$instance;&lt;br /&gt;&lt;br /&gt;INSTANCE_NUMBER INSTANCE_NAME&lt;br /&gt;--------------- ----------------&lt;br /&gt;HOST_NAME&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;VERSION           STARTUP_T STATUS       PAR    THREAD# ARCHIVE LOG_SWITCH_&lt;br /&gt;----------------- --------- ------------ --- ---------- ------- -----------&lt;br /&gt;LOGINS     SHU DATABASE_STATUS   INSTANCE_ROLE      ACTIVE_ST&lt;br /&gt;---------- --- ----------------- ------------------ ---------&lt;br /&gt;              1 edr&lt;br /&gt;edrserver&lt;br /&gt;9.2.0.1.0         23-DEC-08 OPEN         NO           1 STARTED&lt;br /&gt;ALLOWED    NO  ACTIVE            PRIMARY_INSTANCE   NORMAL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;My controlfile script does not contain the temp file..so I have to add it:&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER TABLESPACE TEMP ADD TEMPFILE '/uo1/oracle/app/product/9.2.0.1.0/oradata/edr_temp/tmpfiles/temp01.dbf'SIZE 4000M; &lt;br /&gt;&lt;br /&gt;And one more thing needed is that I had to create a password file&lt;br /&gt;#pwd&lt;br /&gt;/uo1/oracle/app/product/9.2.0.1.0/dbs&lt;br /&gt;orapwd file=orapwedr password=**********&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-3843308832434983779?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/3843308832434983779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=3843308832434983779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3843308832434983779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3843308832434983779'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/12/restore-and-recover-database-using-hot.html' title='Restore and Recover a database using a HOT Backup and lost archivelog files.'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8118127644839034374</id><published>2008-08-15T10:47:00.002+05:30</published><updated>2009-01-07T11:51:28.835+05:30</updated><title type='text'>Rename datafile</title><content type='html'>Process to rename the datafile:&lt;br /&gt;&lt;br /&gt;alter tablespace master offline;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;!mv masterPROD03.dbf childprod03.dbf&lt;br /&gt;!mv masterPROD02.dbf childprod02.dbf&lt;br /&gt;!mv masterPROD01.dbf childprod01.dbf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;alter tablespace master rename datafile '/u01/prod_data/oradata/prod/dbfiles/masterPROD03.dbf' to&lt;br /&gt;'/u01/prod_data/oradata/prod/dbfiles/childprod03.dbf';&lt;br /&gt;&lt;br /&gt;alter tablespace master rename datafile '/u01/prod_data/oradata/prod/dbfiles/masterPROD02.dbf' to&lt;br /&gt;'/u01/prod_data/oradata/prod/dbfiles/childprod02.dbf';&lt;br /&gt;&lt;br /&gt;alter tablespace master rename datafile '/u01/prod_data/oradata/prod/dbfiles/masterPROD01.dbf' to&lt;br /&gt;'/u01/prod_data/oradata/prod/dbfiles/childprod01.dbf';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select file_name from dba_data_files where tablespace_name='master';&lt;br /&gt;&lt;br /&gt;alter tablespace master online;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8118127644839034374?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8118127644839034374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8118127644839034374' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8118127644839034374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8118127644839034374'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/08/rename-datafile.html' title='Rename datafile'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-5892409435469159236</id><published>2008-08-15T10:40:00.000+05:30</published><updated>2008-08-15T10:45:01.352+05:30</updated><title type='text'>Hot backup script</title><content type='html'>Use this script to prepare the required hot backup scripts&lt;br /&gt;&lt;br /&gt;prompt alter system switch logfile;;&lt;br /&gt;DECLARE&lt;br /&gt;CURSOR cur_tablespace IS&lt;br /&gt; SELECT tablespace_name&lt;br /&gt;  FROM dba_tablespaces;&lt;br /&gt;CURSOR cur_datafile (tn VARCHAR) IS&lt;br /&gt; SELECT file_name&lt;br /&gt;  FROM dba_data_files&lt;br /&gt; WHERE tablespace_name = tn;&lt;br /&gt;BEGIN&lt;br /&gt; FOR ct IN cur_tablespace LOOP&lt;br /&gt;  dbms_output.put_line ('alter tablespace '||ct.tablespace_name||&lt;br /&gt;                        ' begin backup;');&lt;br /&gt;  FOR cd IN cur_datafile (ct.tablespace_name) LOOP&lt;br /&gt; dbms_output.put_line ('host cp '||cd.file_name||' &amp;dir');&lt;br /&gt;  END LOOP;&lt;br /&gt;  dbms_output.put_line ('alter tablespace '||ct.tablespace_name||&lt;br /&gt;                        ' end backup;');&lt;br /&gt; END LOOP;&lt;br /&gt;END;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-5892409435469159236?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/5892409435469159236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=5892409435469159236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5892409435469159236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5892409435469159236'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/08/hot-backup-script.html' title='Hot backup script'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-214326783357837866</id><published>2008-05-12T16:36:00.000+05:30</published><updated>2008-05-12T16:38:35.172+05:30</updated><title type='text'>Simple vi Editor Command</title><content type='html'>&lt;span style="font-weight:bold;"&gt;General Startup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; To use vi: vi filename&lt;br /&gt; To exit vi and save changes: ZZ   or  :wq&lt;br /&gt; To exit vi without saving changes: :q!&lt;br /&gt; To enter vi command mode: [esc]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Counts&lt;/span&gt; : A number preceding any vi command tells vi to repeat that command that many times.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Cursor Movement&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;         h move left (backspace) &lt;br /&gt;         j move down &lt;br /&gt;         k move up &lt;br /&gt;         l move right (spacebar) [return] move to the beginning of the next line &lt;br /&gt;         $ last column on the current line &lt;br /&gt;         0 move cursor to the first column on the current line &lt;br /&gt;         ^ move cursor to first nonblank column on the current line &lt;br /&gt;         w move to the beginning of the next word or punctuation mark &lt;br /&gt;         W move past the next space &lt;br /&gt;         b move to the beginning of the previous word or punctuation mark &lt;br /&gt;         B move to the beginning of the previous word, ignores punctuation &lt;br /&gt;         e end of next word or punctuation mark &lt;br /&gt;         E end of next word, ignoring punctuation &lt;br /&gt;         H move cursor to the top of the screen &lt;br /&gt;         M move cursor to the middle of the screen &lt;br /&gt;         L move cursor to the bottom of the screen&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Screen Movement&lt;/span&gt; &lt;br /&gt;&lt;br /&gt; G move to the last line in the file &lt;br /&gt; xG move to line x &lt;br /&gt; z+ move current line to top of screen &lt;br /&gt; z move current line to the middle of screen &lt;br /&gt; z- move current line to the bottom of screen &lt;br /&gt; ^F move forward one screen &lt;br /&gt; ^B move backward one line &lt;br /&gt; ^D move forward one half screen &lt;br /&gt; ^U move backward one half screen &lt;br /&gt; ^R redraw screen ( does not work with VT100 type terminals ) &lt;br /&gt; ^L redraw screen ( does not work with Televideo terminals )&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Inserting&lt;/span&gt; &lt;br /&gt;&lt;br /&gt; r replace character under cursor with next character typed &lt;br /&gt; R keep replacing character until [esc] is hit &lt;br /&gt; i insert before cursor a append after cursor &lt;br /&gt; A append at end of line &lt;br /&gt; O open line above cursor and enter append mode&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Deleting&lt;/span&gt; &lt;br /&gt;&lt;br /&gt; x delete character under cursor &lt;br /&gt; dd delete line under cursor &lt;br /&gt; dw delete word under cursor &lt;br /&gt; db delete word before cursor&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Copying Code&lt;/span&gt; yy (yank)'copies' line which may then be put by the p(put) command. Precede with a count for multiple lines.&lt;br /&gt;&lt;br /&gt;Put Command brings back previous deletion or yank of lines, words, or characters P bring back before cursor p bring back after cursor&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Find Commands&lt;/span&gt; &lt;br /&gt;&lt;br /&gt; ? finds a word going backwards &lt;br /&gt; / finds a word going forwards &lt;br /&gt; f finds a character on the line under the cursor going forward &lt;br /&gt; F finds a character on the line under the cursor going backwards &lt;br /&gt; t find a character on the current line going forward and stop one character before it &lt;br /&gt; T find a character on the current line going backward and stop one character before it &lt;br /&gt; ; repeat last f, F, t, T&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Miscellaneous Commands&lt;/span&gt; &lt;br /&gt;&lt;br /&gt; . repeat last command &lt;br /&gt; u undoes last command issued &lt;br /&gt; U undoes all commands on one line &lt;br /&gt; xp deletes first character and inserts after second (swap) &lt;br /&gt; J join current line with the next line &lt;br /&gt; ^G display current line number &lt;br /&gt; % if at one parenthesis, will jump to its mate &lt;br /&gt; mx mark current line with character x &lt;br /&gt; 'x find line marked with character x &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;NOTE:&lt;/span&gt; Marks are internal and not written to the file.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-214326783357837866?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/214326783357837866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=214326783357837866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/214326783357837866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/214326783357837866'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/05/simple-vi-editor-command.html' title='Simple vi Editor Command'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-1303507800579626191</id><published>2008-05-12T14:20:00.001+05:30</published><updated>2008-05-12T14:38:03.787+05:30</updated><title type='text'>Clone an Oracle database using an online/hot backup</title><content type='html'>This procedure will clone a database using a online copy of the source database files. Before beginning though, there are a few things that are worth noting about online/hot backups:&lt;br /&gt;&lt;br /&gt;    * When a tablespace is put into backup mode, Oracle will write entire blocks to redo rather than the usual change vectors. For this reason, do not perform a hot backup during periods of heavy database activity - it could lead to a lot of archive logs being created.&lt;br /&gt;    * This procedure will put all tablespaces into backup mode at the same time. If the source database is quite large and you think that it might take a long time to copy, consider copying the tablespaces one at a time, or in groups.&lt;br /&gt;    * While the backup is in progress, it will not be possible to take the tablespaces offline normally or shut down the instance. &lt;br /&gt;&lt;br /&gt;Ok, lets get started...&lt;br /&gt;&lt;br /&gt;    * 1. Make a note of the current archive log change number&lt;br /&gt;      Because the restored files will require recovery, some archive logs will be needed. This applies even if you are not intending to put the cloned database into archive log mode. Work out which will be the first required log by running the following query on the source database. Make a note of the change number that is returned:&lt;br /&gt;&lt;br /&gt;      select max(first_change#) chng&lt;br /&gt;      from v$archived_log&lt;br /&gt;      /&lt;br /&gt;&lt;br /&gt;    * 2. Prepare the begin/end backup scripts&lt;br /&gt;      The following sql will produce two scripts; begin_backup.sql and end_backup.sql. When executed, these scripts will either put the tablespaces into backup mode or take them out of it:&lt;br /&gt;&lt;br /&gt;=====================================&lt;br /&gt;cr_hot_backup.sql&lt;br /&gt;&lt;br /&gt;set lines 999 pages 999&lt;br /&gt;set verify off&lt;br /&gt;set feedback off&lt;br /&gt;set heading off&lt;br /&gt;&lt;br /&gt;spool begin_backup.sql&lt;br /&gt;&lt;br /&gt;select 'alter tablespace ' || tablespace_name || ' begin backup;' tsbb&lt;br /&gt;from    dba_tablespaces&lt;br /&gt;where   contents != 'TEMPORARY'&lt;br /&gt;order by tablespace_name&lt;br /&gt;/&lt;br /&gt;spool off&lt;br /&gt;&lt;br /&gt;spool end_backup.sql&lt;br /&gt;&lt;br /&gt;select 'alter tablespace ' || tablespace_name || ' end backup;' tseb&lt;br /&gt;from    dba_tablespaces&lt;br /&gt;where   contents != 'TEMPORARY'&lt;br /&gt;order by tablespace_name&lt;br /&gt;/&lt;br /&gt;spool off&lt;br /&gt;&lt;br /&gt;=======================================&lt;br /&gt;&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# 3. Put the source database into backup mode&lt;br /&gt;From sqlplus, run the begin backup script created in the last step:&lt;br /&gt;&lt;br /&gt;@begin_backup&lt;br /&gt;&lt;br /&gt;This will put all of the databases tablespaces into backup mode.&lt;br /&gt;&lt;br /&gt;# 4. Copy the files to the new location&lt;br /&gt;Copy, scp or ftp the files from the source database/machine to the target. Do not copy the control files across. Make sure that the files have the correct permissions and ownership.&lt;br /&gt;&lt;br /&gt;# 5. Take the source database out of backup mode&lt;br /&gt;Once the file copy has been completed, take the source database out of backup mode. Run the end backup script created in step 2. From sqlplus:&lt;br /&gt;&lt;br /&gt;@end_backup&lt;br /&gt;&lt;br /&gt;# 6. Copy archive logs&lt;br /&gt;It is only necessary to copy archive logs created during the time the source database was in backup mode. Begin by archiving the current redo:&lt;br /&gt;&lt;br /&gt;alter system archive log current;&lt;br /&gt;# Then, identify which archive log files are required. When run, the following query will ask for a change number. This is the number noted in step 1.&lt;br /&gt;&lt;br /&gt;select name&lt;br /&gt;from v$archived_log&lt;br /&gt;where first_change# &gt;= &amp;change_no&lt;br /&gt;order by name&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Create an archive directory in the clone database.s file system and copy all of the identified logs into it.&lt;br /&gt;&lt;br /&gt;# 7. Produce a pfile for the new database&lt;br /&gt;This step assumes that you are using a spfile. If you are not, just copy the existing pfile.&lt;br /&gt;&lt;br /&gt;From sqlplus:&lt;br /&gt;&lt;br /&gt;create pfile='init&lt;new database sid&gt;.ora' from spfile;&lt;br /&gt;&lt;br /&gt;This will create a new pfile in the $ORACLE_HOME/dbs directory.&lt;br /&gt;&lt;br /&gt;Once created, the new pfile will need to be edited. If the cloned database is to have a new name, this will need to be changed, as will any paths. Review the contents of the file and make alterations as necessary. Also think about adjusting memory parameters. If you are cloning a production database onto a slower development machine you might want to consider reducing some values.&lt;br /&gt;&lt;br /&gt;Ensure that the archive log destination is pointing to the directory created in step 6.&lt;br /&gt;&lt;br /&gt;# 8. Create the clone controlfile&lt;br /&gt;Create a control file for the new database. To do this, connect to the source database and request a dump of the current control file. From sqlplus:&lt;br /&gt;&lt;br /&gt;alter database backup controlfile to trace as '/home/oracle/cr_&lt;new sid&gt;.sql'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;The file will require extensive editing before it can be used. Using your favourite editor make the following alterations:&lt;br /&gt;&lt;br /&gt;    * Remove all lines from the top of the file up to but not including the second 'STARTUP MOUNT' line (it's roughly halfway down the file).&lt;br /&gt;&lt;br /&gt;    * Remove any lines that start with --&lt;br /&gt;&lt;br /&gt;    * Remove any lines that start with a #&lt;br /&gt;&lt;br /&gt;    * Remove any blank lines in the 'CREATE CONTROLFILE' section.&lt;br /&gt;&lt;br /&gt;    * Remove the line 'RECOVER DATABASE USING BACKUP CONTROLFILE'&lt;br /&gt;&lt;br /&gt;    * Remove the line 'ALTER DATABASE OPEN RESETLOGS;'&lt;br /&gt;&lt;br /&gt;    * Make a copy of the 'ALTER TABLESPACE TEMP...' lines, and then remove them from the file. Make sure that you hang onto the command, it will be used later.&lt;br /&gt;&lt;br /&gt;    * Move to the top of the file to the 'CREATE CONTROLFILE' line. The word 'REUSE' needs to be changed to 'SET'. The database name needs setting to the new database name (if it is being changed). Decide whether the database will be put into archivelog mode or not.&lt;br /&gt;&lt;br /&gt;    * If the file paths are being changed, alter the file to reflect the changes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is an example of how the file would look for a small database called dg9a which isn't in archivelog mode:&lt;br /&gt;&lt;br /&gt;====================================================&lt;br /&gt;STARTUP NOMOUNT&lt;br /&gt;CREATE CONTROLFILE SET DATABASE "DG9A" RESETLOGS FORCE LOGGING NOARCHIVELOG&lt;br /&gt;    MAXLOGFILES 50&lt;br /&gt;    MAXLOGMEMBERS 5&lt;br /&gt;    MAXDATAFILES 100&lt;br /&gt;    MAXINSTANCES 1&lt;br /&gt;    MAXLOGHISTORY 453&lt;br /&gt;LOGFILE&lt;br /&gt;  GROUP 1 '/u03/oradata/dg9a/redo01.log'  SIZE 100M,&lt;br /&gt;  GROUP 2 '/u03/oradata/dg9a/redo02.log'  SIZE 100M,&lt;br /&gt;  GROUP 3 '/u03/oradata/dg9a/redo03.log'  SIZE 100M&lt;br /&gt;DATAFILE&lt;br /&gt;  '/u03/oradata/dg9a/system01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/undotbs01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/cwmlite01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/drsys01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/example01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/indx01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/odm01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/tools01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/users01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/xdb01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/andy01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/psstats01.dbf',&lt;br /&gt;  '/u03/oradata/dg9a/planner01.dbf'&lt;br /&gt;CHARACTER SET WE8ISO8859P1&lt;br /&gt;;&lt;br /&gt;=======================================================&lt;br /&gt;&lt;br /&gt;# 9. Add a new entry to oratab and source the environment&lt;br /&gt;Edit the /etc/oratab (or /opt/oracle/oratab) and add an entry for the new database.&lt;br /&gt;Source the new environment with '. oraenv' and verify that it has worked by issuing the following command:&lt;br /&gt;&lt;br /&gt;echo $ORACLE_SID&lt;br /&gt;&lt;br /&gt;If this doesn't output the new database sid go back and investigate.&lt;br /&gt;&lt;br /&gt;# 10. Create the a password file&lt;br /&gt;Use the following command to create a password file (add an appropriate password to the end of it):&lt;br /&gt;&lt;br /&gt;orapwd file=${ORACLE_HOME}/dbs/orapw${ORACLE_SID} password=&lt;your password&gt;&lt;br /&gt;&lt;br /&gt;# 11. Create the new control file(s)&lt;br /&gt;Ok, now for the exciting bit! It is time to create the new controlfiles and open the database:&lt;br /&gt;&lt;br /&gt;sqlplus "/ as sysdba"&lt;br /&gt;&lt;br /&gt;@/home/oracle/cr_&lt;new database sid&gt;&lt;br /&gt;&lt;br /&gt;If all goes to plan you will see the instance start and then the message 'Control file created'.&lt;br /&gt;&lt;br /&gt;# 12. Recover and open the database&lt;br /&gt;The archive logs that were identified and copied in step 6 must now be applied to the database. Issue the following command from sqlplus:&lt;br /&gt;&lt;br /&gt;recover database using backup controlfile until cancel&lt;br /&gt;&lt;br /&gt;When prompted to 'Specify log' enter 'auto'. Oracle will then apply all the available logs, and then error with ORA-00308. This is normal, it simply means that all available logs have been applied. Open the database with reset logs:&lt;br /&gt;&lt;br /&gt;alter database open resetlogs;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# 13. Create temp files&lt;br /&gt;Using the 'ALTER TABLESPACE TEMP...' command from step 8, create the temp files. Make sure the paths to the file(s) are correct, then run it from sqlplus.&lt;br /&gt;&lt;br /&gt;# 14. Perform a few checks&lt;br /&gt;If the last couple of steps went smoothly, the database should be open. It is advisable to perform a few checks at this point:&lt;br /&gt;&lt;br /&gt;    * Check that the database has opened with:&lt;br /&gt;&lt;br /&gt;      select status from v$instance;&lt;br /&gt;&lt;br /&gt;      The status should be 'OPEN'&lt;br /&gt;&lt;br /&gt;    * Make sure that the datafiles are all ok:&lt;br /&gt;&lt;br /&gt;      select distinct status from v$datafile;&lt;br /&gt;&lt;br /&gt;      It should return only ONLINE and SYSTEM.&lt;br /&gt;&lt;br /&gt;    * Take a quick look at the alert log too. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# 15. Set the databases global name&lt;br /&gt;The new database will still have the source databases global name. Run the following to reset it:&lt;br /&gt;&lt;br /&gt;alter database rename global_name to &lt;new database sid&gt;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;Note. no quotes!&lt;br /&gt;&lt;br /&gt;# 16. Create a spfile&lt;br /&gt;From sqlplus:&lt;br /&gt;&lt;br /&gt;create spfile from pfile;&lt;br /&gt;&lt;br /&gt;# 17. Change the database ID&lt;br /&gt;If RMAN is going to be used to back-up the database, the database ID must be changed. If RMAN isn't going to be used, there is no harm in changing the ID anyway - and it's a good practice to do so.&lt;br /&gt;&lt;br /&gt;From sqlplus:&lt;br /&gt;&lt;br /&gt;shutdown immediate&lt;br /&gt;startup mount&lt;br /&gt;exit&lt;br /&gt;&lt;br /&gt;From unix:&lt;br /&gt;&lt;br /&gt;nid target=/&lt;br /&gt;&lt;br /&gt;NID will ask if you want to change the ID. Respond with 'Y'. Once it has finished, start the database up again in sqlplus:&lt;br /&gt;&lt;br /&gt;shutdown immediate&lt;br /&gt;startup mount&lt;br /&gt;alter database open resetlogs&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;# 18. Configure TNS&lt;br /&gt;Add entries for new database in the listener.ora and tnsnames.ora as necessary.&lt;br /&gt;&lt;br /&gt;# 19. Finished&lt;br /&gt;That's it!&lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;http://www.shutdownabort.com/quickguides/clone_hot.php&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-1303507800579626191?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/1303507800579626191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=1303507800579626191' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1303507800579626191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1303507800579626191'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/05/clone-oracle-database-using-onlinehot.html' title='Clone an Oracle database using an online/hot backup'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8279455407513990923</id><published>2008-05-01T13:30:00.000+05:30</published><updated>2008-05-01T13:32:30.408+05:30</updated><title type='text'>Tom Kytes Challenge</title><content type='html'>I Came across a wonderful Challenge Tom(Thomas Kyte) gave to people out there some time back, while going through his asktom site.&lt;br /&gt;&lt;br /&gt;The challenge is simple(not as it seems) : Have to correctly provide &lt;span style="font-weight:bold;"&gt;ALL&lt;/span&gt; of the versions the following features were added to Oracle. &lt;br /&gt;&lt;br /&gt;Thought interesting so blogged it here.&lt;br /&gt;&lt;br /&gt;Happy reading, fun along with knowledge.....just go on&lt;br /&gt;&lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;&lt;br /&gt;ops$tkyte%ORA10GR2&gt; select distinct version from features order by version;&lt;br /&gt;&lt;br /&gt;VERSION&lt;br /&gt;--------------------&lt;br /&gt;10.1&lt;br /&gt;10.2&lt;br /&gt;11.1&lt;br /&gt;2&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;6&lt;br /&gt;7.0&lt;br /&gt;7.1&lt;br /&gt;7.2&lt;br /&gt;7.3&lt;br /&gt;8.0&lt;br /&gt;8.1.5&lt;br /&gt;8.1.6&lt;br /&gt;8.1.7&lt;br /&gt;9.0&lt;br /&gt;9.2&lt;br /&gt;&lt;br /&gt;18 rows selected.&lt;br /&gt;&lt;br /&gt;So, here are the features: &lt;br /&gt;&lt;br /&gt;ops$tkyte%ORA10GR2&gt;&lt;br /&gt;ops$tkyte%ORA10GR2&gt; select rownum, txt&lt;br /&gt;  2    from (select txt from features order by rnd)&lt;br /&gt;  3  /&lt;br /&gt;&lt;br /&gt;    ROWNUM TXT&lt;br /&gt;---------- ----------------------------------------------------------------------&lt;br /&gt;         1 Real Application Testing&lt;br /&gt;         2 Read only Replication&lt;br /&gt;         3 Distributed Query&lt;br /&gt;         4 Drop column&lt;br /&gt;         5 Client-Server (where the client could be elsewhere in the network)&lt;br /&gt;         6 Object Relational Features&lt;br /&gt;         7 Ability to return result sets from stored procedures (ref cursors)&lt;br /&gt;         8 Commit and Rollback (transactions)&lt;br /&gt;         9 Triggers&lt;br /&gt;        10 Function based indexes&lt;br /&gt;        11 Materialized Views&lt;br /&gt;        12 Rman&lt;br /&gt;        13 Audit SYSDBA/SYSOPER activity&lt;br /&gt;        14 Automatic Undo Management&lt;br /&gt;        15 Resumable Operations&lt;br /&gt;        16 Automatic Storage Management (ASM)&lt;br /&gt;        17 Streams&lt;br /&gt;        18 Bitmap Indexes&lt;br /&gt;        19 csscan - Character Set Scanner utility&lt;br /&gt;        20 Flashback Query&lt;br /&gt;        21 Case statement (IN SQL, instead of decode)&lt;br /&gt;        22 Parallel Query&lt;br /&gt;        23 Transparent column level encryption&lt;br /&gt;        24 Tablespace encryption&lt;br /&gt;        25 PL/SQL&lt;br /&gt;        26 Partitioning&lt;br /&gt;        27 Row Level Locking&lt;br /&gt;        28 Read Consistency (my favorite feature!)&lt;br /&gt;        29 2 Phase Commit&lt;br /&gt;        30 Sorted Hash Clusters&lt;br /&gt;        31 Conditional compilation for PL/SQL&lt;br /&gt;        32 Connect By Queries (select ename, level from emp connect by prior....)&lt;br /&gt;        33 Update anywhere Replication&lt;br /&gt;&lt;br /&gt;33 rows selected.&lt;br /&gt;&lt;br /&gt;=======================================&lt;br /&gt;Check your answers:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;select rownum, version, txt&lt;br /&gt;  2    from (select version, txt from features order by rnd)&lt;br /&gt;  3  /&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;col txt for a40&lt;br /&gt;select * from features order by &lt;br /&gt;to_number(substr(version,1,decode(instr(version,'.'),0,1,instr(version,'.'))))&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    ROWNUM VERSION              TXT&lt;br /&gt;---------- -------------------- ----------------------------------------&lt;br /&gt;         1 8.1.5                Materialized Views&lt;br /&gt;         2 10.1                 Sorted Hash Clusters&lt;br /&gt;         3 8.0                  Rman&lt;br /&gt;         4 8.1.6                Case statement&lt;br /&gt;         5 7.0                  2 Phase Commit&lt;br /&gt;         6 11.1                 Real Application Testing&lt;br /&gt;         7 2                    Connect By Queries (select ename, level&lt;br /&gt;                                from emp connect by prior....)&lt;br /&gt;&lt;br /&gt;         8 9.0                  Automatic Undo Management&lt;br /&gt;         9 3                    Commit and Rollback (transactions)&lt;br /&gt;        10 7.2                  Ability to return result sets from store&lt;br /&gt;                                d procedures (ref cursors)&lt;br /&gt;&lt;br /&gt;        11 8.1.5                Function based indexes&lt;br /&gt;        12 11.1                 Tablespace encryption&lt;br /&gt;        13 8.1.6                csscan - Character Set Scanner utility&lt;br /&gt;        14 4                    Read Consistency (my favorite feature!)&lt;br /&gt;        15 7.0                  Triggers&lt;br /&gt;        16 10.1                 Automatic Storage Management (ASM)&lt;br /&gt;        17 7.1                  Update anywhere Replication&lt;br /&gt;        18 5                    Distributed Query&lt;br /&gt;        19 7.1                  Parallel Query&lt;br /&gt;        20 5                    Client-Server (where the client could be&lt;br /&gt;                                 elsewhere in the network)&lt;br /&gt;&lt;br /&gt;        21 10.2                 Transparent column level encryption&lt;br /&gt;        22 10.2                 Conditional compilation for PL/SQL&lt;br /&gt;        23 8.1.5                Drop column&lt;br /&gt;        24 9.2                  Streams&lt;br /&gt;        25 8.0                  Object Relational Features&lt;br /&gt;        26 9.0                  Flashback Query&lt;br /&gt;        27 9.2                  Audit SYSDBA/SYSOPER activity&lt;br /&gt;        28 7.3                  Bitmap Indexes&lt;br /&gt;        29 6                    PL/SQL&lt;br /&gt;        30 7.0                  Read only Replication&lt;br /&gt;        31 6                    Row Level Locking&lt;br /&gt;        32 8.0                  Partitioning&lt;br /&gt;        33 9.0                  Resumable Operations&lt;br /&gt;================================================================================&lt;br /&gt;&lt;br /&gt;Want to know how Tom exactly, created this table : &lt;br /&gt;&lt;br /&gt;here is the script,&lt;br /&gt;&lt;br /&gt;/*&lt;br /&gt;&lt;br /&gt;drop table features;&lt;br /&gt;create table features( rnd number, version varchar2(20), txt varchar2(100) );&lt;br /&gt;&lt;br /&gt;insert into features values ( dbms_random.random, '2', 'Connect By Queries (select ename, level &lt;br /&gt;from emp connect by prior....)');&lt;br /&gt;insert into features values ( dbms_random.random, '3', 'Commit and Rollback (transactions)');&lt;br /&gt;insert into features values ( dbms_random.random, '4', 'Read Consistency (my favorite feature!)');&lt;br /&gt;insert into features values ( dbms_random.random, '5', 'Client-Server (where the client could be &lt;br /&gt;elsewhere in the network)');&lt;br /&gt;insert into features values ( dbms_random.random, '5', 'Distributed Query');&lt;br /&gt;insert into features values ( dbms_random.random, '6', 'Row Level Locking');&lt;br /&gt;insert into features values ( dbms_random.random, '6', 'PL/SQL');&lt;br /&gt;insert into features values ( dbms_random.random, '7.0', '2 Phase Commit');&lt;br /&gt;insert into features values ( dbms_random.random, '7.0', 'Triggers');&lt;br /&gt;insert into features values ( dbms_random.random, '7.0', 'Read only Replication');&lt;br /&gt;insert into features values ( dbms_random.random, '7.1', 'Update anywhere Replication');&lt;br /&gt;insert into features values ( dbms_random.random, '7.1', 'Parallel Query');&lt;br /&gt;insert into features values ( dbms_random.random, '7.2', 'Ability to return result sets from stored &lt;br /&gt;procedures (ref cursors)');&lt;br /&gt;insert into features values ( dbms_random.random, '7.3', 'Bitmap Indexes');&lt;br /&gt;insert into features values ( dbms_random.random, '8.0', 'Object Relational Features');&lt;br /&gt;insert into features values ( dbms_random.random, '8.0', 'Partitioning');&lt;br /&gt;insert into features values ( dbms_random.random, '8.0', 'Rman');&lt;br /&gt;insert into features values ( dbms_random.random, '8.1.5', 'Materialized Views');&lt;br /&gt;insert into features values ( dbms_random.random, '8.1.5', 'Function based indexes');&lt;br /&gt;insert into features values ( dbms_random.random, '8.1.5', 'Drop column');&lt;br /&gt;insert into features values ( dbms_random.random, '8.1.6', 'Case statement');&lt;br /&gt;insert into features values ( dbms_random.random, '8.1.6', 'csscan - Character Set Scanner &lt;br /&gt;utility');&lt;br /&gt;insert into features values ( dbms_random.random, '9.0', 'Automatic Undo Management');&lt;br /&gt;insert into features values ( dbms_random.random, '9.0', 'Resumable Operations');&lt;br /&gt;insert into features values ( dbms_random.random, '9.0', 'Flashback Query');&lt;br /&gt;insert into features values ( dbms_random.random, '9.2', 'Streams');&lt;br /&gt;insert into features values ( dbms_random.random, '9.2', 'Audit SYSDBA/SYSOPER activity');&lt;br /&gt;insert into features values ( dbms_random.random, '10.1', 'Automatic Storage Management (ASM)');&lt;br /&gt;insert into features values ( dbms_random.random, '10.1', 'Sorted Hash Clusters');&lt;br /&gt;insert into features values ( dbms_random.random, '10.2', 'Conditional compilation for PL/SQL');&lt;br /&gt;insert into features values ( dbms_random.random, '10.2', 'Transparent column level encryption');&lt;br /&gt;insert into features values ( dbms_random.random, '11.1', 'Tablespace encryption');&lt;br /&gt;insert into features values ( dbms_random.random, '11.1', 'Real Application Testing');&lt;br /&gt;&lt;br /&gt;select distinct version from features order by version;&lt;br /&gt;*/&lt;br /&gt;&lt;br /&gt;===================================================================&lt;br /&gt;Tom Kytes web sites...&lt;br /&gt;&lt;br /&gt;http://tkyte.blogspot.com/&lt;br /&gt;http://asktom.oracle.com/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8279455407513990923?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8279455407513990923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8279455407513990923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8279455407513990923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8279455407513990923'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/05/tom-kytes-challenge.html' title='Tom Kytes Challenge'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4347071435993719874</id><published>2008-04-30T14:32:00.001+05:30</published><updated>2008-04-30T14:42:57.956+05:30</updated><title type='text'>General process for Query Tuning</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Create a plan table&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;@?/rdbms/admin/utlxplan.sql &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Autotrace&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To switch it on:&lt;br /&gt;&lt;br /&gt;SQL&gt;column plan_plus_exp format a100&lt;br /&gt;&lt;br /&gt;SQL&gt;set autotrace on explain   &lt;br /&gt;# Displays the execution plan only. &lt;br /&gt;SQL&gt;set autotrace traceonly explain &lt;br /&gt;# dont run the query&lt;br /&gt;SQL&gt;set autotrace on  &lt;br /&gt;# Shows the execution plan as well as statistics of the statement. &lt;br /&gt;SQL&gt;set autotrace on statistics  &lt;br /&gt;# Displays the statistics only. &lt;br /&gt;SQL&gt;set autotrace traceonly      &lt;br /&gt;# Displays the execution plan and the statistics&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To switch it off:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;set autotrace off  &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Explain plan &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;explain plan for&lt;br /&gt;select ...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;or...&lt;/span&gt;&lt;br /&gt;SQL&gt;explain plan set statement_id = 'bad1' for&lt;br /&gt;select...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Then to see the output...&lt;/span&gt;&lt;br /&gt;SQL&gt;set lines 100 pages 999&lt;br /&gt;SQL&gt;@?/rdbms/admin/utlxpls&lt;br /&gt;&lt;br /&gt;Put something &lt;span style="font-weight:bold;"&gt;unique&lt;/span&gt; in the like clause&lt;br /&gt;&lt;br /&gt;SQL&gt;select hash_value, sql_text&lt;br /&gt;from v$sqlarea&lt;br /&gt;where sql_text like '%TIMINGLINKS%FOLDERREF%'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Grab the sql associated with a hash&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;select sql_text&lt;br /&gt;from v$sqlarea&lt;br /&gt;where hash_value = '&amp;hash'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Look at a query's stats in the sql area&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt;select executions&lt;br /&gt;, cpu_time&lt;br /&gt;, disk_reads&lt;br /&gt;, buffer_gets&lt;br /&gt;, rows_processed&lt;br /&gt;, buffer_gets / executions&lt;br /&gt;from v$sqlarea&lt;br /&gt;where hash_value = '&amp;hash'&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4347071435993719874?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4347071435993719874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4347071435993719874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4347071435993719874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4347071435993719874'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/04/query-tuning.html' title='General process for Query Tuning'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-3211929929080491254</id><published>2008-04-30T12:06:00.002+05:30</published><updated>2008-04-30T12:12:47.098+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cool Scripts'/><title type='text'>Cool Scripts</title><content type='html'>Cool script to know the details of a Particular user.&lt;br /&gt;&lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;-- user_conf.sql &lt;br /&gt;&lt;br /&gt;set lines 100 pages 999&lt;br /&gt;set verify off&lt;br /&gt;set feedback off&lt;br /&gt;&lt;br /&gt;undefine user&lt;br /&gt;&lt;br /&gt;accept userid prompt 'Enter username:'&lt;br /&gt;&lt;br /&gt;select username&lt;br /&gt;,      default_tablespace&lt;br /&gt;,      temporary_tablespace&lt;br /&gt;from   dba_users&lt;br /&gt;where  username = '&amp;userid'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select tablespace_name&lt;br /&gt;,      decode(max_bytes, -1, 'unlimited'&lt;br /&gt;,      ceil(max_bytes / 1024 / 1024) || 'M' ) "QUOTA"&lt;br /&gt;from   dba_ts_quotas&lt;br /&gt;where  username = upper('&amp;&amp;userid')&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select granted_role || ' ' || decode(admin_option, 'NO', '', 'YES', 'with admin option') &lt;br /&gt;&lt;br /&gt;"ROLE"&lt;br /&gt;from   dba_role_privs&lt;br /&gt;where  grantee = upper('&amp;&amp;userid')&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select privilege || ' ' || decode(admin_option, 'NO', '', 'YES', 'with admin option') &lt;br /&gt;&lt;br /&gt;"PRIV"&lt;br /&gt;from   dba_sys_privs&lt;br /&gt;where  grantee = upper('&amp;&amp;userid')&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;undefine user&lt;br /&gt;set verify on&lt;br /&gt;set feedback on&lt;br /&gt; &lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;&lt;br /&gt;Cool script to CLONE a Particular user.&lt;br /&gt;&lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;-- user_clone.sql&lt;br /&gt;&lt;br /&gt;set lines 999 pages 999&lt;br /&gt;set verify off&lt;br /&gt;set feedback off&lt;br /&gt;set heading off&lt;br /&gt;&lt;br /&gt;select username&lt;br /&gt;from dba_users&lt;br /&gt;order by username&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;undefine user&lt;br /&gt;&lt;br /&gt;accept userid prompt 'Enter user to clone: '&lt;br /&gt;accept newuser prompt 'Enter new username: '&lt;br /&gt;accept passwd prompt 'Enter new password: '&lt;br /&gt;&lt;br /&gt;select username&lt;br /&gt;,      created&lt;br /&gt;from   dba_users&lt;br /&gt;where  lower(username) = lower('&amp;newuser')&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;accept poo prompt 'Continue? (ctrl-c to exit)'&lt;br /&gt;&lt;br /&gt;--spool /tmp/user_clone_tmp.sql&lt;br /&gt;spool D:\temp\testing\user_clone_tmp.sql&lt;br /&gt;&lt;br /&gt;select 'create user ' || '&amp;newuser' ||&lt;br /&gt;       ' identified by ' || '&amp;passwd' ||&lt;br /&gt;       ' default tablespace ' || default_tablespace ||&lt;br /&gt;       ' temporary tablespace ' || temporary_tablespace || ';' "user"&lt;br /&gt;from   dba_users&lt;br /&gt;where  username = '&amp;userid'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select 'alter user &amp;newuser quota '||&lt;br /&gt;       decode(max_bytes, -1, 'unlimited'&lt;br /&gt;       ,                     ceil(max_bytes / 1024 / 1024) || 'M') ||&lt;br /&gt;       ' on ' || tablespace_name || ';'&lt;br /&gt;from   dba_ts_quotas&lt;br /&gt;where  username = '&amp;&amp;userid'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select 'grant ' ||granted_role || ' to &amp;newuser' ||&lt;br /&gt;       decode(admin_option, 'NO', ';', 'YES', ' with admin option;') "ROLE"&lt;br /&gt;from   dba_role_privs&lt;br /&gt;where  grantee = '&amp;&amp;userid'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select 'grant ' || privilege || ' to &amp;newuser' ||&lt;br /&gt;       decode(admin_option, 'NO', ';', 'YES', ' with admin option;') "PRIV"&lt;br /&gt;from   dba_sys_privs&lt;br /&gt;where  grantee = '&amp;&amp;userid'&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;spool off&lt;br /&gt;&lt;br /&gt;undefine user&lt;br /&gt;&lt;br /&gt;set verify on&lt;br /&gt;set feedback on&lt;br /&gt;set heading on&lt;br /&gt;&lt;br /&gt;@D:\temp\testing\user_clone_tmp.sql&lt;br /&gt;&lt;br /&gt;host del D:\temp\testing\user_clone_tmp.sql&lt;br /&gt;&lt;br /&gt;--@/tmp/user_clone_tmp.sql&lt;br /&gt;&lt;br /&gt;--!rm /tmp/user_clone_tmp.sql&lt;br /&gt;&lt;br /&gt;NOTE: Username should be Entered in Captitals.&lt;br /&gt; &lt;br /&gt;+++++++++++++++++++++++++++++++++++++++++++++++&lt;br /&gt;&lt;br /&gt;Save the scripts as .sql and run at the command prompt.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-3211929929080491254?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/3211929929080491254/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=3211929929080491254' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3211929929080491254'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3211929929080491254'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/04/cool-script-to-know-details-of.html' title='Cool Scripts'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-912038973365669521</id><published>2008-04-29T15:43:00.000+05:30</published><updated>2008-04-29T15:45:44.844+05:30</updated><title type='text'>How to Create and Use OMF</title><content type='html'>OMF indicates Oracle Managed Files. With the use of Oracle-managed files the administration of an Oracle Database can be simplified. Oracle-managed files eliminate the need for you, the DBA, to directly manage the operating system files comprising an Oracle Database. You specify operations in terms of database objects rather than filenames. &lt;br /&gt;&lt;br /&gt;Enable the Creation of OMFs&lt;br /&gt;--------------------------------&lt;br /&gt;The following initialization parameters allow the database server to use the Oracle-managed files feature.&lt;br /&gt;&lt;br /&gt;1)DB_CREATE_FILE_DEST: Defines the location of the default file system directory where the database creates datafiles or tempfiles when no file specification is given in the creation operation. It is also used as the default file system directory for redo log and control files if DB_CREATE_ONLINE_LOG_DEST_n is not specified.&lt;br /&gt;&lt;br /&gt;2)DB_CREATE_ONLINE_LOG_DEST_n:Defines the location of the default file system directory for redo log files and control file creation when no file specification is given in the creation operation. You can use this initialization parameter multiple times, where n specifies a multiplexed copy of the redo log or control file. You can specify up to five multiplexed copies.&lt;br /&gt;&lt;br /&gt;3)DB_RECOVERY_FILE_DEST:Defines the location of the default file system directory where the database creates RMAN backups when no format option is used, archived logs when no other local destination is configured, and flashback logs. Also used as the default file system directory for redo log and control files if DB_CREATE_ONLINE_LOG_DEST_n is not specified.&lt;br /&gt;&lt;br /&gt;Both of these initialization parameters are dynamic, and can be set using the ALTER SYSTEM or ALTER SESSION statement.&lt;br /&gt;&lt;br /&gt;An Example of using OMF :&lt;br /&gt;---------------------------&lt;br /&gt;1)Setting the parameter for the session:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter session set db_create_file_dest='/oradata';&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;2)Create Tablespace using OMF:&lt;br /&gt;&lt;br /&gt;SQL&gt; create tablespace omf_tbs;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;3)Check the data file Location:&lt;br /&gt;&lt;br /&gt;SQL&gt; select file_name from dba_data_files where tablespace_name='OMF_TBS';&lt;br /&gt;FILE_NAME&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;/oradata/EDR/datafile/o1_mf_omf_tbs_4067w4op_.dbf&lt;br /&gt;&lt;br /&gt;Here EDR is the Database Name.&lt;br /&gt;&lt;br /&gt;The dafault location for datafile is Your settings for parameter/Database Name/datafile/Unique Name.dbf&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-912038973365669521?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/912038973365669521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=912038973365669521' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/912038973365669521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/912038973365669521'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/04/how-to-create-and-use-omf.html' title='How to Create and Use OMF'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-5779658664897947725</id><published>2008-04-19T16:41:00.001+05:30</published><updated>2008-04-19T17:56:41.708+05:30</updated><title type='text'>Oracle11g: Where’s My Alert Log?</title><content type='html'>Just a short blog entry about Oracle 11g. &lt;br /&gt;One of the first things that caught me by surprise with 11g, &lt;br /&gt;when I first started in the beta program, was that the default &lt;br /&gt;location for the alert log has moved. It is still placed &lt;br /&gt;under the traditional OFA structure, but not /u01/app/oracle/admin. &lt;br /&gt;There is a new directory called diag that resides &lt;br /&gt;in /u01/app/oracle as seen on one of my systems:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 ~]$ cd /u01/app/oracle/diag/rdbms/orcl/orcl&lt;br /&gt;[oracle@oracle11gr1 orcl]$ ll&lt;br /&gt;total 64&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 alert&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 cdump&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 hm&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 incident&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 incpkg&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan 24 01:38 ir&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 lck&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 metadata&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 stage&lt;br /&gt;drwxr-x--- 2 oracle oinstall  4096 Jan  9 13:23 sweep&lt;br /&gt;drwxr-x--- 2 oracle oinstall 24576 Apr 19 15:33 trace&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 orcl]$ cd trace&lt;br /&gt;[oracle@oracle11gr1 trace]$ pwd&lt;br /&gt;/u01/app/oracle/diag/rdbms/orcl/orcl/trace&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 trace]$ ll alert_orcl.log&lt;br /&gt;-rw-r----- 1 oracle oinstall 392 Apr 19 15:33 alert_orcl.log&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this case, my database is called orcl and the instance is orcl.&lt;br /&gt;&lt;br /&gt;View : v$diag_info&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-5779658664897947725?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/5779658664897947725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=5779658664897947725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5779658664897947725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5779658664897947725'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/04/oracle11g-wheres-my-alert-log_19.html' title='Oracle11g: Where’s My Alert Log?'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-7887356998824909866</id><published>2008-04-19T16:37:00.000+05:30</published><updated>2008-04-19T16:40:19.352+05:30</updated><title type='text'>If Alert log file is lost</title><content type='html'>One of my friend asked me whether if in any case the &lt;br /&gt;alert log file is lost what happens?&lt;br /&gt;&lt;br /&gt;It is automatically created whenever there needs to &lt;br /&gt;be a new entry into the alert log.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Lets see a practical explanation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 ~]$ sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Sat Apr 19 15:35:05 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn /as sysdba&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt;!&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1]$ cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace&lt;br /&gt;[oracle@oracle11gr1 trace]$&lt;br /&gt;[oracle@oracle11gr1 trace]$ ll alert_orcl.log&lt;br /&gt;-rw-r----- 1 oracle oinstall 144278 Apr 19 15:26 alert_orcl.log&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 trace]$ pwd&lt;br /&gt;/u01/app/oracle/diag/rdbms/orcl/orcl/trace&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 trace]$&lt;br /&gt;[oracle@oracle11gr1 trace]$&lt;span style="font-weight:bold;"&gt; mv alert_orcl.log alert_orcl_bak.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 trace]$ll alert_orcl.log&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ls: alert_orcl.log: No such file or directory&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 trace]$exit&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; CREATE TABLESPACE EDR_VECTOR_SPIND DATAFILE&lt;br /&gt;'/u01/app/oracle/oradata/orcl/user.dbf' SIZE 4M AUTOEXTEND ON&lt;br /&gt;MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;  2    3&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; !&lt;br /&gt;[oracle@oracle11gr1 ~]$&lt;br /&gt;[oracle@oracle11gr1 ~]$&lt;br /&gt;[oracle@oracle11gr1 ~]$ cd /u01/app/oracle/diag/rdbms/orcl/orcl/trace&lt;br /&gt;[oracle@oracle11gr1 trace]$&lt;br /&gt;[oracle@oracle11gr1 trace]$&lt;br /&gt;[oracle@oracle11gr1 trace]$ &lt;span style="font-weight:bold;"&gt;ll alert_orcl.log&lt;/span&gt;&lt;br /&gt;-rw-r----- 1 oracle oinstall 392 Apr 19 15:33 &lt;span style="font-weight:bold;"&gt;alert_orcl.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 trace]$&lt;br /&gt;[oracle@oracle11gr1 trace]$ more alert_orcl.log&lt;br /&gt;Sat Apr 19 15:33:15 2008&lt;br /&gt;CREATE TABLESPACE EDR_VECTOR_SPIND DATAFILE&lt;br /&gt;'/u01/app/oracle/oradata/orcl/user.dbf' SIZE 4M AUTOEXTEND ON&lt;br /&gt;MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO&lt;br /&gt;Completed: CREATE TABLESPACE EDR_VECTOR_SPIND DATAFILE&lt;br /&gt;'/u01/app/oracle/oradata/orcl/user.dbf' SIZE 4M AUTOEXTEND ON&lt;br /&gt;MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 trace]$&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-7887356998824909866?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/7887356998824909866/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=7887356998824909866' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7887356998824909866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7887356998824909866'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/04/if-alert-log-file-is-lost.html' title='If Alert log file is lost'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-5962086209489219432</id><published>2008-04-11T12:42:00.001+05:30</published><updated>2008-04-11T12:49:25.837+05:30</updated><title type='text'>Capture all SQL run between two points in time</title><content type='html'>There are situations where it is useful to capture the SQL &lt;br /&gt;that a particular user is running in the database. Usually&lt;br /&gt;you would simply enable session tracing for that user, but&lt;br /&gt;there are two potential problems with that approach.&lt;br /&gt;&lt;br /&gt;The first is that many web based applications maintain a &lt;br /&gt;pool of persistent database connections which are shared &lt;br /&gt;amongst multiple users. The second is that some applications &lt;br /&gt;connect, run some SQL and disconnect very quickly, making it &lt;br /&gt;tricky to enable session tracing at all (you could of course &lt;br /&gt;use a logon trigger to enable session tracing in this case).&lt;br /&gt;&lt;br /&gt;A quick and dirty solution to the problem is to capture all &lt;br /&gt;SQL statements that are run between two points in time.&lt;br /&gt;&lt;br /&gt;The following procedure will create two tables, each containing &lt;br /&gt;a snapshot of the database at a particular point. The tables &lt;br /&gt;will then be queried to produce a list of all SQL run during &lt;br /&gt;that period.&lt;br /&gt;&lt;br /&gt;If possible, you should do this on a quiet development system - &lt;br /&gt;otherwise you risk getting way too much data back.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1. Take the first snapshot&lt;/span&gt;&lt;br /&gt;Run the following sql to create the first snapshot: &lt;br /&gt;&lt;br /&gt;create table sql_exec_before as&lt;br /&gt;select executions&lt;br /&gt;,  hash_value&lt;br /&gt;from v$sqlarea&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2. Get the user to perform their task within the application&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;3. Take the second snapshot&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;select aft.hash_value&lt;br /&gt;from sql_exec_before bef&lt;br /&gt;, sql_exec_after aft&lt;br /&gt;where aft.executions &gt; bef.executions&lt;br /&gt;and aft.hash_value  =  bef.hash_value (+) &lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;4. Check the results&lt;/span&gt;&lt;br /&gt;Now that you have captured the SQL it is time to query the results.&lt;br /&gt;&lt;br /&gt;This first query will list all query hashes that have been executed:&lt;br /&gt;select aft.hash_value&lt;br /&gt;from sql_exec_before bef&lt;br /&gt;, sql_exec_after aft&lt;br /&gt;where aft.executions &gt; bef.executions&lt;br /&gt;and aft.hash_value  =  bef.hash_value (+) &lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;This one will display the hash and the SQL itself:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;set pages 999 lines 100&lt;br /&gt;break on hash_value&lt;br /&gt;select hash_value&lt;br /&gt;, sql_text&lt;br /&gt;from  v$sqltext&lt;br /&gt;where hash_value in (&lt;br /&gt; select aft.hash_value&lt;br /&gt; from sql_exec_before bef&lt;br /&gt; , sql_exec_after aft&lt;br /&gt; where aft.executions &gt; bef.executions&lt;br /&gt; and aft.hash_value  =  bef.hash_value (+) &lt;br /&gt;)&lt;br /&gt;order by&lt;br /&gt; hash_value&lt;br /&gt;, piece&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;5. Tidy up&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Don't forget to remove the snapshot tables once you've finished: &lt;br /&gt;&lt;br /&gt;drop table sql_exec_before&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;drop table sql_exec_after&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Source : www.shutdownabort.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-5962086209489219432?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/5962086209489219432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=5962086209489219432' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5962086209489219432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5962086209489219432'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/04/capture-all-sql-run-between-two-points.html' title='Capture all SQL run between two points in time'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2680408983144878007</id><published>2008-04-10T17:24:00.001+05:30</published><updated>2008-04-10T17:26:27.940+05:30</updated><title type='text'>How to find Client IP address by Quering Oracle Database ?</title><content type='html'>We can use PLSQL package UTL_INADDR.&lt;br /&gt;&lt;br /&gt;There are two procedures' &lt;br /&gt;&lt;br /&gt;1. GET_HOST_NAME or &lt;br /&gt;2. GET_HOST_ADDRESS &lt;br /&gt;&lt;br /&gt;for finding out local machine HOST name or IP address.&lt;br /&gt;&lt;br /&gt;UTL_INADDR&lt;br /&gt;&lt;br /&gt;We can use below query to findout CLIENT IP ADDRESS.&lt;br /&gt;&lt;br /&gt;SQL&gt; col machine for a20&lt;br /&gt;SQL&gt; col UTL_INADDR.GET_HOST_ADDRESS(MACHINE) for a40&lt;br /&gt;&lt;br /&gt;SQL&gt; select sid,machine,UTL_INADDR.GET_HOST_ADDRESS (machine)&lt;br /&gt;     from v$session&lt;br /&gt;     where type = 'USER' and username is not null &lt;br /&gt;     order by sid;&lt;br /&gt;&lt;br /&gt;       SID MACHINE              UTL_INADDR.GET_HOST_ADDRESS(MACHINE)&lt;br /&gt;---------- -------------------- ----------------------------------------&lt;br /&gt;       152 edrserver            10.21.1.249&lt;br /&gt;&lt;br /&gt;=====================================================&lt;br /&gt;If you are getting below error message then modify above code little bit.&lt;br /&gt;&lt;br /&gt;ERROR at line 1:ORA-29257: host xxxxxxxxxxxxxxxxxx unknown&lt;br /&gt;&lt;br /&gt;ORA-06512: at "SYS.UTL_INADDR", line 19&lt;br /&gt;&lt;br /&gt;ORA-06512: at "SYS.UTL_INADDR", line 40&lt;br /&gt;&lt;br /&gt;ORA-06512: at line 1&lt;br /&gt;&lt;br /&gt;==================Modified code======================&lt;br /&gt;&lt;br /&gt;SQL&gt; select sid, machine,&lt;br /&gt;     UTL_INADDR.get_host_address (substr(machine,instr(machine,'\')+1)) ip &lt;br /&gt;     from v$session&lt;br /&gt;     where type='USER' and username is not null&lt;br /&gt;     order by sid;&lt;br /&gt;&lt;br /&gt;       SID MACHINE              IP&lt;br /&gt;---------- -------------------- ------------------------------&lt;br /&gt;       152 edrserver            10.21.1.249&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2680408983144878007?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2680408983144878007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2680408983144878007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2680408983144878007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2680408983144878007'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/04/how-to-find-client-ip-address-by.html' title='How to find Client IP address by Quering Oracle Database ?'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6461635962620502205</id><published>2008-03-19T11:29:00.000+05:30</published><updated>2008-03-19T11:40:09.960+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='rman'/><title type='text'>Rman Recovery Scenarios</title><content type='html'>Rman recovery scenarios require that the database &lt;br /&gt;is in archive log mode, and that backups of datafiles, &lt;br /&gt;control files and archived redolog files are made using &lt;br /&gt;Rman. Incremental Rman backups may be used also.&lt;br /&gt;&lt;br /&gt;Rman can be used with the repository installed on the &lt;br /&gt;archivelog, or with a recovery catalog that may be &lt;br /&gt;installed in the same or other database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Configuration and operation recommendations:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Set the parameter controlfile autobackup to ON &lt;br /&gt;to have with each backup a controlfile backup also:&lt;br /&gt;&lt;br /&gt;rman&gt;configure controlfile autobackup on;&lt;br /&gt;&lt;br /&gt;Set the parameter retention policy to the recovery &lt;br /&gt;window you want to have, i.e redundancy 2 will keep &lt;br /&gt;the last two backups available, after executing &lt;br /&gt;delete obsolete commands:&lt;br /&gt;&lt;br /&gt;rman&gt;configure retention policy to redundancy 2;&lt;br /&gt;&lt;br /&gt;Execute your full backups with the option &lt;br /&gt;'plus archivelogs' to include your&lt;br /&gt;archivelogs with every backup:&lt;br /&gt;&lt;br /&gt;rman&gt;backup database plus archivelog;&lt;br /&gt;&lt;br /&gt;Perform daily maintenance routines to maintain on &lt;br /&gt;your backup directory the number of backups you need only:&lt;br /&gt;&lt;br /&gt;rman&gt;crosscheck backup;&lt;br /&gt;rman&gt;crosscheck archivelog all;&lt;br /&gt;rman&gt;delete noprompt obsolete backup;&lt;br /&gt;&lt;br /&gt;To work with Rman and a database based &lt;br /&gt;catalog follow these steps:&lt;br /&gt;1. sqlplus /&lt;br /&gt;2. create tablespace repcat;&lt;br /&gt;3. create user rcuser identified by rcuser default tablespace repcat&lt;br /&gt;   temporary tablespace temp;&lt;br /&gt;4. grant connect, resource, recovery_catalog_owner to rcuser;&lt;br /&gt;5. exit&lt;br /&gt;6. rman catalog rcuser/rcuser # connect to rman catalog as the rcuser&lt;br /&gt;7. create catalog # create the catalog&lt;br /&gt;8. connect target / #&lt;br /&gt;=============================================&lt;br /&gt;Complete Closed Database Recovery. System tablespace is missing&lt;br /&gt;---------------------------------------------&lt;br /&gt;In this case complete recovery is performed, only the &lt;br /&gt;system tablespace is missing, so the database can be &lt;br /&gt;opened without reseting the redologs.&lt;br /&gt;1. rman target /&lt;br /&gt;2. startup mount;&lt;br /&gt;3. restore database;&lt;br /&gt;4. recover database;&lt;br /&gt;5. alter database open;&lt;br /&gt;=============================================&lt;br /&gt;Complete Open Database Recovery. Non system tablespace &lt;br /&gt;is missing,database is up&lt;br /&gt;---------------------------------------------&lt;br /&gt;1. rman target /&lt;br /&gt;2. sql 'alter tablespace &lt;tablespace_name&gt; offline immediate';&lt;br /&gt;3. restore datafile 3;&lt;br /&gt;4. recover datafile 3;&lt;br /&gt;5. sql 'alter tablespace &lt;tablespace_name&gt; online';&lt;br /&gt;=============================================&lt;br /&gt;Complete Open Database Recovery (when the database&lt;br /&gt;is initially closed). Non system tablespace is missing&lt;br /&gt;---------------------------------------------&lt;br /&gt;A user datafile is reported missing when trying to &lt;br /&gt;startup the database. The datafile can be turned offline &lt;br /&gt;and the database started up. Restore and recovery are &lt;br /&gt;performed using Rman. After recovery is performed &lt;br /&gt;the datafile can be turned online again.&lt;br /&gt;1. sqlplus /nolog&lt;br /&gt;2. connect / as sysdba&lt;br /&gt;3. startup mount&lt;br /&gt;4. alter database datafile '&lt;datafile_name&gt;' offline;&lt;br /&gt;5. alter database open;&lt;br /&gt;6. exit;&lt;br /&gt;7. rman target /&lt;br /&gt;8. restore datafile '&lt;datafile_name&gt;';&lt;br /&gt;9. recover datafile '&lt;datafile_name&gt;';&lt;br /&gt;10. sql 'alter tablespace &lt;tablespace_name&gt; online';&lt;br /&gt;=============================================&lt;br /&gt;Recovery of a Datafile that has no backups (database is up).&lt;br /&gt;---------------------------------------------&lt;br /&gt;If a non system datafile that was not backed up since &lt;br /&gt;the last backup is missing, recovery can be performed &lt;br /&gt;if all archived logs since the creation of the missing &lt;br /&gt;datafile exist. Since the database is up you can check &lt;br /&gt;the tablespace name and put it offline. The option offline &lt;br /&gt;immediate is used to avoid that the update of the datafile header.&lt;br /&gt;&lt;br /&gt;Pre requisites: All relevant archived logs.&lt;br /&gt;1. sqlplus '/ as sysdba'&lt;br /&gt;2. alter tablespace &lt;tablespace_name&gt; offline immediate;&lt;br /&gt;3. alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf;&lt;br /&gt;4. exit&lt;br /&gt;5. rman target /&lt;br /&gt;6. recover tablespace &lt;tablespace_name&gt;;&lt;br /&gt;7. sql 'alter tablespace &lt;tablespace_name&gt; online';&lt;br /&gt;If the create datafile command needs to be executed to place &lt;br /&gt;the datafile on a location different than the original use:&lt;br /&gt;alter database create datafile '/user/oradata/u01/dbtst/newdata01.dbf' as&lt;br /&gt;'/user/oradata/u02/dbtst/newdata01.dbf'&lt;br /&gt;=============================================&lt;br /&gt;Restore and Recovery of a Datafile to a different location. Database is up.&lt;br /&gt;---------------------------------------------&lt;br /&gt;If a non system datafile is missing and its original &lt;br /&gt;location not available, restore can be made to a different &lt;br /&gt;location and recovery performed.&lt;br /&gt;&lt;br /&gt;Pre requisites: All relevant archived logs, complete cold or hot backup.&lt;br /&gt;1. Use OS commands to restore the missing or corrupted datafile to the new&lt;br /&gt;location, ie:&lt;br /&gt;cp -p /user/backup/uman/user01.dbf /user/oradata/u02/dbtst/user01.dbf&lt;br /&gt;2. alter tablespace &lt;tablespace_name&gt; offline immediate;&lt;br /&gt;3. alter tablespace &lt;tablespace_name&gt; rename datafile&lt;br /&gt;'/user/oradata/u01/dbtst/user01.dbf' to '/user/oradata/u02/dbtst/user01.dbf';&lt;br /&gt;4. rman target /&lt;br /&gt;5. recover tablespace &lt;tablespace_name&gt;;&lt;br /&gt;6. sql 'alter tablespace &lt;tablespace_name&gt; online';&lt;br /&gt;=============================================&lt;br /&gt;Control File Recovery&lt;br /&gt;---------------------------------------------&lt;br /&gt;Always multiplex your controlfiles. If you loose only one &lt;br /&gt;controlfile you can replace it with the one you have in place, &lt;br /&gt;and startup the Database. If both controlfiles are missing, &lt;br /&gt;the database will crash.&lt;br /&gt;&lt;br /&gt;Pre requisites: A backup of your controlfile and all relevant &lt;br /&gt;archived logs. When using Rman alway set configuration parameter&lt;br /&gt;autobackup of controlfile to ON. You will need the dbid to &lt;br /&gt;restore the controlfile, get it from the name of the backed up &lt;br /&gt;controlfile. It is the number following the 'c-' at the start of the name.&lt;br /&gt;1. rman target /&lt;br /&gt;2. set dbid &lt;dbid#&gt;&lt;br /&gt;3. startup nomount;&lt;br /&gt;4. restore controlfile from autobackup;&lt;br /&gt;5. alter database mount;&lt;br /&gt;6. recover database;&lt;br /&gt;7. alter database open resetlogs;&lt;br /&gt;8. make a new complete backup, as the database is open in a new incarnation and&lt;br /&gt;previous archived log are not relevant.&lt;br /&gt;=============================================&lt;br /&gt;Incomplete Recovery, Until Time/Sequence/Cancel&lt;br /&gt;---------------------------------------------&lt;br /&gt;Incomplete recovery may be necessaire when the database &lt;br /&gt;crash and needs to be recovered, and in the recovery process &lt;br /&gt;you find that an archived log is missing. In this case recovery &lt;br /&gt;can only be made until the sequence before the one that is missing.&lt;br /&gt;&lt;br /&gt;Another scenario for incomplete recovery occurs when an important &lt;br /&gt;object was dropped or incorrect data was committed on it.&lt;br /&gt;In this case recovery needs to be performed until before the &lt;br /&gt;object was dropped.&lt;br /&gt;&lt;br /&gt;Pre requisites: A full closed or open database backup and archived &lt;br /&gt;logs, the time orsequence that the 'until' recovery &lt;br /&gt;needs to be performed.&lt;br /&gt;1. If the database is open, shutdown it to perform full restore.&lt;br /&gt;2. rman target \&lt;br /&gt;3. startup mount;&lt;br /&gt;4. restore database;&lt;br /&gt;5. recover database until sequence 8 thread 1; # you must pass the thread, if a&lt;br /&gt;single instance will always be 1.&lt;br /&gt;6. alter database open resetlogs;&lt;br /&gt;7. make a new complete backup, as the database is open in a new incarnation and&lt;br /&gt;previous archived log are not relevant.&lt;br /&gt;Alternatively you may use instead of until sequence, until time, ie: '2008-03-&lt;br /&gt;16:01:01:10'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6461635962620502205?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6461635962620502205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6461635962620502205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6461635962620502205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6461635962620502205'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/03/rman-recovery-scenarios.html' title='Rman Recovery Scenarios'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4737679381211751022</id><published>2008-03-15T17:52:00.000+05:30</published><updated>2008-03-15T17:57:46.483+05:30</updated><title type='text'>How to change the root password of a linux server.</title><content type='html'>Use this information at your own risk, &lt;br /&gt;&lt;br /&gt;Please note that you cannot perform this remotely, &lt;br /&gt;you must be physically at the machine. &lt;br /&gt;&lt;br /&gt;1. The first step is to reboot server. &lt;br /&gt;&lt;br /&gt;2. Since the server I inherit has GRUB, wait until &lt;br /&gt;the grub splash screen comes on and hit the letter &lt;span style="font-weight:bold;"&gt;'e'&lt;/span&gt; &lt;br /&gt;on your keyboard. this will stop grub.&lt;br /&gt;&lt;br /&gt;3. hit &lt;span style="font-weight:bold;"&gt;'e'&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt; again and this will take you to another screen &lt;br /&gt;&lt;br /&gt;4. you should see one of the choices has &lt;span style="font-weight:bold;"&gt;"kernel"&lt;/span&gt; &lt;br /&gt;select the one with "kernel &lt;br /&gt;&lt;br /&gt;5. hit &lt;span style="font-weight:bold;"&gt;'e'&lt;/span&gt; on your keyboard &lt;br /&gt;&lt;br /&gt;6. type ' &lt;span style="font-weight:bold;"&gt;single&lt;/span&gt;' or &lt;span style="font-weight:bold;"&gt;1 &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;(make sure to &lt;span style="font-weight:bold;"&gt;include a space before&lt;/span&gt; "single/1") &lt;br /&gt;and hit enter. then enter '&lt;span style="font-weight:bold;"&gt;b&lt;/span&gt;' to boot. &lt;br /&gt;&lt;br /&gt;7. your system should boot up in single mode as root &lt;br /&gt;&lt;br /&gt;8. now that you are logged in single mode you can &lt;br /&gt;change the root password by sending this command: &lt;br /&gt;     --&gt;&gt; &lt;span style="font-weight:bold;"&gt;passwd&lt;/span&gt;&lt;br /&gt;Give the new password&lt;br /&gt;&lt;br /&gt;9. after you have changed the root password, reboot server &lt;br /&gt;and you should be able to login with the new password. &lt;br /&gt;&lt;br /&gt;DONE &lt;br /&gt;&lt;br /&gt;LILO ---------------------------- &lt;br /&gt;&lt;br /&gt;1. If you have LILO, its different, first reboot server and when you &lt;br /&gt;see the LILO: prompt type "linux single" and hit enter. &lt;br /&gt;this will log you in as root in single user mode. &lt;br /&gt;&lt;br /&gt;2. Once booting is complete, you can change your password with this command: &lt;br /&gt;     --&gt;&gt; &lt;span style="font-weight:bold;"&gt;passwd&lt;/span&gt;&lt;br /&gt;Give the new password&lt;br /&gt;and reboot server. &lt;br /&gt;&lt;br /&gt;DONE&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4737679381211751022?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4737679381211751022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4737679381211751022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4737679381211751022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4737679381211751022'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/03/how-to-change-root-password-of-linux.html' title='How to change the root password of a linux server.'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6045618879913140709</id><published>2008-03-15T12:45:00.001+05:30</published><updated>2008-03-15T12:54:18.071+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='split'/><title type='text'>Usage of Split command in Linux.</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Split&lt;/span&gt;, have a large file that you need to split into smaller chucks? A Oracle dump maybe? split is your command. Below I split a 110MB file into 30 megabyte chunks.&lt;br /&gt;&lt;br /&gt;Split works just fine on both text, and binary (even compressed) files. An example is worth a thousand words of man page (that don't have examples). Here I have TBL_LOSANGELES_CA.dmp, a 109MB Oracle export dump file.&lt;br /&gt;&lt;br /&gt;[root@oracle11gr1 ~]# mkdir split&lt;br /&gt;[root@oracle11gr1 ~]# mv /share/TBL_LOSANGELES_CA.dmp split/&lt;br /&gt;[root@oracle11gr1 ~]# cd split/&lt;br /&gt;[root@oracle11gr1 split]# ll&lt;br /&gt;total 111284&lt;br /&gt;-rwxrw-r-- 1 vshare vshare 113836032 Oct 11 22:43 TBL_LOSANGELES_CA.dmp&lt;br /&gt;&lt;br /&gt;[root@oracle11gr1 split]#&lt;span style="font-weight:bold;"&gt;split -b 30m TBL_LOSANGELES_CA.dmp TBL_LOSANGELES_CA_part_&lt;br /&gt;&lt;/span&gt;[root@oracle11gr1 split]# ll&lt;br /&gt;total 222584&lt;br /&gt;-rwxrw-r-- 1 vshare vshare 113836032 Oct 11 22:43 TBL_LOSANGELES_CA.dmp&lt;br /&gt;-rw-r--r-- 1 root   root    31457280 Mar 14 14:07 TBL_LOSANGELES_CA_part_aa&lt;br /&gt;-rw-r--r-- 1 root   root    31457280 Mar 14 14:07 TBL_LOSANGELES_CA_part_ab&lt;br /&gt;-rw-r--r-- 1 root   root    31457280 Mar 14 14:07 TBL_LOSANGELES_CA_part_ac&lt;br /&gt;-rw-r--r-- 1 root   root    19464192 Mar 14 14:07 TBL_LOSANGELES_CA_part_ad&lt;br /&gt;&lt;br /&gt;Cat command is used to join the files split by above split command.&lt;br /&gt;&lt;br /&gt;[root@oracle11gr1 split]#&lt;span style="font-weight:bold;"&gt;cat TBL_LOSANGELES_CA_part_aa TBL_LOSANGELES_CA_part_ab TBL_LOSANGELES_CA_part_ac TBL_LOSANGELES_CA_part_ad &gt;TBL_LOSANGELES&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@oracle11gr1 split]# ls -lh&lt;br /&gt;total 327M&lt;br /&gt;-rw-r--r-- 1 root   root   109M Mar 14 14:15 TBL_LOSANGELES&lt;br /&gt;-rwxrw-r-- 1 vshare vshare 109M Oct 11 22:43 TBL_LOSANGELES_CA.dmp&lt;br /&gt;-rw-r--r-- 1 root   root    30M Mar 14 14:07 TBL_LOSANGELES_CA_part_aa&lt;br /&gt;-rw-r--r-- 1 root   root    30M Mar 14 14:07 TBL_LOSANGELES_CA_part_ab&lt;br /&gt;-rw-r--r-- 1 root   root    30M Mar 14 14:07 TBL_LOSANGELES_CA_part_ac&lt;br /&gt;-rw-r--r-- 1 root   root    19M Mar 14 14:07 TBL_LOSANGELES_CA_part_ad&lt;br /&gt;&lt;br /&gt;You can check whether the files are identical are not by using the DIFF command.&lt;br /&gt;&lt;br /&gt;[root@oracle11gr1 split]# &lt;span style="font-weight:bold;"&gt;diff -s TBL_LOSANGELES TBL_LOSANGELES_CA.dmp&lt;/span&gt;&lt;br /&gt;Files TBL_LOSANGELES and TBL_LOSANGELES_CA.dmp are &lt;span style="font-weight:bold;"&gt;identical&lt;/span&gt;&lt;br /&gt;[root@oracle11gr1 split]#&lt;br /&gt;&lt;br /&gt;The cat command can be broken into parts (this is useful if each part is on a separate disk, like one each on CDs). Take note that the first time, a single &gt; is used to make sure that the data from this first part overwrites the destination file (if it already exists), but that each time after that, a double &gt; is used to append to the destination file. &lt;br /&gt;&lt;br /&gt;cat TBL_LOSANGELES_CA_part_aa &gt; TBL_LOSANGELES&lt;br /&gt;cat TBL_LOSANGELES_CA_part_ab &gt;&gt; TBL_LOSANGELES&lt;br /&gt;cat TBL_LOSANGELES_CA_part_ac &gt;&gt; TBL_LOSANGELES&lt;br /&gt;cat TBL_LOSANGELES_CA_part_ad &gt;&gt; TBL_LOSANGELES&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6045618879913140709?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6045618879913140709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6045618879913140709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6045618879913140709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6045618879913140709'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/03/usage-of-split-command-in-linux.html' title='Usage of Split command in Linux.'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2740062253137159590</id><published>2008-03-13T16:58:00.000+05:30</published><updated>2008-03-13T17:23:27.554+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='rman'/><title type='text'>RMAN - Recovery Manager for Oracle Database 10g</title><content type='html'>&lt;span style="font-weight:bold;"&gt;WHAT IS RMAN ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Recovery Manager is a tool that: manages the process of creating backups and also manages the process of restoring and recovering from them.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;WHY USE RMAN ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;No extra costs …Its available for free&lt;br /&gt;RMAN introduced in Oracle 8 it has become simpler with &lt;br /&gt;newer versions and easier than user managed backups Proper security&lt;br /&gt;You are 100% sure your database has been backed up.&lt;br /&gt;Its contains detail of the backups taken etc in its central repository&lt;br /&gt;Facility for testing validity of backups also commands like crosscheck to Check the status of backup.&lt;br /&gt;Faster backups and restores compared to backups without RMAN&lt;br /&gt;RMAN is the only backup tool which supports incremental backups.&lt;br /&gt;Oracle 10g has got further optimized incremental backup which has &lt;br /&gt;resulted in improvement of performance during backup and recovery time&lt;br /&gt;Parallel operations are supported&lt;br /&gt;Better querying facility for knowing different details of backup&lt;br /&gt;No extra redo generated when backup is taken..compared to online backup &lt;br /&gt;without RMAN which results in saving of space in hard disk&lt;br /&gt;RMAN is an intelligent tool&lt;br /&gt;Maintains repository of backup metadata&lt;br /&gt;Remembers backup set location&lt;br /&gt;Knows what need to backed up&lt;br /&gt;Knows what is required for recovery&lt;br /&gt;Knows what backup are redundant&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;UNDERSTANDING THE RMAN ARCHITECTURE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An oracle RMAN comprises of RMAN EXECUTABLE &lt;br /&gt;This could be present and fired even through &lt;br /&gt;client side TARGET DATABASE. &lt;br /&gt;(&lt;span style="font-weight:bold;"&gt;Target&lt;/span&gt;)This is the database which needs to be backed up&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;RECOVERY CATALOG&lt;/span&gt; is optional otherwise backup &lt;br /&gt;details are stored in target database controlfile&lt;br /&gt;It is a repository of information queried and updated by Recovery Manager&lt;br /&gt;It is a schema or user stored in Oracle database&lt;br /&gt;One schema can support many databases&lt;br /&gt;It contains information about physical schema of target database datafile and archive log, backup sets and pieces&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Recovery catalog is a must&lt;/span&gt; in following scenarios&lt;br /&gt;In order to store scripts&lt;br /&gt;For tablespace point in time recovery&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Media Management Software&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Media Management software is a must if you are using &lt;br /&gt;RMAN for storing backup in tape drive directly.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Backups in RMAN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Oracle backups in RMAN are of the following type&lt;br /&gt;&lt;br /&gt;RMAN complete backup OR RMAN incremental backup&lt;br /&gt;&lt;br /&gt;These backups are of RMAN proprietary nature&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;IMAGE COPY&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Its again a kind of backup. The advantage of uing Image copy is its not in RMAN proprietary format.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Backup Format&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;RMAN backup is not in oracle format but in RMAN format. &lt;br /&gt;Oracle backup comprises of backup sets and it consists &lt;br /&gt;of backup pieces. Backup sets are logical entity. &lt;br /&gt;In oracle 9i it gets stored in a default location.&lt;br /&gt;&lt;br /&gt;There are two type of backup sets&lt;br /&gt;Datafile backup sets,&lt;br /&gt;Archivelog backup sets&lt;br /&gt;&lt;br /&gt;One more important point of data file backup sets&lt;br /&gt;is it do not include empty blocks. A backup set &lt;br /&gt;would contain many backup pieces. A single backup piece &lt;br /&gt;consists of physical files which are in RMAN proprietary format.&lt;br /&gt;&lt;br /&gt;You can go to RMAN prompt by just typing rman. &lt;br /&gt;RMAN executable is present in ORACLE_HOME/bin location.&lt;br /&gt;&lt;br /&gt;bash-2.05$ rman&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.1.0.5.0 - Production&lt;br /&gt;&lt;br /&gt;Copyright (c) 1995, 2004, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; &lt;br /&gt;&lt;br /&gt;You can use target connect to connect to database. &lt;br /&gt;The database it will connect to depends on the environment variable ORACLE_HOME.&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect target&lt;br /&gt;&lt;br /&gt;connected to target database: ORCL (DBID=1176834246)&lt;br /&gt;&lt;br /&gt;Alternatively you can use “rman TARGET SYS/sys@test NOCATALOG” &lt;br /&gt;to connect to the RMAN of “test” instance.&lt;br /&gt;&lt;br /&gt;Here we will be using target database control file &lt;br /&gt;to store all the information required for RMAN, &lt;br /&gt;like backupsets and backup image information etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Backup Database:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt; shutdown immediate&lt;br /&gt;&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;database closed&lt;br /&gt;database dismounted&lt;br /&gt;Oracle instance shut down&lt;br /&gt;&lt;br /&gt;RMAN&gt; startup mount&lt;br /&gt;&lt;br /&gt;connected to target database (not started)&lt;br /&gt;Oracle instance started&lt;br /&gt;database mounted&lt;br /&gt;&lt;br /&gt;Total System Global Area 1660944384 bytes&lt;br /&gt;&lt;br /&gt;Fixed Size                  1322112 bytes&lt;br /&gt;Variable Size             686019456 bytes&lt;br /&gt;Database Buffers          973078528 bytes&lt;br /&gt;Redo Buffers                 524288 bytes&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup database;&lt;br /&gt;&lt;br /&gt;Starting backup at 13-MAR-08&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=166 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=/u01/app/oracle/oradata/orcl/system01.dbf&lt;br /&gt;input datafile fno=00003 name=/u01/app/oracle/oradata/orcl/sysaux01.dbf&lt;br /&gt;input datafile fno=00005 name=/u01/app/oracle/oradata/orcl/example01.dbf&lt;br /&gt;input datafile fno=00002 name=/u01/app/oracle/oradata/orcl/undotbs01.dbf&lt;br /&gt;input datafile fno=00004 name=/u01/app/oracle/oradata/orcl/users01.dbf&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 13-MAR-08&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 13-MAR-08&lt;br /&gt;piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2008_03_13/&lt;br /&gt;&lt;br /&gt;o1_mf_nnndf_TAG20080313T031455_3b8zv57d_.bkp tag=TAG20080313T031455 comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:01:36&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;including current control file in backupset&lt;br /&gt;including current SPFILE in backupset&lt;br /&gt;channel ORA_DISK_1: starting piece 1 at 13-MAR-08&lt;br /&gt;channel ORA_DISK_1: finished piece 1 at 13-MAR-08&lt;br /&gt;piece handle=/u01/app/oracle/flash_recovery_area/ORCL/backupset/2008_03_13/&lt;br /&gt;&lt;br /&gt;o1_mf_ncsnf_TAG20080313T031455_3b8zy7xr_.bkp tag=TAG20080313T031455 comment=NONE&lt;br /&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06&lt;br /&gt;Finished backup at 13-MAR-08&lt;br /&gt;Creating RMAN Catalog&lt;br /&gt;&lt;br /&gt;You can also create a repository for RMAN to store all this &lt;br /&gt;information. Repository will be just another small &lt;br /&gt;database which can store the catalog information. &lt;br /&gt;Creating a catalog is a 3 step process&lt;br /&gt;&lt;br /&gt;1) Create database which will hold the catalog. &lt;br /&gt;Else you can use the existing database also. &lt;br /&gt;All you need is to create a seperate tablespace &lt;br /&gt;for holding the information about RMAN catalog.&lt;br /&gt;&lt;br /&gt;2) Create RMAN tablespace and RMAN &lt;span style="font-weight:bold;"&gt;user&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; create tablespace rman_tbs datafile ‘/u01/app/oracle/oradata/TEST/rman01.dbf’ size 240M EXTENT MANAGEMENT LOCAL segment SPACE MANAGEMENT AUTO ;&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;SQL&gt; create user rcat identified by rcat&lt;br /&gt;     default tablespace rman_tbs&lt;br /&gt;     TEMPORARY TABLESPACE TEMPTS1&lt;br /&gt;     QUOTA UNLIMITED ON rman_tbs account unlock;&lt;br /&gt;&lt;br /&gt;User created.&lt;br /&gt;&lt;br /&gt;After creating user, you need to grant &lt;span style="font-weight:bold;"&gt;RECOVERY_CATALOG_OWNER&lt;/span&gt; role to that user.&lt;br /&gt;&lt;br /&gt;3) Create RMAN catalog.&lt;br /&gt;&lt;br /&gt;bash-2.05$ rman catalog rcat/rcat@test&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.1.0.5.0 - Production on Thu Mar 13 02:47:16 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1995, 2004, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to recovery catalog database&lt;br /&gt;&lt;br /&gt;RMAN&gt; create catalog &lt;br /&gt;&lt;br /&gt;recovery catalog created&lt;br /&gt;&lt;br /&gt;For registering the database, you need to get connected&lt;br /&gt;to database as well as catalog at the same time. Here is how you can do.&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect target&lt;br /&gt;&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;br /&gt;RMAN-00571: ===========================================================&lt;br /&gt;RMAN-06004: ORACLE error from recovery catalog database: RMAN-20001: target database not found in recovery catalog&lt;br /&gt;&lt;br /&gt;The above error is because the database we connected to is not found in the catalog database. We can register the database in catalog.&lt;br /&gt;&lt;br /&gt;RMAN&gt; register database;&lt;br /&gt;&lt;br /&gt;database registered in recovery catalog&lt;br /&gt;starting full resync of recovery catalog&lt;br /&gt;full resync complete&lt;br /&gt;&lt;br /&gt;Registering database will also resynch the information present&lt;br /&gt;in the target database control file and catalog database. &lt;br /&gt;Since we have taken 1 backup early, it will synchup that &lt;br /&gt;information with RMAN catalog. We can check the same using &lt;br /&gt;LIST BACKUP command at RMAN prompt.&lt;br /&gt;&lt;br /&gt;RMAN&gt; list backup;&lt;br /&gt;&lt;br /&gt;List of Backup Sets&lt;br /&gt;===================&lt;br /&gt;&lt;br /&gt;BS Key  Type LV Size       Device Type Elapsed Time Completion Time&lt;br /&gt;——- —- — ———- ———– ———— —————&lt;br /&gt;18      Full    573.48M    DISK        00:01:26     13-MAR-08&lt;br /&gt;BP Key: 20   Status: AVAILABLE  Compressed: NO  Tag: TAG20080313T031355&lt;br /&gt;Piece Name: /u01/app/oracle/oradata/ORCL/backupset/2008_03_13/&lt;br /&gt;o1_mf_nnndf_TAG20080313T031355_3b8zv57d_.bkp&lt;br /&gt;&lt;br /&gt;List of Datafiles in backup set 18&lt;br /&gt;File LV Type Ckp SCN    Ckp Time  Name&lt;br /&gt;—- — —- ———- ——— —-&lt;br /&gt;1       Full 562487     13-MAR-08 /u01/app/oracle/oradata/ORCL/system01.dbf&lt;br /&gt;2       Full 562487     13-MAR-08 /u01/app/oracle/oradata/ORCL/undotbs01.dbf&lt;br /&gt;3       Full 562487     13-MAR-08 /u01/app/oracle/oradata/ORCL/sysaux01.dbf&lt;br /&gt;4       Full 562487     13-MAR-08 /u01/app/oracle/oradata/ORCL/users01.dbf&lt;br /&gt;5       Full 562487     13-MAR-08 /u01/app/oracle/oradata/ORCL/example01.dbf&lt;br /&gt;&lt;br /&gt;BS Key  Type LV Size       Device Type Elapsed Time Completion Time&lt;br /&gt;——- —- — ———- ———– ———— —————&lt;br /&gt;19      Full    6.80M      DISK        00:00:05     13-MAR-08&lt;br /&gt;BP Key: 21   Status: AVAILABLE  Compressed: NO  Tag: TAG20080313T031355&lt;br /&gt;Piece Name: /u01/app/oracle/flash_recovery_area/ORCL/backupset/2008_03_13/&lt;br /&gt;o1_mf_ncsnf_TAG20080313T031355_3b8zy7xr_.bkp&lt;br /&gt;&lt;br /&gt;Control File Included: Ckp SCN: 562487       Ckp time: 13-MAR-08&lt;br /&gt;SPFILE Included: Modification time: 13-MAR-08&lt;br /&gt;&lt;br /&gt;RMAN Command line&lt;br /&gt;&lt;br /&gt;Backing up the Controlfile and Spfile&lt;br /&gt;&lt;br /&gt;The control file can be automatically backed up after each &lt;br /&gt;RMAN backup and database structure change as a way to protect &lt;br /&gt;the RMAN repository (when we are not using a seperate catalog for RMAN).&lt;br /&gt;&lt;br /&gt;RMAN&gt; configure controlfile autobackup on;&lt;br /&gt;&lt;br /&gt;Backing up control file&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup current controlfile;&lt;br /&gt;&lt;br /&gt;Creating Image copy of all datafiles in database&lt;br /&gt;&lt;br /&gt;These are the image copies and are stored in ORACLE format &lt;br /&gt;and not in RMAN format. Backupsets and backuppieces are &lt;br /&gt;stored in internal RMAN format. Hence these image copies can be &lt;br /&gt;used for manual restore and recovery as well.&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup as copy database;&lt;br /&gt;&lt;br /&gt;Creating backupsets of all datafiles in database&lt;br /&gt;&lt;br /&gt;If you specify BACKUP AS BACKUPSET, then RMAN stores its backups &lt;br /&gt;in backup sets. A backup set, consisting of one or more backup pieces, &lt;br /&gt;contains the physical file data being backed up.  This backupset &lt;br /&gt;is written in a format that only RMAN can access. Only RMAN can &lt;br /&gt;create and restore backup sets. Backup sets can be written to disk&lt;br /&gt;or tape, and they are the only type of backup which RMAN can use &lt;br /&gt;to write backups to tape.&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup as backupset database;&lt;br /&gt;&lt;br /&gt;Backup individual tablespace as backupsets&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup tablespace system, HTMLDB;&lt;br /&gt;&lt;br /&gt;Backup individual tablespace as image copies&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup as copy tablespace system;&lt;br /&gt;&lt;br /&gt;Backup individual files as image copies&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup as copy datafile ‘/u01/app/oracle/oradata/test/system01.dbf’;&lt;br /&gt;&lt;br /&gt;Backup individual files as Backupsets&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup datafile ‘/u01/app/oracle/oradata/test/system01.dbf’;&lt;br /&gt;&lt;br /&gt;Backup archivelogs&lt;br /&gt;&lt;br /&gt;We can backup the archive logs according to the output of some &lt;br /&gt;search condition. Example we want to backup only those &lt;br /&gt;archivelogs which starts with “ARCH_616814159_”.&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup acrchivelog like '%ARCH_616814159_%';&lt;br /&gt;&lt;br /&gt;Copy archivelogs from some time stamp.&lt;br /&gt;&lt;br /&gt;Suppose we want to copy the archivelogs of last 2 days, &lt;br /&gt;then we can use the following commands.&lt;br /&gt;&lt;br /&gt;RMAN&gt; BACKUP ARCHIVELOG from time 'sysdate-2';&lt;br /&gt;&lt;br /&gt;Backup all archivelog files&lt;br /&gt;&lt;br /&gt;RMAN&gt; Backup archivelog all;&lt;br /&gt;&lt;br /&gt;Backup archivelog between some time.&lt;br /&gt;&lt;br /&gt;RMAN&gt; BACKUP ARCHIVELOG FROM TIME 'SYSDATE-30' UNTIL TIME 'SYSDATE-7';&lt;br /&gt;&lt;br /&gt;Specifying copies while backing up.&lt;br /&gt;&lt;br /&gt;RMAN&gt; backup copies 2 datafile '/u01/app/oracle/oradata/test/cs_tbs01.dbf';&lt;br /&gt;&lt;br /&gt;Remember that copies option cannot be used with image copies. &lt;br /&gt;It can be used only with backupsets.&lt;br /&gt;&lt;br /&gt;Giving tags to backups&lt;br /&gt;&lt;br /&gt;RMAN&gt; BACKUP TAG ‘weekly_full_db_bkup’ DATABASE MAXSETSIZE 100M; &lt;br /&gt;&lt;br /&gt;Backing up backupsets&lt;br /&gt;RMAN&gt; BACKUP BACKUPSET ALL;&lt;br /&gt;&lt;br /&gt;Backup imagecopies&lt;br /&gt;&lt;br /&gt;RMAN&gt; Backup as copy backupset all;&lt;br /&gt;&lt;br /&gt;List Imagecopies&lt;br /&gt;&lt;br /&gt;RMAN&gt; list copy;&lt;br /&gt;&lt;br /&gt;List Backupsets&lt;br /&gt;&lt;br /&gt;RMAN&gt; list backup;&lt;br /&gt;&lt;br /&gt;Restoring and Recovering the database&lt;br /&gt;&lt;br /&gt;Use the RESTORE and RECOVER commands for RMAN restore and &lt;br /&gt;recovery of physical database files.&lt;br /&gt;&lt;br /&gt;RMAN&gt; STARTUP FORCE MOUNT;&lt;br /&gt;RESTORE DATABASE;&lt;br /&gt;RECOVER DATABASE;&lt;br /&gt;ALTER DATABASE OPEN;&lt;br /&gt;&lt;br /&gt;Recovering Current Tablespaces&lt;br /&gt;&lt;br /&gt;RMAN&gt; SQL ‘ALTER TABLESPACE users OFFLINE’;&lt;br /&gt;RESTORE TABLESPACE users;&lt;br /&gt;RECOVER TABLESPACE users;&lt;br /&gt;SQL ‘ALTER TABLESPACE users ONLINE;&lt;br /&gt;&lt;br /&gt;Recovering Current Datafiles&lt;br /&gt;&lt;br /&gt;RMAN&gt; SQL ‘ALTER DATABASE DATAFILE 7 OFFLINE’;&lt;br /&gt;RESTORE DATAFILE 7;&lt;br /&gt;RECOVER DATAFILE 7;&lt;br /&gt;SQL ‘ALTER DATABASE DATAFILE 7 ONLINE’;&lt;br /&gt;&lt;br /&gt;Recovering Individual Data Blocks &lt;br /&gt;&lt;br /&gt;RMAN can recover individual corrupted datafile blocks. &lt;br /&gt;When RMAN performs a complete scan of a file for a backup, &lt;br /&gt;any corrupted blocks are listed in V$DATABASE_BLOCK_CORRUPTION. &lt;br /&gt;Corruption is usually reported in alert logs, trace files or &lt;br /&gt;results of SQL queries. Use BLOCKRECOVER to repair all corrupted blocks:&lt;br /&gt;&lt;br /&gt;RMAN&gt; BLOCKRECOVER CORRUPTION LIST;&lt;br /&gt;&lt;br /&gt;You can also recover individual blocks, as shown in this example:&lt;br /&gt;RMAN&gt; BLOCKRECOVER DATAFILE 7 BLOCK 233, 235 DATAFILE 4 BLOCK 101;&lt;br /&gt;&lt;br /&gt;Managing RMAN repository&lt;br /&gt;&lt;br /&gt;As you know that if you do not use a recovery catalog, then &lt;br /&gt;control file of the target database is used as RMAN repository&lt;br /&gt;and eventually after some time the control file records &lt;br /&gt;for RMAN information will get overwritten.Set this initialization&lt;br /&gt;parameter in the parameter file of the target database to &lt;br /&gt;determine how long records are kept:&lt;br /&gt;&lt;br /&gt;CONTROL_FILE_RECORD_KEEP_TIME = &lt;number_of_days_to_keep&gt;&lt;br /&gt;&lt;br /&gt;You can configure a retention policy to be used by RMAN &lt;br /&gt;to determine which backups are considered obsolete.  &lt;br /&gt;This allows you to remove files from the repository that &lt;br /&gt;are no longer needed to meet your retention requirements.  &lt;br /&gt;This policy can be based on a recovery window (the maximum number&lt;br /&gt;of days into the past for which you can recover) or redundancy &lt;br /&gt;(how many copies of each backed-up file to keep).&lt;br /&gt;&lt;br /&gt;Two Parameters are used to set retention policies.&lt;br /&gt;&lt;br /&gt;You can specify the days days between the current time and the &lt;br /&gt;earliest point of recoverability, this is called RECOVERY WINDOW. &lt;br /&gt;RMAN does not consider any full or level 0 incremental backup &lt;br /&gt;as obsolete if it falls within the recovery window.&lt;br /&gt;Alternatively the REDUNDANCY parameter will instruct to store the &lt;br /&gt;number of copies of backup in RMAN repository. If the number of &lt;br /&gt;backups for a specific datafile or control file exceeds the REDUNDANCY&lt;br /&gt;setting considers the extra backups as obsolete.&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE RETENTION POLICY TO REDUNDANCY 3;&lt;br /&gt;&lt;br /&gt;This will make the REDUNDANCY setting to 3. Meaning that it will &lt;br /&gt;at max store 3 copies of backups and ikmages of datafile. &lt;br /&gt;Any more images or backups are consider obsolete.&lt;br /&gt;&lt;br /&gt;When we run the below command&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;&lt;br /&gt;&lt;br /&gt;it will configure new retention policy based on the RECOVERY WINDOW &lt;br /&gt;of 7 days. This means that all the backups which falls outside this &lt;br /&gt;window will be considered obsolute. So in this case you need to have&lt;br /&gt;backup scheduled every week to have atleast 1 valid backup.&lt;br /&gt;&lt;br /&gt;Remember that at any point of time, only one policy can be active. &lt;br /&gt;It can be either REDUNDANCY or RECOVERY WINDOW.&lt;br /&gt;&lt;br /&gt;When you change the retention policy to another one, it will suspend &lt;br /&gt;the previous policy as shown below.&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;&lt;br /&gt;&lt;br /&gt;old RMAN configuration parameters:&lt;br /&gt;CONFIGURE RETENTION POLICY TO REDUNDANCY 3;&lt;br /&gt;new RMAN configuration parameters:&lt;br /&gt;CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;&lt;br /&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;starting full resync of recovery catalog&lt;br /&gt;full resync complete&lt;br /&gt;&lt;br /&gt;Cross checking the available backups&lt;br /&gt;&lt;br /&gt;RMAN&gt; CROSSCHECK BACKUP;&lt;br /&gt;&lt;br /&gt;Crosscheck is needed when an archivelog file or backup is manually &lt;br /&gt;removed, i.e., not deleted by RMAN.  This command ensures that data &lt;br /&gt;about backups in the recovery catalog or control file is synchronized &lt;br /&gt;with corresponding data on disk or in the media management catalog. &lt;br /&gt;The CROSSCHECK command operates only on files that are recorded in &lt;br /&gt;the recovery catalog or the control file.&lt;br /&gt;&lt;br /&gt;The CROSSCHECK command does not delete any files that it is &lt;br /&gt;unable to find, but updates their repository records to EXPIRED. &lt;br /&gt;Then, you can run DELETE EXPIRED to remove the repository records &lt;br /&gt;for all expired files as well as any existing physical files whose &lt;br /&gt;records show the status EXPIRED.&lt;br /&gt;&lt;br /&gt;If some backup pieces or copies were erroneously marked as EXPIRED, &lt;br /&gt;for example, because the media manager was misconfigured, then after &lt;br /&gt;ensuring that the files really do exist in the media manager, run &lt;br /&gt;the CROSSCHECK BACKUP command again to restore those files to AVAILABLE &lt;br /&gt;status.&lt;br /&gt;&lt;br /&gt;RMAN&gt; CROSSCHECK COPY;&lt;br /&gt;&lt;br /&gt;This will validate the image copies.&lt;br /&gt;&lt;br /&gt;Deleting the backups&lt;br /&gt;&lt;br /&gt;The DELETE command removes RMAN backups and copies from DISK marks &lt;br /&gt;the records in control file as DELETED or removes the records from the &lt;br /&gt;recovery catalog (if you use a catalog).&lt;br /&gt;&lt;br /&gt;RMAN&gt; DELETE BACKUPSET 101, 102, 103; &lt;br /&gt;&lt;br /&gt;RMAN&gt; delete controlfilecopy ‘%ctl’;  # Pattern search is allowed.&lt;br /&gt;&lt;br /&gt;RMAN&gt; delete archivelog until sequence 20;&lt;br /&gt;&lt;br /&gt;This will delete all the archives from the oldest one till the &lt;br /&gt;sequence we have specified.&lt;br /&gt;&lt;br /&gt;RMAN&gt; delete backup of tablespace system;&lt;br /&gt;&lt;br /&gt;RMAN&gt; DELETE ARCHIVELOG ALL BACKED UP 2 TIMES TO DEVICE TYPE DISK;&lt;br /&gt;&lt;br /&gt;List commands&lt;br /&gt;&lt;br /&gt;RMAN&gt; list backup;&lt;br /&gt;&lt;br /&gt;RMAN&gt; list copy;&lt;br /&gt;&lt;br /&gt;RMAN&gt; list incarnation of database;&lt;br /&gt;&lt;br /&gt;RMAN&gt; list expired backupset;&lt;br /&gt;&lt;br /&gt;RMAN&gt; list expired copy;&lt;br /&gt;&lt;br /&gt;RMAN&gt; list backup of tablespace sysaux;&lt;br /&gt;&lt;br /&gt;RMAN&gt; list copy of datafile 3;&lt;br /&gt;&lt;br /&gt;Reporting in RMAN&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup;&lt;br /&gt;&lt;br /&gt;Reports which database files need to be backed up to meet a configured &lt;br /&gt;or specified retention policy&lt;br /&gt;&lt;br /&gt;RMAN&gt; report unrecoverable;&lt;br /&gt;&lt;br /&gt;Reports which database files require backup because they have been &lt;br /&gt;affected by some NOLOGGING operation such as a direct-path insert&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup recovery window of 7 days;&lt;br /&gt;&lt;br /&gt;Displays objects requiring backup to satisfy a recovery window-based &lt;br /&gt;retention policy.&lt;br /&gt;&lt;br /&gt;Suppose in the above command we want to skip a perticular tablespace &lt;br /&gt;like perfstat then we can use the below command.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup recovery window of 2 days database skip tablespace perfstat;&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup redundancy 3;&lt;br /&gt;&lt;br /&gt;Displays objects requiring backup to satisfy a redundancy-based &lt;br /&gt;retention policy.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup days 7;&lt;br /&gt;&lt;br /&gt;Displays files that require more than n days’ worth of archived &lt;br /&gt;redo log files for recovery.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup incremental 7;&lt;br /&gt;&lt;br /&gt;Displays files that require application of more than n incremental &lt;br /&gt;backups for recovery.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup redundancy 2 datafile 3;&lt;br /&gt;&lt;br /&gt;Gives report of files with less than 2 redundant backups.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup tablespace htmldb;&lt;br /&gt;&lt;br /&gt;Report of files that must be backed up to satisfy current &lt;br /&gt;retention policy for this tablespace (htmldb)&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup incremental 2;&lt;br /&gt;&lt;br /&gt;Report of files that need more than 2 incrementals during recovery&lt;br /&gt;&lt;br /&gt;RMAN&gt; report need backup device type disk;&lt;br /&gt;&lt;br /&gt;Report of files that must be backed up to satisfy current &lt;br /&gt;retention policy for database&lt;br /&gt;&lt;br /&gt;RMAN&gt; report obsolete;&lt;br /&gt;Shows backups that are obsolete according to the current &lt;br /&gt;retention policy.&lt;br /&gt;&lt;br /&gt;You can add the options RECOVERY WINDOW and REDUNDANCY with &lt;br /&gt;this command as given below.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report obsolete recovery window of 3 days;&lt;br /&gt;&lt;br /&gt;RMAN&gt; report obsolete redundancy 2;&lt;br /&gt;&lt;br /&gt;RMAN&gt; report schema;&lt;br /&gt;&lt;br /&gt;This command lists and displays information about the database files.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report schema at time 'sysdate - 14';&lt;br /&gt;&lt;br /&gt;This command gives report on schema 14 days ago.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report schema at SCN 10000;&lt;br /&gt;&lt;br /&gt;This gives report on schema at scn 10000.&lt;br /&gt;&lt;br /&gt;RMAN&gt; report schema at sequence 55 thread 1;&lt;br /&gt;&lt;br /&gt;Gives report of schema at sequence 55.&lt;br /&gt;&lt;br /&gt;RMAN configuration&lt;br /&gt;&lt;br /&gt;RMAN&gt; show all;&lt;br /&gt;&lt;br /&gt;RMAN configuration parameters are:&lt;br /&gt;CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default&lt;br /&gt;CONFIGURE BACKUP OPTIMIZATION OFF; # default&lt;br /&gt;CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&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 ENCRYPTION FOR DATABASE OFF; # default&lt;br /&gt;CONFIGURE ENCRYPTION ALGORITHM ‘AES128′; # default&lt;br /&gt;CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default&lt;br /&gt;CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘/u01/app/oracle/oradata/test/dbs/snapcf_test.f’; # default&lt;br /&gt;&lt;br /&gt;We can change each of these parameters as per our requirements.&lt;br /&gt;&lt;br /&gt;You can return any setting to its default value by using CONFIGURE… CLEAR&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE BACKUP OPTIMIZATION CLEAR;&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE RETENTION POLICY CLEAR;&lt;br /&gt;&lt;br /&gt;By default, RMAN sends all backups to an operating system &lt;br /&gt;specific directory on disk. So default setting for DEVICE &lt;br /&gt;TYPE is DISK. You can configure to make backups by default &lt;br /&gt;on tape or any other device as given below.&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE DEFAULT DEVICE TYPE TO sbt;&lt;br /&gt;&lt;br /&gt;You can configure backup sets or image copies as the default &lt;br /&gt;for a particular device type, using either of the following commands:&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COPY; # Default becomes image copies&lt;br /&gt;RMAN&gt; CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET; # Default becomes uncompressed&lt;br /&gt;&lt;br /&gt;You can configure RMAN to use compressed backupsets by &lt;br /&gt;default on a particular device type, by using the CONFIGURE &lt;br /&gt;DEVICE TYPE command with the BACKUP TYPE TO COMPRESSED BACKUPSET &lt;br /&gt;option, as shown in the following examples.&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET; &lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO COMPRESSED BACKUPSET;&lt;br /&gt;&lt;br /&gt;To disable compression you can use below command&lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO BACKUPSET; &lt;br /&gt;&lt;br /&gt;RMAN&gt; CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO BACKUPSET; &lt;br /&gt;&lt;br /&gt;You can configure the parallelism for a device type.&lt;br /&gt;&lt;br /&gt;RMAM&gt; CONFIGURE DEVICE TYPE sbt PARALLELISM 2;&lt;br /&gt;&lt;br /&gt;You can turn on/off controlfile autobackup using&lt;br /&gt;&lt;br /&gt;RMAN&gt; configure controlfile autobackup off;&lt;br /&gt;&lt;br /&gt;RMAN&gt; configure controlfile autobackup on;&lt;br /&gt;&lt;br /&gt;We can configure RMAN channel to write backups and images in a specific format.&lt;br /&gt;&lt;br /&gt;The following command configures RMAN to write disk backups to the /backup directory&lt;br /&gt;&lt;br /&gt;CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT ‘/backup/ora_df%t_s%s_s%p’;&lt;br /&gt;&lt;br /&gt;%t is replaced with a four byte time stamp,&lt;br /&gt;%s with the backup set number, and&lt;br /&gt;%p with the backup piece number.&lt;br /&gt;&lt;br /&gt;You can also configure format for controlfile autobackup as well.&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE deviceSpecifier TO ’string’;&lt;br /&gt;&lt;br /&gt;For example, you can run the following command:&lt;br /&gt;&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘?/oradata/cf_%F’;&lt;br /&gt;&lt;br /&gt;Here %F will be replaced by following&lt;br /&gt;&lt;br /&gt;c-IIIIIIIIII-YYYYMMDD-QQ, where:&lt;br /&gt;&lt;br /&gt;IIIIIIIIII stands for the DBID.&lt;br /&gt;YYYYMMDD is a time stamp of the day the backup is generated&lt;br /&gt;QQ is the hex sequence that starts with 00 and has a maximum of FF&lt;br /&gt;&lt;br /&gt;You can clear the format using following command.&lt;br /&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK CLEAR;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;References:&lt;br /&gt;&lt;br /&gt;Metalink Note ID: 360416.1&lt;br /&gt;&lt;br /&gt;http://advait.wordpress.com/2007/08/10/rman-recovery-manager-for-oracle-database-10g/&lt;br /&gt;&lt;br /&gt;http://download-uk.oracle.com/docs/cd/B19306_01/backup.102/b14192/toc.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2740062253137159590?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2740062253137159590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2740062253137159590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2740062253137159590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2740062253137159590'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/03/rman-recovery-manager-for-oracle.html' title='RMAN - Recovery Manager for Oracle Database 10g'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2647906532849431951</id><published>2008-03-04T12:27:00.001+05:30</published><updated>2008-03-04T12:33:12.328+05:30</updated><title type='text'>Network Related Files</title><content type='html'>Oracle uses three files (listener.ora, tnsnames.ora &amp; sqlnet.ora) for network configuration.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Listener.ora&lt;/span&gt;&lt;br /&gt;The listerner.ora file contains server side network configuration parameters. &lt;br /&gt;&lt;br /&gt;It can be found in the ORACLE_HOME/network/admin directory on the server.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;EXAMPLE Listener.ora file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;-------------&lt;span style="font-weight:bold;"&gt;LINUX&lt;/span&gt;----------------&lt;br /&gt;# listener.ora Network Configuration File: /u01/app/oracle/product/10.1.0/db_1/network/admin/listener.ora&lt;br /&gt;# Generated by Oracle configuration tools.&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (SID_NAME = PLSExtProc)&lt;br /&gt;      (ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)&lt;br /&gt;      (PROGRAM = extproc)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;LISTENER =&lt;br /&gt;  (DESCRIPTION_LIST =&lt;br /&gt;    (DESCRIPTION =&lt;br /&gt;      (ADDRESS_LIST =&lt;br /&gt;        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;      )&lt;br /&gt;      (ADDRESS_LIST =&lt;br /&gt;        (ADDRESS = (PROTOCOL = TCP)(HOST = edrserver)(PORT = 1521))&lt;br /&gt;      )&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;-------------&lt;span style="font-weight:bold;"&gt;WINDOWS&lt;/span&gt;----------------&lt;br /&gt;&lt;br /&gt;# listener.ora Network Configuration File: D:\oracle\product\10.1.0\Db_1\network\admin\listener.ora&lt;br /&gt;# Generated by Oracle configuration tools.&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (SID_NAME = PLSExtProc)&lt;br /&gt;      (ORACLE_HOME = D:\oracle\product\10.1.0\Db_1)&lt;br /&gt;      (PROGRAM = extproc)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;LISTENER =&lt;br /&gt;  (DESCRIPTION_LIST =&lt;br /&gt;    (DESCRIPTION =&lt;br /&gt;      (ADDRESS_LIST =&lt;br /&gt;        (ADDRESS = (PROTOCOL = TCP)(HOST = Ntws205.rmsi.com)(PORT = 1521))&lt;br /&gt;      )&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;==================================================================================&lt;br /&gt;After any changes/modifications in the listener.ora file &lt;br /&gt;the listener should be &lt;span style="font-weight:bold;"&gt;restarted or reloaded&lt;/span&gt; to allow the new configuation to take effect.&lt;br /&gt;[oracle@edrserver admin]$lsnrctl stop&lt;br /&gt;[oracle@edrserver admin]$lsnrctl start&lt;br /&gt;or&lt;br /&gt;[oracle@edrserver admin]$lsnrctl reload&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Tnsnames.ora&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The tnsnames.ora file contains client side network configuration parameters. It can be found in the ORACLE_HOME/network/admin directory on the client. This file will also be present on the server if client style connections are used on the server itself. &lt;br /&gt;&lt;br /&gt;Example of a tnsnames.ora file:&lt;br /&gt;&lt;br /&gt;--------------&lt;span style="font-weight:bold;"&gt;WINDOWS&lt;/span&gt;--------------------&lt;br /&gt;# tnsnames.ora Network Configuration File: D:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora&lt;br /&gt;# Generated by Oracle configuration tools.&lt;br /&gt;&lt;br /&gt;EDR_205 =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = ntws205.rmsi.com)(PORT = 1521))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SID = edr)&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;EXTPROC_CONNECTION_DATA =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SID = PLSExtProc)&lt;br /&gt;      (PRESENTATION = RO)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;----------------&lt;span style="font-weight:bold;"&gt;LINUX&lt;/span&gt;----------------------&lt;br /&gt;# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.1.0/db_1/network/admin/tnsnames.ora&lt;br /&gt;# Generated by Oracle configuration tools.&lt;br /&gt;&lt;br /&gt;EDR =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS = (PROTOCOL = TCP)(HOST = edrserver)(PORT = 1521))&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SERVER = DEDICATED)&lt;br /&gt;      (SERVICE_NAME = edr)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;EXTPROC_CONNECTION_DATA =&lt;br /&gt;  (DESCRIPTION =&lt;br /&gt;    (ADDRESS_LIST =&lt;br /&gt;      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;br /&gt;    )&lt;br /&gt;    (CONNECT_DATA =&lt;br /&gt;      (SID = PLSExtProc)&lt;br /&gt;      (PRESENTATION = RO)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;NOTE&lt;/span&gt;: There are two names “EDR_205” which is called as “TNS_ENTRY” which we use with the connect string like “username/pwd@TNS_ENTRY” &amp; “EDR” which is the service_name (instance_name).&lt;br /&gt;=================================================================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Sqlnet.ora&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The sqlnet.ora file contains client side network configuration parameters. It can be found in the ORACLE_HOME/network/admin directory on the client. This file will also be present on the server if client style connections are used on the server itself. &lt;br /&gt;&lt;br /&gt;Example of an sqlnet.ora file:&lt;br /&gt;&lt;br /&gt;# sqlnet.ora Network Configuration File: D:\oracle\product\10.1.0\Db_1\network\admin\sqlnet.ora&lt;br /&gt;# Generated by Oracle configuration tools.&lt;br /&gt;&lt;br /&gt;SQLNET.AUTHENTICATION_SERVICES= (NTS)&lt;br /&gt;NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)&lt;br /&gt;&lt;br /&gt;====================================&lt;br /&gt;&lt;br /&gt;You can find some of the Network related issues and their solutions in the following link:&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;&lt;a href="http://www.error-code.org.uk/list.asp?cl=ORACLE&amp;p=TNS&amp;f=12500&amp;t=12599"&gt;Error codes and solutions&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2647906532849431951?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2647906532849431951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2647906532849431951' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2647906532849431951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2647906532849431951'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/03/network-related-files.html' title='Network Related Files'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8387421338693783438</id><published>2008-02-16T12:42:00.004+05:30</published><updated>2008-02-29T12:48:23.174+05:30</updated><title type='text'>Establishing a Connection from Oracle to SQL Server</title><content type='html'>Here are steps to make a connection from Oracle to SQL Server using Oracles' heterogeneous Services ODBC agent.&lt;br /&gt;&lt;br /&gt;Oracle has a generic connectivity methodology that allows for the Oracle database server to access non-Oracle database systems through ODBC and SQL*Net services. Step-by-Step setup to query from a SQL Server database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;1.&lt;span style="font-weight:bold;"&gt;&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; Define a Data Source Name (DSN) for SQL Server&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;--&gt;&lt;/span&gt; The first step is to define a system DSN within the Windows ODBC Data Sources.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;a.&lt;/span&gt;From the start menu click on Settings -&gt; Control Panel and double click the ODBC icon.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;b.&lt;/span&gt;Click on the System DSN tab and then click the Add button.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;c.&lt;/span&gt;Choose the SQL Server driver since this will be a connection to SQL Server. Click Finish to continue with the data source definition.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;d.&lt;/span&gt;Key in any name you would like to reference this ODBC data source. I have chose SS for simplistic reasons but it should be descriptive to the database you may be connecting to within SQL Server. You may also describe the data source in any way you wish. This is my remote SQL Server that I will be connecting to. Click Next to continue.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;e.&lt;/span&gt;I selected Sql Server authentication and also provided Login ID and Password below. Then click Next to continue.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;f.&lt;/span&gt;Typically, this window is populated with the default SQL Server database of "master." Click the check box to change the default database this ODBC connection should connect to and use the drop down list to select. I have chosen to use the my test Remshr database. Click Next to continue.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;g.&lt;/span&gt;I also left current window alone and clicked Finish.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;h.&lt;/span&gt;The next window then appears for you to look at the settings you have configured for the data source. Click Test Data Source to validate your definition.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;i.&lt;/span&gt;TEST COMPLETED SUCCESSFULLY appears, in which case you have successfully configured the data source. Click OK to close all windows as you are done with the data source definition.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;j.&lt;/span&gt;The end product should be a valid System DSN. You may in the future click on the DSN name and click the Configure button to change the definition if you like. I did this when I wanted to switch between databases. A small warning here on re-configuration of the DSN: you will need to drop and re-create the database link to activate the DSN. Click OK to exit the DSN administrator.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;2.&lt;/span&gt; Create a Heterogeneous Services Initialization File&lt;br /&gt;&lt;br /&gt;Oracle has provided a sample heterogeneous services init file within the %ORACLE_HOME\hs\admin directory. You will need to copy that file to a new file name within the same directory and edit it for the ODBC DSN you have just created. Below you will find the sample heterogeneous services file Oracle provides and then an edited version, which I have given a new name that corresponds to my DSN name. &lt;br /&gt;&lt;br /&gt;%ORACLE_HOME\hs\admin\inithsodbc.ora sample file&lt;br /&gt;&lt;br /&gt;(ORACLE_HOME=D:\oracle\product\10.1.0\Db_1)&lt;br /&gt;&lt;br /&gt;# This is a sample agent init file that contains the HS parameters that are  needed for an ODBC Agent.&lt;br /&gt;#&lt;br /&gt;# HS init parameters&lt;br /&gt;#&lt;br /&gt;HS_FDS_CONNECT_INFO = (odbc data_source_name)&lt;br /&gt;HS_FDS_TRACE_LEVEL = (trace_level)&lt;br /&gt;#&lt;br /&gt;# Environment variables required for the non-Oracle system&lt;br /&gt;#&lt;br /&gt;#set (env var)=(value)&lt;br /&gt;&lt;br /&gt;%ORACLE_HOME\hs\admin\initSS.ora altered file&lt;br /&gt;&lt;br /&gt;# This is a sample agent init file that contains the HS parameters that are needed for an ODBC Agent.&lt;br /&gt;#&lt;br /&gt;# HS init parameters&lt;br /&gt;#&lt;br /&gt;HS_FDS_CONNECT_INFO = SS&lt;br /&gt;HS_FDS_TRACE_LEVEL  = OFF&lt;br /&gt;&lt;br /&gt;3. Alter your listener.ora file&lt;br /&gt;&lt;br /&gt;Here again Oracle has given us a sample listener.ora file to follow for heterogeneous services within the %ORACLE_HOME\hs\admin directory. Below you will find the sample file and the additions I made to my listener.ora file. I made five distinct changes..&lt;br /&gt;Created my own listener name of LISTENERSS&lt;br /&gt;Changed the Port number to 1522&lt;br /&gt;Changed the SID_NAME to my DSN (SS)&lt;br /&gt;Changed the ORACLE_HOME location&lt;br /&gt;Changed the PROGRAM to hsodbc&lt;br /&gt;&lt;br /&gt;%ORACLE_HOME\network\admin\listener.ora altered file&lt;br /&gt;&lt;br /&gt;LISTENER =&lt;br /&gt;  (DESCRIPTION_LIST =&lt;br /&gt;    (DESCRIPTION =&lt;br /&gt;      (ADDRESS_LIST =&lt;br /&gt;        (ADDRESS = (PROTOCOL = TCP)(HOST = Ntws205.rmsi.com)(PORT = 1521))&lt;br /&gt;      )&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENER =&lt;br /&gt;  (SID_LIST =&lt;br /&gt;    (SID_DESC =&lt;br /&gt;      (SID_NAME = PLSExtProc)&lt;br /&gt;      (ORACLE_HOME = D:\oracle\product\10.1.0\Db_1)&lt;br /&gt;      (PROGRAM = extproc)&lt;br /&gt;    )&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;LISTENERSS =&lt;br /&gt; (ADDRESS_LIST=&lt;br /&gt;      (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))&lt;br /&gt;      (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))&lt;br /&gt;&lt;br /&gt;SID_LIST_LISTENERSS=&lt;br /&gt;  (SID_LIST=&lt;br /&gt;      (SID_DESC=&lt;br /&gt;         (SID_NAME=SS)&lt;br /&gt;         (ORACLE_HOME = D:\oracle\product\10.1.0\Db_1)&lt;br /&gt;         (PROGRAM=hsodbc)&lt;br /&gt;       )&lt;br /&gt;      )&lt;br /&gt;&lt;br /&gt;4. Alter your tnsnames.ora file &lt;br /&gt;&lt;br /&gt;Here again Oracle has given us a sample tnsnames.ora file to follow for heterogeneous services within the %ORACLE_HOME\hs\admin directory. Below you will find the sample file and the additions I made to my tnsnames.ora file. &lt;br /&gt;&lt;br /&gt;1.      I made four distinct changes.Created a TNS entry named SS&lt;br /&gt;&lt;br /&gt;2.      Changed the Port number to 1522&lt;br /&gt;&lt;br /&gt;3.      Changed the SID to my DSN (SS)&lt;br /&gt;&lt;br /&gt;4.      Added OK to the HS= parameter&lt;br /&gt;&lt;br /&gt;%ORACLE_HOME\network\admin\tnsnames.ora altered file&lt;br /&gt;&lt;br /&gt;SS  =&lt;br /&gt;  (DESCRIPTION=&lt;br /&gt;    (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))&lt;br /&gt;    (CONNECT_DATA=(SID=SS))&lt;br /&gt;    (HS=OK)&lt;br /&gt;  )&lt;br /&gt;&lt;br /&gt;5. Start the new Listener&lt;br /&gt;&lt;br /&gt;This should be self-explanatory but I provide the output here so that you can know what to expect when you start yours.&lt;br /&gt;&lt;br /&gt;D:\&gt;lsnrctl start listenerss&lt;br /&gt;&lt;br /&gt;LSNRCTL for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-FEB-2008 16:54:55&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2004, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Starting tnslsnr: please wait...&lt;br /&gt;&lt;br /&gt;TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production&lt;br /&gt;System parameter file is d:\oracle\product\10.1.0\db_1\network\admin\listener.ora&lt;br /&gt;Log messages written to d:\oracle\product\10.1.0\db_1\network\log\listenerss.log&lt;br /&gt;Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522)))&lt;br /&gt;Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))&lt;br /&gt;&lt;br /&gt;Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522))&lt;br /&gt;STATUS of the LISTENER&lt;br /&gt;------------------------&lt;br /&gt;Alias                     listenerss&lt;br /&gt;Version                   TNSLSNR for 32-bit Windows: Version 10.2.0.1.0 - Production&lt;br /&gt;Start Date                15-FEB-2008 16:55:09&lt;br /&gt;Uptime                    0 days 0 hr. 0 min. 4 sec&lt;br /&gt;Trace Level               off&lt;br /&gt;Security                  ON: Local OS Authentication&lt;br /&gt;SNMP                      OFF&lt;br /&gt;Listener Parameter File   d:\oracle\product\10.1.0\db_1\network\admin\listener.ora&lt;br /&gt;Listener Log File         d:\oracle\product\10.1.0\db_1\network\log\listenerss.log&lt;br /&gt;Listening Endpoints Summary...&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1522)))&lt;br /&gt;  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\PNPKEYipc)))&lt;br /&gt;Services Summary...&lt;br /&gt;Service "SS" has 1 instance(s).&lt;br /&gt;  Instance "SS", status UNKNOWN, has 1 handler(s) for this service...&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;br /&gt;6. Validate the connection to your DSN&lt;br /&gt;&lt;br /&gt;You can now validate the connection to your SQL Server database by the normal Oracle tnsping utility. &lt;br /&gt;&lt;br /&gt;D:\&gt;tnsping ss&lt;br /&gt;&lt;br /&gt;TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 15-FEB-2008 17:14:57&lt;br /&gt;&lt;br /&gt;Copyright (c) 1997, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Used parameter files:&lt;br /&gt;D:\oracle\product\10.2.0\client_1\network\admin\sqlnet.ora&lt;br /&gt;&lt;br /&gt;Used TNSNAMES adapter to resolve the alias&lt;br /&gt;Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1522)) (CONNECT_DATA=(SID=SS)) (HS=OK))&lt;br /&gt;OK (10 msec)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7. Create a Database Link within Your Oracle Database&lt;br /&gt;&lt;br /&gt;Since we would like to connect from our Oracle database and select information from the SQL Server database, we need to create a database link just as if we were connecting to any other remote Oracle database. I have used the default sa login from SQL Server but you may wish to create your own. &lt;br /&gt;&lt;br /&gt;SQL&gt; create database link ss&lt;br /&gt;     connect to sa identified sa by  using 'SS';&lt;br /&gt;&lt;br /&gt;Database link created.&lt;br /&gt;&lt;br /&gt;This is the fun part as it is the culmination of what we were trying to do. You may describe the tables from SQL Server just as you have done with Oracle in the past and then use a SELECT command. Note that my select statement has double quotes and exact upper and lower cases for the SQL Server query. This is required, at least I tried every combination and none worked except this way.&lt;br /&gt;&lt;br /&gt;SQL&gt; desc tblemp@ss&lt;br /&gt; Name                                      Null?    Type&lt;br /&gt; ----------------------------------------- -------- ----------------------------&lt;br /&gt; EmpNo                                     NOT NULL VARCHAR2(4)&lt;br /&gt; EmpInit                                   NOT NULL VARCHAR2(4)&lt;br /&gt; EmpName                                            VARCHAR2(50)&lt;br /&gt; Salutation                                         VARCHAR2(4)&lt;br /&gt; Nationality                                        VARCHAR2(15)&lt;br /&gt; Sex                                                VARCHAR2(1)&lt;br /&gt; DOB                                                DATE&lt;br /&gt; DOW                                                DATE&lt;br /&gt; Qualification                                      VARCHAR2(15)&lt;br /&gt;-------&lt;br /&gt;-------&lt;br /&gt;-------&lt;br /&gt;&lt;br /&gt;SQL&gt;select "EmpNo","EmpInit","EmpName" from tblemp@ss;&lt;br /&gt;&lt;br /&gt;Source of this article:&lt;br /&gt;http://www.databasejournal.com/features/oracle/article.php/10893_3442661_1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8387421338693783438?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8387421338693783438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8387421338693783438' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8387421338693783438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8387421338693783438'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/02/establishing-connection-from-oracle-to.html' title='Establishing a Connection from Oracle to SQL Server'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8542857857073007511</id><published>2008-02-06T12:36:00.000+05:30</published><updated>2008-02-06T12:41:56.757+05:30</updated><title type='text'>How to apply a patch ?</title><content type='html'>1. You MUST read the Readme.txt file included in opatch file, look for any prereq. steps/ post installation steps or and DB related changes. Also, make sure that you have the correct opatch version required by this patch.&lt;br /&gt;&lt;br /&gt;2.Make sure you have a good backup of database.&lt;br /&gt;&lt;br /&gt;3. Make a note of all Invalid objects in the database prior to the patch.&lt;br /&gt;&lt;br /&gt;4. Shutdown All the Oracle Processes running from that Oracle Home , including the Listener and Database instance, Management agent etc.&lt;br /&gt;&lt;br /&gt;5. You MUST Backup your oracle Home and Inventory &lt;br /&gt;&lt;br /&gt;tar cvf - $ORACLE_HOME $ORACLE_HOME/oraInventory | gzip &gt; Backup_Software_Version.tar.gz&lt;br /&gt;&lt;br /&gt;6. Unzip the patch in $ORACLE_HOME/patches&lt;br /&gt;&lt;br /&gt;7. cd to the patch direcory and do opatch -apply to apply the patch.&lt;br /&gt;&lt;br /&gt;8. Read the output/log file to make sure there were no errors. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;How to Rollback a patch?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;opatch rollback -id (Patch Number)&lt;br /&gt; &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;I messed up my Oracle home/ opatch rollback is failing , what to do now?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remember, we took the backup of the ORACLE_HOME and main importantly the Oracle inventory, you can just restore (uncompress) the software and the inventory and you are all set. Also for fixing the corrupt inventory, please refer to this &lt;a href="http://metalink.oracle.com/"&gt;OracleMetaLink&lt;/a&gt; Note:298906.1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8542857857073007511?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8542857857073007511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8542857857073007511' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8542857857073007511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8542857857073007511'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/02/how-to-apply-patch.html' title='How to apply a patch ?'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-7790997366718054118</id><published>2008-02-06T12:18:00.000+05:30</published><updated>2008-02-07T11:06:09.144+05:30</updated><title type='text'>Critical Patch Update JAN 2008 Linux</title><content type='html'>Oracle Critical Patch Update Advisory - January 2008&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpujan2008.html"&gt;OracleCPU Advisory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Below procedure based on my test enviourment if you follow this instruction please go through README.TXT file that comes with PATCH SET.&lt;br /&gt;&lt;br /&gt;Patch Installation Procedures for Oracle Database Release 11.1.0.6.0&lt;br /&gt;Patch Number : p6646866_111060_LINUX.zip&lt;br /&gt;&lt;br /&gt;Download it from &lt;a href="http://metalink.oracle.com/"&gt;OracleMetaLink&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SYSTEM Overview&lt;br /&gt;&lt;br /&gt;Platforms : Oracle Enterprise Linux 5&lt;br /&gt;Database : 11.1.0.6.0&lt;br /&gt;&lt;br /&gt;Shutdown All the Oracle Processes running from that Oracle Home , including the Listener and Database instance, Management agent etc.&lt;br /&gt;&lt;br /&gt;OPatch Utility Information&lt;br /&gt;&lt;br /&gt;You must use the OPatch utility release 1.0.0.0.57 or later. You can download it from &lt;br /&gt;&lt;a href="http://metalink.oracle.com/"&gt;OracleMetaLink&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Check OPatch Version&lt;br /&gt;&lt;br /&gt;Oracle 10G onwards, the RDBMS software ships with OPatch and it can be loacated under $ORACLE_HOME/OPatch. To download, opatch you need to have an metalink.oracle.com account. On &lt;a href="http://metalink.oracle.com/"&gt;OracleMetaLink&lt;/a&gt; search for Patch 4898608, select the Oracle RDBMS version and download the patch.&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1]$ cd $ORACLE_HOME&lt;br /&gt;[oracle@oracle11gr1 db_1]$ cd OPatch/&lt;br /&gt;[oracle@oracle11gr1 OPatch]$ sh opatch version&lt;br /&gt;Invoking OPatch 11.1.0.6.2&lt;br /&gt;&lt;br /&gt;OPatch Version: 11.1.0.6.2&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;OPatch succeeded.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 OPatch]$ &lt;span style="font-weight:bold;"&gt;sh opatch napply /u01/app/oracle/product/11.1.0/db_1/6646866/ -skip_subset -skip_duplicate&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Invoking OPatch 11.1.0.6.2&lt;br /&gt;&lt;br /&gt;[Output Edited]&lt;br /&gt;OPatch continues with these patches:    6646866   6650132   6650135   6731395&lt;br /&gt;&lt;br /&gt;Do you want to proceed? [y|n]&lt;br /&gt;Y&lt;br /&gt;User Responded with: Y&lt;br /&gt;Running prerequisite checks...&lt;br /&gt;[Output Edited]&lt;br /&gt;&lt;br /&gt;Is the local system ready for patching? [y|n]&lt;br /&gt;Y&lt;br /&gt;User Responded with: Y&lt;br /&gt;[Output Edited]&lt;br /&gt;&lt;br /&gt;Execution of 'sh /u01/app/oracle/product/11.1.0/db_1/6646866/6646866/custom/scripts/post -apply 6646866 ':&lt;br /&gt;&lt;br /&gt;Return Code = 0&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The local system has been patched and can be restarted.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;UtilSession: N-Apply done.&lt;br /&gt;&lt;br /&gt;OPatch succeeded.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Post Installation Instructions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 OPatch]$&lt;br /&gt;After installing the patch, perform the following actions:&lt;br /&gt;&lt;br /&gt;Loading Modified .sql Files into the Database&lt;br /&gt;&lt;br /&gt;There are no steps to perform, because the CPU for Release 11.1.0.6 does not use catcpu.sql or related scripts.&lt;br /&gt;&lt;br /&gt;You can go directly to Recompiling Views in the Database&lt;br /&gt;&lt;br /&gt;You must recompile views for all databases except the following:&lt;br /&gt;&lt;br /&gt;Databases created with Release 11.1.0.6 or later&lt;br /&gt;&lt;br /&gt;Databases created with any release (for example, 10.2.0.3, 10.1.0.5, or 9.2.0.8) after CPUJan2008 or a later CPU has been applied&lt;br /&gt;&lt;br /&gt;The time required to recompile the views and related objects depends on the total number of objects and on your system configuration. In one internal Oracle test with approximately 2000 views and 4000 objects, the total execution time for view_recompile_jan2008cpu.sql and utlrp.sql was about 30 minutes.&lt;br /&gt;&lt;br /&gt;If you want to check whether view recompilation has already been performed for the database, execute the following statement.&lt;br /&gt;&lt;br /&gt;SELECT * FROM registry$history where ID = '6452863';&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1]$ sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL&gt; conn /as sysdba&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;SQL&gt; startup&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt;&lt;br /&gt;SQL&gt; SELECT * FROM registry$history where ID = '6452863';&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;If the view recompilation has been performed, this statement returns one row. If the view recompilation has not been performed, this statement returns no rows.&lt;br /&gt;&lt;br /&gt;To recompile the views in the database, follow these steps:&lt;br /&gt;&lt;br /&gt;--&gt;Run the pre-check script, which reports the maximum number of views and objects that may be recompiled:&lt;br /&gt;&lt;br /&gt;cd $ORACLE_HOME/cpu/view_recompile&lt;br /&gt;sqlplus /nolog&lt;br /&gt;SQL&gt; CONNECT / AS SYSDBA&lt;br /&gt;SQL&gt; @recompile_precheck_jan2008cpu.sql&lt;br /&gt;&lt;br /&gt;Running precheck.sql...&lt;br /&gt;&lt;br /&gt;Number of views to be recompiled :2715&lt;br /&gt;-----------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Number of objects to be recompiled :5523&lt;br /&gt;Please follow the README.txt instructions for running viewrecomp.sql&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;The purpose of this step is to help you determine whether view recompilation should be done at the same time as the CPU install, or scheduled later.&lt;br /&gt;&lt;br /&gt;--&gt;Run the view recompilation script. Note that this script is run with the database in upgrade mode, which restricts connections as SYSDBA.&lt;br /&gt;&lt;br /&gt;cd $ORACLE_HOME/cpu/view_recompile&lt;br /&gt;sqlplus /nolog&lt;br /&gt;SQL&gt; CONNECT / AS SYSDBA&lt;br /&gt;SQL&gt; STARTUP UPGRADE&lt;br /&gt;SQL&gt; @view_recompile_jan2008cpu.sql&lt;br /&gt; PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;1 row created.&lt;br /&gt;&lt;br /&gt;Commit complete.&lt;br /&gt;&lt;br /&gt;No. of Invalid Objects is :31&lt;br /&gt;Please refer to README.html to for instructions on validating these objects&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;Logfile for the current viewrecomp.sql session is : vcomp_ORCL_04Feb2008_16_10_52.log&lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN;&lt;br /&gt;SQL&gt; STARTUP;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;&lt;br /&gt;If any invalid objects were reported, run the utlrp.sql script as follows:&lt;br /&gt;&lt;br /&gt;[oracle@oracle11gr1 view_recompile]$ cd $ORACLE_HOME/rdbms/admin&lt;br /&gt;[oracle@oracle11gr1 admin]$ sqlplus /nolog&lt;br /&gt;SQL&gt; conn /as sysdba&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; @utlrp.sql&lt;br /&gt;TIMESTAMP&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;COMP_TIMESTAMP UTLRP_BGN  2008-02-04 16:18:22&lt;br /&gt;&lt;br /&gt;[Output Edited]&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;TIMESTAMP&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;COMP_TIMESTAMP UTLRP_END  2008-02-04 16:18:50&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;[Output Edited]&lt;br /&gt;OBJECTS WITH ERRORS&lt;br /&gt;-------------------&lt;br /&gt;                  0&lt;br /&gt;[Output Edited]&lt;br /&gt;ERRORS DURING RECOMPILATION&lt;br /&gt;---------------------------&lt;br /&gt;                          0&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT * FROM registry$history where ID = '6452863';&lt;br /&gt;&lt;br /&gt;ACTION_TIME                  ACTION   NAMESPACE  VERSION          ID COMMENTS&lt;br /&gt;---------------------------- -------- ---------- -------- ---------- ----------&lt;br /&gt;04-FEB-08 04.13.43.702093 PM CPU                             6452863 CPUJan2008&lt;br /&gt;&lt;br /&gt;Still if you find any invalid objects then, manually recompile them. For example:&lt;br /&gt;SQL&gt; alter package schemaname.packagename compile;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-7790997366718054118?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/7790997366718054118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=7790997366718054118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7790997366718054118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7790997366718054118'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/02/critical-patch-update-jan-2008-linux.html' title='Critical Patch Update JAN 2008 Linux'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8324494270893187808</id><published>2008-02-06T12:00:00.000+05:30</published><updated>2008-02-06T12:36:16.533+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Patches'/><title type='text'>Critical Patch Update JAN 2008 on Windows</title><content type='html'>Oracle Critical Patch Update Advisory - January 2008&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/deploy/security/critical-patch-updates/cpujan2008.html/"&gt;OracleCPU Advisory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Below procedure based on my test enviourment if you follow this instruction please go through README.TXT file that comes with PATCH SET.&lt;br /&gt;&lt;br /&gt;Patch Installation Procedures for Oracle Database Release 10.1.0.5&lt;br /&gt;Patch Number : p6637274_10105_WINNT.zip&lt;br /&gt;&lt;br /&gt;SYSTEM Overview&lt;br /&gt;&lt;br /&gt;Platforms : Windows XP SP2&lt;br /&gt;Database : 10.1.0.5.0&lt;br /&gt;&lt;br /&gt;Shutdown All the Oracle Processes running from that Oracle Home , including the Listener and Database instance, Management agent etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;OPatch Utility Information&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You must use the OPatch utility release 1.0.0.0.53 or later. You can download it from &lt;br /&gt;&lt;a href="http://metalink.oracle.com/"&gt;OracleMetaLink&lt;/a&gt; with patch 2617419.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Check Oracle Inventory Setup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Oracle 10G onwards, the RDBMS software ships with OPatch and it can be loacated under $ORACLE_HOME/OPatch. To download, opatch you need to have an metalink.oracle.com account. On &lt;a href="http://metalink.oracle.com/"&gt;OracleMetaLink&lt;/a&gt; search for Patch 4898608 , select the Oracle RDBMS version and download the patch.&lt;br /&gt;&lt;br /&gt;set ORACLE_SID=ARIES&lt;br /&gt;set ORACLE_HOME=D:\oracle\product\10.1.0\Db_1&lt;br /&gt;set PERL5LIB=D:\oracle\product\10.1.0\db_1\perl\5.6.1\lib;%PERL5LIB% &lt;br /&gt;set PATH=D:\oracle\product\10.1.0\db_1\perl\5.6.1\bin\MSWin32-x86;%PATH%&lt;br /&gt;&lt;br /&gt;D:\patchset10gR1\6637274&gt;cd D:\oracle\product\10.1.0\db_1\opatch&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\OPatch&gt;opatch lsinventory&lt;br /&gt;[Output Edited]&lt;br /&gt;Creating log file "D:\oracle\product\10.1.0\db_1\.patch_storage\LsInventory__02-05-2008_10-57-56.log"&lt;br /&gt;&lt;br /&gt;Result:&lt;br /&gt;&lt;br /&gt;There is no Interim Patch&lt;br /&gt;&lt;br /&gt;OPatch succeeded.&lt;br /&gt;OPatch returns with error code = 0&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\OPatch&gt;&lt;br /&gt;&lt;br /&gt;==================&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\OPatch&gt;opatch apply D:\patchset10gR1\6637274&lt;br /&gt;&lt;br /&gt;[Output Edited]&lt;br /&gt;Creating log file "D:\oracle\product\10.1.0\db_1\.patch_storage\6637274\Apply_6637274_02-05-2008_11-06-12.log"&lt;br /&gt;&lt;br /&gt;[Output Edited]&lt;br /&gt;Is this system ready for updating?&lt;br /&gt;Please respond Y|N &gt;&lt;br /&gt;Y&lt;br /&gt;Executing the Apply pre-patch script (D:\patchset10gR1\6637274\custom\scripts\pre.bat)...&lt;br /&gt;Applying patch 6637274...&lt;br /&gt;&lt;br /&gt;[Output Edited]&lt;br /&gt;Updating inventory...&lt;br /&gt;Backing up comps.xml ...&lt;br /&gt;&lt;br /&gt;********************************************************************************&lt;br /&gt;**                                ATTENTION                                   **&lt;br /&gt;**                                                                            **&lt;br /&gt;** Please note that the Security Patch Installation (Patch Deinstallation) is **&lt;br /&gt;** not complete until all the Post Installation (Post Deinstallation)         **&lt;br /&gt;** instructions noted in the Readme accompanying this patch, have been        **&lt;br /&gt;** successfully completed.                                                    **&lt;br /&gt;**                                                                            **&lt;br /&gt;********************************************************************************&lt;br /&gt;********************************************************************************&lt;br /&gt;Executing the Apply post-patch script (D:\patchset10gR1\6637274\custom\scripts\post.bat)...&lt;br /&gt;&lt;br /&gt;OPatch succeeded.&lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;br /&gt;OPatch returns with error code = 0&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\OPatch&gt;&lt;br /&gt;&lt;br /&gt;====================================&lt;br /&gt;CD D:\oracle\product\10.1.0\db_1\CPU\cpujan2008&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\cpu\cpujan2008&gt;sqlplus /nolog&lt;br /&gt;SQL&gt; conn sys/sys as sysdba&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; select name from v$instance;&lt;br /&gt;&lt;br /&gt;INSTANCE_NAME&lt;br /&gt;--------------- &lt;br /&gt;aries&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP MIGRATE&lt;br /&gt;ORACLE instance started.&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt;@CATCPU.SQL&lt;br /&gt;&lt;br /&gt;[OUTPUT EDITED]&lt;br /&gt;Package body created.&lt;br /&gt;Package body created.&lt;br /&gt;Package body created.&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;1 row selected.&lt;br /&gt;&lt;br /&gt;Session altered.&lt;br /&gt;&lt;br /&gt;OWA_MESSAGE&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Installed OWA version is: 9.0.4.0.2&lt;br /&gt;&lt;br /&gt;Backing up previous OWA packages to: MODPLSQL\owa_restore_aries.sql&lt;br /&gt;&lt;br /&gt;OWA_MESSAGE&lt;br /&gt;-------------------&lt;br /&gt;&lt;br /&gt;OWALOAD File: MODPLSQL\owa_all\90\owaload_patch.sql&lt;br /&gt;&lt;br /&gt;Logfile: MODPLSQL\owa_patch_aries.log&lt;br /&gt;&lt;br /&gt;OWA_DBG_MSG&lt;br /&gt;&lt;br /&gt;-------------------&lt;br /&gt;Installed OWA version is: 9.0.4.0.2;&lt;br /&gt;Shipped OWA version is  : 9.0.4.0.6;&lt;br /&gt;OWA packages v9.0.4.0.6 will be installed into your database v101050&lt;br /&gt;Will install owadummy.sql and owacomm.sql&lt;br /&gt;[Output Edited]&lt;br /&gt;No errors.&lt;br /&gt;No. of Invalid Objects is :115&lt;br /&gt;Please refer to README.html to for instructions on validating these objects&lt;br /&gt;Logfile for the current catcpu.sql session is : APPLY_ARIES_05Feb2008_11_53_51.log&lt;br /&gt;not spooling currently&lt;br /&gt;SQL&gt; SHUTDOWN IMMEDIATE&lt;br /&gt;SQL&gt; exit&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\cpu\cpujan2008&gt;&lt;br /&gt;&lt;br /&gt;If catcpu.sql reports any Invalid Objects, compile the invalid objects as follows&lt;br /&gt;&lt;br /&gt;cd D:\oracle\product\10.1.0\db_1\rdbms\admin&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\RDBMS\ADMIN&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL&gt; conn sys/sys as sysdba&lt;br /&gt;Connected to an idle instance.&lt;br /&gt;SQL&gt; startup&lt;br /&gt;Database opened.&lt;br /&gt;&lt;br /&gt;SQL&gt; @utlprp.sql 0&lt;br /&gt;&lt;br /&gt;TIMESTAMP&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;COMP_TIMESTAMP UTLRP_BGN  2008-02-05 12:08:43&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;TIMESTAMP&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;COMP_TIMESTAMP UTLRP_END  2008-02-05 12:08:43&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt;  select OBJECT_NAME from dba_objects where status = 'INVALID';&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;no rows selected&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;&lt;br /&gt;Run the CATCPU.sql and UTLRP.sql on all the instances in the ORACLE_HOME individually.&lt;br /&gt;&lt;br /&gt;To view the details about the patch applied :&lt;br /&gt;&lt;br /&gt;select * from dba_registry_history;&lt;br /&gt;&lt;br /&gt;SELECT * FROM registry$history where ID = '6452863';&lt;br /&gt;&lt;br /&gt;ACTION_TIME                  ACTION   NAMESPACE  VERSION          ID COMMENTS&lt;br /&gt;---------------------------- -------- ---------- -------- ---------- ----------&lt;br /&gt;05-FEB-08 12.30.36.406000 PM CPU                             6637274 CPUJan2008&lt;br /&gt;&lt;br /&gt;Still if you find any &lt;span style="font-weight:bold;"&gt;invalid objects&lt;/span&gt; then, manually recompile them. For example:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter package schemaname.packagename compile;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8324494270893187808?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8324494270893187808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8324494270893187808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8324494270893187808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8324494270893187808'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/02/critical-patch-update-jan-2008-on.html' title='Critical Patch Update JAN 2008 on Windows'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-1761249805023310443</id><published>2008-01-24T17:23:00.000+05:30</published><updated>2008-01-24T17:30:31.018+05:30</updated><title type='text'>TNS less connection in Oracle.</title><content type='html'>I have tested this connection method in Oracle 8i, 9i, 10g and in 11g and it works fine.&lt;br /&gt;&lt;br /&gt;D:\&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.1.0.5.0 - Production on Thu Jan 24 16:59:44 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn scott/tiger@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) &lt;br /&gt;            (Host=ntwssrv)(Port=1521))(CONNECT_DATA=(SID=ORCL)))&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;If you think about above connection, it is more like specifying complete address in the connect string as you have in the tnsnames.ora file. &lt;br /&gt;&lt;br /&gt;For 10g and 11g you can use following method as well. This method does not work for 8i or 9i databases.&lt;br /&gt;&lt;br /&gt;==========&lt;br /&gt;D:\&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.1.0.5.0 - Production on Thu Jan 24 17:09:47 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn scott/tiger@ntwssrv:1521/aries&lt;br /&gt;Connected.&lt;br /&gt;&lt;br /&gt;===========&lt;br /&gt;[oracle@oracle11gr1 oracle]$ sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 11.1.0.6.0 - Production on Thu Jan 24 17:27:40 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2007, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn scott/tiger@oracle11gr1:1521/orcl&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-1761249805023310443?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/1761249805023310443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=1761249805023310443' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1761249805023310443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1761249805023310443'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/tns-less-connection-in-oracle.html' title='TNS less connection in Oracle.'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-7934742883337992415</id><published>2008-01-22T14:48:00.000+05:30</published><updated>2008-01-22T14:49:55.523+05:30</updated><title type='text'>Resolving ORA-12705 on Client</title><content type='html'>This tip resolves Oracle client error: “&lt;span style="font-weight:bold;"&gt;ORA-12705&lt;/span&gt;: Cannot access NLS data files or invalid environment specified“. According to Oracle documentation, “ORA-12705 can happen under the following conditions:&lt;br /&gt;&lt;br /&gt;1. ORA-12705 with incorrect NLS_LANG parameter&lt;br /&gt;2. ORA-12705 with incorrectly specified ORA_NLSx&lt;br /&gt;3. ORA-12705 from incorrect Oracle install or configuration&lt;br /&gt;4. ORA-12705 when using Special Character sets&lt;br /&gt;5. ORA-12705 when connecting with SQL*Net&lt;br /&gt;6. ORA-12705 during migrations&lt;br /&gt;7. ORA-12705 when connecting with SQL*Plus&lt;br /&gt;8. ORA-12705 when connecting with language pre-compilers&lt;br /&gt;9. ORA-12705 during Export/Import&lt;br /&gt;&lt;br /&gt;Try doing the following to fix this error on the client side. On the client Windows machine (this tip is only for Windows), The NLS_LANG must be unset in the Windows registry (re-naming works the best because you know what you changed). Look for the NLS_LANG subkey in the registry at \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, and rename it. Then try SQLPlus again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-7934742883337992415?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/7934742883337992415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=7934742883337992415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7934742883337992415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7934742883337992415'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/resolving-ora-12705-on-client.html' title='Resolving ORA-12705 on Client'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2438675186000523892</id><published>2008-01-21T10:55:00.000+05:30</published><updated>2008-01-21T11:09:27.176+05:30</updated><title type='text'>Limit user sessions in Oracle</title><content type='html'>&lt;span style="font-weight:bold;"&gt;How can I limit the number of times a single user can connect to the database at any one time ?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;We can do this by limiting the number of sessions they are allowed to have.&lt;br /&gt;Easy as always to do in Oracle. First we allow resource limits by setting the resource_limit to true, then we simply create a profile and assign that to the user. The profile can set the limit of how many session a user is allowed to have.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;A little demonstration:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;D:\&gt;sqlplus sys/sys as sysdba&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.1.0.5.0 - Production on Mon Jan 21 10:46:28 2008&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2005, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;Connected to:&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter resource_limit&lt;br /&gt;&lt;br /&gt;NAME                                 TYPE        VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;resource_limit                       boolean     FALSE&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set RESOURCE_LIMIT=true scope=both;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; create profile sesslimit limit sessions_per_user 1;&lt;br /&gt;&lt;br /&gt;Profile created.&lt;br /&gt;&lt;br /&gt;SQL&gt; create user sree identified by sree123 &lt;br /&gt;default tablespace sbdata profile sesslimit;&lt;br /&gt;&lt;br /&gt;User created.&lt;br /&gt;&lt;br /&gt;SQL&gt; grant create session to sree;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;If you want to add this profile to existing user then:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter user sree profile sesslimit;&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sree/sree123&lt;br /&gt;Connected.&lt;br /&gt;&lt;br /&gt;-- I'll start second session in another terminal.&lt;br /&gt;&lt;br /&gt;SQL&gt; connect sree/sree123&lt;br /&gt;ERROR:&lt;br /&gt;ORA-02391: exceeded simultaneous SESSIONS_PER_USER limit&lt;br /&gt;&lt;br /&gt;==========&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT DISTINCT resource_name, limit&lt;br /&gt;FROM dba_profiles&lt;br /&gt;ORDER BY resource_name;&lt;br /&gt;&lt;br /&gt;SQL&gt; drop profile sesslimit cascade;&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Production With the Partitioning, OLAP and Data Mining options&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2438675186000523892?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2438675186000523892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2438675186000523892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2438675186000523892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2438675186000523892'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/limit-user-sessions-in-oracle.html' title='Limit user sessions in Oracle'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4519412818926117455</id><published>2008-01-17T11:10:00.000+05:30</published><updated>2008-01-17T15:03:11.773+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='hmhpmu'/><title type='text'>IMPORTANT LINKS</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Oracle By Example (OBE)&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;The Oracle by Example (OBE) series provides hands-on, step-by-step instructions on how to implement various technology solutions to business problems. OBE solutions are built for practical real-world situations, allowing you to gain valuable hands-on experience as well as use the presented solutions as the foundation for production implementation, dramatically reducing time to deployment.&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/start/index.html"&gt;Direct Link to all Articles &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installing Oracle Database 11g on Linux&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/11gr1_db/install/dbinst/dbinst.htm"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installing Oracle Database 11g on Windows&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/11gr1_db/install/dbinst/windbinst2.htm"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Exploring Your Database with Enterprise Manager Database Control&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/11gr1_db/manage/dbconsole/dbcontrol.htm"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Using Database Replay to Perform Real-World Testing&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/11gr1_db/manage/dbreplay/dbreplay.htm"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Creating a Physical Standby Database&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/11gr1_db/ha/dataguard/physstby/physstdby.htm"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oracle by Example Series: Oracle Database 11g&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/11gr1_db/index.htm"&gt;Direct Link to Articles &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oracle by Example Series: Oracle Database 10g&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/10gr2_db_single/index.htm"&gt;Direct Link to Articles &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Automating Installation of Oracle Database 10g and Red Hat Enterprise Linux&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/saternos_kickstart.html"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;RAC LINKS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Biggest challenge in learning / understanding RAC is lack of hands on experience because of expensive hardware, network cards, interconnect and cluster file system. The following links cover step by step Oracle RAC installation and configuration &lt;br /&gt;on single laptop/desktop using VMWare Server without investing anything extra on hardware (using two virtual machines, virtual network cards and virtual shared disk for Oracle RAC database shared files system ).&lt;br /&gt;&lt;br /&gt;Download VMware Server (for Windows and Linux systems)&lt;br /&gt;&lt;a href="http://register.vmware.com/content/download.html"&gt;Download VMWARE &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installing Oracle Database 10g on Windows by Using Real Application Clusters (RAC) and Automated Storage Management (ASM)&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/obe/obe10gdb_vmware/install/racinstallwin2k/racinstallwin2k.htm"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Steps for configuring/building Oracle RAC Database on laptop/desktop machine (without investing any thing on hardware).&lt;br /&gt;&lt;a href="http://becomeappsdba.blogspot.com/search/label/RAC"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oracle 10g RAC installation using Unbreakable Linux&lt;br /&gt;&lt;a href="http://dbaworkshop.blogspot.com/2007/01/oracle-10g-rac-installation-using.html"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installing Oracle RAC 10g Release 1 on Linux x86&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/smiley_rac10gr1_install.html"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installation of Oracle 10g release 2 (10.2.0.1) RAC on Linux (CentOS 4) using VMware Server with no additional shared disk devices.&lt;br /&gt;&lt;a href="http://www.oracle-base.com/articles/10g/OracleDB10gR2RACInstallationOnCentos4UsingVMware.php"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installing Oracle RAC 10g Release 2 on Linux x86&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/smiley_rac10g_install.html"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Oracle 10g RAC On Windows 2003 Using VMware Server&lt;br /&gt;&lt;a href="http://www.oracle-base.com/articles/10g/OracleDB10gR2RACInstallationOnWindows2003UsingVMware.php"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Install Oracle RAC 10g on Oracle Enterprise Linux Using VMware Server&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/chan-ubl-vmware.html"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Oracle-on-Linux Installation Menu&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/tech/linux/install/index.html"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Installing Oracle Database 10g with Real Application Cluster (RAC) on Red Hat Enterprise Linux Advanced Server 3&lt;br /&gt;&lt;a href="http://www.puschitz.com/InstallingOracle10gRAC.shtml"&gt;Direct Link to Article &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Convert a Single Instance Database to Oracle RAC 10g on RHEL3&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/pub/articles/chan_sing2rac_install.html"&gt;Direct Link to Article &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4519412818926117455?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4519412818926117455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4519412818926117455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4519412818926117455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4519412818926117455'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/important-links.html' title='IMPORTANT LINKS'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-3202763106410050978</id><published>2008-01-07T15:01:00.000+05:30</published><updated>2008-01-07T15:05:20.223+05:30</updated><title type='text'>Code to shrink Your Tablespaces</title><content type='html'>Use it at your own risk.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SET verify OFF&lt;br /&gt;COLUMN file_name format a50 WORD_WRAPPED&lt;br /&gt;COLUMN smallest format 999,990 heading "Smallest|Size|Poss."&lt;br /&gt;COLUMN currsize format 999,990 heading "Current|Size"&lt;br /&gt;COLUMN savings format 999,990 heading "Poss.|Savings"&lt;br /&gt;BREAK on REPORT&lt;br /&gt;COMPUTE sum of savings on REPORT&lt;br /&gt;COLUMN value new_val BLKSIZE&lt;br /&gt;SELECT VALUE&lt;br /&gt;FROM   V$PARAMETER&lt;br /&gt;WHERE  NAME = 'db_block_size';&lt;br /&gt;&lt;br /&gt;SELECT FILE_NAME,&lt;br /&gt;       CEIL((NVL(HWM,1) *&amp;&amp; BLKSIZE) / 1024 / 1024)                                 SMALLEST,&lt;br /&gt;       CEIL(BLOCKS *&amp;&amp; BLKSIZE / 1024 / 1024)                                       CURRSIZE,&lt;br /&gt;       CEIL(BLOCKS *&amp;&amp; BLKSIZE / 1024 / 1024) - CEIL((NVL(HWM,1) *&amp;&amp; BLKSIZE) / 1024 / 1024) SAVINGS&lt;br /&gt;FROM   DBA_DATA_FILES A,&lt;br /&gt;       (SELECT   FILE_ID,&lt;br /&gt;                 MAX(BLOCK_ID + BLOCKS - 1) HWM&lt;br /&gt;        FROM     DBA_EXTENTS&lt;br /&gt;        GROUP BY FILE_ID) B&lt;br /&gt;WHERE  A.FILE_ID = B.FILE_ID (+);&lt;br /&gt;&lt;br /&gt;SELECT 'alter database datafile '''&lt;br /&gt;       ||File_Name&lt;br /&gt;       ||''' resize '&lt;br /&gt;       ||Ceil((Nvl(hwm,1) *&amp;&amp; blkSize) / 1024 / 1024)&lt;br /&gt;       ||'m;'  cmd&lt;br /&gt;FROM   dba_Data_Files a,&lt;br /&gt;       (SELECT   File_Id,&lt;br /&gt;                 MAX(Block_Id + Blocks - 1) hwm&lt;br /&gt;        FROM     dba_Extents&lt;br /&gt;        GROUP BY File_Id) b&lt;br /&gt;WHERE  a.File_Id = b.File_Id (+)&lt;br /&gt;       AND Ceil(Blocks *&amp;&amp; blkSize / 1024 / 1024) - Ceil((Nvl(hwm,1) *&amp;&amp; blkSize) / 1024 / 1024) &gt; 0;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-3202763106410050978?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/3202763106410050978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=3202763106410050978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3202763106410050978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3202763106410050978'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/code-to-shrink-your-tablespaces.html' title='Code to shrink Your Tablespaces'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4590383869681870272</id><published>2008-01-07T12:51:00.000+05:30</published><updated>2008-01-28T15:22:06.462+05:30</updated><title type='text'>Cool Scripts for daily DBA activities</title><content type='html'>I will be adding scripts to this post when ever I come across a good one.&lt;br /&gt;&lt;br /&gt;Note: Test the scripts before using on a Production database.&lt;br /&gt;      Finely Format the SQL statements before use.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Calculate the Database Size&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;COLUMN "Total Mb" FORMAT 999,999,999.0&lt;br /&gt;COLUMN "Redo Mb" FORMAT 999,999,999.0&lt;br /&gt;COLUMN "Temp Mb" FORMAT 999,999,999.0&lt;br /&gt;COLUMN "Data Mb" FORMAT 999,999,999.0&lt;br /&gt;&lt;br /&gt;Prompt&lt;br /&gt;Prompt "Database Size"&lt;br /&gt;&lt;br /&gt;select (select sum(bytes/1048576) from dba_data_files) "Data Mb",&lt;br /&gt;(select NVL(sum(bytes/1048576),0) from dba_temp_files) "Temp Mb",&lt;br /&gt;(select sum(bytes/1048576)*max(members) from v$log) "Redo Mb",&lt;br /&gt;(select sum(bytes/1048576) from dba_data_files) +&lt;br /&gt;(select NVL(sum(bytes/1048576),0) from dba_temp_files) +&lt;br /&gt;(select sum(bytes/1048576)*max(members) from v$log) "Total Mb"&lt;br /&gt;from dual;&lt;br /&gt;=========================================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Heavy CPU SQL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will generate the top SQL statements that produce heavy CPU usage&lt;br /&gt;&lt;br /&gt;set termout on&lt;br /&gt;set feedback on&lt;br /&gt;set pagesize 132&lt;br /&gt;&lt;br /&gt;#spool cpusql.lis&lt;br /&gt;&lt;br /&gt;SELECT username,address, hash_value,&lt;br /&gt;buffer_gets, executions, buffer_gets/executions "Gets/Exec",sql_text&lt;br /&gt;FROM v$sqlarea,dba_users&lt;br /&gt;WHERE buffer_gets &gt; 50000 &lt;br /&gt;and executions &gt; 0&lt;br /&gt;and v$sqlarea.parsing_user_id = dba_users.user_id&lt;br /&gt;order by 4 desc;&lt;br /&gt;&lt;br /&gt;#spool off;&lt;br /&gt;=========================================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Calculate the Table Size&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT   Segment_Name               Table_Name,&lt;br /&gt;         SUM(Bytes) / (1024 * 1024) Table_Size_Meg&lt;br /&gt;FROM     dba_Extents&lt;br /&gt;WHERE    Owner = 'SCOTT' &lt;br /&gt;         AND Segment_Name = 'DEPT'&lt;br /&gt;         AND Segment_Type = 'TABLE'&lt;br /&gt;GROUP BY Segment_Name&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;=============================================================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Determine Tablespace Usage&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT a.TableSpace_Name,&lt;br /&gt;       Round(a.Bytes_Alloc / 1024 / 1024,2)                            Megs_Alloc,&lt;br /&gt;       Round(Nvl(b.Bytes_Free,0) / 1024 / 1024,2)                      Megs_Free,&lt;br /&gt;       Round((a.Bytes_Alloc - Nvl(b.Bytes_Free,0)) / 1024 / 1024,&lt;br /&gt;             2) Megs_Used,&lt;br /&gt;       Round((Nvl(b.Bytes_Free,0) / a.Bytes_Alloc) * 100,&lt;br /&gt;             2)    pct_Free,&lt;br /&gt;       100 - Round((Nvl(b.Bytes_Free,0) / a.Bytes_Alloc) * 100,&lt;br /&gt;                   2) pct_Used,&lt;br /&gt;       Round(MaxBytes / 1048576,2)                                     MAX&lt;br /&gt;FROM   (SELECT   f.TableSpace_Name,&lt;br /&gt;                 SUM(f.Bytes)                                                   Bytes_Alloc,&lt;br /&gt;                 SUM(DECODE(f.AutoexTensible,'YES',f.MaxBytes,&lt;br /&gt;                                             'NO',f.Bytes)) MaxBytes&lt;br /&gt;        FROM     dba_Data_Files f&lt;br /&gt;        GROUP BY TableSpace_Name) a,&lt;br /&gt;       (SELECT   f.TableSpace_Name,&lt;br /&gt;                 SUM(f.Bytes)      Bytes_Free&lt;br /&gt;        FROM     dba_Free_Space f&lt;br /&gt;        GROUP BY TableSpace_Name) b&lt;br /&gt;WHERE  a.TableSpace_Name = b.TableSpace_Name (+)&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT   h.TableSpace_Name,&lt;br /&gt;         Round(SUM(h.Bytes_Free + h.Bytes_Used) / 1048576,&lt;br /&gt;               2)                                                         Megs_Alloc,&lt;br /&gt;         Round(SUM((h.Bytes_Free + h.Bytes_Used) - Nvl(p.Bytes_Used,0)) / 1048576,&lt;br /&gt;               2)                                 Megs_Free,&lt;br /&gt;         Round(SUM(Nvl(p.Bytes_Used,0)) / 1048576,2)                                                                         Megs_Used,&lt;br /&gt;         Round((SUM((h.Bytes_Free + h.Bytes_Used) - Nvl(p.Bytes_Used,0)) / SUM(h.Bytes_Used + h.Bytes_Free)) * 100,&lt;br /&gt;               2) pct_Free,&lt;br /&gt;         100 - Round((SUM((h.Bytes_Free + h.Bytes_Used) - Nvl(p.Bytes_Used,0)) / SUM(h.Bytes_Used + h.Bytes_Free)) * 100,&lt;br /&gt;                     2) pct_Used,&lt;br /&gt;         Round(SUM(f.MaxBytes) / 1048576,2)                                                                                  MAX&lt;br /&gt;FROM     sys.v_$temp_Space_Header h,&lt;br /&gt;         sys.v_$temp_Extent_Pool p,&lt;br /&gt;         dba_temp_Files f&lt;br /&gt;WHERE    p.File_Id (+)  = h.File_Id&lt;br /&gt;         AND p.TableSpace_Name (+)  = h.TableSpace_Name&lt;br /&gt;         AND f.File_Id = h.File_Id&lt;br /&gt;         AND f.TableSpace_Name = h.TableSpace_Name&lt;br /&gt;GROUP BY h.TableSpace_Name&lt;br /&gt;ORDER BY 1&lt;br /&gt;-------------------------------------------------------------------------&lt;br /&gt;SELECT   TableSpace_Name    "Tablespace",&lt;br /&gt;         COUNT(Bytes)       "Pieces",&lt;br /&gt;         MIN(Bytes)         "Min",&lt;br /&gt;         Round(Avg(Bytes))  "Average",&lt;br /&gt;         MAX(Bytes)         "Max",&lt;br /&gt;         SUM(Bytes)         "Total"&lt;br /&gt;FROM     sys.dba_Free_Space&lt;br /&gt;GROUP BY TableSpace_Name&lt;br /&gt;&lt;br /&gt;==========================================================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Track your import process:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT Substr(sql_Text,Instr(sql_Text,'INTO "'),30)                             Table_Name,&lt;br /&gt;       Rows_Processed,&lt;br /&gt;       Round((SYSDATE - To_date(First_Load_Time,'yyyy-mm-dd hh24:mi:ss')) * 24 * 60,&lt;br /&gt;             1) Minutes,&lt;br /&gt;       Trunc(Rows_Processed / ((SYSDATE - To_date(First_Load_Time,'yyyy-mm-dd hh24:mi:ss')) * 24 * 60)) Rows_Per_Minute&lt;br /&gt;FROM   sys.v_$sqlArea&lt;br /&gt;WHERE  sql_Text LIKE 'INSERT %INTO "%'&lt;br /&gt;       AND Command_Type = 2&lt;br /&gt;       AND Open_Versions &gt; 0;&lt;br /&gt;===============================================================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Details of parameters for SPfile modifications&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT   NAME,&lt;br /&gt;         Isses_modIfiAble,&lt;br /&gt;         Issys_modIfiAble,&lt;br /&gt;         IsInstance_modIfiAble&lt;br /&gt;FROM     v$Parameter&lt;br /&gt;ORDER BY NAME;&lt;br /&gt;==============================================================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Query to find the difference between two dates omitting weekends and holidays.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT (To_date('31/01/2008','dd/mm/rrrr') - To_date('01/01/2008','dd/mm/rrrr') + 1) - (SELECT COUNT(Days)&lt;br /&gt;FROM   (SELECT To_char(To_date('01/01/2008','dd/mm/rrrr') + LEVEL,'D') Days&lt;br /&gt;FROM   Dual CONNECT BY LEVEL &lt;= 31)                                                                                       WHERE  Days IN ('7','1')) DAY&lt;br /&gt;FROM   Dual;&lt;br /&gt;===============================================================================&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4590383869681870272?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4590383869681870272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4590383869681870272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4590383869681870272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4590383869681870272'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/cool-scripts-for-daily-dba-activities.html' title='Cool Scripts for daily DBA activities'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-664535046236817460</id><published>2008-01-07T12:46:00.000+05:30</published><updated>2008-01-07T12:48:22.855+05:30</updated><title type='text'>Deleting Duplicate Records</title><content type='html'>You may have come across numerous situations where duplicate records needs to be deleted from some table quickly. More often than not this is due to an application or data transformation issue and the number of duplicate rows are generally small related to the overall number of rows in the table. DBAs struggle with this task and spend way too much time and so coming up with elaborate scripts.&lt;br /&gt;&lt;br /&gt;Assuming the table looks like this:&lt;br /&gt;&lt;br /&gt;ACCOUNT&lt;br /&gt;ACCOUNT_ID&lt;br /&gt;STATUS_CODE&lt;br /&gt;FIRST_NAME&lt;br /&gt;LAST_NAME&lt;br /&gt;STREET_ADDRESS&lt;br /&gt;&lt;br /&gt;In this example, there is no primary key or unique constraint preventing duplicates from being inserted. The "logical primary key" is ACCOUNT_ID and STATUS_CODE.&lt;br /&gt;&lt;br /&gt;First we might want to view the duplicate records to assist with troubleshooting and this can be done with this query:&lt;br /&gt;&lt;br /&gt;SELECT   Account_Id,&lt;br /&gt;         Status_Code,&lt;br /&gt;         COUNT(* )   OccurAnces&lt;br /&gt;FROM     ACCOUNT&lt;br /&gt;GROUP BY Account_Id,Status_Code&lt;br /&gt;HAVING   COUNT(* ) &gt; 1;&lt;br /&gt;&lt;br /&gt;And to delete them we rely on Oracle’s rowed which is a unique "key" that exists on every table row:&lt;br /&gt;&lt;br /&gt;DELETE&lt;br /&gt;FROM ACCOUNT A&lt;br /&gt;WHERE&lt;br /&gt;  (ACCOUNT_ID,STATUS_CODE) IN (&lt;br /&gt;    SELECT&lt;br /&gt;      ACCOUNT_ID,&lt;br /&gt;      STATUS_CODE,&lt;br /&gt;    FROM ACCOUNT&lt;br /&gt;    GROUP BY&lt;br /&gt;      ACCOUNT_ID,&lt;br /&gt;      STATUS_CODE&lt;br /&gt;    HAVING&lt;br /&gt;      COUNT(*) &gt; 1) AND&lt;br /&gt;  ROWID != (&lt;br /&gt;    SELECT&lt;br /&gt;      MIN(ROWID)&lt;br /&gt;    FROM ACCOUNT&lt;br /&gt;    WHERE&lt;br /&gt;      ACCOUNT_ID = A.ACCOUNT_ID AND&lt;br /&gt;      STATUS_CODE = A.STATUS_CODE);&lt;br /&gt;&lt;br /&gt;Alternatively this more simplified query can be used, but in some cases it might not execute as fast as the above query because of having to do more random I/O:&lt;br /&gt;&lt;br /&gt;DELETE FROM ACCOUNT a&lt;br /&gt;WHERE       RowId != (SELECT MIN(RowId)&lt;br /&gt;                      FROM   ACCOUNT&lt;br /&gt;                      WHERE  Account_Id = a.Account_Id&lt;br /&gt;                             AND Status_Code = a.Status_Code);&lt;br /&gt;&lt;br /&gt;Please make sure that you thoroughly understand your duplicate record problem and what makes a record unique before deleting duplicate records in a table. Make sure you test the above SQL statements in a test environment with a representative test case before attempting this in a production environment&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-664535046236817460?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/664535046236817460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=664535046236817460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/664535046236817460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/664535046236817460'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/deleting-duplicate-records.html' title='Deleting Duplicate Records'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-5347502089999328545</id><published>2008-01-07T12:43:00.000+05:30</published><updated>2008-01-07T12:45:12.723+05:30</updated><title type='text'>DBVERIFY</title><content type='html'>DBVERIFY is an external command-line utility that performs a physical data structure integrity check. It can be used on offline or online databases, as well on backup files. You use DBVERIFY primarily when you need to ensure that a backup database (or datafile) is valid before it is restored, or as a diagnostic aid when you have encountered data corruption problems.&lt;br /&gt;&lt;br /&gt;DBVERIFY checks are limited to cache-managed blocks (that is, data blocks). Because DBVERIFY is only for use with datafiles, it will not work against control files or redo logs.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are two command-line interfaces to DBVERIFY&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1.Using DBVERIFY to Validate Disk Blocks of a Single Datafile&lt;br /&gt;&lt;br /&gt;D:/&gt;dbv FILE=D:\oracle\product\10.1.0\oradata\ORCL\users.dbf FEEDBACK=100&lt;br /&gt;&lt;br /&gt;------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;2.Using DBVERIFY to Validate a Segment&lt;br /&gt;If we want to check segment level you can use SEGMENT_ID&lt;br /&gt;&lt;br /&gt;SEGMENT_ID  = Segment ID (tsn.relfile.block)&lt;br /&gt;&lt;br /&gt;we can get all three values from below query.&lt;br /&gt;&lt;br /&gt;SQL&gt; Grant sysdba to scott;&lt;br /&gt;&lt;br /&gt;SQL&gt;SELECT t.ts#,&lt;br /&gt;       s.Header_File,&lt;br /&gt;       s.Header_Block&lt;br /&gt;FROM   v$TableSpace t,&lt;br /&gt;       dba_Segments s&lt;br /&gt;WHERE  s.Owner = 'SCOTT'&lt;br /&gt;       AND s.Segment_Name = 'EMP'&lt;br /&gt;       AND t.NAME = s.TableSpace_Name;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      TS# HEADER_FILE HEADER_BLOCK&lt;br /&gt;---------- ----------- ------------&lt;br /&gt;         4           4           27&lt;br /&gt;&lt;br /&gt;SQL&gt; host dbv userid=scott/tiger segment_id=4.4.27&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-5347502089999328545?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/5347502089999328545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=5347502089999328545' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5347502089999328545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5347502089999328545'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2008/01/dbverify.html' title='DBVERIFY'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8572558194465376101</id><published>2007-12-31T17:54:00.000+05:30</published><updated>2007-12-31T17:57:55.272+05:30</updated><title type='text'>New Year Wishes to all  my Guests....</title><content type='html'>&lt;span style="font-weight:bold;"&gt;May the dawning of this New Year, fill your heart with new hopes, open up new horizons and bring for you promises of brighter tomorrows. May you have a great New Year - 2008.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8572558194465376101?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8572558194465376101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8572558194465376101' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8572558194465376101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8572558194465376101'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/new-year-wishes.html' title='New Year Wishes to all  my Guests....'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4043895461619128944</id><published>2007-12-30T10:16:00.000+05:30</published><updated>2008-01-07T18:52:29.577+05:30</updated><title type='text'>Some of the Oracle Database 11g New Features</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Oracle Database 11g Release 1 (11.1) New Features&lt;/span&gt;&lt;br /&gt;=================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Case Sensitive Passwords &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Beginning with Oracle Database 11g Release 1, database passwords are case sensitive. &lt;br /&gt;You can disable this features by setting the SEC_CASE_SENSITIVE_LOGON initialization parameter to FALSE.&lt;br /&gt;&lt;br /&gt;=======================================&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Readonly Tables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To place a table in read-only mode, you must have the ALTER TABLE privilege on thetable or the ALTER ANY &lt;br /&gt;&lt;br /&gt;TABLE privilege. In addition, the COMPATIBILE initializationparameter must be set to 11.1.0 or greater.&lt;br /&gt;&lt;br /&gt;The following example places the EMP table in read-only mode:&lt;br /&gt;&lt;br /&gt;ALTER TABLE EMP READ ONLY; &lt;br /&gt;&lt;br /&gt;The following example returns the table to read/write mode:&lt;br /&gt;&lt;br /&gt;ALTER TABLE EMP READ WRITE;&lt;br /&gt;&lt;br /&gt;=========================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Invisible Indexes&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;An invisible index is an index that is ignored by the optimizer unless you explicitly set the OPTIMIZER_USE_INVISIBLE_INDEXES initialization parameter to TRUE at the session or system level. Making an index invisible is an alternative to making it unusable or dropping it.&lt;br /&gt;&lt;br /&gt;Using invisible indexes, you can do the following: &lt;br /&gt;&lt;br /&gt;Test the removal of an index before dropping it. &lt;br /&gt;&lt;br /&gt;Altering Indexes &lt;br /&gt;&lt;br /&gt;Use temporary index structures for certain operations or modules of an application without affecting the overall application.&lt;br /&gt;&lt;br /&gt;To create an invisible index, use the SQL statement CREATE INDEX with theINVISIBLE clause. The following statement creates an invisible index named IND_EMP_DEPT for the DEPT column of the EMP table:&lt;br /&gt;&lt;br /&gt;CREATE INDEX ind_emp_dept ON emp(dept)INVISIBLE;&lt;br /&gt;&lt;br /&gt;To make an invisible index visible, issue this statement: &lt;br /&gt;&lt;br /&gt;ALTER INDEX ind_emp_dept VISIBLE; &lt;br /&gt;&lt;br /&gt;To make a visible index invisible, issue this statement: &lt;br /&gt;&lt;br /&gt;ALTER INDEX ind_emp_dept INVISIBLE; &lt;br /&gt;&lt;br /&gt;To check whether an index is visible or invisible, query the dictionary views&lt;br /&gt;&lt;br /&gt;USER[ALL][DBA]_INDEXES&lt;br /&gt;&lt;br /&gt;For example, to determine if above index is invisible, issue the following query:&lt;br /&gt;&lt;br /&gt;SELECT INDEX_NAME, VISIBILITY FROM&lt;br /&gt;USER_INDEXES WHERE INDEX_NAME = 'IND_EMP_DEPT';&lt;br /&gt;&lt;br /&gt;INDEX_NAME VISIBILITY &lt;br /&gt;------------- ----------&lt;br /&gt;IND_EMP_DEPT VISIBLE&lt;br /&gt;&lt;br /&gt;===========================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Automatic Stats Collection on Tables &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you know that you can enable DBMS_STATS to automatically gather statistics for a table by specifying the MONITORING keyword in the CREATE (or ALTER) TABLE statement. But, starting with Oracle Database 11g, the MONITORING and NOMONITORING keywords have been deprecated and statistics are collected automatically. If you do specify these keywords, they are ignored. &lt;br /&gt;&lt;br /&gt;Monitoring tracks the approximate number of INSERT, UPDATE, and DELETE operations for the table since the last time statistics were gathered. Information abouthow many rows are affected is maintained in the SGA, until periodically (about everythree hours) SMON incorporates the data into the data dictionary. &lt;br /&gt;&lt;br /&gt;This data dictionary information is made visible through the DBA_TAB_MODIFICATIONS, ALL_TAB_MODIFICATIONS, or USER_TAB_MODIFICATIONS views. The database uses these &lt;br /&gt;views to identify tables with stale statistics.&lt;br /&gt;&lt;br /&gt;=================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Virtual columns&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Tables can now include virtual columns. The value of a virtual column in a row is derived by evaluating an expression. The expression can include columns from the same table, constants, SQL functions, and user-defined PL/SQL functions. In some cases, a virtual column eliminates the need to create a separate view. You can create an index on a virtual column, and you can use a virtual column as a partition or subpartition key.&lt;br /&gt;&lt;br /&gt;==============================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Simplified and improved automatic memory management&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can now set a single initialization parameter (MEMORY_TARGET) to indicate the total amount of memory that is to be allocated to the database (the SGA and instance PGA). The system then automatically and dynamically tunes all SGA and PGA components for optimal performance. You can still designate minimum sizes individually for the SGA and instance PGA.&lt;br /&gt;&lt;br /&gt;===============================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Database resident connection pooling&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Database resident connection pooling (DRCP) provides a connection pool in the database server for typical Web application usage scenarios where the application acquires a database connection, works on it for a relatively short duration, and then releases it. DRCP pools "dedicated" servers, which are the equivalent of a server foreground process and a database session combined. DRCP enables sharing of &lt;br /&gt;database connections across middle-tier processes on the same middle-tier host and across middle-tier hosts. This results in significant reduction in database resources needed to support a large number of client connections, thereby boosting the scalability of both middle-tier and database tiers.&lt;br /&gt;&lt;br /&gt;==================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Tablespace-level encryption&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can encrypt any permanent tablespace to protect sensitive data. Tablespace encryption is completely transparent to your applications. When you encrypt a tablespace, all tablespace blocks are encrypted. &lt;br /&gt;&lt;br /&gt;All segment types are supported for encryption, including tables, clusters, indexes, LOBs, table and index partitions, and so on.&lt;br /&gt;&lt;br /&gt;==========================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Result cache in the system global area&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Results of queries and query fragments can be cached in memory in the result cache. The database can then use cached results to answer future executions of these queries and query fragments. Because retrieving results from the result cache is faster than rerunning a query, frequently run queries experience a significant performance improvement when their results are cached.&lt;br /&gt;&lt;br /&gt;The result cache occupies memory in the shared pool.&lt;br /&gt;&lt;br /&gt;=============================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Enhanced online index creation and rebuild&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Online index creation and rebuild prior to this release required a DML-blocking lock at the beginning and at the end of the rebuild for a short period of time. This lock could delay other DML statements and therefore cause a performance spike. This lock is no longer required, making these online index operations fully transparent.&lt;br /&gt;&lt;br /&gt;===============================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Ability to online redefine tables that have materialized view logs&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Tables with materialized view logs can now be redefined online. Materialized view logs are now one of the dependent objects that can be copied to the interim table with the DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS package procedure.&lt;br /&gt;&lt;br /&gt;=====================================================================&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Optimized ALTER TABLE...ADD COLUMN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;For certain types of tables, when adding a column that has both a NOT NULL constraint and a default value, the database can optimize the resource usage and storage requirements for the operation. It does so by storing the default value for the new column as table metadata, avoiding the need to store the value in all existing records.&lt;br /&gt;&lt;br /&gt;In addition, the following ADD COLUMN operations can now run concurrently with DML operations:&lt;br /&gt;&lt;br /&gt;Add a NOT NULL column with a default value&lt;br /&gt;&lt;br /&gt;Add a nullable column without a default value&lt;br /&gt;&lt;br /&gt;Add a virtual column&lt;br /&gt;==========================================================&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4043895461619128944?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4043895461619128944/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4043895461619128944' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4043895461619128944'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4043895461619128944'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/some-of-oracle-database-11g-new.html' title='Some of the Oracle Database 11g New Features'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-1875568586169411648</id><published>2007-12-28T12:51:00.000+05:30</published><updated>2007-12-28T14:07:50.921+05:30</updated><title type='text'>Oracle Express Editon</title><content type='html'>These are just &lt;span style="font-weight:bold;"&gt;some general points&lt;/span&gt; that might save you a bit of time and head scratching if you decide to give Oracle XE a go:&lt;br /&gt;&lt;br /&gt;First, let's start with the &lt;span style="font-weight:bold;"&gt;good:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It's free to download and develop on&lt;br /&gt;It's free to deploy (including distribution, as long as you make the other party aware of the licensing details)&lt;br /&gt;It is the first really simple installation on either Windows or Linux that I have ever seen Oracle do&lt;br /&gt;The included tools are superb and very modern and AJAXy&lt;br /&gt;&lt;br /&gt;However, there are &lt;span style="font-weight:bold;"&gt;limitations:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;--&gt; Although you can install it on a multiple CPU machine, and it will run on one, it will only use &lt;span style="font-weight:bold;"&gt;one CPU&lt;/span&gt; on that machine.&lt;br /&gt;&lt;br /&gt;--&gt; It will only use a maximum &lt;span style="font-weight:bold;"&gt;1 gigabyte&lt;/span&gt; of memory (again, it will run on machines with more memory; it just won't use it)&lt;br /&gt;&lt;br /&gt;--&gt; It has a database size limit of &lt;span style="font-weight:bold;"&gt;4 gigabytes&lt;/span&gt; for user data (this is all available to the user; system data is counted outside of that 4 gig limit)&lt;br /&gt;&lt;br /&gt;--&gt; Only &lt;span style="font-weight:bold;"&gt;one instance&lt;/span&gt; of Oracle XE can run on any given computer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;You can download Oracle XE software from following link:&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.oracle.com/technology/software/products/database/index.html"&gt;Download Link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-1875568586169411648?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/1875568586169411648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=1875568586169411648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1875568586169411648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1875568586169411648'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/oracle-express-editon.html' title='Oracle Express Editon'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8466256880688267511</id><published>2007-12-28T11:46:00.000+05:30</published><updated>2007-12-28T14:12:56.033+05:30</updated><title type='text'>Locally vs. Dictionary Managed Tablespaces</title><content type='html'>When Oracle allocates space to a segment (like a table or index), a group of contiguous free blocks, called an extent, is added to the segment. Metadata regarding extent allocation and unallocated extents are either stored in the data dictionary, or in the tablespace itself. Tablespaces that record extent allocation in the dictionary, are called dictionary managed tablespaces, and tablespaces that record extent allocation in the tablespace header, are called locally managed tablespaces.&lt;br /&gt;&lt;br /&gt;SQL&gt; select tablespace_name, extent_management, allocation_type from dba_tablespaces;&lt;br /&gt;&lt;br /&gt;TABLESPACE_NAME                  EXTENT_MAN  ALLOCATIO&lt;br /&gt;------------------------------   ----------  ---------&lt;br /&gt;SYSTEM      --                   DICTIONARY -USER&lt;br /&gt;UNDOTBS1    --                   LOCAL      -SYSTEM&lt;br /&gt;TEMP        --                   LOCAL      -UNIFORM&lt;br /&gt;USERS       --                   LOCAL      -SYSTEM&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Dictionary Managed Tablespaces (DMT):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Oracle use the data dictionary (tables in the SYS schema) to track allocated and free extents for tablespaces that is in "dictionary managed" mode. Free space is recorded in the SYS.FET$ table, and used space in the SYS.UET$ table. Whenever space is required in one of these tablespaces, the ST (space transaction) enqueue latch must be obtained to do inserts and deletes agianst these tables. As only one process can acquire the ST enque at a given time, this often lead to contention.&lt;br /&gt;&lt;br /&gt;Execute the following statement to create a dictionary managed tablespace:&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE TABLESPACE tblspc1 DATAFILE '/oradata/tblspc1_01.dbf' SIZE 50M &lt;br /&gt;      EXTENT MANAGEMENT DICTIONARY &lt;br /&gt;      DEFAULT STORAGE ( INITIAL 50K NEXT 50K MINEXTENTS 2 MAXEXTENTS 50 PCTINCREASE 0);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Locally Managed Tablespaces (LMT):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using LMT, each tablespace manages it's own free and used space within a bitmap structure stored in one of the tablespace's data files. Each bit corresponds to a database block or group of blocks. Execute one of the following statements to create a locally managed tablespace:&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE TABLESPACE tblspc2 DATAFILE '/oradata/tblspc2_01.dbf' SIZE 50M&lt;br /&gt;    EXTENT MANAGEMENT LOCAL AUTOALLOCATE;&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE TABLESPACE tblspc3 DATAFILE '/oradata/tblspc3_01.dbf' SIZE 50M&lt;br /&gt;      EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K;&lt;br /&gt;&lt;br /&gt;Note the difference between AUTOALLOCATE and UNIFORM SIZE:&lt;br /&gt;&lt;br /&gt;AUTOALLOCATE specifies that extent sizes are system managed. Oracle will choose "optimal" next extent sizes starting with 64KB. As the segment grows larger extent sizes will increase to 1MB, 8MB, and eventually to 64MB. This is the recommended option for a low or unmanaged environment.&lt;br /&gt;&lt;br /&gt;UNIFORM specifies that the tablespace is managed with uniform extents of SIZE bytes (use K or M to specify the extent size in kilobytes or megabytes). The default size is 1M. The uniform extent size of a locally managed tablespace cannot be overridden when a schema object, such as a table or an index, is created.&lt;br /&gt;&lt;br /&gt;Also not, if you specify, LOCAL, you cannot specify DEFAULT STORAGE, MINIMUM EXTENT or TEMPORARY.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Advantages of Locally Managed Tablespaces: &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Eliminates the need for recursive SQL operations against the data dictionary (UET$ and FET$ tables)&lt;br /&gt;Reduce contention on data dictionary tables (single ST enqueue)&lt;br /&gt;Locally managed tablespaces eliminate the need to periodically coalesce free space (automatically tracks adjacent free space)&lt;br /&gt;Changes to the extent bitmaps do not generate rollback information&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Locally Managed SYSTEM Tablespace:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;From Oracle9i release 9.2 one can change the SYSTEM tablespace to locally managed. &lt;/span&gt;Further, if you create a database with DBCA (Database Configuration Assistant), it will have a locally managed SYSTEM tablespace by default. The following &lt;span style="font-weight:bold;"&gt;restrictions apply:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;No dictionary-managed tablespace in the database can be READ WRITE.&lt;br /&gt;You cannot create new dictionary managed tablespaces&lt;br /&gt;You cannot convert any dictionary managed tablespaces to local&lt;br /&gt;&lt;br /&gt;Thus, it is best only to convert the SYSTEM tablespace to LMT after all other tablespaces are migrated to LMT.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Segment Space Management in LMT:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;From Oracle 9i, one can not only have bitmap managed tablespaces, but also bitmap managed segments when setting Segment Space Management to AUTO for a tablespace. Look at this example:&lt;br /&gt;&lt;br /&gt;SQL&gt; CREATE TABLESPACE tblspc4 DATAFILE '/oradata/tblspc4_01.dbf' SIZE 50M &lt;br /&gt;      EXTENT MANAGEMENT LOCAL &lt;br /&gt;      SEGMENT SPACE MANAGEMENT AUTO;&lt;br /&gt;&lt;br /&gt;Segment Space Management eliminates the need to specify and tune the PCTUSED, FREELISTS, and FREELISTS GROUPS storage parameters for schema objects. The Automatic Segment Space Management feature improves the performance of concurrent DML operations significantly since different parts of the bitmap can be used simultaneously eliminating serialization for free space lookups against the FREELSITS. This is of particular importance when using RAC, or if "buffer busy waits" are deteted.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Convert between LMT and DMT:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The DBMS_SPACE_ADMIN package allows DBAs to quickly and easily convert between LMT and DMT mode. Look at these examples:&lt;br /&gt;&lt;br /&gt;SQL&gt; exec dbms_space_admin.Tablespace_Migrate_TO_Local('tblspc1');&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt;exec dbms_space_admin.Tablespace_Migrate_FROM_Local('tblspc2');&lt;br /&gt;PL/SQL procedure successfully completed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8466256880688267511?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8466256880688267511/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8466256880688267511' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8466256880688267511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8466256880688267511'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/locally-vs-dictionary-managed.html' title='Locally vs. Dictionary Managed Tablespaces'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-575784203453459059</id><published>2007-12-28T11:34:00.000+05:30</published><updated>2007-12-29T11:39:31.687+05:30</updated><title type='text'>Installing the April 2007 Critical Patch Update on Windows</title><content type='html'>This article describes the procedure to install the &lt;span style="font-weight:bold;"&gt;April 2007 CPU patch&lt;/span&gt; on Oracle Database Release 10.1.0.5. The Patch Number is &lt;span style="font-weight:bold;"&gt;p5907304_10105_WINNT.zip&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SYSTEM Overview&lt;br /&gt;&lt;br /&gt;Platforms : Windows XP SP2&lt;br /&gt;Database : 10.1.0.5.0&lt;br /&gt;&lt;br /&gt;OPatch Utility Information&lt;br /&gt;&lt;br /&gt;You must use the OPatch utility release 1.0.0.0.57 or later. You can download it from OracleMetaLink with patch 2617419.&lt;br /&gt;&lt;br /&gt;Check Oracle Inventory Setup&lt;br /&gt;&lt;br /&gt;D:\&gt;set ORACLE_SID=TEST&lt;br /&gt;&lt;br /&gt;D:\&gt;set ORACLE_HOME=D:\oracle\product\10.1.0\db_1&lt;br /&gt;&lt;br /&gt;D:\&gt;cd D:\oracle\product\10.1.0\db_1\opatch&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\OPatch&gt;opatch lsinventory&lt;br /&gt;&lt;br /&gt;Oracle Interim Patch Installer version 1.0.0.0.53&lt;br /&gt;&lt;br /&gt;Note: if Opatch utility version is &lt;= 1.0.0.0.53 then you have to download OPATCH utility from the Metalink site.&lt;br /&gt;[output not attached]&lt;br /&gt;&lt;br /&gt;Oracle Home = D:\oracle\product\10.1.0\db_1&lt;br /&gt;Location of Oracle Universal Installer components = D:\oracle\product\10.1.0\db_1\oui&lt;br /&gt;Location of OraInstaller.jar = "D:\oracle\product\10.1.0\db_1\oui\jlib"&lt;br /&gt;Oracle Universal Installer shared library = D:\oracle\product\10.1.0\db_1\oui\lib\win32\oraInstaller.dll&lt;br /&gt;Location of Oracle Inventory Pointer = N/A&lt;br /&gt;Location of Oracle Inventory = D:\oracle\product\10.1.0\db_1\inventory&lt;br /&gt;Path to Java = "D:\oracle\product\10.1.0\db_1\jre\1.4.2\bin\java.exe"&lt;br /&gt;Log file = D:\oracle\product\10.1.0\db_1/.patch_storage//*.log&lt;br /&gt;&lt;br /&gt;Creating log file "D:\oracle\product\10.1.0\db_1\.patch_storage\LsInventory__12-13-2007_10-18-45.log"&lt;br /&gt;&lt;br /&gt;Result:&lt;br /&gt;&lt;br /&gt;There is no Interim Patch&lt;br /&gt;&lt;br /&gt;OPatch succeeded.&lt;br /&gt;OPatch returns with error code = 0&lt;br /&gt;&lt;br /&gt;Preinstallation Instructions&lt;br /&gt;&lt;br /&gt;1. Ensure that your Oracle Database installation is the same release for which you are applying this patch.&lt;br /&gt;&lt;br /&gt;2. Back up the current database that is installed&lt;br /&gt;--&gt;ORACLE_HOME or ORA INVENTORY&lt;br /&gt;&lt;br /&gt;3. Perform a clean shutdown of all Oracle services&lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleServiceTEST&lt;br /&gt;The following services are dependent on the OracleServiceTEST service.&lt;br /&gt;Stopping the OracleServiceTEST service will also stop these services.&lt;br /&gt;&lt;br /&gt;OracleDBConsoleTEST&lt;br /&gt;&lt;br /&gt;Do you want to continue this operation? (Y/N) [N]: Y&lt;br /&gt;The OracleDBConsoleTEST service is stopping...............&lt;br /&gt;The OracleDBConsoleTEST service was stopped successfully.&lt;br /&gt;&lt;br /&gt;The OracleServiceTEST service is stopping...........&lt;br /&gt;The OracleServiceTEST service was stopped successfully.&lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleServiceRCAT&lt;br /&gt;The OracleServiceRCAT service is stopping......&lt;br /&gt;The OracleServiceRCAT service was stopped successfully.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D:\&gt;LSNRCTL stop&lt;br /&gt;&lt;br /&gt;LSNRCTL for 32-bit Windows: Version 10.1.0.5.0 - Production on 13-DEC-2007 10:30:50&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2004, Oracle. All rights reserved.&lt;br /&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleCSService&lt;br /&gt;&lt;br /&gt;The OracleCSService service was stopped successfully.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleOraDb10g_home1iSQL*Plus&lt;br /&gt;..&lt;br /&gt;The OracleOraDb10g_home1iSQL*Plus service was stopped successfully.&lt;br /&gt;&lt;br /&gt;4. Set the PERL5LIB and PATH environment variables to point to Perl in Oracle Home&lt;br /&gt;&lt;br /&gt;D:\&gt;set PERL5LIB=D:\oracle\product\10.1.0\db_1\perl\5.6.1\lib;%PERL5LIB%&lt;br /&gt;&lt;br /&gt;D:\&gt;set PATH=D:\oracle\product\10.1.0\db_1\perl\5.6.1\bin\MSWin32-x86;%PATH%&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5. set ORACLE_HOME variable&lt;br /&gt;&lt;br /&gt;D:\&gt;set ORACLE_HOME=D:\oracle\product\10.1.0\db_1&lt;br /&gt;&lt;br /&gt;6. Check if the java and jar executables are present in your Oracle Home&lt;br /&gt;&lt;br /&gt;--&gt;JAVA = %ORACLE_HOME%\jre\\bin&lt;br /&gt;--&gt;JAR = %ORACLE_HOME%\jdk\bin&lt;br /&gt;&lt;br /&gt;7. Go to directory where you downloaded the patch&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\OPatch&gt;opatch apply D:\5907304&lt;br /&gt;&lt;br /&gt;Post Installation Instructions&lt;br /&gt;&lt;br /&gt;1. Start All Oracle Services.&lt;br /&gt;&lt;br /&gt;D:\&gt;net start OracleServiceTEST&lt;br /&gt;&lt;br /&gt;D:\&gt;net start OracleServiceRCAT&lt;br /&gt;&lt;br /&gt;D:\&gt;set ORACLE_SID=TEST&lt;br /&gt;&lt;br /&gt;D:\&gt;emctl start dbconsole&lt;br /&gt;&lt;br /&gt;D:\&gt;LSNRCTL start&lt;br /&gt;&lt;br /&gt;D:\&gt;net start OracleCSService&lt;br /&gt;&lt;br /&gt;D:\&gt;net start OracleOraDb10g_home1iSQL*Plus&lt;br /&gt;&lt;br /&gt;2. For each database instance running out of the ORACLE_HOME being patched, connect to the database using SQL*Plus as SYSDBA and run catcpu.sql as follows:&lt;br /&gt;&lt;br /&gt;D:\&gt;rem go to CPU directory&lt;br /&gt;&lt;br /&gt;D:\&gt;CD D:\oracle\product\10.1.0\db_1\CPU\CPUApr2007&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\cpu\cpuapr2007&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.1.0.5.0 - Production on Fri Dec 14 14:31:43 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.&lt;br /&gt;SQL&gt; select instance_name from v$instance;&lt;br /&gt;&lt;br /&gt;INSTANCE_NAME&lt;br /&gt;----------------&lt;br /&gt;TEST&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; STARTUP MIGRATE&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 1023410176 bytes&lt;br /&gt;Fixed Size                   782304 bytes&lt;br /&gt;Variable Size              74190880 bytes&lt;br /&gt;Database Buffers          947912704 bytes&lt;br /&gt;Redo Buffers                 524288 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;&lt;br /&gt;SQL&gt; @CATCPU.SQL&lt;br /&gt;&lt;br /&gt;[output not attached]&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; quit&lt;br /&gt;&lt;br /&gt;If catcpu.sql reports any Invalid Objects, compile the invalid objects as follows&lt;br /&gt;&lt;br /&gt;D:\&gt;cd D:\oracle\product\10.1.0\db_1\rdbms\admin&lt;br /&gt;&lt;br /&gt;D:\oracle\product\10.1.0\Db_1\RDBMS\ADMIN&gt;sqlplus /nolog&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.1.0.5.0 - Production on Fri Dec 14 14:55:21 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&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 1023410176 bytes&lt;br /&gt;Fixed Size                   782304 bytes&lt;br /&gt;Variable Size              74190880 bytes&lt;br /&gt;Database Buffers          947912704 bytes&lt;br /&gt;Redo Buffers                 524288 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;&lt;br /&gt;SQL&gt; @utlprp.sql&lt;br /&gt;&lt;br /&gt;SQL&gt; select OBJECT_NAME from dba_objects where status = 'INVALID';&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;3. If any databases have been created without using DBCA (that is, using the command line), and you need to monitor such a database by using Oracle Enterprise Manager 10g, follow these steps:&lt;br /&gt;&lt;br /&gt;$ sqlplus SYS / AS SYSDBA&lt;br /&gt;SQL&gt; ALTER USER DBSNMP ACCOUNT UNLOCK&lt;br /&gt;SQL&gt; PASSWORD DBSNMP&lt;br /&gt;Changing password for DBSNMP&lt;br /&gt;New password: new_password&lt;br /&gt;Retype new password: new_password&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-575784203453459059?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/575784203453459059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=575784203453459059' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/575784203453459059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/575784203453459059'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/installing-april-2007-critical-patch.html' title='Installing the April 2007 Critical Patch Update on Windows'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2173469653607744013</id><published>2007-12-28T11:12:00.000+05:30</published><updated>2007-12-29T11:34:13.947+05:30</updated><title type='text'>Upgrade the Oracle database from 10.1.0.3.0 to 10.1.0.5.0</title><content type='html'>This article describes the process of upgrading the Oracle Database Server 10g Release &lt;span style="font-weight:bold;"&gt;10.1.0.3&lt;/span&gt; to Oracle Database 10g Release &lt;span style="font-weight:bold;"&gt;10.1.0.5&lt;/span&gt; on Windows XP SP2.&lt;br /&gt;&lt;br /&gt;1. Patch Set Overview&lt;br /&gt;&lt;br /&gt;You can apply the Oracle Database 10g release 10.1.0.5 patch set to the following Oracle Database 10g release 1 (10.1.0.2, 10.1.0.3, or 10.1.0.4) installations.&lt;br /&gt;&lt;br /&gt;2. Oracle Universal Installer Version Requirements&lt;br /&gt;&lt;br /&gt;This patch set includes Oracle Universal Installer release 10.1.0.5, which is also installed when you install this patch set.&lt;br /&gt;&lt;br /&gt;3. System Requirements&lt;br /&gt;&lt;br /&gt;Hardware requirement : Intel Pentium &lt;br /&gt;OS requirement : Windows XP Prof SP1 or later&lt;br /&gt;Oracle DB : 10gr1(10.1.0.2) or later&lt;br /&gt;&lt;br /&gt;4. Pre-installation Tasks&lt;br /&gt;&lt;br /&gt;1. Identify the Oracle Database Installation &lt;br /&gt;&lt;br /&gt;This is not a complete software distribution. You must install it in an existing Oracle Database 10g Oracle home. &lt;br /&gt;&lt;br /&gt;2. Download and extract the &lt;span style="font-weight:bold;"&gt;p4505133_10105_WINNT.zip&lt;/span&gt; patch set.&lt;br /&gt;&lt;br /&gt;3. Shut Down Oracle Databases &lt;br /&gt;&lt;br /&gt;D:\&gt;sqlplus sys@TEST/pwd as sysdba&lt;br /&gt;SQL&gt;shutdown immediate;&lt;br /&gt;&lt;br /&gt;D:\&gt;sqlplus sys@RCAT/pwd as sysdba&lt;br /&gt;SQL&gt;shutdown immediate;&lt;br /&gt;&lt;br /&gt;4. Stop All Services &lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleOraDb10g_home1iSQL*Plus&lt;br /&gt;..&lt;br /&gt;The OracleOraDb10g_home1iSQL*Plus service was stopped successfully.&lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleServiceTEST&lt;br /&gt;The following services are dependent on the OracleServiceTEST service.&lt;br /&gt;Stopping the OracleServiceTEST service will also stop these services.&lt;br /&gt;&lt;br /&gt;OracleDBConsoleTEST&lt;br /&gt;&lt;br /&gt;Do you want to continue this operation? (Y/N) [N]: Y&lt;br /&gt;The OracleDBConsoleTEST service is stopping....&lt;br /&gt;The OracleDBConsoleTEST service was stopped successfully.&lt;br /&gt;&lt;br /&gt;The OracleServiceTEST service is stopping.&lt;br /&gt;The OracleServiceTEST service was stopped successfully.&lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleServiceRCAT&lt;br /&gt;The OracleServiceRCAT service is stopping.......&lt;br /&gt;The OracleServiceRCAT service was stopped successfully.&lt;br /&gt;&lt;br /&gt;5. Stop the listener:&lt;br /&gt;&lt;br /&gt;D:\&gt;LSNRCTL stop&lt;br /&gt;&lt;br /&gt;LSNRCTL for 32-bit Windows: Version 10.1.0.3.0 - Production on 28-DEC-2007 11:05:13&lt;br /&gt;&lt;br /&gt;Copyright (c) 1991, 2004, Oracle.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))&lt;br /&gt;The command completed successfully&lt;br /&gt;&lt;br /&gt;D:\&gt;net stop OracleCSService&lt;br /&gt;&lt;br /&gt;The OracleCSService service was stopped successfully.&lt;br /&gt;&lt;br /&gt;6. Back up the SYSTEM.&lt;br /&gt;&lt;br /&gt;Installation Tasks&lt;br /&gt;&lt;br /&gt;1. Run SETUP.EXE from where you downloaded/extracted your patch.&lt;br /&gt;&lt;br /&gt;In the Name field in the Destination section, select the 10.1.0.x Oracle home that you want to update from the drop down list, then click Next. &lt;br /&gt;&lt;br /&gt;On the Summary screen, click Install.&lt;br /&gt;&lt;br /&gt;Upgrading Release 10.1 to Oracle Database 10g Release 1 (10.1.0.5)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1.Check SYSTEM TBS should have 10mb Free Space.&lt;br /&gt;2.SHARED_POOL_SIZE or JAVA_POOL_SIZE at least 150 MB.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter tablespace SYSTEM&lt;br /&gt;2 add datafile 'D:\oracle\product\10.1.0\oradata\TEST\system02.dbf' size 20m;&lt;br /&gt;&lt;br /&gt;Tablespace altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set SHARED_POOL_SIZE = 150M SCOPE=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set JAVA_POOL_SIZE = 150M SCOPE=spfile;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; SHUTDOWN&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; STARTUP UPGRADE&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 1023410176 bytes&lt;br /&gt;Fixed Size                   782304 bytes&lt;br /&gt;Variable Size              74190880 bytes&lt;br /&gt;Database Buffers          947912704 bytes&lt;br /&gt;Redo Buffers                 524288 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened. &lt;br /&gt;&lt;br /&gt;SQL&gt; SPOOL patch.log&lt;br /&gt;&lt;br /&gt;SQL&gt; @D:\oracle\product\10.1.0\db_1\rdbms\admin\catpatch.sql&lt;br /&gt;DOC&gt;######################################################################&lt;br /&gt;DOC&gt;######################################################################&lt;br /&gt;DOC&gt; The following PL/SQL block will cause an ORA-20000 error and&lt;br /&gt;DOC&gt; terminate the current SQLPLUS session if the user is not SYS.&lt;br /&gt;DOC&gt; Disconnect and reconnect with AS SYSDBA.&lt;br /&gt;DOC&gt;######################################################################&lt;br /&gt;DOC&gt;######################################################################&lt;br /&gt;DOC&gt;#&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;....&lt;br /&gt;[output not attached]&lt;br /&gt;&lt;br /&gt;SQL&gt; SPOOL OFF&lt;br /&gt;&lt;br /&gt;Restart the database&lt;br /&gt;&lt;br /&gt;SQL&gt;SHUTDOWN&lt;br /&gt;SQL&gt;STARTUP&lt;br /&gt;&lt;br /&gt;Run the utlrp.sql script to recompile all invalid PL/SQL packages&lt;br /&gt;&lt;br /&gt;SQL&gt; @D:\oracle\product\10.1.0\db_1\rdbms\admin\utlrp.sql&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$version;&lt;br /&gt;&lt;br /&gt;BANNER&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.1.0.5.0 - Prod&lt;br /&gt;PL/SQL Release 10.1.0.5.0 - Production&lt;br /&gt;CORE 10.1.0.5.0 Production&lt;br /&gt;TNS for 32-bit Windows: Version 10.1.0.5.0 - Production&lt;br /&gt;NLSRTL Version 10.1.0.5.0 - Production&lt;br /&gt;&lt;br /&gt;Known Issues&lt;br /&gt;&lt;br /&gt;select dbms_java.full_ncomp_enabled from dual&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-29558: JAccelerator (NCOMP) not installed. Refer to Install Guide for&lt;br /&gt;instructions.&lt;br /&gt;ORA-06512: at "SYS.DBMS_JAVA", line 236&lt;br /&gt;&lt;br /&gt;IGNORE&lt;br /&gt;---&gt; If you do not use Java in the database, then ignore this error message. &lt;br /&gt;&lt;br /&gt;Don't Ignore&lt;br /&gt;---&gt;If you use Java in the database, then install the NCOMP libraries by selecting the Oracle Database 10g Products installation type from the Oracle Database Companion CD.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;If RMAN CATALOG is also configure then upgrade RMAN CATALOG&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;D:\&gt;rman CATALOG=rman/cat@RCAT&lt;br /&gt;&lt;br /&gt;Recovery Manager: Release 10.1.0.5.0 - Production&lt;br /&gt;&lt;br /&gt;Copyright (c) 1995, 2004, Oracle. All rights reserved.&lt;br /&gt;&lt;br /&gt;connected to recovery catalog database&lt;br /&gt;&lt;br /&gt;RMAN&gt; UPGRADE CATALOG;&lt;br /&gt;&lt;br /&gt;recovery catalog owner is RMAN&lt;br /&gt;enter UPGRADE CATALOG command again to confirm catalog upgrade&lt;br /&gt;&lt;br /&gt;RMAN&gt; UPGRADE CATALOG;&lt;br /&gt;&lt;br /&gt;recovery catalog upgraded to version 10.01.00&lt;br /&gt;DBMS_RCVMAN package upgraded to version 10.01.00&lt;br /&gt;DBMS_RCVCAT package upgraded to version 10.01.00&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2173469653607744013?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2173469653607744013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2173469653607744013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2173469653607744013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2173469653607744013'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/upgrade-oracle-database-from-101030-to.html' title='Upgrade the Oracle database from 10.1.0.3.0 to 10.1.0.5.0'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4065035817936282425</id><published>2007-12-28T10:53:00.000+05:30</published><updated>2007-12-28T10:55:58.008+05:30</updated><title type='text'>Finding your OS and Database 32 bits or 64 bits</title><content type='html'>Want to know whether your Database / Operating System is running a 32-bit or 64-bit software?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DBAs often need to know if they should install Oracle 32-bit or 64-bit software on a given server. If the operating system support 64-bit applications, the 64-bit Oracle distribution can be loaded. Otherwise, the 32-bit distribution must be installed. The following Unix commands will tell you whether your OS is running 32-bits or 64-bits:&lt;br /&gt;&lt;br /&gt;Solaris - isainfo -v (this command doesn't exist on Solaris 2.6 because it is only 32-bits)&lt;br /&gt;&lt;br /&gt;HP-UX - getconf KERNEL_BITS&lt;br /&gt;&lt;br /&gt;AIX - bootinfo -K&lt;br /&gt;&lt;br /&gt;LINUX - uname -a&lt;br /&gt;&lt;br /&gt;If your Linux OS is 32 bit the output will be like below:&lt;br /&gt;&lt;br /&gt;Linux oraclesrvr 2.6.18-8.el5PAE #1 SMP Tue Jun 5 23:39:57 EDT 2007 i686 i686 i386 GNU/Linux&lt;br /&gt;&lt;br /&gt;If your Linux OS is 64 bit the output will be like below:&lt;br /&gt;&lt;br /&gt;Linux aptserver 2.6.18-8.el5xen #1 SMP Tue Jun 5 23:53:34 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux&lt;br /&gt;&lt;br /&gt;If you need to know Oracle 32-bit or 64-bit software is currently installed on a system, connect using a command line utility like sqlplus and look at the banner. If you are running 64-bit software, it will be mentioned in the banner. If nothing is listed, you are running on a 32-bit base.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If your Oracle Software is 64 bit the output will be like below:&lt;br /&gt;SQL&gt; select * from v$version;&lt;br /&gt;&lt;br /&gt;BANNER&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bi&lt;br /&gt;PL/SQL Release 10.1.0.3.0 - Production&lt;br /&gt;CORE    10.1.0.3.0      Production&lt;br /&gt;TNS for Linux: Version 10.1.0.3.0 - Production&lt;br /&gt;NLSRTL Version 10.1.0.3.0 - Production&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If your Oracle Software is 32 bit the output will be like below:&lt;br /&gt;SQL&gt; select * from v$version;&lt;br /&gt;&lt;br /&gt;BANNER&lt;br /&gt;----------------------------------------------------------------&lt;br /&gt;Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Prod&lt;br /&gt;PL/SQL Release 10.1.0.3.0 - Production&lt;br /&gt;CORE    10.1.0.3.0      Production&lt;br /&gt;TNS for Linux: Version 10.1.0.3.0 - Production&lt;br /&gt;NLSRTL Version 10.1.0.3.0 - Production&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4065035817936282425?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4065035817936282425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4065035817936282425' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4065035817936282425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4065035817936282425'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/finding-your-os-and-database-32-bits-or.html' title='Finding your OS and Database 32 bits or 64 bits'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8655407045563182196</id><published>2007-12-27T14:08:00.000+05:30</published><updated>2007-12-28T10:53:44.817+05:30</updated><title type='text'>Relocating Database Files</title><content type='html'>The CRD&amp;T files are called as Database Files:&lt;br /&gt;&lt;br /&gt;1. Control files&lt;br /&gt;2. Redo log files&lt;br /&gt;3. Datafiles &amp; Tempfiles&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;At some moments we need to move or relocate the Database files from original(old) location to new location.&lt;br /&gt;&lt;br /&gt;STEPS FOR RELOCATING THESE DATABASE FILES:&lt;br /&gt;&lt;br /&gt;I.How to move DATAFILES from old to new location(not SYSTEM,UNDO &amp; TEMP tablespaces'):&lt;br /&gt;&lt;br /&gt;Step 1: Take tablespace offline&lt;br /&gt;SQL&gt; alter tablespace tbsname OFFLINE;&lt;br /&gt;&lt;br /&gt;Step 2:Use OS level command to MOVE datafiles from old to new location.&lt;br /&gt;$ mv 'old location' to 'new location'&lt;br /&gt;&lt;br /&gt;Step 3: Rename datafiles in database.&lt;br /&gt;SQL&gt; alter database rename file 'old location' to 'new location';&lt;br /&gt;&lt;br /&gt;Step 4: Take tablespace ONLINE&lt;br /&gt;SQL&gt; alter tablespace tbsname ONLINE;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;II.For SYSTEM or UNDO tablespace:&lt;br /&gt;&lt;br /&gt;Step 1: Shutdown database&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;&lt;br /&gt;Step 2: Move datafiles from old to new location using OS command.&lt;br /&gt;$ mv 'old location' 'new location'&lt;br /&gt;&lt;br /&gt;Step 3: Startup database in mount stage.&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;&lt;br /&gt;Step 4: Rename the datafile &lt;br /&gt;SQL&gt; alter database rename file 'old location' to 'new location';&lt;br /&gt;&lt;br /&gt;Step 5: Open the database for normal use&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;III.How to move control file from old to new location:&lt;br /&gt;&lt;br /&gt;Step 1:  Shutdown the Database&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;&lt;br /&gt;Step 2: Move controlfile from old to new location&lt;br /&gt;$ mv old location new location&lt;br /&gt;&lt;br /&gt;Step 3: Edit CONTROL_FILES parameter in pfile and change location from old to new&lt;br /&gt;CONTROL_FILES='new location'&lt;br /&gt;&lt;br /&gt;Step 4: recreate SPFILE from PFILE&lt;br /&gt;SQL&gt; create spfile from pfile;&lt;br /&gt;&lt;br /&gt;Step 5: startup database&lt;br /&gt;SQL&gt; startup;&lt;br /&gt;&lt;br /&gt;IV.How to move REDO LOG MEMBER from old to new location&lt;br /&gt;&lt;br /&gt;Step 1: shutdown database&lt;br /&gt;SQL&gt; shutdown immediate;&lt;br /&gt;&lt;br /&gt;Step 2: Move redo log member from old to new location&lt;br /&gt;$ mv oldlocation newlocation&lt;br /&gt;&lt;br /&gt;Step 3: startup database with mount stage&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;&lt;br /&gt;Step 4: rename redo log member in database&lt;br /&gt;SQL&gt; alter database rename file 'old location' to 'new location';&lt;br /&gt;&lt;br /&gt;Step 5: open database for normal use&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;V. We cannot relocate the tempfile, if we need to relocate it(tempfile) then the best option is to recreate the temp tablespace in the new location.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8655407045563182196?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8655407045563182196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8655407045563182196' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8655407045563182196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8655407045563182196'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/relocating-database-files.html' title='Relocating Database Files'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4667531554782789552</id><published>2007-12-12T15:05:00.000+05:30</published><updated>2007-12-12T15:23:15.807+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='FTP'/><title type='text'>Simple FTP setup in Linux</title><content type='html'>By default FTP comes disabled on stock &lt;span style="font-weight:bold;"&gt;RedHat/Oracle Enterprise/Centos&lt;/span&gt; server installs. In some occasions I find the need to enable FTP. &lt;br /&gt;&lt;br /&gt;Below I will show you how to do it:&lt;br /&gt;Become the root user on your server. &lt;br /&gt;Change to the &lt;span style="font-weight:bold;"&gt;/etc/xinetd.d&lt;/span&gt; directory&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;cd /etc/xinetd.d/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Edit the gssftp file &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;vi gssftp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Change the line that says &lt;span style="font-weight:bold;"&gt;disable = yes to disable = no&lt;/span&gt;. Also &lt;span style="font-weight:bold;"&gt;remove the –a&lt;/span&gt; option in the server_args line.&lt;br /&gt;&lt;br /&gt;Your config file &lt;span style="font-weight:bold;"&gt;should now look like&lt;/span&gt; the one below. Save the file and exit vi.&lt;br /&gt; &lt;br /&gt;service ftp&lt;br /&gt;{&lt;br /&gt;        flags           = REUSE&lt;br /&gt;        socket_type     = stream&lt;br /&gt;        wait            = no&lt;br /&gt;        user            = root&lt;br /&gt;        server          = /usr/kerberos/sbin/ftpd&lt;br /&gt;        server_args     = -l&lt;br /&gt;        log_on_failure  += USERID&lt;br /&gt;        disable         = no&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight:bold;"&gt;-a option&lt;/span&gt; removes the following restriction, as described in the man ftpd page.&lt;br /&gt;-a&lt;br /&gt;Connections are only allowed for users who can authenticate (via the ftp AUTH mechanism) and who are authorized to connect to the named account without a password. (Anonymous  ftp  may  also be allowed if it is configured.)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Restart&lt;/span&gt; the xinetd daemon. &lt;br /&gt;&lt;span style="font-weight:bold;"&gt;/etc/init.d/xinetd restart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You should now be able to FTP to your server. &lt;br /&gt;&lt;br /&gt;That’s it, you’re FTP service is now enabled. Now let me explain when I actually use&lt;br /&gt;FTP. Sometimes I will transfer very large files or amounts of data between my servers (many gigabytes worth). I will enable FTP temporarily to do this since FTP can do these transfers a little more quickly than SFTP because it doesn’t have as&lt;br /&gt;much overhead. After I’m done with the transfer, I then disable FTP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;EXAMPLES&lt;/span&gt; &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp rmsi.oracle.com&lt;/span&gt;&lt;br /&gt;This command will attempt to connect to the ftp server at rmsi.oracle.com. If it succeeds, it will ask you to log in using a username and password. Public ftp servers often allow you to log in using the username "anonymous" and your email address as password. Once you are logged in you can get a list of the available ftp commands using the help function: &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; help&lt;/span&gt;&lt;br /&gt;This lists the commands that you can use to show the directory contents, transfer files, and delete files. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; ls&lt;/span&gt;&lt;br /&gt;This command prints the names of the files and subdirectories in the current directory on the remote computer. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; cd customers&lt;/span&gt;&lt;br /&gt;This command changes the current directory to the subdirecotry "customers", if it exists. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; cd ..&lt;/span&gt;&lt;br /&gt;Changes the current directory to the parent direcotry. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; lcd images&lt;/span&gt;&lt;br /&gt;Changes the current directory on the local computer to "images", if it exists. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; ascii&lt;/span&gt;&lt;br /&gt;Changes to "ascii" mode for transferring text files. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; binary&lt;/span&gt;&lt;br /&gt;Changes to "binary" mode for transferring all files that are not text files. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; get image1.jpg&lt;/span&gt;&lt;br /&gt;Downloads the file image1.jpg from the remote computer to the local computer. Warning: If there already is file with the same name it will be overwritten. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; put image2.jpg&lt;/span&gt;&lt;br /&gt;Uploads the file image2.jpg from the local computer to the remote computer. Warning: If there already is file with the same name it will be overwritten. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; !ls&lt;/span&gt;&lt;br /&gt;A '!' in front will execute the specified command on the local computer. So '!ls' lists the file names and directory names of the current directory on the local computer. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; mget *.jpg&lt;/span&gt;&lt;br /&gt;With mget you can download multiple images. This command downloads all files that end with ".jgp". &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; mput *.jpg&lt;/span&gt;&lt;br /&gt;Uploads all files that end with ".jgp". &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; mdelete *.jpg&lt;/span&gt;&lt;br /&gt;Deletes all files that end with ".jgp". &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; prompt&lt;/span&gt;&lt;br /&gt;Turns iteractive mode on or off so that commands on multiple files are executed without user confirmation. &lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight:bold;"&gt;ftp&gt; quit&lt;/span&gt;&lt;br /&gt;Exits the ftp program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4667531554782789552?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4667531554782789552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4667531554782789552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4667531554782789552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4667531554782789552'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/12/simple-ftp-setup-in-linux.html' title='Simple FTP setup in Linux'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-1435098862738608874</id><published>2007-11-06T12:28:00.000+05:30</published><updated>2007-11-06T12:47:38.087+05:30</updated><title type='text'>Changing the current Database Name and DB ID</title><content type='html'>CHANGING DBNAME &amp; DBID&lt;br /&gt;-----------------------&lt;br /&gt;&lt;br /&gt;SQL&gt;SHUTDOWN IMMEDIATE&lt;br /&gt;SQL&gt;STARTUP MOUNT&lt;br /&gt;&lt;br /&gt;$nid TARGET=sys/sys@swdm DBNAME=swm&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Change database ID and database name SWDM to SWM? (Y/[N]) =&gt; Y&lt;br /&gt;&lt;br /&gt;SQL&gt;SHUTDOWN IMMEDIATE&lt;br /&gt;&lt;br /&gt;Modify the DB_NAME parameter in the initialization parameter file. The startup will result in an error but proceed anyway.&lt;br /&gt;&lt;br /&gt;SQL&gt;STARTUP MOUNT&lt;br /&gt;SQL&gt;ALTER SYSTEM SET DB_NAME=SWM SCOPE=SPFILE;&lt;br /&gt;SQL&gt;SHUTDOWN IMMEDIATE&lt;br /&gt;&lt;br /&gt;Create a new password file:&lt;br /&gt;&lt;br /&gt;$cd /u01/app/oracle/product/10.1.0/db_1/dbs/&lt;br /&gt;&lt;br /&gt;$orapwd file=/u01/app/oracle/product/10.1.0/db_1/dbs/orapw password=sys entries=10&lt;br /&gt;&lt;br /&gt;If you are using UNIX/Linux simply reset the ORACLE_SID environment variable:&lt;br /&gt;&lt;br /&gt;$ORACLE_SID=SWM; export ORACLE_SID&lt;br /&gt;&lt;br /&gt;Rename the SPFILE to match the new DBNAME.&lt;br /&gt;&lt;br /&gt;If you are using Windows you must recreate the service so the correct name and parameter file are used:&lt;br /&gt;&lt;br /&gt;oradim -delete -sid SWDM&lt;br /&gt;oradim -new -sid SWM -intpwd password -startmode a -pfile c:\oracle\920\database\spfileSWM.ora&lt;br /&gt;&lt;br /&gt;Alter the listener.ora and tnsnames.ora setting to match the new database name and restart the listener:&lt;br /&gt;&lt;br /&gt;$lsnrctl reload&lt;br /&gt;&lt;br /&gt;Open the database with RESETLOGS:&lt;br /&gt;&lt;br /&gt;SQL&gt;STARTUP MOUNT&lt;br /&gt;SQL&gt;ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;&lt;br /&gt;Backup the database.&lt;br /&gt;&lt;br /&gt;==========================================================================&lt;br /&gt;CHANGING DBNAME Only&lt;br /&gt;---------------------&lt;br /&gt;&lt;br /&gt;Repeat the process as before except use the following command to start the DBNEWID utility:&lt;br /&gt;&lt;br /&gt;$nid TARGET=sys/sys@SWDM DBNAME=swm SETNAME=YES&lt;br /&gt;&lt;br /&gt;SQL&gt;SHUTDOWN IMMEDIATE;&lt;br /&gt;SQL&gt;STARTUP MOUNT;&lt;br /&gt;SQL&gt;ALTER SYSTEM SET DB_NAME=SWM SCOPE=spfile;&lt;br /&gt;SQL&gt;SHUDOWN IMMEDIATE;&lt;br /&gt;&lt;br /&gt;On Windows:&lt;br /&gt;C:\&gt; orapwd file= C:\oracle\product\10.1.0\db_1\database\pwdSWM.ora password=xxxxxxx entries=10&lt;br /&gt;&lt;br /&gt;On Unix:&lt;br /&gt;$ orapwd file=/u01/app/oracle/product/10.1.0/db_1/dbs/orapw password=sys entries=10&lt;br /&gt;&lt;br /&gt;SQL&gt;STARTUP;&lt;br /&gt;SQL&gt;SHOW PARAMETER DB_NAME&lt;br /&gt;&lt;br /&gt;We have changed only the database name, The SETNAME parameter tells the DBNEWID utility to only alter the database name. and &lt;br /&gt;&lt;br /&gt;not the database ID, it is not necessary to use the RESETLOGS option when you open the database&lt;br /&gt;&lt;br /&gt;Backup the database.&lt;br /&gt;===========================================================================&lt;br /&gt;&lt;br /&gt;CHANGING DBID Only&lt;br /&gt;-------------------&lt;br /&gt;Backup the database.&lt;br /&gt;Mount the database after a clean shutdown:&lt;br /&gt;&lt;br /&gt;SQL&gt;SHUTDOWN IMMEDIATE&lt;br /&gt;SQL&gt;STARTUP MOUNT&lt;br /&gt;&lt;br /&gt;Invoke the DBNEWID utility (nid) from the command line using a user with SYSDBA privilege. Do not specify a new DBNAME:&lt;br /&gt;&lt;br /&gt;$nid TARGET=sys/password@SWDM&lt;br /&gt;&lt;br /&gt;Shutdown and open the database with RESETLOGS:&lt;br /&gt;&lt;br /&gt;SQL&gt;SHUTDOWN IMMEDIATE&lt;br /&gt;SQL&gt;STARTUP MOUNT&lt;br /&gt;SQL&gt;ALTER DATABASE OPEN RESETLOGS;&lt;br /&gt;&lt;br /&gt;Backup the database.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-1435098862738608874?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/1435098862738608874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=1435098862738608874' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1435098862738608874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1435098862738608874'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/11/changing-current-database-name-and-db.html' title='Changing the current Database Name and DB ID'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-931097880205287906</id><published>2007-11-05T11:07:00.000+05:30</published><updated>2007-11-05T11:09:19.165+05:30</updated><title type='text'>Resize undo tablespace</title><content type='html'>You created undo tablespace using AUTOEXTEND ON MAXSIZE UNLIMITED to avoid error.&lt;br /&gt;&lt;br /&gt;Your have just done purging (deleting millions of rows) on your production database and you noticed that your undo tablespace datafile is huge in size.&lt;br /&gt;&lt;br /&gt;You tried to use “ALTER DATABASE DATAFILE .. RESIZE”, and this command failed with ORA-3297 error. , i.e.: “file contains ~~ blocks of data beyond requested RESIZE value”.&lt;br /&gt;&lt;br /&gt;So you should drop and recreate undo tablespace using the following commands:&lt;br /&gt;&lt;br /&gt;1, Connect to Oracle&lt;br /&gt;&lt;br /&gt;    sqlplus /nolog&lt;br /&gt;    connect / as sysdba&lt;br /&gt;&lt;br /&gt;2, Find out which undo tablespace is being used:&lt;br /&gt;&lt;br /&gt;    SQL&gt;select name,value from v$parameter where name in ('undo_management','undo_tablespace');&lt;br /&gt;&lt;br /&gt;    NAME VALUE&lt;br /&gt;    ——————- ——————-&lt;br /&gt;    undo_management AUTO&lt;br /&gt;    undo_tablespace UNDOTBS1&lt;br /&gt;&lt;br /&gt;3, Create new undo tablespace UNDOTBS2 with smaller size.&lt;br /&gt;&lt;br /&gt;    SQL&gt; create undo tablespace UNDOTBS2 datafile '/u01/app/oracle/oradata/edr/undotbs02.dbf' size 500m reuse;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4, Tell Oracle to use new undo tablespace.&lt;br /&gt;&lt;br /&gt;    SQL&gt; alter system set undo_tablespace=UNDOTBS2;&lt;br /&gt;&lt;br /&gt;5, Now you can safely drop and recreate tablespace UNDOTBS1.&lt;br /&gt;&lt;br /&gt;    SQL&gt; drop tablespace UNDOTBS1 including contents and datafiles;&lt;br /&gt;&lt;br /&gt;    Tablespace dropped.&lt;br /&gt;&lt;br /&gt;6,  SQL&gt; CREATE UNDO TABLESPACE UNDOTBS1 DATAFILE '/u01/app/oracle/oradata/edr/undotbs01.dbf' SIZE 250m reuse AUTOEXTEND ON ;&lt;br /&gt;&lt;br /&gt;    Tablespace created.&lt;br /&gt;&lt;br /&gt;7,  SQL&gt; alter system set undo_tablespace=UNDOTBS1;&lt;br /&gt;&lt;br /&gt;8, Now you can safely drop tablespace UNDOTBS2.&lt;br /&gt;&lt;br /&gt;    SQL&gt; drop tablespace UNDOTBS2 including contents and datafiles;&lt;br /&gt;&lt;br /&gt;    Tablespace dropped.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-931097880205287906?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/931097880205287906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=931097880205287906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/931097880205287906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/931097880205287906'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/11/resize-undo-tablespace.html' title='Resize undo tablespace'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4106628421584895664</id><published>2007-11-05T11:05:00.000+05:30</published><updated>2007-11-05T11:07:06.647+05:30</updated><title type='text'>Recreate Temp tablespace</title><content type='html'>You created temp tablespace using AUTOEXTEND ON MAXSIZE UNLIMITED to avoid error.&lt;br /&gt;On your production database you noticed that your temp tablespace datafile is huge in size. So you should drop and recreate temp tablespace using the following commands,&lt;br /&gt;&lt;br /&gt;CREATE TEMPORARY TABLESPACE temp2&lt;br /&gt; TEMPFILE '/u01/app/oracle/oradata/edr/temp02.dbf' SIZE 5M REUSE&lt;br /&gt; AUTOEXTEND ON NEXT 1M MAXSIZE unlimited&lt;br /&gt; EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;&lt;br /&gt;&lt;br /&gt;ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp2;&lt;br /&gt;&lt;br /&gt;DROP TABLESPACE temp INCLUDING CONTENTS AND DATAFILES;&lt;br /&gt;------------------------------------------------------------------------------------------&lt;br /&gt;CREATE TEMPORARY TABLESPACE temp&lt;br /&gt; TEMPFILE '/u01/app/oracle/oradata/edr/temp01.dbf' SIZE 500M REUSE&lt;br /&gt; AUTOEXTEND ON NEXT 100M MAXSIZE unlimited&lt;br /&gt; EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1M;&lt;br /&gt;------------------------------------------------------------------------------------------&lt;br /&gt;ALTER DATABASE DEFAULT TEMPORARY TABLESPACE temp;&lt;br /&gt;&lt;br /&gt;DROP TABLESPACE temp2 INCLUDING CONTENTS AND DATAFILES;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4106628421584895664?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4106628421584895664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4106628421584895664' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4106628421584895664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4106628421584895664'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/11/recreate-temp-tablespace.html' title='Recreate Temp tablespace'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-7755482843091956241</id><published>2007-10-04T17:46:00.000+05:30</published><updated>2007-10-15T10:57:59.364+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Installation of Oracle 10G on Solaris'/><title type='text'>Installation of Oracle 10G on Solaris 10 -- Short</title><content type='html'>As the root user,&lt;br /&gt;#groupadd oinstall&lt;br /&gt;#groupadd dba&lt;br /&gt;#useradd -d /oracle -g oinstall -G dba -m -s /bin/ksh oracle&lt;br /&gt;#passwd -r files oracle&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;Edit the /oracle/.profile file and add lines&lt;br /&gt;&lt;br /&gt;umask 022&lt;br /&gt;TMP=/tmp&lt;br /&gt;TMPDIR=$TMP&lt;br /&gt;DISPLAY=localhost:0.0&lt;br /&gt;export TMP TMPDIR DISPLAY&lt;br /&gt;ORACLE_BASE=/u01/app/oracle&lt;br /&gt;ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1&lt;br /&gt;ORACLE_SID=sol10&lt;br /&gt;PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;export ORACLE_BASE ORACLE_HOME ORACLE_SID PATH&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;save and check&lt;br /&gt;# su - oracle&lt;br /&gt;Sun Microsystems Inc. SunOS 5.10 Generic January 2005&lt;br /&gt;$ env&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;As the root user,&lt;br /&gt;#mkdir /u01/app/oracle&lt;br /&gt;#mkdir /u01/app/oracle/product/10.1.0/db_1&lt;br /&gt;#chown -R oracle:oinstall /oracle&lt;br /&gt;#chmod -R 775 /oracle&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;$gunzip solarisx86_DB_10_1_0_3_Disk1.cpio.gz&lt;br /&gt;$cpio -idm &lt; solarisx86_DB_10_1_0_3_Disk1.cpio&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;edit the /etc/user_attr file and add&lt;br /&gt;oracle::::project=oracle&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;save and check&lt;br /&gt;# su - oracle&lt;br /&gt;Sun Microsystems Inc. SunOS 5.10 Generic January 2005&lt;br /&gt;$ id -p&lt;br /&gt;$ prctl -n project.max-shm-memory -i project oracle&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;new terminal session as root&lt;br /&gt;#prctl -n project.max-shm-memory -v 4gb -r -i project oracle&lt;br /&gt;oracle user's session&lt;br /&gt;$ prctl -n project.max-shm-memory -i project oracle&lt;br /&gt;root user's session&lt;br /&gt;#projmod -s -K "project.max-shm-memory=(priv,4gb,deny)" oracle&lt;br /&gt;---------------------------------------------------------------------------&lt;br /&gt;#xhost +&lt;br /&gt;#su - oracle&lt;br /&gt;$/Disk1/runInstaller -ignoreSysPrereqs&lt;br /&gt;......&lt;br /&gt;......&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-7755482843091956241?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/7755482843091956241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=7755482843091956241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7755482843091956241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7755482843091956241'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/10/oracle-on-solaris-installation-short.html' title='Installation of Oracle 10G on Solaris 10 -- Short'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8980261605027380826</id><published>2007-09-13T17:02:00.000+05:30</published><updated>2007-12-21T15:16:46.061+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Oracle Installation(9.2.0.1.0) on Red Hat Enterprise Linux 3 and upgrading to 9.2.0.4</title><content type='html'>In order to install an Oracle9iR2 database on RHEL 3, the "Oracle9iR2 Patch Set 3 9.2.0.4.0" patchset and some other patches must be applied. Some errors can only be fixed by applying the 9.2.0.4 patchset. &lt;br /&gt;Patches required: &lt;br /&gt;p3006854_9204_LINUX.zip&lt;br /&gt;p3095277_9204_LINUX.zip&lt;br /&gt;p3119415_9204_LINUX.zip&lt;br /&gt;&lt;br /&gt;1. Install/Check the following RPMs (see Oracle Note:252217.1 for more information): &lt;br /&gt;su - root&lt;br /&gt;rpm -q patch name--&gt;To check&lt;br /&gt;&lt;br /&gt;rpm -ivh \&lt;br /&gt;compat-db-4.0.14-5.i386.rpm \&lt;br /&gt;compat-gcc-7.3-2.96.122.i386.rpm \&lt;br /&gt;compat-gcc-c++-7.3-2.96.122.i386.rpm \&lt;br /&gt;compat-libstdc++-7.3-2.96.122.i386.rpm \&lt;br /&gt;compat-libstdc++-devel-7.3-2.96.122.i386.rpm \&lt;br /&gt;openmotif21-2.1.30-8.i386.rpm \&lt;br /&gt;setarch-1.3-1.i386.rpm \&lt;br /&gt;tcl-8.3.5-92.i386.rpm&lt;br /&gt;&lt;br /&gt;2. Open a terminal window and log in as the root user.&lt;br /&gt;&lt;br /&gt;3. The following local UNIX groups and user must exist on the system:&lt;br /&gt;&lt;br /&gt; Groups: oinstall and dba&lt;br /&gt; User: oracle&lt;br /&gt;&lt;br /&gt;Now create the two groups oinstall, dba&lt;br /&gt;&lt;br /&gt;#groupadd oinstall&lt;br /&gt;#groupadd dba&lt;br /&gt;&lt;br /&gt;Create the operating system user oracle:&lt;br /&gt;&lt;br /&gt;#useradd -g oinstall -G dba oracle&lt;br /&gt;&lt;br /&gt;Enter the following command to set the password of the oracle user:&lt;br /&gt;&lt;br /&gt;#passwd oracle&lt;br /&gt;&lt;br /&gt;4. Create the directory for the software installation and assign ownership to oracle:oinstall. In the example, you use /u01/app/oracle.&lt;br /&gt;&lt;br /&gt;mkdir -p /u01/app/oracle&lt;br /&gt;chown -R oracle:oinstall /u01/app&lt;br /&gt;chmod -R 775 /u01/app&lt;br /&gt; &lt;br /&gt;5. With an editor of your choosing, open /home/oracle/.bash_profile and add the entries to the appropriate file.&lt;br /&gt;&lt;br /&gt;umask 022&lt;br /&gt;PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin&lt;br /&gt;LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib&lt;br /&gt;ORACLE_BASE=/u01/app/oracle/&lt;br /&gt;ORACLE_HOME=/u01/app/oracle/product/9.2.0.1.0&lt;br /&gt;&lt;br /&gt;#PATH=/u01/app/oracle/product/9.2.0.1.0/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin&lt;br /&gt;export PATH&lt;br /&gt;ORACLE_OWNER=oracle&lt;br /&gt;&lt;br /&gt;ORACLE_SID=sid&lt;br /&gt;ORACLE_SID=orcl&lt;br /&gt;PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;export ORACLE_BASE ORACLE_HOME ORACLE_OWNER ORACLE_SID&lt;br /&gt;export PATH LD_LIBRARY_PATH&lt;br /&gt;CLASSPATH=:/u01/app/oracle/product/9.2.0.1.0/JRE:/u01/app/oracle/product/9.2.0.1.0/jlib:/u01/app/oracle/product/9.2.0.1.0/rdbms/jlib:/u01/app/oracle/product/9.2.0.1.0/network/jlib&lt;br /&gt;export CLASSPATH&lt;br /&gt;LD_ASSUME_KERNEL=2.4.1&lt;br /&gt;export LD_ASSUME_KERNEL&lt;br /&gt;&lt;br /&gt;if [ $USER = "oracle" ]; then&lt;br /&gt;        if [ $SHELL = "/bin/ksh" ]; then&lt;br /&gt;              ulimit -p 16384&lt;br /&gt;              ulimit -n 65536&lt;br /&gt;        else&lt;br /&gt;              ulimit -u 16384 -n 65536&lt;br /&gt;        fi&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;6. Configuring Kernel Parameters&lt;br /&gt;&lt;br /&gt;See my previous post for the kernel configuration settings.&lt;br /&gt;&lt;a href="http://oracle-core.blogspot.com/2007/08/configuration-of-kernel-parameters.html"&gt;Kernel Settings&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;---------&lt;br /&gt;&lt;br /&gt;7. If now you execute runInstaller from the Oracle 9iR2 (9.2.0) CD, you will get the following error message: &lt;br /&gt;&lt;br /&gt;Error occurred during initialization of VM&lt;br /&gt;Unable to load native library: /tmp/OraInstall2007-8-25_03-14-57PM/jre/lib/i386/libjava.so:&lt;br /&gt;    symbol __libc_wait, version GLIBC_2.0 not defined in file libc.so.6 with link time reference&lt;br /&gt;&lt;br /&gt;To resolve the __libc_wait symbol issue, download the p3006854_9204 patch p3006854_9204_LINUX.zip from http://metalink.oracle.com.&lt;br /&gt;&lt;br /&gt;To apply the patch, run &lt;br /&gt;su - root&lt;br /&gt;# unzip p3006854_9204_LINUX.zip&lt;br /&gt;Archive:  p3006854_9204_LINUX.zip&lt;br /&gt;   creating: 3006854/&lt;br /&gt;  inflating: 3006854/rhel3_pre_install.sh&lt;br /&gt;  inflating: 3006854/README.txt&lt;br /&gt;&lt;br /&gt;# cd 3006854&lt;br /&gt;# sh rhel3_pre_install.sh&lt;br /&gt;Applying patch...&lt;br /&gt;Patch successfully applied&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;Now runInstaller can be started from the CD: &lt;br /&gt;su - oracle&lt;br /&gt;$ echo $LD_ASSUME_KERNEL    # it is important that this variable is set!&lt;br /&gt;2.4.1&lt;br /&gt;$ /mnt/cdrom/runInstaller&lt;br /&gt;&lt;br /&gt;You may get the following errors:&lt;br /&gt;&lt;br /&gt;Error in invoking target install of makefile /u01/app/oracle/product/9.2.0/network/lib/ins_oemagent.mk. &lt;br /&gt;&lt;br /&gt;Click ignore. &lt;br /&gt;This will be fixed by applying the patch 3119415 after the 9.2.0.4 patchset has been applied.&lt;br /&gt;You won't be able to apply the patch 3119415 at this time since the file /u01/app/oracle/oraInventory/ContentsXML/comps.xml doesn't exist yet. &lt;br /&gt;&lt;br /&gt;Error in invoking target install of makefile /u01/app/oracle/product/9.2.0/ctx/lib/ins_ctx.mk. &lt;br /&gt;&lt;br /&gt;Click ignore. &lt;br /&gt;This is fixed by applying the 9.2.0.4 patchset. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Patching Oracle9iR2 on RH AS 3&lt;br /&gt;&lt;br /&gt;To patch Oracle9iR2, download the Oracle 9i Release 2 Patch Set 3 Version 9.2.0.4.0 for Linux x86 from http://metalink.oracle.com. &lt;br /&gt;&lt;br /&gt;Copy the downloaded "p3095277_9204_LINUX.zip" file to e.g. /tmp and run the following command: &lt;br /&gt;su - oracle&lt;br /&gt;$ cp p3095277_9204_LINUX.zip /tmp&lt;br /&gt;$ cd /tmp&lt;br /&gt;$ unzip p3095277_9204_LINUX.zip&lt;br /&gt;Archive:  p3095277_9204_LINUX.zip&lt;br /&gt;  inflating: 9204_lnx32_release.cpio&lt;br /&gt;  inflating: README.html&lt;br /&gt;  inflating: patchnote.css&lt;br /&gt;$&lt;br /&gt;$ cpio -idmv &lt; 9204_lnx32_release.cpio&lt;br /&gt;Disk1/stage/locks&lt;br /&gt;Disk1/stage/Patches/oracle.apache.isqlplus/9.2.0.4.0/1/DataFiles/bin.1.1.jar&lt;br /&gt;Disk1/stage/Patches/oracle.apache.isqlplus/9.2.0.4.0/1/DataFiles/lib.1.1.jar&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;To patch the runInstaller, run: &lt;br /&gt;su - oracle&lt;br /&gt;$ echo $LD_ASSUME_KERNEL    # it is important that this variable is set!&lt;br /&gt;2.4.1&lt;br /&gt;$ cd /tmp/Disk1/&lt;br /&gt;$ ./runInstaller&lt;br /&gt;&lt;br /&gt; - Welcome Screen:       Click Next&lt;br /&gt; - File Locations:       Use default values&lt;br /&gt; - Available Products:   Select "Oracle Universial Installer 2.2.0.18.0 !"&lt;br /&gt; - Components Locations: Accept default values and click Next&lt;br /&gt; - Summary:              Start the Install&lt;br /&gt; - At the end of the installation, you must exit runInstaller!&lt;br /&gt;&lt;br /&gt;To patch Oracle9iR2, run: &lt;br /&gt;su - oracle&lt;br /&gt;$ echo $LD_ASSUME_KERNEL    # it is important that this variable is set!&lt;br /&gt;2.4.1&lt;br /&gt;$ cd $ORACLE_HOME/bin&lt;br /&gt;$ ./runInstaller&lt;br /&gt;&lt;br /&gt; - Welcome Screen:       Click Next&lt;br /&gt; - File Locations:       Use default values&lt;br /&gt; - Available Products:   Select "Oracle9iR2 Patch Set 3 9.2.0.4.0 !"&lt;br /&gt; - Summary:              Start the Install&lt;br /&gt; - At the end of the installation, exit runInstaller&lt;br /&gt;&lt;br /&gt;You may get the following error:&lt;br /&gt;&lt;br /&gt;Error in invoking target install of makefile /u01/app/oracle/product/9.2.0/network/lib/ins_oemagent.mk. &lt;br /&gt;&lt;br /&gt;Click ignore.&lt;br /&gt;This will be fixed by applying the patch 3119415 after the 9.2.0.4 patchset has been applied. &lt;br /&gt;The patch 3119415 cannot be applied while the patch process for the 9.2.0.4 patchset is running. &lt;br /&gt;&lt;br /&gt;After the 9.2.0.4 patchset has been applied, download the patch p3119415_9204_LINUX.zip. Also, download the opatch Release 2.2.0 utility from http://metalink.oracle.com. &lt;br /&gt;&lt;br /&gt;To install opatch, run: &lt;br /&gt;su - oracle&lt;br /&gt;$ cp p2617419_210_GENERIC.zip /tmp&lt;br /&gt;$ cd /tmp&lt;br /&gt;$ unzip p2617419_210_GENERIC.zip&lt;br /&gt;Before you apply the 3119415 patch, you need to make sure the fuser binary can be found by the oracle user, see the PATH environment variable below. Otherwise the patch can't be applied because the fuser binary is used by opatch. &lt;br /&gt;&lt;br /&gt;To apply the 3119415 patch, run &lt;br /&gt;su - oracle&lt;br /&gt;$ unzip p3119415_9204_LINUX.zip&lt;br /&gt;$ cd 3119415&lt;br /&gt;$ export PATH=$PATH:/tmp/OPatch&lt;br /&gt;$ export PATH=$PATH:/sbin        # the patch needs "fuser" which is located in /sbin&lt;br /&gt;$ which opatch&lt;br /&gt;/tmp/OPatch/opatch&lt;br /&gt;$ opatch apply&lt;br /&gt;&lt;br /&gt;Installation of 9iR2 with all required patches is completed succesfully.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8980261605027380826?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8980261605027380826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8980261605027380826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8980261605027380826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8980261605027380826'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/09/oracle-installation92010-on-red-hat.html' title='Oracle Installation(9.2.0.1.0) on Red Hat Enterprise Linux 3 and upgrading to 9.2.0.4'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6111102361129489135</id><published>2007-08-28T10:28:00.000+05:30</published><updated>2007-10-15T10:59:11.988+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Upgradation'/><title type='text'>Upgrading 9iR2 to 10gR2 using hotbackup</title><content type='html'>&lt;strong&gt;Upgrading 9iR2 to 10gR2 using hotbackup &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Abstract&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The document is aimed at describing the step by step procedure that was followed to upgrade a database from Oracle 9iR2 to 10gR2 using hot backup of 9iR2 database. The basis of this upgrade is a hot backup clone.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Case History&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The database to be upgraded is about 185GB in size, this activity was tested on a development system to validate the success of this exercise before proceeding with the production environment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Analysis&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Summary&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;A hot backup was used to create a database on 10gR2 by recreating the controlfile.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Detailed Analysis&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;1. A password file was initially created in $ORACLE_HOME/dbs of 10gR2 for this particular instance using the orapwd utility. The pfile from the 9i database was used to start the instance by just changing the compatible parameter to 10.2.0 and no other changes were made to the init.ora file since all the deprecated and obsolete parameters will be listed in the alert log once the database is brought up which can be removed later. The instance was now started.&lt;br /&gt;&lt;br /&gt;SQL&gt; startup nomount&lt;br /&gt;&lt;br /&gt;This step can also be executed as shown below, which is an observation from the alert log when the database failed to open with an error of “ORA-39700: database must be opened with UPGRADE option" preceded with an error of "ORA-00704: bootstrap process failure"&lt;br /&gt;&lt;br /&gt;SQL&gt; startup upgrade&lt;br /&gt;&lt;br /&gt;2. The next step is to execute the control file recreation script in order to create the controlfile. This is a text controlfile script which was dumped to a trace file from the production environment and updated to reflect the locations of files in the development server.&lt;br /&gt;&lt;br /&gt;SQL&gt; !cat control_9_to_10.sql&lt;br /&gt;&lt;br /&gt;CREATE CONTROLFILE SET DATABASE "TEN_DB" RESETLOGS&lt;br /&gt;NOARCHIVELOG&lt;br /&gt;MAXLOGFILES 16&lt;br /&gt;MAXLOGMEMBERS 2&lt;br /&gt;MAXDATAFILES 30&lt;br /&gt;MAXINSTANCES 1&lt;br /&gt;MAXLOGHISTORY 113&lt;br /&gt;LOGFILE&lt;br /&gt;GROUP 1 '/home/oracle/dev/log1a.rdo' SIZE 200M,&lt;br /&gt;GROUP 2 '/home/oracle/dev/log2a.rdo' SIZE 200M,&lt;br /&gt;GROUP 3 '/home/oracle/dev/log3a.rdo' SIZE 200M,&lt;br /&gt;GROUP 4 '/home/oracle/dev/log4a.rdo' SIZE 200M&lt;br /&gt;DATAFILE&lt;br /&gt;'/home/oracle/dev/data01.dbf',&lt;br /&gt;'/home/oracle/dev/data02.dbf',&lt;br /&gt;'/home/oracle/dev/data03.dbf',&lt;br /&gt;'/home/oracle/dev/users.dbf',&lt;br /&gt;'/home/oracle/dev/tools.dbf',&lt;br /&gt;'/home/oracle/dev/system01.dbf',&lt;br /&gt;'/home/oracle/dev/undotbs01.dbf',&lt;br /&gt;'/home/oracle/dev/undotbs02.dbf',&lt;br /&gt;'/home/oracle/dev/undotbs03.dbf',&lt;br /&gt;'/home/oracle/dev/index01.dbf',&lt;br /&gt;'/home/oracle/dev/index02.dbf',&lt;br /&gt;'/home/oracle/dev/index04.dbf',&lt;br /&gt;'/home/oracle/dev/index05.dbf',&lt;br /&gt;'/home/oracle/dev/index06.dbf',&lt;br /&gt;'/home/oracle/dev/index03.dbf',&lt;br /&gt;'/home/oracle/dev/index07.dbf',&lt;br /&gt;'/home/oracle/dev/data04.dbf',&lt;br /&gt;'/home/oracle/dev/data05.dbf',&lt;br /&gt;'/home/oracle/dev/data06.dbf',&lt;br /&gt;'/home/oracle/dev/data07.dbf',&lt;br /&gt;'/home/oracle/dev/data08.dbf',&lt;br /&gt;'/home/oracle/dev/data09.dbf',&lt;br /&gt;'/home/oracle/dev/data10.dbf',&lt;br /&gt;'/home/oracle/dev/data11.dbf',&lt;br /&gt;'/home/oracle/dev/data12.dbf',&lt;br /&gt;'/home/oracle/dev/data13.dbf',&lt;br /&gt;'/home/oracle/dev/data14.dbf',&lt;br /&gt;'/home/oracle/dev/data15.dbf',&lt;br /&gt;'/home/oracle/dev/data16.dbf',&lt;br /&gt;'/home/oracle/dev/data17.dbf'&lt;br /&gt;CHARACTER SET US7ASCII;&lt;br /&gt;&lt;br /&gt;SQL&gt; @control_9_to_10.sql&lt;br /&gt;&lt;br /&gt;Control file created.&lt;br /&gt;&lt;br /&gt;3. The database was then recovered to the most recent point of time (until the last available archive file). Since the controlfile was recreated so it was very much necessary to use the keywords “using backup controlfile” during recovery. The files marked in bold are the archives which were applied for recovery.&lt;br /&gt;&lt;br /&gt;SQL&gt; recover database using backup controlfile until cancel;&lt;br /&gt;&lt;br /&gt;ORA-00279: change 79118 generated at 08/06/2007 15:43:45 needed for thread 1 &lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/home/oracle/dev/arch/1_43_629467995.dbf&lt;br /&gt;ORA-00280: change 79118 for thread 1 is in sequence #43&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;&lt;strong&gt;/home/oracle/dev/arch/1_43_629467995.dbf&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ORA-00279: change 79120 generated at 08/06/2007 15:43:51 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/home/oracle/dev/arch/1_44_629467995.dbf&lt;br /&gt;ORA-00280: change 79120 for thread 1 is in sequence #44&lt;br /&gt;ORA-00278: log file '/home/oracle/dev/arch/1_43.dbf' no&lt;br /&gt;longer needed for this recovery&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;&lt;strong&gt;/home/oracle/dev/arch/1_44_629467995.dbf&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;ORA-00279: change 79122 generated at 08/06/2007 15:43:51 needed for thread 1&lt;br /&gt;ORA-00289: suggestion :&lt;br /&gt;/home/oracle/dev/arch/1_45_629467995.dbf&lt;br /&gt;ORA-00280: change 79122 for thread 1 is in sequence #45&lt;br /&gt;ORA-00278: log file '/home/oracle/dev/arch/1_44.dbf' no&lt;br /&gt;longer needed for this recovery&lt;br /&gt;&lt;br /&gt;Specify log: {&lt;RET&gt;=suggested | filename | AUTO | CANCEL}&lt;br /&gt;&lt;strong&gt;CANCEL&lt;/strong&gt;&lt;br /&gt;Media recovery cancelled.&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;4. This is the most daunting step one would go through, because a normal “alter database open resetlogs” reported an error of "ORA-39700: database must be opened with UPGRADE option" in the alert log and an error of "ORA-01092: ORACLE instance terminated. Disconnection forced" at the SQL prompt. It was improvised from this point that a "startup upgrade" can also be used to start the instance. As for the “ORA-39700” error in alert log, the statement shown below was executed and it surprisingly worked.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open resetlogs upgrade;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;5. Since there is no concept of SYSAUX tablespace in 9i and which is one of the essential tablespaces in 10g, a SYSAUX tablespace was then created manually as shown below.&lt;br /&gt;&lt;br /&gt;SQL&gt; create tablespace SYSAUX datafile '/home/oracle/dev/sysaux.dbf' size 500M online permanent extent management local segment space management auto;&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;6. A temporary tablespace was created since it was not included in the controlfile recreation script, and made the default temporary tablespace.&lt;br /&gt;&lt;br /&gt;SQL&gt; create temporary tablespace temp tempfile&lt;br /&gt;'/home/oracle/dev/temp01.dbf' size 8000M;&lt;br /&gt;&lt;br /&gt;Tablespace created.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database default temporary tablespace temp;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;7. Now, When trying to query the dba or v$ views, the database would not respond. When trying to interrupt using the traditional interrupt keys on UNIX "Ctrl+c" an error of ORA-600 was reported at the SQL prompt as shown.&lt;br /&gt;&lt;br /&gt;SQL&gt; select file_name from dba_data_files;&lt;br /&gt;&lt;br /&gt;ORA-00600: internal error code, arguments: [17069], 0xC00000002B8EDDA0],[], [], [], [], [], []&lt;br /&gt;&lt;br /&gt;To start it all over again the database was bounced but it would not come up with a normal "startup" and only accepts "startup upgrade" to come up. This is where it was located from the discussion threads of Metalink that in doing an upgrade from 9i to 10g, the data dictionary needs to be synchronized with the version of the database. The Oracle sever makes a match between the database version and data dictionary every time it opens the database thereby only allowing a “startup upgrade" rather than a normal “startup” to bring the database up.&lt;br /&gt;&lt;br /&gt;It was suggested from another discussion thread of Metalink that catupgrd.sql script needed to be executed from 10gR2 $ORACLE_HOME/rdbms/admin to achieve the synchronization. The script ran for a while and completed successfully.&lt;br /&gt;&lt;br /&gt;SQL&gt; @$ORACLE_HOME/rdbms/admin/catupgrd.sql&lt;br /&gt;&lt;br /&gt;The following script was executed for the utility upgrade status check which was successful as well.&lt;br /&gt;&lt;br /&gt;SQL&gt; @$ORACLE_HOME/rdbms/admin/utlu102s.sql&lt;br /&gt;&lt;br /&gt;The database was bounced yet again and this time it did come up with a normal "startup". The script utlrp.sql was executed a couple of times to recompile all the invalid objects. The global name of the database was then changed to reflect the new name because creating a database with a control file recreation keeps the global_name of the old database unchanged as shown below.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from global_name;&lt;br /&gt;&lt;br /&gt;GLOBAL_NAME&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;NINE_DB.TEST.COM&lt;br /&gt;&lt;br /&gt;The global_name was changed by running the following statement which marked the successful completion of upgrade from Oracle 9iR2 to 10gR2.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database rename global_name to TEN_DB.TEST.COM;&lt;br /&gt;&lt;br /&gt;Note: If the upgrade is from Oracle 9iR2 to 10gR1 then the synchronization is done by executing u0902000.sql and the utility upgrade status is checked by executing utlu101s.sql from 10gR1 $ORACLE_HOME/rdbms/admin.(Metalink Note: 263809.1)&lt;br /&gt;&lt;br /&gt;10gR1 $ORACLE_HOME/rdbms/admin/u0902000.sql --- to upgrade to 10.1.0&lt;br /&gt;which is renamed as catupgrd.sql in 10gR2&lt;br /&gt;&lt;br /&gt;10gR1 $ORACLE_HOME/rdbms/admin/utlu101s.sql --- to upgrade to 10.1.0&lt;br /&gt;which is also renamed as utlu102s.sql in 10gR2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A simple concept of cloning a database has been a vital step for the upgrade of an Oracle server version, which not only reduces the downtime for the upgrade but also is achievable with least overhead.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Author:&lt;/strong&gt; Nawaz Ahmed M.A.S., System Engineer, GAVS Information Services, India. (Metalink Note id: 455990.1)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6111102361129489135?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6111102361129489135/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6111102361129489135' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6111102361129489135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6111102361129489135'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/08/upgrading-9ir2-to-10gr2-using-hotbackup.html' title='Upgrading 9iR2 to 10gR2 using hotbackup'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4709345477581572162</id><published>2007-08-27T14:02:00.000+05:30</published><updated>2007-10-15T10:59:33.326+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kernel Configuration'/><title type='text'>Configuration of kernel parameters</title><content type='html'>Configuring Kernel Parameters&lt;br /&gt;&lt;br /&gt;If the value of any kernel parameter is different from the recommended value, then complete the following procedure:&lt;br /&gt;&lt;br /&gt;Using any text editor, create or edit the /etc/sysctl.conf file, and add or edit lines similar to the following:&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;&lt;br /&gt;Include lines only for the kernel parameter values that you want to change. For the semaphore parameters (kernel.sem), you must specify all four values. However, if any of the current values are larger than the recommended value, then specify the larger value.&lt;br /&gt;&lt;br /&gt;fs.file-max = 512 * PROCESSES&lt;br /&gt;kernel.shmall = 2097152&lt;br /&gt;kernel.shmmax = 2147483648&lt;br /&gt;kernel.shmmni = 4096&lt;br /&gt;kernel.sem = 250 32000 100 128&lt;br /&gt;net.ipv4.ip_local_port_range = 1024 65000&lt;br /&gt;net.core.rmem_default = 4194304&lt;br /&gt;net.core.rmem_max = 4194304&lt;br /&gt;net.core.wmem_default = 262144&lt;br /&gt;net.core.wmem_max = 262144&lt;br /&gt;&lt;br /&gt;Note: If the current value for any parameter is higher than the value listed in this table, then do not change the value of that parameter.&lt;br /&gt;&lt;br /&gt;By specifying the values in the /etc/sysctl.conf file, they persist when you restart the system.&lt;br /&gt;&lt;br /&gt;Enter the following command to change the current values of the kernel parameters:&lt;br /&gt;&lt;br /&gt;# /sbin/sysctl -p&lt;br /&gt;&lt;br /&gt;Setting Shell Limits for the oracle User&lt;br /&gt;&lt;br /&gt;To improve the performance of the software on Linux systems, you must increase the following shell limits for the oracle user:&lt;br /&gt;&lt;br /&gt;Shell Limit Item in limits.conf Hard Limit&lt;br /&gt;&lt;br /&gt;Maximum number of open file descriptors nofile 65536&lt;br /&gt;Maximum number of processes available to a single user nproc 16384&lt;br /&gt;&lt;br /&gt;To increase the shell limits:&lt;br /&gt;&lt;br /&gt;Add the following lines to the /etc/security/limits.conf file:&lt;br /&gt;&lt;br /&gt;oracle              soft    nproc   2047&lt;br /&gt;oracle              hard    nproc   16384&lt;br /&gt;oracle              soft    nofile  1024&lt;br /&gt;oracle              hard    nofile  65536&lt;br /&gt;&lt;br /&gt;Add or edit the following line in the /etc/pam.d/login file, if it does not already exist:&lt;br /&gt;&lt;br /&gt;session    required     /lib/security/pam_limits.so&lt;br /&gt;session    required     pam_limits.so&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;&lt;br /&gt;For 64-bit platforms, the following entry is not required in the /etc/pam.d/login file:&lt;br /&gt;&lt;br /&gt;session    required     /lib/security/pam_limits.so&lt;br /&gt;&lt;br /&gt;Depending on the oracle user's default shell, make the following changes to the default shell start-up file:&lt;br /&gt;&lt;br /&gt;For the Bourne, Bash, or Korn shell, add the following lines to the /etc/profile file (or the file on SUSE systems)/etc/profile.local:&lt;br /&gt;&lt;br /&gt;if [ $USER = "oracle" ]; then&lt;br /&gt;      if [ $SHELL = "/bin/ksh" ]; then&lt;br /&gt;            ulimit -p 16384&lt;br /&gt;            ulimit -n 65536&lt;br /&gt;      else&lt;br /&gt;            ulimit -u 16384 -n 65536&lt;br /&gt;      fi&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;For the C shell (csh or tcsh), add the following lines to the /etc/csh.login file (or the file on SUSE systems)/etc/csh.login.local:&lt;br /&gt;&lt;br /&gt;if ( $USER == "oracle" ) then&lt;br /&gt;      limit maxproc 16384&lt;br /&gt;      limit descriptors 65536&lt;br /&gt;endif&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4709345477581572162?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4709345477581572162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4709345477581572162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4709345477581572162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4709345477581572162'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/08/configuration-of-kernel-parameters.html' title='Configuration of kernel parameters'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8431100207189811829</id><published>2007-08-13T14:37:00.000+05:30</published><updated>2007-10-15T11:00:03.439+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='cron schedule'/><title type='text'>Scheduling backup using Crontab in Linux</title><content type='html'>Edit the crontab using following command and add the line as below:&lt;br /&gt;&lt;br /&gt;$crontab -e&lt;br /&gt;&lt;br /&gt;0 06,18 * * * sh /home/oracle/Desktop/bkup.sh&lt;br /&gt;&lt;br /&gt;Scheduling backup twice a day at 6 in the morning and 6 in the evening.&lt;br /&gt;&lt;br /&gt;Contents of bkup.sh&lt;br /&gt;-------------------&lt;br /&gt;export ORACLE_BASE=/u01/app/oracle&lt;br /&gt;export ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1&lt;br /&gt;export PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;export ORACLE_SID=edr&lt;br /&gt;mv /home/oracle/edrbkup/old_edr.dmp /home/oracle/edrbkup/old_bkup/&lt;br /&gt;mv /home/oracle/edrbkup/old_edr.log /home/oracle/edrbkup/old_bkup/&lt;br /&gt;mv /home/oracle/edrbkup/edr.dmp /home/oracle/edrbkup/old_edr.dmp&lt;br /&gt;mv /home/oracle/edrbkup/edr.log /home/oracle/edrbkup/old_edr.log&lt;br /&gt;exp edr/regp file=/home/oracle/edrbkup/edr.dmp log=/home/oracle/edrbkup/edr.log owner=edr buffer=200000&lt;br /&gt;&lt;br /&gt;This script will automatically clean the old backup and maintains three backups' at any given point of time.&lt;br /&gt;&lt;br /&gt;cron commands:&lt;br /&gt;&lt;br /&gt;$crontab -l  To list the cron jobs scheduled&lt;br /&gt;$crontab -r  To remove the cron job&lt;br /&gt;$crontab -e  To edit/schedule cron jobs&lt;br /&gt;&lt;br /&gt;General Overview:&lt;br /&gt;&lt;br /&gt;Crontab Environment&lt;br /&gt;&lt;br /&gt;cron invokes the command from the user's HOME directory with the shell, /usr/bin/sh).&lt;br /&gt;cron supplies a default environment for every shell, defining:&lt;br /&gt;HOME=user's-home-directory&lt;br /&gt;LOGNAME=user's-login-id&lt;br /&gt;PATH=/usr/bin:/usr/sbin:.&lt;br /&gt;SHELL=/usr/bin/sh&lt;br /&gt;&lt;br /&gt;Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*     *     *     *     *  command to be executed&lt;br /&gt;-     -    -    -    -&lt;br /&gt;|     |     |     |     |&lt;br /&gt;|     |     |     |     +----- day of week (0 - 6) (sunday = 0)&lt;br /&gt;|     |     |     +------- month (1 - 12)&lt;br /&gt;|     |     +--------- day of month (1 - 31)&lt;br /&gt;|     +----------- hour (0 - 23)&lt;br /&gt;+------------- min (0 - 59)&lt;br /&gt;&lt;br /&gt;Hope this may help you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8431100207189811829?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8431100207189811829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8431100207189811829' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8431100207189811829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8431100207189811829'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/08/scheduling-backup-using-crontab-in.html' title='Scheduling backup using Crontab in Linux'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-1432198062134602011</id><published>2007-08-09T10:05:00.000+05:30</published><updated>2007-10-15T11:00:27.539+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Samba share'/><title type='text'>Creating a Samba Share  on a Linux box for a Windows box in network</title><content type='html'>[root@oraclesrvr ~]# mkdir /regp&lt;br /&gt;[root@oraclesrvr ~]# useradd regpadmin&lt;br /&gt;[root@oraclesrvr ~]# useradd regpuser&lt;br /&gt;[root@oraclesrvr ~]# passwd regpadmin&lt;br /&gt;[root@oraclesrvr ~]# passwd regpuser&lt;br /&gt;[root@oraclesrvr ~]# chown -R regpadmin:regpadmin /regp&lt;br /&gt;[root@oraclesrvr ~]# chmod -R 777 /regp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[root@oraclesrvr ~]# vi /etc/samba/smb.conf&lt;br /&gt;&lt;br /&gt;Edit the following lines which are present at the end of file accordingly:&lt;br /&gt;[regp]&lt;br /&gt;comment = regp user stuff&lt;br /&gt;path = /regp/&lt;br /&gt;valid users = regpadmin regpuser&lt;br /&gt;public = no&lt;br /&gt;writable = yes&lt;br /&gt;printable = no&lt;br /&gt;create mask = 0765&lt;br /&gt;:wq&lt;br /&gt;&lt;br /&gt;[root@oraclesrvr ~]# cat /etc/passwd | mksmbpasswd.sh &gt; /etc/samba/smbpasswd&lt;br /&gt;[root@oraclesrvr ~]# chmod 600 /etc/samba/smbpasswd&lt;br /&gt;[root@oraclesrvr ~]# smbpasswd regpadmin&lt;br /&gt;[root@oraclesrvr ~]# smbpasswd regpuser&lt;br /&gt;[root@oraclesrvr ~]# service smb restart&lt;br /&gt;&lt;br /&gt;Now connect to the linux box from any windows machine in same network and try to create,modify or delete any file in the share created by you.&lt;br /&gt;These permissions can be set according to your requirements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-1432198062134602011?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/1432198062134602011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=1432198062134602011' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1432198062134602011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/1432198062134602011'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/08/creating-samba-share-from-linux-box-to.html' title='Creating a Samba Share  on a Linux box for a Windows box in network'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-5725892271773288642</id><published>2007-08-01T11:08:00.000+05:30</published><updated>2007-10-15T11:00:59.653+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='VLM'/><title type='text'>Very Large Memory</title><content type='html'>Creation of Database With Very Large Memory&lt;br /&gt;&lt;br /&gt;Once the Oracle software is installed successfully, then the next major step is to create the database:&lt;br /&gt;&lt;br /&gt;This document deals with database with Very Large Memory option i.e., allocating more than 1.7GB of SGA on a 32 bit Windows server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In Windows 32 bit architechture(x86) there is limit for 2GB of memory usage that Windows will allow for any single process to consume.&lt;br /&gt;And the databases in which a large amount of i/o takesplace needs much more memory than this limit.  So, to allocate and allow oracle to use more than 2GB of memory we use VLM.&lt;br /&gt;&lt;br /&gt;1. Open your boot.ini file and add /PAE and /3GB switches.&lt;br /&gt;&lt;br /&gt;2. Install the Oracle Software.&lt;br /&gt;&lt;br /&gt;3. Open the regedit file&lt;br /&gt;&lt;br /&gt;  start-&gt;run-&gt;regedit-&gt;find ORACLE_HOME key this will be in HKEY_LOCAL_MACHINE--&gt;software--&gt;oracle--&gt;key_oracle_home(what ever your home is)&lt;br /&gt;&lt;br /&gt;in the right hand pane right click and create a new string value with name AWE_WINDOW_MEMORY&lt;br /&gt;&lt;br /&gt;Then double click thih new string and give the vaule in bytes that you require.&lt;br /&gt;By default the value of this string is 1GB.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4. Restart the server to make this changes take effect.&lt;br /&gt;&lt;br /&gt;5. create the database with memory greater than the 1.7GB SGA.&lt;br /&gt;&lt;br /&gt;While allocating the SGA parameter values take care that you give the following parameter values:&lt;br /&gt;&lt;br /&gt;Parameter NAME       VALUE                            &lt;br /&gt;--------------       -----                           &lt;br /&gt;db_cache_size        =0                                               &lt;br /&gt;db_2k_cahe_size      =null&lt;br /&gt;db_4k_cahe_size      =null&lt;br /&gt;db_8k_cahe_size      =null&lt;br /&gt;db_16k_cahe_size     =null&lt;br /&gt;db_32k_cahe_size     =null&lt;br /&gt;db_cache_advice      =OFF              &lt;br /&gt;&lt;br /&gt;db_block_buffers     =262144(2GB) i.e (262144*8192)           &lt;br /&gt;db_block_size        =8192                                    &lt;br /&gt;   &lt;br /&gt;shared_pool_size     =600M&lt;br /&gt;large_pool_size      =48M&lt;br /&gt;java_pool_size       =24M&lt;br /&gt;pga_aggregate_target =700M&lt;br /&gt;sga_target           =0                                        &lt;br /&gt;used_indirect_buffers=TRUE&lt;br /&gt;&lt;br /&gt;Note:db-block_buffres is calculated with the following formula(max that can be allocated):&lt;br /&gt;&lt;br /&gt;==&gt;Your Server Physical Ram - 4GB + AWE_WINDOW_MEMORY(1GB)&lt;br /&gt;&lt;br /&gt;So for example if your System Physical RAM is 9GB, then according to formula:&lt;br /&gt;&lt;br /&gt;9-4+1=6GB&lt;br /&gt;&lt;br /&gt;You can allocate upto 6GB value for your db_block_buffers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-5725892271773288642?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/5725892271773288642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=5725892271773288642' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5725892271773288642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5725892271773288642'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/07/very-large-memory.html' title='Very Large Memory'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4858144917659278359</id><published>2007-08-01T10:34:00.002+05:30</published><updated>2008-05-15T09:46:08.596+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Installation'/><title type='text'>Oracle 10G Installation on Red Hat Linux</title><content type='html'>First Install Linux with all the rpms and packages required.&lt;br /&gt;&lt;br /&gt;1. Create Groups oinstall &amp; dba, and oracle user as follows:&lt;br /&gt;&lt;br /&gt;#groupadd oinstall&lt;br /&gt;#groupadd dba&lt;br /&gt;#useradd -g oinstall -G dba oracle&lt;br /&gt;#passwd oracle&lt;br /&gt;&lt;br /&gt;give a new password &lt;br /&gt; &lt;br /&gt;2. Edit the .bash_profile file of oracle user and add the following lines as follows:&lt;br /&gt;&lt;br /&gt;#vi /home/oracle/.bash_profile&lt;br /&gt;&lt;br /&gt;umask 022&lt;br /&gt;&lt;br /&gt;PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin&lt;br /&gt;LD_LIBRARY_PATH=/usr/lib:/usr/X11R6/lib&lt;br /&gt;&lt;br /&gt;ORACLE_BASE=/u01/app/oracle&lt;br /&gt;ORACLE_HOME=$ORACLE_BASE/product/10.1.0/db_1&lt;br /&gt;ORACLE_SID='SERVICE_NAME'&lt;br /&gt;PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;&lt;br /&gt;export PATH LD_LIBRARY_PATH&lt;br /&gt;export ORACLE_BASE ORACLE_HOME ORACLE_SID&lt;br /&gt;&lt;br /&gt;:wq(save and exit)&lt;br /&gt;&lt;br /&gt;3. Then run the .bash_profile to make the current changes effect&lt;br /&gt;&lt;br /&gt;#. .bash_profile&lt;br /&gt;&lt;br /&gt;Create the directory for the software installation and assign ownership to oracle:oinstall. In the example, you use /u01/app/oracle.&lt;br /&gt;&lt;br /&gt;#mkdir -p /u01/app/oracle&lt;br /&gt;#mkdir -p /u01/app/oracle/product/10.1.0/db_1&lt;br /&gt;&lt;br /&gt;Then change the permissions accordingly&lt;br /&gt;&lt;br /&gt;#chown -R oracle:oinstall /u01/app&lt;br /&gt;#chmod -R 775 /u01/app&lt;br /&gt;&lt;br /&gt;4. Edit the /etc/inittab file and change the runlevel from 5 to 3.&lt;br /&gt;Note: Not required if using Oracle's Enterprise Linux.&lt;br /&gt;&lt;br /&gt;5. If your OS is greater than RHEL 3, then the Oracle Universal Installer does not recognize the OS, change the version to 3 as follows:&lt;br /&gt;&lt;br /&gt;#cp /etc/redhat-release /etc/redhat-release.orig&lt;br /&gt;#vi /etc/redhat-release&lt;br /&gt;&lt;br /&gt;#And replace the line present in the file with &lt;br /&gt;Red Hat Enterprise Linux AS release 3 (Taroon)&lt;br /&gt;:wq&lt;br /&gt;&lt;br /&gt;Once the installation is completed replace the orignal file back.&lt;br /&gt;&lt;br /&gt;#cp /etc/redhat-release.orig /etc/redhat-release&lt;br /&gt;&lt;br /&gt;overwrite:yes&lt;br /&gt;&lt;br /&gt;6. Change the Kernel Parameters according to your Hardware:&lt;br /&gt;&lt;br /&gt;#vi /etc/sysctl.conf&lt;br /&gt;&lt;br /&gt;kernel.sem= 250 32000 100 128&lt;br /&gt;kernel.shmmax = 2147483648&lt;br /&gt;kernal.shmmni = 4096 &lt;br /&gt;kernel.shmall = 262144000&lt;br /&gt;fs.file-max= 1024&lt;br /&gt;net.ipv4.ip_local_port_range= 1024 65000&lt;br /&gt;&lt;br /&gt;:wq&lt;br /&gt;&lt;br /&gt;Note: If any of the value is more than the value given above don't change those values.&lt;br /&gt;&lt;br /&gt;7. To make the changes effect immediately without reboot give the following command:&lt;br /&gt;&lt;br /&gt;#/sbin/sysctl -p&lt;br /&gt;&lt;br /&gt;8. REBOOT(init 6) the system and login as oracle User:&lt;br /&gt;&lt;br /&gt;9. You need to install Oracle in the GUI mode so change the display mode to GUI by giving followinh command:&lt;br /&gt;&lt;br /&gt;$startx&lt;br /&gt;&lt;br /&gt;10. Mount the media disk which contains the Oracle 10G software: &lt;br /&gt;Note: It is recommended that you copy the contents of the CD onto the Filesystem and start the installation:&lt;br /&gt;&lt;br /&gt;$cp /mnt/disk1/*.* /home/oracle/oracle10g&lt;br /&gt;&lt;br /&gt;Give total permissions on the newly created folder oracle10g to oracle user&lt;br /&gt;&lt;br /&gt;$chmod -R 777 /home/oracle/oracle10g&lt;br /&gt;&lt;br /&gt;11. Then Start the installation as follows:&lt;br /&gt;&lt;br /&gt;$sh /home/oracle/oracle10g/runinstaller.sh&lt;br /&gt;&lt;br /&gt;The OUI is started and continue Installation of Oracle same as in Windows:&lt;br /&gt;&lt;br /&gt;next&gt;next&gt;next&gt;.....................................Finish.&lt;br /&gt;&lt;br /&gt;Inbetween it prompts you to run two scripts as root&lt;br /&gt;&lt;br /&gt;DON'T close the current window until you run the respected script as root in a new terminal.&lt;br /&gt;&lt;br /&gt;1st script:&lt;br /&gt;&lt;br /&gt;#root&gt;sh /u01/app/oracle/oraInventory/orainstall.sh&lt;br /&gt;&lt;br /&gt;After executing this script as root go to the previous screen and press the continue tab&lt;br /&gt;&lt;br /&gt;2nd script:&lt;br /&gt;&lt;br /&gt;#root&gt; sh /u01/app/oracle/product/10.1.0/db_1/root.sh&lt;br /&gt;&lt;br /&gt;After executing this script as root go to the previous screen and press the OK tab.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Your Installation of Oracle 10G on Linux is completed successfully(hopefully).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4858144917659278359?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4858144917659278359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4858144917659278359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4858144917659278359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4858144917659278359'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/07/oracle-10g-installation-on-red-hat.html' title='Oracle 10G Installation on Red Hat Linux'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-5407660276120110234</id><published>2007-07-31T09:54:00.000+05:30</published><updated>2007-10-15T11:01:45.487+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Autostart/stop DB'/><title type='text'>Oracle DB Auto Start / Shutdown</title><content type='html'>&lt;strong&gt;How to Configure a Linux x86 Server for Oracle DB Auto Start / Shutdown &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Applies to: Oracle Server - Enterprise Edition - Version: From 8.1.7.4 to 10.1.0.3 on Linux x86(32 Bit)&lt;br /&gt;&lt;br /&gt;The Database server software provides the two scripts to configure automatic DB startup/shutdown with the server machine. &lt;br /&gt;They are &lt;br /&gt;&lt;br /&gt;$ORACLE_HOME/bin/dbstart&lt;br /&gt;$ORACLE_HOME/bin/dbshut&lt;br /&gt;&lt;br /&gt;We need to call these scripts from the unix start/shutdown scripts (rc0.d / rc1.d etc.)&lt;br /&gt;&lt;br /&gt;Step - A:&lt;br /&gt;&lt;br /&gt;Check the oratab file in /etc/oratab or /var/opt/oracle/oratab&lt;br /&gt;This should have the entry for the DB we are dealing with, with a value Y, like:&lt;br /&gt;$ORACLE_SID:$ORACLE_HOME:Y&lt;br /&gt;&lt;br /&gt;Step - B:&lt;br /&gt;&lt;br /&gt;Login to root. Create a new file with name like dbora and&lt;br /&gt;Save the following file in /etc/init.d/ &lt;br /&gt;Please note that /etc/init.d is RedHat specific.&lt;br /&gt;Change the permissions accordingly&lt;br /&gt;&lt;br /&gt;#chmod 755 /etc/init.d/dbora&lt;br /&gt;&lt;br /&gt;-rwxr-xr-x 1 root root 1412 Aug 27 19:14 dbora&lt;br /&gt;&lt;br /&gt;Mention the correct ORA_OWNER and ORA_HOME in the dbora&lt;br /&gt;&lt;br /&gt;------------------ Edit dbora ---------------------------------&lt;br /&gt;&lt;br /&gt;#! /bin/bash&lt;br /&gt;#&lt;br /&gt;# oracle Start/Stop the Databases...&lt;br /&gt;#&lt;br /&gt;# chkconfig: 2345 99 10 &lt;br /&gt;#&lt;br /&gt;# processname: oracle&lt;br /&gt;# config: /etc/oratab&lt;br /&gt;# pidfile: /var/run/oracle.pid&lt;br /&gt;&lt;br /&gt;# Source function library.&lt;br /&gt;. /etc/init.d/functions&lt;br /&gt;&lt;br /&gt;RETVAL=0&lt;br /&gt;ORA_OWNER="oracle"&lt;br /&gt;ORA_HOME="/u01/app/oracle/product/10.1.0/db_1"&lt;br /&gt;&lt;br /&gt;# See how we were called.&lt;br /&gt;&lt;br /&gt;prog="oracle"&lt;br /&gt;&lt;br /&gt;start() {&lt;br /&gt;echo -n $"Starting $prog: "&lt;br /&gt;su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart" &lt;br /&gt;su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"&lt;br /&gt;RETVAL=$?&lt;br /&gt;echo&lt;br /&gt;[ $RETVAL -eq 0 ] &amp;&amp; rm -f /var/lock/subsys/dbora&lt;br /&gt;&lt;br /&gt;return $RETVAL&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;stop() {&lt;br /&gt;echo -n $"Stopping $prog: "&lt;br /&gt;su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut" &lt;br /&gt;su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;restart() {&lt;br /&gt;stop&lt;br /&gt;start&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;case "$1" in&lt;br /&gt;start)&lt;br /&gt;start&lt;br /&gt;;;&lt;br /&gt;stop)&lt;br /&gt;stop&lt;br /&gt;;;&lt;br /&gt;restart)&lt;br /&gt;restart&lt;br /&gt;;;&lt;br /&gt;*)&lt;br /&gt;echo $"Usage: $0 {start|stop|restart}"&lt;br /&gt;exit 1&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;exit $?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------ Save and exit(wq) dbora ---------------------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step - C: Login as root run the following:&lt;br /&gt;&lt;br /&gt;# cd /sbin&lt;br /&gt;# chkconfig --add dbora&lt;br /&gt;&lt;br /&gt;This will create a system service viz. dbora&lt;br /&gt;# chkconfig --list&lt;br /&gt;&lt;br /&gt;This also creates the following files:&lt;br /&gt;&lt;br /&gt;/etc/rc2.d/S99dbora ( calls $ORACLE_HOME/bin/dbstart )&lt;br /&gt;/etc/rc3.d/S99dbora ( calls $ORACLE_HOME/bin/dbstart )&lt;br /&gt;/etc/rc4.d/S99dbora ( calls $ORACLE_HOME/bin/dbstart )&lt;br /&gt;/etc/rc5.d/S99dbora ( calls $ORACLE_HOME/bin/dbstart )&lt;br /&gt;&lt;br /&gt;/etc/rc0.d/K10dbora ( calls $ORACLE_HOME/bin/dbshut )&lt;br /&gt;/etc/rc1.d/K10dbora ( calls $ORACLE_HOME/bin/dbshut )&lt;br /&gt;/etc/rc6.d/K10dbora ( calls $ORACLE_HOME/bin/dbshut )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;chkconfig refers the " # chkconfig: 2345 99 10 " from dbora.&lt;br /&gt;This signifies that the service has start run level set to 2, 3, 4 and 5.Stop run level set to 0, 1 and 6. And the start priority should be 99 and stop priority be 10.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If the version is Red Hat 3 ES or more than the dbora file needs two lines of comments.&lt;br /&gt;Each  service which should be manageable by chkconfig needs two or more commented lines &lt;br /&gt;added to its init.d script. The second line contains  a  description  for  the service,  &lt;br /&gt;and may be extended across multiple lines with backslash continuation.&lt;br /&gt;&lt;br /&gt;For example,&lt;br /&gt;# chkconfig: 2345 99 10 &lt;br /&gt;# description: Saves and restores system entropy pool for higher quality random number generation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step - D: Reboot the Linux box and check&lt;br /&gt;&lt;br /&gt;In some cases for 9.2.0 we also had to copy the init file for SID "test" from /u01/app/oracle/admin/test/pfile to $ORACLE_HOME/dbs to get dbstart and dbshut working: &lt;br /&gt;cp /u01/app/oracle/admin/test/pfile/inittest.ora.642002224936 $ORACLE_HOME/dbs/inittest.ora&lt;br /&gt;But first make sure if your init file already exists in $ORACLE_HOME/dbs!&lt;br /&gt;Note: An article from Metalink customized for my environment. May help you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-5407660276120110234?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/5407660276120110234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=5407660276120110234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5407660276120110234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/5407660276120110234'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/07/oracle-db-auto-start-shutdown.html' title='Oracle DB Auto Start / Shutdown'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8255961972681561004</id><published>2007-06-30T10:29:00.000+05:30</published><updated>2007-06-30T10:31:25.135+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tuning Database Buffer Cache'/><title type='text'>Tuning Database Buffer Cache</title><content type='html'>Introduction &lt;br /&gt;&lt;br /&gt;Buffer pool or buffer cache is a memory structure within Oracle SGA that is used for caching data blocks in the memory. Accessing data from the memory is significantly faster than accessing data from disk. The goal of block buffer tuning is to efficiently cache frequently used data blocks in the buffer cache (SGA) and provide faster access to data. &lt;br /&gt;&lt;br /&gt;Tuning block buffer is a key task in any Oracle tuning initiative and is a part of an ongoing tuning and monitoring of production databases. The task of database performance optimization by allocating appropriate memory structure within SGA is a very interesting and challenging task for a DBA. Generally, it takes a few iterations before you can reach to a satisfactory memory allocation. This article presents a tuning approach that greatly simplifies the tuning effort. The methodology discussed here will help DBAs in creating a proactive database tuning and monitoring strategy for their production databases. If you are a DBA responsible for tuning a database without enough physical memory on the server, you will find this article very informative and useful. With the help of an established methodology and tuning strategy, you can easily identify the problem areas and tune the SGA memory structure. &lt;br /&gt;&lt;br /&gt;Step 1: Identify the amount of memory that you can allocate to block buffers. Create buffer pool without inducing significant paging or swapping. &lt;br /&gt;&lt;br /&gt;Deciding the size of block buffer is critical to the overall system performance. A large block buffer will provide more memory space for caching data blocks in the SGA. In such a case, most SQL statements will find data blocks in the memory and a less time consuming IO will be performed by the database. The more the data cached in the memory, the faster is the database response. Life of DBAs would have been much simpler if we could cache the entire database (or even 50% of the database) in the block buffers, but we are limited by the physical memory available on the server. If we allocate a very large block buffer, the server may swap / page the SGA into a swap space on the disk (If SGA in not locked in the physical memory). In such circumstances, data will no longer be accessed from the memory, and CPU will have to work harder to manage the virtual memory of the server, thus degrading the overall system performance. A very large block buffer may defeat the purpose of caching data in memory for faster access, if the operating system is swapping / paging SGA pages. Within the limitations of the physical memory, the DBA should allocate block buffers to cache data in the SGA without inducing paging or swapping on the server. Hence, understanding the amount of memory available for block buffers is key to tuning the block buffers.  &lt;br /&gt;&lt;br /&gt;You can set the buffer cache by specifying DB_CACHE_SIZE (or DB_BLOCK_BUFFERS) initialization parameter as:- &lt;br /&gt;&lt;br /&gt;DB_CACHE_SIZE = 128 M &lt;br /&gt;&lt;br /&gt;Step 2: Identify how frequently data blocks are accessed from the buffer cache (a. k. a Block Buffer Hit Ratio). &lt;br /&gt;&lt;br /&gt;Once you have allocated the available memory to block buffers, the next step is to identify the efficiency of block buffer usage. Oracle database maintains dynamic performance view V$BUFFER_POOL_STATISTICS with overall buffer usage statistics. This view maintains the following counts every time a data block is accessed either from the block buffers or from the disk: &lt;br /&gt;&lt;br /&gt;NAME – Name of the buffer pool&lt;br /&gt;PHYSICAL_READS – Number of physical reads&lt;br /&gt;DB_BLOCK_GETS – Number of reads for INSERT, UPDATE and DELETE&lt;br /&gt;CONSISTENT_GETS – Number of reads for SELECT  &lt;br /&gt;&lt;br /&gt;DB_BLOCK_GETS + CONSISTENT_GETS = Total Number of reads &lt;br /&gt;&lt;br /&gt;Based on above statistics we can calculate the percentage of data blocks being accessed from the memory to that of the disk (block buffer hit ratio). The following SQL statement will return the block buffer hit ratio:  &lt;br /&gt;&lt;br /&gt;SELECT NAME, 100 – round ((PHYSICAL_READS / (DB_BLOCK_GETS + CONSISTENT_GETS))*100,2) HitRatio&lt;br /&gt;FROM V$BUFFER_POOL_STATISTICS; &lt;br /&gt;&lt;br /&gt;Before measuring the database buffer hit ratio, it is very important to check that the database is running in a steady state with normal workload and no unusual activity has taken place. Buffer hit ratio can be skewed depending on the type of SQL statements running in the database since startup. For example, when you run a SQL statement just after database startup, no data blocks have been cached in the block buffers. At this point, Oracle reads the data blocks from the disk and will cache the blocks in the memory. If you run the same SQL statement again, then most likely the data blocks will still be present in the cache, and Oracle will not have to perform disk IO. If you run the same SQL statement multiple times you will get a higher buffer hit ratio. On the other hand, if you either run SQL statements that rarely query the same data, or run a select on a very large table, the data block may not be in the buffer cache and Oracle will have to perform disk IO, thereby lowering the buffer hit ratio. &lt;br /&gt;&lt;br /&gt;A hit ratio of 95% or greater is considered to be a good hit ratio for OLTP systems. The hit ratio for DSS (Decision Support System) may vary depending on the database load. A lower hit ratio means Oracle is performing more disk IO on the server. In such a situation, you can increase the size of database block buffers to increase the database performance. You may have to increase the physical memory on the server if the server starts swapping after increasing block buffers. &lt;br /&gt;&lt;br /&gt;Step 3: Identify frequently used and rarely used data blocks. Cache frequently used blocks and discard rarely used blocks. &lt;br /&gt;&lt;br /&gt;If you have a low buffer hit ratio and you cannot increase the size of the database block buffers, you can still gain some performance advantage by tuning the block buffers and efficiently caching the data block that will provide maximum benefits. Ideally, we should cache data blocks that are either frequently used in SQL statements, or data blocks used by performance sensitive SQL statements (A SQL statement whose performance is critical to the system performance). An ad-hoc query that scans a large table can significantly degrade overall database performance. A SQL on a large table may flush out frequently used data blocks from the buffer cache to store data blocks from the large table. During the peak time, ad-hoc queries that select data from large tables or from tables that are rarely used should be avoided. If we cannot avoid such queries, we can limit the impact on the buffer cache by using RECYCLE buffer pool.  &lt;br /&gt;&lt;br /&gt;A DBA can create multiple buffer pools in the SGA to store data blocks efficiently. For example, we can use RECYCLE pool to cache data blocks that are rarely used in the application. Typically, this will be a small area in the SGA to store data blocks for current SQL statement / transaction that we do not intend to hold in the memory after the transaction is completed. Similarly, we can use KEEP pool to cache data blocks that are frequently used by the application. Typically, this will be big enough to store data blocks that we want to always keep in memory. By storing data blocks in KEEP and RECYCLE pools you can store frequently used data blocks separately from the rarely used data blocks, and control which data blocks are flushed from the buffer cache. Using RECYCLE pool, we can also prevent a large table scan from flushing frequently used data blocks. You can create the RECYCLE and KEEP pools by specifying the following init.ora parameters: &lt;br /&gt;&lt;br /&gt;DB_KEEP_CACHE_SIZE = &lt;size of KEEP pool&gt;&lt;br /&gt;DB_RECYCLE_CACHE_SIZE = &lt; size of RECYCLE pool&gt; &lt;br /&gt;&lt;br /&gt;When you use the above parameters, the total memory allocated to the block buffers is the sum of DB_KEEP_CACHE_SIZE, DB_RECYCLE_CACHE_SIZE, and DB_CACHE_SIZE. &lt;br /&gt;&lt;br /&gt;Step 4: Assign tables to KEEP / RECYCLE pool. Identify buffer hit ratio for KEEP, RECYCLE, and DEFAULT pool. Adjust the initialization parameters for optimum performance. &lt;br /&gt;&lt;br /&gt;By default, data blocks are cached in the DEFAULT pool. The DBA must configure the table to use the KEEP or the RECYCLE pool by specifying BUFFER_POOL keyword in the CREATE TABLE or the ALTER TABLE statement. For example, you can assign a table to the recycle pool by using the following ALTER TABLE SQL statement. &lt;br /&gt;&lt;br /&gt;ALTER TABLE TABLE_NAME STORAGE (BUFFER_POOL RECYCLE) &lt;br /&gt;&lt;br /&gt;The DBA can take help from application designers in identifying tables that should use KEEP or RECYCLE pool. You can also query X$BH to examine the current block buffer usage by database objects (You must log in as SYS to query X$BH). The following query returns a list of tables that are rarely used and can be assigned to the RECYCLE pool.  &lt;br /&gt;&lt;br /&gt;Col object_name format a30&lt;br /&gt;Col object_type format a20&lt;br /&gt;SELECT o.owner, object_name, object_type, COUNT(1) buffers&lt;br /&gt;FROM SYS.x$bh, dba_objects o&lt;br /&gt;WHERE (tch = 1 OR (tch = 0 AND lru_flag &lt; 8))&lt;br /&gt;AND obj = o. object_id&lt;br /&gt;AND o.owner not in ('SYSTEM','SYS')&lt;br /&gt;GROUP BY o.owner, object_name, object_type&lt;br /&gt;ORDER BY buffers; &lt;br /&gt;&lt;br /&gt;The following query will return a list of tables that are frequently used by SQL statements and can be assigned to the KEEP pool.  &lt;br /&gt;&lt;br /&gt;SELECT o.owner, object_name, object_type, COUNT(1) buffers&lt;br /&gt;FROM SYS.x$bh, dba_objects o&lt;br /&gt;WHERE tch &gt; 10 &lt;br /&gt;AND lru_flag = 8&lt;br /&gt;AND obj = o.object_id&lt;br /&gt;AND o.owner not in ('SYSTEM','SYS')&lt;br /&gt;GROUP BY o.owner, object_name, object_type&lt;br /&gt;ORDER BY buffers; &lt;br /&gt;&lt;br /&gt;Once you have setup the database to use KEEP and RECYCLE pools, you can monitor the buffer hit ratio by querying V$BUFFER_POOL_STATISTICS and V$DB_CACHE_ADVICE to adjust the buffer pool initialization parameters.  &lt;br /&gt;&lt;br /&gt;Step 5: Identify the amount of memory needed to maintain required performance. &lt;br /&gt;&lt;br /&gt;Oracle 9i maintains block buffer advisory information in V$DB_CACHE_ADVICE. This view contains simulated physical reads for a range of buffer cache sizes. The DBA can query this view to estimate buffer cache requirement for the database. The cache advisory can be activated by setting DB_CACHE_ADIVE initialization parameter.  &lt;br /&gt;&lt;br /&gt;DB_CACHE_ADVICE = ON &lt;br /&gt;&lt;br /&gt;There is a minor overhead associated with cache advisory collection. Hence, it is not advisable to collect these statistics in production databases until there is a need to tune the buffer cache. The DBA can turn on DB_CACHE_ADVISE dynamically for the duration of sample workload period and collect advisory statistics.  &lt;br /&gt;&lt;br /&gt;Conclusion&lt;br /&gt;&lt;br /&gt;Using this methodical approach, a DBA can easily identify the problem areas, and tune the database block buffers. The DBA can create the following buffer pool to efficiently cache data blocks in SGA:&lt;br /&gt;&lt;br /&gt;KEEP: Cache tables that are very critical for system performance. Typically, lookup tables are very good candidates for the KEEP pool. The DBA should create the KEEP pool large enough to maintain 99% buffer hit ratio on this pool. &lt;br /&gt;&lt;br /&gt;RECYCLE: Cache tables that are not critical for system performance. Typically, a table containing historical information that is either rarely queried or used by batch process is a good candidate for the RECYCLE pool. The DBA should create the RECYCLE pool large enough to finish the current transaction.&lt;br /&gt;&lt;br /&gt;DEFAULT: Cache tables that do not belong to either KEEP or RECYCLE pool. &lt;br /&gt;The DBA can setup OEM jobs, Oracle statspack, or custom monitoring scripts to monitor your production database block buffer efficiency, and to identify and tune the problem area.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8255961972681561004?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8255961972681561004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8255961972681561004' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8255961972681561004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8255961972681561004'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/tuning-database-buffer-cache.html' title='Tuning Database Buffer Cache'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6828478397120771912</id><published>2007-06-29T16:22:00.000+05:30</published><updated>2007-06-29T16:23:45.539+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Generate Tablespace Usage Report - Script'/><title type='text'>Sql Statement We Use to Generate Tablespace Usage Report</title><content type='html'>A Sql Statement We Use to Generate Tablespace Usage Report Taking Autoextend Into Consideration&lt;br /&gt;&lt;br /&gt;This article describes the query we created in order to generate Database level Tablespace usage in percentage with Autoextend on. &lt;br /&gt;In past we used a query which was showing total assigned space to a particular tablespace and was not including future growth when Autoextend On.&lt;br /&gt;&lt;br /&gt;So it was giving wrong numbers:&lt;br /&gt;:-&gt; Example: Size of tablespace is 1GB – Used Space is 900MB – Free Space is 100MB – &lt;br /&gt;&lt;br /&gt;Now it has Autoextend On with 4GB Total extension capabilities.&lt;br /&gt;&lt;br /&gt;It was sending us Paging telling only 10 Percentage free –instead it should take Total 4GB in consideration and by that it has total 3.1GB Free. Soo we dug into the data dictionary and found base sys views/tables from where we can get that information and refined our query with the same.&lt;br /&gt;&lt;br /&gt;Query:&lt;br /&gt;&lt;br /&gt;REM Following Sql statement will generate tablespace usage report taking autoextend into consideration&lt;br /&gt;sqlplus "/ as sysdba"&lt;br /&gt;set linesize 250&lt;br /&gt;set pagesize 70&lt;br /&gt;col tablespace_name format a20&lt;br /&gt;select a.tablespace_name, SUM(a.bytes)/1024/1024 "CurMb",&lt;br /&gt;SUM(decode(b.maxextend, null, A.BYTES/1024/1024, b.maxextend*8192/1024/1024)) "MaxMb",&lt;br /&gt;(SUM(a.bytes)/1024/1024 - round(c."Free"/1024/1024)) "TotalUsed",&lt;br /&gt;(SUM(decode(b.maxextend, null, A.BYTES/1024/1024, b.maxextend*8192/1024/1024)) - (SUM(a.bytes)/1024/1024 - round(c."Free"/1024/1024))) "TotalFree",&lt;br /&gt;round(100*(SUM(a.bytes)/1024/1024 - round(c."Free"/1024/1024))/(SUM(decode(b.maxextend, null, A.BYTES/1024/1024, b.maxextend*8192/1024/1024)))) "UPercent"&lt;br /&gt;from dba_data_files a,&lt;br /&gt;sys.filext$ b,&lt;br /&gt;(SELECT c.tablespace_name , sum(c.bytes) "Free" FROM DBA_FREE_SPACE c GROUP BY TABLESPACE_NAME) c&lt;br /&gt;where a.file_id = b.file#(+)&lt;br /&gt;and a.tablespace_name = c.tablespace_name&lt;br /&gt;GROUP by a.tablespace_name, c."Free"/1024&lt;br /&gt;/&lt;br /&gt;exit;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6828478397120771912?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6828478397120771912/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6828478397120771912' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6828478397120771912'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6828478397120771912'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/sql-statement-we-use-to-generate.html' title='Sql Statement We Use to Generate Tablespace Usage Report'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4923714973562120432</id><published>2007-06-29T16:08:00.000+05:30</published><updated>2007-07-02T10:02:11.977+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tuning a SQL Statement'/><title type='text'>An Approach to Tuning a SQL Statement</title><content type='html'>While application knowledge and experience is helpful, We've got a methodical approach to use when asked to tune a SQL statement. &lt;br /&gt;&lt;br /&gt;Here's the basic approach/process that can be used to diagnose and analyze a SQL statement..&lt;br /&gt;&lt;br /&gt;Analyze the Statement &lt;br /&gt;&lt;br /&gt;1. We can start by reviewing the WHERE clause, dividing it into clauses that restrict rows and those that join tables.&lt;br /&gt;&lt;br /&gt;2. We can locate candidate Driving Tables by looking at the "restrict rows" clauses as determining which table has the most restrictive clauses ( i.e. those that will result in the fewest rows). If not sure between a couple of candidates, we can pick one.&lt;br /&gt;&lt;br /&gt;3. Next we have to list all the tables in the FROM clause, starting with the driving table, using the JOIN criteria to link from one table to the next. This generates an ordered list of how the database should be accessing the tables, starting with the candidate driving table. This exercise generates all possible ways to join the tables together as well as making sure there are Join criteria for all the tables in the FROM clause.&lt;br /&gt;&lt;br /&gt;4. Look for indexes on the driving table and determine which should be used or if a full table scan would be best. If we find a better index than the one the optimizer picks then we add an Index hint to get the desired index to be used. If a full table scan is in order, we consider adding a parallel hint.&lt;br /&gt;&lt;br /&gt;5. We can try to join two tables that have restrictive where clauses before joining two tables that don't have any such clauses.&lt;br /&gt;&lt;br /&gt;6. We now have one or more candidate explain plan(s) that need to be tested.&lt;br /&gt;Compare Plans &lt;br /&gt;&lt;br /&gt;1. Next we compare the actual explain plan of the statement in question with the candidate plans generated in the above exercise&lt;br /&gt;&lt;br /&gt;2. Looking at the actual data (and running some queries to collect metrics) we consider trying different driving tables and join orders.&lt;br /&gt;&lt;br /&gt;3. We review and compare each, and subjectively arrive at a best guess plan.&lt;br /&gt;&lt;br /&gt;Test it out &lt;br /&gt;&lt;br /&gt;1. The most effective hint we've found is the ORDERED hint. This works especially well when you have a lot of tables in the FROM clause.&lt;br /&gt;&lt;br /&gt;2. We add /*+ ordered */ after the Select verb and the list the tables in the from clause from first to last the way we listed them in Analysis Step 3. Adding other hints like /*+ Full (driving table alias) */ is also a good way to get the optimizer to use the proper driving table.&lt;br /&gt;&lt;br /&gt;3. Run an explain plan using the above HINTs. &lt;br /&gt;&lt;br /&gt;4. If the plan looks good, execute it for real. Set Timing On and set Autotrace On (hopefully you have that enabled in your database)&lt;br /&gt;&lt;br /&gt;5. Run the old and new statements several times to see how the timings work out. The Autotrace summary of blocks touched is a. good indicator of performance: the fewer blocks touched, the better.&lt;br /&gt;&lt;br /&gt;Tuning Hints and Tips &lt;br /&gt;&lt;br /&gt;1. There are many other hints and techniques that can influence an explain plan. Keep in mind that a Hash Join is nearly always better than a Merge Join&lt;br /&gt;&lt;br /&gt;2. Nested Loop is better only if a few rows are being retrieved.&lt;br /&gt;&lt;br /&gt;3. Tuning sub-selects can be tricky. We will often rewrite a statement to replace " IN (Select...) or a NOT IN" with a join to an in-line view and achieve significant performance increase by avoiding executing thousands of Nested Loop index reads with a hash join. Listing more statement rewrite options is beyond the scope of this article.&lt;br /&gt;&lt;br /&gt;Those are the basic steps We follow. Give them a try and over time we are confident your SQL tuning skills will expand.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-4923714973562120432?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/4923714973562120432/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=4923714973562120432' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4923714973562120432'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/4923714973562120432'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/how-i-approach-tuning-sql-statement.html' title='An Approach to Tuning a SQL Statement'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-7754563179083694426</id><published>2007-06-29T16:01:00.001+05:30</published><updated>2007-07-16T15:36:44.835+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Manually un-installed Oracle 10g'/><title type='text'>Manually un-installed Oracle 10g</title><content type='html'>How we Manually un-installed Oracle 10g - Windows&lt;br /&gt;&lt;br /&gt;As a testing box for RMAN and Flashback query, we are supposed to install and perform the required tests on 10g DB. During the first iteration we encountered that OUI was not responding, I believed it to be the security settings on the Windows box. But it was not getting better after changing the security settings on Windows.&lt;br /&gt;&lt;br /&gt;Here the steps we took to manually un-install Oracle 10g on Windows 2003 / XP.&lt;br /&gt;&lt;br /&gt;On the desktop, we Right Click on MyComputer Icon and selected "Manage".  On the left hand pane, we selected "Service and Applications" from Computer Management. &lt;br /&gt;&lt;br /&gt;** Alternatively you can also select Services from Control Panel.&lt;br /&gt;&lt;br /&gt;In the next step we Shutdown Oracle Instance and related Oracle Services. Some of them might give errors " Unable to shutdown". It could be because of improper installation.  Now after shutting down the Oracle services, we had to locate the registry entries for Oracle and delete them manually.&lt;br /&gt;&lt;br /&gt;We made a backup of registry.&lt;br /&gt;&lt;br /&gt;We then clicked on Start --&gt; Run --&gt; Regedit.&lt;br /&gt;&lt;br /&gt;Looked for the following entries:&lt;br /&gt;=============================================================================&lt;br /&gt;HKEY_CURRENT_USER\SOFTWARE\ORACLE&lt;br /&gt;HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\Oracle.oracle&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OracleDBConsole&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Oracle10g_home&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\OraclService&lt;br /&gt;========================================================================= &lt;br /&gt;Deleting  the above entries from the registry required a reboot, so we did a Reboot of the windows box.&lt;br /&gt;Some entries in the registry like registering of some components required cleaning software. We did it using "CleanMyPCRegistry”. This removed any discrepancies in the registry.&lt;br /&gt;&lt;br /&gt;Now in the next step we deleted the physical directories.&lt;br /&gt;&lt;br /&gt;C:\Oracle&lt;br /&gt;&lt;br /&gt;Deleted the Oracle Program Files directory:&lt;br /&gt;C:\Program Files\Oracle&lt;br /&gt;Deleted the Oracle Start Menu shortcuts directory:&lt;br /&gt;C:\Documents and Settings\All Users\Start Menu\Programs\Oracle&lt;br /&gt;&lt;br /&gt;Removed Oracle references from the path. To edit the path we went to:&lt;br /&gt;&lt;br /&gt;Start-&gt;Settings-&gt;Control Panel-&gt;System-&gt;Advanced-&gt;Environment Variables&lt;br /&gt;&lt;br /&gt;We edited both of the environment variables user PATH and system PATH. Remove any Oracle references in them.&lt;br /&gt;&lt;br /&gt;Then we removed Oracle.DataAccess and any Polic.Oracle files from the GAC which is at:&lt;br /&gt;C:\Windows\assembly\&lt;br /&gt;&lt;br /&gt;We also received an error while removing the $ORACLE_HOME/bin directory. While un-installing oci.dll (Oracle Call interface could not be deleted.&lt;br /&gt;&lt;br /&gt;To resolve this, we renamed the Oracle/bin folder and re-boot the machine. After reboot, we are able to delete the oci.dll. We then proceeded with the proper installation of Oracle 10g R2.&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-7754563179083694426?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/7754563179083694426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=7754563179083694426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7754563179083694426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7754563179083694426'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/manually-un-installed-oracle-10g.html' title='Manually un-installed Oracle 10g'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2208246676809057026</id><published>2007-06-29T15:54:00.000+05:30</published><updated>2007-06-29T15:57:50.752+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Address Windowing Extensions (AWE)'/><title type='text'>Implementing Address Windowing Extensions (AWE) or VLM on Windows Platforms</title><content type='html'>PURPOSE&lt;br /&gt;-------&lt;br /&gt;&lt;br /&gt;To address the growing need for use of more memory on 32-Bit Windows platforms,&lt;br /&gt;and explain how AWE is implemented by Oracle on Windows.&lt;br /&gt; &lt;br /&gt;SCOPE &amp; APPLICATION&lt;br /&gt;-------------------&lt;br /&gt;    Oracle DBA's running on the Microsoft Windows platform.&lt;br /&gt;    Oracle Support Analysts, Field Engineers troubleshooting problems&lt;br /&gt;    related to AWE and/or memory issues on Windows.&lt;br /&gt;&lt;br /&gt;AWE Memory implementation on Windows 2000&lt;br /&gt;------------------------------------------&lt;br /&gt; &lt;br /&gt;    A common question on the Windows NT/Windows 2000 platform revolves around &lt;br /&gt;    how to take advantage of systems with more than 4 GB of RAM.  As discussed &lt;br /&gt;    in Metalink  Note 46001.1 and Note 46053.1, the 32-Bit process address &lt;br /&gt;    space for any process on Windows equates to a total of 4GB of addressable &lt;br /&gt;    RAM. Of this, by default, 2GB is reserved for the process itself, and 2GB &lt;br /&gt;    for the kernel.  On systems running either Windows 2000 Advanced Server, &lt;br /&gt;    or Windows NT 4.0 Enterprise Edition, this ratio can be changed by adding &lt;br /&gt;    the /3GB switch to the boot.ini, allowing a process to address 3GB and &lt;br /&gt;    reserving 1GB for the kernel.  However, the total addressable memory for&lt;br /&gt;    a single process is still only 4GB.&lt;br /&gt;    See also Note 1036312.6 : Utilizing Up to 3GB Virtual Memory on Windows NT Server 4.0&lt;br /&gt;&lt;br /&gt;__________________________________________________________________&lt;br /&gt;&lt;br /&gt;What can be done to address memory beyond 4GB?:&lt;br /&gt;===============================================&lt;br /&gt;&lt;br /&gt;    The answer is to take advantage of Physical Address Extensions (PAE), or &lt;br /&gt;    Address Windowing Extensions (AWE)(These two terms are used interchangeably, &lt;br /&gt;    so the rest of this document will refer to this simply as AWE). &lt;br /&gt;    AWE support is available if you are running on a machine with more than 4GB   &lt;br /&gt;    of physical RAM which is running any of the below Windows operating systems:&lt;br /&gt;&lt;br /&gt;    * Windows 2000 Datacenter Server&lt;br /&gt;    * Windows 2000 Advanced Server&lt;br /&gt;    * Windows 2003 Data Center Edition (32-Bit)&lt;br /&gt;    * Windows 2003 Enterprise Edition (32-Bit) &lt;br /&gt;&lt;br /&gt;    On the above operating systems, AWE support is built into the OS.  No&lt;br /&gt;    special drivers are needed to take advantage of the additional memory.&lt;br /&gt;&lt;br /&gt;  AWE CANNOT be used on the following Operating Systems:&lt;br /&gt;&lt;br /&gt;    * Windows 2000 Server (Standard)&lt;br /&gt;    * Windows 2000 Professional&lt;br /&gt;    * Windows XP Home Edition&lt;br /&gt;    * Windows XP Professional&lt;br /&gt;    * Windows 2003 Standard Edition&lt;br /&gt;    * Windows 2003 Web Edition&lt;br /&gt;&lt;br /&gt;   NOTE Also that on 64-Bit Windows operating systems, there is no need for AWE&lt;br /&gt;   implementation support, because the directly addressable memory for a single&lt;br /&gt;   process on 64-Bit Windows is 8 Terabytes.&lt;br /&gt;&lt;br /&gt;__________________________________________________________________&lt;br /&gt;&lt;br /&gt;Oracle versions that can use AWE:&lt;br /&gt;=================================&lt;br /&gt;&lt;br /&gt;    Oracle can take advantage of AWE in the following RDBMS releases:&lt;br /&gt;&lt;br /&gt;    * Oracle 8.1.6.x&lt;br /&gt;    * Oracle 8.1.7.x&lt;br /&gt;    * Oracle 9.2.x&lt;br /&gt;    * Oracle 10.1.x&lt;br /&gt;&lt;br /&gt;   Oracle does NOT implement AWE support in release 9.0.1.x&lt;br /&gt;&lt;br /&gt;   AWE support is available on both the Enterprise Edition of Oracle and&lt;br /&gt;   the Standard Edition of Oracle.  However, on Standard Edition of 9.2.0.1, &lt;br /&gt;   you may receive the following error if trying to start the database with&lt;br /&gt;   USE_INDIRECT_DATA_BUFFERS=TRUE:&lt;br /&gt;&lt;br /&gt;   ORA-439 - FEATURE NOT ENABLED: VERY LARGE MEMORY&lt;br /&gt;&lt;br /&gt;   In Standard Edition 9.2.0.2 and 9.2.0.3, you will not receive the above errors, &lt;br /&gt;   but VLM functionality is still not enabled.  Refer to BUG#2945011 for more detail.&lt;br /&gt;   This BUG is fixed in 9.2.0.3 Patch 2, and will be fixed in 9.2.0.4 as well.&lt;br /&gt;&lt;br /&gt;__________________________________________________________________&lt;br /&gt;&lt;br /&gt;Enabling support at the OS level:&lt;br /&gt;==================================&lt;br /&gt;&lt;br /&gt;    AWE can be enabled at the OS by adding the /PAE switch to the boot.ini &lt;br /&gt;    as such:&lt;br /&gt;&lt;br /&gt;multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /PAE&lt;br /&gt;&lt;br /&gt;    It IS possible to have BOTH the /PAE and /3GB switch in place on the same&lt;br /&gt;    machine, as such:&lt;br /&gt;&lt;br /&gt;multi(0)disk(0)rdisk(0)partition(1)\WINNT="Microsoft Windows 2000 Advanced Server" /3GB /PAE&lt;br /&gt;&lt;br /&gt;    However, be aware that if BOTH switches are in place, the server will only&lt;br /&gt;    be able to recognize up to 16GB of RAM.  If you are working with a server &lt;br /&gt;    with more than 16GB of RAM, you will need to choose between the two.&lt;br /&gt;&lt;br /&gt;    It is important to note that once either or both of these switches are in&lt;br /&gt;    place in the boot.ini, ALL processes running can take advantage of these&lt;br /&gt;    switches.  Thus, in a case where multiple Oracle instances are running on&lt;br /&gt;    the same server, ALL instances can take advantage of the additional memory                &lt;br /&gt;    afforded by these switches, up to the amount of physical memory on the box.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Operating System Privileges Needed at the OS Level:&lt;br /&gt;====================================================&lt;br /&gt;&lt;br /&gt;   In order to take advantage of the additional memory afforded through PAE,&lt;br /&gt;   the operating system user account which is used to start the OracleService&lt;SID&gt;&lt;br /&gt;   must be granted the 'Lock Pages in Memory' system privilege at the operating system&lt;br /&gt;   level.   By default, the OracleService&lt;SID&gt; starts as the LocalSystem account.&lt;br /&gt;   The LocalSystem account has the privilege to Lock Pages in Memory granted to &lt;br /&gt;   it by default.&lt;br /&gt;&lt;br /&gt;   However, if you change the OracleService&lt;SID&gt; to logon as a user OTHER than&lt;br /&gt;   LocalSystem, you may see the following errors when attempting to start the&lt;br /&gt;   database with USE_INDIRECT_DATA_BUFFERS set to TRUE :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   SQL&gt; startup pfile=c:\temp\initscott.ora&lt;br /&gt;   ORA-27102: out of memory&lt;br /&gt;   OSD-00010: Message 10 not found;  product=RDBMS; facility=SOSD&lt;br /&gt;   &lt;br /&gt;   O/S-Error: (OS 1300) Not all privileges referenced are assigned to the caller.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;   To rectify this, you must grant the 'Lock pages in memory' privilege to the user&lt;br /&gt;   that the OracleService&lt;SID&gt; starts as.  To do this, click on:&lt;br /&gt;   Start -&gt;  Programs -&gt; Administrative Tools -&gt; Local Security Policy&lt;br /&gt;   (on a Domain Controller, click on 'Domain Security Policy' instead of 'Local Security Policy')&lt;br /&gt;   Double-click on the 'Lock Pages in memory' policy.&lt;br /&gt;   Add the appropriate user and click 'Ok'.&lt;br /&gt;   Restart the OracleService&lt;SID&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;__________________________________________________________________&lt;br /&gt;&lt;br /&gt;Understanding the Oracle implementation of AWE support:&lt;br /&gt;=======================================================&lt;br /&gt;&lt;br /&gt;    What the PAE switch allows you to do from the Oracle perspective is to &lt;br /&gt;    increase the amount of memory that can be used for the Oracle Database &lt;br /&gt;    Block Buffer Cache.  It is important to note that this additional memory &lt;br /&gt;    can ONLY be used by Oracle in the form of an increased value for &lt;br /&gt;    DB_BLOCK_BUFFERS.  &lt;br /&gt;&lt;br /&gt;    There is still confusion on the old style of VLM versus AWE on Windows 2000. &lt;br /&gt;    With VLM on Windows NT 4.0, there was the concept of pointers pointing to &lt;br /&gt;    the extended memory area, but that is no longer the case on Windows 2000.&lt;br /&gt;    Instead, the windowing technology as described in these articles is being &lt;br /&gt;    used.  For more information on AWE/PAE implementation on the Windows &lt;br /&gt;    platform, refer to Microsoft's website.&lt;br /&gt;&lt;br /&gt;    As mentioned previously, with AWE enabled, this allows the process(es) &lt;br /&gt;    (in this case ORACLE.EXE) to use memory above and beyond the 4GB &lt;br /&gt;    mark defined by a 32-Bit Process Address space.  The physical location of &lt;br /&gt;    these blocks does not matter.  However, the database blocks must still be &lt;br /&gt;    accessed from within a ‘window’, which exists (logically) in that regular &lt;br /&gt;    3GB process address space. &lt;br /&gt;    The size of this window is defined by a registry setting in the HOME key for &lt;br /&gt;    Oracle (HKLM\Software\Oracle\Homex) called AWE_WINDOW_MEMORY.  By default, &lt;br /&gt;    this value is 1GB, so if this value is not set in the registry,  &lt;br /&gt;    AWE_WINDOW_MEMORY will be 1GB.  &lt;br /&gt;&lt;br /&gt;    It is important to realize that any database blocks accessed by Oracle &lt;br /&gt;    (or any user/background thread within Oracle.exe) must first be mapped into &lt;br /&gt;    the 'window' defined by AWE_WINDOW_MEMORY.  In this scenario, it does not&lt;br /&gt;    matter where the blocks are physically located - there is no need to be &lt;br /&gt;    concerned with where the blocks are physically residing.  The window will be &lt;br /&gt;    drawn around the block (i.e. the block will be mapped) wherever it is located  &lt;br /&gt;    in memory.  If the block is in memory but has not been mapped into the &lt;br /&gt;    ‘window’, then it may be necessary to unmapped another block that IS in the &lt;br /&gt;    window, in order to accommodate the new block.  While this mapping and &lt;br /&gt;    unmapping of blocks does add some cost, it is still faster than incurring &lt;br /&gt;    an I/O operation to read the block from disk.  This will be discussed &lt;br /&gt;    further down in the section on troubleshooting.&lt;br /&gt;    &lt;br /&gt;    Note:   &lt;br /&gt;&lt;br /&gt;    Keep in mind that if there are multiple instances on a machine with &lt;br /&gt;    the /PAE switch enabled, ALL instances can take advantage of the additional &lt;br /&gt;    memory.  However, AWE_WINDOW_MEMORY cannot be set on a per-instance basis,&lt;br /&gt;    so all databases that are running out of the HOMEx key where &lt;br /&gt;    AWE_WINDOW_MEMORY is set will inherit the same value.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;__________________________________________________________________&lt;br /&gt;&lt;br /&gt;Enabling AWE Support at the Database/Instance Level:&lt;br /&gt;====================================================&lt;br /&gt;&lt;br /&gt;    To enable the AWE implementation on Oracle, you must set the following &lt;br /&gt;    parameter in the init file (or spfile) used to start the instance:&lt;br /&gt;&lt;br /&gt;      USE_INDIRECT_DATA_BUFFERS=TRUE&lt;br /&gt;&lt;br /&gt;    Note again that the buffer cache MUST be defined using the parameter &lt;br /&gt;    DB_BLOCK_BUFFERS, no matter what version of the RDBMS you are running.  &lt;br /&gt;    The 9.2 feature allowing for Multiple block sizes in a database will be &lt;br /&gt;    disabled if you set USE_INDIRECT_DATA_BUFFERS=TRUE, and you cannot specify &lt;br /&gt;    the DB_CACHE_SIZE parameter to define the size of the buffer cache.&lt;br /&gt;    &lt;br /&gt;&lt;br /&gt;    On 9.2, if you attempt to startup a database with this combination of &lt;br /&gt;    parameters:&lt;br /&gt;&lt;br /&gt;      USE_INDIRECT_DATA_BUFFERS=TRUE&lt;br /&gt;      DB_CACHE_SIZE=xxxxx (Any number)&lt;br /&gt;&lt;br /&gt;    The startup will fail with the following error:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      SQL&gt; startup&lt;br /&gt;      ORA-00385: cannot enable Very Large Memory with new buffer cache &lt;br /&gt;      parameters&lt;br /&gt;&lt;br /&gt;    You must change DB_CACHE_SIZE to use DB_BLOCK_BUFFERS instead, as was the &lt;br /&gt;    syntax under Oracle8i and earlier.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;__________________________________________________________________&lt;br /&gt;&lt;br /&gt;AWE_WINDOW_MEMORY Within the 3GB Process Address Space:&lt;br /&gt;=======================================================&lt;br /&gt;&lt;br /&gt;    If you are using /PAE and the /3GB switch together, the address space for &lt;br /&gt;    ORACLE.EXE will be 3GB.  The value for AWE_WINDOW_MEMORY must come from the &lt;br /&gt;    normal address space used by the ORACLE.EXE process.  Memory that comes &lt;br /&gt;    from that 3GB address space addressable by the oracle.exe process includes&lt;br /&gt;    the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     ·The Value for AWE_WINDOW_MEMORY&lt;br /&gt;     ·The rest of the SGA (shared_pool, large_pool, java_pool, log_buffers, etc)&lt;br /&gt;     ·Overhead for Oracle.exe and DLL’s (65-100M depends on version &amp; options)&lt;br /&gt;     ·Stack space for all threads (Defaults to 1MB/thread, unless orastack &lt;br /&gt;         is used)&lt;br /&gt;     ·PGA and UGA memory for all user sessions&lt;br /&gt;&lt;br /&gt;    Therefore, the value for AWE_WINDOW_MEMORY should be tuned such that mapping&lt;br /&gt;    and unmapping operations are avoided as much as possible, while still &lt;br /&gt;    allowing enough memory within the 3GB address space for the rest of the &lt;br /&gt;    process memory that MUST fit within the 3GB (i.e. overhead, remaining SGA&lt;br /&gt;    components and all user connection memory (stack + uga + pga) noted above).&lt;br /&gt;&lt;br /&gt;    The total size of the buffer cache can then be set to the amount of &lt;br /&gt;    physical memory remaining above the 4GB barrier, plus AWE_WINDOW_MEMORY.&lt;br /&gt;    On a machine with 12GB of RAM, using the default value of 1GB for &lt;br /&gt;    AWE_WINDOW_MEMORY, your total buffer cache could theoretically be as high &lt;br /&gt;    as 9GB:&lt;br /&gt;&lt;br /&gt;     (Total RAM - 4GB + AWE_WINDOW_MEMORY) = 12GB - 4GB + 1GB = 9GB&lt;br /&gt;&lt;br /&gt;    In reality, your maximum buffer cache size will be somewhat less than &lt;br /&gt;    this, allowing for some overhead and additional processes running on the &lt;br /&gt;    system. &lt;br /&gt;&lt;br /&gt;    Attempting to startup the database with a buffer cache larger than the &lt;br /&gt;    maximum value as calculated above may result in the following errors:&lt;br /&gt;&lt;br /&gt;      ORA-27102 out of memory &lt;br /&gt;      OSD-00034 Message 34 not found;  Product=RDBMS;facility =SOSD &lt;br /&gt;      O/S Error: (OS 8) Not enough storage is available to process this command&lt;br /&gt;&lt;br /&gt;    (Note - If you are on Release 9.2, another possible cause for these errors &lt;br /&gt;    is  noted further down, in the troubleshooting section)&lt;br /&gt;&lt;br /&gt;    As mentioned above, the buffer cache must be specified using &lt;br /&gt;    DB_BLOCK_BUFFERS rather than DB_CACHE_SIZE, so assuming an 8K block &lt;br /&gt;    size (8192), to get a 9GB buffer cache, you would set the following init &lt;br /&gt;    parameters:&lt;br /&gt;&lt;br /&gt;      DB_BLOCK_BUFFERS = 1179648&lt;br /&gt;      DB_BLOCK_SIZE = 8192&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;__________________________________________________________________&lt;br /&gt;&lt;br /&gt;Troubleshooting AWE_WINDOW_MEMORY implementation:&lt;br /&gt;&lt;br /&gt;=========================&lt;br /&gt;=========================&lt;br /&gt;&lt;br /&gt;Minimum Value Required for AWE_WINDOW_MEMORY in 9.2 and Above:&lt;br /&gt;==============================================================&lt;br /&gt;&lt;br /&gt;    Here are key points to understand when using AWE_WINDOW_MEMORY:&lt;br /&gt;&lt;br /&gt;     1.  Under Oracle 8.1.7 we do NOT enforce a minimum value for &lt;br /&gt;         AWE_WINDOW_MEMORY to be able to start the database.&lt;br /&gt;     2.  This was changed under Oracle9i Release 2, such that we DO &lt;br /&gt;         enforce a minimum value for AWE_WINDOW_MEMORY. This change was &lt;br /&gt;         done to help improve performance by enforcing a larger window size.&lt;br /&gt;     3.  You can alter the minimum required value for AWE_WINDOW_MEMORY &lt;br /&gt;         under 9.2 by changing/setting the value of the parameter &lt;br /&gt;         _DB_BLOCK_LRU_LATCHES.  Under 8.1.7, this parameter was named &lt;br /&gt;         DB_BLOCK_LRU_LATCHES.  However, under 9.x, this parameter was &lt;br /&gt;         changed to be a hidden parameter.&lt;br /&gt;&lt;br /&gt;    The minimum value for AWE_WINDOW_MEMORY starting with 9.2 is calculated as such:&lt;br /&gt;&lt;br /&gt;    MIN(AWE_WINDOW_MEMORY)=(4096 * DB_BLOCK_SIZE * _DB_BLOCK_LRU_LATCHES)/8&lt;br /&gt;&lt;br /&gt;    Starting with 9.2, to calculate the value for _DB_BLOCK_LRU_LATCHES, we need &lt;br /&gt;    this formula:&lt;br /&gt;&lt;br /&gt;    _DB_BLOCK_LRU_LATCHES = (Max buffer pools * SETS_PER_POOL) &lt;br /&gt;&lt;br /&gt;    Max Buffer Pools is a constant = 8&lt;br /&gt;    SETS_PER_POOL is variable, and depends on whether or not VLM is enabled.&lt;br /&gt;&lt;br /&gt;    SETS_PER_POOL = 2* CPU_COUNT   (if VLM is enabled)&lt;br /&gt;    SETS_PER_POOL= CPU Count /2  (If VLM is NOT enabled)&lt;br /&gt;&lt;br /&gt;    /* Recall that VLM is enabled by setting USE_INDIRECT_DATA_BUFFERS=TRUE&lt;br /&gt;&lt;br /&gt;    So, as you can see, the value for _DB_BLOCK_LRU_LATCHES in 9.2 and above is &lt;br /&gt;    dependent on the number of CPU's in the box, and therefore &lt;br /&gt;    MIN(AWE_WINDOW_MEMORY) is dependent on the # of CPU's as well as the &lt;br /&gt;    DB_BLOCK_SIZE.  The larger the Block Size, and the more CPU's in a system,&lt;br /&gt;    the higher the value for MIN(AWE_WINDOW_MEMORY). Here are a couple of &lt;br /&gt;    example configurations and caclulations showing MIN(AWE_WINDOW_MEMORY).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    Example #1:&lt;br /&gt;    ----------------&lt;br /&gt;      # of CPU's = 8&lt;br /&gt;      DB_BLOCK_SIZE = 8192&lt;br /&gt;      Total RAM = 8GB&lt;br /&gt;&lt;br /&gt;      SETS_PER_POOL = 2 * CPU_COUNT = 16&lt;br /&gt;      _DB_BLOCK_LRU_LATCHES = (max buffer Pools * sets_per_pool) = 8*16 = 128&lt;br /&gt;      MIN(AWE_WINDOW_MEMORY) =(4096*DB_BLOCK_SIZE*_DB_BLOCK_LRU_LATCHES)/8 = &lt;br /&gt;      ( 4096 * 8192 * 128) / 8 = 536870912 bytes = 512 MB&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    Example #2:&lt;br /&gt;    ---------------&lt;br /&gt;      # of CPU's = 16&lt;br /&gt;      DB_BLOCK_SIZE = 8192&lt;br /&gt;      Total RAM = 16 GB&lt;br /&gt;&lt;br /&gt;      SETS_PER_POOL = 2 * CPU_COUNT = 32&lt;br /&gt;      _DB_BLOCK_LRU_LATCHES = (max buffer Pools * sets_per_pool) = 8*32 = 256&lt;br /&gt;      MIN(AWE_WINDOW_MEMORY) =(4096*DB_BLOCK_SIZE*_DB_BLOCK_LRU_LATCHES)/8 = &lt;br /&gt;      ( 4096 * 8192 * 256) / 8 = 1073741824 bytes = 1024 MB&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br /&gt;    These values above are the minimum values required for AWE_WINDOW_MEMORY &lt;br /&gt;    to be set to, UNLESS you explicitly set _DB_BLOCK_LRU_LATCHES to a lower&lt;br /&gt;    value.  If AWE_WINDOW_MEMORY is not set to the minimum value, you will &lt;br /&gt;    receive the following errors:&lt;br /&gt;&lt;br /&gt;      ORA-27102 out of memory &lt;br /&gt;      OSD-00034 Message 34 not found;  Product=RDBMS;facility =SOSD &lt;br /&gt;      O/S Error: (OS 8) Not enough storage is available to process this command&lt;br /&gt;&lt;br /&gt;    If you receive these errors when trying to start the database under 9.2 or 10g, &lt;br /&gt;    this may be because the AWE_WINDOW_MEMORY value in the registry is set &lt;br /&gt;    too low for the calculated minimum value.  If you cannot increase the &lt;br /&gt;    value for AWE_WINDOW_MEMORY, then you can explicitly set &lt;br /&gt;    _DB_BLOCK_LRU_LATCHES to a value lower than the calculated value, and &lt;br /&gt;    retry the startup.&lt;br /&gt;&lt;br /&gt;    _DB_BLOCK_LRU_LATCHES must be at least 8 (Equal to the maximum number of&lt;br /&gt;    buffer pools)&lt;br /&gt;&lt;br /&gt;    Note #1 - Recall from the earlier section that these errors may also occur if&lt;br /&gt;    you are trying to start up with a buffer cache that is too large for the &lt;br /&gt;    physical memory available.&lt;br /&gt;&lt;br /&gt;    Note #2 - The same errors above have also been observed with a buffer&lt;br /&gt;    cache that is too small.  When USE_INDIRECT_DATA_BUFFERS is set to TRUE&lt;br /&gt;    the value for DB_BLOCK_BUFFERS should equate to a buffer cache that is&lt;br /&gt;    AT LEAST equal to AWE_WINDOW_MEMORY.  In most cases, the total buffer&lt;br /&gt;    cache size will be greater than AWE_WINDOW_MEMORY.  If you attempt to &lt;br /&gt;    start up with a buffer cache that is too small (i.e. &lt; AWE_WINDOW_MEMORY)&lt;br /&gt;    that may also result in the ORA-27102 error.&lt;br /&gt;&lt;br /&gt;    Note#3 - It has been observed on some systems that you may need to add a few&lt;br /&gt;    additional meg to AWE_WINDOW_MEMORY to calculate for overhead.  Therefore, if&lt;br /&gt;    you go through the above calculations, and the instance still does not start,&lt;br /&gt;    try adding an additional 10 Meg or so to the calculated value.&lt;br /&gt; &lt;br /&gt;    Note#4 - Also, keep in mind that when calculating the # of CPU's in the system,&lt;br /&gt;    you have to take hyperthreading into account.  On a hyperthreaded system, the OS&lt;br /&gt;    will think that you have double the # of CPU's in the system over what you actually &lt;br /&gt;    have, and this is the number that must be used in the calculations.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;How to calculate the maximum used memory&lt;br /&gt;=========================================&lt;br /&gt;    With respect to awe_window_memory the following maximum amount of memory can be used&lt;br /&gt;    from physical memory: &lt;br /&gt;&lt;br /&gt;    The SGA size is composed from:&lt;br /&gt;    ((db_block_buffers * block size) +  (shared_pool_size + large_pool_size + &lt;br /&gt;    java_pool_size + log_buffers) + 1MB&lt;br /&gt;    The size of SGA + Oracle's overhead  must not exceed the available virtual memory.&lt;br /&gt;&lt;br /&gt;    The size of buffer cache depends on the available virual memory and can be calculated with&lt;br /&gt;    buffer cache = db_block_buffer * db_block_size&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CPU Spins Possible When Using AWE Implementation:&lt;br /&gt;=================================================&lt;br /&gt;&lt;br /&gt;    Use caution when setting _DB_BLOCK_LRU_LATCHES or AWE_WINDOW_MEMORY too low. &lt;br /&gt;    If we are unable to map a requested buffer into the window because all of &lt;br /&gt;    the space  defined by AWE_WINDOW_MEMORY is in use with buffers already &lt;br /&gt;    actively being accessed, then we spin and wait, checking every so often &lt;br /&gt;    until an existing buffer in the window can be unmapped, and a new buffer can&lt;br /&gt;    be mapped in. &lt;br /&gt; &lt;br /&gt;    This spin will consume CPU cycles until enough buffers can be &lt;br /&gt;    Mapped/Unmapped to satisfy the request.  In some cases, there may be so &lt;br /&gt;    many buffers needing to be mapped into the window, that DBWR will consume &lt;br /&gt;    100% of cycles on all CPUs, effectively locking up the machine.  This is &lt;br /&gt;    normal behavior under some circumstances, and is simply an indication that &lt;br /&gt;    AWE_WINDOW_MEMORY is too small.  &lt;br /&gt;&lt;br /&gt;Monitoring Mapping Operations in 9.2 and later releases:&lt;br /&gt;========================================================&lt;br /&gt;&lt;br /&gt;    Starting with 9.2, we have added additional statistics which can be &lt;br /&gt;    measured in v$sesstat (sesssion-level stats) and v$sysstat (system-wide &lt;br /&gt;    stats):&lt;br /&gt;&lt;br /&gt;    STATISTIC# NAME&lt;br /&gt;    ---------- ------------------------------&lt;br /&gt;    154 number of map operations&lt;br /&gt;    155 number of map misses&lt;br /&gt;&lt;br /&gt;    This query below will give you system-wide information on map &lt;br /&gt;    operations and map misses:&lt;br /&gt;    &lt;br /&gt;      SQL&gt; select * from v$sysstat where statistic# in (154, 155);&lt;br /&gt;&lt;br /&gt;    If the # of Map misses is relatively high, or particularly of the # of map&lt;br /&gt;    misses increases consistently over time, this may be an indication that the&lt;br /&gt;    value for AWE_WINDOW_MEMORY is set too low.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Dynamic Memory Management/Automatic Memory Management with AWE Enabled&lt;br /&gt;=============================================================&lt;br /&gt;&lt;br /&gt;Oracle10g introduces the concept of Automatic Memory Management, &lt;br /&gt;whereby the Oracle RDBMS will dynamically adjust SGA parameters &lt;br /&gt;such as SHARED_POOL_SIZE, JAVA_POOL_SIZE, DB_CACHE_SIZE, etc.&lt;br /&gt;&lt;br /&gt;This is enabled by setting the parameter SGA_TARGET to a non-zero value.&lt;br /&gt;However, in order for this to work properly, you must use DB_CACHE_SIZE&lt;br /&gt;for the buffer cache.   When setting USE_INDIRECT_DATA_BUFFERS, you cannot&lt;br /&gt;set DB_CACHE_SIZE, as noted above.  Therefore, SGA_TARGET should not be set&lt;br /&gt;when using AWE - these two features are mutally exclusive.&lt;br /&gt;When setting USE_INDIRECT_DATA_BUFFERS=TRUE on Oracle10g, you should also&lt;br /&gt;set SGA_TARGET to 0.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Diagnosing Spins Associated With AWE in 8.1.x:&lt;br /&gt;==============================================&lt;br /&gt;&lt;br /&gt;    The above stats are not available in 8.1.7, so if you are encountering &lt;br /&gt;    problems with CPU spins, with AWE_WINDOW_MEMORY enabled, it is more &lt;br /&gt;    difficult to diagnose.&lt;br /&gt;&lt;br /&gt;    You can start by identifying and monitoring the thread associated with &lt;br /&gt;    DBWR via the following query:&lt;br /&gt;&lt;br /&gt;      SQL&gt; select b.name, p.spid  from v$process p, v$bgprocess b&lt;br /&gt;      where p.addr=b.paddr;&lt;br /&gt;&lt;br /&gt;      NAME  SPID&lt;br /&gt;      ----- ---------&lt;br /&gt;      PMON  1900&lt;br /&gt;      DBW0  1956&lt;br /&gt;      LGWR  572&lt;br /&gt;      CKPT  1908&lt;br /&gt;      SMON  1808&lt;br /&gt;      RECO  920&lt;br /&gt;      SNP0  1784&lt;br /&gt;      SNP1  1892&lt;br /&gt;      SNP2  1896&lt;br /&gt;      SNP3  1844&lt;br /&gt;&lt;br /&gt;      10 rows selected.&lt;br /&gt;&lt;br /&gt;    As you can see, DBWR has an SPID of 1956, which will equate to the &lt;br /&gt;    Thread ID of that thread within the Oracle executable.  This thread can &lt;br /&gt;    then be monitored using Performance Monitor and/or the PSLIST utility, &lt;br /&gt;    which is available as a free download from http://www.sysinternals.com&lt;br /&gt;&lt;br /&gt;    If your monitoring shows that DBWR is consuming excessive CPU, you can &lt;br /&gt;    attempt to get an errorstack from that thread using oradebug:&lt;br /&gt;&lt;br /&gt;      SQL&gt; oradebug setospid 1956&lt;br /&gt;      Oracle pid: 3, Windows thread id: 1956, image: ORACLE.EXE&lt;br /&gt;      SQL&gt; oradebug unlimit&lt;br /&gt;      Statement processed.&lt;br /&gt;      SQL&gt; oradebug dump errorstack 3&lt;br /&gt;      Statement processed.&lt;br /&gt;&lt;br /&gt;    This should dump the errorstack to the DBWR trace file, found in BDUMP.  &lt;br /&gt;    If the errorstack contains the function SKGMMAP, this is an indication &lt;br /&gt;    that DBWR is working to map/unmap database block buffers.&lt;br /&gt;&lt;br /&gt;Note:   In 8.1.7 of the RDBMS, you cannot use DBWR_IO_SLAVES in combination with&lt;br /&gt;USE_INDIRECT_DATA_BUFFERS, due to BUG#3042660/BUG#2215894.  You must leave&lt;br /&gt;DBWR_IO_SLAVES at its default value - otherwise, buffers are not unmapped&lt;br /&gt;and eventually a spin of the process will result.&lt;br /&gt;This problem is resolved in 9.2.0.1 - the fix is NOT backported to 8.1.7&lt;br /&gt;&lt;br /&gt;KNOWN ISSUES&lt;br /&gt;--------------------&lt;br /&gt;BUG#2461474 - SHOW SGA DOES NOT SHOW CORRECT # OF DB BUFFERS WITH AWE&lt;br /&gt;BUG#1412485 - LONG SHUTDOWN TIME WITH AWE_WINDOW_MEMORY: FIXED IN 8.1.7.1&lt;br /&gt;BUG#1406194 - AWE_WINDOW_MEMORY NOT RELEASED WHEN DB SHUTDOWN:  FIXED IN 8.1.7.1&lt;br /&gt;BUG#2520796 - ORA-439 TRYING TO ENABLE VLM IN STANDARD EDITION OF ORACLE - FIXED IN 9.2.0.4&lt;br /&gt;BUG#2945011 - VLM DOES NOT WORK ON STANDARD EDITION ORACLE 9.2.0.2 ON WINDOWS - FIXED IN 9.2.0.4&lt;br /&gt;BUG#3120033 - ORA-600[KCBVMAP] may occur with AWE, or DBWR may crash with ORA-471 on 9.2.0.4 - FIXED 9.2.0.4 PATCH 2&lt;br /&gt;BUG#3042660 / BUG#2215894 - IO SLAVES DON'T UNMAP BUFFERS ON LINUX IN VLM MODE (APPLIES TO WINDOWS AS WELL)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2208246676809057026?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2208246676809057026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2208246676809057026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2208246676809057026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2208246676809057026'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/implementing-address-windowing.html' title='Implementing Address Windowing Extensions (AWE) or VLM on Windows Platforms'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-9095852608433266896</id><published>2007-06-29T15:48:00.000+05:30</published><updated>2007-06-29T15:50:36.401+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='AUTOMATIC SHARED MEMORY MANAGEMENT'/><title type='text'>CONFIGURING AUTOMATIC SHARED MEMORY MANAGEMENT</title><content type='html'>AUTOMATIC SHARED MEMORY MANAGEMENT&lt;br /&gt;&lt;br /&gt;In Oracle 10g, the memory components are collectively known as the System Global area. Some of the memory components also referred to as pools need to have their size configured properly. The main pools are the shared pool, the large pool, the database cache size and the Java Pool. The appropriate individual sizes need to configured based on the overall SGA size. This can be quite a challenge by itself. Under-sizing may lead to poor performance and out-of-memory errors, while over-sizing may result in wasting of memory.&lt;br /&gt;&lt;br /&gt;In Oracle 10g, all you need to specify is the total amount of memory to be used by all SGA components. The database uses this value to redistribute memory between the various components based on the current workload of the database.&lt;br /&gt;&lt;br /&gt;•The new initialization parameter (SGA_TARGET) can include all the memory in the SGA, manually and automatically seized components and any internal allocations during startup. &lt;br /&gt;&lt;br /&gt;•The initialization parameters used in Oracle 9i and earlier namely DB_CACHE_SIZE, LARGE_POOL_SIZE, SHARED_POOL_SIZE and JAVA_POOL_SIZE are now considered auto-tuned SGA parameters. When the SGA_TARGET is set, the total for the manual SGA size parameters is subtracted from the SGA_TARGET to obtain the amount of memory that can be allocated to auto-tuned memory components.&lt;br /&gt;&lt;br /&gt;•The Automatic Shared Memory Management feature uses a background process called Memory Manager (MMAN). This background process is responsible for coordinating the sizes of the various memory components dynamically based on the current workload. This process checks the current workload on the database every few minutes, to ensure that memory is always present wherever needed. &lt;br /&gt;&lt;br /&gt;•The basic method used by automatic shared memory is given below:&lt;br /&gt;•Statistics are gathered periodically&lt;br /&gt;•Different memory advisories are used to make recommendations&lt;br /&gt;•"What If" analysis is performed to determine best distribution of memory.&lt;br /&gt;•Memory is moved to wherever it is required.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;GUIDELINES &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;•Automatic Shared memory management is configured by setting the SGA_TARGET initialization parameter. If the parameter is set to the default value of 0, then automatic shared memory management is disabled. If set to a non-zero value then Oracle automatically sizes of the shared pool, the large pool, the java pool and the Database buffer cache accordingly.&lt;br /&gt;&lt;br /&gt;•Within the SGA the buffers whose sizes can be configured manually are the Log Buffer (LOG_BUFFER), Keep and Recycle Pools (DB_KEEP_CACHE_SIZE and DB_RECYCLE_CACHE_SIZE), A streams pool (STREAMS_POOL_SIZE) which is new Oracle 10g , fixed SGA and other internal allocations and caches to accommodate non-standard tablespace blocks (DB_nk_CACHE_SIZE, n=2,4,8,16,32).&lt;br /&gt;&lt;br /&gt;•The initialization parameter STATISTICS_LEVEL must be set to TYPICAL or ALL.&lt;br /&gt;&lt;br /&gt;•You can query the values of the auto-tuned parameters from the V$PARAMETER dynamic performance view. If you set a value for the SGA_TARGET and do not specify sizes for the auto-tuned size parameters, the value that is displayed by the V$PARAMETER view against these parameters is 0. &lt;br /&gt;&lt;br /&gt;•The SGA_TARGET should be less than the SGA_MAX_SIZE initialization parameter. It can be reduced upto a minimum value defined for an individual auto-tuned component. Any change you make to the SGA_TARGET only affects the auto-tuned initialization parameters. You can dynamically increase the SGA_TARGET to the absolute maximum specified by adjusting the value of SGA_MAX_SIZE.&lt;br /&gt;&lt;br /&gt;•You can disable automatic shared memory tuning by setting the SGA_TARGET to value of 0. If this is done, the values taken by the individual auto-tuned memory components freeze to their current sizes. They do not take any defaults or previous values.&lt;br /&gt;&lt;br /&gt;•When an auto-tuned parameter is resized, the resize results in a change to the size of the component only if the new value is larger than the present size of the component. If you change JAVA_POOL_SIZE to 2G. This change will take effect immediately ensuring there is always 2G for this parameter, however if you reduce to 1G, where the current size is 1.5G. The change may not occur immediately, and the memory tuning algorithm can reduce to this value if it needs to.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;CONFIGURING AUTOMATIC SHARED MEMORY MANAGEMENT.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;br /&gt;You can configure Automatic Shared Memory Management either:&lt;br /&gt;•Manually&lt;br /&gt;•Using Enterprise Manager Console&lt;br /&gt;•The Enterprise Manager can be used to configure Automatic Shared Memory Management. To do so, select the Database -&gt; Administration Tab -&gt; Memory Parameters -&gt; SGA Tab -&gt; Enable button. Specify the total SGA size in Megabytes.&lt;br /&gt;&lt;br /&gt;•The ALTER SYSTEM command may be used to configure Automatic Shared Memory Management manually.&lt;br /&gt;&lt;br /&gt;SQL&gt; ALTER SYSTEM SET SGA_TARGET = 500M SCOPE=spfile;&lt;br /&gt;&lt;br /&gt;Also modify the initialization parameter listed below to zero, or completely remove them from the parameter file.&lt;br /&gt;&lt;br /&gt;SHARED_POOL_SIZE=0&lt;br /&gt;LARGE_POOL_SIZE=0&lt;br /&gt;JAVA_POOL_SIZE=0&lt;br /&gt;DB_CACHE_SIZE=0&lt;br /&gt;DATA DICTIONARY &lt;br /&gt;&lt;br /&gt;Once configured you can check the sizes with the following:&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT CURRENT_SIZE FROM V$BUFFER_POOL;&lt;br /&gt;&lt;br /&gt;Display output&lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT POOL, SUM(BYTES)/1024/1024 Mbytes FROM V$SGASTAT GROUP BY POOL;&lt;br /&gt;&lt;br /&gt;The total sum of values of the above two queries will be the same as the value you set for SGA_TARGET.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-9095852608433266896?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/9095852608433266896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=9095852608433266896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/9095852608433266896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/9095852608433266896'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/configuring-automatic-shared-memory.html' title='CONFIGURING AUTOMATIC SHARED MEMORY MANAGEMENT'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-7751002273992612652</id><published>2007-06-27T17:15:00.000+05:30</published><updated>2007-06-27T17:16:31.095+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle DBA Checklist'/><title type='text'>Oracle DBA Checklist</title><content type='html'>Oracle DBA Checklist &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I. Daily Procedures&lt;br /&gt;&lt;br /&gt;A. Verify all instances are up&lt;br /&gt;&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;&lt;br /&gt;&lt;br /&gt;B. Look for any new alert log entries&lt;br /&gt;&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;&lt;br /&gt;&lt;br /&gt;C. Verify DBSNMP is running&lt;br /&gt;&lt;br /&gt;1. Log on to each managed machine to check for the 'dbsnmp' process. 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;&lt;br /&gt;D. Verify success of database backup &lt;br /&gt;&lt;br /&gt;E. Verify success of database archiving to tape &lt;br /&gt;&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. 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. Compare to the minimum percent free for that tablespace. Note any low-space conditions and correct.&lt;br /&gt;&lt;br /&gt;2. Verify rollback segment.&lt;br /&gt;&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;&lt;br /&gt;3. Identify bad growth projections.&lt;br /&gt;&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;&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;&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;&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;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;&lt;br /&gt;&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;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-7751002273992612652?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/7751002273992612652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=7751002273992612652' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7751002273992612652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7751002273992612652'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/oracle-dba-checklist.html' title='Oracle DBA Checklist'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-6074351575803206851</id><published>2007-06-27T16:55:00.000+05:30</published><updated>2007-06-27T16:56:47.249+05:30</updated><title type='text'>Recreate the Database Control Repository</title><content type='html'>How to Recreate the Database Control Repository - (Oracle10g R1) &lt;br /&gt;&lt;br /&gt;http://www.idevelopment.info/data/Oracle/DBA_tips/Enterprise_Manager/OEM_3.shtml&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-6074351575803206851?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/6074351575803206851/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=6074351575803206851' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6074351575803206851'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/6074351575803206851'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/recreate-database-control-repository.html' title='Recreate the Database Control Repository'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-7811377130576061543</id><published>2007-06-27T16:46:00.000+05:30</published><updated>2007-06-27T16:51:19.145+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Installation of Oracle 10G on Linux'/><title type='text'>Installation of Oracle on Linux Links</title><content type='html'>http://www.oracle-base.com/articles/linux/OracleEnterpriseLinux4Installation.php&lt;br /&gt;http://www.oracle-base.com/articles/linux/RHEL4Installation.php&lt;br /&gt;http://www.oracle.com/technology/obe/obe10gdb/install/linuxinst/linuxinst.htm&lt;br /&gt;http://www.puschitz.com/OracleOnLinux.shtml&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-7811377130576061543?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/7811377130576061543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=7811377130576061543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7811377130576061543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/7811377130576061543'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/installation-of-oracle-on-linux-links.html' title='Installation of Oracle on Linux Links'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-3706981612106129790</id><published>2007-06-27T16:21:00.000+05:30</published><updated>2007-06-27T16:26:32.443+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='11G Overview'/><title type='text'>Oracle Database 11g Overview Presentation</title><content type='html'>Oracle Database 11g Overview Presentation&lt;br /&gt;&lt;br /&gt;The following is a presentation by Mark Townsend, the vice president of database product management, titled The Future of Database Technology. Towards the middle of the presentation, there is a high level overview of many Oracle database 11g features like SQL replay, online table and index redefinition, automatic diagnostic workflow, support for online hot patching and other highlights.&lt;br /&gt;&lt;br /&gt;Here is the full document: &lt;br /&gt;&lt;br /&gt;http://awads.net/wp/2007/06/25/oracle-database-11g-overview-presentation/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-3706981612106129790?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/3706981612106129790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=3706981612106129790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3706981612106129790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3706981612106129790'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/oracle-database-11g-overview.html' title='Oracle Database 11g Overview Presentation'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2935078551260980690</id><published>2007-06-12T14:20:00.000+05:30</published><updated>2007-07-17T18:01:41.186+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>STATSPACK</title><content type='html'>&lt;strong&gt;STATSPACK &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Below are the steps for generating a statspack Report:&lt;br /&gt;&lt;br /&gt;1. User must have SYSDBA privs &lt;br /&gt;&lt;br /&gt;set ORACLE_SID=orcl&lt;br /&gt;sqlplus sys/pwd as sysdba&lt;br /&gt;&lt;br /&gt;2.You should create SEPARATE TABLESPACE for statspack report.&lt;br /&gt;&lt;br /&gt;create tablespace PERFSTAT&lt;br /&gt;datafile 'c:\perf01.dbf' size 100m &lt;br /&gt;autoextend on &lt;br /&gt;segment space management auto;&lt;br /&gt;&lt;br /&gt;We should generate STATSPACK report DURING PEAK TIME&lt;br /&gt;run SPCREATE.SQL script&lt;br /&gt;Located : $ORACLE_HOME\rdbms\admin\spcreate.sql&lt;br /&gt;&lt;br /&gt;conn sys as sysdba&lt;br /&gt;@$ORACLE_HOME\rdbms\admin\spcreate.sql&lt;br /&gt;&lt;br /&gt;4.connect with PERFSTAT user &lt;br /&gt;perfstat user create automatically when we run SPCREATE.SQL script&lt;br /&gt;&lt;br /&gt;conn perfstat/password&lt;br /&gt;&lt;br /&gt;5.run STATSPACK.SNAP procedure &lt;br /&gt;&lt;br /&gt;exec statspack.snap;&lt;br /&gt;&lt;br /&gt;Note: After 15 minutes run again STATSPACK.SNAP procedure&lt;br /&gt;&lt;br /&gt;6.run SPREPORT for generate statspack report in text format.&lt;br /&gt;&lt;br /&gt;@$ORACLE_HOME\rdbms\admin\spreport.sql&lt;br /&gt;&lt;br /&gt;7.connect with SYSDBA privs user ( sys user)&lt;br /&gt;and execute SPDROP.SQL script for drop PERFSTAT user and all related tables &lt;br /&gt;&lt;br /&gt;conn sys as sysdba&lt;br /&gt;@$ORACLE_HOME\rdbms\admin\spdrop.sql&lt;br /&gt;&lt;br /&gt;8.DROP TABLESPACE use for STATSPACK REPORT&lt;br /&gt;&lt;br /&gt;conn sys as sysdba&lt;br /&gt;drop tablespace [TABLESPACE NAME]&lt;br /&gt;including contents and datafiles&lt;br /&gt;&lt;br /&gt;Note: analyze your report&lt;br /&gt;&lt;br /&gt;http://www.statspackanalyzer.com/analyze.asp&lt;br /&gt;http://www.oraperf.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2935078551260980690?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2935078551260980690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2935078551260980690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2935078551260980690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2935078551260980690'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/statspack.html' title='STATSPACK'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-3932261685785795818</id><published>2007-06-12T11:48:00.000+05:30</published><updated>2007-06-12T16:24:00.283+05:30</updated><title type='text'>Script to Schedule a Full Database Export backup</title><content type='html'>Script to Schedule a Export backup daily three times at 6:00AM,2:30PM,10:30PM.&lt;br /&gt;&lt;br /&gt;SCRIPT:&lt;br /&gt;&lt;br /&gt;schtasks /create /sc hourly /mo 8 /sd 06/07/2007 /ST 22:30:00 /tn MyDailyBackup /tr C:\sree_backup\SREE_BACKUP.bat /RU sree\kasukurthi.sridhar /RP sreetest@9&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Where&lt;br /&gt;&lt;br /&gt;/sc = Schedule Creation&lt;br /&gt;/mo = Modification time&lt;br /&gt;/sd = schedule date&lt;br /&gt;/st = schedule time&lt;br /&gt;/tn = transaction name&lt;br /&gt;/tr = transaction to run( Batch file along with path )&lt;br /&gt;/ru = remote user (if not specified it will takke local user name)&lt;br /&gt;/ru = remote password ( if not specified it will prompt at the run time )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To delete above task issue below command at OS prompt&lt;br /&gt;&lt;br /&gt;SCHTASKS /Delete /TN "MyDailyBackup" /f&lt;br /&gt;&lt;br /&gt;Batch file contents:&lt;br /&gt;&lt;br /&gt;@echo off&lt;br /&gt;move old_sree.dmp "C:\sree_backup\move_old\"&lt;br /&gt;move old_sree.log "C:\sree_backup\move_old\"&lt;br /&gt;rename sree.dmp old_sree.dmp&lt;br /&gt;rename sree.log old_sree.log&lt;br /&gt;exp userid=edr/sree@edr file=c:\sree_backup\sree.dmp log=c:\sree_backup\sree.log full=y buffer=2000000&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-3932261685785795818?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/3932261685785795818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=3932261685785795818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3932261685785795818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/3932261685785795818'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/script-to-schedule-full-database-export.html' title='Script to Schedule a Full Database Export backup'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-8322778888664148985</id><published>2007-06-12T11:33:00.000+05:30</published><updated>2007-06-12T11:35:37.129+05:30</updated><title type='text'>ORA-12528: TNS:listener: all appropriate instances are blocking new connections</title><content type='html'>&lt;strong&gt;ORA-12528: TNS:listener: all appropriate instances are blocking new connections&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It is known issue with ORACLE 10G. &lt;br /&gt;&lt;br /&gt;Suggestion: Don't Use "@(tns_entry string)" with userid/pwd.&lt;br /&gt;just export or set ORACLE_SID and connect WITHOUT "@"tns_entry.&lt;br /&gt;&lt;br /&gt;SQL&gt; grant SYSDBA to system;&lt;br /&gt;&lt;br /&gt;Grant succeeded.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn system/oracle@oracle as sysdba&lt;br /&gt;Connected.&lt;br /&gt;&lt;br /&gt;SQL&gt; STARTUP FORCE&lt;br /&gt;ORA-12528: TNS:listener: all appropriate instances are blocking new connections&lt;br /&gt;&lt;br /&gt;SQL&gt; exit&lt;br /&gt;Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Pr&lt;br /&gt;oduction&lt;br /&gt;With the Partitioning, OLAP and Data Mining options&lt;br /&gt;&lt;br /&gt;C:\&gt;sqlplus sys as sysdba&lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 10.1.0.2.0 - Production on Mon Feb 19 17:13:20 2007&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2004, Oracle. All rights reserved.&lt;br /&gt;&lt;br /&gt;Enter password:&lt;br /&gt;&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;&lt;br /&gt;SQL&gt; select status from v$instance;&lt;br /&gt;&lt;br /&gt;STATUS&lt;br /&gt;------------&lt;br /&gt;STARTED&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database mount;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; conn system as sysdba&lt;br /&gt;Enter password:&lt;br /&gt;Connected.&lt;br /&gt;SQL&gt; SHOW PARAMETER DB_name&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;db_name string ORACLE&lt;br /&gt;SQL&gt; STARTUP FORCE&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 171966464 bytes&lt;br /&gt;Fixed 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;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;SQL&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-8322778888664148985?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/8322778888664148985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=8322778888664148985' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8322778888664148985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/8322778888664148985'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/06/ora-12528-tnslistener-all-appropriate.html' title='ORA-12528: TNS:listener: all appropriate instances are blocking new connections'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-2879995077610069710</id><published>2007-04-22T18:37:00.000+05:30</published><updated>2007-06-12T15:58:14.224+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Links'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Moving, Rebuilding and or Resizing Indexes</title><content type='html'>As this procedure deals only with indexes, I consider it a very low risk process. The main source of risk if any is if your target tablespace for the index is either low on available space or is very fragmented. Just because the index was removed from a tablespace does not mean it can be recreated in the same tablespace. Unless there is sufficient free space and or contiguous extents in the target tablespace the index may not recreate. &lt;br /&gt; &lt;br /&gt;Why Rebuild ?&lt;br /&gt;The reasons for moving and or resizing indexes are relatively self explanatory, however, it is worth explaining why you would want to regularly rebuild some indexes. &lt;br /&gt;When records are added to a table, the table and index grows by the number of records added. When records are deleted from a table the records are physically deleted from the table but are logically deleted from the index. &lt;br /&gt;                                Table    Index&lt;br /&gt;          Task                  count    count&lt;br /&gt;          ------------------------------------&lt;br /&gt;          Add    100 Records     100      100&lt;br /&gt;          Delete 100 Records       0      100&lt;br /&gt;          Add    100 Records     100      200&lt;br /&gt;          delete 100 Records       0      200&lt;br /&gt;As you can see from the above example, the index will continue to grow, where as the table may remain static. &lt;br /&gt; &lt;br /&gt;How to identify indexes with "excessive" logically deleted rows.&lt;br /&gt;The first place to look is at any dynamic table I.E. Interface and temporary tables. &lt;br /&gt;Once the target tables have been identified, obtain a list of index names by using the following example SQL*PLUS script. &lt;br /&gt;     SELECT index_name&lt;br /&gt;     FROM dba_indexes&lt;br /&gt;     WHERE owner = 'SCOTT'&lt;br /&gt;     and table_name = 'EMP'&lt;br /&gt;      /&lt;br /&gt;For each of the indexes identified, execute the validate index command followed by the SQL*PLUS script shown below to obtain the results of the validate index command. Note: The index_stats table holds only one row. &lt;br /&gt;     SQL&gt; validate index gl.gl_interface_n1&lt;br /&gt;     /&lt;br /&gt;&lt;br /&gt;     Index analyzed.&lt;br /&gt;&lt;br /&gt;     SQL&gt;&lt;br /&gt;Use the following SQL*PLUS script to obtain the results. &lt;br /&gt;     column A heading "Index Name"   format a30&lt;br /&gt;     column B heading "Rows"         format 999,999,990&lt;br /&gt;     column C heading "Deleted|Rows" format 999,999,990&lt;br /&gt;     column D heading "% Del"        format 990.0&lt;br /&gt;&lt;br /&gt;     SELECT name A,&lt;br /&gt;            lf_rows B,&lt;br /&gt;            del_lf_rows C,&lt;br /&gt;            (del_lf_rows  * 100 ) / lf_rows D&lt;br /&gt;       FROM index_stats&lt;br /&gt;     /&lt;br /&gt;I usually rebuild indexes that have more than 20 % logically deleted rows. &lt;br /&gt; &lt;br /&gt;Rebuilding an index.&lt;br /&gt;The following PL*SQL script will build an SQL*PLUS script to drop and then recreate the index. &lt;br /&gt;Note: The storage clause and the index owner's password in the output file will have to be modified before you execute the resulting script. Modifying the storage clause will allow you to resize and or move the index. &lt;br /&gt; &lt;br /&gt;&lt;br /&gt;clear columns&lt;br /&gt;&lt;br /&gt;set serveroutput on;&lt;br /&gt;set echo off&lt;br /&gt;set heading off&lt;br /&gt;set feedback off&lt;br /&gt;set verify off&lt;br /&gt;&lt;br /&gt;WHENEVER SQLERROR CONTINUE&lt;br /&gt;&lt;br /&gt;/**************************************/&lt;br /&gt;/**  OBTAIN COMMAND LINE PARAMETERS  **/&lt;br /&gt;/**  OWNER      = Index owner        **/&lt;br /&gt;/**  INDEX_NAME = Index name         **/&lt;br /&gt;/**************************************/&lt;br /&gt;&lt;br /&gt;DEFINE owner      = '&amp;1'&lt;br /&gt;DEFINE index_name = '&amp;2'&lt;br /&gt;&lt;br /&gt;DECLARE&lt;br /&gt;   /**************************************/&lt;br /&gt;   /**  CURSOR C1 Get the index columns **/&lt;br /&gt;   /**************************************/&lt;br /&gt;   CURSOR C1 is&lt;br /&gt;      SELECT column_name&lt;br /&gt;        FROM dba_ind_columns&lt;br /&gt;       WHERE index_owner = upper('&amp;&amp;owner')&lt;br /&gt;         and index_name = upper('&amp;&amp;index_name')&lt;br /&gt;       ORDER by column_position;&lt;br /&gt;&lt;br /&gt;   /**************************************/&lt;br /&gt;   /**  Decalre variables               **/&lt;br /&gt;   /**************************************/&lt;br /&gt;   d_column_name    VARCHAR(30);&lt;br /&gt;   d_table_name     VARCHAR(30);&lt;br /&gt;   d_uniqe          VARCHAR(9);&lt;br /&gt;   d_max_columns    NUMBER(4) := 0;&lt;br /&gt;   d_column_counter NUMBER(4) := 0;&lt;br /&gt;&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;dbms_output.put_line('/****************************************/' );&lt;br /&gt;dbms_output.put_line('/* Drop and create index script         */' );&lt;br /&gt;dbms_output.put_line('/*                                      */' );&lt;br /&gt;dbms_output.put_line('/* Dont forget to edit this file for:   */' );&lt;br /&gt;dbms_output.put_line('/*                                      */' );&lt;br /&gt;dbms_output.put_line('/* 1. Connect password                  */' );&lt;br /&gt;dbms_output.put_line('/* 2. Storage params                    */' );&lt;br /&gt;dbms_output.put_line('/*                                      */' );&lt;br /&gt;dbms_output.put_line('/****************************************/' );&lt;br /&gt;dbms_output.put_line('');&lt;br /&gt;dbms_output.put_line('');&lt;br /&gt;&lt;br /&gt;dbms_output.put_line('connect &amp;&amp;owner/password' );&lt;br /&gt;dbms_output.put_line('');&lt;br /&gt;dbms_output.put_line('');&lt;br /&gt;&lt;br /&gt;dbms_output.put_line('DROP INDEX &amp;&amp;index_name;' );&lt;br /&gt;dbms_output.put_line('');&lt;br /&gt;dbms_output.put_line('');&lt;br /&gt;&lt;br /&gt;   /**************************************/&lt;br /&gt;   /**  Determine the number of columns **/&lt;br /&gt;   /**  in the index                    **/&lt;br /&gt;   /**************************************/&lt;br /&gt;&lt;br /&gt;   SELECT max(column_position)&lt;br /&gt;     INTO d_max_columns&lt;br /&gt;    FROM dba_ind_columns&lt;br /&gt;    WHERE index_owner = upper('&amp;&amp;owner')&lt;br /&gt;      and index_name = upper('&amp;&amp;index_name');&lt;br /&gt;&lt;br /&gt;   SELECT table_name, uniqueness&lt;br /&gt;     INTO d_table_name, d_uniqe&lt;br /&gt;     FROM dba_indexes&lt;br /&gt;    WHERE owner = upper('&amp;&amp;owner')&lt;br /&gt;      and index_name = upper('&amp;&amp;index_name');&lt;br /&gt;&lt;br /&gt;   /**************************************/&lt;br /&gt;   /**  Determine if the index is uniqe **/&lt;br /&gt;   /**************************************/&lt;br /&gt;   SELECT uniqueness&lt;br /&gt;     INTO d_uniqe&lt;br /&gt;     FROM dba_indexes&lt;br /&gt;    WHERE owner = upper('&amp;&amp;owner')&lt;br /&gt;      and index_name = upper('&amp;&amp;index_name');&lt;br /&gt;&lt;br /&gt;   dbms_output.put_line('CREATE '|| d_uniqe ||' INDEX &amp;&amp;index_name' );&lt;br /&gt;   dbms_output.put_line('ON '||d_table_name );&lt;br /&gt;   dbms_output.put_line('(');&lt;br /&gt;&lt;br /&gt;   OPEN C1;&lt;br /&gt;      LOOP&lt;br /&gt;         FETCH C1 INTO d_column_name;&lt;br /&gt;         d_column_counter := d_column_counter + 1;&lt;br /&gt;         EXIT WHEN C1%NOTFOUND;&lt;br /&gt;         IF d_column_counter &lt; d_max_columns THEN&lt;br /&gt;            dbms_output.put_line( d_column_name||',' );&lt;br /&gt;         ELSE&lt;br /&gt;            dbms_output.put_line( d_column_name||' )' );&lt;br /&gt;         END IF;&lt;br /&gt;      END LOOP;&lt;br /&gt;&lt;br /&gt;   dbms_output.put_line('STORAGE ( initial X M  next X M');&lt;br /&gt;   dbms_output.put_line('          minextents 1 maxextents 50');&lt;br /&gt;   dbms_output.put_line('          pctincrease 0 );');&lt;br /&gt;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;NOTE 1: If the index is being used by another user, you will not be able to either validate or drop the index. &lt;br /&gt;NOTE 2: Beware of the primary key constraint. &lt;br /&gt;General details about the index can also be found by:&lt;br /&gt;Analyze index &lt;index-name&gt; compute statistics;&lt;br /&gt;Select * from user_indexes&lt;br /&gt;    where index_name= ‘&lt;index-name&gt;’;&lt;br /&gt;To obtain further detail about an index:&lt;br /&gt;Analyze index &lt;index-name&gt; validate structure;&lt;br /&gt;The command:&lt;br /&gt;Validate index &lt;index-name&gt;;&lt;br /&gt;Performs the same function.&lt;br /&gt;This places detailed information about the index in the table INDEX_STATS. This table can only contain one row, describing only the one index. This SQL also verifies the integrity of each data block in the index and checks for block corruption.&lt;br /&gt;For example, to get the size of an index:&lt;br /&gt;validate index &lt;index_name&gt;;&lt;br /&gt;select name "INDEX NAME", blocks * 8192 "BYTES ALLOCATED",&lt;br /&gt;    btree_space "BYTES USED",&lt;br /&gt;    (btree_space / (blocks * 8192))*100 "PERCENT USED"&lt;br /&gt;    from index_stats;&lt;br /&gt;This assumes a block size of 8K (i.e. 8192 bytes). It shows the number of bytes allocated to the index and the number of bytes actually used.&lt;br /&gt;Note that it does not confirm that each row in the table has an index entry or that each index entry points to a row in the table. To check this:&lt;br /&gt;Analyze table &lt;table-name&gt; validate structure cascade;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22603407-2879995077610069710?l=oracle-core-dba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://oracle-core-dba.blogspot.com/feeds/2879995077610069710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22603407&amp;postID=2879995077610069710' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2879995077610069710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22603407/posts/default/2879995077610069710'/><link rel='alternate' type='text/html' href='http://oracle-core-dba.blogspot.com/2007/04/moving-rebuilding-and-or-resizing.html' title='Moving, Rebuilding and or Resizing Indexes'/><author><name>Sridhar Kasukurthi</name><uri>http://www.blogger.com/profile/06466188467404283512</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22603407.post-4565911563430296689</id><published>2007-04-22T18:33:00.000+05:30</published><updated>2007-06-12T15:58:14.224+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Links'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Systemwide Tuning using StatsPack Reports</title><content type='html'>Systemwide Tuning using StatsPack Reports&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PURPOSE &lt;br /&gt;This article is a reference to understand the output generated by the STATSPACK utility. Since performance tuning is a very broad area this document only provide tuning advice in very specific areas. Several documents are available in Metalink to resolve contention in specific resources. The following resources are available to find specific documentation related to a performance topic: &lt;br /&gt;• Metalink Database Performance Technical Library &lt;br /&gt;• Oracle9i Database Performance Tuning Guide and Reference &lt;br /&gt;• OTN Performance Technical Library &lt;br /&gt;&lt;br /&gt;CONTENT &lt;br /&gt;&lt;br /&gt;• Introduction &lt;br /&gt;• Summary Information &lt;br /&gt;• Instance cache information &lt;br /&gt;• Load profile Information &lt;br /&gt;• Instance Efficiency Ratios &lt;br /&gt;• Top 5 Events section &lt;br /&gt;• Cluster Statistics &lt;br /&gt;• Foreground Wait Events &lt;br /&gt;• Background Wait Events &lt;br /&gt;• Notes Regarding Waitevents &lt;br /&gt;• SQL Information &lt;br /&gt;• Statistics &lt;br /&gt;• IO Activity &lt;br /&gt;• Buffer cache Activity Information &lt;br /&gt;• Instance Recovery Statistics &lt;br /&gt;• PGA Memory Statistics &lt;br /&gt;• Enqueue Activity &lt;br /&gt;• Undo (Rollback) Information &lt;br /&gt;• Latch Information &lt;br /&gt;• Dictionary Cache Statistics &lt;br /&gt;• Library Cache Statistics &lt;br /&gt;• SGA Memory Summary &lt;br /&gt;• SGA Memory Detail &lt;br /&gt;• Init.ora Parameters Summary &lt;br /&gt;&lt;br /&gt;Introduction &lt;br /&gt;StatsPack was created in response to a need for more relevant and more extensive statistical reporting beyond what was available via UTLBSTAT/UTLESTAT reports. Further, this information can be stored permanently in the database instance itself so that historical data is always available for comparison and diagnosis. &lt;br /&gt;Statspack has been available since version 816, but can be installed on 806 and above. Snapshots created using older versions of statspack can usually be read using newer versions of Statspack although the newer features will not be available. &lt;br /&gt;See the following notes for information on installing, configuring snapshots, and generating reports: &lt;br /&gt;- Installing and Configuring StatsPack Package &lt;br /&gt;- Gathering a StatsPack snapshot &lt;br /&gt;- Creating a StatsPack performance report &lt;br /&gt;- FAQ- StatsPack Complete Reference &lt;br /&gt;Timed_statistics must be set to true prior to the creation of a snapshot.  If it is not, the data within statspack will not be relevant.  You can tell if timed_statistics was not set by looking at the total times columns in the report.  If these are zero then timed_statistics was not set. &lt;br /&gt;Snapshots during which the instance was recycled will not contain accurate information and should not be included in a statspack report. &lt;br /&gt;In general, we suggest that snapshots intervals be 15 minutes in length.  This allows fine-grained reporting when hangs are suspected/detected.  The snapshots can also be combined into hourly reports for general performance tuning. &lt;br /&gt;When a value is too large for the statspack field it will be represented by a series of pound signs such as  #######.  Should this occur and you need to see the value in the field you will need to decrease the number of snapshots in the report until the field can be read.  Should there only be one snapshot in the report, then you will need to decrease the snapshot interval. &lt;br /&gt;Profiles created using statspack information are quite helpful in determining long-term trends such as load increases, usage trends, resource consumption, latch activity, etc.  It is especially important that a DBA know these things and be able to demonstrate changes in them that necessitate hardware improvements and load balancing policies. This document will describe the main sections of an statspack report, which will help to understand what information is available to diagnose and resolve performance tuning problems. Some of the sections of the statspack report may contain different information based on the Statspack release that was used to generate the report. This document will also indicate these changes for the different sections. &lt;br /&gt;&lt;br /&gt;Summary Information &lt;br /&gt;The summary information begins with the identification of the database on which the statspack report was run along with the time interval of the statspack report.  Here is the 8i instance information: &lt;br /&gt;STATSPACK report for&lt;br /&gt;&lt;br /&gt;DB Name         DB Id    Instance     Inst Num Release     OPS Host&lt;br /&gt;------------ ----------- ------------ -------- ----------- --- ------------&lt;br /&gt;PHS2           975244035 phs2                2 8.1.7.2.0   YES leo2&lt;br /&gt;&lt;br /&gt;                Snap Id     Snap Time      Sessions&lt;br /&gt;                ------- ------------------ --------&lt;br /&gt; Begin Snap:        100 03-Jan-02 08:00:01  #######&lt;br /&gt;   End Snap:        104 03-Jan-02 09:00:01  #######&lt;br /&gt;    Elapsed:                  60.00 (mins)&lt;br /&gt;&lt;br /&gt;The database name, id, instance name, instance number if OPS is being utilized, Oracle binary release information, host name and snapshot information are provided. &lt;br /&gt;Note that here the number of sessions during the snapshot was too large for the sessions field and so the overflow symbol is displayed. &lt;br /&gt;Here is an example of an 806 instance using statspack: &lt;br /&gt;STATSPACK report for&lt;br /&gt;&lt;br /&gt;DB Name        DB Id     Instance    Inst Num  Release     OPS   Host         &lt;br /&gt;----------  -----------  ----------  --------  ----------  ----  ----------   &lt;br /&gt;GLOVP        1409723819  glovp              1  8.0.6.1.0   NO    shiver       &lt;br /&gt;&lt;br /&gt;                                                                Snap Length   &lt;br /&gt;Start Id    End Id       Start Time             End Time         (Minutes)    &lt;br /&gt;--------  --------  --------------------  --------------------  -----------   &lt;br /&gt;     454       455  07-Jan-03 05:28:20    07-Jan-03 06:07:53          39.55   &lt;br /&gt;Here is the 9i instance information.  Note that the OPS column is now entitled 'Cluster' to accommodate the newer Real Applications Cluster (RAC) terminology and that the Cursors/Session and Comment columns have been added. &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;ETSPRD7       1415901831 etsprd7a            1 9.2.0.2.0   YES     tsonode1&lt;br /&gt;&lt;br /&gt;            Snap Id     Snap Time      Sessions Curs/Sess Comment&lt;br /&gt;            ------- ------------------ -------- --------- -------------------&lt;br /&gt;Begin Snap:      20 03-Jan-03 00:00:05  #######        .0&lt;br /&gt;  End Snap:      21 03-Jan-03 01:00:05  #######        .0&lt;br /&gt;   Elapsed:               60.00 (mins)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Instance Workload Information &lt;br /&gt;Every statspack report start with a section that describes the instance's workload profile and instance metrics that may help to determine the instance efficiency. &lt;br /&gt;- Instance cache information: &lt;br /&gt;In the 8i report the buffer cache size can be determined by multiplying the db_block_buffers by the db_block_size. &lt;br /&gt;Cache Sizes&lt;br /&gt;~~~~~~~~~~~&lt;br /&gt;           db_block_buffers:       6400          log_buffer:  104857600&lt;br /&gt;              db_block_size:      32768    shared_pool_size:  150000000&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In 9i this has been done for you. Std Block size indicates the primary block size of the instance. &lt;br /&gt;Cache Sizes (end)&lt;br /&gt;~~~~~~~~~~~~~~~~~&lt;br /&gt;               Buffer Cache:       704M      Std Block Size:         8K&lt;br /&gt;           Shared Pool Size:       256M          Log Buffer:     1,024K&lt;br /&gt;Note that the buffer cache size is that of the standard buffer cache.  If you have multiple buffer caches, you will need to calculate the others separately. &lt;br /&gt;- Load profile Information: &lt;br /&gt;The load profile information is next.  It is identical in both 8i and 9i. &lt;br /&gt;Load Profile&lt;br /&gt;~~~~~~~~~~~~                            Per Second       Per Transaction&lt;br /&gt;                                   ---------------       ---------------&lt;br /&gt;                  Redo size:            351,530.67              7,007.37&lt;br /&gt;              Logical reads:              5,449.81                108.64&lt;br /&gt;              Block changes:              1,042.0 8                 20.77&lt;br /&gt;             Physical reads:                 37.71                  0.75&lt;br /&gt;            Physical writes:                134.68                  2.68&lt;br /&gt;                 User calls:              1,254.72                 25.01&lt;br /&gt;                     Parses:                  4.92                  0.10&lt;br /&gt;                Hard parses:                  0.02                  0.00&lt;br /&gt;                      Sorts:                 15.73                  0.31&lt;br /&gt;                     Logons:                 -0.01                  0.00&lt;br /&gt;                   Executes:                473.73                  9.44&lt;br /&gt;               Transactions:                 50.17&lt;br /&gt;&lt;br /&gt;  % Blocks changed per Read:   19.12    Recursive Call %:     4.71&lt;br /&gt; Rollback per transaction %:    2.24       Rows per Sort:    20.91&lt;br /&gt;Where: &lt;br /&gt;. Redo size:  This is the amount of redo generated during this report. &lt;br /&gt;. Logical Reads: This is calculated as Consistent Gets + DB Block Gets =  Logical Reads &lt;br /&gt;. Block changes: The number of blocks modified during the sample interval &lt;br /&gt;. Physical Reads: The number of requests for a block that caused a physical I/O. &lt;br /&gt;. Physical Writes: The number of physical writes issued. &lt;br /&gt;. User Calls: The number of queries generated &lt;br /&gt;. Parses: Total of all parses: both hard and soft &lt;br /&gt;. Hard Parses: Those parses requiring a completely new parse of the SQL statement.  These consume both latches and shared pool area. &lt;br /&gt;. Soft Parses: Not listed but derived by subtracting the hard parses from parses.  A soft parse reuses a previous hard parse and hence consumes far fewer resources. &lt;br /&gt;. Sorts, Logons, Executes and Transactions are all self explanatory &lt;br /&gt;- Instance Efficiency Ratios: &lt;br /&gt;Hit ratios are calculations that may provide information regarding different structures and operations in the Oracle instance. Database tuning never must be driven by hit ratios. They only provide additional information to understand how the instance is operating. For example, in a DSS systems a low cache hit ratio may be acceptable due the amount of recycling needed due the large volume of data accesed. So if you increase the size of the buffer cache based on this number, the corrective action may not take affect and you may be wasting memory resources. &lt;br /&gt;See - THE COE PERFORMANCE METHOD , for further reference on how to approach a performance tuning problem. &lt;br /&gt;This section is identical in 8i and 9i. &lt;br /&gt;Instance Efficiency Percentages (Target 100%)&lt;br /&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;br /&gt;            Buffer Nowait %:   99.99       Redo NoWait %:  100.00&lt;br /&gt;            Buffer  Hit   %:  -45.57    In-memory Sort %:   97.55&lt;br /&gt;            Library Hit   %:   99.89        Soft Parse %:   99.72&lt;br /&gt;         Execute to Parse %:   -1.75         Latch Hit %:   99.11&lt;br /&gt;Parse CPU to Parse Elapsd %:   52.66     % Non-Parse CPU:   99.99&lt;br /&gt;&lt;br /&gt; Shared Pool Statistics        Begin   End&lt;br /&gt;                               ------  ------&lt;br /&gt;             Memory Usage %:   42.07   43.53&lt;br /&gt;    % SQL with executions&gt;1:   73.79   75.08&lt;br /&gt;  % Memory for SQL w/exec&gt;1:   76.93   77.64&lt;br /&gt;&lt;br /&gt;It is possible for both the 'buffer hit ratio' and the 'execute to parse' ratios to be negative.  In the case of the buffer hit ration, the buffer cache is too small and the data in is being aged out before it can be used so it must be retrieved again.  This is a form of thrashing which degrades performance immensely. &lt;br /&gt;The execute to parse ratio can be negative when the number of parses is larger than the number of executions.  The Execute to Parse ratio is determined by the following formula: &lt;br /&gt;&lt;br /&gt;100 * (1 - Parses/Executions) = Execute to Parse &lt;br /&gt;Here this becomes: &lt;br /&gt;100 * (1 - 42,757 / 42,023 ) = 100 * (1 - 1.0175) = 100* -0.0175  = -1.75 &lt;br /&gt;&lt;br /&gt;This can be caused by the snapshot boundary occurring during a period of high parsing so that the executions have not occurred before the end of the snapshot.  Check the next snapshot to see if there are enough executes to account for the parses in this report. &lt;br /&gt;Another cause for a negative execute to parse ratio is if the shared pool is too small and queries are aging out of the shared pool and need to be reparsed.  This is another form of thrashing which also degrades performance tremendously. &lt;br /&gt;- Top 5 Events section: &lt;br /&gt;This section shows the Top 5 timed events that must be considered to focus the tuning efforts. Before Oracle 9.2 this section was called "Top 5 Wait Events". It was renamed in Oracle 9.2 to "Top 5 Timed Events" to include the "CPU Time" based on the 'CPU used by this session'. This information will allow you to determine SQL tuning problems. &lt;br /&gt;For further see the Statspack readme file called $ORACLE_HOME/rdbms/admin/spdoc.txt. These events are particularly useful in determining which sections to view next.  For instance if there are fairly high waits on latch free or one of the other latches you might want to examine the latch sections first.  On the other hand, if the db file read waits events seem abnormally high, you might want to look at the file io section first. &lt;br /&gt;Top 5 Wait Events                                                             &lt;br /&gt;~~~~~~~~~~~~~~~~~                                             Wait     % Total&lt;br /&gt;Event                                               Waits  Time (cs)   Wt Time&lt;br /&gt;-------------------------------------------- ------------ ------------ -------&lt;br /&gt;db file sequential read                        12,131,221      173,910   58.04&lt;br /&gt;db file scattered read                             93,310       86,884   29.00&lt;br /&gt;log file sync                                      18,629        9,033    3.01&lt;br /&gt;log file parallel write                            18,559        8,449    2.82&lt;br /&gt;buffer busy waits                                 304,461        7,958    2.66&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Notice that in Oracle 9.2 references are made "Elapsed Time" rather than to "Wait Time". Also the "CPU Time" is included as part of the Top events section. &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;log file sync                                   3,223,927      32,481    64.05&lt;br /&gt;CPU time                                                        7,121    14.04&lt;br /&gt;global cache open x                               517,153       3,130     6.17&lt;br /&gt;log file parallel write                           985,732       2,613     5.15&lt;br /&gt;KJC: Wait for msg sends to complete               568,061       1,794     3.54&lt;br /&gt;          -------------------------------------------------------------&lt;br /&gt;Note that db file scattered and sequential read are generally the top wait events when the instance is tuned well and not OPS/RAC. Wait Events &lt;br /&gt;Cluster Statistics &lt;br /&gt;In Oracle 9i with the introduction of real Application Clusters, several sections were added to the statspack report to show information related to cluster database environment. The following sections are now available in statspack to monitor RAC environments and are only displayed when a cluster is detected. &lt;br /&gt;Oracle 9.0 and 9.1 Cluster Statistics : &lt;br /&gt;Global Lock Statistics&lt;br /&gt;----------------------&lt;br /&gt;Ave global lock get time (ms):                             0.3&lt;br /&gt;Ave global lock convert time (ms):                         0.0&lt;br /&gt;Ratio of global lock gets vs global lock releases:         1.0&lt;br /&gt;&lt;br /&gt;Global cache statistics&lt;br /&gt;-----------------------&lt;br /&gt;Global cache hit %:                                        0.3&lt;br /&gt;Ave global cache get time (ms):                            1.7&lt;br /&gt;Ave global cache convert time (ms):                        3.1&lt;br /&gt;&lt;br /&gt;Cache fusion statistics&lt;br /&gt;-----------------------&lt;br /&gt;Ave time to process CR block request (ms):                 0.2&lt;br /&gt;Ave receive time for CR block (ms):                        1.6&lt;br /&gt;Ave build time for CR block (ms):                          0.1&lt;br /&gt;Ave flush time for CR block (ms):                          0.0&lt;br /&gt;Ave send time for CR block (ms):                           0.1&lt;br /&gt;&lt;br /&gt;Ave time to process current block request (ms):            0.2&lt;br /&gt;Ave receive time for current block (ms):                   2.5&lt;br /&gt;Ave pin time for current block (ms):                       0.0&lt;br /&gt;Ave flush time for current block (ms):                     0.0&lt;br /&gt;Ave send time for current block (ms):                      0.1&lt;br /&gt;&lt;br /&gt;GCS and GES statistics&lt;br /&gt;----------------------&lt;br /&gt;Ave GCS message process time (ms):                         0.1&lt;br /&gt;Ave GES message process time (ms):                         0.1&lt;br /&gt;% of direct sent messages:                                59.5&lt;br /&gt;% of indirect sent messages:                              40.3&lt;br /&gt;% of flow controlled messages:                             0.1&lt;br /&gt;% of GCS messages received by LMD:                        96.4&lt;br /&gt;% of GES messages received by LMD:                         3.6&lt;br /&gt;% of blocked converts:                                    10.3&lt;br /&gt;Ave number of logical side channel messages:              33.8&lt;br /&gt;Ave number of logical recovery claim messages:&lt;br /&gt;Oracle 9.2 Cluster Statistics : &lt;br /&gt;Global Cache Service - Workload Characteristics&lt;br /&gt;-----------------------------------------------&lt;br /&gt;Ave global cache get time (ms):                            4.6&lt;br /&gt;Ave global cache convert time (ms):                       20.2&lt;br /&gt;&lt;br /&gt;Ave build time for CR block (ms):                          0.0&lt;br /&gt;Ave flush time for CR block (ms):                          0.6&lt;br /&gt;Ave send time for CR block (ms):                           0.1&lt;br /&gt;Ave time to process CR block request (ms):                 0.7&lt;br /&gt;Ave receive time for CR block (ms):                        0.9&lt;br /&gt;&lt;br /&gt;Ave pin time for current block (ms):                       2.9&lt;br /&gt;Ave flush time for current block (ms):                     0.1&lt;br /&gt;Ave send time for current block (ms):                      0.1&lt;br /&gt;Ave time to process current block request (ms):            3.1&lt;br /&gt;Ave receive time for current block (ms):                   7.2&lt;br /&gt;&lt;br /&gt;Global cache hit ratio:                                    0.8&lt;br /&gt;Ratio of current block defers:                             0.0&lt;br /&gt;% of messages sent for buffer gets:                        0.5&lt;br /&gt;% of remote buffer gets:                                   0.4&lt;br /&gt;Ratio of I/O for coherence:                               12.3&lt;br /&gt;Ratio of local vs remote work:                             1.2&lt;br /&gt;Ratio of fusion vs physical writes:                        0.0&lt;br /&gt;&lt;br /&gt;Global Enqueue Service Statistics&lt;br /&gt;---------------------------------&lt;br /&gt;Ave global lock get time (ms):                             0.2&lt;br /&gt;Ave global lock convert time (ms):                         2.3&lt;br /&gt;Ratio of global lock gets vs global lock releases:         1.0&lt;br /&gt;&lt;br /&gt;GCS and GES Messaging statistics&lt;br /&gt;--------------------------------&lt;br /&gt;Ave message sent queue time (ms):                          0.1&lt;br /&gt;Ave message sent queue time on ksxp (ms):                 12.3&lt;br /&gt;Ave message received queue time (ms):                      0.0&lt;br /&gt;Ave GCS message process time (ms):                         0.1&lt;br /&gt;Ave GES message process time (ms):                         0.0&lt;br /&gt;% of direct sent messages:                                81.2&lt;br /&gt;% of indirect sent messages:                              13.1&lt;br /&gt;% of flow controlled messages:                             5.7&lt;br /&gt;In all the Oracle9i release, a separate section shows the actual value for all the cluster statistics: &lt;br /&gt;GES Statistics for DB: FUSION  Instance: ecfsc2  Snaps: 161 -162&lt;br /&gt;&lt;br /&gt;Statistic                                    Total   per Second    per Trans&lt;br /&gt;--------------------------------- ---------------- ------------ ------------&lt;br /&gt;dynamically allocated gcs resourc                0          0.0          0.0&lt;br /&gt;dynamically allocated gcs shadows                0          0.0          0.0&lt;br /&gt;flow control messages received                   0          0.0          0.0&lt;br /&gt;flow control messages sent                      10          0.0          0.0&lt;br /&gt;gcs ast xid                                     30          0.0          0.0&lt;br /&gt;gcs blocked converts                       531,572        147.7          0.2&lt;br /&gt;gcs blocked cr converts                     55,739         15.5          0.0&lt;br /&gt;gcs compatible basts                            45          0.0          0.0&lt;br /&gt;gcs compatible cr basts (global)             6,183          1.7          0.0&lt;br /&gt;....&lt;br /&gt;For further reference on tuning RAC clustered instances please refer to the documentation manual called Oracle9i Real Application Clusters Deployment and Performance &lt;br /&gt;Wait Events Information &lt;br /&gt;The following section will describe in detail most of the sections provided in a statspack report. &lt;br /&gt;- Foreground Wait Events: &lt;br /&gt;Foreground wait events are those associated with a session or client process waiting for a resource. The 8i version looks like this: &lt;br /&gt;Wait Events for DB: PHS2  Instance: phs2  Snaps: 100 -104&lt;br /&gt;-&gt; cs - centisecond -  100th of a second&lt;br /&gt;-&gt; ms - millisecond - 1000th of a second&lt;br /&gt;-&gt; ordered by wait time desc, waits desc (idle events last)&lt;br /&gt;                                                                    Avg&lt;br /&gt;                                                     Total Wait    wait  Waits&lt;br /&gt;Event                               Waits   Timeouts  Time (cs)    (ms)   /txn&lt;br /&gt;---------------------------- ------------ ---------- ----------- ------ ------&lt;br /&gt;PX Deq: Execution Msg              15,287      6,927   1,457,570    953  694.9&lt;br /&gt;enqueue                            30,367     28,591     737,906    243 ######&lt;br /&gt;direct path read                   45,484          0     352,127     77 ######&lt;br /&gt;PX Deq: Table Q Normal              7,185        811     241,532    336  326.6&lt;br /&gt;PX Deq: Execute Reply              13,925        712     194,202    139  633.0&lt;br /&gt;.... &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The 9.2 version is much the same but has different time intervals in the header. &lt;br /&gt;Wait Events for DB: FUSION  Instance: ecfsc2  Snaps: 161 -162&lt;br /&gt;-&gt; s  - second&lt;br /&gt;-&gt; cs - centisecond -     100th of a second&lt;br /&gt;-&gt; ms - millisecond -    1000th of a second&lt;br /&gt;-&gt; us - microsecond - 1000000th of a second&lt;br /&gt;-&gt; ordered by wait time desc, waits desc (idle events last)&lt;br /&gt;                                                                   Avg&lt;br /&gt;                  
