<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1619118697478427611</id><updated>2011-07-29T00:32:12.834-07:00</updated><category term='ORACLE PL/SQL MD5 checksum'/><category term='ORACLE PL/SQL JOIN SPLIT'/><category term='HDD Write Test'/><category term='ORACLE PL/SQL BULK COLLECT FORALL'/><category term='Mount USB Linux RHEL Fuse NTFSProgs'/><category term='Oracle insert generate random data table'/><category term='UNIX SHELL TIPS PERL FIND'/><category term='ORACLE ARCHIVE LOG MINING'/><title type='text'>Technology TIPS</title><subtitle type='html'>Technology TIPS</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-4932629797696687824</id><published>2010-02-12T11:21:00.000-08:00</published><updated>2010-02-12T11:23:49.296-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UNIX SHELL TIPS PERL FIND'/><title type='text'>Useful UNIX Shell Commands</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Useful UNIX Shell Commands&lt;/span&gt;&lt;br /&gt;=========================================&lt;br /&gt;&lt;br /&gt;It seems I keep bumping into situations which repeat.  I list below some UNIX shell commands I've used on many occasions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;grep&lt;/span&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;Case insensitive search:&lt;br /&gt;grep -i&lt;br /&gt;Demo: grep -i bizVigyan danny.txt&lt;br /&gt;&lt;br /&gt;List files which contain pattern:&lt;br /&gt;grep -l&lt;br /&gt;Demo: grep -l bizVigyan *.txt&lt;br /&gt;&lt;br /&gt;Return lines which do not match:&lt;br /&gt;grep -v&lt;br /&gt;Demo: grep -v bizVigyan billy.txt&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;find&lt;/span&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;Find may be used to find a file.  Also I use it to generate lists of files which&lt;br /&gt;fit some kind of pattern.  The lists can than be fed to other shell commands.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Self Explanatory Demos:&lt;/span&gt;&lt;br /&gt;---------------------------------&lt;br /&gt;&lt;br /&gt;bizVigyan04-oracle-% /bin/find . -name initbizVigyandev.ora -print&lt;br /&gt;&lt;br /&gt;./dbs/initbizVigyandev.ora&lt;br /&gt;bizVigyan04-oracle-%&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bizVigyan04-oracle-% /bin/find . -name 'init*.ora' -print&lt;br /&gt;./dbs/initbizVigyandev.ora&lt;br /&gt;./dbs/initbizVigyantest.ora&lt;br /&gt;./dbs/initbizVigyanrc.ora&lt;br /&gt;./hs/admin/inithsodbc.ora&lt;br /&gt;bizVigyan04-oracle-%&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bizVigyan04-oracle-% /bin/find . -type l -print&lt;br /&gt;./bin/runInstaller&lt;br /&gt;./lib/libagtsh.so&lt;br /&gt;./lib/libobk.so&lt;br /&gt;./lib/libclntsh.so&lt;br /&gt;./precomp/public/SQLCA.H&lt;br /&gt;bizVigyan04-oracle-%&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bizVigyan04-oracle-% /bin/find . -type l -exec /bin/ls -l {} \;&lt;br /&gt;&lt;br /&gt;lrwxrwxrwx  1 oracle  dba          56 Jul 18 2000 ./bin/runInstaller -&gt;&lt;br /&gt;&lt;br /&gt;disk/u01/app/oracle/product/oui/install/runInstaller.sh&lt;br /&gt;&lt;br /&gt;lrwxrwxrwx  1 oracle  dba          15 Jul 18 2000 ./lib/libagtsh.so -&gt; libagtsh.so.1.0&lt;br /&gt;lrwxrwxrwx  1 oracle  dba          13 Jul 18 2000 ./lib/libobk.so -&gt; libdsbtsh8.so&lt;br /&gt;lrwxrwxrwx  1 oracle  dba          16 Jul 18 2000 ./lib/libclntsh.so -&gt; libclntsh.so.8.0&lt;br /&gt;lrwxrwxrwx  1 oracle  dba           7 Jul 18 2000 ./precomp/public/SQLCA.H -&gt; sqlca.h&lt;br /&gt;bizVigyan04-oracle-%&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I think of the 'xargs' keyword as a magic wand which moves a group of tokens&lt;br /&gt;from the left to the right and squish them onto one line.&lt;br /&gt;&lt;br /&gt;Here is ASCII art which describes my mental picture:&lt;br /&gt;&lt;br /&gt;aabbcc&lt;br /&gt;xxyyzz&lt;br /&gt;112233  -&gt; xargs -&gt; aabbcc xxyyzz 112233 uu bye&lt;br /&gt;uu&lt;br /&gt;bye&lt;br /&gt;&lt;br /&gt;The 'xargs' keyword works well with the 'find' command because the 'find' command&lt;br /&gt;lists file names in a single column.&lt;br /&gt; &lt;br /&gt;This demo uses 'xargs' keyword to do the same thing as the&lt;br /&gt;/bin/find . -type l -exec /bin/ls -l {} \;&lt;br /&gt;demo.&lt;br /&gt;&lt;br /&gt;bizVigyan04-oracle-% /bin/find . -type l -print | xargs /bin/ls -l&lt;br /&gt;lrwxrwxrwx  1 oracle  dba          56 Jul 18 2000 ./bin/runInstaller -&gt;&lt;br /&gt;&lt;br /&gt;disk/u01/app/oracle/product/oui/install/runInstaller.sh lrwxrwxrwx  1 oracle  dba          15 Jul 18&lt;br /&gt;2000 ./lib/libagtsh.so -&gt; libagtsh.so.1.0&lt;br /&gt;lrwxrwxrwx  1 oracle  dba          16 Jul 18 2000 ./lib/libclntsh.so -&gt; libclntsh.so.8.0&lt;br /&gt;lrwxrwxrwx  1 oracle  dba           7 Jul 18 2000 ./precomp/public/SQLCA.H -&gt; sqlca.h&lt;br /&gt;bizVigyan04-oracle-%&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Notice how /bin/ls does the opposite of xargs; it takes a list of&lt;br /&gt;files on a single command line and transforms the list into a column of file names.&lt;br /&gt;&lt;br /&gt;Now we demonstrate 'find' sending a bunch of file names to grep:&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -print | xargs | grep -l bizVigyan&lt;br /&gt;&lt;br /&gt;The above command finds all files (in a tree!) which contain the string 'bizVigyan'.&lt;br /&gt;&lt;br /&gt;The 'find' command is also useful for finding files based on date.&lt;br /&gt;&lt;br /&gt;The command below finds all files younger than 7 days:&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -mtime -7 -print&lt;br /&gt;&lt;br /&gt;The command below finds all files older than 7 days:&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -mtime +7 -print&lt;br /&gt;&lt;br /&gt;Since 'find' can find files based on date, it works well with cpio:&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -mtime -7 -print | /bin/cpio -o &gt; /tmp/newerFiles.cpio&lt;br /&gt;&lt;br /&gt;The above shell command could be considered a low-tech incremental backup.&lt;br /&gt;To check the contents of the backup, we'd do something like this:&lt;br /&gt;&lt;br /&gt;cat /tmp/newerFiles.cpio | /bin/cpio -it&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;perl&lt;/span&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;Perl is a great language.  Often, I use it to edit collections of files.&lt;br /&gt;&lt;br /&gt;If I want to edit just one file I'd do something like this:&lt;br /&gt;&lt;br /&gt;perl -e 's/Smith/Bikle/gi' -p  -i.bak aFileIwantChanged.txt&lt;br /&gt;&lt;br /&gt;If I want to edit all the files in a tree of directories, I'd use find, grep, and xargs to locate the names and then&lt;br /&gt;feed the list to a perl command similar to the one above:&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -print | xargs /bin/grep -l Smith | xargs perl -e 's/Smith/Bikle/gi' -p  -i.bak&lt;br /&gt;&lt;br /&gt;Note that if perl changes any files it will back up the original copies to files with a '.bak' suffix.  If we are confident the perl edits are okay, we may remove the .bak files with a command like &lt;br /&gt;&lt;br /&gt;this:&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -name '*.bak' -print | xargs /bin/grep -l Smith | xargs /bin/rm&lt;br /&gt;&lt;br /&gt;Yes, perl is a useful tool; I may put together a directory full of useful perl scripts when I get some free time.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Miscellaneous&lt;/span&gt;&lt;br /&gt;--------------&lt;br /&gt;&lt;br /&gt;If I want to edit a file and put the results in another file, I'd use sed rather than perl:&lt;br /&gt;&lt;br /&gt;cat initSMITH.ora|/bin/sed '1,$s,SMITH,bizVigyan,g'&gt;initbizVigyan.ora&lt;br /&gt;&lt;br /&gt;Here is a command I use to look at some hardware configuration information on a Solaris host:&lt;br /&gt;&lt;br /&gt;/usr/platform/sun4u/sbin/prtdiag&lt;br /&gt;&lt;br /&gt;Here is a demo command I use to kill a set of processes which fit a grepable pattern:&lt;br /&gt;&lt;br /&gt;/bin/ps -ef |/bin/grep oraclebizVigyan|/bin/awk '{print $2}' | xargs kill&lt;br /&gt;&lt;br /&gt;Sometimes /var/adm/messages can contain interesting information:&lt;br /&gt;&lt;br /&gt;/bin/tail /var/adm/messages&lt;br /&gt;&lt;br /&gt;Netstat contains connection information between your host and others.&lt;br /&gt;For example it can help answer, "Who is connected on port 1521?":&lt;br /&gt;&lt;br /&gt;/bin/netstat -a|/bin/grep 1521&lt;br /&gt;&lt;br /&gt;Here is another awk demo which I've not actually used yet but does&lt;br /&gt;demonstrate 2 good ideas.  The first idea is that I can use the '-F' option to specify a field separator in the file I'm passing to awk. &lt;br /&gt;For example, the /etc/passwd file contains fields separated by ':'.&lt;br /&gt;&lt;br /&gt;The second idea is that awk has some SQL-like functionality.  For example, if I want to select (perhaps display would be a better verb)&lt;br /&gt;the value of the first column for all lines in /etc/passwd where the third column value is "0", I'd type this:&lt;br /&gt;&lt;br /&gt;cat /etc/passwd | /bin/awk -F: '$3 == "0" {print $1}'&lt;br /&gt;&lt;br /&gt;A rough SQL equivalent would be this:&lt;br /&gt;&lt;br /&gt;SELECT column1 FROM /etc/passwd WHERE column3 = '0';&lt;br /&gt;&lt;br /&gt;Here is another awk demo which acts like the SQL function named SUM().&lt;br /&gt;&lt;br /&gt;cat /etc/group | /bin/awk -F: '{sum+=$3}END{print sum}'&lt;br /&gt;&lt;br /&gt;In SQL terms it would be like this:&lt;br /&gt;&lt;br /&gt;SELECT SUM(column3) FROM /etc/group;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;A Recap&lt;/span&gt;&lt;br /&gt;-------&lt;br /&gt;&lt;br /&gt;/bin/find . -name 'init*.ora' -print&lt;br /&gt;&lt;br /&gt;/bin/find . -type l -print&lt;br /&gt;&lt;br /&gt;/bin/find . -type l -exec /bin/ls -l {} \;&lt;br /&gt;&lt;br /&gt;/bin/find . -type l -print | xargs /bin/ls -l&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -print | xargs grep -l bizVigyan&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -mtime -7 -print&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -mtime +7 -print&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -mtime -7 -print | /bin/cpio -o &gt; /tmp/newerFiles.cpio&lt;br /&gt;&lt;br /&gt;cat /tmp/newerFiles.cpio | /bin/cpio -it&lt;br /&gt;&lt;br /&gt;perl -e 's/Smith/Bikle/gi' -p  -i.bak aFileIwantChanged.txt&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -print | xargs /bin/grep -l Smith | xargs perl -e 's/Smith/Bikle/gi' -p  -i.bak&lt;br /&gt;&lt;br /&gt;/bin/find . -type f -name '*.bak' -print | /bin/grep -l Smith | xargs /bin/rm&lt;br /&gt;&lt;br /&gt;cat initSMITH.ora|/bin/sed '1,$s,SMITH,bizVigyan,g'&gt;initbizVigyan.ora&lt;br /&gt;&lt;br /&gt;/usr/platform/sun4u/sbin/prtdiag&lt;br /&gt;&lt;br /&gt;/bin/ps -ef |/bin/grep oraclebizVigyan|/bin/awk '{print $2}' | xargs kill&lt;br /&gt;&lt;br /&gt;/bin/tail /var/adm/messages&lt;br /&gt;&lt;br /&gt;/bin/netstat -a|/bin/grep 1521&lt;br /&gt;&lt;br /&gt;cat /etc/passwd | /bin/awk -F: '$3 == "0" {print $1}'&lt;br /&gt;&lt;br /&gt;cat /etc/group | /bin/awk -F: '{sum+=$3}END{print sum}'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-4932629797696687824?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/4932629797696687824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/useful-unix-shell-commands.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/4932629797696687824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/4932629797696687824'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/useful-unix-shell-commands.html' title='Useful UNIX Shell Commands'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-4528329333386325136</id><published>2010-02-12T10:56:00.001-08:00</published><updated>2010-02-12T10:57:01.364-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle insert generate random data table'/><title type='text'>Oracle sql: Generate/INSERT Random data to a table for testing purposes</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Oracle sql: Generate/INSERT Random data to a table for testing purposes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;****************************** Code Begins **************************************************&lt;br /&gt;&lt;br /&gt;-- ------------------------------------------------------------------------------------------&lt;br /&gt;-- First of all, create the procedure given below&lt;br /&gt;-- &lt;br /&gt;-- Secondly, call the newly create procedure from "sqlplus" as follows:&lt;br /&gt;-- SQL&gt; execute gen_data( 'EMP', 10000 );&lt;br /&gt;-- &lt;br /&gt;--  where EMP is the table name  and 10000 is the number of rows you want to insert&lt;br /&gt;--&lt;br /&gt;-- ------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;create or replace &lt;br /&gt;procedure gen_data( p_tname in varchar2, p_records in number )&lt;br /&gt;authid current_user&lt;br /&gt;as&lt;br /&gt;    l_insert long;&lt;br /&gt;    l_rows   number default 0;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;    dbms_application_info.set_client_info( 'gen_data ' || p_tname );&lt;br /&gt;    l_insert := 'insert /*+ append */ into ' || p_tname ||&lt;br /&gt;                ' select ';&lt;br /&gt;&lt;br /&gt;    for x in ( select data_type, data_length,&lt;br /&gt;       nvl(rpad( '9',data_precision,'9')/power(10,data_scale),9999999999) maxval&lt;br /&gt;                 from user_tab_columns&lt;br /&gt;                where table_name = upper(p_tname)&lt;br /&gt;                order by column_id )&lt;br /&gt;    loop&lt;br /&gt;        if ( x.data_type in ('NUMBER', 'FLOAT' ))&lt;br /&gt;        then&lt;br /&gt;            l_insert := l_insert || 'dbms_random.value(1,' || x.maxval || '),';&lt;br /&gt;        elsif ( x.data_type = 'DATE' )&lt;br /&gt;        then&lt;br /&gt;            l_insert := l_insert ||&lt;br /&gt;                  'sysdate+dbms_random.value+dbms_random.value(1,1000),';&lt;br /&gt;        else&lt;br /&gt;            l_insert := l_insert || 'dbms_random.string(''A'',' ||&lt;br /&gt;                                       x.data_length || '),';&lt;br /&gt;        end if;&lt;br /&gt;    end loop;&lt;br /&gt;    l_insert := rtrim(l_insert,',') ||&lt;br /&gt;                  ' from all_objects where rownum &lt;= :n';&lt;br /&gt;&lt;br /&gt;    loop&lt;br /&gt;        execute immediate l_insert using p_records - l_rows;&lt;br /&gt;        l_rows := l_rows + sql%rowcount;&lt;br /&gt;        commit;&lt;br /&gt;        dbms_application_info.set_module&lt;br /&gt;        ( l_rows || ' rows of ' || p_records, '' );&lt;br /&gt;        exit when ( l_rows &gt;= p_records );&lt;br /&gt;    end loop;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;****************************** Code Ends **************************************************&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-4528329333386325136?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/4528329333386325136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-sql-generateinsert-random-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/4528329333386325136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/4528329333386325136'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-sql-generateinsert-random-data.html' title='Oracle sql: Generate/INSERT Random data to a table for testing purposes'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-9000193934716861152</id><published>2010-02-12T10:18:00.000-08:00</published><updated>2010-02-12T10:20:19.321-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ORACLE ARCHIVE LOG MINING'/><title type='text'>Oracle: Enable Archive Log and prepare for mining</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Oracle: Enable Archive Log and prepare for mining&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Database Parameters to be changed:&lt;/span&gt;&lt;br /&gt;----------------------------------&lt;br /&gt;log_archive_start         = TRUE&lt;br /&gt;log_archive_dest_1        = 'LOCATION=/v1x11510/oracle/archive'&lt;br /&gt;log_archive_dest_state_1  = ENABLE&lt;br /&gt;log_archive_format        = %d_%t_%s.arc&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Login as SYS (As sysdba) and do the following:&lt;/span&gt;&lt;br /&gt;------------------------------------------------&lt;br /&gt;CONNECT sys AS SYSDBA&lt;br /&gt;STARTUP PFILE=/v1x11510/v1x11510db/9.2.0/dbs/initv1x11510.ora MOUNT EXCLUSIVE;&lt;br /&gt;ALTER DATABASE ARCHIVELOG;&lt;br /&gt;ARCHIVE LOG START;&lt;br /&gt;ALTER DATABASE OPEN;&lt;br /&gt;ALTER SYSTEM SWITCH LOGFILE;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;ALTER DATABASE ADD SUPPLEMENTAL LOG DATA&lt;/span&gt;&lt;br /&gt;-------------------------------------------&lt;br /&gt;-- The following stmt collects supplementa ldata for primary keys and unique keys.&lt;br /&gt;ALTER DATABASE ADD SUPPLEMENTAL DATA (PRIMARY KEY, UNIQUE KEY) COLUMNS;&lt;br /&gt;&lt;br /&gt;SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To store dictionary in the REDO logs, do&lt;/span&gt;&lt;br /&gt;-----------------------------------------&lt;br /&gt;EXECUTE dbms_logmnr_d.build(options =&gt; dbms_logmnr_d.store_in_redo_logs);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To store dictionary in file system, do&lt;/span&gt;&lt;br /&gt;--------------------------------------&lt;br /&gt;begin&lt;br /&gt;   dbms_logmnr_d.build (&lt;br /&gt;      dictionary_filename =&gt; 'vxgwy1_ora_dict.txt',&lt;br /&gt;      dictionary_location =&gt; '/tmp'&lt;br /&gt;   );&lt;br /&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-9000193934716861152?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/9000193934716861152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-enable-archive-log-and-prepare.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/9000193934716861152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/9000193934716861152'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-enable-archive-log-and-prepare.html' title='Oracle: Enable Archive Log and prepare for mining'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-1245506226081752857</id><published>2010-02-12T09:48:00.000-08:00</published><updated>2010-02-12T09:51:07.999-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ORACLE PL/SQL MD5 checksum'/><title type='text'>Oracle PL/SQL: MD5 checksum of an PL/SQL object</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Oracle PL/SQL: MD5 checksum of an PL/SQL object&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here comes the Code to find the MD5 checksum of an PL/SQL object named VERIFY_FUNCTION.&lt;br /&gt;&lt;br /&gt;This DBMS_CRYPTO is available in 10GR2. In 8i and 9i, we may have to call DBMS_OBFUSCATION_TOOLKIT instead..&lt;br /&gt;&lt;br /&gt;**************** Code Begins ************************&lt;br /&gt;set serveroutput on size 1000000&lt;br /&gt;&lt;br /&gt;declare&lt;br /&gt;   hash varchar2(32);&lt;br /&gt;   code clob;&lt;br /&gt;begin&lt;br /&gt;   for frec in (&lt;br /&gt;      select text&lt;br /&gt;      from dba_source&lt;br /&gt;      where owner = 'SYS'&lt;br /&gt;      and type = 'FUNCTION'&lt;br /&gt;      and name = 'VERIFY_FUNCTION'&lt;br /&gt;      order by line&lt;br /&gt;   )&lt;br /&gt;   loop&lt;br /&gt;      code := code || frec.text;&lt;br /&gt;   end loop;&lt;br /&gt;   hash := rawtohex(&lt;br /&gt;      dbms_crypto.hash (&lt;br /&gt;         typ =&gt; dbms_crypto.hash_md5,&lt;br /&gt;         src =&gt; code&lt;br /&gt;      )&lt;br /&gt;   );&lt;br /&gt;&lt;br /&gt;   dbms_output.put_line('MD5 HASH of VERIFY_FUNCTION : ' || hash);&lt;br /&gt;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;************** Code Ends  **********************&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-1245506226081752857?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/1245506226081752857/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-plsql-md5-checksum-of-plsql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/1245506226081752857'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/1245506226081752857'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-plsql-md5-checksum-of-plsql.html' title='Oracle PL/SQL: MD5 checksum of an PL/SQL object'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-6468989631663140191</id><published>2010-02-12T09:41:00.000-08:00</published><updated>2010-02-12T09:44:51.117-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ORACLE PL/SQL JOIN SPLIT'/><title type='text'>Oracle PL/SQL: Create functions to join and split strings in SQL</title><content type='html'>Reference: http://articles.techrepublic.com.com/5100-10878_11-5259821.html&lt;br /&gt;&lt;br /&gt;Excellent article. Recognized well by the development community.&lt;br /&gt;&lt;br /&gt;Reproduced below from the above URL: TechRepublic's Oracle newsletter covers automating Oracle utilities, generating database alerts, solving directed graph problems, and more. Automatically subscribe today!&lt;br /&gt;&lt;br /&gt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;br /&gt;A common task when selecting data from a database is to take a set of values a query returns and format it as a comma delimited list. Another task that's almost as common is the need to do the reverse: Take a comma delimited list of values in a single string and use it as a table of values.&lt;br /&gt;&lt;br /&gt;Many scripting languages, such as Perl and Python, provide functions that do this with their own language-specific list of values; so it's surprising that, as of yet, this functionality isn't a standard part of SQL functions. I've seen some pretty ugly looking code that involved complex declarations with MAX and DECODE, but that solution usually only returns a limited set of values. With some of the new Oracle9i and above features, it's possible to do this yourself.&lt;br /&gt;I'd like to use a "join" functionality to specify a query that returns a single column and a delimiter, and then receive a simple string that contains a list of those values separated by my delimiter. The query part can be passed to the function as a REF CURSOR using the new SQL CURSOR function. The delimiter should default to a comma, since that is the most commonly used delimiter. So, the syntax should be:&lt;br /&gt;&lt;br /&gt;SQL&gt; select join(cursor(select ename from emp)) from dual;&lt;br /&gt;&lt;br /&gt;SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,CLARK,SCOTT,KING,TURNER,ADAMS,&lt;br /&gt;JAMES,FORD,MILLER&lt;br /&gt;&lt;br /&gt;The following code will perform this function:&lt;br /&gt;&lt;br /&gt;create or replace function join&lt;br /&gt;(&lt;br /&gt;    p_cursor sys_refcursor,&lt;br /&gt;    p_del varchar2 := ','&lt;br /&gt;) return varchar2&lt;br /&gt;is&lt;br /&gt;    l_value   varchar2(32767);&lt;br /&gt;    l_result  varchar2(32767);&lt;br /&gt;begin&lt;br /&gt;    loop&lt;br /&gt;        fetch p_cursor into l_value;&lt;br /&gt;        exit when p_cursor%notfound;&lt;br /&gt;        if l_result is not null then&lt;br /&gt;            l_result := l_result || p_del;&lt;br /&gt;        end if;&lt;br /&gt;        l_result := l_result || l_value;&lt;br /&gt;    end loop;&lt;br /&gt;    return l_result;&lt;br /&gt;end join;&lt;br /&gt;/&lt;br /&gt;show errors;&lt;br /&gt;&lt;br /&gt;The PL/SQL User's Guide says you always have to declare a package that defines a ref cursor; however, the database already defines this as SYS_REFCURSOR in the STANDARD package. The PL/SQL code should be fairly straightforward. There is a limit of 32,767 characters on the output string and the input column.&lt;br /&gt;&lt;br /&gt;Since all datatypes can be automatically converted to character strings, you can use any datatype in the cursor--as long as it's one column. For example:&lt;br /&gt;&lt;br /&gt;SQL&gt; select join(cursor(select trunc(hiredate,'month') from emp),'|') from&lt;br /&gt;dual;&lt;br /&gt;&lt;br /&gt;01-DEC-80|01-FEB-81|01-FEB-81|01-APR-81|01-SEP-81|01-MAY-81|01-JUN-81|01-APR-87|01-NOV-81|01-SEP-81|01-MAY-87|01-DEC-81|&lt;br /&gt;01-DEC-81|01-JAN-82&lt;br /&gt;&lt;br /&gt;There's another extra benefit. Since the cursor is part of the SQL statement, you can easily join the query inside the join with the outer query. Here is a query that returns each table and a list of the columns that make up its primary key:&lt;br /&gt;&lt;br /&gt;SQL&gt; select table_name,join(cursor(select column_name from user_cons_columns&lt;br /&gt;                 where constraint_name = user_constraints.constraint_name&lt;br /&gt;                 order by position)) columns&lt;br /&gt;       from user_constraints where constraint_type = 'P';&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;View the output in Table A.&lt;br /&gt;&lt;br /&gt;You can also use this "join" function to compare two sets of ordered data. For example, the following query will check that an index has been created on a foreign key (which helps prevent locking the table and aids master-detail queries):&lt;br /&gt;&lt;br /&gt;column status format a7&lt;br /&gt;column table_name format a30&lt;br /&gt;column columns format a40 word_wrapped&lt;br /&gt;&lt;br /&gt;select decode(indexes.table_name,null,'missing','ok') status,&lt;br /&gt;       constraints.table_name,&lt;br /&gt;       constraints.columns&lt;br /&gt;  from&lt;br /&gt;    (select table_name,&lt;br /&gt;            constraint_name,&lt;br /&gt;            join(cursor&lt;br /&gt;            (&lt;br /&gt;                select column_name&lt;br /&gt;                  from user_cons_columns&lt;br /&gt;                 where constraint_name = user_constraints.constraint_name&lt;br /&gt;            )) columns&lt;br /&gt;        from user_constraints&lt;br /&gt;       where constraint_type = 'R'&lt;br /&gt;       ) constraints,&lt;br /&gt;    (select table_name, index_name,&lt;br /&gt;            join(cursor&lt;br /&gt;            (&lt;br /&gt;                select column_name&lt;br /&gt;                  from user_ind_columns&lt;br /&gt;                 where index_name = user_indexes.index_name&lt;br /&gt;            )) columns&lt;br /&gt;      from user_indexes) indexes&lt;br /&gt;    where constraints.table_name = indexes.table_name (+)&lt;br /&gt;      and constraints.columns = indexes.columns (+);&lt;br /&gt;&lt;br /&gt;This query works by executing two subqueries: one that queries foreign keys and another that queries indexes. The join between these two queries is on the table name and the list of columns used in creating the foreign key and the index, taken as an ordered list of values.&lt;br /&gt;&lt;br /&gt;We'd also like the reverse functionality: to have the ability to take a single comma-delimited value and treat it as if it were a column in a table. We can take advantage of the TABLE SQL function and PL/SQL function tables to do this quite easily, but first, we must define the result type to be a TABLE type of the largest possible string.&lt;br /&gt;&lt;br /&gt;create or replace type split_tbl as table of varchar2(32767);&lt;br /&gt;/&lt;br /&gt;show errors;&lt;br /&gt;&lt;br /&gt;create or replace function split&lt;br /&gt;(&lt;br /&gt;    p_list varchar2,&lt;br /&gt;    p_del varchar2 := ','&lt;br /&gt;) return split_tbl pipelined&lt;br /&gt;is&lt;br /&gt;    l_idx    pls_integer;&lt;br /&gt;    l_list    varchar2(32767) := p_list;&lt;br /&gt;AA&lt;br /&gt;    l_value    varchar2(32767);&lt;br /&gt;begin&lt;br /&gt;    loop&lt;br /&gt;        l_idx := instr(l_list,p_del);&lt;br /&gt;        if l_idx &gt; 0 then&lt;br /&gt;            pipe row(substr(l_list,1,l_idx-1));&lt;br /&gt;            l_list := substr(l_list,l_idx+length(p_del));&lt;br /&gt;&lt;br /&gt;        else&lt;br /&gt;            pipe row(l_list);&lt;br /&gt;            exit;&lt;br /&gt;        end if;&lt;br /&gt;    end loop;&lt;br /&gt;    return;&lt;br /&gt;end split;&lt;br /&gt;/&lt;br /&gt;show errors;&lt;br /&gt;&lt;br /&gt;With this function, I can run a query like this:&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from table(split('one,two,three'));&lt;br /&gt;&lt;br /&gt;one&lt;br /&gt;two&lt;br /&gt;three&lt;br /&gt;&lt;br /&gt;The PL/SQL procedure will parse its argument and return each part through a PIPELINE; the TABLE function allows it to be used in the FROM statement, so it appears to SQL as if it is a table with one column and three rows. (Remember that the column being returned is named COLUMN_VALUE if you want to use the value elsewhere.)&lt;br /&gt;&lt;br /&gt;Here's an example query, which shows a dynamic IN condition in a query. The split function generates a table of values, which can be used on a row-by-row basis.&lt;br /&gt;&lt;br /&gt;SQL&gt; select ename from emp&lt;br /&gt;      where to_char(hiredate,'YY')&lt;br /&gt;         in (select column_value from table(split('81,82')));&lt;br /&gt;&lt;br /&gt;View the output in Table B.&lt;br /&gt;&lt;br /&gt;If you want, you can join a column and then split it, too:&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from table(split(join(cursor(select ename from emp))));&lt;br /&gt;&lt;br /&gt;And, you can use this method to merge sets of values:&lt;br /&gt;&lt;br /&gt;create table t(a varchar2(200));&lt;br /&gt;insert into t values('81,82');&lt;br /&gt;insert into t values('84,85');&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from table(split(join(cursor(select a from t))));&lt;br /&gt;&lt;br /&gt;81&lt;br /&gt;82&lt;br /&gt;84&lt;br /&gt;85&lt;br /&gt;&lt;br /&gt;These are just simple example functions. You could extend join to enclose values in quotes and escape quotes inside the values. You could extend split to allow a REF CURSOR parameter instead of a single VARCHAR2, so it could split up sets of columns as well.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-6468989631663140191?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/6468989631663140191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-plsql-create-functions-to-join.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/6468989631663140191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/6468989631663140191'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-plsql-create-functions-to-join.html' title='Oracle PL/SQL: Create functions to join and split strings in SQL'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-6697555302542607551</id><published>2010-02-12T09:34:00.000-08:00</published><updated>2010-02-12T09:37:27.546-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ORACLE PL/SQL BULK COLLECT FORALL'/><title type='text'>Oracle PL/SQL: BULK COLLECT and FORALL usage</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Oracle PL/SQL: BULK COLLECT and FORALL usage&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;create table t1 as select * from all_objects where 1=2;&lt;br /&gt;&lt;br /&gt;create or replace procedure fast_proc is&lt;br /&gt;   TYPE TObjectTable is table of ALL_OBJECTS%ROWTYPE;&lt;br /&gt;   ObjectTable$ TObjectTable;&lt;br /&gt;BEGIN&lt;br /&gt;   select *&lt;br /&gt;          BULK COLLECT INTO ObjectTable$&lt;br /&gt;     from ALL_OBJECTS;&lt;br /&gt;&lt;br /&gt;   forall rowX in ObjectTable$.First..ObjectTable$.Last&lt;br /&gt;          insert into t1 values ObjectTable$(rowX);&lt;br /&gt;END;&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-6697555302542607551?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/6697555302542607551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-plsql-bulk-collect-and-forall.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/6697555302542607551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/6697555302542607551'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/oracle-plsql-bulk-collect-and-forall.html' title='Oracle PL/SQL: BULK COLLECT and FORALL usage'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-4813612374680134034</id><published>2010-02-12T08:39:00.000-08:00</published><updated>2010-02-12T08:59:21.050-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HDD Write Test'/><title type='text'>HDD Write Test</title><content type='html'>&lt;span style="font-weight:bold;"&gt;HDD Write Test&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To write 50G of nothing&lt;/span&gt;&lt;br /&gt;cd /mnt&lt;br /&gt;dd if=/dev/zero of=my50Gfile bs=1024M count=50&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;To time it, do&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;time dd if=/dev/zero of=my50Gfile bs=1024M count=50&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;More workaround:&lt;/span&gt;&lt;br /&gt;dd if=/dev/zero of=diskfiller.tmpfile bs=1000M count=99999999&lt;br /&gt;&lt;br /&gt;==&gt; Takes 5 hrs for a 400G strip on 2 drives.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-4813612374680134034?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/4813612374680134034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/hdd-write-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/4813612374680134034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/4813612374680134034'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/hdd-write-test.html' title='HDD Write Test'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1619118697478427611.post-1570260684848224380</id><published>2010-02-12T08:29:00.000-08:00</published><updated>2010-02-12T09:00:02.647-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mount USB Linux RHEL Fuse NTFSProgs'/><title type='text'>Mounting USB flash drive with NTFS  -f FS on to RHEL 4/5.x</title><content type='html'>&lt;font style="font-weight: bold;"&gt;Mounting USB flash drive with NTFS  -f FS on to RHEL 4/5.x&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;First login as "root" and do:&lt;br /&gt;&lt;br /&gt;fdisk -l&lt;br /&gt;&lt;br /&gt;find whether the device is /dev/sda  or /dev/sda1&lt;br /&gt;&lt;br /&gt;In the following case, it is /dev/sda1:&lt;br /&gt;&lt;br /&gt;  Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/sda1               1       15740     4029424    c  W95 FAT32 (LBA)&lt;br /&gt;&lt;br /&gt;Then, create a dir:&lt;br /&gt;mkdir /v03/flash&lt;br /&gt;&lt;br /&gt;then, mount it as follows:&lt;br /&gt;&lt;br /&gt;mount -t auto /dev/sda1 /v03/flash/&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;Download the following 2 tar balls:&lt;/font&gt;&lt;br /&gt;fuse-2.7.4.tar.gz&lt;br /&gt;ntfsprogs-2.0.0.tar.gz&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;Then, install fuse first&lt;/font&gt;&lt;br /&gt;tar xfz fuse-2.7.4.tar.gz&lt;br /&gt;cd fuse-2.7.4&lt;br /&gt;./configure&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;Then, install ntfsprogs, next&lt;/font&gt;&lt;br /&gt;tar xfz ntfsprogs-2.0.0.tar.gz&lt;br /&gt;cd ntfsprogs-2.0.0&lt;br /&gt;./configure&lt;br /&gt;make install&lt;br /&gt;&lt;br /&gt;Then, you should be able to mount the NTFS for READ and WRITE as follows:&lt;br /&gt;&lt;br /&gt;ntfsmount  /dev/sda1  /mnt  -o  rw&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1619118697478427611-1570260684848224380?l=ash-techtips.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ash-techtips.blogspot.com/feeds/1570260684848224380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/mounting-usb-flash-drive-with-ntfs-f-fs.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/1570260684848224380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1619118697478427611/posts/default/1570260684848224380'/><link rel='alternate' type='text/html' href='http://ash-techtips.blogspot.com/2010/02/mounting-usb-flash-drive-with-ntfs-f-fs.html' title='Mounting USB flash drive with NTFS  -f FS on to RHEL 4/5.x'/><author><name>Ashok RS</name><uri>http://www.blogger.com/profile/07953771764622741798</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/_iwkZdl31-zA/S3Va4fh7zrI/AAAAAAAAAAM/VzqbMo0DlEc/S220/Ash_Subramanian_pix-2-1.jpg'/></author><thr:total>1</thr:total></entry></feed>
