<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Passion for technology</title>
	<atom:link href="http://oramasters.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://oramasters.com</link>
	<description>Challenging the challenges over a decade. Place for Oracle DBAs, Oracle Apps DBAs, Unix Administrators and Developers</description>
	<lastBuildDate>Sun, 08 Apr 2012 00:58:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='oramasters.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Passion for technology</title>
		<link>http://oramasters.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://oramasters.com/osd.xml" title="Passion for technology" />
	<atom:link rel='hub' href='http://oramasters.com/?pushpress=hub'/>
		<item>
		<title>Performance Tuning Scripts</title>
		<link>http://oramasters.com/2012/03/20/performance-tuning-scripts/</link>
		<comments>http://oramasters.com/2012/03/20/performance-tuning-scripts/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 21:51:17 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=444</guid>
		<description><![CDATA[To see username, machine name, program and read etc. ======== select  s.sid, s.username, s.osuser, s.status, s.program, i.consistent_gets, i.physical_reads, round(( i.physical_reads / i.consistent_gets ),2) * 100 pct_misses, a.sql_text from v$session s, v$sqlarea a, v$sess_io i where i.sid = s.sid and   i.consistent_gets != 0 and   a.address         = s.sql_address and   a.hash_value      = s.sql_hash_value having  round(( i.physical_reads / i.consistent_gets [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=444&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To see username, machine name, program and read etc.</p>
<p>========</p>
<p>select  s.sid,<br />
s.username,<br />
s.osuser,<br />
s.status,<br />
s.program,<br />
i.consistent_gets,<br />
i.physical_reads,<br />
round(( i.physical_reads / i.consistent_gets ),2) * 100 pct_misses,<br />
a.sql_text<br />
from v$session s,<br />
v$sqlarea a,<br />
v$sess_io i<br />
where i.sid = s.sid<br />
and   i.consistent_gets != 0<br />
and   a.address         = s.sql_address<br />
and   a.hash_value      = s.sql_hash_value<br />
having  round(( i.physical_reads / i.consistent_gets ),2) * 100 &gt; 30<br />
group by<br />
a.sql_text,<br />
s.sid,<br />
s.username,<br />
s.osuser,<br />
s.status,<br />
s.program,<br />
i.consistent_gets,<br />
i.physical_reads;<br />
=============<br />
SCRIPT TO FIND LONG RUNNING QUERIES.<br />
=============</p>
<p>rem LONGOPS.SQL<br />
rem Long Running Statements<br />
rem Helmut Pfau, Oracle Deutschland GmbH<br />
set linesize 120<br />
col opname format a20<br />
col target format a15<br />
col units format a10<br />
col time_remaining format 99990 heading Remaining[s]<br />
col bps format 9990.99 heading [Units/s]<br />
col fertig format 90.99 heading &#8220;complete[%]&#8220;<br />
select sid,<br />
opname,<br />
target,<br />
sofar,<br />
totalwork,<br />
units,<br />
(totalwork-sofar)/time_remaining bps,<br />
time_remaining,<br />
sofar/totalwork*100 fertig<br />
from   v$session_longops<br />
where  time_remaining &gt; 0<br />
/</p>
<p>&nbsp;</p>
<p>==============</p>
<p>LOG SWITCH PER HOUR</p>
<p>==============</p>
<p>alter  session  set nls_date_format = &#8216;DD.MM.YYYY:HH24:MI&#8217;;</p>
<p>ttitle left &#8216;Redolog File Status from V$LOG&#8217; skip 2</p>
<p>select    group#,  sequence#,   Members, archived,  status,  first_time  from  v$log;</p>
<p>ttitle left &#8216;Number of Logswitches per Hour&#8217; skip 2</p>
<p>select<br />
substr(completion_time,1,5) day,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;00&#8242;,1,0)),&#8217;99&#8242;) &#8220;00&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;01&#8242;,1,0)),&#8217;99&#8242;) &#8220;01&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;02&#8242;,1,0)),&#8217;99&#8242;) &#8220;02&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;03&#8242;,1,0)),&#8217;99&#8242;) &#8220;03&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;04&#8242;,1,0)),&#8217;99&#8242;) &#8220;04&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;05&#8242;,1,0)),&#8217;99&#8242;) &#8220;05&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;06&#8242;,1,0)),&#8217;99&#8242;) &#8220;06&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;07&#8242;,1,0)),&#8217;99&#8242;) &#8220;07&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;08&#8242;,1,0)),&#8217;99&#8242;) &#8220;08&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;09&#8242;,1,0)),&#8217;99&#8242;) &#8220;09&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;10&#8242;,1,0)),&#8217;99&#8242;) &#8220;10&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;11&#8242;,1,0)),&#8217;99&#8242;) &#8220;11&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;12&#8242;,1,0)),&#8217;99&#8242;) &#8220;12&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;13&#8242;,1,0)),&#8217;99&#8242;) &#8220;13&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;14&#8242;,1,0)),&#8217;99&#8242;) &#8220;14&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;15&#8242;,1,0)),&#8217;99&#8242;) &#8220;15&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;16&#8242;,1,0)),&#8217;99&#8242;) &#8220;16&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;17&#8242;,1,0)),&#8217;99&#8242;) &#8220;17&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;18&#8242;,1,0)),&#8217;99&#8242;) &#8220;18&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;19&#8242;,1,0)),&#8217;99&#8242;) &#8220;19&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;20&#8242;,1,0)),&#8217;99&#8242;) &#8220;20&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;21&#8242;,1,0)),&#8217;99&#8242;) &#8220;21&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;22&#8242;,1,0)),&#8217;99&#8242;) &#8220;22&#8243;,<br />
to_char(sum(decode(substr(completion_time,12,2),&#8217;23&#8242;,1,0)),&#8217;99&#8242;) &#8220;23&#8243;<br />
from<br />
V$ARCHIVED_LOG<br />
group by<br />
substr(completion_time,1,5)<br />
/</p>
<p>&nbsp;</p>
<p>==========<br />
&#8211; %Purpose: Monitor Private SQL Areas and PL/SQL space in the UGA and SGA<br />
&#8211;           PL/SQL allocates most memory from the UGA which is  located in the SGA when shared servers are used<br />
&#8211;           UGA = User Global Area<br />
&#8211;           SGA = System Global Area<br />
=========<br />
&#8211;<br />
set feed off;<br />
set pagesize 10000;<br />
set wrap off;<br />
set linesize 200;<br />
set heading on;<br />
set tab on;<br />
set scan on;<br />
set verify off;<br />
set termout on;</p>
<p>column  NA          head &#8216;STATISTIC&#8217;    format a29<br />
column  NR_SESS     head &#8216;#USERS&#8217;       format 9999<br />
column  C1          head &#8216;SUM|[kbyte]&#8216;  format 999990.90<br />
column  C2          head &#8216;AVG|[kbyte]&#8216;  format 999990.90<br />
column  C3          head &#8216;MIN|[kbyte]&#8216;  format 999990.90<br />
column  C4          head &#8216;MAX|[kbyte]&#8216;  format 999990.90</p>
<p>ttitle  left   &#8216;Monitor Private SQL Areas and PL/SQL space&#8217;    skip 2</p>
<p>select<br />
rpad (B.NAME, 29, &#8216;.&#8217;)  as NA,<br />
COUNT(*) as NR_SESS,<br />
SUM(A.VALUE)/1024.0 as C1,<br />
AVG(A.VALUE)/1024.0 as C2,<br />
MIN(A.VALUE)/1024.0 as C3,<br />
MAX(A.VALUE)/1024.0 as C4<br />
from<br />
V$SESSTAT  A,<br />
V$STATNAME B<br />
where<br />
A.STATISTIC# = B.STATISTIC#<br />
and  (B.NAME like &#8216;%pga%&#8217;<br />
or  B.NAME like &#8216;%uga%&#8217;<br />
or  B.NAME like &#8216;%stored%&#8217;)<br />
group  by<br />
B.NAME<br />
/</p>
<p>&nbsp;<br />
=============<br />
Top 10 by Buffer Gets:<br />
=============</p>
<p>set linesize 100<br />
set pagesize 100<br />
SELECT * FROM<br />
(SELECT substr(sql_text,1,350) sql,<br />
buffer_gets, executions, buffer_gets/executions &#8220;Gets/Exec&#8221;,<br />
hash_value,address<br />
FROM V$SQLAREA<br />
WHERE buffer_gets &gt; 10000<br />
ORDER BY buffer_gets DESC)<br />
WHERE rownum &lt;= 10<br />
;</p>
<p>================<br />
Top 10 by Physical Reads:<br />
=============</p>
<p>set linesize 100<br />
set pagesize 100<br />
SELECT * FROM<br />
(SELECT substr(sql_text,1,350) sql,<br />
disk_reads, executions, disk_reads/executions &#8220;Reads/Exec&#8221;,<br />
hash_value,address<br />
FROM V$SQLAREA<br />
WHERE disk_reads &gt; 1000<br />
ORDER BY disk_reads DESC)<br />
WHERE rownum &lt;= 10<br />
;</p>
<p>============<br />
Top 10 by Executions:<br />
===========</p>
<p>set linesize 100<br />
set pagesize 100<br />
SELECT * FROM<br />
(SELECT substr(sql_text,1,350) sql,<br />
executions, rows_processed, rows_processed/executions &#8220;Rows/Exec&#8221;,<br />
hash_value,address<br />
FROM V$SQLAREA<br />
WHERE executions &gt; 100<br />
ORDER BY executions DESC)<br />
WHERE rownum &lt;= 10<br />
;</p>
<p>===============<br />
Top 10 by Parse Calls:<br />
===============</p>
<p>set linesize 100<br />
set pagesize 100<br />
SELECT * FROM<br />
(SELECT substr(sql_text,1,350) sql,<br />
parse_calls, executions, hash_value,address<br />
FROM V$SQLAREA<br />
WHERE parse_calls &gt; 1000<br />
ORDER BY parse_calls DESC)<br />
WHERE rownum &lt;= 10<br />
;</p>
<p>=================<br />
Top 10 by Sharable Memory:<br />
==============</p>
<p>set linesize 100<br />
set pagesize 100<br />
SELECT * FROM<br />
(SELECT substr(sql_text,1,350) sql,<br />
sharable_mem, executions, hash_value,address<br />
FROM V$SQLAREA<br />
WHERE sharable_mem &gt; 1048576<br />
ORDER BY sharable_mem DESC)<br />
WHERE rownum &lt;= 10<br />
;</p>
<p>=========<br />
Top 10 by Version Count:<br />
===========</p>
<p>set linesize 100<br />
set pagesize 100<br />
SELECT * FROM<br />
(SELECT substr(sql_text,1,350) sql,<br />
version_count, executions, hash_value,address<br />
FROM V$SQLAREA<br />
WHERE version_count &gt; 20<br />
ORDER BY version_count DESC)<br />
WHERE rownum &lt;= 10<br />
;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/444/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=444&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2012/03/20/performance-tuning-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title></title>
		<link>http://oramasters.com/2012/01/05/385/</link>
		<comments>http://oramasters.com/2012/01/05/385/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 17:10:22 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=385</guid>
		<description><![CDATA[=========== Small script: It will delete the audit files older than 90 days. =========== [oracle@LONDT778W-D4 ~]$ cat test_aud_del.sh #!/usr/bin/ksh ORACLE_SID=SANJAY export ORACLE_SID ORACLE_HOME=/sanjay/sw/oracle/database/11.2.0.2 export ORACLE_HOME LOGFILE=&#8221;/tmp/delete_old_aud.log&#8221; echo `date` &#62;&#62;$LOGFILE if [ $ORACLE_SID = "SANJAY" ] &#62;&#62;$LOGFILE then echo &#8220;Deleting the audit files older than 90 days for database `echo $ORACLE_SID`&#8221; &#62;&#62;$LOGFILE echo &#8220;Audit files older [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=385&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>===========<br />
<strong>Small script: It will delete the audit files older than 90 days.</strong><br />
===========</p>
<p>[oracle@LONDT778W-D4 ~]$ cat test_aud_del.sh<br />
#!/usr/bin/ksh</p>
<p>ORACLE_SID=SANJAY<br />
export ORACLE_SID<br />
ORACLE_HOME=/sanjay/sw/oracle/database/11.2.0.2<br />
export ORACLE_HOME</p>
<p>LOGFILE=&#8221;/tmp/delete_old_aud.log&#8221;</p>
<p> echo `date` &gt;&gt;$LOGFILE<br />
if  [ $ORACLE_SID = "SANJAY" ]  &gt;&gt;$LOGFILE<br />
then</p>
<p> echo &#8220;Deleting the audit files older than 90 days for database `echo $ORACLE_SID`&#8221; &gt;&gt;$LOGFILE</p>
<p> echo &#8220;Audit files older than 90 days are: `find /sanjay/sw/oracle/database/admin/SANJAY/adump/*.aud -type f -mtime +90| wc -l`&#8221; &gt;&gt;$LOGFILE</p>
<p>find /sanjay/sw/oracle/database/admin/SANJAY/adump/*.aud -type f -mtime +90 -ls -exec rm {} \;</p>
<p> echo &#8220;Space usage at this moment is:<br />
`df -h /sanjay/sw/oracle/`&#8221; &gt;&gt;$LOGFILE<br />
else<br />
echo &#8220;Environment is not set properly&#8221; &gt;&gt;$LOGFILE</p>
<p>fi<br />
exit</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/385/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/385/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/385/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=385&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2012/01/05/385/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>Unix Script Part-1</title>
		<link>http://oramasters.com/2011/12/13/unix-script-part-1/</link>
		<comments>http://oramasters.com/2011/12/13/unix-script-part-1/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 22:59:31 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=364</guid>
		<description><![CDATA[How to create a shell script in unix. open a file in vi editor and save it with .sh extention to run in backgrougn use nohup sh filename.sh &#38; to see the job status $jobs ( it will show runing or done etc) to bring/send in forward/background. ctrl+z fg ctrl +z bg below is a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=364&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>How to create a shell script in unix.</strong></p>
<p>open a file in vi editor and save it with .sh extention<br />
to run in backgrougn use nohup sh filename.sh &amp;<br />
to see the job status $jobs ( it will show runing or done etc)<br />
to bring/send in forward/background. ctrl+z fg ctrl +z bg</p>
<p><strong>below is a very simple example to start shell script.<br />
</strong><br />
&#8220;SHELL=/bin/ksh<br />
export SHELL<br />
export ORACLE_SID=instance_name<br />
export ORACLE_HOME=/oraclehome ( can try $ORACLE_HOME also).<br />
export ORACLE_BASE=/oraclebase<br />
sqlplus /nolog &lt;<br />
connect username/password@instance_name<br />
write full command here ;<br />
exit ;</p>
<p><strong>For example if you want to delete files older than 30 days.</strong></p>
<p>find /u1/database/prod/udump/ -type f -mtime +30 -exec rm {} \;</p>
<p>Or as bash script:<br />
Code:<br />
#!/bin/bash</p>
<p>find /u1/database/prod/arch -type f -mtime +30 -exec rm {} \;<br />
The only 2 commands used are find and rm.</p>
<p>Find looks for files older then 30 days (-type f -mtime +30). All its findings are given to rm (-exec rm {} \; ).</p>
<p>You can place the rm statement outside of find, which is supposed to be faster:</p>
<p>find /u1/database/prod/arch -type f -mtime +3 | xargs rm</p>
<p><strong>Now you can crontab it to remove old files (more than 30 days) in a script.</strong></p>
<p>&#8220;[contact-form]</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=364&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/12/13/unix-script-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>Unix Command building</title>
		<link>http://oramasters.com/2011/12/13/unix-command-building/</link>
		<comments>http://oramasters.com/2011/12/13/unix-command-building/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 22:51:12 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=360</guid>
		<description><![CDATA[&#62;ps –ef&#124;grep “ora_”&#124;grep –v grep&#124;grep $ORACLE_SID&#124;awk ‘{print $2}’&#124;xargs kill –9 We ‘ll walk through the process of building the command. To begin, we want to get a list of active processes on the server. We can do that using the following command: &#62;ps –ef If we execute ps –ef on our server, we’ ll see [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=360&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&gt;ps –ef|grep “ora_”|grep –v grep|grep $ORACLE_SID|awk ‘{print $2}’|xargs kill –9											</p>
<p>We ‘ll walk through the process of building the command. To begin, we want to get a list of active processes on the server. We can do that using the following command:											</p>
<p>&gt;ps –ef											</p>
<p>If we execute ps –ef on our server, we’ ll see a long list of processes &#8211;  both for Oracle and for many other things. However, we want to limit your output to only those processes that are related to the Oracle Database. The grep command can be used to do this. Oracle background process names always begin with “ora_”, so piping the output of ps –ef through grep “ora_” will remove all but the Oracle background processes. For example:											</p>
<p>&gt;ps –ef |grep “ora_”<br />
	oracle	12011	1	0	06-Dec	…	ora_dbwr_JAP<br />
	oracle	12789	20202	0	12:10:55	00:00	grep ora_<br />
	oracle	13202	1	0	06-Dec	…	ora_smon_JAP<br />
	oracle	14983	1	0	06-Dec	…	ora_arch_JAP<br />
	oracle	10209	1	0	06-Dec	…	ora_pmon_JAP<br />
	oracle	2090	1	0	06-Dec	…	ora_reco_JAP<br />
	oracle	10404	1	0	06-Dec	…	ora_lgwr_JAP<br />
	oracle	10403	1	0	06-Dec	…	ora_dbwr_TEST<br />
	oracle	10401	1	0	06-Dec	…	ora_lgwr_TEST				</p>
<p>In the above output as we can see it includes the process that’s running grep command. Pipe this output through grep –v grep to remove the grep command, so you don’t kill your own process. T											</p>
<p>&gt;ps –ef |grep “ora_”|grep –v grep<br />
	oracle	12011	1	0	06-Dec	…	ora_dbwr_JAP<br />
	oracle	13202	1	0	06-Dec	…	ora_smon_JAP<br />
	oracle	14983	1	0	06-Dec	…	ora_arch_JAP<br />
	oracle	10209	1	0	06-Dec	…	ora_pmon_JAP<br />
	oracle	2090	1	0	06-Dec	…	ora_reco_JAP<br />
	oracle	10404	1	0	06-Dec	…	ora_lgwr_JAP<br />
	oracle	10403	1	0	06-Dec	…	ora_dbwr_TEST<br />
	oracle	10401	1	0	06-Dec	…	ora_lgwr_TEST				</p>
<p>Next, we should filter out all processes except those for the current ORACLE_SID. That way we delete the background processes only for that one instance instead of for all instances (if there are multiple database instance running). Do that by grepping for the SID name:											</p>
<p>&gt;ps –ef |grep “ora_”|grep –v grep|grep $ORACLE_SID<br />
	oracle	12011	1	0	06-Dec	…	ora_dbwr_JAP<br />
	oracle	13202	1	0	06-Dec	…	ora_smon_JAP<br />
	oracle	14983	1	0	06-Dec	…	ora_arch_JAP<br />
	oracle	10209	1	0	06-Dec	…	ora_pmon_JAP<br />
	oracle	2090	1	0	06-Dec	…	ora_reco_JAP<br />
	oracle	10404	1	0	06-Dec	…	ora_lgwr_JAP				</p>
<p>Now that we have an accurate list of processes that you want to kill, you can use the awk command to get the process ID (PID) for each of these processes. The PID is in the second column, so we will use the awk ‘{print $2}’ command to display only that column:											</p>
<p>&gt;ps –ef |grep “ora_”|grep –v grep|grep $ORACLE_SID|awk ‘{print $2}’<br />
12011<br />
13202<br />
14983<br />
10209<br />
2090<br />
10404											</p>
<p>Now we have a list of process Id numbers for the Oracle background processes. For the last step, we use the xargs command to pipe the list of PIDs to the kill command. For example:											</p>
<p>&gt;ps –ef |grep “ora_”|grep –v grep|grep $ORACLE_SID|awk ‘{print $2}’|xargs kill –9<br />
Now that we’ve created this compound command, we can assign it to a Unix alias or we can put it in a file and make it a shell script so that we can execute it with a single short command.											</p>
<p>===================<br />
Find command usage:<br />
===================</p>
<p>The Simplest Example<br />
To print the names of all of the files in the directory and all subdirectories<br />
find . -print<br />
find ~ ~barnett /usr/local -print<br />
find ~ ~barnett /usr/local -print<br />
find / -print</p>
<p><strong>Using find with other commands</strong></p>
<p>ls -ld `find . -print`</p>
<p><strong>Using xargs with find</strong></p>
<p>ls -ld `find / -print`</p>
<p>find / -print | xargs ls -ld</p>
<p><strong>Looking for files with particular names<br />
</strong></p>
<p>find . -name *.o -print<br />
find . -name &#8216;*.o&#8217; -print<br />
find . -name &#8216;[a-zA-Z]*.o&#8217; -print</p>
<p><strong>Looking for files by type</strong></p>
<p>find . -type f -print | xargs ls -l</p>
<p>find . -type l -print | xargs ls -ld | awk &#8216;{print $10}&#8217;</p>
<p><strong>Looking for files by sizes</strong></p>
<p>find . -size 27 -print</p>
<p>find . -size +10000c -size -32000c -print</p>
<p><strong>Searching for old files</strong></p>
<p>find . -mtime 7 -print</p>
<p>find . -mtime +6 -mtime -8 -print</p>
<p>find . -type f -atime +30 -print</p>
<p><strong>Searching for files by permission</strong></p>
<p>find . -name *.o -perm 664 -print</p>
<p>find . -type d -perm 777 -print</p>
<p>find . -perm -20 -print</p>
<p>find . -perm -100 -print</p>
<p><strong>Owners and groups<br />
</strong></p>
<p>find . -user root -perm -4000 -print</p>
<p>find . -group staff -perm -2000 -print</p>
<p>find . -user 0 -perm -4000 -print<br />
find . -group 10 -perm -2000 -print</p>
<p><strong>Find and commands</strong></p>
<p>find . -ls</p>
<p>find . -print | xargs ls -gilds</p>
<p><strong>Find and Cpio</strong></p>
<p>find . -depth -cpio &gt;/dev/rmt0<br />
find . -depth -ncpio &gt;/dev/rmt0<br />
find . -depth -print | cpio -oB &gt;/dev/rmt0<br />
find . -depth -print | cpio -ocB &gt;/dev/rmt0</p>
<p><strong>Using Find to Execute Commands</strong></p>
<p>find . -exec echo {} ;</p>
<p>find . -exec echo {} &#8216;;&#8217;</p>
<p>find `pwd` -group staff -exec find {} -type l -print ;</p>
<p>find . -perm -20 -exec chmod g-w {} ;</p>
<p>or<br />
find . -perm -20 -print | xargs chmod g-w</p>
<p>find . -inum 31246 -exec rm [] &#8216;;&#8217;</p>
<p><strong>File comparisons</strong></p>
<p>find /usr -newer /usr/FirstFile -print</p>
<p><strong>Expressions</strong></p>
<p>find /usr ! -newer /FirstFile -print<br />
&#8220;find . ( -name a.out -o -name *.o ) -print<br />
&#8220;</p>
<p><strong>Keeping find from going too far</strong></p>
<p>find * -type f -print -o -type d -prune</p>
<p>find . -print -o -name SCCS -prune</p>
<p>&#8220;[contact-form] </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/360/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/360/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/360/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=360&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/12/13/unix-command-building/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>RMAN Part-2</title>
		<link>http://oramasters.com/2011/12/03/rman-part-2/</link>
		<comments>http://oramasters.com/2011/12/03/rman-part-2/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 19:09:32 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[Backup and Recovery]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=356</guid>
		<description><![CDATA[======== Rman can back up the following types of files: ========= • Archived redo log files • Backup pieces • Control files • Datafiles Spfile • spfile. Note: It is ABCDS RMAN will back up full backups, incremental backups, control file autobackups, and archive redo log files. Keep in mind that flashback logs, online redo [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=356&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>========<br />
<strong>Rman can back up the following types of files:</strong><br />
=========</p>
<p>• Archived redo log files<br />
• Backup pieces<br />
• Control files<br />
• Datafiles Spfile<br />
• spfile.</p>
<p>Note: It is ABCDS</p>
<p>RMAN will back up full backups, incremental backups, control file autobackups, and archive redo<br />
log files. Keep in mind that flashback logs, online redo log files, and the current control file are not backed up.</p>
<p>Note:  Always enable the autobackup for spfile (only backed up if db starting using spfile) and control file feature.<br />
=====</p>
<p>RMAN&gt; configure controlfile autobackup on;</p>
<p>RMAN&gt; configure spfile autobackup on;</p>
<p>========</p>
<p>How to configure RMAN to write to specific locations on disk.</p>
<p>RMAN&gt; configure channel 1 device type disk format &#8216;/ora01/rman/rman1_%U.bk&#8217;;</p>
<p>Note: CONFIGURE command must be executed before you run the BACKUP command.</p>
<p>=========<br />
<strong>Backup Database.</strong><br />
=========</p>
<p>The term &#8220;RMAN level 0 incremental backup&#8221; doesn&#8217;t exactly describe itself very well, either. A level<br />
0 incremental backup is backing up the exact same blocks as a full backup. In other words, the following<br />
two commands back up the exact same blocks in a database:</p>
<p>RMAN&gt; backup as backupset full database;</p>
<p>RMAN&gt; backup as backupset incremental level=0 database;</p>
<p>RMAN&gt; backup database not backed up since time=&#8217;sysdate-1&#8242;;</p>
<p>RMAN&gt; backup database skip readonly skip offline skip inaccessible;  backup database skip offline;</p>
<p>RMAN&gt; backup database skip readonly;</p>
<p>RMAN&gt; backup database skip inaccessible;</p>
<p>&#8212;&#8212;&#8212;&#8212;-</p>
<p>Backup Sets versus Image Copies</p>
<p>The default backup mode of RMAN instructs it to only back up blocks that have been used in a datafile;<br />
these are known as backup sets. RMAN can also make byte-for-byte copies of the datafiles; these are<br />
known as image copies. Creating a backup set is the default type of backup that RMAN creates. The next<br />
command creates a backup set backup of the database:</p>
<p>RMAN&gt; backup database;   backup as backupset database;</p>
<p>You can instruct RMAN to create image copies by using the AS COPY command. The following<br />
creates image copies of every datafile in the database:</p>
<p>RMAN&gt; backup as copy database;  backup incremental level=0 database plus archivelog;</p>
<p>=======<br />
<strong>Backup tablespace.</strong><br />
======</p>
<p>RMAN&gt; backup tablespace system, sysaux;</p>
<p>RMAN&gt; configure exclude for tablespace users;  configure exclude for tablespace users clear; &lt;== to clear the excluded tablespace.</p>
<p>=======<br />
<strong>Backup datafile.</strong><br />
======</p>
<p>RMAN&gt; backup datafile &#8216;/app/sanjay/11R2/system01.dbf&#8217;;</p>
<p>RMAN&gt; backup datafile 1,5;</p>
<p>RMAN&gt; backup as copy datafile 3;</p>
<p>RMAN&gt; backup incremental level 1 datafile 4;</p>
<p>RMAN&gt; backup database not backed up; &lt;== To backup the datafile not backed up.</p>
<p>=======<br />
<strong>Backup controlfile.</strong><br />
======</p>
<p>RMAN&gt; backup current controlfile;</p>
<p>RMAN&gt; configure controlfile autobackup format for device type disk to &#8216;/app/sanjay/rman/rman_ctl_%F.bk&#8217;;</p>
<p>=======<br />
<strong>Backup spfile.</strong><br />
======</p>
<p>RMAN&gt; backup spfile;</p>
<p>Note: RMAN can only back up the spfile if the instance was started using a spfile.</p>
<p>=========<br />
<strong>Backup Archive logs.</strong><br />
=========</p>
<p>RMAN&gt; backup archivelog all;</p>
<p>RMAN&gt; backup archivelog all delete input;</p>
<p>RMAN&gt; backup archivelog sequence 300;</p>
<p>RMAN&gt; backup archivelog sequence between 300 and 400 thread 1;</p>
<p>RMAN&gt; backup archivelog from time &#8220;sysdate-7&#8243; until time &#8220;sysdate-1&#8243;;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=356&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/12/03/rman-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>OEM</title>
		<link>http://oramasters.com/2011/11/06/oem/</link>
		<comments>http://oramasters.com/2011/11/06/oem/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 19:08:55 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[OEM]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=338</guid>
		<description><![CDATA[OEM 11g Docs http://download.oracle.com/docs/cd/E11857_01/index.htm OEM 10g Docs http://download.oracle.com/docs/cd/B16240_01/doc/install.102/e10953/toc.htm &#8221;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=338&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OEM 11g Docs</p>
<p>http://download.oracle.com/docs/cd/E11857_01/index.htm</p>
<p>OEM 10g Docs</p>
<p>http://download.oracle.com/docs/cd/B16240_01/doc/install.102/e10953/toc.htm</p>
<p>&#8220;[contact-form] </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/338/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/338/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/338/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=338&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/11/06/oem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>PL/SQL Part-1</title>
		<link>http://oramasters.com/2011/10/12/324/</link>
		<comments>http://oramasters.com/2011/10/12/324/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 10:35:38 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=324</guid>
		<description><![CDATA[What is PL/SQL? PL/SQL stands for Procedural Language extension of SQL. PL/SQL is a combination of SQL along with the procedural features of programming languages. It was developed by Oracle Corporation to enhance the capabilities of SQL. What is PL/SQL Engine? Oracle uses PL/SQL engine to processes the PL/SQL statements, A PL/SQL code can be [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=324&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What is PL/SQL?</p>
<p>PL/SQL stands for Procedural Language extension of SQL. PL/SQL is a combination of SQL along with the procedural features of programming languages. It was developed by Oracle Corporation to enhance the capabilities of SQL.<br />
What is PL/SQL Engine?</p>
<p>Oracle uses PL/SQL engine to processes the PL/SQL statements, A PL/SQL code can be stored in the client system (client-side) or in the database (server-side).</p>
<p>What are advantages of PL/SQL?</p>
<p>A.	Block Structures: PL/SQL consists of blocks of code, which can be nested within each other. Each block forms a unit of a task or a logical module. PL/SQL Blocks can be stored in the database and reused.<br />
B.	 Procedural Language Capability: PL/SQL consists of procedural language constructs such as conditional statements and loops.<br />
C.	 Better Performance: PL SQL engine processes multiple SQL statements simultaneously as a single block, thereby reducing network traffic.<br />
D.	Error Handling: PL/SQL handles errors or exceptions effectively during the execution of a PL/SQL program. Once an exception is caught, specific actions can be taken depending upon the type of the exception or it can be displayed to the user with a message.</p>
<p>What are PL/SQL Placeholders?<br />
Placeholders are temporary storage area, those can be any of Variables, Constants and Records. Oracle defines placeholders to store data temporarily, which are used to manipulate data during the execution of a PL SQL block. Depending on the kind of data you want to store, you can define placeholders with a name and a data type. Few of the data types used to define placeholders are as under.<br />
Number (n,m) , Char (n) , Varchar2 (n) , Date , Long , Long raw, Raw, Blob, Clob, Nclob, Bfile</p>
<p>What is a PL/SQL Block?<br />
Each PL/SQL program consists of SQL and PL/SQL statements which from a PL/SQL block and a PL/SQL block consist three sections:<br />
A.	The Declaration section (optional).<br />
B.	The Execution section (mandatory).<br />
C.	The Exception or Error handling section (optional).</p>
<p>A.	The Declaration section (optional):<br />
The Declaration section of a PL/SQL Block starts with the reserved keyword DECLARE.  This section is optional and is used to declare any placeholders. Placeholders (may be any of below type) which stores data temporarily.<br />
1. Variables<br />
2. Constants<br />
3. Cursors<br />
4. Records<br />
5. Records those are used to manipulate data in the execution section. </p>
<p>B.	The Execution section (mandatory):<br />
The Execution section of a PL/SQL Block starts with the reserved keyword BEGIN and ends with END. This is a MUST section where the program logic is written to perform any task/s. The programmatic constructs like form the part of execution section.<br />
1. Conditional statement<br />
2. SQL statements<br />
3. Loops</p>
<p>C.	The Exception or Error handling section (optional):<br />
The Exception section of a PL/SQL Block starts with the reserved keyword EXCEPTION.  Any errors in the program can be handled in this section, so that the PL/SQL Blocks terminates gracefully. If the PL/SQL Block contains exceptions that cannot be handled, the Block terminates abruptly with errors.<br />
1. Every statement in the above three sections must end with ; (semicolon).<br />
2. PL/SQL blocks can be nested within other PL/SQL blocks.<br />
3. Comments can be used to document code.<br />
This is how a sample PL/SQL Block looks. </p>
<p>1. HOW to count and group together.</p>
<p>select distinct(column_1),count(*) from table_name group by column_1 ;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/324/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/324/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/324/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=324&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/10/12/324/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>Unix Solaris</title>
		<link>http://oramasters.com/2011/10/10/unix-solaris/</link>
		<comments>http://oramasters.com/2011/10/10/unix-solaris/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 12:24:34 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=322</guid>
		<description><![CDATA[============= HOW TO COLLECT EXPLORER LOGS FOR SOLARIS ============= # /opt/SUNWexplo/bin/explorer run it on the box.. the output is available in: cd /opt/SUNWexplo/output 1. to see the memory size. prtconf 2. to see the details ======================== prtdiag and prtdiag -v for 1. CPU status 2. Memory configuration 3. IO Cards 4. Environment status a. system [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=322&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>=============<br />
HOW TO COLLECT EXPLORER LOGS FOR SOLARIS<br />
=============<br />
# /opt/SUNWexplo/bin/explorer</p>
<p>run it on the box..</p>
<p>the output is available in:</p>
<p>cd /opt/SUNWexplo/output</p>
<p>1. to see the memory size.<br />
prtconf </p>
<p>2. to see the details<br />
========================<br />
prtdiag  and prtdiag -v  for<br />
1. CPU status<br />
2. Memory configuration<br />
3. IO Cards<br />
4. Environment status<br />
   a. system temperature.<br />
   b. Front panel status<br />
   c. Disk status<br />
   d. Fan status<br />
   e. Power suply<br />
   f.<br />
========================</p>
<p>3. to see file i/o<br />
iostat -xtnM 5 </p>
<p>show from time to time 2-3 procent %w , (for /var and /export) </p>
<p>The Database server is a V440 with 16 Gb ram / 4 x 1,3Ghz CPU Only 1 scsi bus</p>
<p>yesterday 1528 study / 92539 object arrive</p>
<p>sk@sanjay01:/usr/sk] $ prtconf<br />
System Configuration: Sun Microsystems sun4u<br />
Memory size: 16384 Megabytes<br />
System Peripherals (Software Nodes):</p>
<p>4.<br />
/var/adm/messages</p>
<p>5.<br />
/etc/vfstab</p>
<p>6.<br />
format (as root user will scan all disk (san disk from san server)<br />
See below.</p>
<p>================================<br />
HOW TO CHECK O.S. LEVEL FILES.<br />
================================</p>
<p>/var/adm/messages</p>
<p>/var/opt/SUNWscor/oracle_server/messages.log.oracle</p>
<p>/var/opt/SUNWscor/oracle_listener/messages.log.listener</p>
<p>/var/opt/SUNWscor/oracle_listener</p>
<p>/var/opt/SUNWscor/oracle_server</p>
<p>/data/logs/impax.log</p>
<p>/data/logs/oracle/bdump/alert_sk.log</p>
<p>==============================<br />
prtdiag -v   SAMPLE OUTPUT<br />
==============================</p>
<p>    prtdiag -v</p>
<p>[sk@sanjay01:/usr/sk] $ prtdiag -v<br />
System Configuration:  Sun Microsystems  sun4u Sun Fire V490<br />
System clock frequency: 150 MHz<br />
Memory size: 8192 Megabytes</p>
<p>========================= CPUs ===============================================</p>
<p>          Run   E$  CPU     CPU<br />
Brd  CPU  MHz   MB  Impl.   Mask<br />
&#8212; &#8212;&#8211; &#8212;- &#8212;- &#8212;&#8212;- &#8212;-<br />
 A  0, 16 1500 32.0 US-IV+   2.2<br />
 A  2, 18 1500 32.0 US-IV+   2.2</p>
<p>========================= Memory Configuration ===============================</p>
<p>          Logical  Logical  Logical<br />
     MC   Bank     Bank     Bank         DIMM    Interleave  Interleaved<br />
Brd  ID   num      size     Status       Size    Factor      with<br />
&#8212;  &#8212;  &#8212;-     &#8212;&#8212;   &#8212;&#8212;&#8212;&#8211;  &#8212;&#8212;  &#8212;&#8212;&#8212;-  &#8212;&#8212;&#8212;&#8211;<br />
 A    0     0      1024MB   no_status     512MB     8-way        0<br />
 A    0     1      1024MB   no_status     512MB     8-way        0<br />
 A    0     2      1024MB   no_status     512MB     8-way        0<br />
 A    0     3      1024MB   no_status     512MB     8-way        0<br />
 A    2     0      1024MB   no_status     512MB     8-way        0<br />
 A    2     1      1024MB   no_status     512MB     8-way        0<br />
 A    2     2      1024MB   no_status     512MB     8-way        0<br />
 A    2     3      1024MB   no_status     512MB     8-way        0</p>
<p>========================= IO Cards =========================</p>
<p>                    Bus  Max<br />
 IO  Port Bus       Freq Bus  Dev,<br />
Type  ID  Side Slot MHz  Freq Func State Name                              Model<br />
&#8212;- &#8212;- &#8212;- &#8212;- &#8212;- &#8212;- &#8212;- &#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;  &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
PCI   8    B    3    33   33  3,0  ok    SUNW,XVR-100                      SUNW,375-3290<br />
PCI   8    B    5    33   33  5,0  ok    scsi-pci1000,30.1000.10c0.8/disk+ LSI,1030<br />
PCI   8    B    5    33   33  5,1  ok    scsi-pci1000,30.1000.10c0.8/disk+ LSI,1030<br />
PCI   8    A    0    66   66  1,0  ok    SUNW,qlc-pci1077,2312.1077.149.2+<br />
PCI   8    A    1    66   66  2,0  ok    SUNW,qlc-pci1077,2312.1077.149.2+</p>
<p>=========================  Environmental Status =========================</p>
<p>System Temperatures (Celsius):<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Device          Temperature     Status<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
CPU0             48             OK<br />
CPU2             50             OK<br />
DBP0             23             OK</p>
<p>=================================</p>
<p>Front Status Panel:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Keyswitch position: NORMAL</p>
<p>System LED Status:</p>
<p>  LOCATOR   FAULT    POWER<br />
  &#8212;&#8212;-  &#8212;&#8212;-  &#8212;&#8212;-<br />
   [OFF]    [OFF]    [ ON]</p>
<p>=================================</p>
<p>Disk Status:<br />
&#8212;&#8212;&#8212;&#8212;<br />
DISK 0: [NO_FAULT]<br />
DISK 1: [NO_FAULT]</p>
<p>=================================</p>
<p>Fan Status:<br />
&#8212;&#8212;&#8212;&#8211;</p>
<p>Fan Tray        Fan              RPM    Status<br />
&#8212;&#8212;&#8212;&#8211;     &#8212;-            &#8212;&#8211;   &#8212;&#8212;&#8212;-<br />
FAN_TRAY_0      CPU0_FAN         5454   [NO_FAULT]<br />
FAN_TRAY_0      CPU1_FAN         4054   [NO_FAULT]<br />
FAN_TRAY_0      CPU2_FAN         3947   [NO_FAULT]<br />
FAN_TRAY_1      IO0_FAN          4054   [NO_FAULT]<br />
FAN_TRAY_1      IO1_FAN          4166   [NO_FAULT]</p>
<p>=================================</p>
<p>Power Supplies:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Supply     Status        Fault     Fan Fail   Temp Fail<br />
&#8212;&#8212;    &#8212;&#8212;&#8212;&#8212;   &#8212;&#8212;&#8211;  &#8212;&#8212;&#8212;  &#8212;&#8212;&#8212;<br />
PS0      [NO_FAULT    ]   OFF       OFF       OFF<br />
PS1      [NO_FAULT    ]   OFF       OFF       OFF</p>
<p>=================================</p>
<p>========================= HW Revisions =======================================</p>
<p>System PROM revisions:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
OBP 4.18.1 2005/06/13 11:39</p>
<p>IO ASIC revisions:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
         Port<br />
Model     ID  Status Version<br />
&#8212;&#8212;&#8211; &#8212;- &#8212;&#8212; &#8212;&#8212;-<br />
Schizo    8     ok      7<br />
Schizo    9     ok      7<br />
[sk@sanjay01:/usr/sk] $</p>
<p>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<br />
<strong>PERFORMANCE RELATED QUERIES</strong><br />
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</p>
<p>Introduction to iostat , vmstat and netstat</p>
<p>This document is primarily written with reference to solaris performance monitoring and tuning but these tools are available in other unix variants also with slight syntax difference.</p>
<p>iostat , vmstat and netstat are three most commonly used tools for performance monitoring . These comes built in with the operating system and are easy to use .iostat stands for input output statistics and reports statistics for i/o devices such as disk drives . vmstat gives the statistics for virtual Memory and netstat gives the network statstics .</p>
<p>Following paragraphs describes these tools and their usage for performance monitoring.</p>
<p>Table of content :<br />
1. Iostat<br />
* Syntax<br />
* example<br />
* Result and Solutions</p>
<p>2. vmstat<br />
* syntax<br />
* example<br />
* Result and Solutions</p>
<p>3. netstat<br />
* syntax<br />
* example<br />
* Result and Solutions</p>
<p>Input Output statistics ( iostat )<br />
iostat reports terminal and disk I/O activity and CPU utilization. The first line of output is for the time period since boot &amp; each subsequent line is for the prior interval . Kernel maintains a number of counters to keep track of the values.</p>
<p>iostat’s activity class options default to tdc (terminal, disk, and CPU). If any other option/s are specified, this default is completely overridden i.e. iostat -d will report only statistics about the disks.</p>
<p>syntax:<br />
Basic synctax is iostat interval count<br />
option – let you specify the device for which information is needed like disk , cpu or terminal. (-d , -c , -t or -tdc ) . x options gives the extended statistics .</p>
<p>interval – is time period in seconds between two samples . iostat 4 will give data at each 4 seconds interval.</p>
<p>count – is the number of times the data is needed . iostat 4 5 will give data at 4 seconds interval 5 times</p>
<p>Example</p>
<p>====================<br />
$ iostat -xtc 10 5<br />
====================<br />
                        extended disk statistics       tty         cpu<br />
     disk r/s  w/s Kr/s Kw/s wait actv svc_t  %w  %b  tin tout us sy wt id<br />
     sd0   2.6 3.0 20.7 22.7 0.1  0.2  59.2   6   19   0   84  3  85 11 0<br />
     sd1   4.2 1.0 33.5  8.0 0.0  0.2  47.2   2   23<br />
     sd2   0.0 0.0  0.0  0.0 0.0  0.0   0.0   0    0<br />
     sd3  10.2 1.6 51.4 12.8 0.1  0.3  31.2   3   31</p>
<p>The fields have the following meanings:<br />
      disk    name of the disk<br />
      r/s     reads per second<br />
      w/s     writes per second<br />
      Kr/s    kilobytes read per second<br />
      Kw/s    kilobytes written per second<br />
      wait    average number of transactions waiting for service (Q length)<br />
      actv    average number of transactions  actively being serviced<br />
(removed  from  the  queue but not yet completed)<br />
      %w      percent of time there are transactions  waiting<br />
              for service (queue non-empty)<br />
      %b      percent of time the disk is busy  (transactions<br />
                  in progress)<br />
Results and Solutions<br />
The values to look from the iostat output are:<br />
* Reads/writes per second (r/s , w/s)<br />
* Percentage busy (%b)<br />
* Service time (svc_t)</p>
<p>If a disk shows consistently high reads/writes along with , the percentage busy (%b) of the disks is greater than 5 percent, and the average service time (svc_t) is greater than 30 milliseconds, then one of the following action needs to be taken</p>
<p>1.) Tune the application to use disk i/o more efficiently by modifying the disk queries and using available cache facilities of application servers .</p>
<p>2.) Spread the file system of the disk on to two or more disk using disk striping feature of volume manager /disksuite etc.</p>
<p>3.) Increase the system parameter values for inode cache , ufs_ninode , which is Number of inodes to be held in memory. Inodes are cached globally (for UFS), not on a per-file system basis</p>
<p>4.) Move the file system to another faster disk /controller or replace existing disk/controller to a faster one.</p>
<p>========================================<br />
<strong>Virtual Memory Statistics ( vmstat )</strong><br />
========================================</p>
<p>vmstat – vmstat reports virtual memory statistics of process, virtual memory, disk, trap, and CPU activity.</p>
<p>On multicpu systems , vmstat averages the number of CPUs into the output. For per-process statistics .Without options, vmstat displays a one-line summary of the virtual memory activity since the system was booted.</p>
<p>syntax<br />
Basic synctax is vmstat interval count</p>
<p>option – let you specify the type of information needed such as paging -p , cache -c ,.interrupt -i etc.</p>
<p>if no option is specified information about process , memory , paging , disk ,interrupts &amp; cpu is displayed .</p>
<p>interval – is time period in seconds between two samples . vmstat 4 will give data at each 4 seconds interval.</p>
<p>count – is the number of times the data is needed . vmstat 4 5 will give data at 4 seconds interval 5 times.</p>
<p>Example<br />
The following command displays a summary of what the system<br />
is doing every five seconds.</p>
<p>example% vmstat 5</p>
<p>     procs  memory          page             disk      faults        cpu<br />
     r b w swap  free re mf pi p fr de sr s0 s1 s2 s3  in  sy  cs us sy id<br />
     0 0 0 11456 4120 1  41 19 1  3  0  2  0  4  0  0  48 112 130  4 14 82<br />
     0 0 1 10132 4280 0   4 44 0  0  0  0  0 23  0  0 211 230 144  3 35 62<br />
     0 0 1 10132 4616 0   0 20 0  0  0  0  0 19  0  0 150 172 146  3 33 64<br />
     0 0 1 10132 5292 0   0  9 0  0  0  0  0 21  0  0 165 105 130  1 21 78</p>
<p>The fields of vmstat&#8217;s display are<br />
procs<br />
r     in run queue<br />
b     blocked for resources I/O, paging etc.<br />
w     swapped<br />
memory (in Kbytes)<br />
swap &#8211;  amount  of  swap   space   currently   available<br />
free   &#8211; size of the free list</p>
<p>page ( in units per second).<br />
re    page reclaims &#8211;  see  -S  option  for  how  this<br />
field is modified.<br />
mf    minor faults &#8211;  see  -S  option  for  how    this<br />
field is modified.<br />
pi    kilobytes paged in<br />
po    kilobytes paged out<br />
fr    kilobytes freed<br />
de    anticipated short-term memory shortfall (Kbytes)<br />
sr    pages scanned by clock algorithm<br />
disk  ( operations per second )<br />
There are  slots for up to four disks,<br />
 labeled with a single letter and number.<br />
The letter indicates  the  type  of disk<br />
 (s = SCSI, i = IPI, etc).<br />
The number is  the logical unit number.</p>
<p>faults<br />
in    (non clock) device interrupts<br />
sy    system calls<br />
cs    CPU context switches</p>
<p>cpu  &#8211;   breakdown of percentage usage of CPU  time.<br />
 On multiprocessors  this is an a<br />
 average across all processors.<br />
us    user time<br />
sy    system time<br />
id    idle time<br />
Results and Solution from iostat</p>
<p>A. CPU issues<br />
Following columns has to be watched to determine if there is any cpu issue</p>
<p>1. Processes in the run queue (procs r)<br />
2. User time (cpu us)<br />
3. System time (cpu sy)<br />
4. Idle time (cpu id)</p>
<p>     procs      cpu<br />
     r b w    us sy  id<br />
     0 0 0    4  14  82<br />
     0 0 1    3  35  62<br />
     0 0 1    3  33  64<br />
     0 0 1    1  21  78<br />
Problem symptoms</p>
<p>A.) Number of processes in run queue<br />
1.) If the number of processes in run queue (procs r) are consistently greater than the number of CPUs on the system it will slow down system as there are more processes then available CPUs .<br />
2.) if this number is more than four times the number of available CPUs in the system then system is facing shortage of cpu power and will greatly slow down the processess on the system.<br />
3.) If the idle time (cpu id) is consistently 0 and if the system time (cpu sy) is double the user time (cpu us) system is facing shortage of CPU resources.</p>
<p>Resolution<br />
Resolution to these kind of issues involves tuning of application procedures to make efficient use of cpu and as a last resort increasing the cpu power or adding more cpu to the system.</p>
<p>B. Memory Issues<br />
Memory bottlenecks are determined by the scan rate (sr) . The scan rate is the pages scanned by the clock algorithm per second. If the scan rate (sr) is continuously over 200 pages per second then there is a memory shortage.</p>
<p>Resolution<br />
1. Tune the applications &amp; servers to make efficient use of memory and cache.<br />
2. Increase system memory .<br />
3. Implement priority paging in s in pre solaris 8 versions by adding line “set priority paging=1? in<br />
/etc/system. Remove this line if upgrading from Solaris 7 to 8 &amp; retaining old /etc/system file.</p>
<p>========================================<br />
<strong>Network Statistics (netstat)</strong><br />
========================================</p>
<p>netstat displays the contents of various network-related data structures in depending on the options selected.</p>
<p>Syntax</p>
<p>netstat<br />
multiple options can be given at one time.</p>
<p>Options<br />
-a – displays the state of all sockets.<br />
-r – shows the system routing tables<br />
-i – gives statistics on a per-interface basis.<br />
-m – displays information from the network memory buffers. On Solaris, this shows statistics<br />
for STREAMS<br />
-p [proto] – retrieves statistics for the specified protocol<br />
-s – shows per-protocol statistics. (some implementations allow -ss to remove fileds with a value of 0 (zero) from the display.)<br />
-D – display the status of DHCP configured interfaces.<br />
-n do not lookup hostnames, display only IP addresses.<br />
-d (with -i) displays dropped packets per interface.<br />
-I [interface] retrieve information about only the specified interface.<br />
-v be verbose</p>
<p>interval – number for continuous display of statictics.</p>
<p>Example<br />
$netstat -rn</p>
<p>Routing Table: IPv4<br />
    Destination           Gateway               Flags  Ref   Use   Interface<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8211; &#8212;&#8211; &#8212;&#8212; &#8212;&#8212;&#8212;<br />
192.168.1.0         192.168.1.11          U        1   1444      le0<br />
224.0.0.0           192.168.1.11          U        1   0            le0<br />
default             192.168.1.1           UG       1   68276<br />
127.0.0.1           127.0.0.1             UH       1   10497     lo0<br />
This shows the output on a Solaris machine who’s IP address is 192.168.1.11 with a default router at 192.168.1.1</p>
<p>Results and Solutions</p>
<p>A.) Network availability<br />
The command as above is mostly useful in troubleshooting network accessibility issues . When outside network is not accessible from a machine check the following</p>
<p>1. if the default router ip address is correct<br />
2. you can ping it from your machine.<br />
3. If router address is incorrect it can be changed with route add command. See man route for more information.</p>
<p>route command examples<br />
$route add default<br />
$route add 192.0.2.32</p>
<p>If the router address is correct but still you can’t ping it there may be some network cable /hub/switch problem and you have to try and eliminate the faulty component .</p>
<p>B.) Network Response<br />
$ netstat -i</p>
<p>Name Mtu 	Net/Dest Address 	Ipkts 	Ierrs 	Opkts Oerrs 	Collis 	Queue<br />
lo0 8232 	loopback localhost 	77814 	0 	77814 	0 	0 	0<br />
hme0 1500 	server1 server1 	10658 	3 	48325 	0 	279257 	0<br />
This option is used to diagnose the network problems when the connectivity is there but it is slow in response .</p>
<p>Values to look at:</p>
<p>* Collisions (Collis)<br />
* Output packets (Opkts)<br />
* Input errors (Ierrs)<br />
* Input packets (Ipkts)</p>
<p>The above values will give information to workout</p>
<p>i. Network collision rate as follows :</p>
<p>Network collision rate = Output collision counts / Output packets</p>
<p>Network-wide collision rate greater than 10 percent will indicate</p>
<p>* Overloaded network,<br />
* Poorly configured network,<br />
* Hardware problems.</p>
<p>ii. Input packet error rate as follows :</p>
<p>Input Packet Error Rate = Ierrs / Ipkts.</p>
<p>If the input error rate is high (over 0.25 percent), the host is dropping packets. Hub/switch cables etc needs to be checked for potential problems.</p>
<p>C. Network socket &amp; TCP Connection state</p>
<p>Netstat gives important information about network socket and tcp state . This is very useful in<br />
finding out the open , closed and waiting network tcp connection .</p>
<p>Network states returned by netstat are following</p>
<p>CLOSED       &#8212;-  Closed.  The socket  is  not  being used.<br />
LISTEN       &#8212;-  Listening for incoming connections.<br />
SYN_SENT     &#8212;-  Actively trying to  establish  connection.<br />
SYN_RECEIVED &#8212;- Initial synchronization of the connection under way.<br />
ESTABLISHED  &#8212;-  Connection has been established.<br />
CLOSE_WAIT   &#8212;-  Remote shut down; waiting  for  the socket to close.<br />
FIN_WAIT_1   &#8212;-  Socket closed; shutting  down  connection.<br />
CLOSING      &#8212;-  Closed,<br />
then   remote   shutdown; awaiting acknowledgement.<br />
LAST_ACK     &#8212;-   Remote  shut  down,  then   closed ;awaiting acknowledgement.<br />
FIN_WAIT_2   &#8212;-  Socket closed; waiting for shutdown from remote.<br />
TIME_WAIT    &#8212;-  Wait after close for  remote  shutdown retransmission..<br />
Example</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#netstat -a<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Local Address 	Remote Address 	Swind   	Send-Q 	Rwind 	Recv-Q 	State<br />
*.* 	*.* 	0 	0 	24576 	0 	IDLE<br />
*.22 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.22 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.* 	*.* 	0 	0 	24576 	0 	IDLE<br />
*.32771 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.4045 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.25 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.5987 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.898 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.32772 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.32775 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.32776 	*.* 	0 	0 	24576 	0 	LISTEN<br />
*.* 	*.* 	0 	0 	24576 	0 	IDLE<br />
192.168.1.184.22 	192.168.1.186.50457 	41992 	0 	24616 	0 	ESTABLISHED<br />
192.168.1.184.22 	192.168.1.186.56806 	38912 	0 	24616 	0 	ESTABLISHED<br />
192.168.1.184.22 	192.168.1.183.58672 	18048 	0 	24616 	0 	ESTABLISHED<br />
if you see a lots of connections in FIN_WAIT state tcp/ip parameters have to be tuned because the<br />
connections are not being closed and they gets accumulating . After some time system may run out of<br />
resource . TCP parameter can be tuned to define a time out so that connections can be released and used by new connection.</p>
<p>==============<br />
<strong>CPU information</strong><br />
==============</p>
<p>[sk@sanjay01:/tmp] $ psrinfo<br />
0       on-line   since 04/20/2011 22:22:44<br />
1       on-line   since 04/20/2011 22:22:44<br />
2       on-line   since 04/20/2011 22:22:44<br />
3       on-line   since 04/20/2011 22:22:42<br />
16      on-line   since 04/20/2011 22:22:44<br />
17      on-line   since 04/20/2011 22:22:44<br />
18      on-line   since 04/20/2011 22:22:44<br />
19      on-line   since 04/20/2011 22:22:44<br />
[sk@sanjay01:/tmp] $ psrinfo -p<br />
4<br />
[sk@sanjay01:/tmp] $<br />
[sk@sanjay01:/tmp] $ psrinfo -pv<br />
The UltraSPARC-IV physical processor has 2 virtual processors (0, 16)<br />
The UltraSPARC-IV physical processor has 2 virtual processors (1, 17)<br />
The UltraSPARC-IV physical processor has 2 virtual processors (2, 18)<br />
The UltraSPARC-IV physical processor has 2 virtual processors (3, 19)</p>
<p>&#8220;[contact-form] </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/322/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/322/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/322/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=322&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/10/10/unix-solaris/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>Automatic Storage Management</title>
		<link>http://oramasters.com/2011/10/07/automatic-storage-management/</link>
		<comments>http://oramasters.com/2011/10/07/automatic-storage-management/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 15:55:03 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[ASM]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=319</guid>
		<description><![CDATA[ASM (Automatic Storage Management) 1 ASM History: ASM was introduced in oracle 10g. 2 ASM doesn&#8217;t: 1 Doesn&#8217;t perform I/O on behalf of the RDBMS, I/O is done by RDBMS and ASM help to locate them.  So there is no “translation layer” for Oracle I/O to datafiles into disk block offsets. I/O from databases is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=319&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<table width="1061" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td colspan="6" valign="bottom" width="1061"><strong>ASM (Automatic Storage Management)</strong></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61">
<p align="right">1</p>
</td>
<td valign="bottom" width="115"><strong>ASM History:</strong></td>
<td colspan="2" valign="bottom" width="876">ASM was introduced in oracle 10g.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115"></td>
<td colspan="2" valign="bottom" width="876"></td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115"></td>
<td colspan="2" valign="bottom" width="876"></td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61">
<p align="right">2</p>
</td>
<td valign="bottom" width="115"><strong>ASM doesn&#8217;t:</strong></td>
<td colspan="2" valign="bottom" width="876"></td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">1</p>
</td>
<td colspan="2" valign="bottom" width="876">Doesn&#8217;t perform I/O on behalf of the RDBMS, I/O is done by RDBMS and ASM help to locate them.  So there is no “translation layer” for Oracle I/O to datafiles into disk block offsets. I/O from databases is directly applied to disk volumes without modification. It reduces overhead and improves performance.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">2</p>
</td>
<td colspan="2" valign="bottom" width="876">ASM doesn&#8217;t have any datafile.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">3</p>
</td>
<td colspan="2" valign="bottom" width="876">You need not more than one ASM instance per server. Means only 1 ASM instance can manage all ASM files for all databases on a server.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">4</p>
</td>
<td colspan="2" valign="bottom" width="876">It does not require large amounts of memory for cache.  ASM requires typically a few hundred MB for internal administration shared across all databases.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">5</p>
</td>
<td colspan="2" valign="bottom" width="876">Backup cannot be done with traditional methods that just backup OS files. Therefore you need integrated tool or using RMAN is one of the best option.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115"></td>
<td colspan="2" valign="bottom" width="876"></td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115"></td>
<td colspan="2" valign="bottom" width="876"></td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115"></td>
<td colspan="2" valign="bottom" width="876"></td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61">
<p align="right">3</p>
</td>
<td valign="bottom" width="115"><strong>ASM, What is:</strong></td>
<td colspan="2" valign="bottom" width="876"></td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">1</p>
</td>
<td colspan="2" valign="bottom" width="876">ASM works on all major operating systems so it is platform independent.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">2</p>
</td>
<td colspan="2" valign="bottom" width="876">SAP supports Oracle ASM.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">3</p>
</td>
<td colspan="2" valign="bottom" width="876">EMC fully supports ASM including various tools that integrate with Oracle as Replication Manager, backup and reporting tools.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">4</p>
</td>
<td colspan="2" valign="bottom" width="876">ASM is available in EXADATA.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" width="61"></td>
<td valign="bottom" width="115">
<p align="center">5</p>
</td>
<td colspan="2" valign="bottom" width="876">ASM distributes chunks of data pseudo-randomly across all available logical disks in a disk group. Hence remove potential performance hot-spots.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" nowrap="nowrap" width="61"></td>
<td valign="bottom" width="115">
<p align="center">6</p>
</td>
<td colspan="2" valign="bottom" width="876">Files that can be stored in ASM: typical database data files, control files, redologs, archivelogs, flashback logs, spfiles,RMAN backups and incremental tracking bitmaps, datapump dumpsets.<br />
In 11gR2, ASM has been extended to allow storing any kind of file using Oracle ACFS capability.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" nowrap="nowrap" width="61"></td>
<td valign="bottom" width="115">
<p align="center">7</p>
</td>
<td colspan="2" valign="bottom" width="876">If ASM instance is down than database will also either be automatically shutdown or crash.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="2" valign="bottom" nowrap="nowrap" width="61"></td>
<td valign="bottom" width="115">
<p align="center">8</p>
</td>
<td colspan="2" valign="bottom" width="876">RMAN is the only way to backup ASM disks.</td>
<td width="9"></td>
</tr>
<tr>
<td colspan="6" valign="bottom" width="1061"><strong>ASM Backgroud processes</strong></td>
</tr>
<tr>
<td valign="bottom" width="48"></td>
<td colspan="3" valign="bottom" width="168"></td>
<td colspan="2" valign="bottom" width="845"></td>
</tr>
<tr>
<td valign="bottom" width="48">
<p align="right">1</p>
</td>
<td colspan="3" valign="bottom" width="168">SMON, PMON, LGWr and DBWr</td>
<td colspan="2" valign="bottom" width="845">Like normal database instances ASM instance too have the usual background processes like SMON, PMON, DBWr, CKPT and LGWr. In addition to that the ASM instance also have the following background processes,</td>
</tr>
<tr>
<td valign="bottom" width="48">
<p align="right">2</p>
</td>
<td colspan="3" valign="bottom" width="168"></td>
<td colspan="2" valign="bottom" width="845"></td>
</tr>
<tr>
<td valign="bottom" width="48">
<p align="right">3</p>
</td>
<td colspan="3" valign="bottom" width="168">RABL</td>
<td colspan="2" valign="bottom" width="845"> Rebalancer: It opens all the device files as part of disk discovery and coordinates the ARB processes for rebalance activity.</td>
</tr>
<tr>
<td valign="bottom" width="48">
<p align="right">4</p>
</td>
<td colspan="3" valign="bottom" width="168">ARBx</td>
<td colspan="2" valign="bottom" width="845"> Actual Rebalancer: They perform the actual rebalancing activities. The number of ARBx processes depends on the ASM_POWER_LIMIT init parameter.</td>
</tr>
<tr>
<td valign="bottom" width="48">
<p align="right">5</p>
</td>
<td colspan="3" valign="bottom" width="168">ASMB</td>
<td colspan="2" valign="bottom" width="845">ASM Bridge: This process is used to provide information to and from the Cluster Synchronization Service (CSS) used by ASM to manage the disk resources. It is also used to update statistics and provide a heartbeat mechanism.</td>
</tr>
<tr>
<td valign="bottom" width="48">
<p align="right">6</p>
</td>
<td colspan="3" valign="bottom" width="168">MARK</td>
<td colspan="2" valign="bottom" width="845">  marks ASM allocation units as stale following a missed write to an offline disk. This essentially tracks which extents require resync for offline disks.</td>
</tr>
<tr>
<td width="48"></td>
<td width="13"></td>
<td width="115"></td>
<td width="40"></td>
<td width="836"></td>
<td width="9"></td>
</tr>
</tbody>
</table>
<table width="1061" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" width="27">
<p align="right">4</p>
</td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">
<p align="center"><strong>ASM, Underlying tools</strong></p>
</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>ASMCMD: ASM </strong></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891">asmcmd utility supports common Linux commands:</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"><span style="text-decoration:underline;">http://docs.oracle.com/cd/E11882_01/server.112/e16102/asm_util001.htm#BABJHJJB</span></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891">$ export ORACLE_SID=+ASM</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891">$ cd $ORACLE_HOME/bin</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"><strong>Category of command</strong></td>
<td valign="bottom" width="891"><strong>Commands</strong></td>
</tr>
<tr>
<td valign="bottom" width="27">
<p align="right">1</p>
</td>
<td valign="bottom" nowrap="nowrap" width="151">Instance Management</td>
<td valign="bottom" width="891"> dsget, dsset, lsct, lsop, lspwusr, orapwusr, shutdown, spbackup, spcopy, spget, spmove, spset, startup</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27">
<p align="right">2</p>
</td>
<td valign="bottom" nowrap="nowrap" width="151">File Management</td>
<td valign="bottom" width="891"> cd, cp, du, find, ls, lsof, mkalias, pwd, rm, rmalias</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27">
<p align="right">3</p>
</td>
<td valign="bottom" nowrap="nowrap" width="151">Disk Group Management</td>
<td valign="bottom" width="891"> chdg, chkdg, dropdg, iostat, lsattr, lsdg, lsdsk, lsod, md_backup, md_restore, mkdg, mount, offline, online, rebal, remap, setattr, umount</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27">
<p align="right">4</p>
</td>
<td valign="bottom" nowrap="nowrap" width="151">Template Management</td>
<td valign="bottom" width="891"> chtmpl, lstmpl, mktmpl, rmtmpl</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27">
<p align="right">5</p>
</td>
<td valign="bottom" nowrap="nowrap" width="151">File Access Control</td>
<td valign="bottom" width="891"> chgrp, chmod, chown, groups, grpmod, lsgrp, lsusr, mkgrp, mkusr, passwd, rmgrp, rmusr</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27">
<p align="right">6</p>
</td>
<td valign="bottom" nowrap="nowrap" width="151">Volume Management</td>
<td valign="bottom" width="891"> volcreate, voldelete, voldisable, volenable, volinfo, volresize, volset, volstat</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>ACFS: ASM Cluster File System:</strong></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>ADVM:  ASM Dynamic Volume Manager </strong></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891">ADVM translates the system calls to the underlying devices</td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>ASMCA: ASM Configuration Assistant:</strong></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>Cooked Files:</strong></td>
</tr>
<tr>
<td valign="bottom" width="27"></td>
<td valign="bottom" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td colspan="2" valign="bottom" nowrap="nowrap" width="1041">
<p align="center"><strong>ASMLib</strong></p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Note: All ASMLib installations require the oracleasmlib and oracleasm-support packages appropriate for their machine. The driver packages are named after the kernel they support. Run the &#8220;uname -r&#8221; command on your machine to determine your kernel version. The corresponding package has the name oracleasm-&lt;kernel_version&gt;.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>To see the ASMLib Kernel Matrix</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"><span style="text-decoration:underline;"><a href="http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html">http://www.oracle.com/technetwork/topics/linux/asmlib/index-101839.html</a></span></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Oracle ASMLib Release Notes</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">http://www.oracle.com/technetwork/server-storage/linux/release-notes-092521.html</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>Installing and Configuring ASMLib :</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Download the following packages from the OTN</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"><span style="text-decoration:underline;"><a href="http://www.oracle.com/technetwork/server-storage/linux/whatsnew/index.html?origref=http://learnwithme11g.wordpress.com/2010/03/18/11gr2-rac-shared-storage-preparationasm-part1/">http://www.oracle.com/technetwork/server-storage/linux/whatsnew/index.html?origref=http://learnwithme11g.wordpress.com/2010/03/18/11gr2-rac-shared-storage-preparationasm-part1/</a></span></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">The ASMLib is highly recommended if using ASM for shared storage within the cluster. It provides many performance and managability benefits.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">ASMLib automatically provides LUN persistence, so when using ASMLib there is no need to manually configure LUN persistence for the ASM devices.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">ASMLib kernel driver MUST match the kernel revision number, the kernel revision number of system can be checked by “uname -r” command.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">oracleasm-support-2.1.3-1.el5x86_64.rpm</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">oracleasmlib-2.0.4-1.el5.x86_64.rpm</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">oracleasm-2.6.18-92.1.17.0.2.el5-2.0.5-1.el5.x86_64.rpm</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>1. Install the RPMs by running the following as the root user:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># rpm -ivh oracleasm-support-2.1.3-1.el5x86_64.rpm \</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">oracleasmlib-2.0.4-1.el5.x86_64.rpm \</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">oracleasm-2.6.18-92.1.17.0.2.el5-2.0.5-1.el5.x86_64.rpm</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>2. To configure ASMLib run following as root user:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">#/etc/init.d/oracleasm configure</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Configuring the Oracle ASM library driver.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">This will configure the on-boot properties of the Oracle ASM library driver. The following questions will determine whether the driver is loaded on boot and what permissions it will have. The current values will be shown in brackets (‘[]‘). Hitting &lt;ENTER&gt; without typing an answer will keep that current value. Ctrl-C will abort.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Default user to own the driver interface []: grid</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Default group to own the driver interface []: asmdba</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Start Oracle ASM library driver on boot (y/n) [n]: y</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Scan for Oracle ASM disks on boot (y/n) [y]: y</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Writing Oracle ASM library driver configuration: done</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Initializing the Oracle ASMLib driver: [ OK ]</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Scanning the system for Oracle ASMLib disks: [ OK ]</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>3. Repeat steps 1 and 2 on all cluster nodes.</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">4.  Mark shared disks as candidate disks</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">To create ASM disks by using ASMLib:</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">5. As the root user use the following syntax:</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># /usr/sbin/oracleasm createdisk disk_name device_partition_name</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">In this command, disk_name is the name you choose for the ASM disk. The name you choose must contain only ASCII capital letters, numbers, or underscores, and the disk name must start with a letter, for example, DISK1 or VOL1, or RAC_FILE1. The name of the disk partition to mark as an ASM disk is the device_partition_name. For example:</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># /usr/sbin/oracleasm createdisk OCR_VOTE01 /usr/sda1</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># /usr/sbin/oracleasm createdisk ASMDATA01 /usr//sdd1</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># /usr/sbin/oracleasm createdisk ASMDATA02 /usr/sde1</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td colspan="2" valign="bottom" width="1041"><strong>Commands:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"><strong>1. To unmark a disk that was used in createdisk command use following command as root user:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># /usr/sbin/oracleasm deletedisk disk_name</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"><strong>2. listdisks command to verify the disks availability:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># /usr/sbin/oracleasm listdisks</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">OCR_VOTE01</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">ASMDATA01</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">ASMDATA02</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"><strong>3. On all nodes the ‘scandisks’ command as root user to see newly created ASM disks. You do not need to create the ASM disks on each node, only on one node in the cluster.</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891"># /usr/sbin/oracleasm scandisks</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="27"></td>
<td valign="bottom" nowrap="nowrap" width="151"></td>
<td valign="bottom" width="891">Scanning system for ASM disks [ OK ]</td>
</tr>
</tbody>
</table>
<table width="1061" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">
<p align="center"><strong>ASM New Features in 11g</strong></p>
</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"><strong>How to connect to ASM in 11g.</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">$ sqlplus / as sysasm  &lt;==  Yes, you read it right, it is sysASM not sysdba.SQL*Plus: Release 11.1.0.7.0 &#8211; Production on Fri Oct 10 10:23:09 2009Copyright (c) 1982, 2007, Oracle.  All rights reserved.</p>
<p>Connected to:<br />
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 &#8211; Production<br />
With the Partitioning, Oracle Label Security, OLAP, Data Mining<br />
and Real Application Testing options</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">Although ASM instance is with no database, you can still create users:SQL&gt; create user sanjay identified by sanjay ;<br />
User created.Now you can grant SYSASM role to the user:</p>
<p>SQL&gt; grant sysasm to sanjay;</p>
<p>Grant succeeded.</p>
<p>Now user sanjay can perform all ASM management functions instead of the user SYS.<br />
The user can connect with the clause as sysasm, similar to the &#8220;as sysdba&#8221; clause in regular databases.</p>
<p>$ sqlplus sanjay/sanjay as sysasm</td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>1</strong></p>
</td>
<td valign="bottom" width="887"><strong>Variable size of AU and Extents: AU (smallest allocation unit) in ASM can varry for different diskgroup starting from 1 MB and can go upto 64 MB. </strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">In general 1 MB is enough for 1 objects but it may not true in many cases. If need it will be taken care automatically. Once thresshold will reach AU size will increase 1M to 4M to 16M to 64M.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">In 11g you can set the diskgroup attribute &#8216;au_size&#8217; during the disk group creation:</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"><strong> create diskgroup dg9 external redundancy disk &#8216;/dev/sanjay/raw15&#8242; attribute &#8216;au_size&#8217; = &#8217;2M&#8217; ;</strong>Note: You can define the size in bytes as well, example: Attribute ‘au_size’=&#8217;2097152&#8242;</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">To check the AU size use V$ASM_DISKGROUP view.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">select name, allocation_unit_size from v$asm_diskgroup ;NAME    ALLOCATION_UNIT_SIZE<br />
&#8212;&#8212;-              &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
DG4                  1048576<br />
DG8                  1048576<br />
DG9                  2097152</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>2</strong></p>
</td>
<td valign="bottom" width="887"><strong>One ASM instance can support all RDBMS versions by setting COMPATIBILITY and DATABASE_COMPATIBILITY parameters for given disk groups.</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">SQL&gt; select compatibility, database_compatibility from  v$asm_diskgroup  where name = &#8216;DG3&#8242; ;</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">COMPATIBILITY          DATABASE_COMPATIBILITY<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-            &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
10.1.0.0.0             10.1.0.0.0</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">In above example:</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">COMPATIBILITY= ASM compatibility i.e. 10.1.0.0.0 here,  means this diskgroup supports up to 10.1 ASM structure.  Thus this diskgroup can have any RDBMS structure.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">DATABASE_COMPATIBILITY= RDBMS compatibility i.e  10.1.0.0.0 here, means the ASM diskgroup DG1 can be used for any RDBMS from version 10.1 onwards.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">SQL&gt; alter diskgroup dg3 set attribute &#8216;compatible.asm&#8217;=&#8217;11.1&#8242;;</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">SQL&gt; alter diskgroup dg3 set attribute &#8216;compatible.rdbms&#8217;=&#8217;11.1&#8242;;</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">Note: compatibility is set for one diskgroup (dg3) not for entire ASM instance.<br />
This feature allows you to use only one ASM instance for all types of database versions.<br />
Depending on which version is used, you can set the attribute appropriately and it will reduce inter-version communication.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>2</strong></p>
</td>
<td valign="bottom" width="887"><strong>Fast failure repair with disk_repair_time</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>3</strong></p>
</td>
<td valign="bottom" width="887"><strong>Metadata backup and restroe made easy with md_backup and md_restore</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">If there were any data it will be lost. Reason md_backup is not a backup of the data but rather the metadata of the ASM instance. The data is  backed up by RMAN. After the diskgroup is created, along with all the directories, you can restore the RMAN backup to this diskgroup.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">ASMCMD&gt; md_backup</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">ASMCMD&gt; md_restore</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">User option -f to create a sql file instead of restoring directly.ASMCMD [+] &gt; md_restore -b dg9.backup -t full -f cr_dg9.sqlNote: you need to run the sql script manually in ASM instance to create all disk groups and other objects.</p>
<p>Script looks like as below.<br />
create diskgroup DG9 EXTERNAL redundancy  disk &#8216;/dev/raw/raw19&#8242; name DG9_0000 size 100M ;<br />
alter diskgroup /*ASMCMD AMBR*/DG9 alter template TEMPFILE attributes (UNPROTECTED COARSE);<br />
alter diskgroup /*ASMCMD AMBR*/DG9 alter template FLASHBACK attributes (UNPROTECTED FINE);<br />
alter diskgroup /*ASMCMD AMBR*/DG9 alter template ARCHIVELOG attributes (UNPROTECTED COARSE);<br />
alter diskgroup /*ASMCMD AMBR*/DG9 alter template BACKUPSET attributes (UNPROTECTED COARSE);<br />
alter diskgroup /*ASMCMD AMBR*/DG9 alter template XTRANSPORT attributes (UNPROTECTED COARSE);<br />
alter diskgroup /*ASMCMD AMBR*/DG9 alter template DATAGUARDCONFIG attributes (UNPROTECTED COARSE);</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>4</strong></p>
</td>
<td valign="bottom" width="887"><strong>Drop diskgroup force including contents:</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">To drop the diskgroup even if the disks are not mounted.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">SQL&gt; drop diskgroup dg7 force including contents;                                                                                                                                                 Note: The available disks show up as FORMER, means it was part of group.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>5</strong></p>
</td>
<td valign="bottom" width="887"><strong>ASMCMD got lsdsk to check the disk with different options like -k, -s, -p, -t, Ik ( i is capital and k is small), -t -g and help lsdsk</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>6</strong></p>
</td>
<td valign="bottom" width="887"><strong>Prefered mirror read option with asm_prefered_read_failure_groups</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">ASM writes on disk group on round robin manner for example: If disk group DG5 has 2 failgroups named DG5_0000 and DG5_0001<br />
1st extent goes to DG5_0000 with a copy going to DG2_0001,<br />
2nd extent goes to DG5_0001 with a copy on DG5_0000,<br />
3rd one back to DG5_0000 with copy on DG5_0001, and so on&#8230;<br />
By this method ASM maintains a copy of one disk on the other one.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">But ASM read extents, they are always read from the primary failgroup (DG5_0000, in this case); not from the secondary (DG2_0001).<br />
The secondary is read only when the primary is not available.<br />
Oracle Database 11g allows you to configure a node to read from a specific failgroup</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">Issue below command from instance 1.<br />
SQL&gt; alter system set asm_preferred_read_failure_groups = &#8216;DG5.DG5_0000&#8242;,&#8217;DG3.DG3_0000&#8242; ;Issue below command from instance 2.SQL&gt; alter system set asm_preferred_read_failure_groups = &#8216;DG5.DG5_0001&#8242;,&#8217;DG3.DG3_0001&#8242; ;</p>
<p>Note: Now if a session from instance 1 wants to read from diskgroup DG5 then disk DG5_0000 will be read.<br />
If the disk is not available then disk DG5_0001 will be read.<br />
Similarly when a session connected to the instance 2 reads the data, the disk DG5_0001 is read.</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887">To check how different disks of the diskgroups are being utilized query view V$ASM_DISK_IOSTAT.<br />
Which simulates the IOSTAT utility found in UNIX systems:</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"><strong>select instname, dbname, group_number, failgroup, disk_number, reads, writes from v$asm_disk_iostat ;</strong>INSTNAM DBNAME   GROUP_NUMBER FAILGROUP  DISK_NUMBER      READS     WRITES<br />
&#8212;&#8212;-    &#8212;&#8212;&#8211;           &#8212;&#8212;&#8212;&#8212;    &#8212;&#8212;&#8212;-        &#8212;&#8212;&#8212;&#8211;      &#8212;&#8212;&#8212;-      &#8212;&#8212;&#8212;-<br />
PRONE31  PRONE3             2 DG5_0000             0       1950        910<br />
PRONE32  PRONE3             2 DG5_0001             1       2845        910</td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center"><strong>7</strong></p>
</td>
<td valign="bottom" width="887"><strong>Mount restricted.</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="175"></td>
<td valign="bottom" width="887">
<p align="center"><strong>ASM New Features in 11.2</strong></p>
</td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">1</p>
</td>
<td valign="bottom" width="887"><strong>No raw device option</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">2</p>
</td>
<td valign="bottom" width="887"><strong>Same home for CRS and ASM</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">3</p>
</td>
<td valign="bottom" width="887"><strong>SYSASM super user for ASM</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">4</p>
</td>
<td valign="bottom" width="887"><strong>Renaming a diskgroup.</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">5</p>
</td>
<td valign="bottom" width="887"><strong>ASM files and ASM Dynamic Volume Manager:</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">6</p>
</td>
<td valign="bottom" width="887"><strong>Snapshot feature to track the changes:</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">7</p>
</td>
<td valign="bottom" width="887"><strong>Hot and Cold attrubutes for diskgroup:</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">8</p>
</td>
<td valign="bottom" width="887"><strong>ASMCMD enhancement</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"><span style="text-decoration:underline;"><a href="http://docs.oracle.com/cd/E11882_01/server.112/e18951/asm_util001.htm#BABCCEJC">http://docs.oracle.com/cd/E11882_01/server.112/e18951/asm_util001.htm#BABCCEJC</a></span></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">9</p>
</td>
<td valign="bottom" width="887"><strong>ASMCMD additional feature: template management:</strong></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175"></td>
<td valign="bottom" width="887"></td>
</tr>
<tr>
<td valign="bottom" width="175">
<p align="center">10</p>
</td>
<td valign="bottom" width="887"><strong>Access Control with [set attribute 'ACCESS_CONTROL.ENABLED' ]and ['ACCESS_CONTROL.UMASK']</strong></td>
</tr>
</tbody>
</table>
<table width="1929" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"><strong><br />
</strong></td>
<td valign="bottom" width="1833"><strong> ASM How to</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32">
<p align="center">1</p>
</td>
<td valign="bottom" width="1833">How to create new database with ASM</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32">
<p align="center">2</p>
</td>
<td valign="bottom" width="1833">How to convert existing database from Non ASM to ASM.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32">
<p align="center">3</p>
</td>
<td valign="bottom" width="1833">How to convert existing ASM database to Non ASM.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32">
<p align="center">4</p>
</td>
<td valign="bottom" width="1833">How to add datafile under tablespace in ASM.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32">
<p align="center">5</p>
</td>
<td valign="bottom" width="1833">How to drop disk group in ASM</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32">
<p align="center">6</p>
</td>
<td valign="bottom" width="1833">How to add a disk group in ASM</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" width="32">
<p align="center">7</p>
</td>
<td valign="bottom" width="1833">How to rebalance &#8230;.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td colspan="3" valign="bottom" width="1929"><strong>Upgrading ASM using DBUA</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">Database Update Assistant (DBUA) can be used to upgrade the ASM instance from Oracle Database 10g to Oracle Database 11g.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">1</p>
</td>
<td valign="bottom" width="1833">Change the directory to the new $ORACLE_HOME/bin and launch DBUA.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="top" width="1833"><strong>cd $ORACLE_HOME/bin</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">2</p>
</td>
<td valign="top" width="1833"><strong>$ ./dbua</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">3</p>
</td>
<td valign="bottom" width="1833">On the Upgrades Operations page, click the <strong>Upgrade Automatic Storage Management Instance</strong> radio button, and click the <strong>Next</strong> button.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">4</p>
</td>
<td valign="bottom" width="1833">On the summary page, confirm the source and target information, then click on <strong>Finish</strong> button.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">5</p>
</td>
<td valign="bottom" width="1833"> When the operation finishes, a successful message should be displayed.   Note: The DBUA logs can be found in file:  $ORACLE_BASE/cfgtoollogs/dbua/logs/ASMUpgrade.log.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td colspan="3" valign="bottom" width="1929"><strong>Upgrading ASM Manually from existing Oracle 10g ASM to 11g:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">1</p>
</td>
<td valign="bottom" width="1833">Install the Oracle Database 11g software to a new ORACLE_HOME directory.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">2</p>
</td>
<td valign="bottom" width="1833">Update the /etc/oratab or /var/opt/oracle/oratab file with the new ASM ORACLE_HOME location.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">3</p>
</td>
<td valign="bottom" width="1833">Copy the ASM initialization file from the old ORACLE_HOME to the new one.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">4</p>
</td>
<td valign="bottom" width="1833">Edit any directory-based parameters (such as diag and dump) in the ASM initialization file as required.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">If you are upgrading a non-RAC ASM instance, you should reconfigure the Oracle CSS using the new ORACLE_HOME.  Do this by executing the <strong>localconfig</strong> command from the new home. Once the CSS configuration is complete, you need to change your ORACLE_HOME to the new Oracle version 11.1 ORACLE_HOME and start the ASM instance.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">5</p>
</td>
<td valign="bottom" width="1833">cd $ORACLE_HOME/bin                                                                                                                                                                                              # ./localconfig reset</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="top" width="1833">If upgrading ASM instance in a RAC environments, you can modify the new ASM home within the OCR using the srvctl utility:                                            <strong>srvctl modify asm -n racnode1 -i +ASM1 -o /apps/oracle/product/11.1.0/asm -p init+ASM1.ora</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32">
<p align="center">6</p>
</td>
<td valign="top" width="1833">Grant the SYSASM role to the SYS</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">If you have obsolete initialization parameters, you can address them now. To get a listing of all the obsolete initialization parameters, refer to the ASM alert log file.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="top" width="1833"></td>
</tr>
<tr>
<td colspan="3" valign="bottom" nowrap="nowrap" width="1929"><strong>ASM bad block recovery:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" nowrap="nowrap" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" nowrap="nowrap" width="1833">If ASM cannot read a physical block from a disk. It considers that the block has IO error. In this case, ASM will automatically read a mirrored block and write a relocated copy to produce successful copy. Although, you can manually repair blocks that have read disk I/O errors. Use &#8216;remap&#8217; command for the same.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" nowrap="nowrap" width="1833"> remap &lt;diskgroup name&gt; &lt;disk name&gt; &lt;block range&gt;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td colspan="3" valign="bottom" width="1929"><strong>Examples of using ASM disks </strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">create tablespace test datafile ‘+diskgrpA’ size 100m;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">alter tablespace test add datafile ‘+diskgrpA’ size 100m;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">alter database add logfile group 4 ‘+dg_log1’,’+dg_log2’ size 100m;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">alter system set log_archive_dest_1=’location=+dg_arch1’;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">alter system set db_recovery_file_dest=’+dg_flash’;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">SQL&gt; create tablespace skumar datafile &#8216;+SKIT_DATA&#8217; size 100M autoextend off ;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">Tablespace created.</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">SQL&gt;  select FILE_ID, TABLESPACE_NAME, FILE_NAME from dba_data_files where tablespace_name=&#8217;SKUMAR&#8217; ;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">   FILE_ID TABLESPACE_NAME    FILE_NAME</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833"> 56           SKUMAR         +SKIT_DATA/skumars1d/datafile/skumar.463.775478783</td>
</tr>
<tr>
<td colspan="3" valign="bottom" width="1929"><strong>Display performance status:</strong></td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="64"></td>
<td valign="bottom" nowrap="nowrap" width="32"></td>
<td valign="bottom" width="1833">select path, reads, writes, read_time, write_time, read_time/decode(reads,0,1,reads) &#8220;AVGRDTIME&#8221;, write_time/decode(writes,0,1,writes) &#8220;AVGWRTIME&#8221;    from v$asm_disk_stat;</td>
</tr>
</tbody>
</table>
<table width="1056" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" nowrap="nowrap" width="109"></td>
<td valign="bottom" width="183"><strong>5. Important views</strong></td>
<td valign="bottom" width="764">
<p align="center"><strong> Comments</strong></p>
</td>
</tr>
<tr>
<td valign="bottom" nowrap="nowrap" width="109"></td>
<td valign="bottom" width="183"></td>
<td valign="bottom" width="764"></td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>1</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_ALIAS:</strong></td>
<td valign="bottom" width="764"> In an ASM instance, contains one row for every alias present in every disk group mounted by the ASM instance. In a DB instance, contains no rows.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>2</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_ATTRIBUTE:</strong></td>
<td valign="bottom" width="764"> Displays one row for each attribute defined. In addition to attributes specified by CREATE DISKGROUP and ALTER DISKGROUP statements, the view may show other attributes that are created automatically. Note that attributes are only displayed for disk groups where COMPATIBLE.ASM is set to 11.1 or higher.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>3</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_CLIENT:</strong></td>
<td valign="bottom" width="764"> In an ASM instance, identifies databases using disk groups managed by the ASM instance. In a DB instance, contains information about the ASM instance if the database has any open ASM files.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>4</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_DISK: </strong></td>
<td valign="bottom" width="764">In an ASM instance, contains one row for every disk discovered by the ASM instance, including disks that are not part of any disk group. In a DB instance, contains rows only for disks in the disk groups in use by that DB instance. This view performs disk discovery every time it is queried.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>5</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_DISK_IOSTAT:</strong></td>
<td valign="bottom" width="764"> Displays information about disk I/O statistics for each ASM client. In a DB instance, only the rows for that instance are shown.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>6</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_DISK_STAT: </strong></td>
<td valign="bottom" width="764">In an ASM instance, contains the same columns as V$ASM_DISK, but to reduce overhead, does not perform a discovery when it is queried. It does not return information about any disks that are new to the storage system. For the most accurate data, use V$ASM_DISK instead.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>7</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_DISKGROUP: </strong></td>
<td valign="bottom" width="764">In an ASM instance, describes a disk group (number, name, size related info, state, and redundancy type). In a DB instance, contains one row for every ASM disk group mounted by the local ASM instance. This view performs disk discovery every time it is queried.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>8</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_DISKGROUP_STAT:</strong></td>
<td valign="bottom" width="764"> In an ASM instance, contains the same columns as V$ASM_DISKGROUP, but to reduce overhead, does not perform a discovery when it is queried. It does not return information about any disks that are new to the storage system. For the most accurate data, use V$ASM_DISKGROUP instead.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>9</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_FILE: </strong></td>
<td valign="bottom" width="764">In an ASM instance, contains one row for every ASM file in every disk group mounted by the ASM instance. In a DB instance, contains no rows.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>10</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_OPERATION: </strong></td>
<td valign="bottom" width="764">In an ASM instance, contains one row for every active ASM long running operation executing in the ASM instance. In a DB instance, contains no rows.</td>
</tr>
<tr>
<td valign="bottom" width="109">
<p align="center"><strong>11</strong></p>
</td>
<td valign="bottom" width="183"><strong>V$ASM_TEMPLATE: </strong></td>
<td valign="bottom" width="764">In an ASM or DB instance, contains one row for every template present in every disk group mounted by the ASM instance.</td>
</tr>
</tbody>
</table>
<table width="1516" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" nowrap="nowrap" width="131"></td>
<td valign="bottom" width="1385">
<p align="center"><strong>ASM, Known issues</strong></p>
</td>
</tr>
<tr>
<td valign="bottom" width="131">
<p align="right">1</p>
</td>
<td valign="bottom" width="1385"><strong>Background process ASMB termination instance.</strong></td>
</tr>
<tr>
<td valign="bottom" width="131">Error:</td>
<td valign="bottom" width="1385">7099389 ORA-15064: communication failure with ASM instance<br />
7099390 ORA-03113: end-of-file on communication channel<br />
7099391 Process ID:<br />
7099392 Session ID: 115 Serial number: 13<br />
7099393 ASMB (ospid: 2651): terminating the instance due to error 15064<br />
7099394 Wed Jan 04 16:31:42 2010</td>
</tr>
<tr>
<td valign="bottom" width="131">Findings:</td>
<td valign="bottom" width="1385">Find if usage of ASMB backuground is not coming down</td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385">select TO_CHAR (SYSDATE, &#8216;MM-DD-YYYY HH24:MI:SS&#8217;) &#8220;NOW&#8221;, PROGRAM, PGA_ALLOC_MEM/1024/1024, PGA_USED_MEM/1024/1024, PGA_MAX_MEM/1024/1024 from v$process where PROGRAM like &#8216;%ASM%&#8217;;</td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385">NOW                 PROGRAM                                          PGA_ALLOC_MEM/1024/1024 PGA_USED_MEM/1024/1024 PGA_MAX_MEM/1024/1024<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
01-23-2012 10:25:33 oracle@CLRACW02D (ASMB)                                       15.8068485             8.09796333            15.8068485</td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385">Note: Value of PGA_MAX_MEM for ASM background process will keep on increasing and will cause instance crash at a point.</td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385"></td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385">select<br />
&#8216;Host Name     :&#8217; || host_name ||chr(10) ||<br />
&#8216;Instance_Name :&#8217; || instance_name ||chr(10)||<br />
&#8216;DB Start Time :&#8217; || to_char(STARTUP_TIME,&#8217;yyyy/mon/dd hh24:mi:ss&#8217;) ||chr(10)||<br />
&#8216;Current Time  :&#8217; || to_char(sysdate,&#8217;yyyy/mon/dd hh24:mi:ss&#8217;)  &#8220;Instance Particulars&#8221;<br />
from  v$instance;</td>
</tr>
<tr>
<td valign="bottom" width="131">Solution:</td>
<td valign="bottom" width="1385">It is a bug in</td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385">ASM INSTANCE CRASHES FREQUENTLY WITH ORA-15082 in 11g [ID 1056695.1]</td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385"></td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385">Interim patch 6851110 exists for certain platform/version: Apply this patch.</td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385"><span style="text-decoration:underline;">https://support.oracle.com/CSP/ui/flash.html#tab=KBHome%28page=KBHome&amp;id=%28%29%29,%28page=KBNavigator&amp;id=%28viewingMode=1143&amp;bmDocTitle=ASM%20INSTANCE%20CRASHES%20FREQUENTLY%20WITH%20ORA-15082%20in%2011g&amp;bmDocType=PROBLEM&amp;bmDocDsrc=KB&amp;bmDocID=1056695.1&amp;from=BOOKMARK%29%29</span></td>
</tr>
<tr>
<td valign="bottom" width="131"></td>
<td valign="bottom" width="1385">Workaround: Restart the database instance</td>
</tr>
</tbody>
</table>
<table width="580" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="bottom" width="580">
<p align="center"><strong>ASM, Docs and articles</strong></p>
</td>
</tr>
<tr>
<td valign="bottom" width="580"><span style="text-decoration:underline;"><a href="http://docs.oracle.com/cd/E11882_01/server.112/e18951/toc.htm">http://docs.oracle.com/cd/E11882_01/server.112/e18951/toc.htm</a></span></td>
</tr>
<tr>
<td valign="bottom" width="580"></td>
</tr>
<tr>
<td valign="bottom" width="580">Master Note for Automatic Storage Management (ASM) [ID 1187723.1]</td>
</tr>
<tr>
<td valign="bottom" width="580"></td>
</tr>
</tbody>
</table>
<p>&#8220;[contact-form]</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/319/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/319/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/319/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=319&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/10/07/automatic-storage-management/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
		<item>
		<title>Unix commands for DBA Part-1</title>
		<link>http://oramasters.com/2011/10/06/unix-commands-for-dba-part-1/</link>
		<comments>http://oramasters.com/2011/10/06/unix-commands-for-dba-part-1/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 16:03:42 +0000</pubDate>
		<dc:creator>Sanjay</dc:creator>
				<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://oramasters.com/?p=313</guid>
		<description><![CDATA[1. How to sort based on column [sanjay@rwgdbwf01:/tmp] $ ps -ef&#124; grep LOCAL=NO&#124; sort +5 sanjay 21148     1  0   May 01 ?       1886:04 oracleSanjay (LOCAL=NO) sanjay  4480     1  0   Apr 03 ?       145:05 oracleSanjay (LOCAL=NO) sanjay 1815     1  0   Apr 03 ?       305:34 oracleSanjay (LOCAL=NO) sanjay 4394     1  0   Apr 03 ?       413:50 oracleSanjay (LOCAL=NO) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=313&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>1. How to sort based on column</strong></p>
<p>[sanjay@rwgdbwf01:/tmp] $ ps -ef| grep LOCAL=NO| sort +5<br />
sanjay 21148     1  0   May 01 ?       1886:04 oracleSanjay (LOCAL=NO)<br />
sanjay  4480     1  0   Apr 03 ?       145:05 oracleSanjay (LOCAL=NO)<br />
sanjay 1815     1  0   Apr 03 ?       305:34 oracleSanjay (LOCAL=NO)<br />
sanjay 4394     1  0   Apr 03 ?       413:50 oracleSanjay (LOCAL=NO)</p>
<p><strong>2. Different options with &#8216;find&#8217;.</strong><br />
2.1 To find a file named &#8220;wherewere.you&#8221; under all sub-directories of /usr/oracle<br />
find /usr/oracle -name wherewere.you -print</p>
<p>2.2 To remove all the files under /usr/oracle which end with .tmp<br />
find /usr/oracle -name &#8220;*.tmp&#8221; -print -exec rm -f {} \;</p>
<p>2.3 To list all files under /usr/oracle which are older than a week.<br />
find /usr/oracle -mtime +7 -print</p>
<p>2.4 To list all files under /usr/oracle which are modified within a week.<br />
find /usr/oracle -mtime -7 -print</p>
<p>2.5 To compress all files which end with .dmp and are more than 2 MB.<br />
find /usr/oracle -size +2097152c -name &#8220;*.dmp&#8221; -print -exec compress {} \;</p>
<p><strong>3. Shared memory segment sizes</strong><br />
ipcs -mb<br />
ipcs -b<br />
ipcrm -m       &lt;== Use for the Shared Memory entry<br />
ipcrm -s       &lt;== Use for the Semaphore entry</p>
<p><strong>4. How to see the users logged in to the server and their IP address</strong><br />
who -T</p>
<p><strong>5. How to convert the contents of a text file to </strong></p>
<p><strong>A. UPPERCASE<br />
</strong>tr &#8220;[a-z]&#8221; &#8220;[A-Z]&#8221; &lt; filename &gt; newfilename</p>
<p><strong>6. How to convert the contents of a text file to  lowercase.</strong><br />
tr &#8220;[A-Z]&#8221; &#8220;[a-z]&#8221; &lt; filename &gt; newfilename</p>
<p><strong>7. How to see lines 100 to 120 of a file</strong><br />
head -120 filename | tail -20</p>
<p><strong>8. How to see the versions of all Oracle products installed on the server.<br />
</strong>$ORACLE_HOME/orainst/inspdver</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/oramasters.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/oramasters.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/oramasters.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/oramasters.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/oramasters.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/oramasters.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/oramasters.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/oramasters.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/oramasters.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/oramasters.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/oramasters.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/oramasters.wordpress.com/313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/oramasters.wordpress.com/313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/oramasters.wordpress.com/313/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=oramasters.com&amp;blog=18486720&amp;post=313&amp;subd=oramasters&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://oramasters.com/2011/10/06/unix-commands-for-dba-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://0.gravatar.com/avatar/670fc7ff9a0af72c04ee478368173cb5?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dbaacademy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
