<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ask the German &#187; UNIX</title>
	<atom:link href="http://www.askthegerman.com/archives/category/operatingsystem/unix/feed" rel="self" type="application/rss+xml" />
	<link>http://www.askthegerman.com</link>
	<description>"the owl of Minerva spreads its wings only with the falling of the dusk"</description>
	<lastBuildDate>Thu, 30 Apr 2009 10:26:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Monitor your Tomcat Servlet on a regular basis</title>
		<link>http://www.askthegerman.com/archives/274</link>
		<comments>http://www.askthegerman.com/archives/274#comments</comments>
		<pubDate>Thu, 30 Apr 2009 08:30:55 +0000</pubDate>
		<dc:creator>Volker</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[TomCat]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Web Technologies]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=274</guid>
		<description><![CDATA[Lets assume you have enabled the monitoring capabilities of your tomcat. If you do not know how to achieve this see my earlier posting here about. Now it is cool to monitor your application on a regular basis. Because I&#8217;m used to shell scripting in LINUX I present you here a scripting solution within a [...]]]></description>
			<content:encoded><![CDATA[<p>Lets assume you have enabled the monitoring capabilities of your tomcat.<br />                   If you do not know how to achieve this see my earlier <a href="/archives/252" title="Enabling tomcat monitoring capabilities">posting</a> here about.</p>
<p>Now it is cool to monitor your application on a regular basis. <br />                   Because I&#8217;m used to shell scripting in LINUX I present you here a scripting solution within a bash shell. But I&#8217;m sure you can do the same in Windows. <br />                   The idea is to set up a cron job ( for windows use the scheduler) and get the statuspage from your tomcat every &#8211; lets say &#8211; five minutes.<br />                   Get some of the interesting values out of this page and save them in a csv &#8211; File.<br />                   Create a new file every day. Perhaps you want to use this files as input for a spreadsheet program to create some nice charts.</p>
<p>But to be honest &#8211; this is a very special script &#8211; you have to adopt it to your needs.<br />                   This are the basic prerequisites:</p>
<ul>
<li>you need linux to run it (this script is developed on a SUSE &#8211; Distribution)</li>
<li>eventually you need to install some tools (I think the w3m tool is not bundled with every linux distribution)</li>
<li>this script only! works correct with a tomcat 6.0 version</li>
</ul>
<p><font face="Courier" size="1"><span style="color: #006600">#!/bin/bash<br />                   # -configure below-</span><br />                   HTTPPORT=&quot;8080&quot; &nbsp;&nbsp; <span style="color: #0066ff"># The http Port of your tomcat</span><br />                   JKPORT=&quot;8709&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #0066ff"># The Modjk Port of your tomcat (if your tomcat should be reachable from a apache webserver)</span><br />                   SERVER=&quot;localhost:$HTTPPORT&quot; <span style="color: #0066ff"># you can even monitor a tomcat on another server!</span><br />                   USER=&quot;tomcat-oper&quot; <span style="color: #0066ff"># the account and</span><br />                   PW=&quot;IwantItAll&quot;&nbsp;&nbsp;&nbsp; <span style="color: #0066ff"># password you have defined in tomcat-users.xml</span><br />                   APPL=&quot;CoolAppl&quot; &nbsp;&nbsp; <span style="color: #0066ff"># The name of your application</span><br />     <span style="color: #006600"># -configure above-</span><br />                   TODAY=`date &#8216;+%m-%d-%y&#8217;`<br />                   TIME=`date &#8216;+%H:%M:%S&#8217;`<br />                   OUTFILE=&quot;tomcat-stats-${TODAY}.csv&quot;<br />     <span style="color: #006600">#</span><br />     <span style="color: #006600">#set -x</span>&nbsp;&nbsp; <span style="color: #0066ff"># uncomment if you want to improve the script or if you are searching for a bug</span><br />     <span style="color: #006600">#</span><br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># If there is no csv-file create one and put a headerline in</span><br />                   if !(test -e $OUTFILE) then<br />          &nbsp; echo &quot;Time,FreeMemory,UsedMemory,MaxMemory,HttpThreadsMax,<br />      &nbsp; HttpThreadsBusy,ModJKThreads,ModJKThreadsBusy,Sessions&quot; &gt; $OUTFILE<br />                   fi<br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># get the statuspage from tomcat &#8211; filter it for the wanted informations &#8211; and create a temporary file</span><br />                   &nbsp;  w3m -dump http://${USER}:${PW}@${SERVER}/manager/status/all| \<br />                   &nbsp;  egrep &quot;(memory|thread|Active sessions|<br />        &nbsp; ^JVM|$HTTPPORT|$JKPORT|${APPL})&quot; &gt;/tmp/tomcat-status<br />     <span style="color: #006600">#<br />                   #</span> <span style="color: #0066ff"># put the values in variables / uncomment to get a better understanding of the process</span><br />     <span style="color: #006600">#</span><br />                   while read line<br />                   &nbsp;&nbsp;    do<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      case $line in<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           JVM)   read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  JVM_VALUE=`echo $line | awk &#8216;{print($3 &quot;,&quot; $7 &quot;,&quot; $11)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug</span></font><font face="Courier" size="1"><span style="color: #006600"><br />            #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;JVM_VALUE: &lt;$JVM_VALUE&gt;&quot;</span><span style="color: #0066ff"></span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;            *${HTTPPORT}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HTTP_MAX_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #006600"></span> <span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;HTTP_MAX_THREADS: &lt;$HTTP_MAX_THREADS&gt;&quot;</span><span style="color: #0066ff"></span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  HTTP_BSY_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $11)}&#8217;`<br />     <span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug</span><br />     <span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                echo &quot;HTTP_BSY_THREADS: &lt;$HTTP_BSY_THREADS&gt;&quot;</span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           *${JKPORT}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  MODJK_MAX_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;MODJK_MAX_THREADS: &lt;$MODJK_MAX_THREADS&gt;&quot;</span><br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  MODJK_BSY_THREADS=`echo $line |awk &#8216;{print(&quot;,&quot; $11)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment </span></font><font face="Courier" size="1"><span style="color: #0066ff">below </span></font><font face="Courier" size="1"><span style="color: #0066ff">if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                echo &quot;MODJK_BSY_THREADS: &lt;$MODJK_BSY_THREADS&gt;&quot;</span><span style="color: #0066ff"></span><br />            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;           *${APPL}) read line<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                  SESSION_CNT=`echo $line |awk &#8216;{print(&quot;,&quot; $3)}&#8217;`<br />     <span style="color: #006600"></span></font><font face="Courier" size="1"><span style="color: #0066ff">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uncomment below if you want to debug<br />     </span></font><font face="Courier" size="1"><span style="color: #006600"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;               echo &quot;SESSION_CNT: &lt;$SESSION_CNT&gt;&quot;</span><span style="color: #0066ff"></span><br />            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;                         ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *) ;;<br />                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      esac<br />                   &nbsp;&nbsp;&nbsp;    done &lt; /tmp/tomcat-status<br />     <span style="color: #006600">#</span> <span style="color: #0066ff"># Now is the time to write the data to the csv-file</span><br />           &nbsp; echo &quot;${TIME},${JVM_VALUE}${HTTP_MAX_THREADS}${HTTP_BSY_THREADS}<br />      &nbsp; ${MODJK_MAX_THREADS}${MODJK_BSY_THREADS}${SESSION_CNT}&quot; &gt;&gt;$OUTFILE<br />                   exit</font></p>
<p><em>*) be aware that based on word wrapping this script might not work instantly</em> </p>
<p>Create a scriptfile (e.g. tomcat-check.sh) and apply the script to your tomcat. Then edit your crontab.                </p>
<p>There should be a line like:<br />     <strong>&quot;*/5 * * * * cd ~/statistics; ./tomcat-check.sh  1&gt;tomcat-check.log 2&gt;&amp;1&quot;</strong></p>
<p>And then the script should create the csv-files. I&#8217;m not used to excel &#8211; but even I managed to create a more or less interesting diagram from this data. Note how regular the memory behaves while there is no user session.</p>
<p><img alt="Tomcat Monitoring Graphic" title="Tomcat Monitoring Graphic" src="/wp-content/uploads/tomcat/tomcat-graphic-small.jpg" />&nbsp;</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F274';
  addthis_title  = 'Monitor+your+Tomcat+Servlet+on+a+regular+basis';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/274/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password Protect Webfolders</title>
		<link>http://www.askthegerman.com/archives/227</link>
		<comments>http://www.askthegerman.com/archives/227#comments</comments>
		<pubDate>Sun, 14 Dec 2008 11:55:42 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Webserver]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[.htpasswd]]></category>
		<category><![CDATA[htpasswd2]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[protect]]></category>
		<category><![CDATA[username]]></category>
		<category><![CDATA[webfolder]]></category>
		<category><![CDATA[webroot]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=227</guid>
		<description><![CDATA[Sometimes we have to place content on our webserver we want to protect and only accessed by privileged users. A basic security can be established by a password restricted folder access, enforced by the Apache Webserver itself. This can be done by some simple instructions added to our .htaccess file: (In case you haven&#8217;t already [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we have to place content on our webserver we want to protect and only accessed by privileged users.</p>
<p>A basic security can be established by a password restricted folder access, enforced by the Apache Webserver itself.</p>
<p>This can be done by some simple instructions added to our .htaccess file:<br />     (In case you haven&#8217;t already a .htaccess file, just create a new file calling it .htaccess and locating it in the folder you want to protect.) </p>
<p><em>AuthType Basic<br />     AuthName &quot;Protected Area&quot;<br />     AuthUserFile FILE<br />     require valid-user</em></p>
<p>These commands will tell the Apache webserver that the folder in question (and all below) are now protected and it needs a valid combination of username/password to access it.</p>
<ul>
<li><em>AuthName</em> is some free form text you can specify, telling the visitor what you are asking for and Apache Webserver will show in it&#8217;s dialog box.</li>
</ul>
<ul>
<li><em>AuthUserFile</em> is the reference to the stored .htpasswd file containing all valid username/password combinations to access the folder in question (ususally and best located out of the protected directory tree).</li>
</ul>
<p>Having that done we now need to create the necessary .htpasswd file which we can do interactive on our server with the command:</p>
<p><em>htpasswd2 -c FILE USER</em></p>
<p>Assuming html is your webroot, a valid example, for protecting a folder called images below our webroot and using demouser/demopassword as user credentials, would be:</p>
<p><strong>.htaccess:</strong><br />     (Locate this file within the folder images and be aware to use an absolute path for <em>AuthUserFile, </em>as for <em>www.domain.com</em> would be wrong!)</p>
<p><em>AuthUserFile /home/username/html/.htpasswd<br />     AuthType Basic<br />     AuthName &quot;Login for Secure Area&quot;<br />     require valid-user</em> </p>
<p><strong>.htpasswd</strong><br />     (Create a new file called .htpasswd and locate this file within the folder you&#8217;ve specified within <em>AuthUserFile </em>path<em>.</em>)</p>
<p><em>demouser:$1$OHq3K5v3$pvFrGsHjWwYjpkZhc70T9. </em> </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F227';
  addthis_title  = 'Password+Protect+Webfolders';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/227/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transportable Tablespaces</title>
		<link>http://www.askthegerman.com/archives/210</link>
		<comments>http://www.askthegerman.com/archives/210#comments</comments>
		<pubDate>Wed, 10 Dec 2008 12:34:28 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[converting]]></category>
		<category><![CDATA[endianness Big]]></category>
		<category><![CDATA[endianness Little]]></category>
		<category><![CDATA[exp]]></category>
		<category><![CDATA[imp]]></category>
		<category><![CDATA[plattform]]></category>
		<category><![CDATA[RMAN]]></category>
		<category><![CDATA[transportable Tablespaces]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=210</guid>
		<description><![CDATA[Since Oracle Version 10G ist is possible to transfer tablespaces no longer only between platforms of the same architecture. Now in 10G it also possible to transport from any platform to any platform, provided the platforms belong to the list below: SQL&#62;&#160; select * from v$transportable_platform; &#160;&#160; PLATFORM_ID PLATFORM_NAME&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ENDIAN_FORMAT &#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1 Solaris[tm] OE [...]]]></description>
			<content:encoded><![CDATA[<p>Since Oracle Version 10G ist is possible to transfer tablespaces no longer only between platforms of the same architecture. Now in 10G it also possible to transport from any platform to any platform, provided the platforms belong to the list below:</p>
<p><em><font face="Courier">SQL&gt;&nbsp; select * from v$transportable_platform;</font></em></p>
<p><em><font face="Courier">&nbsp;&nbsp; PLATFORM_ID PLATFORM_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIAN_FORMAT<br />        &nbsp;&nbsp; <br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 Solaris[tm] OE (32-bit)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Big<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2 Solaris[tm] OE (64-bit)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Big<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7 Microsoft Windows NT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Little<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 10 Linux IA (32-bit)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Little<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6 AIX-Based Systems (64-bit)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Big<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3 HP-UX (64-bit)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Big<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5 HP Tru64 UNIX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Little<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 HP-UX IA (64-bit)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Big<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 11 Linux IA (64-bit)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Little<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 15 HP Open VMS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Little<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8 Microsoft Windows IA (64-bit)&nbsp;&nbsp;&nbsp; Little<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9 IBM zSeries Based Linux&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Big<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 13 Linux 64-bit for AMD&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Little<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 16 Apple Mac OS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Big<br />        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12 Microsoft Windows 64-bit for AMD Little</font></em> </p>
<p><strong><span>But be aware that depending on which plattforms we deal with there might be some converting necessary or not<font face="courier">!</font></span></strong></p>
<p>To help you with that, I have carried together the little cook book about &quot;How to do&quot; below:</p>
<p><u>1. Set the tablespace to READ ONLY</u></p>
<p><em>SQL&gt; alter tablespace USERS read only;<br />       Tablespace altered.</em>&nbsp;</p>
<p>2. Export metadata</p>
<p><em>exp userid=\&#8217;/ as sysdba\&#8217; transport_tablespace=y<br />       tablespaces=users<br />       file=users_tts.dmp log=exp_users_tts.log<br />       statistics=none</em></p>
<p><u>3. Converting tablespace if necessary</u> </p>
<p>Depending on we have to convert the file between <strong>endianness Little</strong> and <strong>endianness Big</strong> (forward or backward) we can do that with RMAN:</p>
<p><em>rman target=/</em></p>
<p><em>Recovery Manager: Release 10.2.0.3.0 &#8211; Production on Wed Dec 10 13:10:57 2008<br />       connected to target database: orav10 (DBID=1953618181)</em></p>
<p><em>RMAN&gt; convert tablespace &#8216;USERS&#8217;<br />       2&gt;&nbsp; to platform=&quot;Linux IA (32-bit)&quot;<br />       3&gt;&nbsp; db_file_name_convert=&#8217;/database/orav10/datafiles/users.dbf&#8217;,<br />       4&gt;&nbsp; &#8216;/tmp/users.dbf&#8217;;</em></p>
<p><u>4. Move datafiles and export dump file</u></p>
<p><em>$ftp users_tts.dmp</em> </p>
<p>and <em>/database/orav10/datafiles/users.dbf</em> (no conversion)<br />   or <em>/tmp/users.dbf</em> (converted file if conversion had been required)</p>
<p><u>5. Import metadata</u> </p>
<p><em>imp userid=\&#8217;/ as sysdba\&#8217; TRANSPORT_TABLESPACE=Y <br />       datafiles=</em><em>/database/orav10/datafiles/users.dbf<br />       (or </em><em>/tmp/users.dbf )<br />       file=users_tts.dmp log=imp_users_tts.log</em> </p>
<p><u>6. Set the tablespace to READ WRITE</u></p>
<p><em>SQL&gt; alter tablespace USERS read write;<br />       Tablespace altered.</em>  </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F210';
  addthis_title  = 'Transportable+Tablespaces';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/210/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changed File-Permissions in Oracle 10g Release 2 (10.2.0.2)</title>
		<link>http://www.askthegerman.com/archives/181</link>
		<comments>http://www.askthegerman.com/archives/181#comments</comments>
		<pubDate>Wed, 26 Nov 2008 09:01:44 +0000</pubDate>
		<dc:creator>Ralf</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[Message file not found]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[SP2-0750]]></category>
		<category><![CDATA[SQLPLUS]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=181</guid>
		<description><![CDATA[When you want to use SQL*Plus or exp/imp on the same server on which you have installed your database you might get errors like these: sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory or Error 6 initializing SQL*Plus Message file sp1us.msb not found SP2-0750: You may [...]]]></description>
			<content:encoded><![CDATA[<p>When you want to use SQL*Plus or exp/imp on the same server on which you have installed your database you might get errors like these:</p>
<p><font face="Courier">sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory</font></p>
<p>or</p>
<p><font face="Courier">Error 6 initializing SQL*Plus<br />  Message file sp1us.msb not found<br />  SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory</font></p>
<p><font face="Courier">Syntax:<br />  $ sqlplus username/password</font></p>
<p>You get this error only when you execute &#8216;sqlplus&#8217; as a user outside of the dba or Oracle group, because in Oracle Database 10g Release 2 the Oracle Home was locked down by setting umask to 007 prior to installation, so that the files that sqlplus needs to execute do not have read/execute permissions for group &quot;others&quot; and some directories under $ORACLE_HOME have no world read nor execute permission (rwxr-x&#8212;)</p>
<p>Warning , don&#8217;t use the following command to lower the permissions, this may corrupt your Oracle-Installation:<br />  <font face="Courier">chmod -R 755 $ORACLE_HOME/</font></p>
<p>The better way is to use an script which is provided by oracle:<br />  <font face="Courier">$ORACLE_HOME/install/changePerm.sh</font></p>
<p>This script will relax the permissions on most files and directories in your Oracle Home, and allow &quot;others&quot; to execute them.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F181';
  addthis_title  = 'Changed+File-Permissions+in+Oracle+10g+Release+2+%2810.2.0.2%29';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/181/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transfering data from server to server</title>
		<link>http://www.askthegerman.com/archives/141</link>
		<comments>http://www.askthegerman.com/archives/141#comments</comments>
		<pubDate>Fri, 21 Nov 2008 09:31:13 +0000</pubDate>
		<dc:creator>Ralf</dc:creator>
				<category><![CDATA[Backup]]></category>
		<category><![CDATA[Operating System]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[file transfer]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[pipe]]></category>
		<category><![CDATA[secure shell]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://www.askthegerman.com/?p=141</guid>
		<description><![CDATA[When transferring data from one server to another &#8211; maybe for backup reason &#8211; most people use tar to create an archive. Then they copy it to the new server and untar it or leave it as a tarfile as backup. Working with UNIX and using a trick&#160; you can transfer it with compression and [...]]]></description>
			<content:encoded><![CDATA[<p>When transferring data from one server to another &#8211; maybe for backup reason &#8211; most people use tar to create an archive. Then they copy it to the new server and untar it or leave it as a tarfile as backup.</p>
<p>Working with UNIX and using a trick&nbsp; you can transfer it with compression and speed up the whole transfer time a lot.</p>
<p>Using the output result of&nbsp; a command directly as the command line input of a second command&nbsp; using a&nbsp; Unix Pipe the need of writing it down to disk first no longer exists. Finally accessing the remote system though a ssh tunnel will even transfer the compressed data over the network within one single step. </p>
<p>Invoking the following single command will transfer all your data within sourcedirectory an Server B and immediately store it locally&nbsp; on Server B within a compress archive:</p>
<p><em>ssh username@hostname &quot;cd /sourcedirectory/ ; tar czf &#8211; .&quot; &gt; /targetdirectory/filename.tgz</em> </p>
<p>While the following variation:</p>
<p><em>ssh username@hostname &quot;cd /sourcedirectory/ ; tar czf &#8211; .&quot;&gt; /targetdirectory/filename.tgz| tar xvf -</em>   </p>
<p>will directly extract it again for you on the your local system. </p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.askthegerman.com%2Farchives%2F141';
  addthis_title  = 'Transfering+data+from+server+to+server';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.askthegerman.com/archives/141/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
