<?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-460925175086280617</id><updated>2024-09-05T20:28:04.604+06:00</updated><title type='text'>Ask Ershad : May I Help Your Administration(Oracle+MSSQL Server+MySQL) ?</title><subtitle type='html'>Hi Ershad Here,A DBA by profession.Working with Oracle,MSSQL Server &amp;amp; MySQl on WIN/LIN/SUN platform. Mail your questions and advice at askershad@gmail.com.&#xa;Comments and advice are highly appreciable.&#xa;&#xa;[PLEASE Do TEST before you actually DO!!!]</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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>43</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-460925175086280617.post-1721189918419417414</id><published>2010-04-19T21:49:00.004+06:00</published><updated>2010-04-20T00:23:26.729+06:00</updated><title type='text'>DIFF utility: Find Differences Between Files</title><content type='html'>Working as a DBA , you may encounter situations like to compare two files to check whether the contents are same or not.&lt;br /&gt;diff will surely make your life easy.Believe IT or ....&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;$ diff init.ora init1.ora&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check the output showing the differences in the files:&lt;br /&gt;16,17c16,17&lt;br /&gt;&lt; sga_max_size=900M&lt;br /&gt;&lt; sga_target=700M&lt;br /&gt;---&lt;br /&gt;&gt; sga_max_size=800M&lt;br /&gt;&gt; sga_target=600M&lt;br /&gt;19a20&lt;br /&gt;&gt; # sort_area_size=0&lt;br /&gt;&lt;br /&gt;here, &lt; refer to file1 &amp; &gt; refer to file 2.&lt;br /&gt;And , c stands for change&lt;br /&gt;a stands for append (looks like file 2 has one more line &amp; that is 20 which shows contents &quot;# sort_area_size=0&quot;&lt;br /&gt;&lt;br /&gt;There is another tag like d (beside c &amp; a) which stands for delete.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;$ diff init.ora init1.ora &gt; change.diff&lt;/span&gt;&lt;br /&gt;To convert init.ora to init1.ora, use the &quot;patch&quot; command with the difference report output:&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;$ patch init.ora change.diff&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We can even use &quot;sdiff&quot; utility too.&lt;br /&gt;Ex: &lt;span style=&quot;font-weight:bold;&quot;&gt;$ sdiff init.ora init1.ora&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will show the changes in more readable format.&lt;br /&gt;&lt;br /&gt;Note: can also use &quot;diff3&quot; utility to compare differences between three files.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Find Differences Between Directories:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Possible guys!!!!&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;$ diff /oracle/scripts /u01/oracle/scripts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;thanks... have a nice day.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/1721189918419417414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/1721189918419417414?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/1721189918419417414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/1721189918419417414'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/diff-utility-find-differences-between.html' title='DIFF utility: Find Differences Between Files'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-715390162075826125</id><published>2010-04-19T21:20:00.010+06:00</published><updated>2010-04-19T21:44:54.321+06:00</updated><title type='text'>Reference to vi editor</title><content type='html'>hi,&lt;br /&gt;Can check a somewhat huge reference for vi editor. Very much helps to DBA guys.&lt;br /&gt;&lt;br /&gt;$ vi filename&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Some Helpful vi Command-Line Startup Options:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option&lt;/span&gt;         ==&gt;          &lt;span style=&quot;font-weight:bold;&quot;&gt;Action&lt;/span&gt;&lt;br /&gt;vi  ==&gt; Starts editing session in memory.&lt;br /&gt;vi &lt;file&gt; ==&gt;  Starts session and opens the specified file.&lt;br /&gt;vi &lt;file&gt;* ==&gt;  Opens first file that matches the wildcard pattern. Use :n to navigate to the next matched file.&lt;br /&gt;view &lt;file&gt; ==&gt;  Opens file in read-only mode.&lt;br /&gt;vi -R &lt;file&gt; ==&gt;  Opens file in read-only mode.&lt;br /&gt;vi -r &lt;file&gt; ==&gt;  Recovers file and recent edits after abnormal abort from editing session (like a system crash).&lt;br /&gt;vi +n &lt;file&gt; ==&gt;  Opens file at specified line number n.&lt;br /&gt;vi + &lt;file&gt;  ==&gt;    Opens file at the last line.&lt;br /&gt;vi +/&lt;pattern&gt; &lt;file&gt; ==&gt; Opens file at first occurrence of specified string pattern.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Common Techniques to Enter vi Insert Mode:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Enter Insert Command&lt;/span&gt;   ==&gt;    &lt;span style=&quot;font-weight:bold;&quot;&gt; Action&lt;/span&gt;&lt;br /&gt;i   ==&gt; Insert text in front of the cursor.&lt;br /&gt;a   ==&gt; Insert text after the cursor.&lt;br /&gt;I   ==&gt; Insert text at the beginning of the line.&lt;br /&gt;A   ==&gt; Insert text at the end of the line.&lt;br /&gt;o   ==&gt; Insert text below the current line.&lt;br /&gt;O   ==&gt; Insert text above the current line.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Useful vi Exit Commands&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Exit Command&lt;/span&gt;  ==&gt; &lt;span style=&quot;font-weight:bold;&quot;&gt;Action&lt;/span&gt;&lt;br /&gt;:wq   ==&gt; Save and exit.&lt;br /&gt;ZZ   ==&gt; Save and exit.&lt;br /&gt;:x   ==&gt; Save and exit.&lt;br /&gt;:w   ==&gt; Save the current edits without exiting.&lt;br /&gt;:w!   ==&gt; Override file protections and save.&lt;br /&gt;:q   ==&gt; Exit the file.&lt;br /&gt;:q!   ==&gt; Exit without saving.&lt;br /&gt;:n   ==&gt; Edit next file.&lt;br /&gt;:e!   ==&gt; Return to previously saved version.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Common Navigation Commands&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Command  ==&gt; Action&lt;/span&gt;&lt;br /&gt;j (or down arrow)  ==&gt; Move down a line.&lt;br /&gt;k (or up arrow)  ==&gt; Move up a line.&lt;br /&gt;h (or left arrow)  ==&gt; Move one character left.&lt;br /&gt;l (or right arrow)  ==&gt; Move one character right.&lt;br /&gt;Ctrl+f (or Page Down)  ==&gt; Scroll down one screen.&lt;br /&gt;Ctrl+b (or Page Up)  ==&gt; Scroll up one screen.&lt;br /&gt;1G  ==&gt; Go to first line in file.&lt;br /&gt;G  ==&gt; Go to last line in file.&lt;br /&gt;nG  ==&gt; Go to n line number.&lt;br /&gt;H  ==&gt; Go to top of screen.&lt;br /&gt;L  ==&gt; Go to bottom of screen.&lt;br /&gt;w  ==&gt; Move one word forward.&lt;br /&gt;b  ==&gt; Move one word backward.&lt;br /&gt;0  ==&gt; Go to start of line.&lt;br /&gt;$  ==&gt; Go to end of line.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Common Options for Copying, Deleting, and Pasting Text&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option  ==&gt; Action&lt;/span&gt;&lt;br /&gt;yy  ==&gt; Yank (copy) the current line.&lt;br /&gt;nyy  ==&gt; Yank (copy) n number of lines.&lt;br /&gt;p  ==&gt; Put yanked line(s) below the cursor.&lt;br /&gt;P  ==&gt; Put yanked line(s) above the cursor.&lt;br /&gt;x  ==&gt; Delete the character that the cursor is on.&lt;br /&gt;X  ==&gt; Delete the character to the left of the cursor.&lt;br /&gt;dw  ==&gt; Delete the word the cursor is currently on.&lt;br /&gt;dd  ==&gt; Delete current line of text.&lt;br /&gt;ndd  ==&gt; Delete n lines of text&lt;br /&gt;D  ==&gt; Delete to the end of the current line.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Common Options for Changing Text&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option  ==&gt; Action&lt;/span&gt;&lt;br /&gt;r  ==&gt; Replace the character that the curser is on with the next character you type.&lt;br /&gt;~  ==&gt; Change the case of a character.&lt;br /&gt;cc  ==&gt; Delete the current line and insert text.&lt;br /&gt;C  ==&gt; Delete to the end of the line and insert text.&lt;br /&gt;c$  ==&gt; Delete to the end of the line and insert text.&lt;br /&gt;cw  ==&gt; Delete to the end of the word and insert text.&lt;br /&gt;R  ==&gt; Type over the characters in the current line.&lt;br /&gt;s  ==&gt; Delete the current character and insert text.&lt;br /&gt;S  ==&gt; Delete the current line and insert text.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Common Options for Text Searching&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option   ==&gt; Action&lt;/span&gt;&lt;br /&gt;/&lt;pattern&gt;   ==&gt; Search forward for a string.&lt;br /&gt;?&lt;pattern&gt;   ==&gt; Search backward for a string.&lt;br /&gt;n   ==&gt; Repeat the search forward.&lt;br /&gt;N   ==&gt; Repeat the search backward.&lt;br /&gt;f&lt;character&gt;   ==&gt; Search forward for a character in the current line.&lt;br /&gt;F&lt;character&gt;   ==&gt; Search backward for a character in the current line.&lt;br /&gt;&lt;br /&gt;:set number   ==&gt; Displaying Line Numbers&lt;br /&gt;u  ==&gt; Undoing a Command&lt;br /&gt;&lt;br /&gt;Thanks to GUYS behind &quot;Linux Recipes for Oracle DBAs&quot; for this summary.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/715390162075826125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/715390162075826125?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/715390162075826125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/715390162075826125'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/reference-to-vi-editor.html' title='Reference to vi editor'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-177042774846897213</id><published>2010-04-18T23:58:00.000+06:00</published><updated>2010-04-19T00:00:58.102+06:00</updated><title type='text'>Select the LAST N rows from a table in Oracle</title><content type='html'>From Oracle 9i onwards, the RANK() and DENSE_RANK() functions can be used to determine the LAST N or BOTTOM N rows. Examples:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Get the bottom 10 employees based on their salary&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT ename, sal &lt;br /&gt;  FROM ( SELECT ename, sal, RANK() OVER (ORDER BY sal) sal_rank&lt;br /&gt;           FROM emp ) &lt;br /&gt; WHERE sal_rank &lt;= 10;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Select the employees getting the lowest 10 salaries&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT ename, sal &lt;br /&gt;  FROM ( SELECT ename, sal, DENSE_RANK() OVER (ORDER BY sal) sal_dense_rank&lt;br /&gt;           FROM emp ) &lt;br /&gt; WHERE sal_dense_rank &lt;= 10;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;For Oracle 8i and above, one can get the bottom N rows using an inner-query with an ORDER BY clause:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;  FROM (SELECT * FROM my_table ORDER BY col_name_1)&lt;br /&gt; WHERE ROWNUM &lt; 10;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;Use this workaround for older (8.0 and prior) releases:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;  FROM my_table a&lt;br /&gt; WHERE 10 &gt;= (SELECT COUNT(DISTINCT maxcol)&lt;br /&gt;                FROM my_table b&lt;br /&gt;               WHERE b.maxcol &lt;= a.maxcol)&lt;br /&gt; ORDER BY maxcol;&lt;br /&gt;&lt;br /&gt;Thanks.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/177042774846897213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/177042774846897213?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/177042774846897213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/177042774846897213'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/select-last-n-rows-from-table-in-oracle.html' title='Select the LAST N rows from a table in Oracle'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-3389192728165947200</id><published>2010-04-18T23:46:00.004+06:00</published><updated>2010-04-18T23:56:36.916+06:00</updated><title type='text'>Select the TOP N rows from a table in Oracle</title><content type='html'>Below is the examples to find the top 5 employees based on their salary.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option 1: Using RANK()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT employee_name, salary&lt;br /&gt;FROM ( SELECT employee_name, salary, RANK() OVER (ORDER BY salary DESC) salary_rank&lt;br /&gt;FROM employee )&lt;br /&gt;WHERE salary_rank &lt;= 5;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option 2: Using Dense_Rank()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT employee_name, salary&lt;br /&gt;FROM ( SELECT employee_name, salary, DENSE_RANK() OVER (ORDER BY salary DESC) salary_dense_rank&lt;br /&gt;FROM employee )&lt;br /&gt;WHERE salary_dense_rank &lt;= 5;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option 3: Using inner query&lt;br /&gt;This is an example of using an inner-query with an ORDER BY clause:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM (SELECT * FROM employee ORDER BY salary DESC)&lt;br /&gt;WHERE ROWNUM &lt; 5;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Option 4: Using count distinct combination&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM employee e&lt;br /&gt;WHERE 5 &gt;= (SELECT COUNT(DISTINCT salary)&lt;br /&gt;FROM employee b&lt;br /&gt;WHERE b.salary &gt;= e.salary)&lt;br /&gt;ORDER BY salary DESC;&lt;br /&gt;&lt;br /&gt;Thanks.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/3389192728165947200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/3389192728165947200?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3389192728165947200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3389192728165947200'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/select-top-n-rows-from-table-in-oracle.html' title='Select the TOP N rows from a table in Oracle'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-1453993378018411281</id><published>2010-04-18T23:44:00.001+06:00</published><updated>2010-04-18T23:58:25.194+06:00</updated><title type='text'>Controlling the Autotrace Report in sql*plus</title><content type='html'>In sql*plus with AUTOTRACE command you can see the execution plan of successful SQL DML (that is, SELECT, DELETE, UPDATE and INSERT) statements which is useful for monitoring and tuning the performance of these statements.&lt;br /&gt;&lt;br /&gt;You can control the report by setting the AUTOTRACE system variable.&lt;br /&gt;&lt;br /&gt;Following is the available AUTOTRACE settings.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;1)SET AUTOTRACE OFF:&lt;/span&gt; No AUTOTRACE report is generated. This is the default. Result of a query will be displayed on the console as usual.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;2)SET AUTOTRACE ON EXPLAIN:&lt;/span&gt; The AUTOTRACE report shows the optimizer execution path along with query output and note but does not show statistics.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;3)SET AUTOTRACE ON STATISTICS:&lt;/span&gt; The AUTOTRACE report shows the SQL statement execution statistics along with query output but does not display execution plan.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;4)SET AUTOTRACE ON:&lt;/span&gt; The AUTOTRACE report includes both the optimizer execution path and the SQL statement execution statistics along with query output.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;5)SET AUTOTRACE TRACEONLY: &lt;/span&gt;Report displays both optimizer execution path as well as execution statistics but does not display query output. If STATISTICS is enabled, query data is still fetched, but not printed.&lt;br /&gt;&lt;br /&gt;Thanks.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/1453993378018411281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/1453993378018411281?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/1453993378018411281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/1453993378018411281'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/controlling-autotrace-report-in-sqlplus.html' title='Controlling the Autotrace Report in sql*plus'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-4152678455564315956</id><published>2010-04-18T23:33:00.002+06:00</published><updated>2010-04-18T23:43:52.830+06:00</updated><title type='text'>All About V$ views</title><content type='html'>This can help a lot to an Oracle DBA to get info about different views:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Advisors: Information related to cache advisors&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$PGA_TARGET_ADVICE&lt;br /&gt; V$PGA_TARGET_ADVICE_HISTOGRAM&lt;br /&gt; V$MTTR_TARGET_ADVICE&lt;br /&gt; V$PX_BUFFER_ADVICE&lt;br /&gt; V$DB_CACHE_ADVICE&lt;br /&gt; V$SHARED_POOL_ADVICE&lt;br /&gt; V$JAVA_POOL_ADVICE&lt;br /&gt; V$STREAMS_POOL_ADVICE (10.2)&lt;br /&gt; V$SGA_TARGET_ADVICE (10.2)&lt;br /&gt; V$ADVISOR_PROGRESS (10.2)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;ASM&lt;/span&gt; &lt;br /&gt; &lt;br /&gt; V$ASM_ALIAS (10.1)&lt;br /&gt; V$ASM_CLIENT(10.1)&lt;br /&gt; V$ASM_DISK(10.1)&lt;br /&gt; V$ASM_DISK_STAT(10.2)&lt;br /&gt; V$ASM_DISKGROUP(10.1)&lt;br /&gt; V$ASM_DISKGROUP_STAT(10.2)&lt;br /&gt; V$ASM_FILE(10.1)&lt;br /&gt; V$ASM_OPERATION(10.1)&lt;br /&gt; V$ASM_TEMPLATE(10.1)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Backup/recovery  Information related to database backups and recovery including last backup,archive logs,state of files for backup,and recovery&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$ARCHIVE&lt;br /&gt; V$ARCHIVED_LOG&lt;br /&gt; V$ARCHIVE_DEST&lt;br /&gt; V$ARCHIVE_DEST_STATUS &lt;br /&gt; V$ARCHIVE_GAP &lt;br /&gt; V$ARCHIVE_PROCESSES&lt;br /&gt; V$BACKUP&lt;br /&gt; V$BACKUP_ASYNC_IO&lt;br /&gt; V$BACKUP_CORRUPTION&lt;br /&gt; V$BACKUP_DATAFILE&lt;br /&gt; V$BACKUP_DEVICE&lt;br /&gt; V$BACKUP_PIECE&lt;br /&gt; V$BACKUP_REDOLOG&lt;br /&gt; V$BACKUP_SET&lt;br /&gt; V$BACKUP_SYNC_IO&lt;br /&gt; V$BLOCK_CHANGE_TRACKING&lt;br /&gt; V$COPY_CORRUPTION&lt;br /&gt; V$DATABASE_BLOCK_CORRUPTION&lt;br /&gt; V$DATABASE_INCARNATION&lt;br /&gt; V$DATAFILE_COPY&lt;br /&gt; V$DELETED_OBJECT&lt;br /&gt; V$FAST_START_SERVERS&lt;br /&gt; V$FAST_START_TRANSACTIONS&lt;br /&gt; V$INSTANCE_RECOVERY&lt;br /&gt; V$MTTR_TARGET_ADVICE&lt;br /&gt; V$PROXY_ARCHIVEDLOG&lt;br /&gt; V$PROXY_DATAFILE&lt;br /&gt; V$RMAN_CONFIGURATION &lt;br /&gt; V$RECOVERY_FILE_STATUS&lt;br /&gt; V$RECOVERY_LOG&lt;br /&gt; V$RECOVERY_PROGRESS&lt;br /&gt; V$RECOVERY_STATUS&lt;br /&gt; V$RECOVER_FILE&lt;br /&gt; V$BACKUP_ARCHIVELOG_DETAILS(10.2)&lt;br /&gt; V$BACKUP_ARCHIVELOG_SUMMARY(10.2)&lt;br /&gt; V$BACKUP_CONTROLFILE_DETAILS(10.2)&lt;br /&gt; V$BACKUP_CONTROLFILE_SUMMARY(10.2)&lt;br /&gt; V$BACKUP_COPY_DETAILS(10.2)&lt;br /&gt; V$BACKUP_COPY_SUMMARY(10.2)&lt;br /&gt; V$BACKUP_FILES(10.1)&lt;br /&gt; V$BACKUP_PIECE_DETAILS(10.2)&lt;br /&gt; V$BACKUP_SET_DETAILS(10.2)&lt;br /&gt; V$BACKUP_SET_SUMMARY(10.2)&lt;br /&gt; V$BACKUP_SPFILE&lt;br /&gt; V$BACKUP_SPFILE_DETAILS(10.2)&lt;br /&gt; V$BACKUP_SPFILE_SUMMARY(10.2)&lt;br /&gt; V$DATAFILE_HEADER&lt;br /&gt; V$FLASH_RECOVERY_AREA_USAGE(10.2)&lt;br /&gt; V$FLASHBACK_DATABASE_LOG(10.1)&lt;br /&gt; V$FLASHBACK_DATABASE_STAT(10.1)&lt;br /&gt; V$OBSOLETE_BACKUP_FILES&lt;br /&gt; V$OFFLINE_RANGE&lt;br /&gt; V$PROXY_ARCHIVELOG_DETAILS(10.2)&lt;br /&gt; V$PROXY_ARCHIVELOG_SUMMARY(10.2)&lt;br /&gt; V$PROXY_COPY_DETAILS(10.2)&lt;br /&gt; V$PROXY_COPY_SUMMARY(10.2)&lt;br /&gt; V$RECOVERY_FILE_DEST(10.1)&lt;br /&gt; V$RESTORE_POINT(10.2)&lt;br /&gt; V$RMAN_BACKUP_JOB_DETAILS(10.2)&lt;br /&gt; V$RMAN_BACKUP_SUBJOB_DETAILS(10.2)&lt;br /&gt; V$RMAN_BACKUP_TYPE(10.2)&lt;br /&gt; V$RMAN_ENCRYPTION_ALGORITHMS(10.2)&lt;br /&gt; V$RMAN_OUTPUT(10.1)&lt;br /&gt; V$RMAN_STATUS(10.1)&lt;br /&gt; V$UNUSABLE_BACKUPFILE_DETAILS(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Caches  Information related to the various caches, including objects, library, cursors, and the dictionary&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$ACCESS&lt;br /&gt;  V$BUFFER_POOL&lt;br /&gt;  V$BUFFER_POOL_STATISTICS&lt;br /&gt;  V$DB_CACHE_ADVICE&lt;br /&gt;  V$DB_OBJECT_CACHE&lt;br /&gt;  V$JAVA_POOL_ADVICE&lt;br /&gt;  V$LIBRARYCACHE&lt;br /&gt;  V$LIBRARY_CACHE_MEMORY&lt;br /&gt;  V$PGASTAT&lt;br /&gt;  V$PGA_TARGET_ADVICE&lt;br /&gt;  V$PGA_TARGET_ADVICE_HISTOGRAM&lt;br /&gt;  V$ROWCACHE&lt;br /&gt;  V$ROWCACHE_PARENT&lt;br /&gt;  V$ROWCACHE_SUBORDINATE&lt;br /&gt;  V$SESSION_CURSOR_CACHE&lt;br /&gt;  V$SGA&lt;br /&gt;  V$SGASTAT&lt;br /&gt;  V$SGA_CURRENT_RESIZE_OPS&lt;br /&gt;  V$SGA_DYNAMIC_COMPONENTS&lt;br /&gt;  V$SGA_DYNAMIC_FREE_MEMORY&lt;br /&gt;  V$SGA_RESIZE_OPS&lt;br /&gt;  V$SGAINFO&lt;br /&gt;  V$SHARED_POOL_ADVICE&lt;br /&gt;  V$SHARED_POOL_RESERVED&lt;br /&gt;  V$SYSTEM_CURSOR_CACHE&lt;br /&gt;  V$SUBCACHE&lt;br /&gt;  V$JAVA_LIBRARY_CACHE_MEMORY(10.1)&lt;br /&gt;  V$PROCESS_MEMORY(10.2)&lt;br /&gt;  V$SGA_TARGET_ADVICE(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Cache Fusion/RAC&lt;/span&gt; &lt;br /&gt; &lt;br /&gt; V$ACTIVE_INSTANCES&lt;br /&gt;  V$BH&lt;br /&gt;  V$CLUSTER_INTERCONNECTS(10.2)&lt;br /&gt;  V$CONFIGURED_INTERCONNECTS(10.2)&lt;br /&gt;  V$CR_BLOCK_SERVER&lt;br /&gt;  V$CURRENT_BLOCK_SERVER(10.1)&lt;br /&gt;  V$GC_ELEMENT&lt;br /&gt;  VGCSHVMASTER_INFO&lt;br /&gt;  V$GCSPFMASTER_INFO&lt;br /&gt;  V$GES_BLOCKING_ENQUEUE&lt;br /&gt;  V$GES_CONVERT_LOCAL&lt;br /&gt;  V$GES_CONVERT_REMOTE&lt;br /&gt;  V$GES_ENQUEUE&lt;br /&gt;  V$GES_LATCH&lt;br /&gt;  V$GES_RESOURCE&lt;br /&gt;  V$GES_STATISTICS&lt;br /&gt;  V$HVMASTER_INFO&lt;br /&gt;  V$INSTANCE_CACHE_TRANSFER&lt;br /&gt;  V$RESOURCE_LIMIT&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Control files Information related to instance control files&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$CONTROLFILE&lt;br /&gt; V$CONTROLFILE_RECORD_SECTION&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Cursors/SQL statements Information related to cursors and SQL statements, including the open cursors, statistics, and actual SQL text&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$OPEN_CURSOR&lt;br /&gt;  V$SQL&lt;br /&gt;  V$SQLAREA&lt;br /&gt;  V$SQLTEXT&lt;br /&gt;  V$SQLTEXT_WITH_NEWLINES&lt;br /&gt;  V$SQL_BIND_DATA&lt;br /&gt;  V$SQL_BIND_METADATA&lt;br /&gt;  V$SQL_CURSOR&lt;br /&gt;  V$SQL_OPTIMIZER_ENV&lt;br /&gt;  V$SQL_PLAN&lt;br /&gt;  V$SQL_PLAN_STATISTICS&lt;br /&gt;  V$SQL_PLAN_STATISTICS_ALL&lt;br /&gt;  V$SQL_REDIRECTION&lt;br /&gt;  V$SESSION_CURSOR_CACHE&lt;br /&gt;  V$SQL_SHARED_CURSOR&lt;br /&gt;  V$SQL_SHARED_MEMORY&lt;br /&gt;  V$SQL_WORKAREA&lt;br /&gt;  V$SQL_WORKAREA_ACTIVE&lt;br /&gt;  V$SQL_WORKAREA_HISTOGRAM&lt;br /&gt;  V$SYSTEM_CURSOR_CACHE V$MUTEX_SLEEP(10.2)&lt;br /&gt;  V$MUTEX_SLEEP_HISTORY(10.2) (for those dubious shared latches)&lt;br /&gt;  V$SQL_BIND_CAPTURE(10.1)&lt;br /&gt;  V$SQL_JOIN_FILTER(10.2)&lt;br /&gt;  V$SQL_AREA_PLAN_HASH(10.2)&lt;br /&gt;  V$SQLSTATS(10.2)&lt;br /&gt;  V$SYS_OPTIMIZER_ENV(10.1)&lt;br /&gt;  V$VPD_POLICY&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Database instances  Information related to the actual database instance&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$ACTIVE_INSTANCES&lt;br /&gt;  V$BGPROCESS&lt;br /&gt;  V$DATABASE&lt;br /&gt;  V$INSTANCE&lt;br /&gt;  V$PROCESS&lt;br /&gt;  V$SGA&lt;br /&gt;  V$SGASTAT&lt;br /&gt;  V$BLOCKING_QUIESCE(10.2)&lt;br /&gt;  V$CLIENT_STATS(10.1)&lt;br /&gt;  RAC Views: V$BH&lt;br /&gt;  V$ACTIVE_INSTANCES&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt; Direct Path Operations   Information related to the SQL*Loader direct load option&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$LOADISTAT&lt;br /&gt; V$LOADPSTAT&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Distributed/Heterogeneous Services&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;  V$DBLINK&lt;br /&gt;  V$GLOBAL_TRANSACTION&lt;br /&gt;  V$GLOBAL_BLOCKED_LOCKS&lt;br /&gt;  V$HS_AGENT&lt;br /&gt;  V$HS_PARAMETER&lt;br /&gt;  V$HS_SESSION&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt; Fixed view Information related to the v$ tables themselves&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$FIXED_TABLE&lt;br /&gt; V$FIXED_VIEW_DEFINITION&lt;br /&gt; V$INDEXED_FIXED_COLUMN&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;General General information related to various system information&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$DBPIPES&lt;br /&gt;  V$CONTEXT&lt;br /&gt;  V$GLOBALCONTEXT&lt;br /&gt;  V$LICENSE&lt;br /&gt;  V$OPTION&lt;br /&gt;  V$RESERVED_WORDS&lt;br /&gt;  V$TIMER&lt;br /&gt;  V$TIMEZONE_NAMES&lt;br /&gt;  V$TYPE_SIZE&lt;br /&gt;  V$_SEQUENCES&lt;br /&gt;  V$VERSION&lt;br /&gt;  V$DB_TRANSPORTABLE_PLATFORM(10.2)&lt;br /&gt;  V$TRANSPORTABLE_PLATFORM(10.1)&lt;br /&gt;  V$SCHEDULER_RUNNING_JOBS(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;I/O Information related to I/O, including files and statistics&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$DBFILE&lt;br /&gt;  V$FILESTAT&lt;br /&gt;  V$WAITSTAT&lt;br /&gt;  V$TEMPSTAT&lt;br /&gt;  V$FILE_HISTOGRAM(10.1)&lt;br /&gt;  V$FILEMETRIC(10.1)&lt;br /&gt;  V$FILEMETRIC_HISTORY(10.1)&lt;br /&gt;  V$SYSAUX_OCCUPANTS(10.1)&lt;br /&gt;  V$TABLESPACE&lt;br /&gt;  V$TEMP_HISTOGRAM(10.1)&lt;br /&gt;  V$TEMP_SPACE_HEADER&lt;br /&gt;  V$TEMPFILE&lt;br /&gt;  V$TEMPSEG_USAGE&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Latches/locks Information related to latches and locks&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$ENQUEUE_LOCK&lt;br /&gt;  V$ENQUEUE_STAT&lt;br /&gt;  V$EVENT_NAME&lt;br /&gt;  V$FILE_CACHE_TRANSFER&lt;br /&gt;  V$GLOBAL_BLOCKED_LOCKS&lt;br /&gt;  V$LATCH&lt;br /&gt;  V$LATCHHOLDER&lt;br /&gt;  V$LATCHNAME&lt;br /&gt;  V$LATCH_CHILDREN&lt;br /&gt;  V$LATCH_MISSES&lt;br /&gt;  V$LATCH_PARENT&lt;br /&gt;  V$LOCK&lt;br /&gt;  V$LOCKED_OBJECT&lt;br /&gt;  V$RESOURCE&lt;br /&gt;  V$RESOURCE_LIMIT&lt;br /&gt;  V$TRANSACTION_ENQUEUE&lt;br /&gt;  V$_LOCK&lt;br /&gt;  V$_LOCK1&lt;br /&gt;  V$ENQUEUE_STATISTICS&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt; FOLLOWING ARE RAC VIEWS:&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$CR_BLOCK_SERVER&lt;br /&gt;  V$GCSHVMASTER_INFO&lt;br /&gt;  V$GCSPFMASTER_INFO&lt;br /&gt;  V$GC_ELEMENT&lt;br /&gt;  V$GES_BLOCKING_ENQUEUE&lt;br /&gt;  V$GES_ENQUEUE&lt;br /&gt;  V$HVMASTER_INFO&lt;br /&gt;  V$GES_LATCH&lt;br /&gt;  V$GES_RESOURCES&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Log Miner  Information related to Log Miner&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$LOGMNR_CALLBACK&lt;br /&gt;  V$LOGMNR_CONTENTS&lt;br /&gt;  V$LOGMNR_DICTIONARY&lt;br /&gt;  V$LOGMNR_LATCH&lt;br /&gt;  V$LOGMNR_LOGFILE&lt;br /&gt;  V$LOGMNR_LOGS&lt;br /&gt;  V$LOGMNR_PARAMETERS&lt;br /&gt;  V$LOGMNR_PROCESS&lt;br /&gt;  V$LOGMNR_REGION&lt;br /&gt; &lt;br /&gt;  V$LOGMNR_SESSION&lt;br /&gt;  V$LOGMNR_STATS&lt;br /&gt;  V$LOGMNR_TRANSACTION&lt;br /&gt;  V$LOGMNR_DICTIONARY_LOAD(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Metrics  Information related to Metrics (ALL New in 10g!)&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$METRICNAME&lt;br /&gt;  V$SERVICEMETRIC&lt;br /&gt;  V$EVENTMETRIC&lt;br /&gt;  V$FILEMETRIC&lt;br /&gt;  V$FILEMETRIC_HISTORY&lt;br /&gt;  V$SERVICEMETRIC_HISTORY&lt;br /&gt;  V$SESSMETRIC&lt;br /&gt;  V$SYSMETRIC&lt;br /&gt;  V$SYSMETRIC_HISTORY&lt;br /&gt;  V$SYSMETRIC_SUMMARY&lt;br /&gt;  V$THRESHOLD_TYPES&lt;br /&gt;  V$WAITCLASSMETRIC&lt;br /&gt;  V$WAITCLASSMETRIC_HISTORY&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Multithreaded/shared servers Information related to multithreaded and parallel servers, including connections, queues,dispatchers, and shared servers&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$CIRCUIT&lt;br /&gt;  V$DISPATCHER&lt;br /&gt;  V$DISPATCHER_RATE&lt;br /&gt;  V$QUEUE&lt;br /&gt;  V$QUEUEING_MTH&lt;br /&gt;  V$REQDIST&lt;br /&gt;  V$SHARED_SERVER&lt;br /&gt;  V$SHARED_SERVER_MONITOR&lt;br /&gt;  V$DISPATCHER_CONFIG(10.1)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Object Usage   Information related to object use and dependencies&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$OBJECT_DEPENDENCY&lt;br /&gt; V$OBJECT_USAGE&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Overall system   Information related to the overall system performance&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$GLOBAL_TRANSACTION&lt;br /&gt;  V$SHARED_POOL_RESERVED&lt;br /&gt;  V$RESUMABLE&lt;br /&gt;  V$SORT_SEGMENT&lt;br /&gt;  V$TEMPSEG_USAGE&lt;br /&gt;  V$STATNAME&lt;br /&gt;  V$SYS_OPTIMIZER_ENV&lt;br /&gt;  V$SYS_TIME_MODEL&lt;br /&gt;  V$SYSSTAT&lt;br /&gt;  V$SYSTEM_CURSOR_CACHE&lt;br /&gt;  V$SYSTEM_EVENT&lt;br /&gt;  V$TEMPFILE&lt;br /&gt;  V$TEMPORARY_LOBS&lt;br /&gt;  V$TEMP_EXTENT_MAP&lt;br /&gt;  V$TEMP_EXTENT_POOL&lt;br /&gt;  V$TEMP_SPACE_HEADER&lt;br /&gt;  V$TRANSACTION&lt;br /&gt;  V$ALERT_TYPES(10.1)&lt;br /&gt;  V$EVENT_HISTOGRAM(10.1)&lt;br /&gt;  V$OSSTAT(10.1)&lt;br /&gt;  V$SYSTEM_WAIT_CLASS(10.1)&lt;br /&gt;  V$TEMP_HISTOGRAM(10.1)&lt;br /&gt;  V$XML_AUDIT_TRAIL&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Parallel Query Information related to the Parallel Query option&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$EXECUTION&lt;br /&gt;  V$PARALLEL_DEGREE_LIMIT_MTH&lt;br /&gt;  V$PQ_SESSTAT&lt;br /&gt;  V$PQ_SLAVE&lt;br /&gt;  V$PQ_SYSSTAT&lt;br /&gt;  V$PQ_TQSTAT&lt;br /&gt;  V$PX_PROCESS&lt;br /&gt;  V$PX_PROCESS_SYSSTAT&lt;br /&gt;  V$PX_SESSION&lt;br /&gt;  V$PX_SESSTAT&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Parameters     Information related to various Oracle parameters, including initialization and NLS per session&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$NLS_PARAMETERS&lt;br /&gt;  V$NLS_VALID_VALUES&lt;br /&gt;  V$OBSOLETE_PARAMETER&lt;br /&gt;  V$PARAMETER&lt;br /&gt;  V$PARAMETER2&lt;br /&gt;  V$SPPARAMETER&lt;br /&gt;  V$SYSTEM_PARAMETER&lt;br /&gt;  V$SYSTEM_PARAMETER2&lt;br /&gt;  V$PARAMETER_VALID_VALUES(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Redo logs Information related to redo logs, including statistics and history&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$LOG&lt;br /&gt;  V$LOGFILE&lt;br /&gt;  V$LOGHIST&lt;br /&gt;  V$LOG_HISTORY&lt;br /&gt;  V$THREAD (RAC related)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Replication and materialized views   Information related to replication and materialized views&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; V$MVREFRESH&lt;br /&gt; V$REPLPROP&lt;br /&gt; V$REPLQUEUE&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Resource Manager     Information related to resource management&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$ACTIVE_SESSION_POOL_MTH&lt;br /&gt;  V$ACTIVE_SESSION_POOL_HISTORY&lt;br /&gt;  V$RSRC_CONS_GROUP_HISTORY(10.2)&lt;br /&gt;  V$RSRC_CONSUMER_GROUP&lt;br /&gt;  V$RSRC_CONSUMER_GROUP_CPU_MTH&lt;br /&gt;  V$RSRC_PLAN&lt;br /&gt;  V$RSRC_PLAN_CPU_MTH&lt;br /&gt;  V$RSRC_PLAN_HISTORY(10.2)&lt;br /&gt;  V$RSRC_SESSION_INFO(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Rollback segments And Undo Information on rollback segments, including statistics and transactions&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$ROLLNAME&lt;br /&gt;  V$ROLLSTAT&lt;br /&gt;  V$TRANSACTION&lt;br /&gt;  V$UNDOSTAT&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Security/privileges Information related to security&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$ENABLEDPRIVS&lt;br /&gt;  V$PWFILE_USERS&lt;br /&gt;  V$VPD_POLICY&lt;br /&gt;  V$WALLET(10.2)&lt;br /&gt;  V$XML_AUDIT_TRAIL(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Sessions (includes some replication information and heterogeneous services)  Information related to a session, including object access, cursors, processes, and statistics&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$ACTIVE_SESSION_HISTORY&lt;br /&gt;  V$MYSTAT&lt;br /&gt;  V$PROCESS&lt;br /&gt;  V$SESS_TIME_MODEL&lt;br /&gt;  V$SESSION&lt;br /&gt;  V$SESSION_CONNECT_INFO&lt;br /&gt;  V$SESSION_CURSOR_CACHE&lt;br /&gt;  V$SESSION_EVENT&lt;br /&gt;  V$SESSION_LONGOPS&lt;br /&gt;  V$SESSION_OBJECT_CACHE&lt;br /&gt;  V$SESSION_WAIT&lt;br /&gt;  V$SESSION_WAIT_CLASS&lt;br /&gt;  V$SESSION_WAIT_HISTORY&lt;br /&gt;  V$SESSTAT&lt;br /&gt;  V$SESS_IO&lt;br /&gt;  V$SES_OPTIMIZER_ENV&lt;br /&gt;  V$SESSMETRIC&lt;br /&gt;  and V$CLIENT_STATS&lt;br /&gt;  and V$TSM_SESSIONS(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Services (all new for 10.1)&lt;/span&gt; &lt;br /&gt; &lt;br /&gt;  V$ACTIVE_SERVICES&lt;br /&gt;  V$SERV_MOD_ACT_STATS&lt;br /&gt;  V$SERVICE_EVENT&lt;br /&gt;  V$SERVICE_STATS&lt;br /&gt;  V$SERVICE_WAIT_CLASS&lt;br /&gt;  V$SERVICES&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Sorting  Information related to sorting&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$SORT_SEGMENT&lt;br /&gt;  V$TEMPSEG_USAGE&lt;br /&gt;  V$TEMP_EXTENT_MAP&lt;br /&gt;  V$TEMP_EXTENT_POOL&lt;br /&gt;  V$TEMP_HISTOGRAM(10.1)&lt;br /&gt;  V$TEMP_SPACE_HEADER&lt;br /&gt;  V$TEMPFILE&lt;br /&gt;  V$TEMPSTAT&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Standby databases (Data Guard)  Information related to standby databases&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$DATAGUARD_STATUS&lt;br /&gt;  V$LOGSTDBY&lt;br /&gt;  V$LOGSTDBY_STATS&lt;br /&gt;  V$MANAGED_STANDBY&lt;br /&gt;  V$STANDBY_LOG&lt;br /&gt;  V$DATAGUARD_CONFIG(10.1)&lt;br /&gt;  V$DATAGUARD_STATS(10.2)&lt;br /&gt;  V$LOGSTDBY_PROCESS(10.2)&lt;br /&gt;  V$LOGSTDBY_PROGRESS(10.2)&lt;br /&gt;  V$LOGSTDBY_STATE(10.2)&lt;br /&gt;  V$LOGSTDBY_TRANSACTION(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;File mapping interface    Information related to file mapping&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$MAP_COMP_LIST&lt;br /&gt;  V$MAP_ELEMENT&lt;br /&gt;  V$MAP_EXT_ELEMENT&lt;br /&gt;  V$MAP_FILE&lt;br /&gt;  V$MAP_FILE_EXTENT&lt;br /&gt;  V$MAP_FILE_IO_STACK&lt;br /&gt;  V$MAP_LIBRARY&lt;br /&gt;  V$MAP_SUBELEMENT&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Streams Information related to streams&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$AQ&lt;br /&gt;  V$STREAMS_APPLY_COORDINATOR&lt;br /&gt;  V$STREAMS_APPLY_READER&lt;br /&gt;  V$STREAMS_APPLY_SERVER&lt;br /&gt;  V$STREAMS_CAPTURE&lt;br /&gt;  V$BUFFERED_PUBLISHERS(10.1)&lt;br /&gt;  V$BUFFERED_QUEUES(10.1)&lt;br /&gt;  V$BUFFERED_SUBSCRIBERS(10.1)&lt;br /&gt;  V$PROPAGATION_RECEIVER(10.1)&lt;br /&gt;  V$PROPAGATION_SENDER(10.1)&lt;br /&gt;  V$RULE(10.1)&lt;br /&gt;  V$RULE_SET(10.1)&lt;br /&gt;  V$RULE_SET_AGGREGATE_STATS(10.1)&lt;br /&gt;  V$STREAMS_TRANSACTION(10.2)&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Statistics  Information related to statistics in general&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$SEGMENT_STATISTICS&lt;br /&gt;  V$SEGSTAT&lt;br /&gt;  V$SEGSTAT_NAME&lt;br /&gt;  V$STATISTICS_LEVEL&lt;br /&gt;  V$STATNAME&lt;br /&gt;  V$WAITSTAT&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Transactions Information related to transactions in general&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  V$GLOBAL_TRANSACTION&lt;br /&gt;  V$LOGSTDBY_TRANSACTION&lt;br /&gt;  V$RESUMABLE&lt;br /&gt;  V$STREAMS_TRANSACTION&lt;br /&gt;  V$TRANSACTION&lt;br /&gt;  V$TRANSACTION_ENQUEUE&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &lt;br /&gt;Note: In Oracle 10.1 and above, the V$LOCK_TYPE dynamic performance view summarizes all implemented lock types&lt;br /&gt;&lt;br /&gt;MTV ENJOY....&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/4152678455564315956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/4152678455564315956?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4152678455564315956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4152678455564315956'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/advisors-information-related-to-cache.html' title='All About V$ views'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-674066601730213503</id><published>2010-04-18T23:29:00.001+06:00</published><updated>2010-04-18T23:32:31.046+06:00</updated><title type='text'>Top SQL query by cpu for MSSQL Server</title><content type='html'>Check the fantastic query below to find the 25 top most &lt;span style=&quot;font-weight:bold;&quot;&gt;cpu intensive queries&lt;/span&gt; for a &lt;span style=&quot;font-weight:bold;&quot;&gt;SQL Server Instance.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;select top 25 * from (SELECT pa.value AS dbid,&lt;br /&gt;       COALESCE(DB_NAME(st.dbid),&lt;br /&gt;                DB_NAME(CAST(pa.value as int))+&#39;*&#39;) AS DBNAME, &lt;br /&gt;       SUBSTRING(text,&lt;br /&gt;        -- starting value for substring &lt;br /&gt;        CASE WHEN statement_start_offset = 0 &lt;br /&gt;             OR statement_start_offset IS NULL &lt;br /&gt;               THEN 1 &lt;br /&gt;               ELSE statement_start_offset/2 + 1 END,&lt;br /&gt;        -- ending value for substring&lt;br /&gt;        CASE WHEN statement_end_offset = 0 &lt;br /&gt;          OR statement_end_offset = -1 &lt;br /&gt;          OR statement_end_offset IS NULL &lt;br /&gt;               THEN LEN(text) &lt;br /&gt;               ELSE statement_end_offset/2 END - &lt;br /&gt;                   CASE WHEN statement_start_offset = 0 &lt;br /&gt;                          OR statement_start_offset IS NULL &lt;br /&gt;                               THEN 1 &lt;br /&gt;                               ELSE statement_start_offset/2  END + 1&lt;br /&gt;        )  AS TSQL, total_worker_time,execution_count,&lt;br /&gt;        total_worker_time/execution_count avg_cpu,total_physical_reads/execution_count avg_physical_read,&lt;br /&gt;        total_elapsed_time/execution_count avg_elapsed_time,total_logical_reads/execution_count avg_logical_read&lt;br /&gt;FROM sys.dm_exec_query_stats  &lt;br /&gt;   CROSS APPLY sys.dm_exec_sql_text(sql_handle) st&lt;br /&gt;   OUTER APPLY sys.dm_exec_plan_attributes(plan_handle) pa&lt;br /&gt;    WHERE attribute = &#39;dbid&#39;) a where a.dbid&gt;4 order by avg_cpu desc;&lt;br /&gt;&lt;br /&gt;Let me know any problem on execution.&lt;br /&gt;Thanks.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/674066601730213503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/674066601730213503?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/674066601730213503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/674066601730213503'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/top-sql-query-by-cpu-for-mssql-server.html' title='Top SQL query by cpu for MSSQL Server'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-6603492116088572537</id><published>2010-04-18T23:22:00.001+06:00</published><updated>2010-04-18T23:27:32.503+06:00</updated><title type='text'>Understanding Execution Plan Statistics</title><content type='html'>Below is the output of an execution plan statistics.&lt;br /&gt;SQL&gt; set autot trace statistics&lt;br /&gt;SQL&gt; select * from tab;&lt;br /&gt;&lt;br /&gt;107 rows selected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Statistics&lt;br /&gt;----------------------------------------------------------&lt;br /&gt;8 recursive calls&lt;br /&gt;0 db block gets&lt;br /&gt;898 consistent gets&lt;br /&gt;0 physical reads&lt;br /&gt;0 redo size&lt;br /&gt;3459 bytes sent via SQL*Net to client&lt;br /&gt;458 bytes received via SQL*Net from client&lt;br /&gt;9 SQL*Net roundtrips to/from client&lt;br /&gt;0 sorts (memory)&lt;br /&gt;0 sorts (disk)&lt;br /&gt;107 rows processed&lt;br /&gt;&lt;br /&gt;You sometimes want to know what these fields indicates. Below is the details of these fields.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;1)recursive calls:&lt;/span&gt; For processing of sql statements oracle database maintain internal tables. Sometimes for processing sql statements change is needed in the internal tables and sometimes not. When Oracle Database needs to make a change to these tables, it internally generates an internal SQL statement, which in turn generates a recursive call.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;2)db block gets:&lt;/span&gt; Number of times a CURRENT block was requested.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;3)consistent gets:&lt;/span&gt; Number of times a consistent read was requested for a block. This is called the logical reads indicates for processing of a query how many blocks needs to be accessed.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;4)physical reads:&lt;/span&gt; Total number of data blocks read from disk. This number equals the value of &quot;physical reads direct&quot; + all reads into buffer cache.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;5)redo size:&lt;/span&gt; For processing of a query total amount of redo generated in bytes.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;6)bytes sent through SQL*Net to client:&lt;/span&gt; Total number of bytes sent to the client from the foreground processes.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;7)bytes received through SQL*Net from client:&lt;/span&gt; Total number of bytes received from the client over Oracle Net.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;8)SQL*Net round-trips to/from client:&lt;/span&gt; Total number of Oracle Net messages sent to and received from the client.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;9)sorts (memory):&lt;/span&gt;Number of sort operations that were performed completely in memory and did not require any disk writes.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;10)sorts (disk):&lt;/span&gt;Number of sort operations that required at least one disk write.&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;&lt;br /&gt;11)rows processed:&lt;/span&gt; Number of rows processed during the operation. &lt;br /&gt;&lt;br /&gt;Thanks.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/6603492116088572537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/6603492116088572537?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6603492116088572537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6603492116088572537'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/understanding-execution-plan-statistics.html' title='Understanding Execution Plan Statistics'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-5138951973215510799</id><published>2010-04-18T00:32:00.000+06:00</published><updated>2010-04-18T00:34:16.129+06:00</updated><title type='text'>Type of constraints in oracle</title><content type='html'>Constraint in oracle imposes rule that restrict the values in a oracle database. There are six types of constraint in oracle database and all these constraints except not null constraint can be declared in two ways.&lt;br /&gt;&lt;br /&gt;A brief description of these six types of constraints are listed below.&lt;br /&gt;&lt;br /&gt;1)Not Null Constraint: If I define a field not null then value must be inserted in to that column.&lt;br /&gt;&lt;br /&gt;2)Unique Constraint: If I define a column or set of column to be unique then it prohibits multiple rows from having the same value in the same column or combination of columns but allows some values to be null.&lt;br /&gt;&lt;br /&gt;3)Primary Key Constraint: Primary key constraint is the combination of not null constraint and unique constraint. In a single declare it satisfy both constraint.&lt;br /&gt;&lt;br /&gt;4)Foreign Key Constraint: Foreign key constraint requires values in one table to match values in another table.&lt;br /&gt;&lt;br /&gt;5)Check Constraint: Check constraint imposes restriction of values based on specified condition.&lt;br /&gt;&lt;br /&gt;6)REF Constraint: A REF constraint lets you further describe the relationship between the REF column and the object it references.&lt;br /&gt;&lt;br /&gt;Constraint related queries: &lt;a href=&quot;http://askershad.blogspot.com/2010/04/dbaconstraints-userconstraints.html&quot;&gt;http://askershad.blogspot.com/2010/04/dbaconstraints-userconstraints.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/5138951973215510799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/5138951973215510799?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/5138951973215510799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/5138951973215510799'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/type-of-constraints-in-oracle.html' title='Type of constraints in oracle'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-4508120722141210637</id><published>2010-04-18T00:19:00.005+06:00</published><updated>2010-04-18T00:30:58.729+06:00</updated><title type='text'>dba_constraints/ user_constraints/ all_constraints queries</title><content type='html'>Simply list of constranits along with the constraint_type you can achieve querying from dba_constraints/ user_constraints/ all_constraints.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:85%;color:#3366ff;&quot;&gt;SQL&gt; select owner, constraint_name, constraint_type from dba_constraintswhere owner=&#39;&amp;amp;Owner_name&#39; and table_name=&#39;&amp;amp;Tab_name&#39;;&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;color:#000000;&quot;&gt;Output:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the column constraint_type there may have values C,P,U,R,V and O which means,&lt;br /&gt;1) C :check constraint on a table&lt;br /&gt;2) P :primary key&lt;br /&gt;3) U :unique key&lt;br /&gt;4) R :referential integrity&lt;br /&gt;5) V :with check option, on a view&lt;br /&gt;6) O :with read only, on a view&lt;br /&gt;&lt;br /&gt;You can get constraints along with their columns and position by querying from DBA_CONS_COLUMNS/ USER_CONS_COLUMNS/ ALL_CONS_COLUMNS.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;SQL&gt; col owner for a10&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;col constraint_name for a27&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;col table_name for a25&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;col column_name for a23&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;set pages 100&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;SQL&gt; select * from dba_cons_columns where table_name=&#39;&amp;amp;Tab_name&#39; and owner=&#39;&amp;amp;Owner_name&#39; order by constraint_name, position;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;By joining both two views you can get a list of constraints , their type, column_name, column position and their reference constraint name, reference table name in the constraint by,&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;SQL&gt; col r_owner for a10&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;SQL&gt; Select c.constraint_name, cc.column_name, c.r_owner,c.r_constraint_name,c.constraint_type,cc.position, r.table_namefrom dba_constraints c JOIN dba_cons_columns cc ON(c.table_name=cc.table_name AND c.owner=cc.ownerAND c.constraint_name=cc.constraint_name) LEFT JOIN dba_constraints rON(c.r_constraint_name=r.constraint_name AND r.constraint_type in (&#39;P&#39;,&#39;U&#39;) ) where c.table_name=&#39;&amp;amp;Tab_name&#39; and c.owner=&#39;&amp;amp;Owner_name&#39; order byconstraint_name, position;&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Thanks.&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/4508120722141210637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/4508120722141210637?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4508120722141210637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4508120722141210637'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2010/04/dbaconstraints-userconstraints.html' title='dba_constraints/ user_constraints/ all_constraints queries'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-2631111965693556465</id><published>2009-02-22T15:31:00.008+06:00</published><updated>2009-07-18T02:41:46.803+07:00</updated><title type='text'>Oracle: Restore points</title><content type='html'>Restore point is nothing but a name given to a specified point of a database status.It can define the status of a database on a specific time or SCN number.So, that when we flashback database , we can mention the name of the restore point in stead of a specific date and time or a SCN number .&lt;br /&gt;&lt;br /&gt;Oracle will automatically flashback the database to that specific restore point. It is a mapping of SCN number to a restore point name. So, when we flashback database to a restore point we do, nothing but restoring to a specific SCN.&lt;br /&gt;&lt;br /&gt;There are two different type of restore point:&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(51,51,255)&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color:#66cccc;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;span style=&quot;COLOR: rgb(51,51,255)&quot;&gt;a) Normal restore point or nonguaranteed restore point&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(51,51,255)&quot;&gt;b) Guaranteed restore point&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold&quot;&gt;a) To create Normal restore point do the following:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold&quot;&gt;sql&gt; create restore point ershad;&lt;/span&gt;&lt;br /&gt;[I have given the restore point name as &quot;&lt;span style=&quot;COLOR: rgb(51,51,255)&quot;&gt;ershad&lt;/span&gt;&quot;]&lt;br /&gt;&lt;br /&gt;So, when required , we can flashback the database upto this restore point.But, CONDITIONS APPLY....&lt;br /&gt;&lt;br /&gt;whether database can be flashbacked upto the restore point depends on whether you have the flashback logs in the Flash Recovery Area or not.If you have, you can restore upto that point.But , it is not Guaranteed every time.so, you may face the following error while trying to flashback to a normal restore point.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold&quot;&gt;ORA-38729: Not enough flashback database log data to do FLASHBACK&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This error means the database does not have the flashback logs needed to go back to the restore point or time or SCN that you’ve specified&lt;br /&gt;&lt;br /&gt;***Check &lt;a href=&quot;http://askershad.blogspot.com/2009/02/how-to-check-maximum-flashback-possible.html&quot; target=&quot;_blank&quot;&gt;db_flashback_retention_target&lt;/a&gt; for more on flashback logs retention period.***&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold&quot;&gt;b) Guaranteed restore point:&lt;/span&gt;&lt;br /&gt;This will guarantee that at any point in time you can flashback the database to the restore point. As , Oracle will make sure the flashback logs will not be deleted until that restore point , whatever the case is.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#000000;&quot;&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(51,51,255)&quot;&gt;sql&gt; create restore point askershad guarantee flashback database;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;[I have given the restore point name as &quot;&lt;span style=&quot;COLOR: rgb(51,51,255)&quot;&gt;askershad&lt;/span&gt;&quot;]&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(255,0,0)&quot;&gt;Note: As Guaranteed restore point assures flashback logs will not be deleted.So Be Careful about the space consumed in Flash recovery area.And create this only when you require.like , you need to check your database behaviour with a new application and you are going to revert back after the test. And please DROP the restore point after your job is done.Because,for a Guaranteed restore point, the associated flashback logs will never be deleted until you drop the restore point. And not doing so may end up no space in flash recovery area and cause a recovery writer(RVWR) process failure which leads to database instance failure......&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;&lt;br /&gt;&lt;u&gt;TO CHECK RESTORE POINTS:&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(51,51,255)color:#000000;&quot; &gt;sql&gt; select * from v$restore_point;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME NAME&lt;br /&gt;------- -------------------------------- ------ ------------------- ----------- -------&lt;br /&gt;916841 --------11----------------------YES-----3981312----------22-FEB-09-- ASKERSHAD&lt;br /&gt;916831-------- 11---------------------- NO-----------0-----------22-FEB-09---ERSHAD&lt;br /&gt;&lt;br /&gt;SCN--&gt; To which SCN the restore point is mapped&lt;br /&gt;DATABASE_INCARNATION#--&gt;This column displays the incarnation of the database&lt;br /&gt;when this restore point was created&lt;br /&gt;GUARANTEE_FLASHBACK_DATABASE--&gt;whether it is guaranteed or normal restore point&lt;br /&gt;STORAGE_SIZE--&gt;What is the flashback log size***&lt;br /&gt;TIME--&gt;&lt;/span&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;To what TIME the restore point is mapped&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;NAME--&gt;Name of the restored point&lt;br /&gt;&lt;br /&gt;***look here , The normal restored point does not have a size mentioned. As it requires the flashback logs from the point of SCN number. If logs are not there,it is not possible to flashback. The guaranteed one will keep the logs so, the size of logs belong to it and assures the flashback.&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;&lt;br /&gt;&lt;u&gt;TO DROP RESTORE POINTS:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(51,51,255)color:#000000;&quot; &gt;SQL&gt; drop restore point ershad;&lt;/span&gt;(for both types the command is same)&lt;/span&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(255,0,0)&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;&lt;u&gt;&lt;span style=&quot;FONT-WEIGHT: bold&quot;&gt;More Topic:&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oraclehow-to-flash-database.html&quot; target=&quot;_blank&quot;&gt;FLASHBACK DATABASE TO A RESTORE POINT&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(255,0,0)&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;COLOR: rgb(255,0,0)&quot;&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(51,51,51)&quot;&gt;Have a nice day..........&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;FONT-WEIGHT: bold; COLOR: rgb(255,0,0)&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/2631111965693556465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/2631111965693556465?isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/2631111965693556465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/2631111965693556465'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracle-restore-points.html' title='Oracle: Restore points'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-8515091652181249329</id><published>2009-02-22T15:09:00.003+06:00</published><updated>2009-02-22T15:24:40.948+06:00</updated><title type='text'>Oracle:flashback database to earlier time from SQL prompt</title><content type='html'>In the last post we have seen how to flashback a database using RMAN utility. And i have discussed about the pros and cons of flashback database also. To review please check:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oraclehow-to-flash-database.html&quot; target=&quot;_blank&quot;&gt;HOW TO FLASHBACK DATABASE USING RMAN UTILITY&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now , we will see what are the options available to flashback database from SQL*plus utility.&lt;br /&gt;&lt;br /&gt;being in the sql prompt also you can do several flashback of database .Available options are:&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;1) flashback to a specific date and time&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;2) flashback to a specific SCN number&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;3) flashback to a named restore point&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In Detail::&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;1) flashback to a specific date and time:&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;connect sys/e@lion as sysdba&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;shutdown immediate&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;startup mount&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;flashback database to timestamp to_date(&#39;14-FEB-2007 11:30:00&#39;,&#39;DD-MON-YYYY HH24:MI:SS&#39;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Please read &lt;a href=&quot;http://askershad.blogspot.com/2009/02/oraclehow-to-flash-database.html&quot; target=&quot;_blank&quot;&gt;USING RESETLOGS WITH FLASHBACK DATABASE FEATURE&lt;/a&gt;  before performing the following step.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;2) flashback to a specific SCN number:&lt;/u&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;sql&gt;connect sys/e@lion as sysdba&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;Check the current SCN number first:&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt; select current_scn from v$database;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CURRENT_SCN&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;-----------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;     916022&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then,&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;shutdown immediate&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;startup mount&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt; flashback database to scn 915000;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;Please read &lt;a href=&quot;http://askershad.blogspot.com/2009/02/oraclehow-to-flash-database.html&quot; target=&quot;_blank&quot;&gt;USING RESETLOGS WITH FLASHBACK DATABASE FEATURE&lt;/a&gt;  before performing the following step.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;sql&gt;alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;3) flashback to a named restore point:&lt;/u&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;connect sys/e@lion as sysdba&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;shutdown immediate&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;startup mount&lt;/span&gt;&lt;br /&gt;then  issue the following with the restore point name you want to flashback. In my case, it is &quot;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;ershad&lt;/span&gt;&quot;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt;flashback database to restore point ershad;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Please read &lt;a href=&quot;http://askershad.blogspot.com/2009/02/oraclehow-to-flash-database.html&quot; target=&quot;_blank&quot;&gt;USING RESETLOGS WITH FLASHBACK DATABASE FEATURE&lt;/a&gt;  before performing the following step.&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;sql&gt;alter database open resetlogs;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;Topic explained:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;WHAT IS RESTORE POINT&lt;br /&gt;HOW TO CREATE RESTORE POINT&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/8515091652181249329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/8515091652181249329?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/8515091652181249329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/8515091652181249329'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracleflashback-database-to-earlier.html' title='Oracle:flashback database to earlier time from SQL prompt'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-3874299764224649569</id><published>2009-02-14T16:27:00.002+06:00</published><updated>2009-02-22T15:07:34.598+06:00</updated><title type='text'>HOW to check the maximum flashback possible of a database</title><content type='html'>&lt;span style=&quot;font-size:100%;&quot;&gt;If you want to  check how far back you can flashback the database.please do following:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-size:100%;&quot; &gt;sql&gt; alter session set nls_date_format=&#39;DD-MON-YYYY HH24:MI:SS&#39;;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-size:100%;&quot; &gt;Session altered.&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-size:100%;&quot; &gt;sql&gt; select * from v$flashback_database_log;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_TIME RETENTION_TARGET      FLASHBACK_SIZE      ESTIMATED_FLASHBACK_SIZE&lt;br /&gt;-------------------- -------------------- ---------------- -------------- ----------------------------------------------------------------------------------------------&lt;br /&gt;907191----  &lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;14-FEB-2009  12:37:20-----&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;                                       1440------&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;                                          8192000--------73728&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;so we can flashback database to any time in betweeen &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;upto 14-feb-2009 till 12:37:20 or upto the scn number 907191&lt;/span&gt;. but the condition is , we should have the flashback logs available and the archived logs are also available. Because flashback feature uses archive logs to undo the changes.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;columns of  &lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;V$FLASHBACK_DATABASE_LOG&lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;OLDEST_FLASHBACK_SCN&lt;/span&gt;--&gt;The oldest SCN to which you can flash back the database.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;OLDEST_FLASHBACK_TIME&lt;/span&gt;--&gt;The earliest time to which you can flash back the database.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;RETENTION_TARGET&lt;/span&gt;--&gt;The initialization parameter&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt; db_flashback_retention_target &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;determines how long the flashback logs are retained,values measurement is  in minutes.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;FLASHBACK_SIZE&lt;/span&gt;--&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Current size (in bytes) of the flashback data&lt;span style=&quot;color: rgb(204, 153, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;.&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;ESTIMATED_FLASHBACK_SIZE&lt;/span&gt;--&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;Estimated size of flashback data needed for the current target retention(will be discussed shortly)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;u style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;DB_FLASHBACK_RETENTION_TARGET&lt;/u&gt;&lt;br /&gt;This parameter value decides how long the flashback logs should be kept. remember undo_retention parameter, it behaves the same way. It will keep the flashback logs for that much time but still conditions apply.....&lt;br /&gt;as it depends on the size of flash recovery area also.DB_RECOVERY_FILE_DEST_SIZE decides the size of flashback recovery area. So, &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;DB_FLASHBACK_RETENTION_TARGET will try to keep the flashback logs until the time , if it has sufficient space. If not , FRA will delete the oldest logs to keep new one.the reverse of this, if space is enough , it can keep logs more than the time mentioned in &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;DB_FLASHBACK_RETENTION_TARGET parameter.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;in my query to &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;v$flashback_database_log&lt;/span&gt; you can see &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;FLASHBACK_SIZE&lt;/span&gt; is &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;8192000(which is 8 MB almost)  &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:78%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:130%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span&gt;and &lt;span style=&quot;font-weight: bold;&quot;&gt;ESTIMATED_FLASH_SIZE&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span&gt;is 73728(which is 72 KB).So, as  of my retention parameter i require 72 kb of space and compare to that i have 8MB.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;font-size:100%;&quot;&gt; So it will be well enough . &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;But on the real time active database,the reverse is almost always true.&lt;br /&gt;&lt;br /&gt;HOW TO ESTIMATE FLASHBACK LOG SIZE&lt;br /&gt;&lt;br /&gt;thanks,&lt;br /&gt;have a nice day&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/3874299764224649569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/3874299764224649569?isPopup=true' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3874299764224649569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3874299764224649569'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/how-to-check-maximum-flashback-possible.html' title='HOW to check the maximum flashback possible of a database'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-460925175086280617.post-2803516473187318425</id><published>2009-02-14T12:35:00.054+06:00</published><updated>2009-02-22T15:27:56.928+06:00</updated><title type='text'>Oracle:flashback a database to earlier time using RMAN</title><content type='html'>&lt;span style=&quot;font-size:100%;&quot;&gt;we can flashback an Oracle database with following features:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;font-size:100%;&quot; &gt;1) flashback to a specific date and time&lt;/span&gt;&lt;span style=&quot;font-weight: bold;font-size:100%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;font-size:100%;&quot; &gt;2) flashback to a specific SCN number&lt;/span&gt;&lt;span style=&quot;font-weight: bold;font-size:100%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;font-size:100%;&quot; &gt;3) flashback to a named restore point&lt;/span&gt;&lt;span style=&quot;font-weight: bold;font-size:100%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;font-size:100%;&quot; &gt;4) flashback to last resetlogs option&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;br /&gt;&lt;br /&gt;first of all, we need to enable flashback and properly size the flash recovery area so that flashback logs are created and we can flashback our database to a previous stage.&lt;br /&gt;to do that please check the following:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracle-flashback-feature.html&quot; target=&quot;_blank&quot;&gt;HOW TO ENABLE FLASHBACK &lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracleconfigure-flash-recovery-area.html&quot; target=&quot;_blank&quot;&gt;HOW TO CONFIGURE FLASH RECOVERY AREA&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;now, it is configure properly and we can flashback our database as required.&lt;br /&gt;&lt;br /&gt;One more information you may need, that is how far back you can flashback the database.&lt;br /&gt;follow the link for this,&lt;a href=&quot;http://askershad.blogspot.com/2009/02/how-to-check-maximum-flashback-possible.html&quot; target=&quot;_blank&quot;&gt;MAXIMUM FLASHBACK POSSIBLE FOR ORACLE DATABASE&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;1)Flashback to a specific date and time:(steps)&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; connect target /@lion&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;          &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;RMAN&gt; shutdown immediate&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;          RMAN&gt; startup mount&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;          RMAN&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt; flashback database to time &#39;sysdate-50/60/24&#39;;&lt;/span&gt; &lt;/span&gt;(doing a flashback to 50 minutes from sysdate)&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;br /&gt;&lt;u&gt;OUTPUT:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt; Starting flashback at 14-FEB-09&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;using channel ORA_DISK_1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;starting media recovery&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;media recovery complete, elapsed time: 00:00:07&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Finished flashback at 14-FEB-09&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;at this point, you may need to check whether database has been flashbackED to the point you want.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;to do that, &lt;span style=&quot;font-weight: bold;&quot;&gt;open the database in read only mode and check the data.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; sql &#39;alter database open read only&#39;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;and the answer is &lt;span style=&quot;font-weight: bold;&quot;&gt;yes&lt;/span&gt;,you got what you want, shutdown the database and open it with resetlogs option.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;RMAN&gt;shutdown immediate;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;RMAN&gt;startup mount;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;RMAN&gt; alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;If answer is no, you can redo the procedure to flashback to a diiferent TIME. that is,shutdown database,startup mount,&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;flashback to the desired TIME,open in read only mode and check. if now it is fine , then shutdown the database once&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; again and open the database with resetlog options.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;RMAN&gt; alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;we need to do this , as we are doing an incomplete recovery.........&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;if you want to mention a specific time then:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; flashback database to time &quot;to_date(&#39;13-FEB-2009 11:00:00&#39;,&#39;DD-MON-YYYY hh24:mi:ss&#39;)&quot;;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;font-size:100%;&quot; &gt;&lt;u&gt;2) &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;flashback to a specific SCN number&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;font-size:100%;&quot; &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;first check the current scn of the database by issuing following statement:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;connect as sysdba&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;sql&gt; select current_scn from v$database;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CURRENT_SCN&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;-----------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt; 909158&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;that means we can flashback to a SCN prior to this SCN only.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;RMAN&gt; connect target /@lion&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;RMAN&gt; shutdown immediate&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;RMAN&gt; startup mount&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;now, think i want to flashback till SCN number--&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;RMAN&gt; flashback database to scn 909100;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;br /&gt;Starting flashback at 22-FEB-09&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=155 devtype=DISK&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;starting media recovery&lt;br /&gt;media recovery complete, elapsed time: 00:00:03&lt;br /&gt;&lt;br /&gt;Finished flashback at 22-FEB-09&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;at this point, you may need to check whether database has been flashback to the point you want.&lt;br /&gt;to do that, open the database in read only mode and check the data.&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; sql &#39;alter database open read only&#39;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;Now , check this,&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;sys@LION&gt; select current_scn from v$database;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CURRENT_SCN&lt;br /&gt;-----------&lt;br /&gt;   909100&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;and the answer is yes,you got what you want, shutdown the database and open it with resetlogs option.&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt;shutdown immediate;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt;startup mount;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If answer is no, you can redo the procedure to flashback to a diiferent SCN. that is,shutdown database,startup mount,flashback to the desired SCN ,open in read only mode and check. if now it is fine , then shutdown the database once again and open the database with resetlog options.&lt;/span&gt;&lt;span style=&quot;font-weight: bold;font-size:100%;&quot; &gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;we need to do this , as we are doing an incomplete recovery.........&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;3.Flashback to a Restore Point:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;we can flashback a database to a restore point also.&lt;br /&gt;to do that,&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; connect target /@lion&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; shutdown immediate&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; startup mount&lt;/span&gt;&lt;br /&gt;then  issue the following with the restore point name you want to flashback. In my case, it is &quot;ershad&quot;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; flashback database to restore point ershad;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;at this point, you may need to check whether database has been flashback to the point you want.&lt;br /&gt;to do that, open the database in read only mode and check the data.&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; alter database open read only;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and the answer is yes,you got what you want, shutdown the database and open it with resetlogs option.&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt;shutdown immediate;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt;startup mount;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If answer is no, you can redo the procedure to flashback to a diiferent restore point. that is,shutdown database,startup mount,flashback to the desired Restore point ,open in read only mode and check. if now it is fine , then shutdown the database once again and open the database with resetlog options.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;RMAN&gt; alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;we need to do this , as we are doing an incomplete recovery.........&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;WHAT IS RESTORE POINT&lt;br /&gt;HOW TO CREATE RESTORE POINT&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;4)&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;font-size:100%;&quot; &gt;&lt;u&gt;flashback to last resetlogs option&lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;   At last , During the flashback operation , we may end up with a mistake like:&lt;br /&gt;You may have flashback to a wrong point. As we know it is still recoverable, BY opening the database in read only mode,you can check whether the operation is desired or not . if yes , open the database with resetlog options, if no, you can redo the procedure to your desired point once again.&lt;br /&gt;&lt;br /&gt;Problem is , if you have flashback to a point and open the database with resetlogs options. And now feel that it was wrong.&lt;br /&gt;&lt;br /&gt;Dont worry. You can still go back to the previous incarnation and recover your old state of database before resetlogs.Because, Oracle knows you expect a lot from him.&lt;br /&gt;Let us check, &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;HOW TO FLASHBACK DATABASE TO PRIOR TO LAST RESETLOGS OPTIONS:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; connect target /@lion&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; shutdown immediate;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; startup mount;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; flashback database to before resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; alter database open resetlogs;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: When we do a resetlogs, oracle will record the SCN . So the previous operation is nothing but flashing back to a previous SCN. We can check the last resetlogs SCN from the following query:&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;SQL&gt; select resetlogs_change# from v$database;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RESETLOGS_CHANGE#&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;-----------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;           911255&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: Assume the current SCN is 25444. And I have flashback logs Till 22999. So, we can flashback to any point in between this.and more important , backward and forward both are possible in this range till you reach your expected point. I mean to say , once you flashback to 23888 and found it is not right and you need a bit forward. So, you can then flashback to 24000(which is actually going forward as of your last operation).You can flashback as many times in your range till the flashback logs are available and you have not opened it with resetlogs option.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;More:&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracleflashback-database-to-earlier.html&quot; target=&quot;_blank&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;FLASHBACK A DATABASE FROM SQL PROMPT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 153, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);font-size:100%;&quot; &gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/how-to-check-maximum-flashback-possible.html&quot; target=&quot;_blank&quot;&gt;MAXIMUM FLASHBACK POSSIBLE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Thanks a lot.....&lt;br /&gt;&lt;br /&gt;Have a nice day&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/2803516473187318425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/2803516473187318425?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/2803516473187318425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/2803516473187318425'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oraclehow-to-flash-database.html' title='Oracle:flashback a database to earlier time using RMAN'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-239783623062476973</id><published>2009-02-14T12:11:00.004+06:00</published><updated>2009-02-14T12:25:26.683+06:00</updated><title type='text'>ORA-38759: Database must be mounted by only one instance and not open</title><content type='html'>i have received an error like the following while trying to enable flashback on my database.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; alter database flashback on;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;alter database flashback on&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;*&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;ERROR at line 1:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;ORA-38759: Database must be mounted by only one instance and not open.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Reason is: you cannot enable flashback feature when the database is in open stage.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt;select status from v$instance;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;STATUS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;OPEN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;solution:&lt;/u&gt;&lt;/span&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;do the following:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt;shutdown immediate;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; startup mount;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; alter database flashback on;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; alter database open;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;But, we can disable flashback feature , when the database is in open state too.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To check whether flashback feature is enable or not:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; select flashback_on from v$database;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;FLASHBACK_ON&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;NO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracle-flashback-feature.html&quot; target=&quot;_blank&quot;&gt;Oracle 10G/11G: Flashback features and example&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracle-flashback-feature.html&quot; target=&quot;_blank&quot;&gt;Oracle 10G/11G: Different flashback options&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;have a nice day..................&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/239783623062476973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/239783623062476973?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/239783623062476973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/239783623062476973'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/ora-38759-database-must-be-mounted-by.html' title='ORA-38759: Database must be mounted by only one instance and not open'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-6274462734916782228</id><published>2009-02-14T11:16:00.009+06:00</published><updated>2009-02-22T15:31:15.669+06:00</updated><title type='text'>Oracle flashback feature</title><content type='html'>&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;Oracle flashback feature:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;In ORACLE 10G, a new feature introduced named as &lt;span style=&quot;font-weight: bold;&quot;&gt;FLASHBACK&lt;/span&gt;.actually in ORACLE 9i, also there was a feature called &lt;span style=&quot;font-weight: bold;&quot;&gt;FLASHBACK QUERIES&lt;/span&gt;. Dont get confused about it.... think like the full featured FLASHBACK is from 10G. in 9i, it had only one option available compared to 10G flashback options.In 10G, FLASHBACK refers as one tool which supports different types of data recovery&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;flashback features:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;i) flashback a database to prior to present time&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt; ii) flashback a table to prior to present time&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;iii) flashback/rollback a drop table statement(means rollback a table which is dropped)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;i) FLASHBACK DATABASE:&lt;/u&gt;&lt;/span&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;             earlier till 9i, if we need to go to previous time of a database then we need to do incomplete recovery(&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;DBPITR&lt;/span&gt;). That is restore a backup previous to the time you want to recover and apply archived logs till the time you want to recover, then open the database with resetlogs option.10G onwards, we can flashback our database to a previous point in time. Flashback feature uses flashback logs(additional logs to be created for this feature) to do the flashback. Flashback logs will maintain the block changes information and this will be refered to , when you want to flashback your database.Oracle will read the flashback logs and undo the changed blocks to roll it backward.&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 102, 0);font-size:85%;&quot; &gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;Note: The entire database will be rolled back. you cannot perform flashback on individual tables or tablespaces.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;ii) &lt;span style=&quot;font-weight: bold;&quot;&gt;FLASHBACK a table data to prior time:&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;this was introduced in Oracle9i as flashback query feature. Remember, &lt;span style=&quot;font-weight: bold;&quot;&gt;read consistancy....snapshot too old error&lt;/span&gt; .we can have read consistency till the data was not committed by another transaction.If transaction gets rollback the undo will be applied again. If commited you will see the newest data. Till the transaction going on you can see the read consistent data from undo. And so, When the change is committed, the need for the past image is gone, but it’s not discarded till there is a need of undo space for other transactions.So, the concept of flashback a table is why not to use the undo to get a table to a previous stage.yes we can do that.but only till the undo is available.&lt;br /&gt;and we can resize the undo also depending on how much back image of a table i want.........&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;iii) Rollback/restore a dropped table:&lt;/u&gt;&lt;/span&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;we know DDL statements connot be rollback. Means if you drop a table,that is gone. But this works only till oracle 9i.&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;in 10G,you can restore a table which was dropped by a ddl commands. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Check whether flashback is enabled or not in oracle 10G:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;SQL&gt; select flashback_on from v$database;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;br /&gt;FLASHBACK_ON&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;YES&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If it shows no means flashback is not enabled&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;How to enable flashback in oracle 10G&lt;/u&gt;&lt;/span&gt;&lt;u&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 1:&lt;/span&gt; Database should be in archive log mode.(&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracle-how-to-enable-and-disable.html&quot; target=&quot;_blank&quot;&gt;HOW TO ENABLE /DISABLE ARCHIVE LOG)&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 2:&lt;/span&gt; FLASH RECOVERY AREA must be configured.&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracleconfigure-flash-recovery-area.html&quot; target=&quot;_blank&quot;&gt;(HOW TO CONFIGURE FLASH RECOVERY AREA)&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 3: &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; conn sys/**@lion as sysdba&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt;startup mount&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt;alter database flashback on;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; alter database open;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: enabling flashback generates flashbacks logs which tracks the changes to data blocks. Flash recovery area is the only place where it stores flashback logs. So, flash recovery area must to be configured.Secondly, having only flashback logs will not help to flashback database ,it needs the archive logs to be applied to undo the blocks.so,the database must be in archive log mode.Remember one more thing, sizing the flash recovery area is very much important.&lt;br /&gt;if you size it inadequetly it may end up having no space in FRA, so,database may hang,or will not startup and you may receive the following errors :(because it may be the location for your rman backup storage and archived logs also. so, no space here means you are in trouble)&lt;br /&gt;&lt;br /&gt;Check the errors you may receive if flashback recovery area lack of space:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;1)  You see a message in the alert log similar to the following:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-weight: bold;&quot;&gt;Can not open flashback thread because there is no more space in flash recovery area&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;2)If the database has aborted earlier because of flashback errors and you attempt to&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;start it, you get the following error:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;SQL&gt; alter database open;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;alter database open&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;*&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;ERROR at line 1:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51); font-weight: bold;&quot;&gt;ORA-38760: This database instance failed to turn on flashback database&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 102, 102);&quot;&gt;we will talk about how we can solve this issues in separate discussion. Let us come back to the discussion here.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;Using flashback:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oraclehow-to-flash-database.html&quot; target=&quot;_blank&quot;&gt;HOW to flashback a DATABASE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;Other available options:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What should be the  size of FRA(flash recovery area)&lt;br /&gt;How to disable flashback&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/6274462734916782228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/6274462734916782228?isPopup=true' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6274462734916782228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6274462734916782228'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracle-flashback-feature.html' title='Oracle flashback feature'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-4829055858549406694</id><published>2009-02-14T10:44:00.004+06:00</published><updated>2009-02-14T11:07:04.050+06:00</updated><title type='text'>HOW TO GET ORACLE DATABASE IDENTIFIER (DBID)</title><content type='html'>&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;DBID stands for database identifier.&lt;/span&gt; Which is a unique identifier for each oracle database running.we can get the &lt;span style=&quot;font-weight: bold;&quot;&gt;DBID &lt;/span&gt;from the &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;v$database&lt;/span&gt; view.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt;select DBID from v$database;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      DBID&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;----------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt; 396604920&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;so, above command will show you the unique database identifier of your database which is stored in your CONTROL files.You may need to know your Database DBID on some recovery scenarios.one example is , you may need to restore your control files from rman backup as you have lost all of your control files.There are lot of conditions apply in recovering a control file depending on the type of backup taken and the location of backup.We will discuss about this&lt;br /&gt;in the control file recovery situations documentation afterward .But, while recovering the control file you may end up here:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; connect target /@lion&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; startup nomount;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; restore controlfile from autobackup;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;OUTPUT asking about DBID:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;br /&gt;&lt;u&gt;RMAN-06495: must explicitly specify DBID with SET DBID command &lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;this is where this article stands firm.........&lt;br /&gt;Now , you have to set DBID first then try the above recovery stunts.Now ,it becomes a challenging task as we know DBID is stored in control file which we have already lost........&lt;br /&gt;&lt;br /&gt;So, is there a way out???&lt;br /&gt;Yes, Oracle can do almost everything........&lt;br /&gt;&lt;br /&gt;Let us check the following way to know &lt;u&gt;what is my database DBID&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;We can get &lt;u&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;ORACLE DATABASE DBID&lt;/span&gt;&lt;/u&gt; from :&lt;br /&gt;  &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;a) a rman autobackup file.(backup taken with control file autobackup on parameter)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  b) we can configure alert log file to store DBID regularly&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  c) we can retrieve DBID from a file dump&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  d) we can get DBID from rman output&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  &lt;/span&gt;&lt;br /&gt;  &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;In detail:&lt;/span&gt;&lt;/u&gt;&lt;br /&gt; &lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;a)DBID FROM CONTROL FILE AUTOBACKUP:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;  If  you choose to take rman control file autobackup on, then mention the format parameter with %F, so that it will generate the file name as %F, this %F parameter includes the DBID in the filename.&lt;br /&gt; &lt;br /&gt;ex: &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;%F maintains the c-IIIIIIIIII-YYYYMMDD-QQ format &lt;/span&gt;.&lt;br /&gt;        where  c    indicates that it is a control file backup&lt;br /&gt;               IIIIIIIIII   indicates DBID&lt;br /&gt;              YYYYMMDD   indicates the date backup was created&lt;br /&gt;              QQ   indicates a hex sequence number to make the filename unique on the same day&lt;br /&gt;             &lt;br /&gt;  &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;b)GET DBID FROM ALERT LOG FILE:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;    We can make sure that my database DBID is written to alert log file on regular basis with the help of a package named&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt; DBMS_SYSTEM .&lt;/span&gt;&lt;br /&gt;    To do that, include the following to your regular backup job or script:&lt;br /&gt;     &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;     COL dbid NEW_VALUE hold_dbid&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;     SELECT dbid FROM v$database;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;     exec dbms_system.ksdwrt(2,&#39;DBID: &#39;||TO_CHAR(&amp;amp;hold_dbid)); &lt;/span&gt;  &lt;br /&gt;   &lt;br /&gt;    after running this code, check your alert log now. you will get an entry like:&lt;br /&gt;  &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt; DBID: 396604920&lt;/span&gt;&lt;br /&gt;   &lt;br /&gt;  &lt;u&gt;c)DBID FROM A FILE DUMP:&lt;/u&gt;&lt;br /&gt;    Other way is, if any of the physical files(datafiles,logfiles,even archived log files) are available, we can extract the DBID to a trace file. More importantly, we dont need the database to be mounted for this:&lt;br /&gt;    example:&lt;br /&gt;   &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt; sql&gt; connect /@lion as sysdba&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;    sql&gt;startup nomount;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;    sql&gt;alter system dump datafile &#39;D:\lion\data\SYSTEM.DBF&#39; block min 1 block max 10;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now search the in the trace file generated in user_dump_dest location with the string &#39;Db ID&#39;. and you will get an entry like:&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Db ID=396604920=0x17a3b5f8, Db Name=&#39;LION&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;we can use the same syntax to make a dump of redo log files/archived log files as :&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;SQL&gt; alter system dump logfile &#39;&lt;file&gt;&#39;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;u&gt;d)DBID from RMAN output:&lt;/u&gt;&lt;br /&gt;  whenever you will connect to your target database rman utility, it will show the DBID as follows on the post connection output. see the following:(for this your database should be at least mounted,when you connect RMAN)&lt;br /&gt;  &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Rman&gt; connect target /@lion&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;connected to target database: LION (DBID=396604920, not open)&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;  So, you can view your previously rman output log files to get the DBID , as you surely have executed rman scripts earlier.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Rman uses DBID to identify a database uniquely. So, in control file recovery scenario,if your backups are not in default location or you dont have recovery catalog then rman cannot have the information , that which backup piece is appropriate for restore. So, it requieres DBID.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;have a nice day..............&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/4829055858549406694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/4829055858549406694?isPopup=true' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4829055858549406694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4829055858549406694'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/how-to-get-oracle-database-identifier.html' title='HOW TO GET ORACLE DATABASE IDENTIFIER (DBID)'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-5597086536745228395</id><published>2009-02-10T10:57:00.012+06:00</published><updated>2009-02-14T10:38:17.549+06:00</updated><title type='text'>Oracle: Create database manually (in windows/linux)</title><content type='html'>Let us check a demonstration of &lt;u&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;HOW TO CREATE AN ORACLE DATABASE MANUALLY:&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Note: Demonstration is on oracle 10G version. but the same will do for other versions also...almost....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;step 1:&lt;/span&gt; let us create the location for our database:&lt;br /&gt;My database name will be &#39;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;DEMO&lt;/span&gt;&#39; and the location is &#39;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo&lt;/span&gt;&#39;&lt;br /&gt;under &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo&lt;/span&gt; folder, i will create folder named......&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo\data&lt;/span&gt; (will store all of my datafiles)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo\pfile&lt;/span&gt; (will be my pfile location)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo\adump&lt;/span&gt; (will be my audit_dump_dest location)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo\bdump&lt;/span&gt; (will be my background_dump_dest location)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo\cdump&lt;/span&gt; (will be my core_dump_dest location)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;d:\demo\udump &lt;/span&gt;(will be my user_dump_dest location)&lt;br /&gt;if you want you can have another folder for flash recovery area (Oracle 10G onwards)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);&quot;&gt;step 2:&lt;/span&gt; now , let us copy a sample pfile from the existing running database and place it into &quot;d:\demo\pfile&quot; folder.&lt;br /&gt;&lt;br /&gt;&lt;a style=&quot;font-weight: bold;&quot; href=&quot;http://askershad.blogspot.com/2009/02/oracle-sample-pfile.html&quot; target=&quot;_blank&quot;&gt;CHECK THE SAMPLE PFILE&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the sample file do the required changes mentioned in &quot;&lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);&quot;&gt;BLUE&lt;/span&gt;&quot; color text and save the file.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;Note:&lt;/span&gt; remember the value of &lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-size:85%;&quot; &gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;undo_tablespace parameter in pfile&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;as we need to provide the same name for undo_tablespace when we will create the database.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 3:&lt;/span&gt; now we need to create the password file. we will use the orapwd utility for this.&lt;br /&gt;you will find this utility in $ORACLE_HOME\bin directory.&lt;br /&gt;so, lets proceed...&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;c:\ershad&gt;orapwd file=E:\oracle\product\10.2.0\db_1\database\pwddemo.ora password=tiger entries=5&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;here we have created a password file named pwddemo.ora under my $oracle_home. The password is tiger and maximum 5 user will be allowed to login as sysdba.&lt;br /&gt;&lt;br /&gt;What is a password file&lt;br /&gt;Create password file with ORAPWD utility&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 4: &lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;update your listener.ora and tnsnames.ora with only the &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;BLUE&lt;/span&gt; colored text here:&lt;br /&gt;          (copy &amp;amp; paste)&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;==&gt;in tnsnames.ora file:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;# tnsnames.ora Network Configuration File: E:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;# Generated by Oracle configuration tools.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;tiger =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;  (DESCRIPTION =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    (ADDRESS_LIST =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.4.12.242)(PORT = 1521))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    (CONNECT_DATA =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    (server=dedicated)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (SERVICE_NAME = tiger)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;  )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;demo=&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;  (DESCRIPTION =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;    (ADDRESS_LIST =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;      (ADDRESS = (PROTOCOL = TCP)(HOST = YOUR HOSTNAME/IP)(PORT = 1521))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;    (CONNECT_DATA =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;      (SERVICE_NAME =demo)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;  )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;==&gt;in listener.ora file:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;LISTENER =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;  (DESCRIPTION_LIST =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    (DESCRIPTION =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (ADDRESS_LIST =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;        (ADDRESS = (PROTOCOL = TCP)(HOST = dba2)(PORT = 1521))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (ADDRESS_LIST =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;  )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;SID_LIST_LISTENER =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;  (SID_LIST =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    (SID_DESC =&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (SID_NAME = PLSExtProc)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (ORACLE_HOME = e:\oracle\product\10.2.0\db_1)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (PROGRAM = extproc)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    (SID_DESC = &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (GLOBAL_DBNAME = tiger)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (ORACLE_HOME =e:\oracle\product\10.2.0\db_1)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;      (SID_NAME = tiger)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;   &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt; (SID_DESC = &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;      (GLOBAL_DBNAME = demo)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;      (ORACLE_HOME =e:\oracle\product\10.2.0\db_1)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;      (SID_NAME = demo)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;    )&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;  )&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 5:&lt;/span&gt; you need to create the service:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;C:\ershad&gt;oradim -new -sid demo -pfile d:\demo\pfile\initdemo.ora -startmode A&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 6:&lt;/span&gt; connect to the database:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;C:\ershad&gt;set oracle_sid=demo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;C:\ershad&gt;sqlplus / as sysdba&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; select status from v$instance;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;STATUS&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;STARTED&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;after connecting to database, if it shows &quot;connect to an idle instance&quot; , then you need to manually start up the database using the following:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;&quot;&gt;sql&gt;startup nomount pfile=d:\demo\pfile\initdemo.ora&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;step 7: &lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;run the create database script :&lt;br /&gt;       just copy the following into a file and run the file in sql prompt as follows...............&lt;br /&gt;&lt;br /&gt;content of create_database_script file:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;create database demo&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;logfile     group 1 (&#39;d:\demo\data\redo1.log&#39;) size 100M,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;            group 2 (&#39;d:\demo\data\redo2.log&#39;) size 100M,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;            group 3 (&#39;d:\demo\data\redo3.log&#39;) size 100M&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;datafile &#39;d:\demo\data\system.dbf&#39; size 100M autoextend on next 10M maxsize unlimited extent management local&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;sysaux datafile &#39;d:\demo\data\sysaux.dbf&#39; size 100M autoextend on next 10M maxsize unlimited&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;undo tablespace &lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;undodemo&lt;/span&gt; datafile &#39;d:\demo\data\undotbs1.dbf&#39; size 100M&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;default temporary tablespace temptiger tempfile &#39;d:\demo\data\temp01.dbf&#39; size 100M;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;so now,&lt;br /&gt;sql&gt;@d:\create_database_script&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Database created.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;Now, You need to run two scripts to create the dynamic views and enable pl/sql packages&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;put the database in oepn mode and run the following scripts:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;location of scripts are  &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&#39;$ORACLE_HOME\RDBMS\ADMIN&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; @E:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catalog.sql&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; @E:\oracle\product\10.2.0\db_1\RDBMS\ADMIN\catproc.sql&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;Your manually created database is ready to use now.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;HOW TO CREATE ORACLE DATABASE MANUALLY IN LINUX&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;perform all the steps previous except step 5. as in unix/linux ,no need to create the database service.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;thanks,&lt;br /&gt;have a nice day...........................&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 0); font-weight: bold;&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/5597086536745228395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/5597086536745228395?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/5597086536745228395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/5597086536745228395'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracle-create-database-manually-in_10.html' title='Oracle: Create database manually (in windows/linux)'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-3012682613814467747</id><published>2009-02-10T10:17:00.002+06:00</published><updated>2009-02-10T10:21:26.193+06:00</updated><title type='text'>Oracle: A sample pfile</title><content type='html'>&lt;span style=&quot;color: rgb(51, 51, 255);font-size:85%;&quot; &gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;let us check a sample pfile here, database name is  &#39;demo&#39; :&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;##############################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Copyright (c) 1991, 2001, 2002 by Oracle Corporation&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;##############################################################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Cache and I/O&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;db_block_size=8192&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;db_file_multiblock_read_count=16&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Cursors and Library Cache&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;open_cursors=300&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Database Identification&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;db_domain=&quot;&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;db_name=&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt;demo&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Diagnostics and Statistics&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;background_dump_dest=&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;d:\demo\bdump&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;core_dump_dest=&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;d:\demo\cdump&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;user_dump_dest=&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;d:\demo\udump&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# File Configuration&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;control_files=(&quot;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;d:\demo\data\control01.ctl&quot;, &quot;d:\demo\data\control02.ctl&quot;, &quot;d:\demo\data\control03.ctl&lt;/span&gt;&quot;)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Job Queues&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;job_queue_processes=10&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Miscellaneous&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;compatible=10.2.0.1.0&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Processes and Sessions&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;processes=150&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# SGA Memory&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;sga_target=571473920&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Security and Auditing&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;audit_file_dest=&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;d:\demo\adump&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;remote_login_passwordfile=EXCLUSIVE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Shared Server&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;dispatchers=&quot;(PROTOCOL=TCP) (SERVICE=&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;demo&lt;/span&gt;XDB)&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# Sort, Hash Joins, Bitmap Indexes&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;pga_aggregate_target=189792256&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;# System Managed Undo and Rollback Segments&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;###########################################&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;undo_management=AUTO&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;undo_tablespace=&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;UNDODEMO&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;thanks,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;have a nice day..............&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255); font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/3012682613814467747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/3012682613814467747?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3012682613814467747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3012682613814467747'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracle-sample-pfile.html' title='Oracle: A sample pfile'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-1644349702874912085</id><published>2009-02-10T09:52:00.003+06:00</published><updated>2009-02-10T10:01:10.951+06:00</updated><title type='text'>exp/imp vs expdp/impdp or datapump export/import feature  or difference between datapump and original export/import</title><content type='html'>prior to &lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;oracle 10G&lt;/span&gt;, the logical backup was taken through &lt;span style=&quot;font-weight: bold;&quot;&gt;EXP/IMP&lt;/span&gt; utility, which was the basic export/import utility till oracle 9i. Oracle has come with more powerful logical backup tool in oracle 10G. As we know about &lt;span style=&quot;font-weight: bold;&quot;&gt;datapump export/import&lt;/span&gt; utility.&lt;br /&gt;&lt;br /&gt;let us check the feature which enhances the datapump export/import over the original export/import&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;u&gt;expdp/impdp(datapump) vs exp/imp(basic one)&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;1)&lt;/span&gt; Impdp/Expdp uses parallel execution rather than a single stream of execution. this improved the task performance a lot.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;2)&lt;/span&gt; In Data Pump, expdp full=y and then impdp schemas=HR is same as of expdp schemas=HR and then impdp full=y where in original export/import does not always behave the same.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;3)&lt;/span&gt; in datapump Expdp/Impdp access files on the server rather than on the client.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;4)&lt;/span&gt; Data Pump represents metadata information in the dump file set as XML documents rather than as simple DDL commands.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;5) &lt;/span&gt;Datapump Impdp/Expdp has self-tuning abilities. Tuning parameters that were used in original Export and Import, such as RECORDLENGTH and BUFFER are not supported by&lt;br /&gt;Data Pump Export and Import.Not required is the perfect term to define.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;6)&lt;/span&gt; Datapump Expdp/Impdp operates on a group of files called a dump file set rather than on&lt;br /&gt;a single sequential dump file as exp/imp&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;7) &lt;/span&gt;Oracle data pump does not supports Sequential media, such as tapes and pipes.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;8)&lt;/span&gt; The way of transition of data between two different versions of oracle database is not same&lt;br /&gt;in expdp/impdp and exp/imp utility&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;9)&lt;/span&gt; When you are importing rows into an existing table using either APPEND or TRUNCATE&lt;br /&gt;using datapump, if any row violates an active constraint, the load is discontinued and no data is loaded.&lt;br /&gt;&lt;br /&gt;Original Import will  logs any rows that are in violation and continues the load process.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;10) &lt;/span&gt;Datapump expdp/impdp generates more undo than expdp/impdp&lt;br /&gt;&lt;br /&gt;Hope the information are useful....&lt;br /&gt;&lt;br /&gt;thanks,&lt;br /&gt;have a nice day.............&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/1644349702874912085/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/1644349702874912085?isPopup=true' title='45 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/1644349702874912085'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/1644349702874912085'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/expimp-vs-expdpimpdp-or-datapump.html' title='exp/imp vs expdp/impdp or datapump export/import feature  or difference between datapump and original export/import'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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>45</thr:total></entry><entry><id>tag:blogger.com,1999:blog-460925175086280617.post-7177778622509729388</id><published>2009-02-08T13:38:00.004+06:00</published><updated>2009-02-09T10:42:25.850+06:00</updated><title type='text'>Oracle:rman output to a file/V$rman_output/V$rman_status</title><content type='html'>When using rman utility , you may often need to store the rman activity log in a file. And normally we use various rman backup and recovery scripts on a scheduled time to run . so, we need to refer to log to find everything was ok at the scheduled time as i want.&lt;br /&gt;&lt;br /&gt;Although , whenever you run rman commands , it will automatically log the detail output of rman activity in a data dictionary file named as &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;V$rman_output.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; select * from v$rman_output;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;but as it is a dynamic view , so the contents will be washed out on restart of the database.&lt;br /&gt;&lt;br /&gt;so, a log file is safe to store the output of rman.let us check the following demonstration:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;RMAN&gt; spool log to &#39;c:\rman.log&#39;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; backup database;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; spool off;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Whatever statements you have issued in between spool and spool off will have there output stored in the destination file you have mentioned.As you see there is no output of backup database command on the screen.&lt;br /&gt;Let us check the log file now:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;c:\&gt;notepad &#39;c:\rman.log&#39;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Spooling started in log file: c:\rman.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Recovery Manager10.2.0.1.0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Starting backup at 08-FEB-09&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;using target database control file instead of recovery catalog&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;allocated channel: ORA_DISK_1&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;channel ORA_DISK_1: sid=143 devtype=DISK&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;channel ORA_DISK_1: starting full datafile backupset&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;channel ORA_DISK_1: specifying datafile(s) in backupset&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;input datafile fno=00001 name=D:\LION\DATA\SYSTEM.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;input datafile fno=00002 name=D:\LION\DATA\UNDOTBS1.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;input datafile fno=00003 name=D:\LION\DATA\SYSAUX.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;input datafile fno=00004 name=C:\DATA01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;input datafile fno=00005 name=C:\INDEX01.DBF&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;channel ORA_DISK_1: starting piece 1 at 08-FEB-09&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;channel ORA_DISK_1: finished piece 1 at 08-FEB-09&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;piece handle=E:\LION\BACKUPSET\2009_02_08\O1_MF_NNNDF_TAG20090208T150901_4RX89GOZ_.BKP tag=TAG20090208T150901 comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Finished backup at 08-FEB-09&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Starting Control File and SPFILE Autobackup at 08-FEB-09&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;piece handle=E:\LION\AUTOBACKUP\2009_02_08\O1_MF_S_678294567_4RX8B8MK_.BKP comment=NONE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Finished Control File and SPFILE Autobackup at 08-FEB-09&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00558: error encountered while parsing input commands&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-01009: syntax error: found &quot;off&quot;: expecting one of: &quot;log, msglog, trace&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-01007: at line 1 column 7 file: standard input&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00571: ===========================================================&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-00558: error encountered while parsing input commands&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-01009: syntax error: found &quot;;&quot;: expecting one of: &quot;allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, convert, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, flashback, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, switch, spool, startup, shutdown, send, show, test, transport, upgrade, unregister, validate&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN-01007: at line 1 column 10 file: standard input&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;so, hope it is ok&lt;br /&gt;remember one thing , if you run the same procedure again, it will overwrite the same file.&lt;br /&gt;to avoid this situation try the following:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; spool log to &#39;c:\rman.log&#39; append;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; backup database;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt; spool off;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you are running a rman script or cmdfile then  also in the file you can do the same.&lt;br /&gt;or you have another option like:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;rman&gt; rman target /@lion  cmdfile c:\rman.txt  log c:\rman.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to avoid overwriting ................&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;rman&gt; rman target /@lion  cmdfile c:\rman.txt  log c:\rman.log  append&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Note: You can check the job status of rman by quering the V$rman_status view also....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Have a nice day............................&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/7177778622509729388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/7177778622509729388?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/7177778622509729388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/7177778622509729388'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oraclerman-output-to.html' title='Oracle:rman output to a file/V$rman_output/V$rman_status'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-3649289021011656352</id><published>2009-02-08T11:41:00.004+06:00</published><updated>2009-02-08T16:27:49.968+06:00</updated><title type='text'>Oracle:Configure flash recovery area</title><content type='html'>in Oracle 10G, a major feature is flash recovery area.Flash recovery area contributes as a central repository for rman to store backups,archive logs. Even oracle recommends to keep your manual backups,archive logs,redo files to keep in FRA. We can keep control files also to this location.&lt;br /&gt;&lt;br /&gt;Let us check what are the effective way to configure FRA(&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;login as sysdba user&lt;/span&gt;):&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;step 1:&lt;/span&gt; To configure Flash recovery area , first you need to think about:&lt;br /&gt;             i) what will be the location&lt;br /&gt;            ii) what should be the size&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;step 2: &lt;/span&gt;&lt;br /&gt;          &lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;sql&gt;show parameter  log_archive_dest&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;           sql&gt;show parameter  log_archive_duplex_dest&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;           or&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;           sql&gt;show parameter log_archive_dest_&lt;/span&gt;&lt;br /&gt;                  (check for  the values for 1 to 10)&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;If this parameters have a value set then, you need to remove this values.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Normally we may have either log_archive_dest+log_archive_duplex_dest  or log_archive_dest_1 to 10 set as archive location. Both combination are not allowed together.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;any of these parameters , need to be removed to configure flash recovery area&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(255, 0, 0);&quot;&gt;&lt;br /&gt;&lt;u&gt;Note: You may have this values configured as your archive log location, we will discuss about this point later&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;u&gt;to remove the values:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; alter system set log_archive_duplex_dest = &#39;  &#39; scope=both;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt; alter system set log_archive_dest = &#39;  &#39; scope=both;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;for log_archive_dest_1 to 10 follow the same to remove the values.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;step 3:&lt;/span&gt; Issue the following command:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt;alter system set db_recovery_file_dest_size = 8G scope=both;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sql&gt;alter system set db_recovery_file_dest = &#39;e:\oracle\flasharea&#39; scope=both;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;Note: the directory &quot;e:\oracle\flasharea&quot; should exists .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, the note earlier about archive log location.&lt;br /&gt;if you have log_archive_dest as your archive log location , then change it to log_archive_dest_1 to store archive log.&lt;br /&gt;&lt;br /&gt;check this ,&lt;br /&gt;earlier location for archive log:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;SQL&gt;show parameter log_archive_dest&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;NAME                                 TYPE        VALUE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;------------------------------------ ----------- ----------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;log_archive_dest                     string      e:\archive&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;now change the value:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;sql&gt; alter system set log_archive_dest = &#39;  &#39; scope=both;&lt;br /&gt;then,&lt;br /&gt;SQL&gt; alter system set log_archive_dest_1 = &#39;location=e:\archive&#39;;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 102, 102);&quot;&gt;Note that , With flash recovery area configured we can keep the archive log in that location(as of oracle recommendation), though if you want above is the solution for using flash recovery area as well as different archive locations for archiving redo logs.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;Thanks,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;Have a nice day....................&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/3649289021011656352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/3649289021011656352?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3649289021011656352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/3649289021011656352'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracleconfigure-flash-recovery-area.html' title='Oracle:Configure flash recovery area'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-4827781088127753594</id><published>2009-02-08T10:37:00.003+06:00</published><updated>2009-02-08T16:04:19.143+06:00</updated><title type='text'>Oracle: foreign key syntax</title><content type='html'>let us check the syntax of foreign key with various options:&lt;br /&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;step 1)&lt;/span&gt; first we will create a primary key that will be referred in foreign key constraints:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;sys@LION&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;CREATE TABLE  ersh_tab&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;( emp_id  number(10)     not null,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  emp_name     varchar2(50)     not null,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  address     varchar2(50),     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  CONSTRAINT emp_id_pk PRIMARY KEY (emp_id)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Table created&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;step 2) &lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;We will configure the foreign key now.&lt;/span&gt;&lt;br /&gt;          &lt;u&gt;a) foreign key with create table option&lt;/u&gt;&lt;br /&gt;       sys@LION&gt; create table ersh_foreign_tab&lt;br /&gt;                              (id number(10) not null,&lt;br /&gt;                               email varchar2(32),&lt;br /&gt;                               constraint emp_id_fk foreign key (id) references ersh_tab(emp_id)&lt;br /&gt;                               );&lt;br /&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Table created&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;br /&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;u&gt;b) &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;foreign key with alter table option&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;        sys@LION&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;ALTER TABLE ersh_foreign_tab&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;                                    add CONSTRAINT emp_id_fk&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;                         FOREIGN KEY (id)&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt; REFERENCES  ersh_tab(emp_id);&lt;/span&gt;&lt;br /&gt;         &lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;Table altered&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;     &lt;br /&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;c)&lt;/span&gt;  &lt;span style=&quot;color: rgb(51, 102, 255);font-size:85%;&quot; &gt;Composite primary key with create table&lt;/span&gt;:&lt;/u&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;sys@LION&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;CREATE TABLE  ersh_tab&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;                          ( emp_id  number(10)     not null,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;                          emp_name     varchar2(50)     not null,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;                            address     varchar2(50),     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;                          CONSTRAINT emp_id_pk PRIMARY KEY (emp_id,emp_name)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;u&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;composite foreign key with create table option&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;sys@LION&gt; create table ersh_foreign_tab&lt;br /&gt;                              (id number(10) not null,&lt;br /&gt;                               email varchar2(32),&lt;br /&gt;                               constraint emp_id_fk foreign key (id,email) references ersh_tab(emp_id,email)&lt;br /&gt;                               );&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Have a nice day.................&lt;br /&gt;&lt;span style=&quot;font-size: 85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/4827781088127753594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/4827781088127753594?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4827781088127753594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/4827781088127753594'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracle-foreign-key-syntax.html' title='Oracle: foreign key syntax'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-6724065087605669026</id><published>2009-02-08T09:49:00.014+06:00</published><updated>2009-02-08T16:30:47.084+06:00</updated><title type='text'>Oracle: Rman show command parameters</title><content type='html'>to check the rman configuration settings, SHOW is very important . there is a lot of parameter that show supports. let us check one by one:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show all;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;using target database control file instead of recovery catalog&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE BACKUP OPTIMIZATION OFF; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO &#39;%F&#39;; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE MAXSETSIZE TO UNLIMITED; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ENCRYPTION FOR DATABASE OFF; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ENCRYPTION ALGORITHM &#39;AES128&#39;; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE SNAPSHOT CONTROLFILE NAME TO &#39;E:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFLION.ORA&#39;; # default&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;show all&lt;/span&gt; will show all the rman  configuration settings which include both the default settings as well as what you have configured . You can identify the default settings by &quot;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;# default&lt;/span&gt;&quot; at the end of every line.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show controlfile autobackup;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;br /&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;shows whether control file will be backup up automatically after any backup operation by rman.default value is OFF.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show archivelog deletion policy;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;shows the archive log detention policy.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show archivelog backup copies;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;shows the number of archivelog backup copies&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show auxname;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration has no stored or default parameters&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;shows the auxiliary database information.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show backup optimization;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE BACKUP OPTIMIZATION OFF; # default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;shows whether backup optimization is on or off.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show controlfile autobackup format;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO &#39;%F&#39;; # default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;shows what will be the format of auto backed up control file .&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show datafile backup copies;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;shows how many datafile backup copies will be kept by rman&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show default device type;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;shows whether the default device type is disk or tape&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show retention policy;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Shows policy for datafile and control file backups and copies that RMAN marks as obsolete.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show encryption algorithm;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ENCRYPTION ALGORITHM &#39;AES128&#39;; # default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;shows which encryption algorithm is currently is use.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;==&gt;RMAN&gt; show encryption for database;[or for tablespace]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE ENCRYPTION FOR DATABASE OFF; # default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;shows the encryption for the database or every tablespace.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;u&gt;More:&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;show exclude; &lt;/span&gt; (will show which tablespaces are excluded from backup)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;show maxsetsize;&lt;/span&gt; (shows the max size of backup set. the default is unlimited)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;show snapshot controlfile name;&lt;/span&gt; (shows the snapshot control file name)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;show compression algorithm;&lt;/span&gt; (shows compression algorithm . default is ZLIB)&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;show channel for device type disk;&lt;/span&gt; [device type sbt](shows the channel for device type)&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;NOTE:&lt;/span&gt; &lt;span style=&quot;color: rgb(51, 51, 255);font-size:85%;&quot; &gt;If you have changed the default value of any rman parameters , you can get the parameter name  and the values from v$rman_configuration view .&lt;br /&gt;ex:&lt;br /&gt;step 1: &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;br /&gt;RMAN&gt; show controlfile autobackup;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;br /&gt;RMAN configuration parameters are:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);font-size:85%;&quot; &gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;so, it is off now.and it is default&lt;/span&gt;&lt;br /&gt;step 2:&lt;br /&gt;sys@LION&gt; select * from v$rman_configuration;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;no rows selected&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;step 3:&lt;br /&gt;RMAN&gt; configure controlfile autobackup on;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;new RMAN configuration parameters:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;CONFIGURE CONTROLFILE AUTOBACKUP ON;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;new RMAN configuration parameters are successfully stored&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;Changing the default value off to on.&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;step 4:&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sys@LION&gt; select * from v$rman_configuration;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;  CONF# NAME                           VALUE&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;---------- ------------------------------ ------------------------------&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;         1 CONTROLFILE AUTOBACKUP         ON&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;So , hope it is clear now.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Thanks,&lt;br /&gt;have a nice day....&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/6724065087605669026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/6724065087605669026?isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6724065087605669026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6724065087605669026'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/oracle-rman-show-command-parameter.html' title='Oracle: Rman show command parameters'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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-460925175086280617.post-6340889481368199287</id><published>2009-02-07T16:30:00.009+06:00</published><updated>2009-02-07T17:02:51.700+06:00</updated><title type='text'>ORA-02273: this unique/primary key is referenced by some foreign keys</title><content type='html'>Problem occurs because you are trying to drop a primary constraints which has a dependent foreign key exist.&lt;br /&gt;let us check the demonstration:&lt;br /&gt;i will create  a table with primary key:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;sys@LION&gt;&lt;/span&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;CREATE TABLE  ersh_tab&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;( emp_id  number(10)     not null,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  emp_name     varchar2(50)     not null,&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  address     varchar2(50),     &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;  CONSTRAINT emp_id_pk PRIMARY KEY (emp_id)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now let us make a foreign key relationship depending on this table:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sys@LION&gt; create table opt (id number(30),emp_mail varchar2(50),constraint opt_id_fk foreign key(id) references ersh_tab(emp_id));&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;Now i will try to drop the primary key constraints, which is emp_id_pk:&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sys@LION&gt; alter table ersh_tab drop constraint emp_id_pk;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;alter table ersh_tab drop constraint emp_id_pk&lt;/span&gt; &lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;                                     *&lt;/span&gt; &lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;ERROR at line 1:&lt;/span&gt; &lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;ORA-02273: this unique/primary key is referenced by some foreign keys&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 51); font-weight: bold;&quot;&gt;&lt;u&gt;solution is :&lt;/u&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;first drop the foreign key constraint then the primary one :&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;sys@LION&gt; alter table opt drop constraint opt_id_fk;&lt;/span&gt;&lt;br /&gt;then,&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;sys@LION&gt; alter table ersh_tab drop constraints emp_id_pk;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;or to do it in one shot , you can try the following:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;sys@LION&gt; alter table ersh_tab drop constraints emp_id_pk cascade;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;it will drop the dependent constraints also automatically.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Note :&lt;/span&gt; you can get the dependency information from dba_constraints/user_constraints/all_constraints view .&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;span style=&quot;color: rgb(204, 153, 51);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;a href=&quot;http://askershad.blogspot.com/2009/02/oracleprimary-key-syntax.html&quot; target=&quot;_blank&quot;&gt;MORE ABOUT PRIMARY KEY&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;br /&gt;thanks,&lt;br /&gt;Have a nice day .............&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot;font-family:Verdana, Arial, Helvetica, sans-serif;&quot;&gt;He                            who has never learned to obey&lt;br /&gt;                          cannot be a good commander.&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family:Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;                          Aristotle&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(51, 51, 51);&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;YOU CAN CONSULT OR SHARE YOUR DOUBTS WITH US AT askershad@gmail.com
Thanks for your contribution to community&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://askershad.blogspot.com/feeds/6340889481368199287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/460925175086280617/6340889481368199287?isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6340889481368199287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/460925175086280617/posts/default/6340889481368199287'/><link rel='alternate' type='text/html' href='http://askershad.blogspot.com/2009/02/ora-02273-this-uniqueprimary-key-is.html' title='ORA-02273: this unique/primary key is referenced by some foreign keys'/><author><name>ASKERSHAD</name><uri>http://www.blogger.com/profile/17065456408402158811</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>