<?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-5456017795336143989</id><updated>2011-12-21T11:38:11.353-08:00</updated><category term='hibernate'/><category term='quartz'/><category term='PostgreSQL'/><category term='Database'/><category term='Maven'/><category term='spring'/><category term='File system'/><category term='Mysql'/><category term='Replication'/><category term='Escape'/><category term='Putty'/><category term='DBA'/><category term='iText'/><category term='Linux hacks'/><category term='HP Admin'/><category term='life saver.'/><category term='NetBeans'/><category term='Oracle'/><category term='Java'/><category term='Car'/><category term='DD'/><category term='Ford'/><category term='suv'/><category term='pdf'/><title type='text'>Geek Stuff Matters</title><subtitle type='html'>Geek Stuff Matter. Tips and Tricks for DBS and *nix</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>50</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-5217749740995746852</id><published>2011-08-02T09:20:00.000-07:00</published><updated>2011-08-02T09:21:25.745-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'></title><content type='html'>create or replace function get_token(&lt;br /&gt;   the_list  varchar2,&lt;br /&gt;   the_index number,&lt;br /&gt;   delim     varchar2 := ','&lt;br /&gt;)&lt;br /&gt;   return    varchar2&lt;br /&gt;is&lt;br /&gt;   start_pos number;&lt;br /&gt;   end_pos   number;&lt;br /&gt;begin&lt;br /&gt;   if the_index = 1 then&lt;br /&gt;       start_pos := 1;&lt;br /&gt;   else&lt;br /&gt;       start_pos := instr(the_list, delim, 1, the_index - 1);&lt;br /&gt;       if start_pos = 0 then&lt;br /&gt;           return null;&lt;br /&gt;       else&lt;br /&gt;           start_pos := start_pos + length(delim);&lt;br /&gt;       end if;&lt;br /&gt;   end if;&lt;br /&gt;&lt;br /&gt;   end_pos := instr(the_list, delim, start_pos, 1);&lt;br /&gt;&lt;br /&gt;   if end_pos = 0 then&lt;br /&gt;       return substr(the_list, start_pos);&lt;br /&gt;   else&lt;br /&gt;       return substr(the_list, start_pos, end_pos - start_pos);&lt;br /&gt;   end if;&lt;br /&gt;&lt;br /&gt;end get_token;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select&lt;br /&gt;   get_token('foo,bar,baz',1), -- 'foo'&lt;br /&gt;   get_token('foo,bar,baz',3), -- 'baz'&lt;br /&gt;   --&lt;br /&gt;   get_token('a,,b',2),        -- '' (null)&lt;br /&gt;   get_token('a,,b',3),        -- 'b'&lt;br /&gt;   --&lt;br /&gt;   get_token('a|b|c',2,'|'),   -- 'b'&lt;br /&gt;   get_token('a|b|c',4,'|')    -- '' (null)&lt;br /&gt;from&lt;br /&gt;   dual&lt;br /&gt;/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-5217749740995746852?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/5217749740995746852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=5217749740995746852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5217749740995746852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5217749740995746852'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2011/08/create-or-replace-function-gettoken.html' title=''/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-730924037427349721</id><published>2011-02-09T12:08:00.000-08:00</published><updated>2011-02-09T12:09:52.309-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle logging message to a table.</title><content type='html'>create table log_test (message varchar2(255));&lt;br /&gt;create table log_results (resultvalue number);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CREATE OR REPLACE PROCEDURE LOG_MESSAGE (MESSAGE_IN IN VARCHAR2) AS&lt;br /&gt;   PRAGMA AUTONOMOUS_TRANSACTION;&lt;br /&gt;BEGIN&lt;br /&gt;   INSERT INTO LOG_TEST (MESSAGE) VALUES (MESSAGE_IN);&lt;br /&gt;   COMMIT;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;create or replace&lt;br /&gt;PROCEDURE CREATE_ERROR (VALUE_IN IN NUMBER) IS&lt;br /&gt;   l_x NUMBER;&lt;br /&gt;BEGIN&lt;br /&gt;   LOG_MESSAGE( 'Attempting to divide by ' || to_char(VALUE_IN) );&lt;br /&gt;   l_x := 10 / VALUE_IN;&lt;br /&gt;   INSERT INTO log_results (resultvalue) values (l_x);&lt;br /&gt;   LOG_MESSAGE( 'Finished to divide by ' || to_char(VALUE_IN) );&lt;br /&gt;   COMMIT;&lt;br /&gt;END;&lt;br /&gt;/&lt;br /&gt;&lt;br /&gt;select * from log_test;&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from log_test;&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from log_results;&lt;br /&gt;&lt;br /&gt;no rows selected&lt;br /&gt;&lt;br /&gt;SQL&gt; exec create_error(2);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; exec create_error(1);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; exec create_error(0);&lt;br /&gt;BEGIN create_error(0); END;&lt;br /&gt;&lt;br /&gt;*&lt;br /&gt;ERROR at line 1:&lt;br /&gt;ORA-01476: divisor is equal to zero&lt;br /&gt;ORA-06512: at "TPM.CREATE_ERROR", line 5&lt;br /&gt;ORA-06512: at line 1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;SQL&gt; exec create_error(4);&lt;br /&gt;&lt;br /&gt;PL/SQL procedure successfully completed.&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from log_results;&lt;br /&gt;&lt;br /&gt;RESULTVALUE&lt;br /&gt;-----------&lt;br /&gt;           5&lt;br /&gt;          10&lt;br /&gt;         2.5&lt;br /&gt;&lt;br /&gt;SQL&gt; select * from log_test;&lt;br /&gt;&lt;br /&gt;MESSAGE&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;Attempting to divide by 2&lt;br /&gt;Finished to divide by 2&lt;br /&gt;Attempting to divide by 1&lt;br /&gt;Finished to divide by 1&lt;br /&gt;Attempting to divide by 0&lt;br /&gt;Attempting to divide by 4&lt;br /&gt;Finished to divide by 4&lt;br /&gt;&lt;br /&gt;7 rows selected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-730924037427349721?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/730924037427349721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=730924037427349721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/730924037427349721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/730924037427349721'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2011/02/oracle-logging-message-to-table.html' title='Oracle logging message to a table.'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-6217551884942851580</id><published>2010-10-20T20:42:00.001-07:00</published><updated>2010-10-20T20:42:35.160-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'></title><content type='html'>set your ORACLE_SID to an ASM instance &lt;br /&gt;using asmcmd locate the directory that contains the archive log files. for example..&lt;br /&gt;&lt;br /&gt;ASMCMD&gt; cd +POC2FLASH/POC2DWH/ARCHIVELOG&lt;br /&gt;using 'rm' command you can delete the directory. &lt;br /&gt;&lt;br /&gt;But don't forget to remove the archive log details from the control file or the RMAN catalog &lt;br /&gt;For this you need to connect to the target database using rman&lt;br /&gt;rman target sys/&lt;password&gt; nocatalog &lt;br /&gt;rman&gt;crosscheck archivelog all&lt;br /&gt;rman&gt;delete expired archivelog all&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-6217551884942851580?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/6217551884942851580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=6217551884942851580' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6217551884942851580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6217551884942851580'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/10/set-your-oraclesid-to-asm-instance.html' title=''/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2130381675678197542</id><published>2010-10-18T11:09:00.000-07:00</published><updated>2010-10-18T11:10:07.146-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux hacks'/><title type='text'>DHCP hostname.</title><content type='html'>Set the hostname: `# hostname &lt;hostname&gt;`&lt;br /&gt;Add ‘HOSTNAME=&lt;hostname&gt;’ to ‘/etc/sysconfig/network’ (makes the change permanent).&lt;br /&gt;Add ‘DHCP_HOSTNAME=&lt;hostname&gt;’ to ‘/etc/sysconfig/network-scripts/ifcfg-eth0′&lt;br /&gt;Restart the networking service: `# service network restart`&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2130381675678197542?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2130381675678197542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2130381675678197542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2130381675678197542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2130381675678197542'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/10/dhcp-hostname.html' title='DHCP hostname.'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-3020274720666542311</id><published>2010-09-07T11:29:00.000-07:00</published><updated>2010-09-07T11:36:32.064-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='DD'/><title type='text'>Mount entire driver image</title><content type='html'>if you dump your entire Hard driver using DD. you can view the content of the Image using the following comment.&lt;br /&gt;&lt;br /&gt;assume you have create a hd image in /home/backup/hd.dump&lt;br /&gt;&lt;br /&gt;1). fdisk /home/backup/hd.dump&lt;br /&gt;You must set cylinders.&lt;br /&gt;You can do this from the extra functions menu.&lt;br /&gt;&lt;br /&gt;Disk /mnt/storage/disk_image: 0 MB, 0 bytes&lt;br /&gt;255 heads, 63 sectors/track, 0 cylinders, total 0 sectors&lt;br /&gt;Units = sectors of 1 * 512 = 512 bytes&lt;br /&gt;Disk identifier: 0x41172ba5&lt;br /&gt;&lt;br /&gt;                  Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/home/backup/hd.dump1              63       64259       32098+  de  Dell Utility&lt;br /&gt;/home/backup/hd.dump2   *       64260    78108029    39021885    7  HPFS/NTFS&lt;br /&gt;Partition 2 has different physical/logical endings:&lt;br /&gt;     phys=(1023, 254, 63) logical=(4861, 254, 63)&lt;br /&gt;&lt;br /&gt;2). then take the start of the partition that you want to edit 64260 in this case and multiply it by 512 ie 512*64260=32901120&lt;br /&gt;&lt;br /&gt;then mount like this:&lt;br /&gt;&lt;br /&gt;3). mount -o loop,offset=32901120 -t auto /home/backup/hd.dump /mnt/images ( assume the /mnt/images exists).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-3020274720666542311?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/3020274720666542311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=3020274720666542311' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3020274720666542311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3020274720666542311'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/09/mount-entire-driver-image.html' title='Mount entire driver image'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-559333201418810811</id><published>2010-08-31T12:11:00.000-07:00</published><updated>2010-08-31T12:15:58.971-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HP Admin'/><title type='text'>change HP server boot order remotely using iLo</title><content type='html'>1). SSH to HP server&lt;br /&gt;2). cd system1/bootconfig1&lt;br /&gt;3). show bootsource1    #please write down the bootorder number, I use 1 in this case&lt;br /&gt;4). set bootsource1 bootorder=1    'this will give you the descriptive msg'&lt;br /&gt;5). set bootsource$b bootorder=$p  'replace $b and $p to the device and boot order you want to set'&lt;br /&gt;&lt;br /&gt;6). voila. reboot the machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-559333201418810811?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/559333201418810811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=559333201418810811' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/559333201418810811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/559333201418810811'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/08/change-hp-server-boot-order-remotely.html' title='change HP server boot order remotely using iLo'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-6231826790255623272</id><published>2010-08-13T20:56:00.000-07:00</published><updated>2010-08-13T20:57:04.112-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>add temp table space</title><content type='html'>alter tablespace temp add tempfile size 128m autoextend on next 32m maxsize 8g;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-6231826790255623272?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/6231826790255623272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=6231826790255623272' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6231826790255623272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6231826790255623272'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/08/add-temp-table-space.html' title='add temp table space'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2879191096118404056</id><published>2010-08-07T23:48:00.000-07:00</published><updated>2010-08-07T23:58:09.442-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle turn on Archive mode</title><content type='html'>his is a two-step process. email if you have questions: fayoubi@gmail.com&lt;br /&gt;&lt;br /&gt;STEP ONE : Modify your initSID.ora&lt;br /&gt;&lt;br /&gt;Modify your initSID.ora to include the following three lines:&lt;br /&gt;&lt;br /&gt;log_archive_start = true&lt;br /&gt;log_archive_dest = /mount_point/oradata/SID/ARCHIVE/arch&lt;br /&gt;log_archive_format = _%s.arc&lt;br /&gt;&lt;br /&gt;log_archive_start: This parameter specifies whether archiving should be started automatically when the database is started.&lt;br /&gt;&lt;br /&gt;log_archive_dest: This value specifies the default location of the file to be used when archiving redo log files.&lt;br /&gt;&lt;br /&gt;log_archive_format: This parameter is used to specify the default file name format for the archive log files, this value is appended to the log_archive_dest value ( %s is the log sequence number ).&lt;br /&gt;&lt;br /&gt;STEP TWO : Starting archive logging&lt;br /&gt;&lt;br /&gt;The final step to starting archive logging, involves an Oracle SQL*DBA command which is run when the database is mounted but not open.&lt;br /&gt;&lt;br /&gt;With the database shut down, use one of the many DBA tools available to manually start the database ( I still prefer to use SQL*DBA ) and execute the following sequence of commands:&lt;br /&gt;&lt;br /&gt;startup mount exclusive&lt;br /&gt;connect internal&lt;br /&gt;alter database archivelog;&lt;br /&gt;alter database open;&lt;br /&gt;&lt;br /&gt;Now check to ensure archive logging is running. Whilst still connected internal, execute the command archive log list as shown below:&lt;br /&gt;&lt;br /&gt;SQLDBA&gt; archive log list&lt;br /&gt;Database log mode ARCHIVELOG&lt;br /&gt;Automatic archival ENABLED&lt;br /&gt;Archive destination /mount_point/oradata/SID/ARCHIVE/arch&lt;br /&gt;Oldest online log sequence 2&lt;br /&gt;Current log sequence 3&lt;br /&gt;SQLDBA&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2879191096118404056?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2879191096118404056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2879191096118404056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2879191096118404056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2879191096118404056'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/08/oracle-turn-on-archive-mode.html' title='Oracle turn on Archive mode'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2025848510611029918</id><published>2010-07-07T15:21:00.000-07:00</published><updated>2010-07-07T15:29:45.744-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>how to fix ORA-00600: internal error code, arguments: [kcratr1_lastbwr]</title><content type='html'>if your Oracle gives you &lt;span style="font-weight: bold;"&gt;ORA-01033: ORACLE initialization or shutdown in progress&lt;/span&gt; when your app is trying to connect Oracle. (or DBA account with &lt;span style="font-weight: bold;"&gt;ORA-00600: internal error code, arguments: [kcratr1_lastbwr]&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;below is the commands to fix it.&lt;br /&gt;&lt;br /&gt;login as sysdba;&lt;br /&gt;&lt;br /&gt;SQL&gt; shutdown;&lt;br /&gt;SQL&gt; startup mount;&lt;br /&gt;SQL&gt; recover database;&lt;br /&gt;SQL&gt; alter database open;&lt;br /&gt;&lt;br /&gt;it should fix the problem&lt;span style="font-style: italic;"&gt;&lt;/span&gt;&lt;i&gt;.&lt;br /&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2025848510611029918?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2025848510611029918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2025848510611029918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2025848510611029918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2025848510611029918'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/07/how-to-fix-ora-00600-internal-error.html' title='how to fix ORA-00600: internal error code, arguments: [kcratr1_lastbwr]'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-6218716668739104476</id><published>2010-05-26T19:49:00.000-07:00</published><updated>2010-05-26T19:54:21.840-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>How to fix 'No converter found for 'org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer"</title><content type='html'>if you are seeing 'No converter found for 'org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer' in your log when you using the spring+hibernate+dwr combination,&lt;br /&gt;&lt;br /&gt;to solve this problem,&lt;br /&gt;&lt;br /&gt;change the converter='bean' to converter="hibernate3" in the convert tag.&lt;br /&gt;&lt;br /&gt;for example.&lt;br /&gt;&lt;br /&gt;&lt;converter converter="bean" match="local.tux.Product"&gt;&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;&lt;converter converter="hibernate3" match="local.tux.Product"&gt;&lt;/converter&gt;&lt;/converter&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-6218716668739104476?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/6218716668739104476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=6218716668739104476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6218716668739104476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6218716668739104476'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/05/how-to-fix-no-converter-found-for.html' title='How to fix &apos;No converter found for &apos;org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer&quot;'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-8688648446292609792</id><published>2010-04-21T10:38:00.000-07:00</published><updated>2010-04-21T10:39:59.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>launch java program with remote debugging capability.</title><content type='html'>export javadg="java  -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-8688648446292609792?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/8688648446292609792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=8688648446292609792' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8688648446292609792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8688648446292609792'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/04/launch-java-program-with-remote.html' title='launch java program with remote debugging capability.'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-3871426352117989149</id><published>2010-03-08T14:02:00.000-08:00</published><updated>2010-03-08T14:04:10.288-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux hacks'/><title type='text'>Move a directory over the network</title><content type='html'>tar -c -f - -p --numeric-owner $source_dir_1  | \&lt;br /&gt;  ssh  $destination_host "cd $destination_location ; tar -x -p"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-3871426352117989149?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/3871426352117989149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=3871426352117989149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3871426352117989149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3871426352117989149'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2010/03/move-directory-over-network.html' title='Move a directory over the network'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-4857486810325081293</id><published>2009-12-09T13:32:00.001-08:00</published><updated>2009-12-09T13:33:39.159-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle drop all tables.</title><content type='html'>1). get a list of the tables and construct the drop statement.&lt;br /&gt;    select 'drop table '|| object_name || ' cascade constraint;' from user_objects where object_type = 'TABLE';&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2). run the result.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-4857486810325081293?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/4857486810325081293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=4857486810325081293' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4857486810325081293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4857486810325081293'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/12/oracle-drop-all-tables.html' title='Oracle drop all tables.'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-446606932764831289</id><published>2009-11-24T09:54:00.000-08:00</published><updated>2009-11-24T09:55:33.846-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>set oracle date format</title><content type='html'>&lt;pre&gt;for lazy people like me don't want to use to_date() function.&lt;br /&gt;we can preset the dateformat for the session.&lt;br /&gt;&lt;br /&gt;alter session set NLS_DATE_FORMAT='&lt;my_format&gt;';&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-446606932764831289?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/446606932764831289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=446606932764831289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/446606932764831289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/446606932764831289'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/11/set-oracle-date-format.html' title='set oracle date format'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-316693509381962520</id><published>2009-11-23T14:19:00.000-08:00</published><updated>2009-12-09T15:00:45.370-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>dblink link</title><content type='html'>1) make sure you have create database link privileges.&lt;br /&gt;   login as dba and "grant create database link to $user;&lt;br /&gt;&lt;br /&gt;2).&lt;br /&gt;create database link&lt;br /&gt;$dblinkname connect to $schemaname identified by $schemapassword using '$oracle_sid';&lt;br /&gt;$dblinkname is the identifier for this dblink.&lt;br /&gt;$schemaname is the schema you want to connect&lt;br /&gt;$schemapassword is the normal password for the $schemaname.&lt;br /&gt;$oracle_sid is the connection string. eg host/sid&lt;br /&gt;&lt;br /&gt;to test.&lt;br /&gt;&lt;br /&gt;select * from dual@$dblinkname;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-316693509381962520?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/316693509381962520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=316693509381962520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/316693509381962520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/316693509381962520'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/11/dblink-link.html' title='dblink link'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-747218273178779997</id><published>2009-11-20T11:39:00.000-08:00</published><updated>2009-11-20T11:48:28.663-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>use rman to delete archive log</title><content type='html'>if you are getting&lt;br /&gt;&lt;br /&gt;Enter password: ********&lt;br /&gt;ERROR:&lt;br /&gt;ORA-00257: archiver error. Connect internal only, until freed.&lt;br /&gt;&lt;br /&gt;this error message when you login to your Oracle&lt;br /&gt;&lt;br /&gt;you can use rman to delete some log.&lt;br /&gt;&lt;br /&gt;oracle $ rman target /&lt;br /&gt;rman&gt; delete noprompt archivelog until time 'sysdate - 2' ;&lt;br /&gt;rman&gt; crosscheck backupset;&lt;br /&gt;&lt;br /&gt;This will delete the archive log older than 2 days.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-747218273178779997?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/747218273178779997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=747218273178779997' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/747218273178779997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/747218273178779997'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/11/use-rman-to-delete-archive-log.html' title='use rman to delete archive log'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-8904539469364493202</id><published>2009-10-06T15:35:00.001-07:00</published><updated>2009-10-06T15:35:23.416-07:00</updated><title type='text'>Liferay add user to a community programmtically</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px; border-collapse: collapse; color: rgb(86, 94, 99); line-height: 16px; "&gt;UserLocalServiceUtil.addGroupUsers(groupId, new String[]{userId});&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-8904539469364493202?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/8904539469364493202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=8904539469364493202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8904539469364493202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8904539469364493202'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/10/liferay-add-user-to-community.html' title='Liferay add user to a community programmtically'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-3799805419219757342</id><published>2009-09-28T14:25:00.000-07:00</published><updated>2009-09-28T14:26:45.186-07:00</updated><title type='text'>Web Design Stuff</title><content type='html'>some CSS note:&lt;br /&gt; to hide/show a div tag: display : hide/show;&lt;br /&gt;&lt;br /&gt;to pop up a div tag&lt;br /&gt; position : absolute;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-3799805419219757342?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/3799805419219757342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=3799805419219757342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3799805419219757342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3799805419219757342'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/09/web-design-stuff.html' title='Web Design Stuff'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-5777294763744364021</id><published>2009-08-19T13:37:00.000-07:00</published><updated>2009-08-19T13:42:23.769-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Hi Speed copy Oracle data from one machine to another machine</title><content type='html'>[PREREQUITE]&lt;br /&gt;  SSH SETUP to connect without password&lt;br /&gt;[TARGET MACHINE]&lt;br /&gt;     mknod /tmp/inpipe.dmp p&lt;br /&gt;     imp username/password file=inpipe.dmp &amp;amp;&lt;br /&gt;&lt;br /&gt;[SOURCE MACHINE]&lt;br /&gt;      mknod /tmp/outpipe p&lt;br /&gt;      ssh -C user@target 'cat &gt; /tmp/inpipe.dmp' &lt; /tmp/outpipe &amp;amp;&lt;br /&gt;     exp username/password file=/tmp/outpipe&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-5777294763744364021?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/5777294763744364021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=5777294763744364021' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5777294763744364021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5777294763744364021'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/08/hi-speed-copy-oracle-data-from-one.html' title='Hi Speed copy Oracle data from one machine to another machine'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-1903656330850189306</id><published>2009-08-06T14:53:00.000-07:00</published><updated>2009-08-06T14:56:12.045-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>use exp/imp to copy the data from one db to another</title><content type='html'>&lt;pre&gt;To export Table(s)&lt;br /&gt;exp scott/tiger file=emp.dmp log=emp.log tables=emp rows=yes indexes=no&lt;br /&gt;exp scott/tiger file=emp.dmp tables=(emp,dept)&lt;br /&gt;&lt;br /&gt;To export whole schema&lt;br /&gt;exp scott/tiger file=emp.dmp&lt;br /&gt;&lt;br /&gt;To import&lt;br /&gt;imp scott/tiger file=emp.dmp full=yes&lt;br /&gt;imp scott/tiger file=emp.dmp fromuser=scott touser=scott tables=dept&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-1903656330850189306?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/1903656330850189306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=1903656330850189306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1903656330850189306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1903656330850189306'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/08/use-expimp-to-copy-data-from-one-db-to.html' title='use exp/imp to copy the data from one db to another'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-1113548549883577682</id><published>2009-06-08T09:47:00.000-07:00</published><updated>2010-07-09T22:04:07.515-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='quartz'/><category scheme='http://www.blogger.com/atom/ns#' term='spring'/><title type='text'>Spring + Quartz + Hibernate</title><content type='html'>If you are getting no session error due to the hibernate session is not available to you.&lt;br /&gt;here is the solution.&lt;br /&gt;&lt;br /&gt;create a bean using thetranssactionProxyFactoryBean&lt;br /&gt;[bean id="cpkMailingList" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"]&lt;br /&gt;      [property name="target"]&lt;br /&gt;         [bean  class="com.company.manufacturing.cron.CpkMailingList"]&lt;br /&gt;           [property name="emailTemplate" value="cpkemail.vm" /]&lt;br /&gt;           [property name="sendHTMLMailService" ref="sendHTMLMailService" /]&lt;br /&gt;           [property name="mailingList" value="bli@email.com"/]&lt;br /&gt;           [property name="message" ref="mailMessage" /]&lt;br /&gt;           [property name="fpyManager" ref="fpyManager"/]&lt;br /&gt;           [property name="productManager" ref="productManager" /]&lt;br /&gt;           [property name="appMeasStatManager" ref="appMeasStatManager" /]&lt;br /&gt;         [/bean]&lt;br /&gt;      [/property]&lt;br /&gt;      [property name="transactionAttributes"]&lt;br /&gt;         [props]&lt;br /&gt;            [prop key="sendMail"]PROPAGATION_REQUIRED[/prop]&lt;br /&gt;         [/props]&lt;br /&gt;      [/property]&lt;br /&gt;    [/bean]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-1113548549883577682?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/1113548549883577682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=1113548549883577682' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1113548549883577682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1113548549883577682'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/06/spring-quartz-hibernate.html' title='Spring + Quartz + Hibernate'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-835454476906388873</id><published>2009-05-29T12:40:00.000-07:00</published><updated>2009-05-29T12:42:26.152-07:00</updated><title type='text'>Caching  in Java + Spring</title><content type='html'>Caching is quite important to boost the application performance. There are many cache libraries in Java world, both commercial and open source. You should choose the existing library instead creating your own library. I see some guys in my previous companies develop their own cache, and it is not good for their project. Instead of spending time on project business features, guy spent much time to create the perfect library and maintain it through the project life cycle. Another case is using the Map and its relative classes for caching, it makes the application could not scalable and it does not provide the flexible caching mechanism the cache should have. Of course, we need to create the cache library if there is no good one in the market, but it is not true. There are many good cache libraries in Java world, one of them is Ehcache (http://ehcache.sourceforge.net/). Ehcache is the excellent library provides to community with high quality, good documentation, simple use and wide adoption by other popular frameworks. It takes development team 5-10 minutes to set up the caching (of course, if you are fresher you must spend more time to understand the caching mechanism), so why you do not use such library instead of creating your own library?&lt;br /&gt;&lt;br /&gt;In our application, we use Spring as IoC container, though set up the Ehcache manager is the easy task but we would like to use it with our Spring beans and exposed it as Osgi service. Spring modules is the good library help us easy in configuration. It provides the consistent abstraction caching to our application, hence we can use our cache facade with other caching libraries such as JBoss cache, JCS, OScache without chaging our application code. You could download the Spring Modules at https://springmodules.dev.java.net/.&lt;br /&gt;&lt;br /&gt;Here are the following steps to configure Ehcache in Spring application&lt;br /&gt;&lt;br /&gt;Configuring caching via ehcache.xml file&lt;br /&gt;&lt;br /&gt;[?xml version="1.0" encoding="UTF-8"?]&lt;br /&gt;&lt;br /&gt;[ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&lt;br /&gt; xsi:noNamespaceSchemaLocation="ehcache.xsd"]&lt;br /&gt;&lt;br /&gt; [!--&lt;br /&gt; Configure it if you have overflowToDisk or diskPersistent enabled for any cache.&lt;br /&gt; java.io.tmpdir - Default temp file path&lt;br /&gt; --]&lt;br /&gt; [diskStore path="java.io.tmpdir" /]&lt;br /&gt;&lt;br /&gt; [!--&lt;br /&gt;&lt;br /&gt;    Mandatory Default Cache configuration. These settings will be applied to caches&lt;br /&gt;    created programmtically using CacheManager.add(String cacheName).&lt;br /&gt;&lt;br /&gt;    The defaultCache has an implicit name "default" which is a reserved cache name.&lt;br /&gt;    --]&lt;br /&gt; [defaultCache maxElementsInMemory="10000" eternal="false"&lt;br /&gt;  timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true"&lt;br /&gt;  diskSpoolBufferSizeMB="30" maxElementsOnDisk="10000000"&lt;br /&gt;  diskPersistent="false" diskExpiryThreadIntervalSeconds="120"&lt;br /&gt;  memoryStoreEvictionPolicy="LRU" /]&lt;br /&gt;&lt;br /&gt; [!--&lt;br /&gt;&lt;br /&gt;    Sample cache named sampleCache1&lt;br /&gt;    This cache contains a maximum in memory of 10000 elements, and will expire&lt;br /&gt;    an element if it is idle for more than 5 minutes and lives for more than&lt;br /&gt;    10 minutes.&lt;br /&gt;&lt;br /&gt;    If there are more than 10000 elements it will overflow to the&lt;br /&gt;    disk cache, which in this configuration will go to wherever java.io.tmp is&lt;br /&gt;    defined on your system. On a standard Linux system this will be /tmp"&lt;br /&gt;&lt;br /&gt; --]&lt;br /&gt; [cache name="engroupCache" maxElementsInMemory="10000"&lt;br /&gt;  maxElementsOnDisk="10000000" eternal="false" overflowToDisk="true"&lt;br /&gt;  diskSpoolBufferSizeMB="20" timeToIdleSeconds="300"&lt;br /&gt;  timeToLiveSeconds="600" memoryStoreEvictionPolicy="LFU" /]&lt;br /&gt;[/ehcache]&lt;br /&gt;&lt;br /&gt;Declarating Ehcache in Spring context&lt;br /&gt;&lt;br /&gt;[bean id="cacheManager"&lt;br /&gt; class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"]&lt;br /&gt; [property name="configLocation"]&lt;br /&gt;  [value]classpath:ehcache.xml[/value]&lt;br /&gt; [/property]&lt;br /&gt;[/bean]&lt;br /&gt;[/pre]&lt;br /&gt;[pre lang="xml" xml:space="preserve" xml:lang="xml"]&lt;br /&gt;[bean id="cacheProviderFacade"&lt;br /&gt; class="org.springmodules.cache.provider.ehcache.EhCacheFacade"]&lt;br /&gt; [property name="cacheManager" ref="cacheManager" /]&lt;br /&gt;[/bean]&lt;br /&gt;&lt;br /&gt;Programmatic use&lt;br /&gt;&lt;br /&gt;Using ehcache is so simple, a unit test to make the test whether configuration is set up correctly and take the simple put/get could explain all.&lt;br /&gt;&lt;br /&gt;@RunWith(EngroupClassRunner.class)&lt;br /&gt;@ContextConfiguration(locations = { "/META-INF/spring/cache-context.xml" })&lt;br /&gt;public class CacheTest {&lt;br /&gt;    @Autowired&lt;br /&gt;    protected CacheProviderFacade cacheProviderFacade;&lt;br /&gt;&lt;br /&gt;    @Test&lt;br /&gt;    public void testCacheConfiguration() {&lt;br /&gt;        Assert.assertNotNull(cacheProviderFacade);&lt;br /&gt;&lt;br /&gt;        EhCacheCachingModel model = new EhCacheCachingModel();&lt;br /&gt;        model.setCacheName("engroupCache");&lt;br /&gt;&lt;br /&gt;        cacheProviderFacade.putInCache("a", model, new Integer(1));&lt;br /&gt;        Integer fromCache = (Integer) cacheProviderFacade.getFromCache("a",&lt;br /&gt;                model);&lt;br /&gt;        Assert.assertEquals(new Integer(1), fromCache);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Besides of using ehcache to create the session like variable in our application, we would like to use ehcache to cache SQL statement in iBatis and integrate with Terracotta to complete our distributing caching solution in our future project. I will keep the post on further caching usage in future posts. Keep reading!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-835454476906388873?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/835454476906388873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=835454476906388873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/835454476906388873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/835454476906388873'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/caching-in-java-spring.html' title='Caching  in Java + Spring'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2551337888816436270</id><published>2009-05-26T09:20:00.000-07:00</published><updated>2009-05-26T09:21:44.522-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>use maven to generate auto generate schema</title><content type='html'>add the following to your pom.xml&lt;br /&gt;&lt;br /&gt;change the content inside your srcFile tag and of course convert the [] to the diamond brakets.&lt;br /&gt;&lt;br /&gt;[plugin]&lt;br /&gt;    [groupId]org.codehaus.mojo[/groupId]&lt;br /&gt;    [artifactId]sql-maven-plugin[/artifactId]&lt;br /&gt;    [version]1.0[/version]&lt;br /&gt;    [configuration]&lt;br /&gt;        [driver]${jdbc.driverClassName}[/driver]&lt;br /&gt;        [username]${jdbc.username}[/username]&lt;br /&gt;        [password]${jdbc.password}[/password]&lt;br /&gt;        [url]${jdbc.url}[/url]&lt;br /&gt;        [autocommit]true[/autocommit]&lt;br /&gt;        [skip]${maven.test.skip}[/skip]&lt;br /&gt;    [/configuration]&lt;br /&gt;    [executions]                   &lt;br /&gt;        [execution]&lt;br /&gt;            [id]create-schema[/id]&lt;br /&gt;            [phase]process-test-resources[/phase]&lt;br /&gt;            [goals]&lt;br /&gt;                [goal]execute[/goal]&lt;br /&gt;            [/goals]&lt;br /&gt;            [configuration]&lt;br /&gt;                [autocommit]true[/autocommit]&lt;br /&gt;                [srcFiles]&lt;br /&gt;                    [srcFile]src/test/resources/${jdbc.groupId}-schema.sql[/srcFile]&lt;br /&gt;                [/srcFiles]&lt;br /&gt;            [/configuration]&lt;br /&gt;        [/execution]&lt;br /&gt;    [/executions]&lt;br /&gt;    [dependencies]&lt;br /&gt;        [dependency]&lt;br /&gt;            [groupId]${jdbc.groupId}[/groupId]&lt;br /&gt;            [artifactId]${jdbc.artifactId}[/artifactId]&lt;br /&gt;            [version]${jdbc.version}[/version]&lt;br /&gt;        [/dependency]&lt;br /&gt;    [/dependencies]&lt;br /&gt;[/plugin]&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2551337888816436270?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2551337888816436270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2551337888816436270' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2551337888816436270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2551337888816436270'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/use-maven-to-generate-auto-generate.html' title='use maven to generate auto generate schema'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2748912325021754594</id><published>2009-05-25T15:02:00.001-07:00</published><updated>2009-05-25T18:14:10.076-07:00</updated><title type='text'>Hibernate oneToMany lazy load correctly</title><content type='html'>&lt;div&gt;I found lots of programmers are scratching their heads and try to find out why their lazy loading fetch strategy is not working correctly. There aren't many documents or tutorials in the web to tell you how to solve it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To properly configure the hibernate lazy initialize collection, just follow these steps.&lt;/div&gt;&lt;br /&gt;1). POJO Bean&lt;br /&gt;   1). override equal() and hashCode(). This is very important. I have seen a lots of programmer think these functions are not useful. without override these function, the Hibernate lazy loading will not work correctly.&lt;br /&gt;&lt;br /&gt;   2). in your @OneToMany and @ManyToOne relation attribute. indicate these are lazy loading. To do that. add fetch=fetchType.lazy inside the bracket eg. @ManyToOne(fetch=fetchType.lazy)&lt;br /&gt;&lt;br /&gt;  3). in your web.xml file add the following entities&lt;br /&gt;      &amp;lt;filter-mapping &amp;gt;&lt;br /&gt;       &amp;lt;filter-name&amp;gt;lazyLoadingFilter&amp;lt;/filter-name&amp;gt;&lt;br /&gt;       &amp;lt;url-pattern&amp;gt;/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;      &amp;lt;/filter-mapping&amp;gt;&lt;br /&gt;  and&lt;br /&gt;       &amp;lt;filter&amp;gt;&lt;br /&gt;       &amp;lt;filter-name&amp;gt;lazyLoadingFilter&amp;lt;/filter-name&amp;gt;&lt;br /&gt;       &amp;lt;filter-class&amp;gt;org.springframework.orm.hibernate3.support.OpenSessionInViewFilter&amp;lt;/filter-class&amp;gt;&lt;br /&gt;   &amp;lt;/filter&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2748912325021754594?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2748912325021754594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2748912325021754594' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2748912325021754594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2748912325021754594'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/hibernate-onetomany-lazy-load-correctly.html' title='Hibernate oneToMany lazy load correctly'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-6632081117163114805</id><published>2009-05-25T14:51:00.000-07:00</published><updated>2009-05-25T14:54:42.944-07:00</updated><title type='text'>Hibernate enable lazy loading in your web app</title><content type='html'>In your web.xml file,&lt;br /&gt;&lt;br /&gt;added the following&lt;br /&gt;&lt;br /&gt;[filter-mapping]&lt;br /&gt;       [filter-name]lazyLoadingFilter[/filter-name&gt;&lt;br /&gt;       [url-pattern]/*[/url-pattern]&lt;br /&gt;   [/filter-mapping]&lt;br /&gt;&lt;br /&gt;and&lt;br /&gt;&lt;br /&gt;[filter]&lt;br /&gt;       [filter-name]lazyLoadingFilter[/filter-name]&lt;br /&gt;       [filter-class]org.springframework.orm.hibernate3.support.OpenSessionInViewFilter[/filter-class]&lt;br /&gt;   [/filter]&lt;br /&gt;&lt;br /&gt;replace [ and ] to &amp;gt; and &amp;lt;&lt;br /&gt;damn blogspot editor&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-6632081117163114805?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/6632081117163114805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=6632081117163114805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6632081117163114805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/6632081117163114805'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/hibernate-enable-lazy-loading-in-your.html' title='Hibernate enable lazy loading in your web app'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-3689333269473315379</id><published>2009-05-20T22:38:00.000-07:00</published><updated>2009-05-24T20:07:55.826-07:00</updated><title type='text'>How to use OR to rewrite SQL Query</title><content type='html'>&lt;div&gt;how to optimize the following SQL&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;select * from sys_user &lt;/div&gt;&lt;div&gt;where user_code = 'bli' &lt;/div&gt;&lt;div&gt;or user_code in &lt;/div&gt;&lt;div&gt;(select grp_code &lt;/div&gt;&lt;div&gt;from sys_grp &lt;/div&gt;&lt;div&gt;where sys_grp.user_code = 'bli')&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;0  SELECT STATEMENT Optimizer=RULE&lt;/div&gt;&lt;div&gt;1  0   FILTER&lt;/div&gt;&lt;div&gt;2  1     TABLE ACCESS (FULL) OF 'SYS_USER'&lt;/div&gt;&lt;div&gt;3  1     INDEX (UNIQUE SCAN) OF 'PK_SYS_GRP' (UNIQUE)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;14  recursive calls&lt;/div&gt;&lt;div&gt;4  db block gets&lt;/div&gt;&lt;div&gt;30590 consistent gets&lt;/div&gt;&lt;div&gt;0  physical reads&lt;/div&gt;&lt;div&gt;0  redo size&lt;/div&gt;&lt;div&gt;1723  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;425  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;2  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;0  sorts (memory)&lt;/div&gt;&lt;div&gt;0  sorts (disk)&lt;/div&gt;&lt;div&gt;3  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the result of this query normally contains one or two rows, but sys_user table contains a lots of entries. How can we drive sys_grp?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the table information&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sql &gt; select count(*)  from sys_grp;&lt;/div&gt;&lt;div&gt;count(*)&lt;/div&gt;&lt;div&gt;---------------------&lt;/div&gt;&lt;div&gt;25130&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;sql&gt; select count(*) from sys_user;&lt;/div&gt;&lt;div&gt;Count(*)&lt;/div&gt;&lt;div&gt;----------------------&lt;/div&gt;&lt;div&gt;15190&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;optimize:&lt;/div&gt;&lt;div&gt;1) reduce the logical read is the base principle.&lt;/div&gt;&lt;div&gt;we will try to reduce the logical read to increase the sql query.&lt;/div&gt;&lt;div&gt;we can use or to rewrite this sql&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;select * from sys_user where user_code = 'bli' &lt;/div&gt;&lt;div&gt;union all&lt;/div&gt;&lt;div&gt;select * from sys_user where user_code &lt;&gt; 'bli' &lt;/div&gt;&lt;div&gt;and user_code in (select grp_code from sys_grp &lt;/div&gt;&lt;div&gt;where sys_grp.user_code = 'bli')&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Statistics&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;          0  recursive calls&lt;/div&gt;&lt;div&gt;          0  db block gets&lt;/div&gt;&lt;div&gt;         130 consistent gets&lt;/div&gt;&lt;div&gt;          0  physical reads&lt;/div&gt;&lt;div&gt;          0  redo size&lt;/div&gt;&lt;div&gt;       1723  bytes sent via SQL*Net to client&lt;/div&gt;&lt;div&gt;        425  bytes received via SQL*Net from client&lt;/div&gt;&lt;div&gt;          2  SQL*Net roundtrips to/from client&lt;/div&gt;&lt;div&gt;          1  sorts (memory)&lt;/div&gt;&lt;div&gt;          0  sorts (disk)&lt;/div&gt;&lt;div&gt;          3  rows processed&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Execution Plan&lt;/div&gt;&lt;div&gt;----------------------------------------------------------&lt;/div&gt;&lt;div&gt;0      SELECT STATEMENT Optimizer=RULE&lt;/div&gt;&lt;div&gt;1    0   UNION-ALL&lt;/div&gt;&lt;div&gt;2    1     TABLE ACCESS (BY INDEX ROWID) OF 'SYS_USER'&lt;/div&gt;&lt;div&gt;3    2       INDEX (UNIQUE SCAN) OF 'PK_SYS_USER' (UNIQUE)&lt;/div&gt;&lt;div&gt;4    1     NESTED LOOPS&lt;/div&gt;&lt;div&gt;5    4       VIEW OF 'VW_NSO_1'&lt;/div&gt;&lt;div&gt;6    5         SORT (UNIQUE)&lt;/div&gt;&lt;div&gt;7    6           TABLE ACCESS (BY INDEX ROWID) OF 'SYS_GRP'&lt;/div&gt;&lt;div&gt;8    7             INDEX (RANGE SCAN) OF 'FK_SYS_USER_CODE' (NON-UNIQUE)&lt;/div&gt;&lt;div&gt;9    4       TABLE ACCESS (BY INDEX ROWID) OF 'SYS_USER'&lt;/div&gt;&lt;div&gt;10    9         INDEX (UNIQUE SCAN) OF 'PK_SYS_USER' (UNIQUE)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;with this query, the logically read reduces to 130.  From 30590 to 130 is a huge performance jump&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-3689333269473315379?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/3689333269473315379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=3689333269473315379' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3689333269473315379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3689333269473315379'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/how-to-use-or-to-rewrite-sql-query.html' title='How to use OR to rewrite SQL Query'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2629695363782530387</id><published>2009-05-19T21:21:00.001-07:00</published><updated>2009-05-19T21:27:34.203-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>DBMS_STAT tables and backup the stat informaiton</title><content type='html'>when we use DBMS_STAT to analyze the DB, we need to save previous analyze data in case of the stat data decrease the system performance.&lt;br /&gt;&lt;br /&gt;to create a stat backup.&lt;br /&gt;login to sqlplus&lt;br /&gt;&lt;br /&gt;SQL&gt; begin&lt;br /&gt;2 dbms_stats.create_stat_table(ownname =&gt; 'TEST',stattab =&gt; 'STAT_TABLE');&lt;br /&gt;3 end;&lt;br /&gt;4 /&lt;br /&gt;&lt;br /&gt;analyze information&lt;br /&gt; SQL&gt; BEGIN&lt;br /&gt;2 --DBMS_STATS.delete_table_stats(ownname =&gt; 'TEST',tabname =&gt; 'A');&lt;br /&gt;3 DBMS_STATS.gather_table_stats(ownname =&gt; 'TEST',tabname =&gt; 'A');&lt;br /&gt;4 END;&lt;br /&gt;5 /&lt;br /&gt;&lt;br /&gt;export analyzed data to stat_table&lt;br /&gt;SQL&gt; BEGIN&lt;br /&gt;2 dbms_stats.export_table_stats(ownname =&gt; 'TEST',tabname =&gt; 'A',stattab =&gt; 'STAT_TABLE');&lt;br /&gt;3 END;&lt;br /&gt;4 /&lt;br /&gt;&lt;br /&gt;check how many rows in a table&lt;br /&gt;SQL&gt; select count(*) from stat_table;&lt;br /&gt;&lt;br /&gt;delete analyzed data&lt;br /&gt;SQL&gt; BEGIN&lt;br /&gt;2 DBMS_STATS.delete_table_stats(ownname =&gt; 'TEST',tabname =&gt; 'A');&lt;br /&gt;3 END;&lt;br /&gt;4 /&lt;br /&gt;&lt;br /&gt;import analyzed data&lt;br /&gt;SQL&gt; BEGIN&lt;br /&gt;2 DBMS_STATS.import_table_stats(ownname =&gt; 'TEST',tabname =&gt; 'A',stattab =&gt; 'STAT_TABLE');&lt;br /&gt;3 END;&lt;br /&gt;4 /&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Done&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2629695363782530387?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2629695363782530387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2629695363782530387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2629695363782530387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2629695363782530387'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/dbmsstat-tables-and-backup-stat.html' title='DBMS_STAT tables and backup the stat informaiton'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-8530696182849989933</id><published>2009-05-19T21:13:00.000-07:00</published><updated>2009-05-19T21:18:08.643-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle show parameters tips and tricks</title><content type='html'>To check Oracle parameters, you can use "show Parameters". Show parameters can be run as fuzzy query.&lt;br /&gt;&lt;br /&gt;for instance, if I want to check "db_" parameters, I can use &lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter db_;&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;&lt;br /&gt;db_16k_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_2k_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_32k_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_4k_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_8k_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_block_buffers integer 0&lt;br /&gt;&lt;br /&gt;db_block_checking string FALSE&lt;br /&gt;&lt;br /&gt;db_block_checksum string TRUE&lt;br /&gt;&lt;br /&gt;db_block_size integer 8192&lt;br /&gt;&lt;br /&gt;db_cache_advice string ON&lt;br /&gt;&lt;br /&gt;db_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;&lt;br /&gt;db_create_file_dest string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_1 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_2 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_3 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_4 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_5 string&lt;br /&gt;&lt;br /&gt;db_domain string&lt;br /&gt;&lt;br /&gt;db_file_multiblock_read_count integer 8&lt;br /&gt;&lt;br /&gt;db_file_name_convert string&lt;br /&gt;&lt;br /&gt;db_files integer 200&lt;br /&gt;&lt;br /&gt;db_flashback_retention_target integer 1440&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;&lt;br /&gt;db_keep_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_name string Ora813&lt;br /&gt;&lt;br /&gt;db_recovery_file_dest string /home/oracle/product/10.2.0/flash&lt;br /&gt;&lt;br /&gt;_recovery_area&lt;br /&gt;&lt;br /&gt;db_recovery_file_dest_size big integer 2G&lt;br /&gt;&lt;br /&gt;db_recycle_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_unique_name string Ora813&lt;br /&gt;&lt;br /&gt;db_writer_processes integer 1&lt;br /&gt;&lt;br /&gt;dbwr_io_slaves integer 0&lt;br /&gt;&lt;br /&gt;rdbms_server_dn string&lt;br /&gt;&lt;br /&gt;standby_archive_dest string %ORACLE_HOME%/RDBMS&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;&lt;br /&gt;standby_file_management string MANUAL&lt;br /&gt;&lt;br /&gt;SQL&gt; spool off;&lt;br /&gt;&lt;br /&gt;I have difficulty to remember all these parameters. Oracle have already thought about these and you can use fuzzy to query the parameters.&lt;br /&gt;&lt;br /&gt;SQL&gt; show parameter db_c;&lt;br /&gt;&lt;br /&gt;NAME TYPE VALUE&lt;br /&gt;&lt;br /&gt;------------------------------------ ----------- ------------------------------&lt;br /&gt;&lt;br /&gt;db_cache_advice string ON&lt;br /&gt;&lt;br /&gt;db_cache_size big integer 0&lt;br /&gt;&lt;br /&gt;db_create_file_dest string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_1 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_2 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_3 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_4 string&lt;br /&gt;&lt;br /&gt;db_create_online_log_dest_5 string&lt;br /&gt;&lt;br /&gt;SQL&gt; spool off;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-8530696182849989933?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/8530696182849989933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=8530696182849989933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8530696182849989933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8530696182849989933'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/oracle-show-parameters-tips-and-tricks.html' title='Oracle show parameters tips and tricks'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-3755198833011132543</id><published>2009-05-19T21:05:00.001-07:00</published><updated>2009-05-19T21:11:40.812-07:00</updated><title type='text'>Oracle lag and Lead</title><content type='html'>LAG(EXPRESSION,[OFFSET],[DEFAULT])&lt;br /&gt;&lt;br /&gt;SQL&gt; with a as (select 1 id,'a' name from dual&lt;br /&gt;2 union&lt;br /&gt;3 select 2 id,'b' name from dual&lt;br /&gt;4 union&lt;br /&gt;5 select 3 id,'c' name from dual&lt;br /&gt;6 union&lt;br /&gt;7 select 4 id,'d' name from dual&lt;br /&gt;8 union&lt;br /&gt;9 select 5 id,'e' name from dual&lt;br /&gt;10 )&lt;br /&gt;11 select id,name,lag(id,1,'')over(order by name) from a&lt;br /&gt;12 /&lt;br /&gt;&lt;br /&gt;ID NAME LAG(ID,1,'')OVER(ORDERBYNAME)&lt;br /&gt;---------- ---- -----------------------------&lt;br /&gt;1 a &lt;br /&gt;2 b 1&lt;br /&gt;3 c 2&lt;br /&gt;4 d 3&lt;br /&gt;5 e 4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;LEAD(EXPRESION,[OFFSET],[DEFAULT])&lt;br /&gt;&lt;br /&gt;SQL&gt; with a as (select 1 id,'a' name from dual&lt;br /&gt;2 union&lt;br /&gt;3 select 2 id,'b' name from dual&lt;br /&gt;4 union&lt;br /&gt;5 select 3 id,'c' name from dual&lt;br /&gt;6 union&lt;br /&gt;7 select 4 id,'d' name from dual&lt;br /&gt;8 union&lt;br /&gt;9 select 5 id,'e' name from dual&lt;br /&gt;10 )&lt;br /&gt;11 select id,name,lead(id,1,'')over(order by name) from a&lt;br /&gt;12 /&lt;br /&gt;&lt;br /&gt;ID NAME LEAD(ID,1,'')OVER(ORDERBYNAME)&lt;br /&gt;---------- ---- ------------------------------&lt;br /&gt;1 a 2&lt;br /&gt;2 b 3&lt;br /&gt;3 c 4&lt;br /&gt;4 d 5&lt;br /&gt;5 e&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-3755198833011132543?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/3755198833011132543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=3755198833011132543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3755198833011132543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3755198833011132543'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/oracle-lag-and-lead.html' title='Oracle lag and Lead'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-4001406391494325667</id><published>2009-05-18T20:54:00.000-07:00</published><updated>2009-05-18T21:05:29.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><title type='text'>Use Maven to manage your Java Project</title><content type='html'>Maven have lots of cool features. In this post, I am writing for how to craete single executable jar file that includes all the dependended libraries. This plug-in is called assembly.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;for how to use this plugin. please visit &lt;a href="http://maven.apache.org/plugins/maven-assembly-plugin"&gt;http://maven.apache.org/plugins/maven-assembly-plugin&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-4001406391494325667?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/4001406391494325667/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=4001406391494325667' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4001406391494325667'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4001406391494325667'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/use-maven-to-manage-your-java-project.html' title='Use Maven to manage your Java Project'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2222503725794382617</id><published>2009-05-18T18:16:00.000-07:00</published><updated>2009-05-18T20:08:13.144-07:00</updated><title type='text'>Oracle Analytic Fucntions</title><content type='html'>&lt;span class="Apple-style-span"   style="border-collapse: collapse;  line-height: 19px; font-family:'Trebuchet MS';font-size:13px;"&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Oracle Analytic Fucntions&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;The general syntax of analytic function is:&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Function(arg1,..., argn) OVER ( [PARTITION BY &lt;...&gt;] [ORDER BY &lt;....&gt;] [] )&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;is like "ROW " or "RANK " &lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;the usages are:&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Types of Analytical Functions&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Ranking Functions&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;This family consists of rank, dense_rank, row_number, ntile,percent_rank and cume_dist.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;See also dense rank vs rank vs row_number.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Window Functions&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Window Functions consist of all agregate functions (sum,max, avg...)&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Reporting Functions&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;These are queries that ask something like: find the sales that contribute 10 % or more to total sales. The most prominent function for this is ratio_to_report.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Lag/Lead Functions&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Lag/Lead functions make it possible to access values in other rows than the current one. The corresponding functions are lag and lead.&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;The partition clause&lt;/p&gt;&lt;p style="margin-top: 0px; margin-right: 0px; margin-bottom: 1.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;An important part in analytic functions is the Partition Claus&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2222503725794382617?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2222503725794382617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2222503725794382617' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2222503725794382617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2222503725794382617'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/oracle-analytic-fucntions.html' title='Oracle Analytic Fucntions'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-4063438680072120111</id><published>2009-05-13T23:36:00.001-07:00</published><updated>2009-05-13T23:36:32.117-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DBA'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>measuring Oracle cache hit rate</title><content type='html'>&lt;div&gt;rem-------------------------------------------&lt;/div&gt;&lt;div&gt;rem measuring cache hitrate&lt;/div&gt;&lt;div&gt;rem ------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- Collecting initial cache hit rate...&lt;/div&gt;&lt;div&gt;SELECT ROUND((1-(phy.value / (cur.value + con.value)))*100,2) "Cache Hit Ratio"&lt;/div&gt;&lt;div&gt;FROM v$sysstat cur, v$sysstat con, v$sysstat phy&lt;/div&gt;&lt;div&gt;WHERE cur.name = 'db block gets'&lt;/div&gt;&lt;div&gt;AND con.name = 'consistent gets'&lt;/div&gt;&lt;div&gt;AND phy.name = 'physical reads'&lt;/div&gt;&lt;div&gt;/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- intervent to increase cache hit rate...&lt;/div&gt;&lt;div&gt;DECLARE&lt;/div&gt;&lt;div&gt;v_dummy dual.dummy%TYPE;&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;FOR I IN 1..1000 LOOP&lt;/div&gt;&lt;div&gt;SELECT dummy INTO v_dummy FROM dual;&lt;/div&gt;&lt;div&gt;END LOOP;&lt;/div&gt;&lt;div&gt;END;&lt;/div&gt;&lt;div&gt;/&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- collect again...&lt;/div&gt;&lt;div&gt;SELECT ROUND((1-(phy.value / (cur.value + con.value)))*100,2) "Cache Hit Ratio"&lt;/div&gt;&lt;div&gt;FROM v$sysstat cur, v$sysstat con, v$sysstat phy&lt;/div&gt;&lt;div&gt;WHERE cur.name = 'db block gets'&lt;/div&gt;&lt;div&gt;AND con.name = 'consistent gets'&lt;/div&gt;&lt;div&gt;AND phy.name = 'physical reads'&lt;/div&gt;&lt;div&gt;/&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-4063438680072120111?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/4063438680072120111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=4063438680072120111' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4063438680072120111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4063438680072120111'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/measuring-oracle-cache-hit-rate_13.html' title='measuring Oracle cache hit rate'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-7856553042060622941</id><published>2009-05-13T22:53:00.000-07:00</published><updated>2009-05-13T23:23:42.219-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Quick and Easy ways to copy Oracle Schema method 1</title><content type='html'>exp/imp can be used to export/import data to or from schema&lt;br /&gt;&lt;br /&gt;the syntax is &lt;span style="font-weight:bold;"&gt;&lt;/span&gt;&lt;div&gt;to export:&lt;/div&gt;&lt;div&gt;&lt;span style="font-weight:bold;"&gt;$exp username/password inctype=[complete||incremental] file=file.dmp&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;to import:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:宋体;"&gt;&lt;span class="Apple-style-span"  style="font-size:large;"&gt;imp username/password inctype= RECTORE FULL=Y FILE=file.dmp&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  font-weight: bold;font-family:宋体;font-size:18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  font-weight: bold;font-family:宋体;font-size:18px;"&gt;please note. to import, you need to create enough room for rollback.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  font-weight: bold;font-family:宋体;font-size:18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  font-weight: bold;font-family:宋体;font-size:18px;"&gt;next time, I will take about to use new tool called datapump to export/import schema. data pump only available for oracle 10+.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  font-weight: bold;font-family:宋体;font-size:18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-7856553042060622941?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/7856553042060622941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=7856553042060622941' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7856553042060622941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7856553042060622941'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/quick-and-easy-ways-to-copy-oracle.html' title='Quick and Easy ways to copy Oracle Schema method 1'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-1492167786715782434</id><published>2009-05-12T23:34:00.000-07:00</published><updated>2009-05-13T00:25:54.355-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='iText'/><category scheme='http://www.blogger.com/atom/ns#' term='pdf'/><category scheme='http://www.blogger.com/atom/ns#' term='Maven'/><category scheme='http://www.blogger.com/atom/ns#' term='NetBeans'/><title type='text'>5 easy steps to create a PDF Document in Java</title><content type='html'>Recently, my company has asked me to create some histograms in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;pdf&lt;/span&gt; format. &lt;div&gt;The first thing comes to my mind is to use &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;Jasper Report&lt;/span&gt;. After talking to one of my &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;colleagues, I decided to use iText to generate the pdf document.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Generate a pdf document is not a rocket science. Here are the steps how I do it in Netbeans( I believe it should be same as in Eclipse). I assume you have installed Maven plugin for your Netbeans. If you haven't done so, please install it. Maven will make your programming life much easier.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Setup the environment first.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;1). Create a maven project in NetBeans.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;2). open the project description file pom.xml. this file is located inside your &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Project Files&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;3). inside the &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;dependencies&lt;/span&gt; tag, add an iText dependeny&lt;/div&gt;&lt;div&gt;    &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt; &amp;lt;dependency&amp;gt&lt;/div&gt;&lt;div&gt;        &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&amp;lt;groupid&amp;gt;com.lowagie&amp;lt;/groupid&amp;gt;&lt;/div&gt;&lt;div&gt;        &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&amp;lt;artifactid&amp;gt;itext&amp;lt;/artifactid&amp;gt;&lt;/div&gt;&lt;div&gt;        &lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&amp;lt;version&amp;gt;2.1.5&amp;lt;/version&amp;gt;&lt;/div&gt;&lt;div&gt;        &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &amp;lt;/dependency&amp;gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;   &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;4). right click on the Libraries folder and select download all libraries.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;     2.  inside your main function.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Document doc = new Document();         &lt;/div&gt;&lt;div&gt;       PdfWriter.getInstance(doc, new FileOutputStream("/tmp/helloWorld.pdf"));         &lt;/div&gt;&lt;div&gt;       doc.open();&lt;/div&gt;&lt;div&gt;       doc.add(new Paragraph("Hello from iText PDF"));&lt;/div&gt;&lt;div&gt;        doc.close();&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    3. click on Run.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    4. a file named helloWorld.pdf should located in /tmp directory.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;    5. there is no step 5.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is just the sample to illustruate how easy it is to create PDF file by using Netbean and Maven. If you have some questions, please let me know.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;       &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-1492167786715782434?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/1492167786715782434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=1492167786715782434' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1492167786715782434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1492167786715782434'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/5-easy-steps-to-create-pdf-document.html' title='5 easy steps to create a PDF Document in Java'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-1406280735385086037</id><published>2009-05-12T11:13:00.000-07:00</published><updated>2009-05-12T11:17:50.938-07:00</updated><title type='text'>Difference between "in (...)" and "= any(...)" queries when using arrays</title><content type='html'>I was playing with "in (...)"  and "= any (...)" queries and found a&lt;br /&gt;difference between them and I wonder:&lt;br /&gt;&lt;br /&gt;why this works:&lt;br /&gt;&lt;br /&gt;select * from table_of_integers where integer_column = any (array[5,6]);&lt;br /&gt;&lt;br /&gt;and this doesn't:&lt;br /&gt;&lt;br /&gt;select * from table_of_integers where integer_column in (array[5,6]);&lt;br /&gt;&lt;br /&gt;Although documentation says:&lt;br /&gt;&lt;br /&gt;9.20.4. ANY/SOME&lt;br /&gt;&lt;br /&gt;[...]&lt;br /&gt;SOME is a synonym for ANY. IN is equivalent to = ANY.&lt;br /&gt;[...]&lt;br /&gt;&lt;br /&gt;I thought that if IN is equivalent to = any, both queries above should work.&lt;br /&gt;&lt;br /&gt;after "google is your friend", I am able to find my answers.&lt;br /&gt;&lt;br /&gt;the answers are&lt;br /&gt;&lt;br /&gt;select * from table_of_integers where integer_column = any (array[5,6]);&lt;br /&gt;&lt;br /&gt;This checks if integer_column matches any value in the specified array.&lt;div class="im"&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"&gt; select * from table_of_integers where integer_column in (array[5,6]);&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/div&gt; This checks if integer_column IS an array[5,6] (which it isn't).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-1406280735385086037?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/1406280735385086037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=1406280735385086037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1406280735385086037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1406280735385086037'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/difference-between-in-and-any-queries.html' title='Difference between &quot;in (...)&quot; and &quot;= any(...)&quot; queries when using arrays'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-4089060160314748205</id><published>2009-05-11T22:02:00.000-07:00</published><updated>2009-05-11T22:03:34.025-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Linux hacks'/><category scheme='http://www.blogger.com/atom/ns#' term='File system'/><title type='text'>Converting an ext3 filesystem to ext4</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: -webkit-sans-serif; font-size: 13px; line-height: 19px; "&gt;&lt;h2 style="color: black; background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; font-weight: normal; margin-top: 0px; margin-right: 0px; margin-left: 0px; padding-top: 0.5em; padding-bottom: 0.17em; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(170, 170, 170); font-size: 150%; margin-bottom: 0.6em; background-position: initial initial; "&gt;&lt;span class="Apple-style-span" style="font-size: 13px; "&gt;since ext4 is backwards compatible, you can mount an ext3 partition as ext4:&lt;/span&gt;&lt;br /&gt;&lt;/h2&gt;&lt;div style="background-color: rgb(255, 224, 224); color: rgb(0, 0, 0); padding-top: 0.05em; padding-right: 0.5em; padding-bottom: 0.05em; padding-left: 0.5em; margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: rgb(204, 102, 102); border-right-color: rgb(204, 102, 102); border-bottom-color: rgb(204, 102, 102); border-left-width: 10px; border-left-style: solid; border-left-color: rgb(204, 102, 102); font-size: 92%; white-space: pre; font-family: monospace; width: 55%; "&gt;mount -t ext4 /dev/&lt;i&gt;device&lt;/i&gt; /mnt/&lt;i&gt;mountpoint&lt;/i&gt;&lt;/div&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;where &lt;i&gt;device&lt;/i&gt; is the device you want to mount, and &lt;i&gt;mountpoint&lt;/i&gt; is where you want to mount it.&lt;/p&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;The filesystem will not, however, use many of the new features of ext4. You can enable those with the following:&lt;/p&gt;&lt;div style="padding-top: 0.2em; padding-right: 0.3em; padding-bottom: 0.2em; padding-left: 0.3em; margin-top: 0.2em; margin-right: 0.2em; margin-bottom: 0.2em; margin-left: 0.2em; background-color: rgb(255, 193, 193); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(255, 112, 112); border-right-color: rgb(255, 112, 112); border-bottom-color: rgb(255, 112, 112); border-left-color: rgb(255, 112, 112); font-size: 92%; "&gt;&lt;b&gt;Warning:&lt;/b&gt; This will make the filesystem unable to be mounted as ext3&lt;/div&gt;&lt;div style="background-color: rgb(255, 224, 224); color: rgb(0, 0, 0); padding-top: 0.05em; padding-right: 0.5em; padding-bottom: 0.05em; padding-left: 0.5em; margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: rgb(204, 102, 102); border-right-color: rgb(204, 102, 102); border-bottom-color: rgb(204, 102, 102); border-left-width: 10px; border-left-style: solid; border-left-color: rgb(204, 102, 102); font-size: 92%; white-space: pre; font-family: monospace; width: 55%; "&gt;tune2fs -O extents,uninit_bg,dir_index /dev/&lt;i&gt;device&lt;/i&gt;&lt;/div&gt;&lt;p style="margin-top: 0.4em; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; line-height: 1.5em; "&gt;It is important that you then run fsck, to make sure everything is ok:&lt;/p&gt;&lt;div style="background-color: rgb(255, 224, 224); color: rgb(0, 0, 0); padding-top: 0.05em; padding-right: 0.5em; padding-bottom: 0.05em; padding-left: 0.5em; margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; margin-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: rgb(204, 102, 102); border-right-color: rgb(204, 102, 102); border-bottom-color: rgb(204, 102, 102); border-left-width: 10px; border-left-style: solid; border-left-color: rgb(204, 102, 102); font-size: 92%; white-space: pre; font-family: monospace; width: 55%; "&gt;fsck -pf /dev/&lt;i&gt;device&lt;/i&gt;&lt;/div&gt;&lt;div style="padding-top: 0.2em; padding-right: 0.3em; padding-bottom: 0.2em; padding-left: 0.3em; margin-top: 0.2em; margin-right: 0.2em; margin-bottom: 0.2em; margin-left: 0.2em; background-color: rgb(193, 255, 193); border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(0, 176, 0); border-right-color: rgb(0, 176, 0); border-bottom-color: rgb(0, 176, 0); border-left-color: rgb(0, 176, 0); font-size: 92%; width: 65%; "&gt;&lt;b&gt;Note:&lt;/b&gt; Using this method, new files will be created using the "extents" method, but old files will not be automatically converted&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-4089060160314748205?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/4089060160314748205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=4089060160314748205' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4089060160314748205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4089060160314748205'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/converting-ext3-filesystem-to-ext4.html' title='Converting an ext3 filesystem to ext4'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-5315819398023657839</id><published>2009-05-11T21:35:00.000-07:00</published><updated>2009-05-11T21:38:15.291-07:00</updated><title type='text'>Appfuse experience</title><content type='html'>appfuse is an opensource framework. it glues some of the best Java Open source frameworks out there.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Appfuse is build on top of Spring framework. it can be use JPA, Hibernate and iBatic for the data layer persistence. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;you can download appfuse from www.appfuse.org&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-5315819398023657839?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/5315819398023657839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=5315819398023657839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5315819398023657839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5315819398023657839'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/appfuse-experience.html' title='Appfuse experience'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-1989743359833710993</id><published>2009-05-11T19:26:00.000-07:00</published><updated>2009-05-11T21:34:03.585-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Putty'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux hacks'/><title type='text'>Poor man VPN using SSH Tunnelling</title><content type='html'>&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;!-- Social Bookmarks BEGIN --&gt;&lt;em&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-1989743359833710993?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/1989743359833710993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=1989743359833710993' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1989743359833710993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/1989743359833710993'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/poor-man-vpn-using-ssh-tunnelling.html' title='Poor man VPN using SSH Tunnelling'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-4511605371852956619</id><published>2009-05-11T19:03:00.000-07:00</published><updated>2009-05-11T19:09:52.663-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PostgreSQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Tips: Alter postgresql.conf to increase PostgreSQL performance</title><content type='html'>The default configuration PostgreSQL ships with is a very solid configuration aimed at everyone's best guess as to how an "average" database on "average"  hardware should be setup. This article aims to help PostgreSQL users of all  levels better understand PostgreSQL performance tuning.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; There are several postmaster options that can be set that drastically  affect performance, below is a list of the most commonly used and how  they effect performance: &lt;/p&gt;  &lt;ul class="pgtuning"&gt;&lt;li&gt; &lt;em&gt;max_connections = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; — This option sets the  maximum number of database backend to have at any one time.  Use this  feature to ensure that you do not launch so many backends that you begin  swapping to disk and kill the performance of all the children.  Depending  on your application it may be better to deny the connection entirely  rather than degrade the performance of all of the other children.  &lt;/li&gt;&lt;li&gt; &lt;em&gt;shared_buffers = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; — Editing this option is the simplest way to improve the performance of your database server. The default is pretty low for most modern hardware. General wisdom says that this should be set to roughly 25% of available RAM on the system. Like most of the options I will outline here you will simply need to try them at different levels (both up and down ) and see how well it works on your particular system. Most people find that setting it larger than a third starts to degrade performance. &lt;/li&gt;&lt;li&gt; &lt;em&gt;effective_cache_size = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; — This value tells PostgreSQL's optimizer how much memory PostgreSQL has available for caching data and helps in determing whether or not it use an index or not. The larger the value increases the likely hood of using an index. This should be set to the amount of memory allocated to shared_buffers plus the amount of OS cache available. Often this is more than 50% of the total system memory. &lt;/li&gt;&lt;li&gt; &lt;em&gt;work_mem = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; — This option is used to control the amount of memory using in sort operations and hash tables.  While you may need to increase the amount of memory if you do a ton of sorting in your application, care needs to be taken.  This isn't a system wide parameter, but a per operation one.  So if a complex query has several sort operations in it it will use multiple work_mem units of memory.  Not to mention that multiple backends could be doing this at once.  This query can often lead your database server to swap if the value is too large.  This option was previously called &lt;em&gt;sort_mem&lt;/em&gt; in older versions of PostgreSQL.  &lt;/li&gt;&lt;li&gt; &lt;em&gt;max_fsm_pages = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; — This option helps to control the free space map.  When something is deleted from a table it isn't  removed from the disk immediately, it is simply marked as "free" in the free space map.  The space can then be reused for any new INSERTs that you do on the table.  If your setup has a high rate of DELETEs and INSERTs it may be necessary increase this value to avoid table bloat. &lt;/li&gt;&lt;li&gt; &lt;em&gt;fsync = &lt;boolean&gt;&lt;/boolean&gt;&lt;/em&gt; —  This option determines if all your WAL pages are fsync()'ed to disk before a transactions is committed.  Having this on is safer, but can reduce write performance. If fsync is not enabled there is the chance of unrecoverable data corruption. Turn this off at your own risk.  &lt;/li&gt;&lt;li&gt; &lt;em&gt;commit_delay = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; and &lt;em&gt;commit_siblings = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; — These options are used in concert to help improve performance by writing out multiple transactions that are committing at once. If there are commit_siblings number of backends active at the instant your transaction is committing then the server waiting commit_delay microseconds to try and commit multiple transactions at once. &lt;/li&gt;&lt;li&gt; &lt;em&gt;random_page_cost = &lt;num&gt;&lt;/num&gt;&lt;/em&gt; — random_page_cost controls the way PostgreSQL views non-sequential disk reads.  A higher value makes it more likely that a sequential scan will be used over an index scan indicating that your server has very fast disks. &lt;/li&gt;&lt;/ul&gt;  &lt;div style="border: 1px solid rgb(153, 153, 153); margin: 5px; display: block; float: right; background-color: rgb(156, 190, 208); width: 225px;"&gt;     &lt;p style="margin: 0pt; padding: 5px;"&gt;      If this is still confusing to you, Revolution Systems does offer a     &lt;a href="mailto:benli3060@gmail.com"&gt;PostgreSQL Tuning Service&lt;/a&gt;     &lt;/p&gt; &lt;/div&gt;   &lt;p&gt; Note that many of these options consume shared memory and it will probably be necessary to increase the amount of shared memory allowed on your system to get the most out of these options.  &lt;/p&gt;   &lt;h3&gt;Hardware Issues&lt;/h3&gt;   &lt;p&gt; Obviously the type and quality of the hardware you use for your database server drastically impacts the performance of your database.  Here are a few tips to use when purchasing hardware for your database server (in order of importance):  &lt;/p&gt;   &lt;ul&gt;&lt;li&gt;&lt;strong&gt;RAM&lt;/strong&gt; —  The more RAM you have the more disk   cache you will have.  This greatly impacts performance considering    memory I/O is thousands of times faster than disk I/O.     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Disk types&lt;/strong&gt; — Obviously fast Ultra-320 SCSI   disks are your best option, however high end SATA drives are also    very good.  With SATA each disk is substantially cheaper and with that   you can afford more spindles than with SCSI on the same budget.    &lt;/li&gt;&lt;li&gt;&lt;strong&gt;Disk configuration&lt;/strong&gt; — The optimum configuration   is RAID 1+0 with as many disks as possible and with your transaction log   (pg_xlog) on a separate disk ( or stripe ) all by itself. RAID 5 is not    a very good option for databases unless you have more than 6 disks in    your volume.  With newer versions of PostgreSQL you can also use the    tablespaces option to put different tables, databases, and indexes on    different disks to help optimize performance.  Such as putting your often    used tables on a fast SCSI disk and the less used ones slower    IDE or SATA drives.     &lt;/li&gt;&lt;li&gt;&lt;strong&gt;CPUs&lt;/strong&gt; — The more CPUs the better, however   if your database does not use many complex functions your money is   best spent on more RAM or a better disk subsystem.    &lt;/li&gt;&lt;/ul&gt;   &lt;p&gt; In general the more RAM and disk spindles you have in your system the better it will perform. This is because with the extra RAM you will access your disks less.  And the extra spindles help spread the reads and writes over multiple disks to increase throughput and to reduce  drive head congestion. &lt;/p&gt;   &lt;p&gt; Another good idea is to separate your application code and your database server onto different hardware.  Not only does this provide more hardware dedicated to the database server, but the operating system's disk cache will contain more PostgreSQL data and not other various application or system data this way.  &lt;/p&gt;  &lt;p&gt; For example, if you have one web server and one database server you can use a cross-over cable on a separate ethernet interface to handle just  the web server to database network traffic to ensure you reduce any possible bottlenecks there.  You can also obviously create an entirely different physical network for database traffic if you have multiple servers that access the same database server. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-4511605371852956619?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/4511605371852956619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=4511605371852956619' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4511605371852956619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/4511605371852956619'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/quick-tip-to-increase-postgresql.html' title='Tips: Alter postgresql.conf to increase PostgreSQL performance'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-7937480711997046840</id><published>2009-05-09T11:44:00.000-07:00</published><updated>2009-05-09T11:56:14.728-07:00</updated><title type='text'>Writing your own Velocity macro</title><content type='html'>Velocity is a Java Template Engine. Velocity can be generate Highlighted source code view, SQL, reports in variable forms. By using velocity, developers can seperate the code logic and the views.&lt;br /&gt;&lt;br /&gt;these are the logics&lt;br /&gt;&lt;br /&gt;#if   #else   #end   -- conditional&lt;br /&gt;#foreach  #end  -- Iteration&lt;br /&gt;&lt;br /&gt;#set() assign new variable value&lt;br /&gt;&lt;br /&gt;#stop stop execution the following&lt;br /&gt;#evaluate() evaluate a function&lt;br /&gt;#define&lt;br /&gt;&lt;br /&gt;#macro&lt;br /&gt;&lt;br /&gt;to define your own macro&lt;br /&gt;&lt;br /&gt;&lt;span id="zoom" class="a14c"&gt;&lt;pre&gt;#macro(invoke $__p_page)&lt;br /&gt;   #if($__p_page.startsWith("/"))&lt;br /&gt;       #parse($__p_page)&lt;br /&gt;   #else&lt;br /&gt;       #set($__uri = $resource.this_vm())&lt;br /&gt;       #set($__path = $__uri.substring(0, $__uri.lastIndexOf("/")))&lt;br /&gt;       #parse("$__path/$__p_page")&lt;br /&gt;   #end&lt;br /&gt;#end&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;to use it.&lt;br /&gt;&lt;br /&gt;#invoke( hello.vm)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span id="zoom" class="a14c"&gt;&lt;center&gt;&lt;br /&gt;&lt;/center&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-7937480711997046840?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/7937480711997046840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=7937480711997046840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7937480711997046840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7937480711997046840'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/writing-your-own-velocity-macro.html' title='Writing your own Velocity macro'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-908867674642149629</id><published>2009-05-08T16:45:00.001-07:00</published><updated>2009-05-08T16:46:24.801-07:00</updated><title type='text'>NC linux command</title><content type='html'>Today, I  discover a nice network utility tool call nc&lt;br /&gt;&lt;br /&gt;you can use it for troubleshooting your network apps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-908867674642149629?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/908867674642149629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=908867674642149629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/908867674642149629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/908867674642149629'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/nc-linux-command.html' title='NC linux command'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2507914358577263503</id><published>2009-05-08T16:33:00.001-07:00</published><updated>2009-05-11T22:19:49.375-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ford'/><category scheme='http://www.blogger.com/atom/ns#' term='suv'/><category scheme='http://www.blogger.com/atom/ns#' term='Car'/><category scheme='http://www.blogger.com/atom/ns#' term='Escape'/><title type='text'>Ford Escape</title><content type='html'>Yes, finally. I got my Ford Escape today.&lt;br /&gt;&lt;br /&gt;I like this small suv very much. Compare to my 98 Acura Integra. This car is big and comfy.&lt;br /&gt;&lt;br /&gt;will post some pictures when I have time&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2507914358577263503?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2507914358577263503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2507914358577263503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2507914358577263503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2507914358577263503'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/05/ford-escape.html' title='Ford Escape'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-2816840696700665588</id><published>2009-04-22T12:53:00.000-07:00</published><updated>2009-04-22T12:54:27.580-07:00</updated><title type='text'>move/rename oracle datafiles</title><content type='html'>&lt;p&gt;To properly move the datafile &lt;a id="KonaLink2" target="undefined" class="kLink" style="text-decoration: underline ! important; position: static;" href="http://www.mydigitallife.info/2007/08/04/how-to-rename-or-move-oracle-tablespace-datafile-to-another-location/#"&gt;&lt;span style="color: blue ! important; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;Bitstream Vera Sans&amp;quot;,Verdana,Arial,&amp;quot;Lucida Sans&amp;quot;,&amp;quot;Lucida Sans Unicode&amp;quot;,Helvetica,sans-serif; font-weight: 400; font-size: 13px; position: static;color:blue;" &gt;&lt;span class="kLink" style="border-bottom: 1px solid blue; color: blue ! important; font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;Bitstream Vera Sans&amp;quot;,Verdana,Arial,&amp;quot;Lucida Sans&amp;quot;,&amp;quot;Lucida Sans Unicode&amp;quot;,Helvetica,sans-serif; font-weight: 400; font-size: 13px; position: static; background-color: transparent;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;around or rename the datafile, follow this guide:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Login to SQLPlus.&lt;/li&gt;&lt;li&gt;Connect as SYS DBA with &lt;strong&gt;CONNECT / AS SYSDBA&lt;/strong&gt; command.&lt;/li&gt;&lt;li&gt;Shutdown the database instance with &lt;strong&gt;SHUTDOWN&lt;/strong&gt; command.&lt;/li&gt;&lt;li&gt;Rename or/and move the datafiles at OS level.&lt;/li&gt;&lt;li&gt;Start Oracle database in mount state with &lt;strong&gt;STARTUP MOUNT&lt;/strong&gt; command.&lt;/li&gt;&lt;li&gt;Modify the name or location of datafiles in Oracle data dictionary using following command syntax: &lt;p&gt;ALTER DATABASE RENAME FILE ‘&lt;fully&gt;’ TO ‘&lt;new&gt;’;&lt;/p&gt; &lt;/li&gt;&lt;li&gt;Open Oracle database instance completely with &lt;strong&gt;ALTER DATABASE OPEN&lt;/strong&gt; command.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;If the datafiles that need to be changed or moved do not belong to SYSTEM tablespaces, and do not contain active rollback segments or temporary segments, there is another workaround that does not require database instance to be shutdown. Instead, only the particular tablespace that contains the date files is taken offline.&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Login to SQLPlus.&lt;/li&gt;&lt;li&gt;Connect as SYS DBA with &lt;strong&gt;CONNECT / AS SYSDBA&lt;/strong&gt; command.&lt;/li&gt;&lt;li&gt;Make offline the affected tablespace with &lt;strong&gt;ALTER TABLESPACE &lt;tablespace&gt; OFFLINE;&lt;/strong&gt; command.&lt;/li&gt;&lt;li&gt;Modify the name or location of datafiles in Oracle data dictionary using following command syntax: &lt;p&gt;ALTER TABLESPACE &lt;tablespace&gt; RENAME DATAFILE ‘&lt;fully&gt;’ TO ‘&lt;new&gt;’;&lt;/p&gt; &lt;/li&gt;&lt;li&gt;Bring the tablespace online again with &lt;strong&gt;ALTER TABLESPACE alter tablespace &lt;tablespace&gt; ONLINE;&lt;/strong&gt; command.&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-2816840696700665588?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/2816840696700665588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=2816840696700665588' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2816840696700665588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/2816840696700665588'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/04/moverename-oracle-datafiles.html' title='move/rename oracle datafiles'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-7047429845310801916</id><published>2009-04-21T10:19:00.001-07:00</published><updated>2009-04-21T10:20:25.809-07:00</updated><title type='text'>wtf is Oracle Varchar2? What are the difference between varchar and varchar2</title><content type='html'>I was kinda confused earlier on the differences but get a better explaination after hunting around. Below details each of their characteristics:&lt;br /&gt;&lt;br /&gt;Char: Declare and used. If the size declared is 5 and assigned value is only length 2, the leftover will be stored with spaces. Some claimed this would be much faster, but some doesn't find any differences in performance compare &lt;a style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;" name="AdBriteInlineAd_comparison" id="AdBriteInlineAd_comparison" target="_top"&gt;&lt;/a&gt;to varchar.&lt;br /&gt;VarChar: Declare in advance, size used only when assigning values. Depending on the values assigned, for those that have not been used or excessive size allocated will be freed. First few bites will store the length of the values assigned. ANSI SQL Standard.&lt;br /&gt;VarChar2: It is an oracle's improve&lt;a style="background: transparent url(http://files.adbrite.com/mb/images/green-double-underline-006600.gif) repeat-x scroll center bottom; cursor: pointer; color: rgb(0, 102, 0); text-decoration: none; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; margin-bottom: -2px; padding-bottom: 2px;" name="AdBriteInlineAd_improved" id="AdBriteInlineAd_improved" target="_top"&gt;&lt;/a&gt; Varchar datatype version. Characteristics are mostly similar to varchar.&lt;br /&gt;&lt;br /&gt;Do you have anything to addon?&lt;br /&gt;&lt;br /&gt;Recycled from the Internet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-7047429845310801916?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/7047429845310801916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=7047429845310801916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7047429845310801916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7047429845310801916'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/04/wtf-is-oracle-varchar2-what-are.html' title='wtf is Oracle Varchar2? What are the difference between varchar and varchar2'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-8343325699668650358</id><published>2009-04-17T15:33:00.000-07:00</published><updated>2009-04-17T15:35:14.290-07:00</updated><title type='text'>Use RMAN to copy a database to a different Server</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;Question:&lt;/b&gt; I want to use RMAN to copy a  database to a different server, in a different disk directory. Can I use RMAN to  restore a database to another server?&lt;/p&gt;&lt;hr /&gt; &lt;p class="MsoNormal"&gt;Applies to:  Oracle Server - Enterprise Edition - Version:  10.2.0.0.0&lt;br /&gt;&lt;br /&gt;The goal is restoring a database using RMAN on a different node with different  backup directory structures and different database directory structures .&lt;br /&gt;&lt;br /&gt;- You have a database backed up on NODE 1.&lt;br /&gt;- You need to restore the database on NODE 2.&lt;br /&gt;- The directory structure is different on NODE 2.&lt;br /&gt;- You need to put the backups in a new directory structure in NODE 2, unlike as  they were in NODE 1.&lt;br /&gt;- You need to restore the database files into a new directory structure in NODE  2, unlike as they were in NODE 1.&lt;br /&gt; &lt;/p&gt; &lt;p class="MsoNormal"&gt;Solution&lt;br /&gt; &lt;/p&gt; &lt;/span&gt;    &lt;p class="MsoNormal"&gt;&lt;span class="style1"&gt;Below is the procedure with an example of using RMAN to  copy a database to another directory:&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="font-size:85%;"&gt; &lt;span class="style1"&gt;1) Connect to the target database using rman and backup the database ---&gt; NODE 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;$ rman target /Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 13  00:29:33&lt;br /&gt;2007Copyright © 1982, 2005, Oracle. All rights reserved.connected to target  database: ORA10G (DBID=3932056136)RMAN&gt;&lt;br /&gt;backup database plus archivelog;Starting backup at 13-FEB-07current log  archivedusing channel ORA_DISK_1channel&lt;br /&gt;ORA_DISK_1: starting archive log backupsetchannel ORA_DISK_1: specifying archive  log(s) in backup setinput archive log thread=1&lt;br /&gt;sequence=143 recid=109 stamp=614392105channel ORA_DISK_1: starting piece 1 at  13-FEB-07channel ORA_DISK_1: finished piece&lt;br /&gt;1 at 13-FEB-07piece handle=/u01/oracle/product/oradata/ora10g/fra/ORA10G/backupset/2007_02_13/o1_mf_annnn_TAG20070213T002825_2x21kbds_.bkp&lt;br /&gt;tag=TAG20070213T002825 comment=NONEchannel ORA_DISK_1: backup set complete,  elapsed time: 00:00:02Finished backup at 13-FEB-07Starting&lt;br /&gt;backup at 13-FEB-07using channel ORA_DISK_1channel ORA_DISK_1: starting full  datafile backupsetchannel ORA_DISK_1: specifying&lt;br /&gt;datafile(s) in backupsetinput datafile fno=00003 name=/u01/oracle/product/oradata/ora10g/data/sysaux01.dbfinput  datafile&lt;br /&gt;fno=00001 name=/u01/oracle/product/oradata/ora10g/data/system01.dbfinput  datafile fno=00002 name=/u01/oracle/product/oradata/ora10g/data/undotbs01.dbfinput&lt;br /&gt;datafile fno=00004 name=/u01/oracle/product/oradata/ora10g/data/users01.dbfinput  datafile fno=00005 name=/home/oracle/1.dbfinput&lt;br /&gt;datafile fno=00006 name=/u01/oracle/product/oradata/ora10g/data/sysaux02.dbfinput  datafile fno=00007 name=/u01/oracle/product/oradata/ora10g/data/undotbs02.dbfchannel&lt;br /&gt;ORA_DISK_1: starting piece 1 at 13-FEB-07channel ORA_DISK_1: finished piece 1 at 13-FEB-07piece handle=/u01/oracle/product/oradata/ora10g/fra/ORA10G/backupset/2007_02_13/o1_mf_nnndf_TAG20070213T002827_2x21kd12_.bkp&lt;br /&gt;tag=TAG20070213T002827 comment=NONEchannel ORA_DISK_1: backup set complete,  elapsed time: 00:00:55Finished backup at 13-FEB-07Starting&lt;br /&gt;backup at 13-FEB-07current log archivedusing channel ORA_DISK_1channel  ORA_DISK_1: starting archive log backupsetchannel&lt;br /&gt;ORA_DISK_1: specifying archive log(s) in backup setinput archive log thread=1  sequence=144 recid=110 stamp=614392165channel&lt;br /&gt;ORA_DISK_1: starting piece 1 at 13-FEB-07channel ORA_DISK_1: finished piece 1 at 13-FEB-07piece handle=/u01/oracle/product/oradata/ora10g/fra/ORA10G/backupset/2007_02_13/o1_mf_annnn_TAG20070213T002925_2x21m6ty_.bkp&lt;br /&gt;tag=TAG20070213T002925 comment=NONEchannel ORA_DISK_1: backup set complete,  elapsed time: 00:00:02Finished backup at 13-FEB-07Starting&lt;br /&gt;Control File and SPFILE Autobackup at 13-FEB-07piece  handle=/u01/oracle/product/ora10g/dbs/c-3932056136-20070213-02 comment=NONEFinished  Control File and SPFILE Autobackup at 13-FEB-07RMAN&gt; exit&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;2) Move the following files to the NODE 2 :&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;+ The database backup pieces&lt;br /&gt;+ Controlfile backup piece&lt;br /&gt;+ The parameter file i.e init.ora file&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;3) Edit the PFILE on NODE 2 to change the environment specific parameters like .&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;user_dump_dest =&lt;br /&gt;background_dump_dest =&lt;br /&gt;control_files =&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;    &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;4) Once the PFILE is suitably modified invoke Rman on the NODE 2 after setting  the Oracle environment variables and start the database in nomount mode: &lt;/span&gt;    &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;[oracle@test-br test]$ export ORACLE_HOME=/u01/oracle/product/ora10g&lt;br /&gt;[oracle@test-br test]$ export ORACLE_SID=ora10g&lt;br /&gt;[oracle@test-br test]$ export PATH=$ORACLE_HOME/bin:$PATH&lt;br /&gt;[oracle@test-br test]$ rman target /&lt;br /&gt;Recovery Manager: Release 10.2.0.1.0 - Production on Tue Feb 13 00:36:55 2007&lt;br /&gt;Copyright © 1982, 2005, Oracle. All rights reserved.&lt;br /&gt;connected to target database (not started)&lt;br /&gt;RMAN&gt; startup nomount&lt;br /&gt;Oracle instance started&lt;br /&gt;Total System Global Area 205520896 bytes&lt;br /&gt;Fixed Size 1218508 bytes&lt;br /&gt;Variable Size 75499572 bytes&lt;br /&gt;Database Buffers 121634816 bytes&lt;br /&gt;Redo Buffers 7168000 bytes&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;5) Restore the controlfile from the backup piece.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;RMAN&gt; restore controlfile from '/u01/oracle/product/ora10g/dbs/c-3932056136-20070213-02';&lt;br /&gt;Starting restore at 13-FEB-07&lt;br /&gt;using target database control file instead of recovery catalog&lt;br /&gt;allocated channel: ORA_DISK_1&lt;br /&gt;channel ORA_DISK_1: sid=155 devtype=DISK&lt;br /&gt;channel ORA_DISK_1: restoring control file&lt;br /&gt;channel ORA_DISK_1: restore complete,&lt;br /&gt;elapsed time: 00:00:02&lt;br /&gt;output filename=/u01/oracle/product/oradata/ora10g/cntrl/control01.ctl&lt;br /&gt;Finished restore at 13-FEB-07 &lt;/span&gt;    &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;6) Mount the database.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;RMAN&gt; alter database mount ;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;7) Now catalog the backup pieces that were shipped from NODE 1.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;RMAN&gt; catalog backuppiece  '/home/oracle/test/backup/o1_mf_annnn_TAG20070213T002925_2x21m6ty_.bkp';Starting&lt;br /&gt;implicit crosscheck backup at 13-FEB-07allocated channel: ORA_DISK_1channel  ORA_DISK_1: sid=155 devtype=DISKCrosschecked&lt;br /&gt;3 objectsFinished implicit crosscheck backup at 13-FEB-07Starting implicit  crosscheck copy at 13-FEB-07using channel&lt;br /&gt;ORA_DISK_1Finished implicit crosscheck copy at 13-FEB-07searching for all files  in the recovery areacataloging files...no&lt;br /&gt;files catalogedcataloged backuppiecebackup piece  handle=/home/oracle/test/backup/o1_mf_annnn_TAG20070213T002925_2x21m6ty_.bkp&lt;br /&gt;recid=41 stamp=614393265RMAN&gt; catalog backuppiece  '/home/oracle/test/backup/o1_mf_annnn_TAG20070213T002825_2x21kbds_.bkp';cataloged&lt;br /&gt;backuppiecebackup piece  handle=/home/oracle/test/backup/o1_mf_annnn_TAG20070213T002825_2x21kbds_.bkp  recid=42 stamp=614393292RMAN&gt;&lt;br /&gt;catalog backuppiece  '/home/oracle/test/backup/o1_mf_nnndf_TAG20070213T002827_2x21kd12_.bkp';cataloged  backuppiecebackup&lt;br /&gt;piece  handle=/home/oracle/test/backup/o1_mf_nnndf_TAG20070213T002827_2x21kd12_.bkp  recid=43 stamp=614393310&lt;br /&gt;&lt;/span&gt;    &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;8) Get to know the last sequence available in the archivelog backup using the  following command.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;RMAN &gt; list backup of archivelog all;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;9) Rename the Redologfiles,so that they can be created in new locations when  opened the database is opened in resetlogs.&lt;br /&gt;&lt;/span&gt;    &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;SQL&gt; alter database rename file '/u01/oracle/product/oradata/ora10g/log/redo01.log'  to '/home/oracle/test/log/redo01.log';..................&lt;br /&gt;&lt;/span&gt;    &lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style1"&gt;10) Now restore the datafiles to new locations and recover.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span class="style2"&gt;RMAN&gt; run { set until sequence &lt;seq_no&gt; set newname for datafile 1 to  '/home/oracle/test/data/sys01.dbf';&lt;br /&gt;set newname for datafile 2 to '/home/oracle/test/data/undotbs01.dbf'; set  newname for datafile 3 to '/home/oracle/test/data/sysaux01.dbf';&lt;br /&gt;set newname for datafile 4 to '/home/oracle/test/data/users01.dbf'; set newname  for datafile 5 to '/home/oracle/test/data/1.dbf';&lt;br /&gt;set newname for datafile 6 to '/home/oracle/test/data/sysaux02.dbf'; set newname  for datafile 7 to '/home/oracle/test/data/undotbs02.dbf';&lt;br /&gt;restore database; switch datafile all; recover database; alter database open  resetlogs; }&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="font-size:85%;"&gt;This is just my note copy from Sorabh Harit. Thanks Sorabh. &lt;/span&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;&lt;span class="normalname"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-8343325699668650358?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/8343325699668650358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=8343325699668650358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8343325699668650358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8343325699668650358'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/04/use-rman-to-copy-database-to-different.html' title='Use RMAN to copy a database to a different Server'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-287678340540309577</id><published>2009-04-15T14:18:00.000-07:00</published><updated>2009-04-15T21:55:20.036-07:00</updated><title type='text'>brainstorming a new Document Management System</title><content type='html'>I am thinking to make myself a Document Management System (DMS).&lt;br /&gt;&lt;br /&gt;I don't like any of  the DMS out there.&lt;br /&gt;&lt;br /&gt;either they are not search friendly (KnowledgeTree).&lt;br /&gt;hate the language it is written in (PHP)&lt;br /&gt;too complicate to use. ( Alfresco)&lt;br /&gt;&lt;br /&gt;I kind of like Docmgr DMS, it has a very clean interface and simply it just work.&lt;br /&gt;the only think I don't like Docmgr is it is written in PHP.&lt;br /&gt;&lt;br /&gt;I am not saying PHP is bad. but it just too troublesome to maintain the code and people will write bad code.&lt;br /&gt;&lt;br /&gt;I am thinking to use Java and PostgreSQL as the main Technology components.&lt;br /&gt;&lt;br /&gt;Java have been proven it is clean, well structure programming language.&lt;br /&gt;PostgreSQL in my opinion, it is the best Open Source Database out there. (Don't convince me MySQL is good, to be honestly, I hate MySQL.  Too many things can go wrong with MySQL).&lt;br /&gt;&lt;br /&gt;The draft of the requirement is in http://docs.google.com/Doc?id=dsq74hw_55czc4zfd5&amp;amp;hl=en&lt;br /&gt;&lt;br /&gt;Once I have time, I will finalize the requirements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-287678340540309577?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/287678340540309577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=287678340540309577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/287678340540309577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/287678340540309577'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/04/brainstorming-new-document-management.html' title='brainstorming a new Document Management System'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-7047100584598338679</id><published>2009-04-14T13:27:00.000-07:00</published><updated>2009-04-14T13:32:19.504-07:00</updated><title type='text'>Purchase 2009 Ford Escape</title><content type='html'>Yesterday is my happy day.  I went to Ford Dealer yesterday to browse some new Car. I was hooked by 2009 Escape.&lt;br /&gt;&lt;br /&gt;the stylish, roomy and functional widgets make us to bring out our Credit card and reserved one of them.&lt;br /&gt;&lt;br /&gt;I have never drove a Ford in my life so far and I has always thought American Car sucks. These statements are not true anymore.&lt;br /&gt;&lt;br /&gt;I am looking forward to April 30. that is when my car is coming.&lt;br /&gt;&lt;br /&gt;I will take some pix and keep you guys posted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-7047100584598338679?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/7047100584598338679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=7047100584598338679' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7047100584598338679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/7047100584598338679'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/04/purchase-2009-ford-escape.html' title='Purchase 2009 Ford Escape'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-3347026182889487388</id><published>2009-04-12T23:07:00.000-07:00</published><updated>2009-04-12T23:10:45.491-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='life saver.'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Oracle Tips and Tricks</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 13px; "&gt;oracle auto generated drop objects :)&lt;br /&gt;&lt;br /&gt;select 'Drop '||object_type||' '||object_name||&lt;br /&gt;case&lt;br /&gt;  when object_type = 'TABLE' then ' cascade constraints;' &lt;br /&gt;  else ';'&lt;br /&gt;end&lt;br /&gt;from user_objects;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 13px;"&gt;This will generated all the drop table, sequence etc. statements for you.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 13px;"&gt;&lt;a href="javascript:void(0)"&gt;Publish Post&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-3347026182889487388?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/3347026182889487388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=3347026182889487388' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3347026182889487388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/3347026182889487388'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/04/oracle-tips-and-tricks.html' title='Oracle Tips and Tricks'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-8054254358579983855</id><published>2009-04-12T22:31:00.000-07:00</published><updated>2009-04-12T22:39:35.565-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Replication'/><category scheme='http://www.blogger.com/atom/ns#' term='Mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Resume Mysql Replication</title><content type='html'>When MySQL slave db doesn't shutdown correctly, the next time you start it, the error may occur and complaints one of the log files is not found in mysql directory.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;here is the procedure to fix it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;1). MYSQL &gt; show slave status\G;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial;"&gt;the output as the following&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial;"&gt;            &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt; Slave_IO_State:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                Master_Host: 127.0.01&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                Master_User: remotereplicator&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                Master_Port: 33061&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;              Connect_Retry: 60&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Master_Log_File: HP2-bin.000016&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;        Read_Master_Log_Pos: 819453275&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;             Relay_Log_File: mysqld-relay-bin.000020&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;              Relay_Log_Pos: 3311066&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;      Relay_Master_Log_File: HP2-bin.000016&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;           Slave_IO_Running: No&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;          Slave_SQL_Running: No&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Replicate_Do_DB:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;        Replicate_Ignore_DB:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Replicate_Do_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;     Replicate_Ignore_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;    Replicate_Wild_Do_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;Replicate_Wild_Ignore_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                 Last_Errno: 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                 Last_Error:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;               Skip_Counter: 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;        Exec_Master_Log_Pos: 819453275&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Relay_Log_Space: 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Until_Condition: None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;             Until_Log_File:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;              Until_Log_Pos: 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Master_SSL_Allowed: No&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Master_SSL_CA_File:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Master_SSL_CA_Path:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Master_SSL_Cert:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;          Master_SSL_Cipher:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;             Master_SSL_Key:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;      Seconds_Behind_Master: NULL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;1 row in set (0.02 sec)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;write down the Relay_Maste_Log_File and Read_Master_Log_File_Pos value. in this case, they are HP2-bin.000016 and 819453275 respectly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2). MYSQL&gt; stop slave;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3). MYSQL&gt;reset slave;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4). MYSQL&gt;start slave;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5). MYSQL&gt;show slave status\G;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;the output should be look like this&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;*&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;************************** 1. row ***************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;             Slave_IO_State: Waiting for master to send event&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                Master_Host: 127.0.0.1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                Master_User: remotereplicator&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                Master_Port: 33061&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;              Connect_Retry: 60&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Master_Log_File: HP2-bin.000003&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;        Read_Master_Log_Pos: 3493&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;             Relay_Log_File: mysqld-relay-bin.000006&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;              Relay_Log_Pos: 233&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;      Relay_Master_Log_File: HP2-bin.000003&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;           Slave_IO_Running: Yes&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;          Slave_SQL_Running: No&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Replicate_Do_DB:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;        Replicate_Ignore_DB:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Replicate_Do_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;     Replicate_Ignore_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;    Replicate_Wild_Do_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;Replicate_Wild_Ignore_Table:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                 Last_Errno: 1007&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;                 Last_Error: Error 'Can't create database 'manufacture';&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;database exists' on query. Default database: 'manufacture'. Query: 'create&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;database manufacture'&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;               Skip_Counter: 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;        Exec_Master_Log_Pos: 98&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Relay_Log_Space: 3628&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Until_Condition: None&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;             Until_Log_File:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;              Until_Log_Pos: 0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Master_SSL_Allowed: No&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Master_SSL_CA_File:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;         Master_SSL_CA_Path:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;            Master_SSL_Cert:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;          Master_SSL_Cipher:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;             Master_SSL_Key:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;      Seconds_Behind_Master: NULL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ERROR:&lt;/div&gt;&lt;div&gt;No query specified&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- it tells you the database has exists.  this is a good sight. it means the&lt;/div&gt;&lt;div&gt;slave is working.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;6). MYSQL&gt; stop slave;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;7). MYSQL&gt;  CHANGE MASTER TO MASTER_HOST='127.0.01',&lt;/div&gt;&lt;div&gt;MASTER_USER='$remotereplicator',&lt;/div&gt;&lt;div&gt;MASTER_PASSWORD='$pass',MASTER_LOG_FILE='$log_file',&lt;/div&gt;&lt;div&gt;MASTER_LOG_POS=$log_pos;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;in here,&lt;/div&gt;&lt;div&gt;$remotereplicator is the remote replication user&lt;/div&gt;&lt;div&gt;$pass is the remote replication user's password&lt;/div&gt;&lt;div&gt;$log_file is the remote replication file. in this case. it is HP2-bin.000016&lt;/div&gt;&lt;div&gt;$log_pos is the remote position, in this case, it is 819453275&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;8). MYSQL&gt; start slave;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;9). to confirm it is working.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    MYSQL&gt; show slave status\G;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    the values of the Slave_IO_Running and the Slave_SQL_Running should be&lt;/div&gt;&lt;div&gt;"Yes"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-8054254358579983855?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/8054254358579983855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=8054254358579983855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8054254358579983855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/8054254358579983855'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2009/04/resume-mysql-replication.html' title='Resume Mysql Replication'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5456017795336143989.post-5835299792047587244</id><published>2008-09-17T18:59:00.000-07:00</published><updated>2009-05-13T14:23:13.649-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Database =&gt; oracle and  router =&gt; cisco</title><content type='html'>Now adays, when comes to decision of database,  most people say Oracle without look at the requirements.  There is no doubt that Oracle is a good Database System, but most of the time, it just overkilled.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5456017795336143989-5835299792047587244?l=geekmatters.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekmatters.blogspot.com/feeds/5835299792047587244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5456017795336143989&amp;postID=5835299792047587244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5835299792047587244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5456017795336143989/posts/default/5835299792047587244'/><link rel='alternate' type='text/html' href='http://geekmatters.blogspot.com/2008/09/database-oracle-and-router-cisco.html' title='Database =&gt; oracle and  router =&gt; cisco'/><author><name>Ben</name><uri>http://www.blogger.com/profile/04782241055001305258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
