<?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:blogger='http://schemas.google.com/blogger/2008' 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-6584799265926566340</id><updated>2025-10-09T02:15:15.035-07:00</updated><category term="Fundamentals"/><category term="Oracle Network"/><category term="Backup Recovery"/><category term="Tuning"/><category term="DBA Responsibilities"/><category term="RMAN"/><category term="dba role"/><category term="Data Guard"/><category term="Partitioning"/><category term="Patching"/><category term="RDBMS"/><category term="Tablespaces"/><category term="export Import"/><category term="index"/><category term="ASM in Oracle 10g"/><category term="Apps"/><category term="Auditing"/><category term="DBMS_stats"/><category term="Database hanging"/><category term="FND TABLES"/><category term="Invalid Objects"/><category term="RAC"/><category term="RAID"/><category term="backup"/><category term="create database"/><category term="dba certification"/><category term="default Users"/><category term="flashback  table"/><category term="recyclebin"/><category term="redo log file resize"/><category term="unix commands"/><category term="user profile"/><title type='text'>Big N Fat DBA</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>91</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-1902893578868100808</id><published>2010-05-26T22:07:00.001-07:00</published><updated>2010-05-26T22:07:10.070-07:00</updated><title type='text'>ASM Remote Copy</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/1902893578868100808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/1902893578868100808' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/1902893578868100808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/1902893578868100808'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/05/asm-remote-copy.html' title='ASM Remote Copy'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-5822656590980082469</id><published>2010-05-26T22:06:00.005-07:00</published><updated>2010-05-26T22:06:58.579-07:00</updated><title type='text'>ASM Duplicate Active in 11g</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/5822656590980082469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/5822656590980082469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5822656590980082469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5822656590980082469'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/05/asm-duplicate-active-in-11g.html' title='ASM Duplicate Active in 11g'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-7199537696867555282</id><published>2010-05-26T22:06:00.001-07:00</published><updated>2010-05-26T22:06:30.305-07:00</updated><title type='text'>ASM KFED</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/7199537696867555282/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/7199537696867555282' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7199537696867555282'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7199537696867555282'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/05/asm-kfed.html' title='ASM KFED'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-7183463500818528501</id><published>2010-04-09T21:18:00.000-07:00</published><updated>2010-04-09T21:19:26.454-07:00</updated><title type='text'>Create Multiple Instance on A Single Database</title><content type='html'>TO CRAETE A NEW ORACLE INSTANCE (DB_NAME=bnfd INSTANCE_NAME=bnfd1)&lt;br /&gt;-----------------------------------&lt;br /&gt;1.CREATE A NEW DIRECTORY AS THE GLOBAL DATABASE NAME (DB_NAME:bnfd) IN THE PARAMETER FILE &lt;br /&gt;  AND EDIT THE PFILE WITH THE NEW INSTANCE NAME AND NEW DATABASE NAME.&lt;br /&gt;  example:create a directory as E:\oracle\admin\bnfd and edit the parameter&lt;br /&gt;  file after copying.(CREATE THE NEW PARAMETER FILE)&lt;br /&gt;2.CREATE THE NEW PASSWORD FILE IN THE DIRECTORY &lt;br /&gt;  E:\&gt;oracle\ora92\database&gt;orapwd FILE=pwdbnfd1.ora PASSWORD=sys ENTRIES=5;&lt;br /&gt;3.If we are using Windows NT then add the service with oradim program&lt;br /&gt;  C:\&gt;oradim -new -sid bnfd1 -startmode a -pfile E:\oracle\admin\bnfd\pfile\bnfd.ora&lt;br /&gt;4.Add in the listener.ora the global database name and the sid and restart the lis&lt;br /&gt;  tener.&lt;br /&gt;5.Add this in tnsnames.ora with the new service name(SERVICE_NAME=bnfd1).&lt;br /&gt;6.connect sys/sys@bnfd as sysdba&lt;br /&gt;7C:\&gt;oradim -delete -sid bnfd1(To delete a SID)&lt;br /&gt;8C:\&gt;oradim -edit -sid bnfd1 -startmode a -pfile E:\oracle\admin\bnfd\pfile\bnfd.ora;(To edit a sid) &lt;br /&gt;&lt;br /&gt;TO CREATE A PARALLEL SERVER(instance=11,12 db_name:hello1)&lt;br /&gt;-------------------------------------------------------------------&lt;br /&gt;1.Do not change the DB_NAME to hello2(keep it hello1)&lt;br /&gt; but change the instance name to 12.&lt;br /&gt;2.do the same steps as that of creating a new instance.&lt;br /&gt;3.In the tnsnames.ora have two entries to connect to two instances, but they will&lt;br /&gt;  connect to the same database so that if one instance is down the other instance&lt;br /&gt;  can go up and take its place. &lt;br /&gt;&lt;br /&gt;copy the folder structure as it is in case of other databases.&lt;br /&gt;TO CREATE A DATABASE FOR THE INSTANCE (11 and 12)(DB_NAME:hello1)&lt;br /&gt;Either give the UNDO tablespace or comment the undo parameters&lt;br /&gt;---------------------------------------------------------------------------&lt;br /&gt;1.Comment all the undo related parameters in the init.ora file for 12 instance.&lt;br /&gt;2.Startup nomount using pfile for 12 instance&lt;br /&gt;3. startup nomount pfile=&quot;C:\oracle\admin\catalgdb\scripts\init.ora&quot;;&lt;br /&gt;CREATE DATABASE targetdb&lt;br /&gt;MAXINSTANCES 1&lt;br /&gt;MAXLOGHISTORY 1&lt;br /&gt;MAXLOGFILES 5&lt;br /&gt;MAXLOGMEMBERS 3&lt;br /&gt;MAXDATAFILES 100&lt;br /&gt;DATAFILE &#39;C:\oracle\oradata\targetdb\system01.dbf&#39; SIZE 250M REUSE AUTOEXTEND ON NEXT  10240K MAXSIZE UNLIMITED&lt;br /&gt;EXTENT MANAGEMENT LOCAL&lt;br /&gt;DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE &#39;C:\oracle\oradata\targetdb\temp01.dbf&#39; SIZE 40M REUSE AUTOEXTEND ON NEXT  640K MAXSIZE UNLIMITED&lt;br /&gt;UNDO TABLESPACE &quot;UNDOTBS1&quot; DATAFILE &#39;C:\oracle\oradata\targetdb\undotbs01.dbf&#39; SIZE 200M REUSE AUTOEXTEND ON NEXT  5120K MAXSIZE UNLIMITED&lt;br /&gt;CHARACTER SET WE8MSWIN1252&lt;br /&gt;NATIONAL CHARACTER SET AL16UTF16&lt;br /&gt;LOGFILE GROUP 1 (&#39;C:\oracle\oradata\targetdb\redo01.log&#39;) SIZE 102400K,&lt;br /&gt;GROUP 2 (&#39;C:\oracle\oradata\targetdb\redo02.log&#39;) SIZE 102400K,&lt;br /&gt;GROUP 3 (&#39;C:\oracle\oradata\targetdb\redo03.log&#39;) SIZE 102400K;&lt;br /&gt;spool off&lt;br /&gt;exit;&lt;br /&gt;&lt;br /&gt;Database created.&lt;br /&gt;&lt;br /&gt;4.alter database mount;&lt;br /&gt;5.alter database archivelog;&lt;br /&gt;6.alter database open;&lt;br /&gt;&lt;br /&gt;Run catalog.sql from e:\oracle\ora92\rdbms\admin&lt;br /&gt;Eun catproc.sql from e:\oracle\ora92\rdbms\admin&lt;br /&gt;&lt;br /&gt;Go to the e:\oracle\ora92\sqlplus\admin directory, connect as SYSTEM and run @PUPBLD.SQL from the sql prompt. &lt;br /&gt;&lt;br /&gt;open the database and create temp and undo tablespace.&lt;br /&gt;make them at least 600mb each&lt;br /&gt;undo tablespace should be named as undo01&lt;br /&gt;edit the init.ora file where all &quot;UNDO&quot; parameters are there and make them uncommented.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It will be possible to start 11/12 in nomount mode.&lt;br /&gt;But if we mount the database hello1 using 11 instance &lt;br /&gt;then if we try to mount the database using 12 instance &lt;br /&gt;then we will get an error&lt;br /&gt;ORA-01102: cannot mount database in EXCLUSIVE mode.&lt;br /&gt;(Any one of the instances 11 or 12 can be used to open the database).&lt;br /&gt;&lt;br /&gt;THE STEPS IS THEORITICALLY CORRECT BUT PRACTICALLY THERE SEEMS TO BE SOME PROBLEM &lt;br /&gt;(To solve this problem we have to mount and open the database in shared mode and&lt;br /&gt;this is done using the statement&lt;br /&gt;&lt;br /&gt;SQL&gt;ALTER DATABASE MOUNT SHARED;(Parallel server mode)&lt;br /&gt;&lt;br /&gt;(This will ensure that whether we can connect the database using SID 11 or 12&lt;br /&gt;but it will open the same database -hello1).)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;STEPS TO PREPARE AN AUXILLARY INSTANCE FOR TSPITR&lt;br /&gt;-----------------------------------------------------&lt;br /&gt;1.db_file_name_convert=(&#39;e:\oracle\oradata\hello1&#39;,&#39;e:\oracle\oradata\hello2&#39;)&lt;br /&gt;  log_file_name_convert=(&#39;e:\oracle\oradata\hello1&#39;,&#39;e:\oracle\oradata\hello2&#39;)&lt;br /&gt;  lock_name_space=hello2 &lt;br /&gt;  db_name=hello1 instance_name=12&lt;br /&gt;2.Start the auxiliary instance in nomount mode.&lt;br /&gt;&lt;br /&gt;TSPITR-Tablespace Point In Time Recovery&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;Before TSPITR can continue ensure that the database backup is taken and target &lt;br /&gt;database is open and auxillary database is in nomount mode and follow the rules &lt;br /&gt;of tspitr.It should be noted that immediately after TSPITR is done backup &lt;br /&gt;should be taken, otherwise next time TSPITR will give an error.&lt;br /&gt;&lt;br /&gt;Shutdown the auxiliary instance immediately after performing tspitr.&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect target backup_admin/backup_admin@hello1&lt;br /&gt;&lt;br /&gt;connected to target database: hello1 (DBID=3960930000)&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect catalog rman_bnfd/rman_bnfd@kodiak&lt;br /&gt;&lt;br /&gt;connected to recovery catalog database&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect auxiliary sys/sys@hello2&lt;br /&gt;&lt;br /&gt;connected to auxiliary database: hello1 (not mounted)&lt;br /&gt;&lt;br /&gt;RMAN&gt; RECOVER tablespace users UNTIL TIME &quot;to_date(&#39;14-10-2004 15:30:00&#39;,&#39;dd-mm-yyyy hh24:mi:ss&#39;)&quot;&lt;br /&gt;2&gt; ;&lt;br /&gt;&lt;br /&gt;Starting recover at 14-OCT-04&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=20 devtype=DISK&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;# set the until clause&lt;br /&gt;set until  time &quot;to_date(&#39;14-10-2004 15:30:00&#39;,&#39;dd-mm-yyyy hh24:mi:ss&#39;)&quot;;&lt;br /&gt;# restore the controlfile&lt;br /&gt;restore clone controlfile to clone_cf;&lt;br /&gt;# replicate the controlfile&lt;br /&gt;replicate clone controlfile from clone_cf;&lt;br /&gt;# mount the controlfile&lt;br /&gt;sql clone &#39;alter database mount clone database&#39;;&lt;br /&gt;# archive current online log for tspitr to a resent until time&lt;br /&gt;sql &#39;alter system archive log current&#39;;&lt;br /&gt;# avoid unnecessary autobackups for structural changes during TSPITR&lt;br /&gt;sql &#39;begin dbms_backup_restore.AutoBackupFlag(FALSE); end;&#39;;&lt;br /&gt;# resync catalog after controlfile restore&lt;br /&gt;resync catalog;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;Starting restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;allocated channel: ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: sid=12 devtype=DISK&lt;br /&gt;channel ORA_AUX_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_AUX_DISK_1: restoring controlfile&lt;br /&gt;output filename=E:\ORACLE\ORADATA\hello2\CONTROL01.CTL&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\CONTROLFILE\%ORACLE_SID_CTRL_DATE_C-3960930000-20041014-0&lt;br /&gt;5.BAK tag=null params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;Finished restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;replicating controlfile&lt;br /&gt;input filename=E:\ORACLE\ORADATA\hello2\CONTROL01.CTL&lt;br /&gt;output filename=E:\ORACLE\ORADATA\hello2\CONTROL02.CTL&lt;br /&gt;output filename=E:\ORACLE\ORADATA\hello2\CONTROL03.CTL&lt;br /&gt;&lt;br /&gt;sql statement: alter database mount clone database&lt;br /&gt;&lt;br /&gt;sql statement: alter system archive log current&lt;br /&gt;&lt;br /&gt;sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;&lt;br /&gt;&lt;br /&gt;starting full resync of recovery catalog&lt;br /&gt;full resync complete&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;# generated tablespace point-in-time recovery script&lt;br /&gt;# set the until clause&lt;br /&gt;set until  time &quot;to_date(&#39;14-10-2004 15:30:00&#39;,&#39;dd-mm-yyyy hh24:mi:ss&#39;)&quot;;&lt;br /&gt;plsql &lt;&lt;&lt;-- tspitr_2&lt;br /&gt;declare&lt;br /&gt;  sqlstatement       varchar2(512);&lt;br /&gt;  offline_not_needed exception;&lt;br /&gt;  pragma exception_init(offline_not_needed, -01539);&lt;br /&gt;begin&lt;br /&gt;  sqlstatement := &#39;alter tablespace &#39;||  &#39;USERS&#39; ||&#39; offline for recover&#39;;&lt;br /&gt;  krmicd.writeMsg(6162, sqlstatement);&lt;br /&gt;  krmicd.execSql(sqlstatement);&lt;br /&gt;exception&lt;br /&gt;  when offline_not_needed then&lt;br /&gt;    null;&lt;br /&gt;end; &gt;&gt;&gt;;&lt;br /&gt;# set a destination filename for restore&lt;br /&gt;set newname for datafile  1 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello2\SYSTEM01.DBF&quot;;&lt;br /&gt;# set a destination filename for restore&lt;br /&gt;set newname for datafile  2 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello2\UNDOTBS01.DBF&quot;;&lt;br /&gt;# set a destination filename for restore&lt;br /&gt;set newname for datafile  9 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello1\USERS01.DBF&quot;;&lt;br /&gt;# restore the tablespaces in the recovery set plus the auxilliary tablespaces&lt;br /&gt;restore clone datafile  1, 2, 9;&lt;br /&gt;switch clone datafile all;&lt;br /&gt;#online the datafiles restored or flipped&lt;br /&gt;sql clone &quot;alter database datafile  1 online&quot;;&lt;br /&gt;#online the datafiles restored or flipped&lt;br /&gt;sql clone &quot;alter database datafile  2 online&quot;;&lt;br /&gt;#online the datafiles restored or flipped&lt;br /&gt;sql clone &quot;alter database datafile  9 online&quot;;&lt;br /&gt;# make the controlfile point at the restored datafiles, then recover them&lt;br /&gt;recover clone database tablespace  &quot;USERS&quot;, &quot;SYSTEM&quot;, &quot;UNDOTBS1&quot;;&lt;br /&gt;alter clone database open resetlogs;&lt;br /&gt;# PLUG HERE the creation of a temporary tablespace if export fails due to lack&lt;br /&gt;# of temporary space.&lt;br /&gt;# For example in Unix these two lines would do that:&lt;br /&gt;#sql clone &quot;create tablespace aux_tspitr_tmp&lt;br /&gt;#           datafile &#39;&#39;/tmp/aux_tspitr_tmp.dbf&#39;&#39; size 500K&quot;;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;sql statement: alter tablespace USERS offline for recover&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;Starting restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;using channel ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to E:\ORACLE\ORADATA\hello2\SYSTEM01.DBF&lt;br /&gt;restoring datafile 00002 to E:\ORACLE\ORADATA\hello2\UNDOTBS01.DBF&lt;br /&gt;restoring datafile 00009 to E:\ORACLE\ORADATA\hello1\USERS01.DBF&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\DATABASETEST\TEST_0AG2HB1G_1_1.BAK tag=TAG20041014T151351&lt;br /&gt; params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;Finished restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;datafile 9 switched to datafile copy&lt;br /&gt;input datafilecopy recid=4 stamp=539537696 filename=E:\ORACLE\ORADATA\hello1\US&lt;br /&gt;ERS01.DBF&lt;br /&gt;&lt;br /&gt;sql statement: alter database datafile  1 online&lt;br /&gt;&lt;br /&gt;sql statement: alter database datafile  2 online&lt;br /&gt;&lt;br /&gt;sql statement: alter database datafile  9 online&lt;br /&gt;&lt;br /&gt;Starting recover at 14-OCT-04&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;&lt;br /&gt;archive log thread 1 sequence 8 is already on disk as file E:\ORACLE\ORA92\RDBMS&lt;br /&gt;\ARC00008.001&lt;br /&gt;channel ORA_AUX_DISK_1: starting archive log restore to default destination&lt;br /&gt;channel ORA_AUX_DISK_1: restoring archive log&lt;br /&gt;archive log thread=1 sequence=7&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\ARCHIVELOG\%ORACLE_SID_DATA_DATA.BAK tag=TAG20041014T1515&lt;br /&gt;34 params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;archive log filename=E:\ORACLE\ORA92\RDBMS\ARC00007.001 thread=1 sequence=7&lt;br /&gt;archive log filename=E:\ORACLE\ORA92\RDBMS\ARC00008.001 thread=1 sequence=8&lt;br /&gt;media recovery complete&lt;br /&gt;Finished recover at 14-OCT-04&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;# export the tablespaces in the recovery set&lt;br /&gt;host &#39;exp userid =\&quot;sys/sys@hello2 as sysdba\&quot; point_in_time_recover=y tablespa&lt;br /&gt;ces=&lt;br /&gt; USERS file=&lt;br /&gt;tspitr_a.dmp&#39;;&lt;br /&gt;# shutdown clone before import&lt;br /&gt;shutdown clone immediate&lt;br /&gt;# import the tablespaces in the recovery set&lt;br /&gt;host &#39;imp userid =\&quot;backup_admin/backup_admin@hello1 as sysdba\&quot; point_in_time_&lt;br /&gt;recover=y file=&lt;br /&gt;tspitr_a.dmp&#39;;&lt;br /&gt;# online/offline the tablespace imported&lt;br /&gt;sql &quot;alter tablespace  USERS online&quot;;&lt;br /&gt;sql &quot;alter tablespace  USERS offline&quot;;&lt;br /&gt;# enable autobackups in case user does open resetlogs from RMAN after TSPITR&lt;br /&gt;sql &#39;begin dbms_backup_restore.AutoBackupFlag(TRUE); end;&#39;;&lt;br /&gt;# resync catalog after tspitr finished&lt;br /&gt;resync catalog;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Export: Release 9.2.0.1.0 - Production on Thu Oct 14 15:35:22 2004&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 9.2.0.1.0 - Production&lt;br /&gt;Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set&lt;br /&gt;Note: table data (rows) will not be exported&lt;br /&gt;&lt;br /&gt;About to export Tablespace Point-in-time Recovery objects...&lt;br /&gt;For tablespace USERS ...&lt;br /&gt;. exporting cluster definitions&lt;br /&gt;. exporting table definitions&lt;br /&gt;. exporting referential integrity constraints&lt;br /&gt;. exporting triggers&lt;br /&gt;. end point-in-time recovery&lt;br /&gt;Export terminated successfully without warnings.&lt;br /&gt;host command complete&lt;br /&gt;&lt;br /&gt;database closed&lt;br /&gt;database dismounted&lt;br /&gt;Oracle instance shut down&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Import: Release 9.2.0.1.0 - Production on Thu Oct 14 15:35:41 2004&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 9.2.0.1.0 - Production&lt;br /&gt;&lt;br /&gt;Export file created by EXPORT:V09.02.00 via conventional path&lt;br /&gt;About to import Tablespace Point-in-time Recovery objects...&lt;br /&gt;import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set&lt;br /&gt;Import terminated successfully without warnings.&lt;br /&gt;host command complete&lt;br /&gt;&lt;br /&gt;sql statement: alter tablespace  USERS online&lt;br /&gt;&lt;br /&gt;sql statement: alter tablespace  USERS offline&lt;br /&gt;&lt;br /&gt;sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;&lt;br /&gt;&lt;br /&gt;starting full resync of recovery catalog&lt;br /&gt;full resync complete&lt;br /&gt;Finished recover at 14-OCT-04&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ANOTHER EXAMPLE OF TSPITR RECOVERY&lt;br /&gt;-----------------------------------&lt;br /&gt;RMAN&gt; connect target backup_admin/backup_admin@hello1&lt;br /&gt;&lt;br /&gt;connected to target database: hello1 (DBID=3960930000)&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect catalog rman_bnfd/rman_bnfd@kodiak&lt;br /&gt;&lt;br /&gt;connected to recovery catalog database&lt;br /&gt;&lt;br /&gt;RMAN&gt; connect auxiliary sys/sys@hello2&lt;br /&gt;&lt;br /&gt;connected to auxiliary database: hello1 (not mounted)&lt;br /&gt;&lt;br /&gt;RMAN&gt; RECOVER tablespace testbnfd UNTIL TIME &quot;to_date(&#39;14-10-2004 16:20:00&#39;,&#39;dd&lt;br /&gt;-mm-yyyy hh24:mi:ss&#39;)&quot;&lt;br /&gt;2&gt; ;&lt;br /&gt;&lt;br /&gt;Starting recover at 14-OCT-04&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=8 devtype=DISK&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;# set the until clause&lt;br /&gt;set until  time &quot;to_date(&#39;14-10-2004 16:20:00&#39;,&#39;dd-mm-yyyy hh24:mi:ss&#39;)&quot;;&lt;br /&gt;# restore the controlfile&lt;br /&gt;restore clone controlfile to clone_cf;&lt;br /&gt;# replicate the controlfile&lt;br /&gt;replicate clone controlfile from clone_cf;&lt;br /&gt;# mount the controlfile&lt;br /&gt;sql clone &#39;alter database mount clone database&#39;;&lt;br /&gt;# archive current online log for tspitr to a resent until time&lt;br /&gt;sql &#39;alter system archive log current&#39;;&lt;br /&gt;# avoid unnecessary autobackups for structural changes during TSPITR&lt;br /&gt;sql &#39;begin dbms_backup_restore.AutoBackupFlag(FALSE); end;&#39;;&lt;br /&gt;# resync catalog after controlfile restore&lt;br /&gt;resync catalog;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;Starting restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;allocated channel: ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: sid=12 devtype=DISK&lt;br /&gt;channel ORA_AUX_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_AUX_DISK_1: restoring controlfile&lt;br /&gt;output filename=E:\ORACLE\ORADATA\hello2\CONTROL01.CTL&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\CONTROLFILE\%ORACLE_SID_CTRL_DATE_C-3960930000-20041014-0&lt;br /&gt;B.BAK tag=null params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;Finished restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;replicating controlfile&lt;br /&gt;input filename=E:\ORACLE\ORADATA\hello2\CONTROL01.CTL&lt;br /&gt;output filename=E:\ORACLE\ORADATA\hello2\CONTROL02.CTL&lt;br /&gt;output filename=E:\ORACLE\ORADATA\hello2\CONTROL03.CTL&lt;br /&gt;&lt;br /&gt;sql statement: alter database mount clone database&lt;br /&gt;&lt;br /&gt;sql statement: alter system archive log current&lt;br /&gt;&lt;br /&gt;sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;&lt;br /&gt;&lt;br /&gt;starting full resync of recovery catalog&lt;br /&gt;full resync complete&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;# generated tablespace point-in-time recovery script&lt;br /&gt;# set the until clause&lt;br /&gt;set until  time &quot;to_date(&#39;14-10-2004 16:20:00&#39;,&#39;dd-mm-yyyy hh24:mi:ss&#39;)&quot;;&lt;br /&gt;plsql &lt;&lt;&lt;-- tspitr_2&lt;br /&gt;declare&lt;br /&gt;  sqlstatement       varchar2(512);&lt;br /&gt;  offline_not_needed exception;&lt;br /&gt;  pragma exception_init(offline_not_needed, -01539);&lt;br /&gt;begin&lt;br /&gt;  sqlstatement := &#39;alter tablespace &#39;||  &#39;TESTbnfd&#39; ||&#39; offline for recover&#39;;&lt;br /&gt;  krmicd.writeMsg(6162, sqlstatement);&lt;br /&gt;  krmicd.execSql(sqlstatement);&lt;br /&gt;exception&lt;br /&gt;  when offline_not_needed then&lt;br /&gt;    null;&lt;br /&gt;end; &gt;&gt;&gt;;&lt;br /&gt;# set a destination filename for restore&lt;br /&gt;set newname for datafile  1 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello2\SYSTEM01.DBF&quot;;&lt;br /&gt;# set a destination filename for restore&lt;br /&gt;set newname for datafile  2 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello2\UNDOTBS01.DBF&quot;;&lt;br /&gt;# set a destination filename for restore&lt;br /&gt;set newname for datafile  11 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello1\TESTbnfd.ORA&quot;;&lt;br /&gt;# restore the tablespaces in the recovery set plus the auxilliary tablespaces&lt;br /&gt;restore clone datafile  1, 2, 11;&lt;br /&gt;switch clone datafile all;&lt;br /&gt;#online the datafiles restored or flipped&lt;br /&gt;sql clone &quot;alter database datafile  1 online&quot;;&lt;br /&gt;#online the datafiles restored or flipped&lt;br /&gt;sql clone &quot;alter database datafile  2 online&quot;;&lt;br /&gt;#online the datafiles restored or flipped&lt;br /&gt;sql clone &quot;alter database datafile  11 online&quot;;&lt;br /&gt;# make the controlfile point at the restored datafiles, then recover them&lt;br /&gt;recover clone database tablespace  &quot;TESTbnfd&quot;, &quot;SYSTEM&quot;, &quot;UNDOTBS1&quot;;&lt;br /&gt;alter clone database open resetlogs;&lt;br /&gt;# PLUG HERE the creation of a temporary tablespace if export fails due to lack&lt;br /&gt;# of temporary space.&lt;br /&gt;# For example in Unix these two lines would do that:&lt;br /&gt;#sql clone &quot;create tablespace aux_tspitr_tmp&lt;br /&gt;#           datafile &#39;&#39;/tmp/aux_tspitr_tmp.dbf&#39;&#39; size 500K&quot;;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;sql statement: alter tablespace TESTbnfd offline for recover&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;Starting restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;using channel ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to E:\ORACLE\ORADATA\hello2\SYSTEM01.DBF&lt;br /&gt;restoring datafile 00002 to E:\ORACLE\ORADATA\hello2\UNDOTBS01.DBF&lt;br /&gt;restoring datafile 00011 to E:\ORACLE\ORADATA\hello1\TESTbnfd.ORA&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\DATABASETEST\TEST_0JG2HEPM_1_1.BAK tag=TAG20041014T161758&lt;br /&gt; params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;Finished restore at 14-OCT-04&lt;br /&gt;&lt;br /&gt;datafile 11 switched to datafile copy&lt;br /&gt;input datafilecopy recid=6 stamp=539547280 filename=E:\ORACLE\ORADATA\hello1\TE&lt;br /&gt;STbnfd.ORA&lt;br /&gt;&lt;br /&gt;sql statement: alter database datafile  1 online&lt;br /&gt;&lt;br /&gt;sql statement: alter database datafile  2 online&lt;br /&gt;&lt;br /&gt;sql statement: alter database datafile  11 online&lt;br /&gt;&lt;br /&gt;Starting recover at 14-OCT-04&lt;br /&gt;using channel ORA_DISK_1&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;&lt;br /&gt;archive log thread 1 sequence 14 is already on disk as file E:\ORACLE\ORA92\RDBM&lt;br /&gt;S\ARC00014.001&lt;br /&gt;channel ORA_AUX_DISK_1: starting archive log restore to default destination&lt;br /&gt;channel ORA_AUX_DISK_1: restoring archive log&lt;br /&gt;archive log thread=1 sequence=13&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\DATABASETEST\TEST_0NG2HEST_1_1.BAK tag=TAG20041014T161938&lt;br /&gt; params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;archive log filename=E:\ORACLE\ORA92\RDBMS\ARC00013.001 thread=1 sequence=13&lt;br /&gt;archive log filename=E:\ORACLE\ORA92\RDBMS\ARC00014.001 thread=1 sequence=14&lt;br /&gt;media recovery complete&lt;br /&gt;Finished recover at 14-OCT-04&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;# export the tablespaces in the recovery set&lt;br /&gt;host &#39;exp userid =\&quot;sys/sys@hello2 as sysdba\&quot; point_in_time_recover=y tablespa&lt;br /&gt;ces=&lt;br /&gt; TESTbnfd file=&lt;br /&gt;tspitr_a.dmp&#39;;&lt;br /&gt;# shutdown clone before import&lt;br /&gt;shutdown clone immediate&lt;br /&gt;# import the tablespaces in the recovery set&lt;br /&gt;host &#39;imp userid =\&quot;backup_admin/backup_admin@hello1 as sysdba\&quot; point_in_time_&lt;br /&gt;recover=y file=&lt;br /&gt;tspitr_a.dmp&#39;;&lt;br /&gt;# online/offline the tablespace imported&lt;br /&gt;sql &quot;alter tablespace  TESTbnfd online&quot;;&lt;br /&gt;sql &quot;alter tablespace  TESTbnfd offline&quot;;&lt;br /&gt;# enable autobackups in case user does open resetlogs from RMAN after TSPITR&lt;br /&gt;sql &#39;begin dbms_backup_restore.AutoBackupFlag(TRUE); end;&#39;;&lt;br /&gt;# resync catalog after tspitr finished&lt;br /&gt;resync catalog;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Export: Release 9.2.0.1.0 - Production on Thu Oct 14 18:15:12 2004&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 9.2.0.1.0 - Production&lt;br /&gt;Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set&lt;br /&gt;Note: table data (rows) will not be exported&lt;br /&gt;&lt;br /&gt;About to export Tablespace Point-in-time Recovery objects...&lt;br /&gt;For tablespace TESTbnfd ...&lt;br /&gt;. exporting cluster definitions&lt;br /&gt;. exporting table definitions&lt;br /&gt;. . exporting table                          TEST1&lt;br /&gt;. . exporting table                          TEST2&lt;br /&gt;. exporting referential integrity constraints&lt;br /&gt;. exporting triggers&lt;br /&gt;. end point-in-time recovery&lt;br /&gt;Export terminated successfully without warnings.&lt;br /&gt;host command complete&lt;br /&gt;&lt;br /&gt;database closed&lt;br /&gt;database dismounted&lt;br /&gt;Oracle instance shut down&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Import: Release 9.2.0.1.0 - Production on Thu Oct 14 18:15:36 2004&lt;br /&gt;&lt;br /&gt;Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production&lt;br /&gt;With the Partitioning, OLAP and Oracle Data Mining options&lt;br /&gt;JServer Release 9.2.0.1.0 - Production&lt;br /&gt;&lt;br /&gt;Export file created by EXPORT:V09.02.00 via conventional path&lt;br /&gt;About to import Tablespace Point-in-time Recovery objects...&lt;br /&gt;import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set&lt;br /&gt;. importing bnfd&#39;s objects into bnfd&lt;br /&gt;. . importing table                        &quot;TEST1&quot;&lt;br /&gt;. . importing table                        &quot;TEST2&quot;&lt;br /&gt;. importing SYS&#39;s objects into SYS&lt;br /&gt;Import terminated successfully without warnings.&lt;br /&gt;host command complete&lt;br /&gt;&lt;br /&gt;sql statement: alter tablespace  TESTbnfd online&lt;br /&gt;&lt;br /&gt;sql statement: alter tablespace  TESTbnfd offline&lt;br /&gt;&lt;br /&gt;sql statement: begin dbms_backup_restore.AutoBackupFlag(TRUE); end;&lt;br /&gt;&lt;br /&gt;starting full resync of recovery catalog&lt;br /&gt;full resync complete&lt;br /&gt;Finished recover at 14-OCT-04&lt;br /&gt;&lt;br /&gt;RMAN&gt;&lt;br /&gt;&lt;br /&gt;RMAN&gt;&lt;br /&gt;&lt;br /&gt;AFTER THE TABLESPACE POINT IN TIME RECOVERY IS OVER THE TABLESPACE SHOULD BE MADE ONLINE FOR &lt;br /&gt;FURTHUR TRANSACTIONS.&lt;br /&gt;2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATING A CLONE DATABASE(hello1 database being duplicated to hello3).BEFORE CLONING THE DATABASE&lt;br /&gt;IT SHOULD BE SEEN THAT THE SCN IS SET TILL THE LAST ARCHIVELOG SCN.THIS INFORMATION CAN BE OBTAINED &lt;br /&gt;BY ISSUING THE SQL STATEMENT SELECT * FROM V$DATABASE;)&lt;br /&gt;connect to auxiliary database before starting the database cloning&lt;br /&gt;----------------------------&lt;br /&gt;RMAN&gt; RUN&lt;br /&gt;2&gt; {&lt;br /&gt;3&gt; set until scn  2338189;&lt;br /&gt;4&gt; duplicate target database to hello3;&lt;br /&gt;5&gt; }&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;Starting Duplicate Db at 04-DEC-04&lt;br /&gt;allocated channel: ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: sid=12 devtype=DISK&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;   set until scn  2338189;&lt;br /&gt;   set newname for datafile  1 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello3\SYSTEM01.DBF&quot;;&lt;br /&gt;   set newname for datafile  2 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello3\UNDO01&quot;;&lt;br /&gt;   set newname for datafile  3 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello3\TEMP01&quot;;&lt;br /&gt;   set newname for datafile  4 to&lt;br /&gt; &quot;E:\ORACLE\ORADATA\hello3\bnfdTEST&quot;;&lt;br /&gt;   restore&lt;br /&gt;   check readonly&lt;br /&gt;   clone database&lt;br /&gt;   ;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;executing command: SET NEWNAME&lt;br /&gt;&lt;br /&gt;Starting restore at 04-DEC-04&lt;br /&gt;&lt;br /&gt;using channel ORA_AUX_DISK_1&lt;br /&gt;channel ORA_AUX_DISK_1: starting datafile backupset restore&lt;br /&gt;channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set&lt;br /&gt;restoring datafile 00001 to E:\ORACLE\ORADATA\hello3\SYSTEM01.DBF&lt;br /&gt;restoring datafile 00002 to E:\ORACLE\ORADATA\hello3\UNDO01&lt;br /&gt;restoring datafile 00003 to E:\ORACLE\ORADATA\hello3\TEMP01&lt;br /&gt;restoring datafile 00004 to E:\ORACLE\ORADATA\hello3\bnfdTEST&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\DATABASETEST\TEST_37G6ON27_1_1.BAK tag=TAG20041203T232702&lt;br /&gt; params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;Finished restore at 04-DEC-04&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE &quot;hello3&quot; RESETLOGS ARCHIVE&lt;br /&gt;LOG&lt;br /&gt;  MAXLOGFILES     40&lt;br /&gt;  MAXLOGMEMBERS      2&lt;br /&gt;  MAXDATAFILES      240&lt;br /&gt;  MAXINSTANCES    16&lt;br /&gt;  MAXLOGHISTORY     1815&lt;br /&gt; LOGFILE&lt;br /&gt;  GROUP  1 ( &#39;E:\ORACLE\ORADATA\hello3\REDO01.LOG&#39; ) SIZE    5242880  REUSE,&lt;br /&gt;  GROUP  2 ( &#39;E:\ORACLE\ORADATA\hello3\REDO02.LOG&#39; ) SIZE    5242880  REUSE,&lt;br /&gt;  GROUP  3 ( &#39;E:\ORACLE\ORADATA\hello3\REDO03.LOG&#39; ) SIZE    5242880  REUSE&lt;br /&gt; DATAFILE&lt;br /&gt;  &#39;E:\ORACLE\ORADATA\hello3\SYSTEM01.DBF&#39;&lt;br /&gt; CHARACTER SET WE8ISO8859P1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;   switch clone datafile all;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;datafile 2 switched to datafile copy&lt;br /&gt;input datafilecopy recid=1 stamp=543977044 filename=E:\ORACLE\ORADATA\hello3\UN&lt;br /&gt;DO01&lt;br /&gt;datafile 3 switched to datafile copy&lt;br /&gt;input datafilecopy recid=2 stamp=543977044 filename=E:\ORACLE\ORADATA\hello3\TE&lt;br /&gt;MP01&lt;br /&gt;datafile 4 switched to datafile copy&lt;br /&gt;input datafilecopy recid=3 stamp=543977044 filename=E:\ORACLE\ORADATA\hello3\SU&lt;br /&gt;MANTEST&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;   set until scn  2338189;&lt;br /&gt;   recover&lt;br /&gt;   clone database&lt;br /&gt;    delete archivelog&lt;br /&gt;   ;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;executing command: SET until clause&lt;br /&gt;&lt;br /&gt;Starting recover at 04-DEC-04&lt;br /&gt;using channel ORA_AUX_DISK_1&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;&lt;br /&gt;archive log thread 1 sequence 4 is already on disk as file E:\ORACLE\ORA92\RDBMS&lt;br /&gt;\ARC00004.001&lt;br /&gt;channel ORA_AUX_DISK_1: starting archive log restore to default destination&lt;br /&gt;channel ORA_AUX_DISK_1: restoring archive log&lt;br /&gt;archive log thread=1 sequence=3&lt;br /&gt;channel ORA_AUX_DISK_1: restored backup piece 1&lt;br /&gt;piece handle=C:\BACKUP\ARCHIVELOG\%ORACLE_SID_DATA_DATA_U%.BAK tag=TAG20041203T2&lt;br /&gt;32756 params=NULL&lt;br /&gt;channel ORA_AUX_DISK_1: restore complete&lt;br /&gt;archive log filename=E:\ORACLE\ORA92\DATABASE\hello3ARC00003.001 thread=1 seque&lt;br /&gt;nce=3&lt;br /&gt;channel clone_default: deleting archive log(s)&lt;br /&gt;archive log filename=E:\ORACLE\ORA92\DATABASE\hello3ARC00003.001 recid=1 stamp=&lt;br /&gt;543977050&lt;br /&gt;archive log filename=E:\ORACLE\ORA92\RDBMS\ARC00004.001 thread=1 sequence=4&lt;br /&gt;media recovery complete&lt;br /&gt;Finished recover at 04-DEC-04&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;   shutdown clone;&lt;br /&gt;   startup clone nomount ;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;database closed&lt;br /&gt;database dismounted&lt;br /&gt;Oracle instance shut down&lt;br /&gt;&lt;br /&gt;connected to auxiliary database (not started)&lt;br /&gt;Oracle instance started&lt;br /&gt;&lt;br /&gt;Total System Global Area     185670316 bytes&lt;br /&gt;&lt;br /&gt;Fixed Size                      453292 bytes&lt;br /&gt;Variable Size                159383552 bytes&lt;br /&gt;Database Buffers              25165824 bytes&lt;br /&gt;Redo Buffers                    667648 bytes&lt;br /&gt;sql statement: CREATE CONTROLFILE REUSE SET DATABASE &quot;hello3&quot; RESETLOGS ARCHIVE&lt;br /&gt;LOG&lt;br /&gt;  MAXLOGFILES     40&lt;br /&gt;  MAXLOGMEMBERS      2&lt;br /&gt;  MAXDATAFILES      240&lt;br /&gt;  MAXINSTANCES    16&lt;br /&gt;  MAXLOGHISTORY     1815&lt;br /&gt; LOGFILE&lt;br /&gt;  GROUP  1 ( &#39;E:\ORACLE\ORADATA\hello3\REDO01.LOG&#39; ) SIZE    5242880  REUSE,&lt;br /&gt;  GROUP  2 ( &#39;E:\ORACLE\ORADATA\hello3\REDO02.LOG&#39; ) SIZE    5242880  REUSE,&lt;br /&gt;  GROUP  3 ( &#39;E:\ORACLE\ORADATA\hello3\REDO03.LOG&#39; ) SIZE    5242880  REUSE&lt;br /&gt; DATAFILE&lt;br /&gt;  &#39;E:\ORACLE\ORADATA\hello3\SYSTEM01.DBF&#39;&lt;br /&gt; CHARACTER SET WE8ISO8859P1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;   catalog clone datafilecopy  &quot;E:\ORACLE\ORADATA\hello3\UNDO01&quot;;&lt;br /&gt;   catalog clone datafilecopy  &quot;E:\ORACLE\ORADATA\hello3\TEMP01&quot;;&lt;br /&gt;   catalog clone datafilecopy  &quot;E:\ORACLE\ORADATA\hello3\bnfdTEST&quot;;&lt;br /&gt;   switch clone datafile all;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=E:\ORACLE\ORADATA\hello3\UNDO01 recid=1 stamp=543977210&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=E:\ORACLE\ORADATA\hello3\TEMP01 recid=2 stamp=543977210&lt;br /&gt;&lt;br /&gt;cataloged datafile copy&lt;br /&gt;datafile copy filename=E:\ORACLE\ORADATA\hello3\bnfdTEST recid=3 stamp=5439772&lt;br /&gt;11&lt;br /&gt;&lt;br /&gt;datafile 2 switched to datafile copy&lt;br /&gt;input datafilecopy recid=1 stamp=543977210 filename=E:\ORACLE\ORADATA\hello3\UN&lt;br /&gt;DO01&lt;br /&gt;datafile 3 switched to datafile copy&lt;br /&gt;input datafilecopy recid=2 stamp=543977210 filename=E:\ORACLE\ORADATA\hello3\TE&lt;br /&gt;MP01&lt;br /&gt;datafile 4 switched to datafile copy&lt;br /&gt;input datafilecopy recid=3 stamp=543977211 filename=E:\ORACLE\ORADATA\hello3\SU&lt;br /&gt;MANTEST&lt;br /&gt;&lt;br /&gt;printing stored script: Memory Script&lt;br /&gt;{&lt;br /&gt;   Alter clone database open resetlogs;&lt;br /&gt;}&lt;br /&gt;executing script: Memory Script&lt;br /&gt;&lt;br /&gt;database opened&lt;br /&gt;Finished Duplicate Db at 04-DEC-04</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/7183463500818528501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/7183463500818528501' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7183463500818528501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7183463500818528501'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/create-multiple-instance-on-single.html' title='Create Multiple Instance on A Single Database'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-7576671106675148558</id><published>2010-04-09T20:37:00.001-07:00</published><updated>2010-04-09T20:37:22.004-07:00</updated><title type='text'>Optach for RDBMS Oracle_HOme</title><content type='html'>connect as oracle&lt;br /&gt;set env of instance &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1) down load the patch from updates.oracle.com to $ORACLE_HOME/patch&lt;br /&gt;&lt;br /&gt;unzip the patch. &lt;br /&gt;&lt;br /&gt;During uzipping please note down the directory it is creating.&lt;br /&gt;&lt;br /&gt;cd to that directory. copy the directory path(copied path).&lt;br /&gt;&lt;br /&gt;2)&lt;br /&gt;&lt;br /&gt;export PATH=&lt;opatch_path&gt;/OPatch:$PATH  &lt;br /&gt;&lt;br /&gt;export PATH=/opt/perl/bin:$PATH&lt;br /&gt;&lt;br /&gt;3)&lt;br /&gt;Apply the patch by this command&lt;br /&gt;&lt;br /&gt;opatch apply -invPtrLoc &lt;location_of_oraInst.loc&gt;/oraInst.loc &lt;location_of_patch&gt;/&lt;rdbms_patch_number&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/7576671106675148558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/7576671106675148558' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7576671106675148558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7576671106675148558'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/optach-for-rdbms-oraclehome.html' title='Optach for RDBMS Oracle_HOme'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-8567993625075097101</id><published>2010-04-09T20:28:00.000-07:00</published><updated>2010-04-09T20:32:37.366-07:00</updated><title type='text'>Optimizer Statstics &amp; Index Usage!!!</title><content type='html'>Optimizer Statistics - &lt;br /&gt;&lt;br /&gt;To Verify - &lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT TABLE_NAME, NUM_ROWS, BLOCKS, AVG_ROW_LEN,&lt;br /&gt;       TO_CHAR(LAST_ANALYZED, &#39;MM/DD/YYYY HH24:MI:SS&#39;)&lt;br /&gt;     FROM DBA_TABLES&lt;br /&gt;     WHERE TABLE_NAME IN (&#39;SO_LINES_ALL&#39;,&#39;SO_HEADERS_ALL&#39;,&#39;SO_LAST_ALL&#39;);&lt;br /&gt;&lt;br /&gt;TABLE_NAME        NUM_ROWS   BLOCKS   AVG_ROW_LEN LAST_ANALYZED&lt;br /&gt;------------ --------   -------  ----------- -------------&lt;br /&gt;SO_HEADERS_ALL     1632264    209014        149  07/29/2009 00:59:51&lt;br /&gt;SO_LINES_ALL       10493845   1922196            263  07/29/2009 01:16:09&lt;br /&gt;SO_LAST_ALL&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note - SO_LAST_ALL has no statistics.&lt;br /&gt;&lt;br /&gt;Verifying Index Statistics&lt;br /&gt;To verify that index statistics are available and assist you in determining which are the best indexes to use in an application, execute the following statement against the dictionary DBA_INDEXES view: &lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT INDEX_NAME &quot;NAME&quot;, NUM_ROWS, DISTINCT_KEYS &quot;DISTINCT&quot;,&lt;br /&gt;  1  LEAF_BLOCKS, CLUSTERING_FACTOR &quot;CF&quot;, BLEVEL &quot;LEVEL&quot;,&lt;br /&gt;  2  AVG_LEAF_BLOCKS_PER_KEY &quot;ALFBPKEY&quot;&lt;br /&gt;  3  FROM DBA_INDEXES&lt;br /&gt;  4  WHERE owner = &#39;SH&#39;&lt;br /&gt;  5* ORDER BY INDEX_NAME;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NAME                             NUM_ROWS   DISTINCT LEAF_BLOCKS         CF      LEVEL   ALFBPKEY&lt;br /&gt;------------------------------ ---------- ---------- ----------- ---------- ---------- ----------&lt;br /&gt;CUSTOMERS_PK                        50000      50000         454       4405          2          1&lt;br /&gt;PRODUCTS_PK                         10000      10000          90       1552          1          1&lt;br /&gt;PRODUCTS_PROD_CAT_IX                10000          4          99       4422          1         24&lt;br /&gt;PRODUCTS_PROD_SUBCAT_IX             10000         37         170       6148          2          4&lt;br /&gt;SALES_PROD_BIX                       6287        909        1480       6287          1          1&lt;br /&gt;SALES_PROMO_BIX                      4727        459         570       4727          1          1&lt;br /&gt;&lt;br /&gt;6 rows selected.&lt;br /&gt;&lt;br /&gt;Optimizer Index Determination Criteria&lt;br /&gt;The optimizer uses the following criteria when determining which index to use: &lt;br /&gt;&lt;br /&gt;Number of rows in the index (cardinality) &lt;br /&gt;&lt;br /&gt;Number of distinct keys. These define the selectivity of the index. &lt;br /&gt;&lt;br /&gt;Level or height of the index. This indicates how deeply the data &#39;probe&#39; must search in order to find the data. &lt;br /&gt;&lt;br /&gt;Number of leaf blocks in the index. This is the number of I/Os needed to find the desired rows of data. &lt;br /&gt;&lt;br /&gt;Clustering factor (CF). This is the collocation amount of the index block relative to data blocks. The higher the CF, the less likely the optimizer is to select this index. &lt;br /&gt;&lt;br /&gt;Average leaf blocks per key (ALFBKEY). Average number of leaf blocks in which each distinct value in the index appears, rounded to the nearest integer. For indexes that enforce UNIQUE and PRIMARY KEY constraints, this value is always one. &lt;br /&gt;&lt;br /&gt;Determining if You Have Chosen the Right Index&lt;br /&gt;Use the following notes to assist you in deciding whether you have chosen an appropriate index for a table, data, and query: &lt;br /&gt;&lt;br /&gt;DISTINCT &lt;br /&gt;Consider index ap_invoices_n3, the number of distinct keys is two. The resulting selectivity based on index ap_invoices_n3 is poor, and the optimizer is not likely to use this index. Using this index fetches 50% of the data in the table. In this case, a full table scan is cheaper than using index ap_invoices_n3. &lt;br /&gt;&lt;br /&gt;Index Cost Tie &lt;br /&gt;The optimizer uses alphabetic determination: If the optimizer determines that the selectivity, cost, and cardinality of two finalist indexes is the same, then it uses the two indexes&#39; names as the deciding factor. It chooses the index with name beginning with a lower alphabetic letter or number. &lt;br /&gt;&lt;br /&gt;Verifying Column Statistics&lt;br /&gt;To verify that column statistics are available, execute the following statement against the dictionary&#39;s DBA_TAB_COL_STATISTICS view: &lt;br /&gt;&lt;br /&gt;SQL&gt; SELECT COLUMN_NAME, NUM_DISTINCT, NUM_NULLS, NUM_BUCKETS, DENSITY&lt;br /&gt;&lt;br /&gt;FROM DBA_TAB_COL_STATISTICS&lt;br /&gt;WHERE TABLE_NAME =&quot;PA_EXPENDITURE_ITEMS_ALL&quot;&lt;br /&gt;ORDER BY COLUMN_NAME;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This returns the following data: &lt;br /&gt;&lt;br /&gt;COLUMN_NAME                    NUM_DISTINCT  NUM_NULLS NUM_BUCKETS    DENSITY &lt;br /&gt;------------------------------ ------------ ---------- ----------- ---------- &lt;br /&gt;BURDEN_COST                            4300      71957           1 .000232558 &lt;br /&gt;BURDEN_COST_RATE                        675    7376401           1 .001481481 &lt;br /&gt;CONVERTED_FLAG                            1   16793903           1          1 &lt;br /&gt;COST_BURDEN_DISTRIBUTED_FLAG              2      15796           1         .5 &lt;br /&gt;COST_DISTRIBUTED_FLAG                     2          0           1         .5 &lt;br /&gt;COST_IND_COMPILED_SET_ID                 87    6153143           1 .011494253 &lt;br /&gt;EXPENDITURE_ID                      1171831          0           1 8.5337E-07 &lt;br /&gt;TASK_ID                                8648          0           1 .000115634 &lt;br /&gt;TRANSFERRED_FROM_EXP_ITEM_ID        1233787   15568891           1 8.1051E-07 &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Verifying column statistics are important for the following conditions: &lt;br /&gt;&lt;br /&gt;Join conditions &lt;br /&gt;&lt;br /&gt;When the WHERE clause includes a column(s) with a bind variable; for example: &lt;br /&gt;&lt;br /&gt;column x  = :variable_y&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In these cases, the stored column statistics can be used to get a representative cardinality estimation for the given expression. &lt;br /&gt;&lt;br /&gt;Consider the data returned in the previous example. &lt;br /&gt;&lt;br /&gt;NUM_DISTINCT Column Statistic&lt;br /&gt;Low&lt;br /&gt;The number of distinct values for the columns CONVERTED_FLAG is one. In this case this column has only one value. If in the WHERE clause, then there is a bind variable on column CONVERTED_FLAG = :variable_y, say. If CONVERTED_FLAG is low, as the case in this example, then this leads to poor selectivity, and CONVERTED_FLAG is a poor candidate to be used as the index. &lt;br /&gt;&lt;br /&gt;Column COST_BURDEN_DISTRIBUTED_FLAG: NUM_DISTINCT = 2. Likewise, this is low. COST_BURDEN_DISTRIBUTED_FLAG is not a good candidate for an index unless there is much skew or there are a lot of nulls. If there is data skew of, say, 90%, then 90% of the data has one particular value and 10% of the data has another value. If the query only needs to access the 10%, then a histogram is needed on that column in order for the optimizer to recognize the skew and use an index on this column. &lt;br /&gt;&lt;br /&gt;High&lt;br /&gt;NUM_DISTINCT is more than 1 million for column EXPEDITURE_ID. If there is a bind variable on column EXPENDITURE_ID, then this leads to high selectivity (implying high density of data on this column). In other words, EXPENDITURE_ID is a good candidate to be used as the index. &lt;br /&gt;&lt;br /&gt;NUM_NULL Column Statistic&lt;br /&gt;NUM_NULLS indicates the number of null statistics. &lt;br /&gt;&lt;br /&gt;Low &lt;br /&gt;For example, if a single column index has few nulls, such as the COST_DISTRIBUTED_FLAG column, and if this column is used as the index, then the resulting data set is large. &lt;br /&gt;&lt;br /&gt;High &lt;br /&gt;If there are many nulls on a particular column, such as the CONVERTED_FLAG column, and if this column is used as the index, then the resulting data set is small. This means that COST_DISTRIBUTED_FLAG is a more appropriate column to index. &lt;br /&gt;&lt;br /&gt;DENSITY Column Statistic&lt;br /&gt;This indicates the density of the values of that column. This is calculated by 1 over NUM_DISTINCT. &lt;br /&gt;&lt;br /&gt;Column Statistics and Join Methods&lt;br /&gt;Column statistics are useful to help determine the most efficient join method, which, in turn, is also based on the number of rows returned.</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/8567993625075097101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/8567993625075097101' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/8567993625075097101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/8567993625075097101'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/optimizer-statstics-index-usage.html' title='Optimizer Statstics &amp; Index Usage!!!'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-7642524255534162108</id><published>2010-04-09T18:01:00.003-07:00</published><updated>2010-04-09T18:02:56.101-07:00</updated><title type='text'>Services in Oracle 10g and 11g</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/7642524255534162108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/7642524255534162108' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7642524255534162108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7642524255534162108'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/services-in-oracle-10g-and-11g.html' title='Services in Oracle 10g and 11g'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-1959263136953679246</id><published>2010-04-09T18:01:00.001-07:00</published><updated>2010-04-09T18:01:25.559-07:00</updated><title type='text'>Cluster Databases in enterprise</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/1959263136953679246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/1959263136953679246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/1959263136953679246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/1959263136953679246'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/cluster-databases-in-enterprise.html' title='Cluster Databases in enterprise'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-2080496549791517826</id><published>2010-04-09T18:00:00.003-07:00</published><updated>2010-04-09T18:00:57.602-07:00</updated><title type='text'>Managing ASM in an Enterprise</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/2080496549791517826/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/2080496549791517826' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/2080496549791517826'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/2080496549791517826'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/managing-asm-in-enterprise.html' title='Managing ASM in an Enterprise'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-7019025561382479210</id><published>2010-04-09T18:00:00.001-07:00</published><updated>2010-04-09T18:00:39.324-07:00</updated><title type='text'>OEM - The Grid Control</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/7019025561382479210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/7019025561382479210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7019025561382479210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7019025561382479210'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/oem-grid-control.html' title='OEM - The Grid Control'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-6780842501645261360</id><published>2010-04-09T17:59:00.001-07:00</published><updated>2010-04-09T18:00:19.160-07:00</updated><title type='text'>Database 11gR2 - New Features!!!</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/6780842501645261360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/6780842501645261360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/6780842501645261360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/6780842501645261360'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/database-11gr2-new-features.html' title='Database 11gR2 - New Features!!!'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-648903004417511596</id><published>2010-04-09T17:59:00.000-07:00</published><updated>2010-04-09T17:59:12.771-07:00</updated><title type='text'>Blogger Buzz: Blogger integrates with Amazon Associates</title><content type='html'>&lt;a href=&quot;http://buzz.blogger.com/2009/12/blogger-integrates-with-amazon.html&quot;&gt;Blogger Buzz: Blogger integrates with Amazon Associates&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/648903004417511596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/648903004417511596' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/648903004417511596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/648903004417511596'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/04/blogger-buzz-blogger-integrates-with.html' title='Blogger Buzz: Blogger integrates with Amazon Associates'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-955740399119348974</id><published>2010-01-16T16:50:00.001-08:00</published><updated>2010-01-16T16:51:00.308-08:00</updated><title type='text'>Advanced Back up using RMAN</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/955740399119348974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/955740399119348974' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/955740399119348974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/955740399119348974'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/01/advanced-back-up-using-rman.html' title='Advanced Back up using RMAN'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-5670436626911338064</id><published>2010-01-16T16:49:00.000-08:00</published><updated>2010-01-16T16:50:22.338-08:00</updated><title type='text'>Best Practices For Oracle Database Adminstrators</title><content type='html'></content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/5670436626911338064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/5670436626911338064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5670436626911338064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5670436626911338064'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2010/01/best-practices-for-oracle-database.html' title='Best Practices For Oracle Database Adminstrators'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-2940438057594813882</id><published>2009-12-16T13:29:00.000-08:00</published><updated>2009-12-16T13:30:11.480-08:00</updated><title type='text'>How to determine which Unix shell you are using</title><content type='html'>How to determine which Unix shell you are using:&lt;br /&gt;&lt;br /&gt; &gt; env | grep SHELL&lt;br /&gt;&lt;br /&gt;        -or-&lt;br /&gt;&lt;br /&gt;        &gt; echo $SHELL&lt;br /&gt; &lt;br /&gt;  -or-&lt;br /&gt;&lt;br /&gt; &gt; ps -f        ....Will provide a full listing of processes associated&lt;br /&gt;                       with the current terminal, one of which will be the &lt;br /&gt;                       shell process.&lt;br /&gt;&lt;br /&gt; -or-&lt;br /&gt;&lt;br /&gt; &gt; setenv       ....On a C shell this will return the current &lt;br /&gt;                       environment, while other shells will return an error.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Please Note:&lt;br /&gt;The following examples use &#39;ORACLE_HOME&#39; as the variable name.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;BOURNE SHELL(sh):&lt;br /&gt;-----------------&lt;br /&gt;&lt;br /&gt;To set environment variables within a Bourne Shell (sh), the variable must be&lt;br /&gt;initialized locally, then exported globally:&lt;br /&gt;&lt;br /&gt; &gt; ORACLE_HOME=/u01/app/oracle/product/8.1.7   &lt;br /&gt;                ...defines ORACLE_HOME locally to the shell&lt;br /&gt;&lt;br /&gt; &gt; export ORACLE_HOME  &lt;br /&gt;                ...makes it globally available to other processes started from&lt;br /&gt;                this shell&lt;br /&gt;&lt;br /&gt;To have a variable set automatically when you log into the Bourne Shell of your&lt;br /&gt;Unix server:&lt;br /&gt;&lt;br /&gt; Add the above lines (minus the &#39;&gt;&#39; prompt) to the hidden &#39;.profile&#39; &lt;br /&gt;        file in your $HOME directory. &lt;br /&gt;&lt;br /&gt;If you make changes to your &#39;.profile&#39; and want those changes propagated to &lt;br /&gt;your current running environment (without having to log out, then back in):&lt;br /&gt;&lt;br /&gt;        &gt; cd $HOME&lt;br /&gt; &gt; . .profile&lt;br /&gt;&lt;br /&gt;To unset environment variables within a Bourne Shell (sh):&lt;br /&gt;&lt;br /&gt; &gt; unset ORACLE_HOME&lt;br /&gt;&lt;br /&gt;To check what an environment variable is set to:&lt;br /&gt;&lt;br /&gt; &gt; env | grep ORACLE_HOME&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;KORN SHELL(ksh):&lt;br /&gt;----------------&lt;br /&gt;&lt;br /&gt;To set environment variables within a Korn Shell (ksh), you can use the Bourne &lt;br /&gt;syntax show above, or use the streamlined Korn Shell syntax:&lt;br /&gt;&lt;br /&gt; &gt; export ORACLE_HOME=/u01/app/oracle/product/8.1.7 &lt;br /&gt;&lt;br /&gt;To have a variable set automatically when you log into the Korn Shell of your&lt;br /&gt;Unix server:&lt;br /&gt;&lt;br /&gt; Add the above lines (minus the &#39;&gt;&#39; prompt) to the hidden &#39;.profile&#39; &lt;br /&gt;        file in your $HOME directory. &lt;br /&gt;&lt;br /&gt;If you make changes to your &#39;.profile&#39; and want those changes propagated to &lt;br /&gt;your current running environment (without having to log out, then back in):&lt;br /&gt;&lt;br /&gt; &gt; cd $HOME&lt;br /&gt; &gt; . .profile&lt;br /&gt;&lt;br /&gt;To unset environment variables within a Korn Shell (ksh), use the same syntax &lt;br /&gt;as you would in a Bourne Shell (sh):&lt;br /&gt;&lt;br /&gt; &gt; unset ORACLE_HOME&lt;br /&gt;&lt;br /&gt;To check what an environment variable is set to:&lt;br /&gt;&lt;br /&gt; &gt; env | grep ORACLE_HOME&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;C SHELL(csh):&lt;br /&gt;-------------&lt;br /&gt;&lt;br /&gt;To set environment variables within a C Shell (csh):&lt;br /&gt;&lt;br /&gt; &gt; setenv ORACLE_HOME /u01/app/oracle/product/11.1.0</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/2940438057594813882/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/2940438057594813882' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/2940438057594813882'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/2940438057594813882'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/12/how-to-determine-which-unix-shell-you.html' title='How to determine which Unix shell you are using'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-6156908246586100530</id><published>2009-04-01T15:33:00.000-07:00</published><updated>2009-04-01T15:43:53.487-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="DBMS_stats"/><title type='text'>DBMS_STATS</title><content type='html'>&lt;div&gt;Optimizer statistics are a collection of data that describe more details about the database and the objects in the database. These statistics are used by the query optimizer to choose the best execution plan for each SQL statement&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The optimizer statistics are stored in the &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;data dictionary&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because the objects in a database can be constantly changing, statistics must be regularly updated so that they accurately describe these database objects. Statistics are maintained automatically by Oracle or you can maintain the optimizer statistics manually using the &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;DBMS_STATS &lt;/span&gt;package.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;Automatic Statistics Gathering:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Oracle gathers statistics on all database objects automatically and maintains those statistics in a regularly-scheduled maintenance job. Automated statistics collection eliminates many of the manual tasks associated with managing the query optimizer, and significantly reduces the chances of getting poor execution plans because of missing or stale statistics.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Optimizer statistics are automatically gathered with the job &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;GATHER_STATS_JOB&lt;/span&gt;. This job gathers statistics on all objects in the database which have:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Missing statistics&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Stale statistics&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This job is created automatically at database creation time and is managed by the Scheduler. The Scheduler runs this job when the maintenance window is opened. By default, the maintenance window opens every night from 10 P.M. to 6 A.M. and all day on weekends.&lt;/div&gt;&lt;div&gt;It calls DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC procedure.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Automatic statistics gathering is enabled by default when a database is created, or when a database is upgraded from an earlier database release. You can verify that the job exists by viewing the DBA_SCHEDULER_JOBS view:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT * FROM DBA_SCHEDULER_JOBS WHERE JOB_NAME = &#39;GATHER_STATS_JOB&#39;;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT owner, job_name, enabled FROM dba_scheduler_jobs;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;OWNER                          JOB_NAME                                                     ENABLE&lt;/div&gt;&lt;div&gt;------------------------------ ----------------                       ---------------------&lt;/div&gt;&lt;div&gt;SYS                            PURGE_LOG                                                        TRUE&lt;/div&gt;&lt;div&gt;SYS                            GATHER_STATS_JOB                                       TRUE&lt;/div&gt;&lt;div&gt;SYS                            TEST_FULL_JOB_DEFINITION                     TRUE&lt;/div&gt;&lt;div&gt;SYS                            TEST_PROG_SCHED_JOB_DEFINITION     TRUE&lt;/div&gt;&lt;div&gt;SYS                            TEST_PROG_JOB_DEFINITION                     TRUE&lt;/div&gt;&lt;div&gt;SYS                            TEST_SCHED_JOB_DEFINITION                   TRUE&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;Manual Statistics:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because the automatic statistics gathering runs during an overnight batch window, the statistics on tables which are significantly modified during the day may become stale. There are typically two types of such objects:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Volatile tables that are being deleted or truncated and rebuilt during the course of the day.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Objects which are the target of large bulk loads which add 10% or more to the object&#39;s total size.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Statistics are gathered using the DBMS_STATS package. This PL/SQL package is also used to modify, view, export, import, and delete statistics.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The DBMS_STATS package can gather statistics on table and indexes, and well as individual columns and partitions of tables&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Procedures in DBMS_STATS Package:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;GATHER_INDEX_STATS === Index statistics&lt;/div&gt;&lt;div&gt;GATHER_TABLE_STATS === Table, column, and index statistics&lt;/div&gt;&lt;div&gt;GATHER_SCHEMA_STATS === Statistics for all objects in a schema&lt;/div&gt;&lt;div&gt;GATHER_DICTIONARY_STATS&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt; &lt;/span&gt;=== Statistics for all dictionary objects, for all system schemas, including SYS and SYSTEM and other optional schemas &lt;/div&gt;&lt;div&gt;GATHER_DATABASE_STATS === Statistics for all objects in a database&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;When to Gather Statistic:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.For an application in which tables are being incrementally modified&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2.For tables which are being substantially modified in batch operations, such as with bulk loads&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3.For partitioned tables, there are often cases in which only a single partition is modified.In those cases, statistics can be gathered only on those partitions rather than gathering statistics for the entire table&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;System Statistics&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; Describe the system&#39;s hardware characteristics, such as I/O and CPU performance and utilization, to the query optimizer. When choosing an execution plan, the optimizer estimates the I/O and CPU resources required for each query&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold; &quot;&gt;Gather, View, Modify or Delete optimizer statistics for database objects:&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;Subprocedures&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;GATHER_DATABASE_STATS&lt;/div&gt;&lt;div&gt;    (estimate_percent,block_sample,method_opt,degree, granularity,cascade,stattab, &lt;/div&gt;&lt;div&gt;     statid, options,statown,gather_sys,no_invalidate,gather_temp,gather_fixed,stattype);&lt;/div&gt;&lt;div&gt;GATHER_INDEX_STATS &lt;/div&gt;&lt;div&gt;    (ownname,indname,partname,estimate_percent,stattab,statid                  &lt;/div&gt;&lt;div&gt;     statown,degree,granularity,no_invalidate,stattype);&lt;/div&gt;&lt;div&gt;GATHER_SCHEMA_STATS&lt;/div&gt;&lt;div&gt;    (ownname,estimate_percent,block_sample,method_opt,degree,granularity,cascade,&lt;/div&gt;&lt;div&gt;     stattab,statid,options,statown,no_invalidate,gather_temp,gather_fixed);&lt;/div&gt;&lt;div&gt;GENERATE_STATS&lt;/div&gt;&lt;div&gt;    (ownname,objname,organized);&lt;/div&gt;&lt;div&gt;GATHER_SYSTEM_STATS &lt;/div&gt;&lt;div&gt;    (gathering_mode,interval,stattab,statid,statown);&lt;/div&gt;&lt;div&gt;GATHER_TABLE_STATS&lt;/div&gt;&lt;div&gt;    (ownname,tabname,partname,estimate_percent,block_sample,method_opt,&lt;/div&gt;&lt;div&gt;     degree,granularity,cascade,stattab,statid,statown,no_invalidate,stattype);&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-family:&#39;times new roman&#39;;&quot;&gt;&lt;pre&gt;partname         VARCHAR2 DEFAULT NULL,    estimate_percent NUMBER   DEFAULT NULL,     block_sample     BOOLEAN  DEFAULT FALSE,    method_opt       VARCHAR2 DEFAULT &#39;FOR ALL COLUMNS SIZE 1&#39;,    degree           NUMBER   DEFAULT NULL,    granularity      VARCHAR2 DEFAULT &#39;DEFAULT&#39;,     cascade          BOOLEAN  DEFAULT FALSE,    stattab          VARCHAR2 DEFAULT NULL,     statid           VARCHAR2 DEFAULT NULL,    statown          VARCHAR2 DEFAULT NULL,    no_invalidate    BOOLEAN  DEFAULT FALSE&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;PREPARE_COLUMN_VALUES&lt;/div&gt;&lt;div&gt;    (srec,values);&lt;/div&gt;&lt;div&gt;SET_COLUMN_STATS &lt;/div&gt;&lt;div&gt;SET_INDEX_STATS &lt;/div&gt;&lt;div&gt;SET_SYSTEM_STATS &lt;/div&gt;&lt;div&gt;SET_TABLE_STATS &lt;/div&gt;&lt;div&gt;CONVERT_RAW_VALUE &lt;/div&gt;&lt;div&gt;GET_COLUMN_STATS &lt;/div&gt;&lt;div&gt;GET_INDEX_STATS &lt;/div&gt;&lt;div&gt;GET_SYSTEM_STATS &lt;/div&gt;&lt;div&gt;GET_TABLE_STATS &lt;/div&gt;&lt;div&gt;DELETE_COLUMN_STATS&lt;/div&gt;&lt;div&gt;    (ownname,tabname,colname,partname,stattab,statid,&lt;/div&gt;&lt;div&gt;     cascade_parts,statown,no_invalidate,force);&lt;/div&gt;&lt;div&gt;DELETE_DATABASE_STATS&lt;/div&gt;&lt;div&gt;    (stattab,statid,statown,no_invalidate,stattype,force);&lt;/div&gt;&lt;div&gt;DELETE_INDEX_STATS&lt;/div&gt;&lt;div&gt;    (ownname,indname,partname,stattab,statid,cascade_parts,statown            &lt;/div&gt;&lt;div&gt;     no_invalidate,stattype,force);&lt;/div&gt;&lt;div&gt;DELETE_SCHEMA_STATS&lt;/div&gt;&lt;div&gt;    (ownname,stattab,statid,statown,no_invalidate&lt;/div&gt;&lt;div&gt;     stattype,force);&lt;/div&gt;&lt;div&gt;DELETE_SYSTEM_STATS&lt;/div&gt;&lt;div&gt;    (stattab,statid,statown); &lt;/div&gt;&lt;div&gt;DELETE_TABLE_STATS &lt;/div&gt;&lt;div&gt;    (ownname,tabname,partname,stattab,statid,cascade_parts,cascade_columns,    &lt;/div&gt;&lt;div&gt;     cascade_indexes,statown,no_invalidate,stattype,force);&lt;/div&gt;&lt;div&gt;CREATE_STAT_TABLE &lt;/div&gt;&lt;div&gt;DROP_STAT_TABLE &lt;/div&gt;&lt;div&gt;EXPORT_COLUMN_STATS &lt;/div&gt;&lt;div&gt;EXPORT_INDEX_STATS &lt;/div&gt;&lt;div&gt;EXPORT_SYSTEM_STATS &lt;/div&gt;&lt;div&gt;EXPORT_TABLE_STATS &lt;/div&gt;&lt;div&gt;EXPORT_SCHEMA_STATS &lt;/div&gt;&lt;div&gt;EXPORT_DATABASE_STATS &lt;/div&gt;&lt;div&gt;IMPORT_COLUMN_STATS &lt;/div&gt;&lt;div&gt;IMPORT_INDEX_STATS &lt;/div&gt;&lt;div&gt;IMPORT_SYSTEM_STATS &lt;/div&gt;&lt;div&gt;IMPORT_TABLE_STATS &lt;/div&gt;&lt;div&gt;IMPORT_SCHEMA_STATS &lt;/div&gt;&lt;div&gt;IMPORT_DATABASE_STATS &lt;/div&gt;&lt;div&gt;FLUSH_SCHEMA_MONITORING_INFO &lt;/div&gt;&lt;div&gt;FLUSH_DATABASE_MONITORING_INFO &lt;/div&gt;&lt;div&gt;ALTER_SCHEMA_TABLE_MONITORING &lt;/div&gt;&lt;div&gt;ALTER_DATABASE_TABLE_MONITORING&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:&#39;courier new&#39;;font-size:13px;&quot;&gt;EXEC DBMS_STATS.gather_schema_stats(&#39;SCOTT&#39;,DBMS_STATS.AUTO_SAMPLE_SIZE);&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot; ;font-family:&#39;courier new&#39;;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot; ;font-family:&#39;courier new&#39;;font-size:13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:&#39;times new roman&#39;;font-size:16px;&quot;&gt;&lt;pre style=&quot;font-family: &#39;courier new&#39;, &#39;Andale Mono&#39;, courier, monospace; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;EXEC DBMS_STATS.gather_schema_stats (ownname =&gt; &#39;SCOTT&#39;, cascade =&gt;true,estimate_percent =&gt; dbms_stats.auto_sample_size);&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;  &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;EXEC DBMS_STATS.delete_schema_stats(&#39;SCOTT&#39;);&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot; ;font-family:&#39;courier new&#39;;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot; ;font-family:&#39;courier new&#39;;font-size:13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/6156908246586100530/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/6156908246586100530' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/6156908246586100530'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/6156908246586100530'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/04/dbmsstats.html' title='DBMS_STATS'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-5499327638390534280</id><published>2009-03-31T09:27:00.000-07:00</published><updated>2009-06-04T08:15:59.445-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Tuning"/><title type='text'>CODE OPTIMISATION TIPS</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;   style=&quot;border-collapse: collapse;   font-family:arial;font-size:13px;&quot;&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;. Avoid using functions on indexed columns&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;Example:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt; where to_char(emp_no) = ‘121212’&lt;br /&gt;The index on emp_no will be suppressed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;Solutions: where emp_no = to_number(’121212’)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;.Comparison of wrong data types, suppresses the index internally&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;where char_data = 123&lt;br /&gt;The index on char_data will be suppressed as oracle re-writes the query.&lt;br /&gt;Solution:&lt;br /&gt;Avoid such errors&lt;br /&gt;where char_data = to_char(123)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;.Oracle does not make use of an index on a column if &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;NOT IN&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt; is present.&lt;br /&gt;Example: &lt;br /&gt;select * from emp where deptno not in (select deptno from dept where deptstatus = ‘A’) &lt;br /&gt;Solution:&lt;br /&gt;Use &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;NOT EXISTS&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt; instead of &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;NOT IN&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;&lt;br /&gt;Example: select * from emp where not exists (select ‘X’ from dept where deptstatus = ‘A’ and dept. deptno = emp. deptno).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;4&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;.the index on brand will not be used.&lt;br /&gt;Example: &lt;br /&gt;select brand, sum(price) from products group by brand having brand = ‘Arrow’; &lt;br /&gt;Solution:&lt;br /&gt;Replace &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;HAVING&lt;/span&gt; with &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;a WHERE&lt;/span&gt; clause where ever possible.&lt;br /&gt;Example: &lt;br /&gt;select brand, sum(price) from products where brand = ‘Arrow’ group by brand;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;5&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;.Use of &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;nested statements&lt;/span&gt; slows down the query execution&lt;br /&gt;Example: &lt;br /&gt;select count(*) from products where itemcode in (Select itemcode from clothing where material = ‘Cotton’);&lt;br /&gt;Solution:&lt;br /&gt;Avoid nested selects.&lt;br /&gt;Example:&lt;br /&gt;select count(*) from products P, clothing C &lt;br /&gt;where P.barcode = C.barcode and C.material = ‘Cotton’;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;6&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;.Use of &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;NVL(&lt;/span&gt;) suppresses index usage.&lt;br /&gt;Example: &lt;br /&gt;where NVL(this_value, 99) = other_value &lt;br /&gt;Try to re-write NVLs.&lt;br /&gt;Example:&lt;br /&gt;where (this_value is null and other_value = 99) OR &lt;br /&gt;(this_value is not null and this_value = other_value)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;7&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;.Composite Indexes are not used if the leading indexed column is not present in the WHERE clause.&lt;br /&gt;Example: select count(*) from products where price &lt;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt;Solution: The leading column of the index must be present in the WHERE clause in order to hit the index. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-size:small;&quot;&gt; select count(*) from products where brand &gt; ‘0’   and price &lt;&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/5499327638390534280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/5499327638390534280' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5499327638390534280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5499327638390534280'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/03/code-optimisation-tips.html' title='CODE OPTIMISATION TIPS'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-5705546537656720693</id><published>2009-03-29T15:25:00.000-07:00</published><updated>2009-06-04T07:26:45.681-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Patching"/><title type='text'>rdbms patch</title><content type='html'>&lt;div&gt;Check which rdbms patches are applied in uor database -&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;/usr/bin/perl $ORACLE_HOME/OPatch/opatch lsinventory -invPtrLoc &lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;$ORACLE_HOME/oraInst.loc&lt;br /&gt;$ /home/orart02 &lt;/div&gt;&lt;br /&gt;&lt;div&gt;$ opatch versionInvoking OPatch 10.2.0.3.0&lt;br /&gt;OPatch Version: 10.2.0.3.0&lt;br /&gt;OPatch succeeded.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;$ /home/orart02 &lt;/div&gt;&lt;br /&gt;&lt;div&gt;$ which opatch&lt;/div&gt;&lt;br /&gt;&lt;div&gt;/apps/rt02/oracle/product/10201/OPatch/opatch&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt; $ which perl&lt;/div&gt;&lt;br /&gt;&lt;div&gt;/usr/bin/perl&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;$ /home/orart02 $ /usr/bin/perl /apps/rt02/oracle/product/10201/OPatch/opatch lsinventory -invPtrLoc &lt;/div&gt;&lt;br /&gt;&lt;div&gt;$ORACLE_HOME/oraInst.loc&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/5705546537656720693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/5705546537656720693' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5705546537656720693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/5705546537656720693'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/03/rdbms-patch.html' title='rdbms patch'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-9218749280179632899</id><published>2009-03-29T14:51:00.000-07:00</published><updated>2009-06-04T07:27:10.865-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Fundamentals"/><title type='text'>Basic checks for a new Daatabase</title><content type='html'>When You will be given an &#39;USER NAME&#39; and &#39;PASSWORD&#39; of a new database and a new environment then the basic things you need to check are below,&lt;br /&gt;&lt;br /&gt;Goto $ORACLE_HOME/dbs and see the parameter file ,SPFILE&lt;br /&gt;&lt;br /&gt;uname -a&lt;br /&gt;&lt;br /&gt;$echo $oracle_HOME&lt;br /&gt;&lt;br /&gt;$.ps-efgrep pmon  --- to check databases&lt;br /&gt;&lt;br /&gt;$echo $SID  ---&lt;br /&gt;&lt;br /&gt;$echo $oracle_sid&lt;br /&gt;&lt;br /&gt;$ ps -efgrep pmon  ---It ll show u all the databases&lt;br /&gt;user02   319658        1   0   Feb 24      -  3:37 ora_pmon_sun&lt;br /&gt;user02   663636        1   0   Feb 28      -  3:52 ora_pmon_MOON&lt;br /&gt;user02  2265204  1224816   0 12:56:55  pts/0  0:00 grep pmon&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ grep env    *To see all the env variables&lt;br /&gt;&lt;br /&gt;$sqlplus &quot;/as sysdba&quot;&lt;br /&gt;&lt;br /&gt;SQL&gt; select name from v$database;&lt;br /&gt;NAME&lt;br /&gt;---------&lt;br /&gt;RT02&lt;br /&gt;&lt;br /&gt;SQL&gt; select status from v$instance;&lt;br /&gt;STATUS&lt;br /&gt;------------&lt;br /&gt;OPEN&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter control&lt;br /&gt;NAME       TYPE        VALUE&lt;br /&gt;control_file_record_keep_time        integer     7&lt;br /&gt;control_files                        string      /apps/user02/oracle/admin/cntr                                                 l_rt02.dbf, /apps/user02/oracle/admin/cnrtl_rt02.dbf,/apps/user02/oracle/admin/cntrl_rt03.dbf&lt;br /&gt;&lt;br /&gt;SQL&gt;show parameter dump;&lt;br /&gt;&lt;br /&gt;NAME                                           TYPE       VALUE&lt;br /&gt;background_core_dump            string       partial&lt;br /&gt;background_dump_dest            string       /apps/user02/oracle/admin/&lt;br /&gt;bdumpcore_dump_dest             string      /apps/user02/oracle/admin/&lt;br /&gt;cdumpmax_dump_file_size       string      UNLIMITED&lt;br /&gt;shadow_core_dump                    string      partial&lt;br /&gt;user_dump_dest                         string     /apps/user02/oracle/admin/udump&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$log;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from v$logfile&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter undo&lt;br /&gt;NAME                                    TYPE       VALUE &lt;br /&gt;undo_management               string      AUTO&lt;br /&gt;undo_retention                     integer     3600&lt;br /&gt;undo_tablespace                   string      undo_ts&lt;br /&gt;&lt;br /&gt;SQL&gt; select file_name,sum(bytes)/1024/1024 from dba_data_files where tablespace_name=&#39;UNDO_TS&#39; group by file_name;&lt;br /&gt;&lt;br /&gt;SQL&gt; col FILE_NAME for a60&lt;br /&gt;SQL&gt;set lines 200&lt;br /&gt;SQL&gt; /&lt;br /&gt;SQL&gt; select FILE_NAME, TABLESPACE_NAME,(bytes)/1024/1024  from dba_data_files;&lt;br /&gt;select tablespace_name,sum(bytes)/1024/1024 from dba_free_space where tablespace_name=&#39;SYSTEM&#39; group by tablespace_name;&lt;br /&gt;&lt;br /&gt;SQL&gt; select AUTOEXTENSIBLE,FILE_NAME,TABLESPACE_NAME from dba_data_files where tablespace_name=&#39;&amp;amp;TSNAME&#39;;&lt;br /&gt;Enter value for tsname: RETEK_DATA&lt;br /&gt;=========&lt;br /&gt;Examples -&lt;br /&gt;&lt;br /&gt;SQL&gt;ALTER TABLESPACE TEMP ADD TEMPFILE &#39;/apps/rt02/oradata/data03/temp01.dbf&#39; SIZE 8000M AUTOEXTEND OFF&lt;br /&gt;&lt;br /&gt;Added a new file -&lt;br /&gt;SQL&gt;ALTER TABLESPACE TEMP ADD TEMPFILE &#39;/apps/rt02/oradata/data03/temp02.dbf&#39; SIZE 8000M AUTOEXTEND OFF&lt;br /&gt;&lt;br /&gt;Reused a existing tempfile which had come from clone -&lt;br /&gt;SQL&gt;ALTER TABLESPACE TEMP ADD TEMPFILE &#39;/apps/rt02/oradata/data01/temp02.dbf&#39; SIZE 16000M REUSE AUTOEXTEND OFF</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/9218749280179632899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/9218749280179632899' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/9218749280179632899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/9218749280179632899'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/03/basic-checks-for-new-daatabase.html' title='Basic checks for a new Daatabase'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-3852251141461094300</id><published>2009-03-26T13:48:00.000-07:00</published><updated>2009-06-04T07:28:24.206-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Data Guard"/><title type='text'>Data guard Creation</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:&#39;Trebuchet MS&#39;;font-size:14px;&quot;&gt;&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 2px; color: rgb(85, 85, 85); background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(238, 238, 238); font: normal normal bold 110%/normal Verdana, sans-serif; background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color: rgb(0, 0, 0);  font-weight: normal; font-size:14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 2px; color: rgb(85, 85, 85); background-image: initial; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: rgb(238, 238, 238); font: normal normal bold 110%/normal Verdana, sans-serif; background-position: initial initial; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color: rgb(0, 0, 0);  font-weight: normal; font-size:14px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;1) Ensure the Primary database is in ARCHIVELOG mode:&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;post-body entry-content&quot; style=&quot;margin-top: 0px; margin-right: 6px; margin-bottom: 0px; margin-left: 5px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;SQL&gt; archive log list&lt;br /&gt;Database log mode No Archive Mode&lt;br /&gt;Automatic archival Disabled&lt;br /&gt;Archive destination /export/home/oracle/temp/oracle/arch&lt;br /&gt;Oldest online log sequence 7&lt;br /&gt;Current log sequence 9&lt;br /&gt;SQL&gt; alter database close; &lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database archivelog; &lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown immediate &lt;br /&gt;ORA-01109: database not open&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Database dismounted.&lt;br /&gt;ORACLE instance shut down.&lt;br /&gt;&lt;br /&gt;Modify the Primary database init.ora so that log_archive_start=true and restart &lt;br /&gt;the instance. Verify that database is in archive log mode and that automatic &lt;br /&gt;archiving is enabled.&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 /export/home/oracle/temp/oracle/arch&lt;br /&gt;Oldest online log sequence 7&lt;br /&gt;Next log sequence to archive 9&lt;br /&gt;Current log sequence 9&lt;br /&gt;&lt;br /&gt;2) Create a backup of the Primary database:&lt;br /&gt;&lt;br /&gt;You can use an existing backup of the Primary database as long as you have the &lt;br /&gt;archive logs that have been generated since that backup. You may also take a &lt;br /&gt;hot backup as long as you have all archive logs through the end of the backup &lt;br /&gt;of the last tablespace. To create a cold backup do the following: &lt;br /&gt;&lt;br /&gt;SQL&gt; &lt;br /&gt;SQL&gt; select name from v$datafile;&lt;br /&gt;&lt;br /&gt;NAME&lt;br /&gt;----------------------------------------------------------------------&lt;br /&gt;/export/home/oracle/temp/oracle/data/sys.dbf&lt;br /&gt;&lt;br /&gt;SQL&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; exit&lt;br /&gt;&lt;br /&gt;Create a backup of all datafiles and online redo logs using an OS command or &lt;br /&gt;utility. A backup of the online redo logs is necessary to facilitate switchover.&lt;br /&gt;&lt;br /&gt;Once complete startup the instance:&lt;br /&gt;&lt;br /&gt;SQL&gt; startup&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 80512156 bytes&lt;br /&gt;Fixed Size 279708 bytes&lt;br /&gt;Variable Size 71303168 bytes&lt;br /&gt;Database Buffers 8388608 bytes&lt;br /&gt;Redo Buffers 540672 bytes&lt;br /&gt;Database mounted.&lt;br /&gt;Database opened.&lt;br /&gt;&lt;br /&gt;3) Connect to the primary database and create the standby control file:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database create standby controlfile as &lt;br /&gt;&#39;/export/home/oracle/temp/oracle/data/backup/standby.ctl&#39;;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;4) Copy files to the Standby host:&lt;br /&gt;&lt;br /&gt;Copy the backup datafiles, standby controlfile, all available archived redo logs,&lt;br /&gt;and online redo logs from the primary site to the standby site. Copying of the&lt;br /&gt;online redo logs is necessary to facilitate switchover.&lt;br /&gt;&lt;br /&gt;If the standby is on a separate site with the same directory structure as the &lt;br /&gt;primary database then you can use the same path names for the standby files as &lt;br /&gt;the primary files. In this way, you do not have to rename the primary datafiles &lt;br /&gt;in the standby control file. If the standby is on the same site as the primary &lt;br /&gt;database, or the standby database is on a separate site with a different &lt;br /&gt;directory structure the you must rename the primary datafiles in the standby &lt;br /&gt;control file after copying them to the standby site. This can be done using &lt;br /&gt;the db_file_name_convert and log_file_name_convert parameters or by manually &lt;br /&gt;using the alert database statements.&lt;br /&gt;&lt;br /&gt;5) Set the initialization parameters for the primary database:&lt;br /&gt;&lt;br /&gt;It is suggested that you maintain two init.ora’s on both the primary and the &lt;br /&gt;standby. This allows you to facilitate role reversal during switchover &lt;br /&gt;operations more easily. &lt;br /&gt;&lt;br /&gt;Primary init.ora on Primary host:&lt;br /&gt;&lt;br /&gt;log_archive_dest_1=&#39;LOCATION=/export/home/oracle/temp/oracle/arch&#39;&lt;br /&gt;log_archive_dest_2=&#39;SERVICE=DGD01_hasunclu2 reopen=60&#39;&lt;br /&gt;log_archive_dest_state_1=enable&lt;br /&gt;log_archive_dest_state_2=enable&lt;br /&gt;log_archive_format=%t_%s.dbf&lt;br /&gt;log_archive_start=true&lt;br /&gt;remote_archive_enable=true&lt;br /&gt;&lt;br /&gt;Create the standby initialization parameter file and set the initialization &lt;br /&gt;parameters for the standby database. Depending on your configuration, you may &lt;br /&gt;need to set filename conversion parameters.&lt;br /&gt;&lt;br /&gt;Standby init.ora on Primary host:&lt;br /&gt;&lt;br /&gt;log_archive_dest_1=&#39;LOCATION=/export/home/oracle/temp/oracle/arch&#39;&lt;br /&gt;log_archive_dest_state_1=enable&lt;br /&gt;log_archive_format=%t_%s.dbf&lt;br /&gt;log_archive_start=true&lt;br /&gt;standby_archive_dest=/export/home/oracle/temp/oracle/arch&lt;br /&gt;standby_file_management=auto&lt;br /&gt;fal_server=DGD01_hasunclu2&lt;br /&gt;fal_client=DGD01_hasunclu1&lt;br /&gt;remote_arhive_enable=true&lt;br /&gt;&lt;br /&gt;NOTE: In the above example db_file_name_convert and log_file_name_convert are &lt;br /&gt;not needed as the directory structure on the two hosts are the same. If the &lt;br /&gt;directory structure is not the same then setting of these parameters is &lt;br /&gt;recommended. Please reference notes 47325.1 and 47343.1 for further &lt;br /&gt;information.&lt;br /&gt;&lt;br /&gt;Copy the two init.ora’s from the Primary host to the Standby host. You must &lt;br /&gt;modify the Primary init.ora on the Standby host to have log_archive_dest_2 use &lt;br /&gt;the alias that points to the Primary host (ie DGD01_hasunclu1). You must &lt;br /&gt;modify the Standby init.ora on the standby host to have fal_server and &lt;br /&gt;fal_client use the aliases when standby is running on the Primary host &lt;br /&gt;(ie fal_server=DGD01_hasunclu1 and fal_client=DGD01_hasunclu2).&lt;br /&gt;&lt;br /&gt;6) Configure networking components:&lt;br /&gt;&lt;br /&gt;On the Primary host create a net service name that the Primary database can &lt;br /&gt;use to connect to the Standby database. On the Primary host create a net &lt;br /&gt;service name that Standby, when running on the Primary host, can use to &lt;br /&gt;connect to the Primary, when it is running on the Standby host. Example from &lt;br /&gt;Primary’s host tnsnames.ora:&lt;br /&gt;&lt;br /&gt;DGD01_hasunclu1 =&lt;br /&gt;(DESCRIPTION =&lt;br /&gt;(ADDRESS_LIST =&lt;br /&gt;(ADDRESS = (PROTOCOL = TCP)(HOST = hasunclu1)(PORT = 1521))&lt;br /&gt;)&lt;br /&gt;(CONNECT_DATA =&lt;br /&gt;(SID = DGD01)&lt;br /&gt;(SERVER = DEDICATED)&lt;br /&gt;)&lt;br /&gt;)&lt;br /&gt;DGD01_hasunclu2 =&lt;br /&gt;(DESCRIPTION =&lt;br /&gt;(ADDRESS_LIST =&lt;br /&gt;(ADDRESS = (PROTOCOL = TCP)(HOST = hasunclu2)(PORT = 1521))&lt;br /&gt;)&lt;br /&gt;(CONNECT_DATA =&lt;br /&gt;(SID = DGD01)&lt;br /&gt;(SERVER = DEDICATED)&lt;br /&gt;)&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;The above two net service names must exist in the Standby hosts tnsnames.ora &lt;br /&gt;also.&lt;br /&gt;&lt;br /&gt;You must also configure a listener on the standby database. If you plan to &lt;br /&gt;manage this standby database using the Data Guard broker, you must configure &lt;br /&gt;the listener to use the TCP/IP protocol and statically register the standby &lt;br /&gt;database service using its SID.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7) Start the standby instance and mount the standby database.&lt;br /&gt;&lt;br /&gt;oracle@hasunclu2:/export/home/oracle/temp/oracle&gt; sqlplus &quot;/ as sysdba&quot; &lt;br /&gt;&lt;br /&gt;SQL*Plus: Release 9.0.1.0.0 - Production on Thu Mar 14 18:00:57 2002&lt;br /&gt;&lt;br /&gt;(c) Copyright 2001 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=?/dbs/initDGD.ora&lt;br /&gt;ORACLE instance started.&lt;br /&gt;&lt;br /&gt;Total System Global Area 80512156 bytes&lt;br /&gt;Fixed Size 279708 bytes&lt;br /&gt;Variable Size 71303168 bytes&lt;br /&gt;Database Buffers 8388608 bytes&lt;br /&gt;Redo Buffers 540672 bytes&lt;br /&gt;SQL&gt; alter database mount standby database;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;8) Create standby redo log files, if necessary:&lt;br /&gt;&lt;br /&gt;Standby redo logs are necessary for the higher protection levels such as &lt;br /&gt;Guaranteed, Instant, and Rapid. In these protection modes LGWR from the &lt;br /&gt;Primary host writes transactions directly to the standby redo logs. &lt;br /&gt;This enables no data loss solutions and reduces the amount of data loss &lt;br /&gt;in the event of failure. Standby redo logs are not necessary if you are using &lt;br /&gt;the delayed protection mode. &lt;br /&gt;&lt;br /&gt;If you configure standby redo on the standby then you should also configure &lt;br /&gt;standby redo logs on the primary database. Even though the standby redo logs&lt;br /&gt;are not used when the database is running in the primary role, configuring &lt;br /&gt;the standby redo logs on the primary database is recommended in preparation &lt;br /&gt;for an eventual switchover operation. &lt;br /&gt;&lt;br /&gt;Standby redo logs must be archived before the data can be applied to the &lt;br /&gt;standby database. The standby archival operation occurs automatically, even if &lt;br /&gt;the standby database is not in ARCHIVELOG mode. However, the archiver process &lt;br /&gt;must be started on the standby database. Note that the use of the archiver &lt;br /&gt;process (ARCn) is a requirement for selection of a standby redo log.&lt;br /&gt;&lt;br /&gt;You must have the same number of standby redo logs on the standby as you have &lt;br /&gt;online redo logs on production. They must also be exactly the same size.&lt;br /&gt;&lt;br /&gt;The following syntax is used to create standby redo logs:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add standby logfile&lt;br /&gt;2 &#39;/export/home/oracle/temp/oracle/data/srl_1.dbf&#39; size 20m;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;SQL&gt; alter database add standby logfile&lt;br /&gt;2 &#39;/export/home/oracle/temp/oracle/data/srl_2.dbf&#39; size 20m;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database add standby logfile&lt;br /&gt;2 &#39;/export/home/oracle/temp/oracle/data/srl_3.dbf&#39; size 20m;&lt;br /&gt;&lt;br /&gt;Database altered.&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;9) Manually change the names of the primary datafiles and redo logs in the &lt;br /&gt;standby control file for all files not automatically renamed using &lt;br /&gt;DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT as noted in step 5. Datafile &lt;br /&gt;names can be changed on the standby at a mounted state with the following &lt;br /&gt;syntax:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter database rename file&lt;br /&gt;2 &#39;/export/home/oracle/temp/oracle/data/sys.dbf&#39;&lt;br /&gt;3 to&lt;br /&gt;4 &#39;/export/home/oracle/temp/oracle/data2/sys.dbf&#39;;&lt;br /&gt;&lt;br /&gt;10) Stop and restart the listeners:&lt;br /&gt;&lt;br /&gt;On the primary database, and start the listener on the standby database so that &lt;br /&gt;changes made to the listener.ora can be implemented.&lt;br /&gt;&lt;br /&gt;11) Activate parameter changes:&lt;br /&gt;&lt;br /&gt;Manually enable initialization parameter changes on the primary database &lt;br /&gt;so that it can initiate archiving to the standby site.&lt;br /&gt;&lt;br /&gt;At runtime, the LOG_ARCHIVE_DEST_n initialization parameter can be changed &lt;br /&gt;using ALTER SYSTEM and ALTER SESSION statements. Activate the changes made to &lt;br /&gt;these parameters by either bouncing the instance or activating via alter system. &lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;SQL&gt; alter system set log_archive_dest_2=&#39;SERVICE=DGD01_hasunclu2 reopen=60&#39;;&lt;br /&gt;&lt;br /&gt;System altered.&lt;br /&gt;&lt;br /&gt;12) Verify that automatic archiving is occurring:&lt;br /&gt;&lt;br /&gt;On the Primary database switch a log and verfy that it has been shipped &lt;br /&gt;properly using the v$archive_dest view.&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; select status, error from v$archive_dest where dest_id=2;&lt;br /&gt;&lt;br /&gt;STATUS ERROR&lt;br /&gt;--------- -------------------------------------------------------&lt;br /&gt;VALID&lt;br /&gt;&lt;br /&gt;SQL&gt;&lt;br /&gt;&lt;br /&gt;13) Optionally place Standby database in managed recovery:&lt;br /&gt;&lt;br /&gt;SQL&gt; recover managed standby database disconnect;&lt;br /&gt;Media recovery complete.&lt;br /&gt;SQL&gt; exit&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot; style=&quot;margin-top: 0px; margin-right: 6px; margin-bottom: 0px; margin-left: 5px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot; style=&quot;margin-top: 0px; margin-right: 6px; margin-bottom: 0px; margin-left: 5px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: arial;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial; font-size: 13px; white-space: pre; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; &quot;&gt;reference metalink document id Note:180031.1&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;post-body entry-content&quot; style=&quot;margin-top: 0px; margin-right: 6px; margin-bottom: 0px; margin-left: 5px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:arial;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/3852251141461094300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/3852251141461094300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/3852251141461094300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/3852251141461094300'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/03/data-guard-creation.html' title='Data guard Creation'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-425388954072849616</id><published>2009-03-25T15:47:00.000-07:00</published><updated>2009-06-04T07:28:50.387-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="default Users"/><title type='text'>Default USERS</title><content type='html'>&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;SYS&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The SYS user owns all base tables and user-accessable view of the data dictionary (Oracle configuration information). No Oracle user should ever alter (update, delete, or insert) any rows or schema objects conatained in the SYS schema, because such activity can compromise data integrety. The security administrator must keep strict control of this central account.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;SYSTEM&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The SYSTEM user is used to create additional tables and views that display administrative information, and internal tables and views used by various Oracle options and tools.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;SYSMAN&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The SYSMAN user represents the Enterprise Manager super admin account. This EM admin can create and modify other EM admin accounts as well as admin the database instance itself.&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;DBSNMP&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The DBSNMP user is used by EM to monitor the database. EM uses this account to access performance stats about the database. The DBSNMP credentials sometimes referred to as the monitoring credentials.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/425388954072849616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/425388954072849616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/425388954072849616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/425388954072849616'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/03/default-users.html' title='Default USERS'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-1929149022852005457</id><published>2009-03-25T15:44:00.000-07:00</published><updated>2009-06-04T07:29:19.317-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="redo log file resize"/><title type='text'>REDO LOG File Resize</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;   style=&quot;border-collapse: collapse;   font-family:arial;font-size:13px;&quot;&gt;&lt;p&gt;You can&#39;t resize logfile, you have to create new ones and drop the old ones.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;before you begin ensure your database is not experiencing heavy traffic or do it at the time of least traffic probably at night [with peace at your alongside].&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;1&lt;/span&gt;.have a look at your current log groups/members:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;SELECT a.group#, a.member, b.bytes FROM v$logfile a, v$log b WHERE a.group# = b.group#;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;2.&lt;/span&gt;Make your last redolog group as current [very important] by using manual log switch until you get desired result.&lt;/p&gt;&lt;p&gt;alter system switch logfile;&lt;/p&gt;&lt;p&gt;select group#, status from v$log;&lt;/p&gt;&lt;p&gt;GROUP# STATUS&lt;br /&gt;---------- ----------------&lt;br /&gt;1 INACTIVE&lt;br /&gt;2 INACTIVE&lt;br /&gt;3 INACTIVE&lt;br /&gt;4 CURRENT&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;3 &lt;/span&gt;.After making the last group as current start dropping the groups one by one beginning from group number 1. Do it for all except the last group which has been recently made current.If you get any recovery related&lt;/p&gt;&lt;p&gt;312/624 error than carry out a fresh manual checkpoint and proceed again to drop the group.&lt;/p&gt;&lt;p&gt;alter database drop logfile group 1;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;4&lt;/span&gt;.Recreate your new loggroups with desired sizes &amp;amp; locations. Ensure you do not create any thing below minimum size [10g : minimum 4Mb, default 50Mb, OMF 100MB]. Ensure a correct log size as it may impact&lt;/p&gt;&lt;p&gt;your database performance. Create number of groups as desired&lt;/p&gt;&lt;p&gt;alter database add logfile group 1 (&lt;br /&gt;&#39;path/member1.log&#39;, &lt;br /&gt;&#39;path/member2.log&#39;) size 500M reuse;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt;5.&lt;/span&gt;Carry out a manual log switch. See that newly created group becomes current. Carry out manual checkpoint &amp;amp; log switch until your last old log(the only one left) becomes inactive than drop it.Veryfy new logs. If you&lt;/p&gt;&lt;p&gt;are using RMAN than rman may search for dropped logfiles during your next backup.&lt;/p&gt;&lt;p&gt;&lt;br /&gt; &lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold;&quot;&gt; do i need to restart my database after these operations. ???&lt;/span&gt;&lt;/p&gt;&lt;p&gt; No need to restart the Database&lt;/p&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/1929149022852005457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/1929149022852005457' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/1929149022852005457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/1929149022852005457'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2009/03/redo-log-file-resize.html' title='REDO LOG File Resize'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-7259516794804174775</id><published>2008-10-27T10:42:00.000-07:00</published><updated>2009-06-04T07:29:37.166-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="backup"/><title type='text'>Hot Backup in Oracle</title><content type='html'>When datafiles are put into hot backup mode,  Oracle is &lt;strong&gt;still writing to&lt;/strong&gt; them&lt;br /&gt;Oracle slightly changes the way it performs updates to &lt;strong&gt;datafiles by copying whole datafile blocks&lt;/strong&gt;, rather changed bytes , into the online redo logs.&lt;br /&gt;Hot backups, by their very nature,take a corrupt copy of the datafiles.Since the instance is in ARCHIVELOG mode, all changes to the datafiles are available upon restore to correct any discrepancies created as the archiving process passes over any given datafile. This is why Oracle records redo information in whole blocks during hot backup: to help recover any inconsistent blocks in the datafiles upon restore.&lt;br /&gt;And also during Hot backup mode &lt;strong&gt;oracle doesnt update the SCN&lt;/strong&gt; in the header of the Datafile.&lt;br /&gt;Online redo log files should never be backed up in hot backup mode.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;STEPS:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;1)Get listing of tablespaces and datafiles&lt;br /&gt;(SELECT tablespace_name, file_name FROM sys.dba_data_files).&lt;br /&gt;&lt;br /&gt;2. For each tablespacea) Put tablespace in hot backup mode&lt;br /&gt;(ALTER TABLESPACE $TABLESPACENAME BEGIN BACKUP).&lt;br /&gt;b) Copy, archive, or snapshot each datafile in this tablespace.&lt;br /&gt;c) End hot backup mode for this tablespace &lt;br /&gt;(ALTER TABLESPACE $TABLESPACENAME END BACKUP).&lt;br /&gt;&lt;br /&gt;3. Backup the Oracle “controlfile”&lt;br /&gt;(ALTER DATABASE BACKUP CONTROLFILE to trace)&lt;br /&gt;&lt;br /&gt;4. Confirm all tablespaces returned to normal mode  (SELECT FILE#,STATUS,CHANGE#,TIME FROM v$backup WHERE STATUS != &#39;NOT ACTIVE&#39;).&lt;br /&gt;&lt;br /&gt;5.ALter System switch logfile ( it ll force the checkpoint which ll update SCN in the datafiles header)&lt;br /&gt;&lt;br /&gt;6. Perform an archive log switch   (ALTER SYSTEM ARCHIVE LOG CURRENT).&lt;br /&gt;7. Backup archived redo logs.</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/7259516794804174775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/7259516794804174775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7259516794804174775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/7259516794804174775'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2008/10/hot-backup-in-oracle.html' title='Hot Backup in Oracle'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-3946577396250021434</id><published>2008-10-22T13:11:00.000-07:00</published><updated>2009-06-04T07:29:54.005-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="create database"/><title type='text'>Create Database in oracle</title><content type='html'>After you have install the binaries using Oracle Universal Installer you need to create the database. And you can do that in two ways:&lt;br /&gt;Using the Database Configuration Assistant (DBCA)&lt;br /&gt;With the SQL “create database”  statement&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Using “DBCA” :&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The Database Configuration Assistant (DBCA) an Oracle supplied tool that enables you to create an Oracle database, configure database options for an existing Oracle database, delete an Oracle database, or manage database templates.&lt;br /&gt;command prompt ( start-&gt;run-&gt;cmd-&gt;dbca).&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;Using SQL “create database” statement:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1:&lt;/strong&gt; Decide on Your Instance Identifier (SID)&lt;br /&gt;There can be more than one Oracle instance on a single machine. In order to be able to distinguish these instances, Oracle uses a SID (System Identifier) which is a string.&lt;br /&gt;The SID can be set through the ORACLE_SID environment&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&gt;set ORACLE_SID = OraProdEurope&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 2:&lt;/strong&gt; Establish the Database Administrator Authentication Method&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Step 3:&lt;/strong&gt; Create the initialization parameter file&lt;br /&gt;When an Oracle instance starts up, it requires either an initialization paramter file (init.ora) or an SPFILE. SPFILES have binary content and must be created from init.ora files. Therefore, the init.ora file (which is an ordinary text file) is created first.&lt;br /&gt;Create the init.ora file and put it in below path.&lt;br /&gt;Unix Path is:  $ORACLE_HOME/dbs&lt;br /&gt;Windows path is: %ORACLE_HOME%\database&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 4:&lt;/strong&gt; Connect to the Instance&lt;br /&gt;&lt;a name=&quot;1003964&quot;&gt;&lt;/a&gt;$ SQLPLUS /nolog&lt;br /&gt;&lt;a name=&quot;1003965&quot;&gt;&lt;/a&gt;SQL&gt;CONNECT SYS/password AS SYSDBA&lt;br /&gt;           Connected to an idle instance.&lt;br /&gt;&lt;br /&gt;SQL*Plus tells us that we&#39;re connected to an idle instance. That means that it is not yet started. So, let&#39;s start the instance. We have to start the instance without mounting (nomount) as there is no database we could mount at the moment.&lt;br /&gt;&lt;br /&gt;&lt;a name=&quot;1018296&quot;&gt;&lt;/a&gt;&lt;strong&gt;Step 5:&lt;/strong&gt; Start the Instance.&lt;br /&gt;&lt;a name=&quot;1003988&quot;&gt;&lt;/a&gt;SQL&gt; STARTUP NOMOUNT&lt;br /&gt;&lt;br /&gt;This created the SGA (System Global Area) and the background processes&lt;br /&gt;&lt;a name=&quot;1003989&quot;&gt;&lt;/a&gt;&lt;a name=&quot;1018301&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;Step 6:&lt;/strong&gt; Issue the CREATE DATABASE Statement&lt;br /&gt;&lt;a name=&quot;1018398&quot;&gt;&lt;/a&gt;CREATE DATABASE mynewdb&lt;br /&gt;&lt;a name=&quot;1022355&quot;&gt;&lt;/a&gt;   USER SYS IDENTIFIED BY pz6r58&lt;br /&gt;&lt;a name=&quot;1022356&quot;&gt;&lt;/a&gt;   USER SYSTEM IDENTIFIED BY y1tz5p&lt;br /&gt;&lt;a name=&quot;1022368&quot;&gt;&lt;/a&gt;   LOGFILE GROUP 1 (&#39;/oracle/oradata/mynewdb/redo01.log&#39;) SIZE 100M,&lt;br /&gt;&lt;a name=&quot;1022369&quot;&gt;&lt;/a&gt;           GROUP 2 (&#39;/oracle/oradata/mynewdb/redo02.log&#39;) SIZE 100M,&lt;br /&gt;&lt;a name=&quot;1018399&quot;&gt;&lt;/a&gt;           GROUP 3 (&#39;/oracle/oradata/mynewdb/redo03.log&#39;) SIZE 100M&lt;br /&gt;&lt;a name=&quot;1022377&quot;&gt;&lt;/a&gt;   MAXLOGFILES 5&lt;br /&gt;&lt;a name=&quot;1022391&quot;&gt;&lt;/a&gt;   MAXLOGMEMBERS 5&lt;br /&gt;&lt;a name=&quot;1022383&quot;&gt;&lt;/a&gt;   MAXLOGHISTORY 1&lt;br /&gt;&lt;a name=&quot;1022399&quot;&gt;&lt;/a&gt;   MAXDATAFILES 100&lt;br /&gt;&lt;a name=&quot;1022373&quot;&gt;&lt;/a&gt;   MAXINSTANCES 1&lt;br /&gt;&lt;a name=&quot;1022408&quot;&gt;&lt;/a&gt;   CHARACTER SET US7ASCII&lt;br /&gt;&lt;a name=&quot;1022409&quot;&gt;&lt;/a&gt;   NATIONAL CHARACTER SET AL16UTF16&lt;br /&gt;&lt;a name=&quot;1018400&quot;&gt;&lt;/a&gt;   DATAFILE &#39;/oracle/oradata/mynewdb/system01.dbf&#39; SIZE 325M REUSE&lt;br /&gt;&lt;a name=&quot;1024394&quot;&gt;&lt;/a&gt;   EXTENT MANAGEMENT LOCAL&lt;br /&gt;&lt;a name=&quot;1022418&quot;&gt;&lt;/a&gt;   DEFAULT TEMPORARY TABLESPACE tempts1&lt;br /&gt;&lt;a name=&quot;1024401&quot;&gt;&lt;/a&gt;      DATAFILE &#39;/oracle/oradata/mynewdb/temp01.dbf&#39;&lt;br /&gt;&lt;a name=&quot;1024411&quot;&gt;&lt;/a&gt;      SIZE 20M REUSE&lt;br /&gt;&lt;a name=&quot;1018406&quot;&gt;&lt;/a&gt;   UNDO TABLESPACE undotbs&lt;br /&gt;&lt;a name=&quot;1024410&quot;&gt;&lt;/a&gt;      DATAFILE &#39;/oracle/oradata/mynewdb/undotbs01.dbf&#39;&lt;br /&gt;&lt;a name=&quot;1018407&quot;&gt;&lt;/a&gt;      SIZE 200M REUSE AUTOEXTEND ON NEXT 5120K MAXSIZE UNLIMITED;&lt;br /&gt;&lt;br /&gt;If something goes wrong with the creation, Oracle will write an error into the alert.log. The alert log is normaly found in the directory that is specified with the background_dump_dest. If this parameter was not specified (as is the case in our minimal init.ora), the alert.log will be written into %ORACLE_HOME%/RDMBS/trace.&lt;br /&gt;If an ORA-01031: insufficient privileges is returned, that means most likely, that the current user is not in the dba group (on unix), or the ORA_DBA (windows).&lt;br /&gt;If the init.ora file is not at its default location or has not been found with the pfile attribute, an ORA-01078: failure in processing system parameters and an LRM-00109: could not open parameter file &#39;/appl/oracle/product/9.2.0.2/dbs/initadpdb.ora&#39; error is issued.&lt;br /&gt;The create database command also executes a file whose name is determined by the (hidden) init parameter _init_sql_file (which seems to default to sql.bsq)&lt;br /&gt;After the creation of the database, it can be mounted and opened for use.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 7:&lt;/strong&gt; Create Additional Tablespaces&lt;br /&gt;&lt;br /&gt;CONNECT SYS/password AS SYSDBA&lt;br /&gt;&lt;a name=&quot;1020635&quot;&gt;&lt;/a&gt;-- create a user tablespace to be assigned as the default tablespace for users&lt;br /&gt;&lt;a name=&quot;1020612&quot;&gt;&lt;/a&gt;CREATE TABLESPACE users LOGGING&lt;br /&gt;&lt;a name=&quot;1020640&quot;&gt;&lt;/a&gt;     DATAFILE &#39;/oracle/oradata/mynewdb/users01.dbf&#39;&lt;br /&gt;&lt;a name=&quot;1020639&quot;&gt;&lt;/a&gt;     SIZE 25M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED&lt;br /&gt;&lt;a name=&quot;1020645&quot;&gt;&lt;/a&gt;     EXTENT MANAGEMENT LOCAL;&lt;br /&gt;&lt;a name=&quot;1020638&quot;&gt;&lt;/a&gt;-- create a tablespace for indexes, separate from user tablespace&lt;br /&gt;&lt;a name=&quot;1020620&quot;&gt;&lt;/a&gt;CREATE TABLESPACE indx LOGGING&lt;br /&gt;&lt;a name=&quot;1020642&quot;&gt;&lt;/a&gt;     DATAFILE &#39;/oracle/oradata/mynewdb/indx01.dbf&#39;&lt;br /&gt;&lt;a name=&quot;1020643&quot;&gt;&lt;/a&gt;     SIZE 25M REUSE AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED&lt;br /&gt;&lt;a name=&quot;1020644&quot;&gt;&lt;/a&gt;     EXTENT MANAGEMENT LOCAL;&lt;br /&gt;&lt;a name=&quot;1018553&quot;&gt;&lt;/a&gt;EXIT&lt;br /&gt;&lt;a name=&quot;1018327&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;Step 8:&lt;/strong&gt; Run Scripts to Build Data Dictionary Views&lt;br /&gt;CONNECT SYS/password AS SYSDBA&lt;br /&gt;(In order to complete the db creation, the following scripts must be run as sys )&lt;br /&gt;&lt;a name=&quot;1018696&quot;&gt;&lt;/a&gt;&lt;br /&gt;@/oracle/rdbms/admin/catalog.sql&lt;br /&gt;&lt;a name=&quot;1020747&quot;&gt;&lt;/a&gt;@/oracle/rdbms/admin/catproc.sql&lt;br /&gt;&lt;a name=&quot;1018712&quot;&gt;&lt;/a&gt;EXIT&lt;br /&gt;&lt;br /&gt;CATALOG.SQL&lt;br /&gt;&lt;a name=&quot;1020735&quot;&gt;&lt;/a&gt;Creates the views of the data dictionary tables, the dynamic performance views, and public synonyms for many of the views. Grants PUBLIC access to the synonyms.&lt;br /&gt;&lt;a name=&quot;1020684&quot;&gt;&lt;/a&gt;CATPROC.SQL&lt;br /&gt;&lt;a name=&quot;1020686&quot;&gt;&lt;/a&gt;Runs all scripts required for or used with PL/SQL.&lt;br /&gt;&lt;br /&gt;The user system might also want to run /sqlplus/admin/pupbld.sql.&lt;br /&gt;pupbld.sql creates a table that allows to block someone from using sql plus.</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/3946577396250021434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/3946577396250021434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/3946577396250021434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/3946577396250021434'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2008/10/create-database-in-oracle.html' title='Create Database in oracle'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6584799265926566340.post-4291419870280267796</id><published>2008-10-20T08:32:00.000-07:00</published><updated>2009-06-04T07:30:22.075-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="user profile"/><title type='text'>USER Profiles</title><content type='html'>&lt;strong&gt;&lt;span style=&quot;color:#cc0000;&quot;&gt;Profiles in Oracle&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Profiles are a means to limit resources a user can use.&lt;br /&gt;Before profiles can be assigned, they must be created with create profile. Then, they can be assigned to users with alter user ... profile.&lt;br /&gt;For Example:&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;CREATE PROFILE&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;SQL&gt; &lt;span style=&quot;font-size:85%;&quot;&gt;CREATE PROFILE developer&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt; LIMIT&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PASSWORD_LIFE_TIME 60&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PASSWORD_GRACE_TIME 10&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PASSWORD_REUSE_TIME 0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PASSWORD_REUSE_MAX 0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;FAILED_LOGIN_ATTEMPTS 4&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PASSWORD_LOCK_TIME 2&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;CPU_PER_CALL 3000&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;PRIVATE_SGA 500K&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;LOGICAL_READS_PER_CALL 1000;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;ALTER Profile:&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;SQL&gt;ALTER PROFILE developer LIMIT FAILED_LOGIN_ATTEMPTS 3;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;strong&gt;Drop Profile without user:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;SQL&gt; drp profile developer;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;Drop Profile with user:&lt;br /&gt;&lt;/strong&gt;SQL&gt; drp profile developer CASCADE;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Assigna profile to User:&lt;/strong&gt;&lt;br /&gt;SQL&gt; alter user rama profile developer ;&lt;br /&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#ff0000;&quot;&gt;&lt;strong&gt;Limitable resources&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;RESOURCE_LIMIT=TRUE&lt;/strong&gt; is required for resource limiting portions of the profile. Password limiting functionality is not affected by this parameter.&lt;br /&gt;&lt;br /&gt;SQL&gt;SELECT name, valueFROM gv$parameterWHERE name = &#39;resource_limit&#39;;&lt;br /&gt;SQL&gt; ALTER SYSTEM SET resource_limit=TRUE SCOPE=BOTH;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Kernel limits&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;Maximum concurrent &lt;a href=&quot;http://www.adp-gmbh.ch/ora/concepts/session.html&quot;&gt;sessions&lt;/a&gt; for a user(sessions_per_user)&lt;br /&gt;CPU time limit per session(cpu_per_session)&lt;br /&gt;CPU time limit per call(cpu_per_call)Call being parse, execute and fetch&lt;br /&gt;Maximum connect time(connect_time)The session will be dropped by oracle after specified time.&lt;br /&gt;Maximum idle time(idle_time)The session will be dropped by oracle after specified time of doing nothing. Long running processes are not idle!&lt;br /&gt;Maximum blocks read per session(logical_reads_per_session)&lt;br /&gt;Maximum blocks read per call(logical_reads_per_call) &lt;a name=&quot;private_sga&quot;&gt;&lt;/a&gt;&lt;br /&gt;Maximum amount of &lt;a href=&quot;http://www.adp-gmbh.ch/ora/concepts/sga.html&quot;&gt;SGA&lt;/a&gt;(private_sga)&lt;br /&gt;....(composite_limit)&lt;br /&gt;In order to enforce &lt;a href=&quot;http://www.adp-gmbh.ch/ora/concepts/profile.html#kernel_limits&quot;&gt;kernel limits&lt;/a&gt;, &lt;a href=&quot;http://www.adp-gmbh.ch/ora/misc/init_params.html#resource_limit&quot;&gt;resource_limit&lt;/a&gt; must be set to true.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;Password limits&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;-Maximum failed login attempts(failed_login_attempts)&lt;br /&gt;-Maximum time a password is valid(password_life_time)&lt;br /&gt;-Minimum of different passwords before password can be reused(password_reuse_max)&lt;br /&gt;-Minimum of days before a password can be reused(password_reuse_time)&lt;br /&gt;-Number of days an account is locked after failing to login(password_lock_time)&lt;br /&gt;-Password grace time (password_grace_time)&lt;br /&gt;-Verify function for passwords(password_verify_function)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If a session exceeds one of these limits, Oracle will terminate the session. If there is a logoff trigger, it won&#39;t be executed.&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;History of passwords&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;In order to track password related profile limits, Oracle stores the history of passwords for a user in &lt;strong&gt;&lt;span style=&quot;color:#cc33cc;&quot;&gt;user_history$&lt;/span&gt;&lt;/strong&gt;.&lt;br /&gt;Profiles already created and their settings can be queried through &lt;strong&gt;&lt;span style=&quot;color:#cc33cc;&quot;&gt;dba_profiles&lt;/span&gt;&lt;/strong&gt;</content><link rel='replies' type='application/atom+xml' href='http://bignfatdba.blogspot.com/feeds/4291419870280267796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6584799265926566340/4291419870280267796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/4291419870280267796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6584799265926566340/posts/default/4291419870280267796'/><link rel='alternate' type='text/html' href='http://bignfatdba.blogspot.com/2008/10/user-profiles.html' title='USER Profiles'/><author><name>Bis</name><uri>http://www.blogger.com/profile/17261475195595227005</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>