<?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-6016290386756889880</id><updated>2012-02-17T09:35:32.873+05:30</updated><category term='find and move files to another folder'/><category term='Oracle Partitioning'/><category term='wget usages'/><category term='ORA-27300'/><category term='Port Forwarding'/><category term='Oracle Data Pump'/><category term='SSH'/><category term='interesting usages of wget'/><category term='OLTP Compression'/><category term='Postfix'/><category term='burn from command line'/><category term='Sed Command'/><category term='size'/><category term='impdp'/><category term='Oracle'/><category term='cdrecord'/><category term='IPTABLES'/><category term='Partition Pruning'/><category term='Limiting Denial of Service Attacks'/><category term='relayhost'/><category term='SMTP Relay'/><category term='ORA-27302'/><category term='upgrading from Ubuntu Hardy to Ubuntu Intrepid'/><category term='ORA-27301'/><category term='oracle import/export'/><category term='download'/><category term='imp/exp'/><category term='Linux'/><category term='sort files'/><category term='iso to cdrom'/><category term='List'/><category term='SQLPlus Schema Size'/><category term='nvidia bug'/><category term='htaccess'/><category term='Alter text from a source text file and write to an output file'/><category term='RANGE Partitioning with examples'/><category term='expdp'/><category term='Webserver text files'/><title type='text'>A Linux Admin's WeBlog!</title><subtitle type='html'>A place where I jot things which happens in my day-to-day life!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-3172172973600855278</id><published>2010-12-02T12:26:00.007+05:30</published><updated>2010-12-02T12:34:45.792+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='expdp'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Data Pump'/><category scheme='http://www.blogger.com/atom/ns#' term='impdp'/><category scheme='http://www.blogger.com/atom/ns#' term='oracle import/export'/><title type='text'>Oracle Data Pump</title><content type='html'>The Data Pump utility was introduced from Oracle 10g R1 onwards. This boasts very high data transfer between databases. The Data Pump provides two utilities as mentioned below:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Data Pump Export : expdp&lt;/li&gt;&lt;li&gt;Data Pump Import : impdp&lt;/li&gt;&lt;/ul&gt;They might seem similar to the traditional exp and imp commands but they actually aren't! The export files from expdp cant be imported using the traditional import command imp. Also export files from exp cant be imported using impdp. The utilities are server related rather than client related with regard to the traditional ones. &lt;br /&gt;&lt;br /&gt;Okay, enough of theories! Let's look at some examples:&lt;br /&gt;&lt;br /&gt;Step 1: Log into the database as SYS user:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;splus sys as sysdba &lt;/b&gt;&lt;/blockquote&gt;Step 2: Creating directory for dumping and setting permissions &lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;create directory DUMPDIR as '/home/oracle/dumpdir';&lt;/b&gt;&lt;/blockquote&gt;Grant necessary permissions for the user who needs the export their schema:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;grant read,write on directory dumpdir to user1;&lt;/b&gt;&lt;/blockquote&gt;Step 3: Exporting the schema&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;expdp user1/passwd DIRECTORY=DUMPDIR DUMPFILE=user1.expdp.dmp SCHEMAS=user1;&lt;/b&gt;&lt;/blockquote&gt;Step 4: Importing the schema&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;impdp user1/password DIRECTORY=DUMPDIR DUMPFILE=user1.expdp.dmp SCHEMAS=user1;&lt;/b&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-3172172973600855278?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/3172172973600855278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=3172172973600855278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3172172973600855278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3172172973600855278'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2010/12/oracle-data-pump.html' title='Oracle Data Pump'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-3383902947981175546</id><published>2010-12-02T10:11:00.000+05:30</published><updated>2010-12-02T10:11:44.955+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ORA-27301'/><category scheme='http://www.blogger.com/atom/ns#' term='ORA-27300'/><category scheme='http://www.blogger.com/atom/ns#' term='ORA-27302'/><title type='text'>Oracle wont start: ORA-27300, ORA-27301, ORA-27302 (No space left on device)</title><content type='html'>Ever encountered this error while starting up your Oracle database? At first glance, as the error informs with the line familiar to most administrators "No space left on device", its not actually what you think it is!&lt;br /&gt;&lt;br /&gt;Even if you have loads of HDD space and free memory left, this error can happen. Its because you don't have enough semaphores left. A semaphore is a value in a designated place in operating system (or kernel) storage that each process can check and then change (&lt;a href="http://www.sap-basis-abap.com/unix/what-is-a-semaphore.htm"&gt;ref&lt;/a&gt;).&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;ORA-27154: post/wait create failed&lt;/b&gt;&lt;br /&gt;&lt;b&gt;ORA-27300: OS system dependent operation:semget failed with status: 28&lt;/b&gt;&lt;br /&gt;&lt;b&gt;ORA-27301: OS failure message: No space left on device&lt;/b&gt;&lt;br /&gt;&lt;b&gt;ORA-27302: failure occurred at: sskgpsemsper&lt;/b&gt;&lt;/blockquote&gt;&lt;div style="color: #0b5394;"&gt;&lt;/div&gt;To fix this error, edit your /etc/sysctl.conf file and add/modify the below parameter to the values mentioned below:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;kernel.sem = 250 32000 100 128&lt;/b&gt;&lt;/blockquote&gt;Now to apply these changes, run the below command:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;sysctl -p&lt;/b&gt;&lt;/blockquote&gt;Once its done, try starting your database. It should start without the previous error.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-3383902947981175546?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/3383902947981175546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=3383902947981175546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3383902947981175546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3383902947981175546'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2010/12/oracle-wont-start-ora-27300-ora-27301.html' title='Oracle wont start: ORA-27300, ORA-27301, ORA-27302 (No space left on device)'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-8871186413154999601</id><published>2010-12-02T09:23:00.003+05:30</published><updated>2010-12-02T10:22:05.096+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle import/export'/><category scheme='http://www.blogger.com/atom/ns#' term='imp/exp'/><title type='text'>Oracle Export and Import - The Traditional Way!</title><content type='html'>Even though its possible to pass the requires parameters during exp or imp command run time, its convenient to use single-line full commands when its to be used in an automated export/import scripts:&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Complete Database Export:&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;To export the complete Oracle Database and import it to another machine, it requires SYSTEM user privileges. Here is how its done:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;exp SYSTEM/password FULL=y FILE=completedb.dmp LOG=dba.log CONSISTENT=y&lt;/b&gt;&lt;/blockquote&gt;&amp;nbsp;Here:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Full=y&lt;/i&gt; : denotes a complete database export is required.&lt;br /&gt;&lt;i&gt;FILE=filename.dmp&lt;/i&gt; : denotes the file name of the export file.&lt;br /&gt;&lt;i&gt;LOG=logname.log&lt;/i&gt; : denotes the log file to be written.&lt;br /&gt;&lt;i&gt;CONSISTENT=y &lt;/i&gt;: denotes no further changes shall be affected in the export file.&lt;br /&gt;&lt;br /&gt;To import the complete database in another machine, here is how to do it:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;imp SYSTEM/password FULL=y FIlE=completedb.dmp commit=y&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;u&gt;User Schema Export:&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;An user can export his/her own schema using the below command:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;exp username/password FILE=userdb.dmp OWNER=username&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;To import the schema, the below command shall be used:&lt;br /&gt;&lt;blockquote&gt;&lt;user&gt;&lt;password&gt;&lt;b&gt;imp SYSTEM/password FROMUSER=username1 TOUSER=username2 FILE=userdb.dmp&lt;/b&gt; &lt;/password&gt;&lt;/user&gt;&lt;/blockquote&gt;Here "&lt;i&gt;username1&lt;/i&gt;" is the name of the user who exported the schema and "&lt;i&gt;username2&lt;/i&gt;" is the name of the user to which the schema needs to be imported.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;user&gt;&lt;password&gt;User Schema Export (Table specific):&lt;/password&gt;&lt;/user&gt;&lt;/u&gt;&lt;br /&gt;&lt;user&gt;&lt;password&gt; &lt;/password&gt;&lt;/user&gt;&lt;br /&gt;&lt;user&gt;&lt;password&gt; To export a schema with only selected tables:&amp;nbsp;&lt;/password&gt;&lt;/user&gt; &lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;exp username/password FILE=userdb-tables.dmp TABLES=(table1,table2)&lt;/b&gt;&lt;/blockquote&gt;&lt;br /&gt;To import that export file back to another user, the below command shall be used:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;imp SYSTEM/password FROMUSER=username1 TOUSER=username2 FILE=userdb-tables.dmp TABLES=(table1,table2)&lt;/b&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-8871186413154999601?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/8871186413154999601/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=8871186413154999601' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/8871186413154999601'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/8871186413154999601'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2010/12/oracle-export-and-import-traditional.html' title='Oracle Export and Import - The Traditional Way!'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-682474949679701638</id><published>2010-10-07T16:53:00.008+05:30</published><updated>2010-10-14T16:28:45.957+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLPlus Schema Size'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle'/><title type='text'>Finding schema size in Oracle using SQLPlus CLI</title><content type='html'>To find out the schema size for a particular user, login as the user into the schema using SQLPlus CLI:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;sqlplus schemauser/password&lt;/b&gt;&lt;/blockquote&gt;Once logged in, execute the below query:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;SELECT sum(bytes)/1024/1024 FROM user_segments;&lt;/b&gt; &lt;/blockquote&gt;As per the calculation above (1024/1024), the output will be in MB.&lt;br /&gt;&lt;br /&gt;Sample output shown below:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;SUM(BYTES)/1024/1024&lt;/b&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;------------------- &lt;/b&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;12.4375&lt;/b&gt; &lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-682474949679701638?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/682474949679701638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=682474949679701638' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/682474949679701638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/682474949679701638'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2010/10/finding-schema-size-in-oracle-using.html' title='Finding schema size in Oracle using SQLPlus CLI'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-5866762634772343480</id><published>2010-10-07T15:50:00.009+05:30</published><updated>2010-10-14T16:27:41.557+05:30</updated><title type='text'>Tomcat: Deploying an application in direct URL with port 80</title><content type='html'>Ever had a requirement of deploying a Tomcat Web Application such that you need to get that under &lt;i&gt;http://example.com&lt;/i&gt; instead of &lt;i&gt;http://example.com:8080/webapp&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;Here is what needs to be done:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Run the Tomcat Server in port 80 instead of port 8080:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This can be done under the &lt;i&gt;server.xml&lt;/i&gt; file present under &lt;i&gt;"&lt;tomcat_home&gt;tomcat_home/conf&lt;/tomcat_home&gt;&lt;/i&gt;". Open the server.xml file and find the part that says:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;&lt;span style="color: #351c75; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;connector connectiontimeout="20000" port="8080" protocol="HTTP/1.1" redirectport="8443"&gt;&lt;/connector&gt;&lt;/span&gt;&lt;/b&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;connector connectiontimeout="20000" port="8080" protocol="HTTP/1.1" redirectport="8443"&gt;&lt;/connector&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"  redirectPort="8443"&lt;/b&gt; &lt;/blockquote&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;Change that to the below form:&lt;br /&gt;&lt;blockquote style="color: #351c75; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;&lt;b&gt;&lt;connector connectiontimeout="20000" port="80" protocol="HTTP/1.1" redirectport="8443"&gt;&lt;/connector&gt;&lt;/b&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;connector connectiontimeout="20000" port="8080" protocol="HTTP/1.1" redirectport="8443"&gt;&lt;/connector&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;b&gt;Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"  redirectPort="8443"&lt;/b&gt; &lt;/blockquote&gt;Once done, the application will be accessible under &lt;i&gt;http://example.com/webapp&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Setting a web app to Document Root&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There are two easier methods for doing this:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;a) &lt;span style="font-size: small;"&gt;The ROOT folder&lt;/span&gt;:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;By default, the ROOT folder of the Tomcat Server is showing the default Tomcat page. So backup that folder to another suitable location (apart from the "webapps" folder. Now either rename your application folder to the name ROOT (please note that it should be in capitals) or create a soft link for that folder with the name ROOT:&lt;br /&gt;&lt;blockquote&gt;&lt;div style="color: #351c75; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;$ mv tomcatapp ROOT&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;or&lt;br /&gt;&lt;blockquote&gt;&lt;div style="color: #351c75; font-family: &amp;quot;Helvetica Neue&amp;quot;,Arial,Helvetica,sans-serif;"&gt;$ ln -s tomcatapp ROOT&lt;/div&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;b) Re-direction method:&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Edit the file &lt;i&gt;tomcat_home&lt;tomcat_home&gt;/webapps/ROOT/index.html&lt;/tomcat_home&gt;&lt;/i&gt;, delete everything (after taking a backup) and place the below content in it:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: x-small;"&gt;&lt;span style="color: #351c75;"&gt;&lt;/span&gt;&lt;span style="color: #351c75;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_JhGyv-3Unaw/TK2dhgIS8tI/AAAAAAAAHE8/JlzllKv5McA/s1600/Screenshot.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="100" src="http://4.bp.blogspot.com/_JhGyv-3Unaw/TK2dhgIS8tI/AAAAAAAAHE8/JlzllKv5McA/s400/Screenshot.png" width="400" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Change the &lt;i&gt;http://example.com&lt;/i&gt; to your required URL.&lt;br /&gt;&lt;br /&gt;Now, your application shall be accessible under http://example.com itself. Easier for the clients to access ;-) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: There are other methods also for doing this.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-5866762634772343480?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/5866762634772343480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=5866762634772343480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/5866762634772343480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/5866762634772343480'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2010/10/tomcat-deploying-application-in-direct.html' title='Tomcat: Deploying an application in direct URL with port 80'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_JhGyv-3Unaw/TK2dhgIS8tI/AAAAAAAAHE8/JlzllKv5McA/s72-c/Screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-7961329818567272881</id><published>2010-09-30T18:25:00.001+05:30</published><updated>2010-09-30T18:26:25.735+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Partition Pruning'/><category scheme='http://www.blogger.com/atom/ns#' term='Oracle Partitioning'/><category scheme='http://www.blogger.com/atom/ns#' term='OLTP Compression'/><category scheme='http://www.blogger.com/atom/ns#' term='RANGE Partitioning with examples'/><title type='text'>Oracle: Compression, Partitioning &amp; Pruning</title><content type='html'>&lt;i&gt;"What  I have written below is actually the notes I have taken when I tried to  learn Oracle Partitioning, Table/Tablespace Compression and Partition  Pruning. I know its not a technically advanced write up, but I guess it will help  beginners like me to get started with this heavily vast topic"&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Disclaimer:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Most of what written below has been taken from other websites. The examples mentioned in this blog worked out for me but I give no guarantee that it will work on another machine without proper study. &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;TABLE and TABLESPACE Compression&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Table  compression was introduced in Oracle 9i as a space saving feature for  data warehousing projects. In 11g it is now considered a mainstream  feature that is acceptable for OLTP databases. In addition to saving  storage space, compression can result in increased I/O performance and  reduced memory use in the buffer cache.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;TABLESPACE with OLTP Compression&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #0b5394;"&gt;&lt;span style="font-size: x-small;"&gt;sql&amp;gt;  CREATE TABLESPACE TB_COMPRESSED datafile  '/home/oracle/app/oracle/oradata/TB_COMPRESSED.dbf' size 10000M DEFAULT  COMPRESS FOR ALL OPERATIONS;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;User Creation&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;1. Since we created the tablespace with compression enabled, we can create an user on that tablespace. &lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;sql&amp;gt; create user ORAUSER identified by perfomix_test default tablespace TB_COMPRESSED;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2. Once the user is created, necessary grants needs to be provided for the user for normal operations.  &lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;   &lt;span style="color: #0b5394;"&gt; sql&amp;gt; grant CREATE TABLE, CREATE SESSION, CREATE TRIGGER, CREATE VIEW, CREATE SEQUENCE, CREATE PROCEDURE to ORAUSER;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3. Setting quota for the user.  &lt;span style="font-size: x-small;"&gt;&lt;br style="color: #0b5394;" /&gt;   &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;sql&amp;gt; alter user ORAUSER quota unlimited on TB_COMPRESSED;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Oracle Partitioning&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Partitioning  allows a table, index, or index-organized table to be subdivided into  smaller pieces, where each piece of such a database object is called a  partition. Each partition has its own name, and may optionally have its  own storage characteristics.&lt;br /&gt;&lt;br /&gt;From the perspective of a database  administrator, a partitioned object has multiple pieces that can be  managed either collectively or individually. This gives the  administrator considerable flexibility in managing partitioned objects.  However, from the perspective of the application, a partitioned table is  identical to a non-partitioned table; no modifications are necessary  when accessing a partitioned table using SQL queries and DML statements.&lt;br /&gt;&lt;br /&gt;Partitioning  can provide tremendous benefit to a wide variety of applications by  improving performance, manageability, and availability. It is not  unusual for partitioning to improve the performance of certain queries  or maintenance operations by an order of magnitude. Moreover,  partitioning can greatly simplify common administration tasks.&lt;br /&gt;&lt;br /&gt;Oracle  Partitioning offers three fundamental data distribution methods as  basic partitioning strategies that control how data is placed into  individual partitions:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Range Partitioning&lt;/b&gt;: This maps data  to partitions based on ranges of values of the partitioning key that you  establish for each partition. It is the most common type of  partitioning and is often used with dates.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Hash Partitioning&lt;/b&gt;:  This maps data to partitions based on a hashing algorithm that Oracle  applies to the partitioning key that you identify. The hashing algorithm  evenly distributes rows among partitions, giving partitions  approximately the same size.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;List Partitioning&lt;/b&gt;: This  enables you to explicitly control how rows map to partitions by  specifying a list of discrete values for the partitioning key in the  description for each partition. The advantage of list partitioning is  that you can group and organize unordered and unrelated sets of data in a  natural way.&lt;br /&gt;&lt;br /&gt;Here I am going to discuss more about RANGE partitioning in this blog.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Creating a Partitioned Table (Range Partitioning) with OLTP Compression:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Below shown is an example of Range Partitioning in Oracle. The CREATE query will have the clause "PARTITION BY RANGE(&lt;i&gt;field_name&lt;/i&gt;)"  and the partitions are defined one-by-one with a distinctive name. A  clause "VALUES LESS THAN" is mandatory for defining the partition  end-points.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;CREATE TABLE SAMPLE_ORDERS&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; (ORDER_NUMBER NUMBER,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; ORDER_DATE DATE,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; CUST_NUM NUMBER,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; TOTAL_PRICE NUMBER,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; TOTAL_TAX NUMBER,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; TOTAL_SHIPPING NUMBER)&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION BY RANGE(ORDER_DATE)&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; (&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P1 VALUES LESS THAN(TO_DATE('01-JAN-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P2 VALUES LESS THAN(TO_DATE('01-FEB-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P3 VALUES LESS THAN(TO_DATE('01-MAR-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P4 VALUES LESS THAN(TO_DATE('01-APR-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P5 VALUES LESS THAN(TO_DATE('01-MAY-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P6 VALUES LESS THAN(TO_DATE('01-JUN-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P7 VALUES LESS THAN(TO_DATE('01-JUL-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P8 VALUES LESS THAN(TO_DATE('01-AUG-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; PARTITION P9 VALUES LESS THAN(TO_DATE('01-SEP-2010', 'DD-MON-YYYY')) COMPRESS FOR ALL OPERATIONS&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt; );&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This should create a table with 9 range partitions along with enabling OLTP compression.&lt;br /&gt;&lt;br /&gt;Now  we can insert some dummy values to the table for testing. As you can  see, there is no changes with the INSERT queries even if its done  against a partitioned table. Oracle manages the input data and store  them into respective partitions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('200', '05-FEB-2010', '200', '2000', '2222', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('300', '05-MAR-2010', '300', '3000', '3333', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('400', '05-APR-2010', '400', '4000', '4444', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('500', '05-MAY-2010', '500', '5000', '5555', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('600', '05-JUN-2010', '600', '6000', '6666', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('700', '05-JUL-2010', '700', '7000', '7777', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('800', '05-AUG-2010', '800', '8000', '8888', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('101', '02-JAN-2010', '100', '1000', '1111', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('201', '02-FEB-2010', '200', '2000', '2222', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('301', '02-MAR-2010', '300', '3000', '3333', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('401', '02-APR-2010', '400', '4000', '4444', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('501', '02-MAY-2010', '500', '5000', '5555', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('601', '02-JUN-2010', '600', '6000', '6666', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('701', '02-JUL-2010', '700', '7000', '7777', '1111');&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;&lt;span style="color: #0b5394;"&gt;  sql&amp;gt; INSERT INTO SAMPLE_ORDERS values ('801', '02-AUG-2010', '800', '8000', '8888', '1111');&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;SELECT Queries:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Just like the INSERT queries, the SELECT queries can also be used without any kind of modifications relation to partitioning.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp; SQL&amp;gt; select * from SAMPLE_ORDERS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;How ever, its also possible to SELECT data from specific partitions by giving the partition name.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp; SQL&amp;gt; select * from SAMPLE_ORDERS PARTITION(P2);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; ORDER_NUMBER ORDER_DAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_NUM TOTAL_PRICE&amp;nbsp; TOTAL_TAX TOTAL_SHIPPING&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; ------------ --------- ---------- ----------- ---------- --------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02-JAN-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp; SQL&amp;gt; select * from SAMPLE_ORDERS PARTITION(P3);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; ORDER_NUMBER ORDER_DAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_NUM TOTAL_PRICE&amp;nbsp; TOTAL_TAX TOTAL_SHIPPING&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; ------------ --------- ---------- ----------- ---------- --------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200 05-FEB-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201 02-FEB-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Checking on Partition and Compression Details&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Since  we created the partitions using "COMPRESS FOR ALL OPERATIONS", its  ideal for heavy-transaction databases like OLTP. We can find the details  of the Partitions and Compression details using the below query:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp; SQL&amp;gt; SELECT partition_name, compression, compress_for FROM user_tab_partitions;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; PARTITION_NAME&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COMPRESS COMPRESS_FOR&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; ------------------------------ -------- ------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P5&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P6&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P7&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P8&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; P9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ENABLED&amp;nbsp;&amp;nbsp;&amp;nbsp; OLTP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Modifying Partitions in a table&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding a new partition:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394;"&gt;sql&amp;gt;&amp;nbsp; alter table tempabc add partition p2 values less than ('C%');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;You cannot move a partition with sub-partitions&lt;/li&gt;&lt;li&gt;Each subpartition must be individually moved.&lt;/li&gt;&lt;li&gt;We can add a partition to the high end of the table (after the  last existing partition). If the first element of the partition bound of  the high partition is MAXVALUE, you cannot add a partition to the  table. You must split the high partition.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/li&gt;&lt;li&gt;You can add a partition to a table even if one or more of the table indexes or index partitions are marked UNUSABLE.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/li&gt;&lt;li&gt;You must use the SPLIT PARTITION clause to add a partition at the beginning or the middle of the table.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/li&gt;&lt;li&gt;ALTER TABLE DROP PARTITION drops a partition and its data. If you  want to drop a partition but keep its data in the table, you must merge  the partition into one of the adjacent partitions.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/li&gt;&lt;li&gt;If you drop a partition and later insert a row that would have  belonged to the dropped partition, the row will be stored in the next  higher partition. However, if you drop the highest partition, the insert  will fail because the range of values represented by the dropped  partition is no longer valid for the table.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;b&gt;Ways to partition an existing table&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Method 1:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;create a PARTITIONED table&lt;/li&gt;&lt;li&gt;load the NON-PARTITIONED data into the PARTITIONED table&lt;/li&gt;&lt;li&gt;drop the NON-PARTITIONED table&lt;/li&gt;&lt;li&gt;rename PARTITIONED table to whatever is appropriate&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;Method 2:&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;export table and data&lt;/li&gt;&lt;li&gt;drop table&lt;/li&gt;&lt;li&gt;create new partitioned table the way you want it&lt;/li&gt;&lt;li&gt;import table data into new partitioned table (this should also  create all the necessary indexes and constraints from your original  table)&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Partition Pruning&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Semantics-based partitioning can allow Adaptive Server to  eliminate certain partitions when performing a search. Range-based  partitions, for example, contain rows whose partitioning keys are  discrete value sets. When a query predicate—a where clause—is based on  those partitioning keys, Adaptive Server can quickly ascertain whether  rows in a particular partition can satisfy the query. This behavior is  called partition pruning, or partition elimination, and it can save  considerable time and resources during execution.&lt;br /&gt;&lt;br /&gt;For range and  list partitioning – Adaptive Server can apply partition pruning on  equality (=) and range (&amp;gt;, &amp;gt;=, &amp;lt;, and &amp;lt;=) predicates on  partition-key columns on a single table.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Sample Queries:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 1:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394;"&gt;sql&amp;gt; select * from  sample_orders WHERE ORDER_DATE BETWEEN TO_DATE  ('01-JAN-2010','DD-MON-YYYY') AND TO_DATE('01-MAR-2010','DD-MON-YYYY');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Result:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; ORDER_NUMBER ORDER_DAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_NUM TOTAL_PRICE&amp;nbsp; TOTAL_TAX TOTAL_SHIPPING&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp; ------------ --------- ---------- ----------- ---------- --------------&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100 05-JAN-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 101 02-JAN-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200 05-FEB-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #351c75; font-family: Arial,Helvetica,sans-serif;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 201 02-FEB-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 200&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2222&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Example 2:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp; SQL&amp;gt; select * from sample_orders where ORDER_DATE &amp;gt; ('01-JUN-2010');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Result:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif; font-size: small;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #351c75;"&gt;&amp;nbsp; ORDER_NUMBER ORDER_DAT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CUST_NUM TOTAL_PRICE&amp;nbsp; TOTAL_TAX TOTAL_SHIPPING&lt;/span&gt;&lt;/span&gt;&lt;br style="color: #351c75;" /&gt;     &lt;span style="color: #351c75;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ------------ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ---------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------- &amp;nbsp; &amp;nbsp; ----------- ---------- --------------&lt;/span&gt;&lt;br style="color: #351c75;" /&gt;     &lt;span style="color: #351c75;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05-JUN-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6666&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br style="color: #351c75;" /&gt;     &lt;span style="color: #351c75;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 601 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 02-JUN-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 600&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6666&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br style="color: #351c75;" /&gt;     &lt;span style="color: #351c75;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 700&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05-JUL-10 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 700&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7777&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br style="color: #351c75;" /&gt;     &lt;span style="color: #351c75;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 701&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02-JUL-10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 700&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7777&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br style="color: #351c75;" /&gt;     &lt;span style="color: #351c75;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 800&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 05-AUG-10&amp;nbsp;&amp;nbsp;&amp;nbsp; 800&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8888&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;br style="color: #351c75;" /&gt;     &lt;span style="color: #351c75;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 801&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02-AUG-10 &amp;nbsp;&amp;nbsp; 800&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8888&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1111&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;More Examples: &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Partition on a numeric value range: &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp; &lt;span style="color: #0b5394;"&gt;CREATE TABLE emp (&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; empno NUMBER(4),&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; ename VARCHAR2(30),&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; sal&amp;nbsp;&amp;nbsp; NUMBER&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp; )&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp; PARTITION BY RANGE(empno) (&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; partition e1 values less than (1000)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tablespace ts1,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; partition e2 values less than (2000)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tablespace ts2,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; partition e3 values less than (MAXVALUE) tablespace ts3&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp; );&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Partition on a VARCHAR2 string: &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&amp;nbsp;&lt;span style="color: #0b5394;"&gt; CREATE TABLE emp&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; ( id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NUMBER(5)&amp;nbsp;&amp;nbsp;&amp;nbsp; PRIMARY KEY,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VARCHAR2(50) NOT NULL,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; phone&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VARCHAR2(15),&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; email&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VARCHAR2(100)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; )&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp; PARTITION BY RANGE ( name )&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION p1 VALUES LESS THAN ('L')&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TABLESPACE ts1,&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION p2 VALUES LESS THAN (MAXVALUE) TABLESPACE ts2&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Time based range partitioning:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #0b5394;"&gt;CREATE TABLE t1 (id NUMBER, c1 DATE)&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp; PARTITION BY RANGE (c1)&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (PARTITION t1p1 VALUES LESS THAN (TO_DATE('2007-11-01', 'YYYY-MM-DD')),&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION t1p2 VALUES LESS THAN (TO_DATE('2007-12-01', 'YYYY-MM-DD')),&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION t1p3 VALUES LESS THAN (TO_DATE('2008-01-01', 'YYYY-MM-DD')),&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PARTITION t1p4 VALUES LESS THAN (MAXVALUE)&lt;/span&gt;&lt;br style="color: #0b5394;" /&gt;     &lt;span style="color: #0b5394;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-7961329818567272881?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/7961329818567272881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=7961329818567272881' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/7961329818567272881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/7961329818567272881'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2010/09/oracle-compression-partitioning-pruning.html' title='Oracle: Compression, Partitioning &amp; Pruning'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-2174300324238782660</id><published>2009-08-22T16:56:00.001+05:30</published><updated>2009-08-22T16:56:52.730+05:30</updated><title type='text'>Oracle Database : Complete Export and Import</title><content type='html'>Suppose, we need to export all the Oracle schema in one step, similar&lt;br /&gt;to "--all-databases" option in MySQL. In such cases, here is how its done:&lt;br /&gt;&lt;blockquote&gt;exp USERID=system/password@sid file=complete_bak.dmp log=/tmp/full.log FULL=Y;&lt;/blockquote&gt;This should export all the databases in one step and will store that to a single file.&lt;br /&gt;&lt;br /&gt;Now to import that back, here is what needs to be done.&lt;br /&gt;&lt;blockquote&gt;imp system/password@sid file=complete_bak.dmp log=/tmp/full.log full=y ignore=y&lt;/blockquote&gt;Note:&lt;br /&gt;&lt;br /&gt;* Will work only if ORACLE_HOME is same on both servers&lt;br /&gt;* Create tablespace on the new server before importing the database. Else this wont work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-2174300324238782660?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/2174300324238782660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=2174300324238782660' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/2174300324238782660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/2174300324238782660'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2009/08/oracle-database-complete-export-and_22.html' title='Oracle Database : Complete Export and Import'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-4425703240928110012</id><published>2009-08-22T16:39:00.000+05:30</published><updated>2009-08-22T16:50:14.886+05:30</updated><title type='text'>OpenOffice Error : The user interface language cannot be determined-Linux</title><content type='html'>Stuck at this error after re-installing or upgrading OpenOffice?&lt;pre style="font-family: georgia;"&gt;&lt;h3&gt;&lt;blockquote&gt;&lt;span style="font-size:78%;"&gt;OpenOffice Error : The user interface language cannot be determined-Linux&lt;/span&gt;&lt;/blockquote&gt;&lt;/h3&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style="font-family:Georgia,serif;"&gt;&lt;span style="font-size:100%;"&gt;The error occurs because the folder where the necessary files are&lt;br /&gt;not present are not having enough permissions. The solution&lt;br /&gt;is pretty simple. Get into the user's home directory&lt;blockquote&gt;# cd /home/username&lt;/blockquote&gt;Find the hidden folder which stores OpenOffice files. Its&lt;br /&gt;usually ".openofficeversion" or ".oooversion".&lt;br /&gt;&lt;blockquote&gt;# cd ~/.oooversion&lt;/blockquote&gt;Now execute the below command:&lt;blockquote&gt;# sudo chown --reference=. -R .openoffice.org2&lt;/blockquote&gt;Now give necessary permissions to that folder:&lt;blockquote&gt;# sudo chmod -R 755 .openoffice.org2&lt;/blockquote&gt;Try opening up OpenOffice. It should work just fine now.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-4425703240928110012?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/4425703240928110012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=4425703240928110012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/4425703240928110012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/4425703240928110012'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2009/08/openoffice-error-user-interface.html' title='OpenOffice Error : The user interface language cannot be determined-Linux'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-1411892013085220060</id><published>2009-08-22T16:35:00.000+05:30</published><updated>2009-08-22T16:39:49.753+05:30</updated><title type='text'>Bulk downoading files from a webserver folder accessible via FTP</title><content type='html'>Suppose, if we need to download all files from a web folder, accessible via FTP, we can use LFTP command to do that. For example, in one website, under the "clamav" folder, I need to download all RPM files from there. So instead of downloading that one by one, I can do so by the command below:&lt;span style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;lftp -c 'open -e "mget -d *.el5.rf.i386.rpm" http://packages.sw.be/clamav/'&lt;/blockquote&gt;This needs to be executed from a terminal. Also packages, LFTP and MGET needs to be present.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-1411892013085220060?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/1411892013085220060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=1411892013085220060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/1411892013085220060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/1411892013085220060'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2009/08/bulk-downoading-files-from-webserver.html' title='Bulk downoading files from a webserver folder accessible via FTP'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-3520735498979768541</id><published>2008-12-16T11:35:00.000+05:30</published><updated>2008-12-16T11:54:09.114+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='cdrecord'/><category scheme='http://www.blogger.com/atom/ns#' term='iso to cdrom'/><category scheme='http://www.blogger.com/atom/ns#' term='burn from command line'/><title type='text'>Burn an ISO image to a CD right from the command line!</title><content type='html'>This is commonly used by system administrators who love simple, efficient and verbose method of writing an image into a Compact Disk. If you have an ISO file "image.iso", then you can use the "cdrecord" command:&lt;br /&gt;&lt;blockquote&gt;cdrecord -v speed=8 dev=/dev/cdrom /path/to/image.iso&lt;/blockquote&gt;&lt;span style="font-style: italic;"&gt;Attributes:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-v&lt;/span&gt; :  Verbose mode, shows a lotta information while writing the disk.. geeky :-D&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;speed =&lt;/span&gt;  : you can set the burning speed. 8 means 8x speed&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;-multi &lt;/span&gt;: multisession mode (ooooh, cool feature for a command line tool)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-3520735498979768541?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/3520735498979768541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=3520735498979768541' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3520735498979768541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3520735498979768541'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/12/burn-iso-image-to-cd-right-from-command.html' title='Burn an ISO image to a CD right from the command line!'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-7015634735488837261</id><published>2008-12-16T10:59:00.000+05:30</published><updated>2008-12-16T11:35:04.811+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='sort files'/><category scheme='http://www.blogger.com/atom/ns#' term='List'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='size'/><title type='text'>Listing files in Linux sorted according to size</title><content type='html'>Have you ever felt the need to list the 10 files that takes the largest space in a specific directory? You might know that its pretty easy do that via GUI but believe me its the same thing when it comes to the Console also.&lt;br /&gt;&lt;br /&gt;Here is how its done:&lt;br /&gt;&lt;blockquote&gt;du -a (directory) | sort -n -r | head -n 10&lt;/blockquote&gt;This will list all the files in the directory specified, sorts them and lists the 10 files that takes up maximum size.&lt;br /&gt;&lt;br /&gt;Easy, right?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-7015634735488837261?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/7015634735488837261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=7015634735488837261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/7015634735488837261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/7015634735488837261'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/12/listing-files-sorted-according-to-size.html' title='Listing files in Linux sorted according to size'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-4830131660680577690</id><published>2008-12-02T20:27:00.000+05:30</published><updated>2008-12-02T21:07:38.940+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Webserver text files'/><category scheme='http://www.blogger.com/atom/ns#' term='download'/><category scheme='http://www.blogger.com/atom/ns#' term='htaccess'/><title type='text'>Make files in your webserver download instead of being displayed</title><content type='html'>Suppose, you have a text file in your web directory. When you access that file, it will be displayed in the web browser itself. If you want to make that file (or any other file type you want) to be asked to download instead of being displayed, here is what you can do:&lt;br /&gt;&lt;br /&gt;Create a .htaccess file in that directory with the following content:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;AddType  unknown/nothing pdf&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;AddType unknown/nothing txt&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;AddType  unknown/nothing jpg&lt;/span&gt;&lt;/blockquote&gt;Now when you access any file with an extension .jpg or .pdf, your browser will ask you to download the file instead of showing up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-4830131660680577690?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/4830131660680577690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=4830131660680577690' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/4830131660680577690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/4830131660680577690'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/12/make-files-download-instead-of-being.html' title='Make files in your webserver download instead of being displayed'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-1074137210640684431</id><published>2008-12-02T19:13:00.000+05:30</published><updated>2008-12-02T20:16:41.497+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SMTP Relay'/><category scheme='http://www.blogger.com/atom/ns#' term='Postfix'/><category scheme='http://www.blogger.com/atom/ns#' term='relayhost'/><title type='text'>Relaying email from Postfix via another SMTP Server</title><content type='html'>Have you ever been in a situation where you want to relay your emails from your Postfix server via another SMTP server? This is certainly possible and its way too simple:&lt;br /&gt;&lt;br /&gt;First thing to do is configure Postfix in your machine. Once done, edit the configuration file for Postfix (usually under /etc/main.cf) and editing the below value:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102); font-style: italic;"&gt;#relayhost =&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51); font-style: italic;"&gt;relayhost = smtp.emailprovider.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Once done, all emails sent via your Postfix server will be relayed through the desired Outgoing server.&lt;br /&gt;&lt;br /&gt;Other options that may interest you are as follows:&lt;br /&gt;&lt;blockquote&gt;&lt;ul style="font-style: italic;"&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;myhostname = hostname.emailprovider.com&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;mydomain = emailprovider.com&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;masquerade_domains = emailprovider.com&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;The last option will correct the envelopes shows as "user@emailprovider.com".&lt;br /&gt;&lt;br /&gt;Hope that helps someone :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-1074137210640684431?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/1074137210640684431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=1074137210640684431' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/1074137210640684431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/1074137210640684431'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/12/relaying-email-from-postfix-via-another.html' title='Relaying email from Postfix via another SMTP Server'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-3447608753807402566</id><published>2008-12-01T21:24:00.000+05:30</published><updated>2008-12-02T20:19:25.646+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Limiting Denial of Service Attacks'/><title type='text'>Limiting Denial of Service (DoS) attacks</title><content type='html'>&lt;strong style="font-weight: normal;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Denial-of-service_attack"&gt;Denial of Service (DoS)&lt;/a&gt; attack is&lt;/strong&gt; an attempt by a malicious (or unwitting) user, process, or system to prevent legitimate users from accessing a resource (usually a network service) by exploiting a weakness or design limitation in an information system. Examples of DoS attacks include flooding network connections, filling disk storage, disabling ports, or removing power. This can be limited by setting timeouts.&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;# echo 30 &gt; /proc/sys/net/ipv4/tcp_fin_timeout&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# echo 1800 &gt; /proc/sys/net/ipv4/tcp_keepalive_time&lt;span style="font-family:Georgia,serif;"&gt;&lt;/span&gt;&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;span style="font-family:Georgia,serif;"&gt;# e&lt;/span&gt;cho 1 &gt; /proc/sys/net/ipv4/tcp_window_scaling&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# echo 0 &gt; /proc/sys/net/ipv4/tcp_sack&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;# echo 1280 &gt; /proc/sys/net/ipv4/tcp_max_syn_backlog &lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;span style="font-family: monospace;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Source: &lt;a href="http://sourcelinux.wikidot.com/firewall-using-iptables"&gt;http://sourcelinux.wikidot.com/firewall-using-iptables&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-3447608753807402566?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/3447608753807402566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=3447608753807402566' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3447608753807402566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3447608753807402566'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/12/limiting-denial-of-service-dos-attacks.html' title='Limiting Denial of Service (DoS) attacks'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-3552305341005810522</id><published>2008-11-27T09:33:00.000+05:30</published><updated>2008-11-27T11:35:30.536+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='interesting usages of wget'/><category scheme='http://www.blogger.com/atom/ns#' term='wget usages'/><title type='text'>Usages of "wget" command in Linux</title><content type='html'>&lt;a href="http://www.gnu.org/software/wget/"&gt;&lt;span style="font-weight: bold;"&gt;Wget&lt;/span&gt;&lt;/a&gt;, IMO, is the best download manager application I've ever seen for Linux operating system. Apart from the normal usages of wget, there are so many cool usages which can become real handy!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Resume Downloads:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget -c download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download in background:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget -b download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Limit the bandwidth usage:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget --limit-rate=10k download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;This will make wget download the file at a maximum speed of 10Kbps. This can be handy when downloading in background and there are other applications that needs Internet usage. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download from websites having authentication:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget --username=username --password=password download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download from an FTP server that requires authentication:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget --ftp-user=username --ftp-password=password download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download a website completely (recursively):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget -r website_link&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;Download a website completely (recursively) up to a certain level:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget -r -l 5 website_link&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Download up to 5 levels from the website directory. &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Please make sure you have enough disk space before attempting to download like this.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download a website and convert the links relative to the local system to make it available for offline use:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget --convert-links -r website_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Torn ON mirroring:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget --mirror download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download an HTML page along with its page requisites:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;This helps to download a web page (HTML) along with the requirements of that page such as images, sounds, style sheets etc. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# wget  --page-requisites download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download Securely from HTTPS sites:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;wget --secure-protocol=protocol_name download_link&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Valid options for Protocol names are "auto", "SSLv2", "SSLv3", and "TLSv1". The option "auto" can be used if you dont want to specify the protocol to be used. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And.. yes.. that's not all.. there are so many other options for the wget command. Refer its manual pages for more details.. If I find anything more interesting, I will make sure I post it here :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-3552305341005810522?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/3552305341005810522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=3552305341005810522' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3552305341005810522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/3552305341005810522'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/11/usages-of-wget-command-in-linux.html' title='Usages of &quot;wget&quot; command in Linux'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-8242135405319907195</id><published>2008-11-27T09:28:00.000+05:30</published><updated>2008-11-27T13:15:41.918+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='find and move files to another folder'/><title type='text'>Find all files matching a specific pattern and move them to a specified sub-folder</title><content type='html'>To find all files matching a specific pattern and move them to a specified sub-folder, this command will be handy:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;# &lt;span style="color: rgb(51, 51, 51);"&gt;find . -type f -exec grep -q 'search_string' {} \; -exec mv {} sub_folder_location/ \;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-8242135405319907195?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/8242135405319907195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=8242135405319907195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/8242135405319907195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/8242135405319907195'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/11/find-all-files-matching-specific.html' title='Find all files matching a specific pattern and move them to a specified sub-folder'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-6827196702032883397</id><published>2008-11-18T09:03:00.000+05:30</published><updated>2008-12-02T16:23:53.113+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='upgrading from Ubuntu Hardy to Ubuntu Intrepid'/><category scheme='http://www.blogger.com/atom/ns#' term='nvidia bug'/><title type='text'>Nvidia driver fails to load after an upgrade from Ubuntu 8.04 (Hardy Heron) to Ubuntu 8.10 (Intrepid Ibex)</title><content type='html'>Well, I guess it was too early for me for an upgrade but I was waiting restlessly for an upgrade to the latest Ubuntu version, Intrepid Ibex. The upgrade went fine but guess what, my X server failed to load NVIDIA drivers once it booted up. I could get into Safe Graphics mode.. but it was certainly not what I should have.&lt;br /&gt;&lt;br /&gt;I had to refer so many blogs and docs to get this working.. I am posting that here so that anyone else having the same issue might find this useful.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Boot with Xorg server default configuration first.&lt;/li&gt;&lt;li&gt;Open up Synaptic and remove every installed package having the name "nvidia"&lt;/li&gt;&lt;li&gt;Reboot again (this is a must)&lt;/li&gt;&lt;li&gt; Install these Nvidia packages except "nvidia-xconfig" package (which got the bug)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;  nvidia-glx-177&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;    nvidia-*-modaliases&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;    nvidia-kernel&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;    nvidia-kernel-common&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;    nvidia-177-kernel-source&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;    nvidia-settings&lt;/span&gt;&lt;ul&gt;&lt;li&gt; Reboot again&lt;/li&gt;&lt;li&gt;Run sudo nvidia-xconfig&lt;/li&gt;&lt;li&gt;Restart X server.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;From many blogs and forums, many have said that this corrected their issue.. but unfortunately, not mine.. I checked the Xorg.log and could see the line that the file "libglx.so" was missing due to some reason. Then I got a suggestion from another blog to link the file libglx.so.169.12 to libglx.so.&lt;br /&gt;&lt;br /&gt;# sudo -s&lt;br /&gt;# cd /usr/lib/xorg/modules/extensions&lt;br /&gt;# ln -s libglx.so.169.12  libglx.so&lt;br /&gt;# init 6&lt;br /&gt;&lt;br /&gt;That worked! And, I became another happy Intrepid Ibex user :-)&lt;br /&gt;&lt;br /&gt;PS: This bug might have fixed with the latest updates so, I also recommend doing a complete update before trying these steps!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-6827196702032883397?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/6827196702032883397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=6827196702032883397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/6827196702032883397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/6827196702032883397'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/11/nvidia-driver-fails-to-load-after.html' title='Nvidia driver fails to load after an upgrade from Ubuntu 8.04 (Hardy Heron) to Ubuntu 8.10 (Intrepid Ibex)'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-5569869266764441602</id><published>2008-11-12T10:18:00.000+05:30</published><updated>2008-11-27T13:20:46.625+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Alter text from a source text file and write to an output file'/><category scheme='http://www.blogger.com/atom/ns#' term='Sed Command'/><title type='text'>A cool usage of "sed" command</title><content type='html'>Suppose, you have a text file called "&lt;span style="font-style: italic;"&gt;input.txt&lt;/span&gt;". You want to convert all instances of "&lt;span style="font-style: italic;"&gt;thisword&lt;/span&gt;" to "&lt;span style="font-style: italic;"&gt;anotherword&lt;/span&gt;" and produces and output file called "&lt;span style="font-style: italic;"&gt;output.txt&lt;/span&gt;".&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;# cat input.txt | sed 's/thisword/anotherword/g' &gt; output.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cool, huh?  ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-5569869266764441602?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/5569869266764441602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=5569869266764441602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/5569869266764441602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/5569869266764441602'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/11/cool-usage-of-sed-command.html' title='A cool usage of &quot;sed&quot; command'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-4017788929478363847</id><published>2008-11-12T09:36:00.000+05:30</published><updated>2008-11-27T12:26:27.440+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Port Forwarding'/><category scheme='http://www.blogger.com/atom/ns#' term='Linux'/><category scheme='http://www.blogger.com/atom/ns#' term='SSH'/><category scheme='http://www.blogger.com/atom/ns#' term='IPTABLES'/><title type='text'>SSH Port forwarding in Linux using IPTables</title><content type='html'>Port forwarding can be done using IPTables using DNAT. I had a requirement in my enterprise, which is shown in the below chart:&lt;br /&gt;&lt;br /&gt;Internet --&gt; Connections made on port 22 on Gateway machine --&gt; re-directed to port 22 of another machine present in the private network&lt;br /&gt;&lt;br /&gt;Here the Gateway machine as two NIC cards with one of them having a public IP, say, 202.202.202.202. The machine to which the SSH connections are forwarded are on port 22 of 192.168.1.10 which is on a private network connected via the second NIC card.&lt;br /&gt;&lt;br /&gt;So here is how the IPTable rule should be given:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt;&lt;external_interface&gt;iptables -t nat -A PREROUTING -p tcp -i external_interface -d external_ip --dport 22 -j DNAT --to-destination private_ip&lt;/external_interface&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So as per my above example network, here is how the rule should look like:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;iptables -t nat -A PREROUTING -p tcp -i eth0 -d 202.202.202.202 --dport 22 -j DNAT --to-destination 192.168.1.10&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: Please note that the private machine to be connected must be using the same Gateway we are trying to SSH. This should be taken into consideration while port forwarding in a network using more than one Gateway machines.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-4017788929478363847?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/4017788929478363847/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=4017788929478363847' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/4017788929478363847'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/4017788929478363847'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/11/ssh-port-forwarding-in-linux-using.html' title='SSH Port forwarding in Linux using IPTables'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-7205617756426433631</id><published>2008-11-12T09:14:00.000+05:30</published><updated>2008-11-18T09:26:58.771+05:30</updated><title type='text'>Reverse SSH Tunneling in Linux</title><content type='html'>This can be very handy if you want to access a Linux box present inside a NATed Network from a Linux machine outside the network. The hard way is via DNAT using IPTables using Port Forwarding, but this is very, very simple if SSH Tunneling is used.&lt;br /&gt;&lt;br /&gt;For example, if you want to access a machine 192.168.1.10 (present under a NAT Network) from another Linux machine having the IP address 202.202.202.202, then here is what you have to do:&lt;br /&gt;&lt;br /&gt;1) SSH from the private machine to the public machine using the below command;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0); font-weight: bold;"&gt;ssh -R 18000:localhost:22 remoteuser@202.202.202.202&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here -R specifies that the given port on the remote (server) host is to be forwarded to the given host and port on the local side. 18000 can be any unused port on the machine.&lt;br /&gt;&lt;br /&gt;2) Now from the remote machine, SSH into that machine itself to the port we mentioned earlier.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 51, 0);"&gt;ssh localuser@localhost -p 18000&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;That should ask for a password and it needs to be the password of the localuser you have specified in the above command. &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(102, 51, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-7205617756426433631?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/7205617756426433631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=7205617756426433631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/7205617756426433631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/7205617756426433631'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/11/reverse-ssh-tunneling-in-linux.html' title='Reverse SSH Tunneling in Linux'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6016290386756889880.post-1035283624449274189</id><published>2008-09-24T14:54:00.000+05:30</published><updated>2008-09-24T15:40:25.335+05:30</updated><title type='text'>Upgrading from PHP 5.1 to 5.2 in Fedora</title><content type='html'>Its not that hard to upgrade PHP from v5.1 to v5.2. Here is how I do this (in detail):&lt;br /&gt;&lt;br /&gt;1) Know your current PHP version:&lt;br /&gt;&lt;br /&gt;# php -v&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;PHP 5.1.6 (cli) (built: Feb 23 2007 10:11:28) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Copyright (c) 1997-2006 The PHP Group&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So the current version is 5.1.6 and this needs to be upgraded.&lt;br /&gt;&lt;br /&gt;2) Check out the PHP RPMs that you have installed in your machine:&lt;br /&gt;&lt;br /&gt;# rpm -qa | grep php&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;php-pdo-5.1.6-1.4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;php-json-1.2.1-2.fc5&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;php-mysql-5.1.6-1.4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;php-gd-5.1.6-1.4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;php-xml-5.1.6-1.4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;php-5.1.6-1.4&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;php-pear-1.4.9-1.2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3) Download the RPM packages for the new PHP Version. I use the website &lt;a href="http://rpm.pbone.net/"&gt;RPM.PBONE.NET&lt;/a&gt; since it provides a good customized search interface for finding the right RPM packages. Use "Advanced RPM Search" link near the "Search" button and you will see what I mean. Download the ones required from the desired FTP servers and place them in a folder.&lt;br /&gt;&lt;br /&gt;(Since I am doing this for a PHP Development machine, I might use a few extra packages that might not be in your menu ;-)&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;span class="textblack"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;/span&gt;pcre-6.6-1.fc5.remi.i386.rpm  &lt;br /&gt;php-devel-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;php-pdo-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;php-5.2.5-1.fc5.remi.i386.rpm       &lt;br /&gt;php-gd-5.2.5-1.fc5.remi.i386.rpm   &lt;br /&gt;php-pear-1.7.1-1.fc5.remi.noarch.rpm&lt;br /&gt;php-cli-5.2.5-1.fc5.remi.i386.rpm   &lt;br /&gt;sqlite2-2.8.17-1.fc5.i386.rpm&lt;br /&gt;php-common-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;php-mysql-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;sqlite2-2.8.17-1.fc5.i386.rpm.html&lt;br /&gt;&lt;br /&gt;4) Remove the existing PHP RPMs from the machine:&lt;br /&gt;&lt;br /&gt;# rpm -e php php-pear php-pdo php-gd php-mysql php-gd&lt;br /&gt;&lt;br /&gt;(If this is successful, you wont get any results. If you see a message like "&lt;span style="font-style: italic;"&gt;php-gd not found&lt;/span&gt;" then just remove that package from the above remove list)&lt;br /&gt;&lt;br /&gt;5) Install the new RPMs in the below order to avoid dependency errors:&lt;br /&gt;&lt;br /&gt;# rpm -Uvh pcre-6.6-1.fc5.remi.i386.rpm&lt;br /&gt;# rpm -ivh php-common-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;# rpm -ivh php-cli-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;# rpm -ivh php-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;# rpm -ivh sqlite2-2.8.17-1.fc5.i386.rpm&lt;br /&gt;# rpm -ivh php-pdo-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;# rpm -ivh php-mysql-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;# rpm -ivh php-pear-1.7.1-1.fc5.remi.noarch.rpm&lt;br /&gt;# rpm -ivh php-gd-5.2.5-1.fc5.remi.i386.rpm&lt;br /&gt;&lt;br /&gt;6) This should be over pretty quickly and you wont get any errors. Then just restart your Apache Server (HTTPD) for the changes to take effect.&lt;br /&gt;&lt;br /&gt;# /etc/init.d/httpd restart&lt;br /&gt;&lt;br /&gt;Now check your PHP Version and see if the change got reflected:&lt;br /&gt;&lt;br /&gt;# php -v&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;PHP &lt;span style="font-weight: bold;"&gt;5.2.5&lt;/span&gt; (cli) (built: Nov 10 2007 12:15:39) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Copyright (c) 1997-2007 The PHP Group&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Voila, Done!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6016290386756889880-1035283624449274189?l=tuxdiary.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxdiary.blogspot.com/feeds/1035283624449274189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6016290386756889880&amp;postID=1035283624449274189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/1035283624449274189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6016290386756889880/posts/default/1035283624449274189'/><link rel='alternate' type='text/html' href='http://tuxdiary.blogspot.com/2008/09/upgrading-from-php-51-to-52-in-fedora.html' title='Upgrading from PHP 5.1 to 5.2 in Fedora'/><author><name>Vikas Vishnu</name><uri>http://www.blogger.com/profile/07100764436032110917</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp3.blogger.com/_JhGyv-3Unaw/R6scJ2bri4I/AAAAAAAAAWA/frDOdHV2swM/S220/fred.png'/></author><thr:total>0</thr:total></entry></feed>
