<?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>Prune&#039;s Blog &#187; Database</title>
	<atom:link href="http://www.lecentre.net/blog/archives/category/database/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lecentre.net/blog</link>
	<description>Internet, UNIX, Video, Leisure...</description>
	<lastBuildDate>Thu, 19 Jan 2012 20:38:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>computer stuffs&#8230;</title>
		<link>http://www.lecentre.net/blog/archives/858</link>
		<comments>http://www.lecentre.net/blog/archives/858#comments</comments>
		<pubDate>Mon, 19 Oct 2009 04:47:01 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Dev]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/?p=858</guid>
		<description><![CDATA[The main purpose of this blog is to act as a reminder, a todo. Here are things i&#8217;ve just found and needs a second look at, or more, a testing. Human readable Glassfish Log This is a shell (sh) script that should made things easier when having a look or doing a &#171;&#160;tail -f&#160;&#187; at [...]]]></description>
			<content:encoded><![CDATA[<p>The main purpose of this blog is to act as a reminder, a todo. Here are things i&#8217;ve just found and needs a second look at, or more, a testing.</p>
<li><a href="http://humglassfishlog.sourceforge.net/">Human readable Glassfish Log</a></li>
<p>This is a shell (sh) script that should made things easier when having a look or doing a &laquo;&nbsp;tail -f&nbsp;&raquo; at Glassfish error logs.</p>
<li><a href="http://blogs.sun.com/aquatic/">Rajeshwar&#8217;s Weblog</a></li>
<p>This is a blog, lately talking about Glassfish V3 REST api implementation. As far as I know this is (still) not working with GF v2, which already have JMX and, if you&#8217;re a registered Sun user, SNMP. But worth having a look.</p>
<li><a href="http://beet.sourceforge.net">Beet</a></li>
<p>It seems to me that most of developpers are using Spring framework nowadays. This tool should enable them (or force them ?) to have a deeper look of what the framework is actualy doing. Seriously, comments welcome. May be the weapon of choice for sysadmins like me, dealing with developpers who hide behing their framework (like if the framework was an excuse&#8230; huhuhu).</p>
<li><a href="http://pandorafms.org/index.php?sec=project&#038;sec2=home&#038;lang=en">PandoraFMS</a></li>
<p>Another monitoring software&#8230; well&#8230; to be tested.</p>
<li><a href="http://www.oracle.com/technology/pub/articles/mearelli-igoogle.html">Oracle Database-backed iGoogle Gadgets</a></li>
<p>An interesting thing you can do with Google&#8217;s API&#8230; It should with any database, but hey, a free software working with Oracle is worth beeing mentioned <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<li><a href="http://www.oracle.com/technology/pub/articles/index.html">Other Oracle related articles</a></li>
<li><a href="http://download.oracle.com/otn_hosted_doc/timesten/603/TimesTen-Documentation/arch.pdf">Oracle TimesTen In-Memory Database</a></li>
<p>This is a PDF file dealing with TimesTen Database. This is a product newly (2 or 3 years) bought by Oracle, and well integrated. Embed the database close to the application, in the application server. Data are replicated at startup. You can choose which database, which table, which data using a filter, or even do transformations to the data. You select the synchronization frequency and there you go. I had a session OOW 2009 about that and how it was used to break a CDN application in two parts : one for slow data change (read/write to the DB) and one for massive fast queries on the delivery side. Ok, this use a lot of RAM&#8230; but RAM is cheap isn&#8217;t it ?</p>
<p>Now we have some cool things to read and test, don&#8217;t we ? <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/858/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11g R2 on Linux Fedora</title>
		<link>http://www.lecentre.net/blog/archives/842</link>
		<comments>http://www.lecentre.net/blog/archives/842#comments</comments>
		<pubDate>Fri, 18 Sep 2009 14:21:48 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/?p=842</guid>
		<description><![CDATA[This is my first attempt at Oracle 11g with Linux. As I&#8217;m still waiting for the 11G R2 to be released on Solaris, I managed to have a try on a Linux VM. First, get VirtualBox Then, get a Fedora 11 image You may also need a &#171;&#160;z7&#8243; compressor to un-z7 the image. You can [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.lecentre.net/blog/wp-content/uploads/2009/09/otn_logo_small.gif" alt="otn_logo_small" title="otn_logo_small" width="148" height="59" class="alignleft size-full wp-image-848" /><br />
This is my first attempt at Oracle 11g with Linux. As I&#8217;m still waiting for the 11G R2 to be released on Solaris, I managed to have a try on a Linux VM.</p>
<p>First, get <a href="http://www.virtualbox.org/">VirtualBox</a><br />
Then, get a <a href="http://virtualbox.wordpress.com/images/fedora/">Fedora 11 image</a><br />
You may also need a &laquo;&nbsp;z7&#8243; compressor to un-z7 the image. You can get 7za from the Macports </p>
<div class="codesnip-container" ># port install p7zip<br />
# 7za  e fedora-11-x86.7z</p>
<p>7-Zip (A) 9.04 beta  Copyright (c) 1999-2009 Igor Pavlov  2009-05-30<br />
p7zip Version 9.04 (locale=utf8,Utf16=on,HugeFiles=on,2 CPUs)</p>
<p>Processing archive: fedora-11-x86.7z</p>
<p>Extracting  Machine/fedora-11-x86/fedora-11-x86.xml<br />
Extracting  VDI/fedora-11-x86.vdi<br />
Extracting  VDI<br />
Extracting  Machine/fedora-11-x86<br />
Extracting  Machine</p>
<p>Everything is Ok</p>
<p>Folders: 3<br />
Files: 2<br />
Size:       4740698220<br />
Compressed: 1148257214</p></div>
<p>Then configure and start the VM. I had to add 3 NICs, so I have 4 network interfaces, enough to play. I also set the first one as Bridge instead of the default NAT, so my VM have a real IP.<br />
I then have to log as root, chance the /etc/sudoers so Wheel users can sudo. Then I added fedora (default user) to Wheel group in /etc/groups.<br />
Now I can sudo. We are close to be able to install Oracle database. While I&#8217;m at it, go to<a href="http://www.oracle.com/technology/software/products/database/index.html"> Oracle website</a> and download the 2 install zip files. This is quite huge, around 2.1Gb. Be carefull when you unzip (not yet), as everything lives in the &laquo;&nbsp;database&nbsp;&raquo; folder&#8230;<br />
You will also need the <a href="http://download.oracle.com/otn/linux/oracle11g/R2/linux_11gR2_grid.zip">Grid Infrastructure Software</a>.<br />
Please note we are installong the 32bits versions, but the 64bits version is the same, only <a href="http://www.oracle.com/technology/software/products/database/index.html">the packages to download</a> are different. Click on the &laquo;&nbsp;view all&nbsp;&raquo; to get the Grid Infrastructure Software.</p>
<p>For Oracle 11G R2 to work on linux you need to fulfill some dependencies, starting with some RPM packages. Use &#8216;yum&#8217; to search for them and install them. Here is a list according to <a href="http://download.oracle.com/docs/cd/E11882_01/install.112/e10812/prelinux.htm#BABFDJJF">Oracle Linux recommendations</a> :</p>
<div class="codesnip-container" >binutils-2.17.50.0.6<br />
compat-libstdc++-33-3.2.3<br />
compat-libstdc++-33-3.2.3 (32 bit)<br />
elfutils-libelf-0.125<br />
elfutils-libelf-devel-0.125<br />
gcc-4.1.2<br />
gcc-c++-4.1.2<br />
glibc-2.5-24<br />
glibc-2.5-24 (32 bit)<br />
glibc-common-2.5<br />
glibc-devel-2.5<br />
glibc-devel-2.5 (32 bit)<br />
glibc-headers-2.5<br />
ksh-20060214<br />
libaio-0.3.106<br />
libaio-0.3.106 (32 bit)<br />
libaio-devel-0.3.106<br />
libaio-devel-0.3.106 (32 bit)<br />
libgcc-4.1.2<br />
libgcc-4.1.2 (32 bit)<br />
libstdc++-4.1.2<br />
libstdc++-4.1.2 (32 bit)<br />
libstdc++-devel 4.1.2<br />
make-3.81<br />
sysstat-7.0.2<br />
unixODBC-2.2.11<br />
unixODBC-2.2.11 (32 bit)<br />
unixODBC-devel-2.2.11<br />
unixODBC-devel-2.2.11 (32 bit)</div>
<p>11G R2 now comes with a &laquo;&nbsp;bundeled NTP server&nbsp;&raquo;, I mean, Oracle now can sync the time of every node in the cluster. No need of NTPD, and no evictions due to bad Solaris xntpd server. Just disable ntpd or ensure it&#8217;s not running before installing Oracle database.<br />
Also, configure SSHD and kernel parameters, if needed, as <a href="http://download.oracle.com/docs/cd/E11882_01/install.112/e10812/manpreins.htm#BABCHAED">Oracle prerequisite</a>.<br />
Now, let&#8217;s go with Oracle. Create an oracle user with :</p>
<div class="codesnip-container" >adduser oracle<br />
passwd oracle (give a password)</div>
<p>As root, create a /opt/oracle folder and give RWX rights to oracle user.<br />
Create a SSL key for user Oracle, add your personal public key to authorized_keys and log as oracle user. Copy the Oracle install files to the home dir of this user.</p>
<div class="codesnip-container" >mkdir /opt/oracle<br />
chown oracle /opt/oracle<br />
su &#8211; oracle<br />
ssh-keygen -f dsa<br />
(set empty password and write the key in .ssh folder)<br />
vi .ssh/authorized_keys<br />
(copy the pubkey of your admin user)<br />
unzip linux.x64_11gR2_grid.zip<br />
unzip linux_11gR2_database_1of2.zip<br />
unzip linux_11gR2_database_2of2.zip<br />
cd database</div>
<p>Log-in again with your oracle user, setting X11 forwarding (use -X -Y if you are using a mac) : </p>
<div class="codesnip-container" >ssh -X -Y oracle@your_host<br />
cd grid</p>
<p>cd database<br />
./runInstaller</p>
<p>Starting Oracle Universal Installer&#8230;</p>
<p>Checking Temp space: must be greater than 80 MB.   Actual 9828 MB    Passed<br />
Checking swap space: must be greater than 150 MB.   Actual 1023 MB    Passed<br />
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed<br />
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2009-09-18_09-47-50AM. Please wait &#8230;[oracle@localhost database]$ Xlib:  extension &laquo;&nbsp;Generic Event Extension&nbsp;&raquo; missing on display &laquo;&nbsp;localhost:10.0&#8243;.</p></div>
<p>Don&#8217;t take account for X11 errors, as long as you have the install window.<br />
First question is giving out your email address for security updates&#8230; As you ARE a good DBA/Sysadmin, you won&#8217;t need this. Click next <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>As I don&#8217;t have time and I KNOW I will not do better, check there for some more informations on <a href="http://dbastreet.com/docs/11gR2RacInstall_gridinfra.html">installing Oracle 11G R2 RAC ASM</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/842/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql Reminder : csv export</title>
		<link>http://www.lecentre.net/blog/archives/683</link>
		<comments>http://www.lecentre.net/blog/archives/683#comments</comments>
		<pubDate>Wed, 28 Jan 2009 15:10:15 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/?p=683</guid>
		<description><![CDATA[I was asked to export some data in a csv format from a Mysql database. I&#8217;m just putting it here as a reminder&#8230; Thank you so much my blog to extend my brain capacity so much ! SELECT * INTO OUTFILE '/tmp/result.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lecentre.net/blog/wp-content/uploads/2009/01/logo_mysql_sun_a.gif"><img class="alignleft size-full wp-image-684" title="logo_mysql_sun_a" src="http://www.lecentre.net/blog/wp-content/uploads/2009/01/logo_mysql_sun_a.gif" alt="logo_mysql_sun_a" width="114" height="68" /></a></p>
<p>I was asked to export some data in a csv format from a Mysql database. I&#8217;m just putting it here as a reminder&#8230; Thank you so much my blog to extend my brain capacity so much !</p>
<pre lang="SQL">SELECT * INTO OUTFILE '/tmp/result.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM dc_account_key WHERE created_at > '2009-01-09' AND active = 0;</pre>
<p>I won&#8217;t explain this, it&#8217;s really straitforward. This is just a reminder, after all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/683/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 11g ASM install on Solaris 10 with RAW data files</title>
		<link>http://www.lecentre.net/blog/archives/591</link>
		<comments>http://www.lecentre.net/blog/archives/591#comments</comments>
		<pubDate>Tue, 25 Nov 2008 15:18:49 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/?p=591</guid>
		<description><![CDATA[I was installing a Oracle 11g + ASM server for testing and upgrade purpose when I came across a problem : how do I create RAW &#171;&#160;filsystem&#160;&#187; for ASM ? I found a lot of docs for doing this with Linux, but nothing about Solaris. Of course you will quickly find something about &#8216;lofs&#8217; and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-592" title="database-11g" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/database-11g.gif" alt="" width="181" height="54" /></p>
<p>I was installing a Oracle 11g + ASM server for testing and upgrade purpose when I came across a problem : how do I create RAW &laquo;&nbsp;filsystem&nbsp;&raquo; for ASM ?</p>
<p>I found a lot of docs for doing this with Linux, but nothing about Solaris.</p>
<p>Of course you will quickly find something about &#8216;lofs&#8217; and &#8216;lofsadm&#8217;. This is the right starting point. But then ?<br />
It seems ASM wants to have &laquo;&nbsp;real&nbsp;&raquo; block device for use with ASM. If I&#8217;m wrong, please, comment and correct me.</p>
<p>My solution was to :<br />
<span id="more-591"></span></p>
<ul>
<li>create two &#8216;zeroed&#8217; files with DD, around 8Gb each. They will be used in a RAID 0 redundancy. This should be managed by ASM itself, and need to be configured. Do this as user Oracle
<pre lang="shell">$ cd /opt/oracle
$ mkdir disks
$ dd if=/dev/zero of=/opt/oracle/disks/baytestdb_asm1_disk1 bs=8192 count=1000000
$ dd if=/dev/zero of=/opt/oracle/disks/baytestdb_asm1_disk2 bs=8192 count=1000000</pre>
</li>
<li>use &#8216;lofiadm&#8217; to link the files as block devices. Do this as root user :
<pre lang="shell"># lofiadm -a /opt/oracle/disks/baytestdb_asm1_disk1 /dev/lofi/1
# lofiadm -a /opt/oracle/disks/baytestdb_asm1_disk2 /dev/lofi/2
# lofiadm
Block Device             File
/dev/lofi/1              /opt/oracle/disks/baytestdb_asm1_disk1
/dev/lofi/2              /opt/oracle/disks/baytestdb_asm1_disk2</pre>
</li>
<li>use &#8216;mknod&#8217; to create a copy of the block device in your Oracle directory and give appropriate rights.
<pre lang="shell">#  ls -l /dev/lofi
lrwxrwxrwx   1 root     root          29 Nov 25 14:39 1 -&gt; ../../devices/pseudo/lofi@0:1
lrwxrwxrwx   1 root     root          29 Nov 25 14:39 2 -&gt; ../../devices/pseudo/lofi@0:2

# ls -l /devices/pseudo/lofi@0:1
brw-------   1 root     sys      147,  1 Nov 25 14:30 /devices/pseudo/lofi@0:1

# ls -l /devices/pseudo/lofi@0:2
brw-------   1 root     sys      147,  2 Nov 25 14:36 /devices/pseudo/lofi@0:2</pre>
<p>You will use the numbers 147, 1 and 147, 2 to create the node :</p>
<pre lang="shell"># cd /opt/oracle/disks
# mknod baytestdb_asm1_disk_1 c 147 1
# mknod baytestdb_asm1_disk_2 c 147 2
# chown oracle:oinstall baytestdb_asm1_disk_*
# chmod 660 baytestdb_asm1_disk_*</pre>
</li>
<li>Tell the Oracle ASM Installer to search in the directory (<em>/opt/oracle/disks</em> in my case and NOT <em>/opt/oracle/disks/*</em>)</li>
</ul>
<p>OK, I admit, names of dd files and block device are not good/clear&#8230; I still havn&#8217;t found  a real good and clear naming. But, heh, I did my part. Now, do yours and propose the names <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I did all this on the latest Solaris 10/08 :</p>
<pre lang="shell">cat /etc/release    
                      Solaris 10 10/08 s10s_u6wos_07b SPARC
           Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 27 October 2008
uname -a
SunOS indus.adm.groupertl.net 5.10 Generic_137137-09 sun4v sparc SUNW,Sun-Fire-T1000</pre>
<p>I will not come over all the recommended for Oracle install, like having oracle user and oinstall, oper and dba groups. Once you have all the pre-requisit and the new devices created as above, start here.</p>
<p>Untar, unzip or uncpio the ASM install files and the DB files. I like to do this in <em>/opt/oracle/install</em>.<br />
Oracle disks are in <em>/opt/oracle/disks</em>. Oracle home is in <em>/opt/oracle/shellhome</em>. Oracle product files are in <em>/opt/oracle/product/11</em>. If you have RAC (crs), I do intall in <em>/opt/oracle/product/11/crs_1</em>. For ASM and DBs, I install in <em>/opt/oracle/product/11/oracle_base/asm_1</em> and <em>db_1</em>.</p>
<p>Once this is done, start the installer as user oracle :</p>
<pre lang="shell">$ /opt/oracle/install/11GR1ASM/database/runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 180 MB.   Actual 6241 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 6564 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-11-27_10-30-27AM. Please wait ...-bash-3.00$ Warning: Cannot convert string "-monotype-arial-regular-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct</pre>
<p>Don&#8217;t care for the font error.<br />
As a side note, if you are working on the server from a remote host, using SSH, you will have to redirect the display. You will have all the informations if you don&#8217;t. If you are on a Mac OsX, you will need to :</p>
<ul>
<li>start the X11 server (found in the Xcode tools I think)</li>
<li>configure your SSH client to redirect the DISPLAY (this is by default I think &#8211; on every Unix OS)</li>
<li>use the -X -Y options to ssh like :    ssh -X -Y oracle@my_server_name</li>
</ul>
<p>The Oracle installer will open with this window.<br />
<img class="alignnone size-full wp-image-595" title="oracle-asm-1" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-1.png" alt="" width="500" height="375" /><br />
Choose the Advanced Install and click next.</p>
<p><img class="alignnone size-full wp-image-596" title="oracle-asm-2" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-2.png" alt="" width="500" height="374" /></p>
<p><img class="alignnone size-full wp-image-597" title="oracle-asm-3" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-3.png" alt="" width="500" height="375" /><br />
Remember the baytest_asm1 name. You may have to use it later when you administer your oracle install.</p>
<p><img class="alignnone size-full wp-image-598" title="oracle-asm-4" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-4.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-599" title="oracle-asm-5" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-5.png" alt="" width="500" height="375" /><br />
Enter here, the ASM password. Keep it secure.</p>
<p><img class="alignnone size-full wp-image-600" title="oracle-asm-6" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-6.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-601" title="oracle-asm-7" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-7.png" alt="" width="500" height="376" /><br />
In Normal redundancy you will need two disks. They are not used as mirror, but should guaranty some redundancy. High redundancy will require 3 disks. External&#8230; you have to manage it. Use this is you already have some RAID you are trusting in <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img class="alignnone size-full wp-image-602" title="oracle-asm-8" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-8.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-603" title="oracle-asm-9" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-9.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-604" title="oracle-asm-10" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-10.png" alt="" width="500" height="375" /><br />
Click Install and wait. Wait. Waiiiiiit&#8230;&#8230;&#8230;.</p>
<p><img class="alignnone size-full wp-image-605" title="oracle-asm-11" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-11.png" alt="" width="500" height="375" /></p>
<p>Then&#8230;<br />
<img class="alignnone size-full wp-image-606" title="oracle-asm-12" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-12.png" alt="" width="500" height="375" /></p>
<p>You will have to run the script on the host as root. You will only have to give a directory where some files will be installed. Don&#8217;t use the /usr/local/bin offer. Change it to somewhere in /opt/oracle, at least. You will have to do the same thing for the Database install in a few moments.</p>
<pre lang="shell"># /opt/oracle/product/11/oracle_base/asm_1/root.sh
Running Oracle 11g root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/oracle/product/11/oracle_base/asm_1

Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/oracle/asmbin     

Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized

Cleaning up Network socket directories
Setting up Network socket directories
Adding to inittab
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
Cluster Synchronization Services is active on these nodes.
        indus
Cluster Synchronization Services is active on all the nodes.
Oracle CSS service is installed and running under init(1M)
Finished product-specific root actions.</pre>
<p>You can click OK and go to the next step.<br />
<img class="alignnone size-full wp-image-607" title="oracle-asm-13" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-13.png" alt="" width="500" height="377" /></p>
<p><img class="alignnone size-full wp-image-608" title="oracle-asm-14" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-asm-14.png" alt="" width="500" height="374" /></p>
<p>And you are done.</p>
<p>Let&#8217;s go with the DB install now. Just run the DB installer.</p>
<pre lang="shell">$ /opt/oracle/install/11GR1DB/database/runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 180 MB.   Actual 5825 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 6507 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2008-11-27_11-17-05AM. Please wait ...-bash-3.00$ Warning: Cannot convert string "-monotype-arial-regular-r-normal--*-140-*-*-p-*-iso8859-1" to type FontStruct
Oracle Universal Installer, Version 11.1.0.6.0 Production
Copyright (C) 1999, 2007, Oracle. All rights reserved.</pre>
<p><img class="alignnone size-full wp-image-609" title="oracle-db-1" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-1.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-610" title="oracle-db-2" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-2.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-611" title="oracle-db-3" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-3.png" alt="" width="500" height="378" /></p>
<p><img class="alignnone size-full wp-image-612" title="oracle-db-4" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-4.png" alt="" width="500" height="377" /></p>
<p><img class="alignnone size-full wp-image-613" title="oracle-db-5" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-5.png" alt="" width="500" height="374" /></p>
<p><img class="alignnone size-full wp-image-614" title="oracle-db-6" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-6.png" alt="" width="500" height="377" /></p>
<p><img class="alignnone size-full wp-image-615" title="oracle-db-7" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-7.png" alt="" width="500" height="377" /></p>
<p><img class="alignnone size-full wp-image-616" title="oracle-db-8" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-8.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-617" title="oracle-db-9" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-9.png" alt="" width="500" height="374" /></p>
<p><img class="alignnone size-full wp-image-618" title="oracle-db-10" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-10.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-619" title="oracle-db-11" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-11.png" alt="" width="500" height="374" /></p>
<p><img class="alignnone size-full wp-image-620" title="oracle-db-12" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-12.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-621" title="oracle-db-13" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-13.png" alt="" width="500" height="376" /></p>
<p><img class="alignnone size-full wp-image-622" title="oracle-db-14" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-14.png" alt="" width="500" height="374" /></p>
<p><img class="alignnone size-full wp-image-623" title="oracle-db-15" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-15.png" alt="" width="500" height="375" /></p>
<p><img class="alignnone size-full wp-image-624" title="oracle-db-16" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-16.png" alt="" width="500" height="376" /></p>
<p><img class="alignnone size-full wp-image-625" title="oracle-db-17" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-17.png" alt="" width="500" height="373" /></p>
<p><img class="alignnone size-full wp-image-626" title="oracle-db-18" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-18.png" alt="" width="500" height="373" /></p>
<p><img class="alignnone size-full wp-image-628" title="oracle-db-19" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-19.png" alt="" width="500" height="376" /></p>
<p><img class="alignnone size-full wp-image-629" title="oracle-db-20" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-20.png" alt="" width="500" height="329" /><br />
You will encounter one or two error message. Just click OK and go on. One done, click OK and Next.</p>
<p>You now have to run a script as root. Copy the script name and start it in a root shell of the host.<br />
<img class="alignnone size-full wp-image-630" title="oracle-db-21" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-21.png" alt="" width="500" height="375" /></p>
<pre lang="shell"># /opt/oracle/product/11/oracle_base/db_1/root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
   ORACLE_OWNER= oracle
    ORACLE_HOME=  /opt/oracle/product/11/oracle_base/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]: /opt/oracle/dbbin
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.</pre>
<p><img class="alignnone size-full wp-image-631" title="oracle-db-22" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/oracle-db-22.png" alt="" width="500" height="374" /></p>
<p>And you are done.<br />
Now you should have some running processes on the host. Notice the two listeners, one for ASM, one for the DB.<br />
Also note the <em>/opt/oracle/product/11/oracle_base/asm_1/bin/ocssd.bin</em> process. This one is the link between ASM and the database.</p>
<p>Check next post for the Oracle 11.1.0.6 to 11.1.0.7 upgrade.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/591/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Oracle FCF, TAF and FAN explained</title>
		<link>http://www.lecentre.net/blog/archives/567</link>
		<comments>http://www.lecentre.net/blog/archives/567#comments</comments>
		<pubDate>Mon, 03 Nov 2008 14:59:47 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/?p=567</guid>
		<description><![CDATA[Thanks to the Database Journal and Tarry Singh, you have now really good introduction articles on Oracle, TAF, FAN, and many more. Just check articles 15 and 16, and spend some time on the others. Thank you Tarry.]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-568" title="databasejournal" src="http://www.lecentre.net/blog/wp-content/uploads/2008/11/databasejournal.gif" alt="" width="128" height="27" /></p>
<p>Thanks to the <a href="http://www.databasejournal.com" target="_blank">Database Journal</a> and <a href="http://tarrysingh.blogspot.com/" target="_blank">Tarry Singh</a>, you have now really good introduction articles on Oracle, TAF, FAN, and many more.</p>
<p>Just check articles <a href="http://www.databasejournal.com/features/oracle/article.php/3659411" target="_blank">15</a> and <a href="http://www.databasejournal.com/features/oracle/article.php/3663401" target="_blank">16</a>, and spend some time on the others.</p>
<p>Thank you Tarry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/567/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Open World 2008</title>
		<link>http://www.lecentre.net/blog/archives/321</link>
		<comments>http://www.lecentre.net/blog/archives/321#comments</comments>
		<pubDate>Sun, 21 Sep 2008 01:50:35 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/?p=321</guid>
		<description><![CDATA[Cette année j&#8217;ai la chance d&#8217;aller a Oracle Open World. Pour ceux qui ne savent pas, c&#8217;est 5 jours avec plein d&#8217;informaticiens qui parlent de bases de données. Enfin, surtout d&#8217;une, Oracle. Comme moi je suis la pour travailler, je vais laisser la place a mon compère, TrucTruc. Bonjour, alors c&#8217;est moi TrucTruc. Pour ceux qui [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-322" title="Oracle Open World" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/gpj_oow_reg_header.gif" alt="" width="500" height="102" /></p>
<p>Cette année j&#8217;ai la chance d&#8217;aller a Oracle Open World.</p>
<p>Pour ceux qui ne savent pas, c&#8217;est 5 jours avec plein d&#8217;informaticiens qui parlent de bases de données. Enfin, surtout d&#8217;une, Oracle.</p>
<p>Comme moi je suis la pour travailler, je vais laisser la place a mon compère, TrucTruc.<br />
<span id="more-321"></span></p>
<p><em>Bonjour, alors c&#8217;est moi TrucTruc. Pour ceux qui ne me connaissent pas, voila une photo de moi : </em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6527.jpg"><em><img class="alignnone size-medium wp-image-323" title="TrucTruc" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6527-300x200.jpg" alt="" width="300" height="200" /></em></a></p>
<p><em>Donc, ce matin nous avons pris l&#8217;avion. Un 747 de Air France. Bon, j&#8217;ai pas trop de photo de moi, mais voila ce que j&#8217;ai pu prendre de la fenetre :<br />
</em> <a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6461.jpg"><em><img class="alignnone size-medium wp-image-324" title="img_6461" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6461-200x300.jpg" alt="" width="200" height="300" /></em></a><em> </em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6462.jpg"><em><img class="alignnone size-medium wp-image-325" title="img_6462" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6462-200x300.jpg" alt="" width="200" height="300" /></em></a></p>
<p><em>On est meme passé a au sud dur Groenland:<br />
 </em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6463.jpg"><em><img class="alignnone size-medium wp-image-326" title="img_6463" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6463-300x200.jpg" alt="" width="300" height="200" /></em></a></p>
<p><em>A la fin on a pris le metro et on est arrivé a l&#8217;hotel : <br />
</em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6503.jpg"><em><img class="alignnone size-medium wp-image-332" title="img_6503" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6503-300x200.jpg" alt="" width="300" height="200" /> </em></a><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6504.jpg"><em><img class="alignnone size-medium wp-image-333" title="img_6504" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6504-300x200.jpg" alt="" width="300" height="200" /></em></a><em> <br />
</em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6505.jpg"><em><img class="alignnone size-medium wp-image-334" title="img_6505" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6505-300x200.jpg" alt="" width="300" height="200" /> </em></a><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6508.jpg"><em><img class="alignnone size-medium wp-image-335" title="img_6508" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6508-300x200.jpg" alt="" width="300" height="200" /><br />
</em></a><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6509.jpg"><em><img class="alignnone size-medium wp-image-336" title="img_6509" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6509-300x200.jpg" alt="" width="300" height="200" /> </em></a><em><img class="alignnone size-medium wp-image-338" title="img_6513" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6513-300x200.jpg" alt="" width="300" height="200" /></em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6512.jpg"><em><br />
</em></a><em>  </em><em><img class="alignnone size-medium wp-image-337" title="img_6512" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6512-200x300.jpg" alt="" width="200" height="300" /></em></p>
<p><em>Voila. </em></p>
<p><em>Ah oui, j&#8217;ai aussi fait caca (en téléphonant&#8230; il y a un téléphone dans les toilettes <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )<br />
</em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6515.jpg"><em><img class="alignnone size-medium wp-image-340" title="img_6515" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6515-200x300.jpg" alt="" width="200" height="300" /> </em></a><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6522.jpg"><em><img class="alignnone size-medium wp-image-341" title="img_6522" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6522-200x300.jpg" alt="" width="200" height="300" /><br />
</em></a><em>Mais apres je me suis lavé les mains :<br />
</em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6514.jpg"><em><img class="alignnone size-medium wp-image-342" title="img_6514" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6514-300x200.jpg" alt="" width="300" height="200" /></em></a></p>
<p><em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6514.jpg"></a>Maintenant on va prendre une doucher puis aller diner. Enfin, ptetre on va prendre un bain. En meme temps, la douche est pas mal. Vous voullez voir ?<br />
</em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6516.jpg"><em><img class="alignnone size-medium wp-image-339" title="img_6516" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6516-300x200.jpg" alt="" width="300" height="200" /></em></a><em> </em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6517.jpg"><em><img class="alignnone size-medium wp-image-343" title="img_6517" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6517-200x300.jpg" alt="" width="200" height="300" /><br />
</em></a><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6518.jpg"><em><img class="alignnone size-medium wp-image-344" title="img_6518" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6518-300x200.jpg" alt="" width="300" height="200" /></em></a></p>
<p><em>Et pour ce soir, j&#8217;ai déjà tout prevu. Mais chut, il faut pas le dire a Vachette et Chaussette. C&#8217;est des filles, elles peuvent pas comprendre : <br />
</em><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6524.jpg"><em><img class="alignnone size-medium wp-image-345" title="img_6524" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6524-300x200.jpg" alt="" width="300" height="200" /> </em></a><a href="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6525.jpg"><em><img class="alignnone size-medium wp-image-346" title="img_6525" src="http://www.lecentre.net/blog/wp-content/uploads/2008/09/img_6525-200x300.jpg" alt="" width="200" height="300" /></em></a></p>
<p><em>Bon, j&#8217;arrête pour aujourd&#8217;hui. Demain je prendrais des photos dans la rue. C&#8217;est drôle les américains. Vous allez voir <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </em></p>
<p>Merci TrucTruc pour ces belles photo. Ne vide pas le mini bar ce soir quand même, tu dois tenir 5 jours ! <br />
A demain pour la suite : des bus &laquo;&nbsp;Oracle&nbsp;&raquo;, des affiches &laquo;&nbsp;Oracle&nbsp;&raquo;, des flèches dans les rues &laquo;&nbsp;Oracle&nbsp;&raquo;, des pompiers, des manifs de catho intégristes, une rue barrée pour installer la cantine Oracle, des vendeur de badges Barrack Obama, des lions de mer qui puent, les cable car&#8230; Enfin, surtout du Oracle quand meme <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>En fait, la seule mauvaise nouvelle, c&#8217;est que le concert du mercredi soir, c&#8217;est UB40, et pas U2 <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
La lose !!!<br />
Enfin ya aussi 3 autres mecs, mais bon, on verra d&#8217;ici la&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/321/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sybase database migration / reduction</title>
		<link>http://www.lecentre.net/blog/archives/276</link>
		<comments>http://www.lecentre.net/blog/archives/276#comments</comments>
		<pubDate>Thu, 10 Apr 2008 15:27:42 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Sybase]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/?p=276</guid>
		<description><![CDATA[One of the main problem of sybase (and other database) is the way it handle disk space. You must create &#171;&#160;disk devices&#160;&#187;, which can be RAW or file on a filesystem. Then give some space of it to a database, and perhaps create or extend segments. Of course, this may sound a good way to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the main problem of sybase (and other database) is the way it handle disk space. You must create &laquo;&nbsp;disk devices&nbsp;&raquo;, which can be RAW or file on a filesystem. Then give some space of it to a database, and perhaps create or extend segments.</p>
<p>Of course, this may sound a good way to deal with it. Then comes the time when you need some storage for something else, or another database.</p>
<p>You start realizing that the 15 Gb you added to your database, thinking your data will grow as you reach your 1.000.000.000 subscriber&#8230; but your stalled at 150 <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span id="more-276"></span></p>
<p>So, using some sybase tools, you realize only 5% of the space is used. Then you wonder &laquo;&nbsp;how will I get the free space for something else ?&nbsp;&raquo;</p>
<p>The Sybase and Sybase support is simple : you can&#8217;t. But&#8230;</p>
<p>Of course you can. It&#8217;s only data after all. Your data.<br />
The solution is simpler to say than to do : backup data and schema, drop the database, drop the devices, re-create the devices, the database then import.</p>
<p>One would say : eaaassssyyyyyy.<br />
Then try to do it without using dump/load.</p>
<p>The fact is the dump/load Sybase command uses internal Sybase page structures. If you have a 15Gb database, even 5% filled, your dump will have a 15Gb size, minus the compression you set for the dump.<br />
When loading, each page will be put in a page of the new database device. Meaning, you need to have a new database the same size as the old one. The load tool will tell you that if you are wrong.<br />
And this is even worse than you may think : you need to have the same amount of data and log space (or more) !!</p>
<p>So&#8230; bcp out, then bcp in.</p>
<p>BCP is a command line tool provided by sybase. It load/unload data from/to a flat file.</p>
<p>First, get the schema out of the database.<br />
For this I use the dbschema perl tool. Get it at <a title="http://www.midsomer.org" href="http://www.midsomer.org" target="_blank">http://www.midsomer.org</a><br />
This is what I do :</p>
<pre lang="shell">
mkdir DB1_schema
cd DB1_schema
/opt/monitor/perl/bin/perl   /home/prune/dbschema/dbschema.pl -SDB1 -Usa -Ppassword -O1 -m -A -V -b --target-db my_new_db
</pre>
<p>You will get a directory per database inside DB1. In each directory you will have a file per type of object : table, stored procs, key, foreign key, view&#8230;</p>
<p>The use of &laquo;&nbsp;&#8211;target-db my_new_db&nbsp;&raquo; will create DBP in/out scripts with the right name to import data to a different database (my_new_db instead of my_old_db). See under for the BCP stuffs anyway.</p>
<p>Then, get the data out using <strong>bcp</strong>.<br />
You need to <strong>bcp out</strong> the data each table at a time.<br />
The database I&#8217;m using have almost a hundred tables. One solution is to use an option of the dbschema to create a bcp shell script. Or you can use the <strong>sp__bcp</strong> stored procedure from the awesom package you can find at <a title="http://www.edbarlow.com" href="http://www.edbarlow.com" target="_blank">http://www.edbarlow.com<br />
</a>sp__bcp need options so it can create the bcp command line :</p>
<ul>
<li>DSQUERY : the dataserver name</li>
</ul>
<ul>
<li>database_name : the database to dump from</li>
</ul>
<ul>
<li>sa : the login of the admin user or a user who can select every tables</li>
</ul>
<ul>
<li>password : &#8230;</li>
</ul>
<ul>
<li>out : in or out, depending of the script you want to create<a title="http://www.edbarlow.com" href="http://www.edbarlow.com" target="_blank"></a></li>
</ul>
<p>When creating the bcp in script, be sure to be in the right database you just have bcp out BUT put the database name where you will load the data, if different.</p>
<pre lang="SQL">
use my_old_db
go
sp__bcp "DB1", "my_old_db", "sa", "password", "out"
go
</pre>
<p>Also get the in script :</p>
<pre lang="SQL">
use my_old_db
go
sp__bcp "DB1", "my_new_db", "sa", "password", "in", "dat", "-b 10000"
go
</pre>
<p>This proc will not create any script. You need to copy the output to a file, make it executable.<br />
The last parameter will split the load in chuck of 10000 lines, which will help to not fill the logs. Maybe 50000 or 100000 would be better. please comment.<br />
Then you can create back your database on the right devices, with the right size, etc.</p>
<pre lang="SQL">
disk init
name      = 'NewdbData',
physname  = '/opt/db/dbdata/DB1_NewdbData',
vdevno    = 7,
size      = 2560000,
cntrltype = 0,
dsync = 'false'
go

disk init
name      = 'NewdbLog',
physname  = '/opt/db/dbdata/DB1_NewdbLog',
vdevno    = 8,
size      = 153600,
cntrltype = 0,
dsync = 'false'
go

CREATE DATABASE my_new_db ON NewdbData = 5000 LOG ON PhileasLog = 300
use master
go
sp_dboption phileas, 'single user', true
go
exec sp_logdevice phileas, PhileasLog
go
sp_dboption phileas, 'single user', false
go
</pre>
<p>You are ready to re-create the structure of the database. The &laquo;&nbsp;table structure&nbsp;&raquo; as Sybase support call it.</p>
<p>Go to the dbschema directory, in the db you want to create, and load the scripts one at a time, in the right order. Note that, if your developpers do fancy things in theire stored procs, the schema export from dbschema may not work. I had to use an extract from &laquo;&nbsp;CAST&nbsp;&raquo;, then use dos2unix to translate some french accents to unix code.<br />
Here is how I do it then :</p>
<pre lang="shell">
dos2unix procs-cast.sql procs.sql

isql -Usa -w512 -SDB1 -Ppassword &lt; defaults.sql &gt; defaults.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; groups.sql &gt; groups.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; types.sql &gt; types.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; rules.sql   &gt; rules.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; tables.sql &gt; tables.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; keys.sql &gt; keys.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; views.sql &gt; views.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; indexes.sql &gt; indexes.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; fkeys.sql &gt; fkeys.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; trigs.sql &gt; trigs.sql.err
isql -Usa -w512 -SDB1 -Ppassword &lt; procs.sql &gt; procs.sql.err
</pre>
<p>Once this is done, just check you have all your stuffs :</p>
<pre lang="SQL">
select type, count(*) from sysobjects  group by type
go
 type
 ---- -----------
 D             16 types
 P           1072 procs
 R             15 rule
 RI           357 index
 S             26 system tables
 TR           538 trigger
 U            555 table
 V             94 view
</pre>
<p>You should have the same result as on your old database. In fact, I don&#8217;t <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
But the dev told me that it was normal. Some procs are &laquo;&nbsp;wrong&nbsp;&raquo; but they are never used on a history database, which is what I&#8217;m working on right now.</p>
<p>You can then load the data, using the bcp script.<br />
If your files are big, you may fill the logs. You need to set a procedure to dump them. This proc will automaticaly be run by a trigger. You can add it in your database, or in <strong>sybsystemprocs</strong>. This proc is made for logging the dump, and dumping to a file. I just changed it to dump with &laquo;&nbsp;no_log&nbsp;&raquo;, as we don&#8217;t care of the log during import.</p>
<p>Here is the proc :</p>
<pre lang="SQL">
CREATE PROC sp_thresholdaction   (
  @dbname varchar(30),
  @segmentname varchar(30),
  @space_left int,
  @status int )
AS
BEGIN
declare @msg  varchar(256),
        @date_actuelle  datetime,
        @nom_fichier  varchar(256),
        @date_fichier  varchar(20),
        @rep_sauve_log  varchar(40)

select @rep_sauve_log = 'compress::6::/DUMP_SYBASE/DB1/DumpDATA/'

select @date_actuelle = getdate()

select @date_fichier =
	convert (char(8), @date_actuelle, 112) +'-'+
	convert(varchar(2),datepart(hh,@date_actuelle)) +
	convert(varchar(2),datepart(mi,@date_actuelle)) +
	convert(varchar(2),datepart(ss,@date_actuelle))

select @nom_fichier = @rep_sauve_log + @dbname + @date_fichier + '.trn',
       @msg = @date_fichier + ' Warning: dump transaction for ' + @dbname + ':' + @segmentname  + ' (' + convert(varchar(12),@space_left) + ' free) on ' + @nom_fichier

print @msg

if @segmentname = 'logsegment'
     dump tran @dbname with no_log
return
END

go
</pre>
<p>Finaly, run you bcp in script, and you are all set. I hope&#8230; <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Don&#8217;t forget to change the DB owner and options, but if you are that far I&#8217;m sure you can do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/276/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Should we pay for Oracle support ?</title>
		<link>http://www.lecentre.net/blog/archives/273</link>
		<comments>http://www.lecentre.net/blog/archives/273#comments</comments>
		<pubDate>Wed, 26 Mar 2008 14:05:06 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/archives/273</guid>
		<description><![CDATA[So you pay A LOT for your premium Oracle support ? I won&#8217;t spend my time complaining on the Metalink web interface, the one you must use to open a F**King SR (Service Request), where you lost half a day each time. I won&#8217;t complain on the F**King result you get&#8230; something nobody can read [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.lecentre.net/blog/wp-content/uploads/2008/03/metalinksmalllogo.gif" alt="metalink Oracle" /></p>
<p>So you pay A LOT for your premium Oracle support ?</p>
<p>I won&#8217;t spend my time complaining on the Metalink web interface, the one you must use to open a F**King SR (Service Request), where you lost half a day each time.<br />
I won&#8217;t  complain on the  F**King  result you get&#8230; something nobody can read through and get the information without losing the second half day <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>No, my problems are somwhere else, and far more important, to me&#8230;<br />
<span id="more-273"></span><br />
First, I tried to open a SR. Well, ok, it did not took me half of the day. But then, everything was complete, I clicked &laquo;&nbsp;next&nbsp;&raquo; at the bottom of the page. And there we go :</p>
<pre>
ERROR: MetaLink Network or Page Error

We're sorry but there was a problem trying to access the requested page in MetaLink.

Please hit the "back" button to retry the previous operation. If you continue to get this error page
, please email essrv_us@oracle.com with details of what you are doing when you r
eceive this page.
</pre>
<p>So I sent an email to Oracle.</p>
<p>My supprise was the opening of a new SR in my SR list. The number is 18697692.6. I don&#8217;t know if you can have a look at it. whatever.</p>
<p>I just add an update, specifying I was using Safari on OS X Tiger.</p>
<p>Today I got a phone call from Oracle. Don&#8217;t know which support team it was. The girl asked me what the problem was. I just answerd what was in the ticket  : trying to open a SR on metalink using Safari.</p>
<p>She was not aware of what Safari was&#8230; She just answered me that Internet Explorer was the only solution to use Metalink, and I should download and install it ASAP.</p>
<p>laught !!!</p>
<p>I told her that IE was not existing anymore on OsX, and whatever I wouldn&#8217;t install it anyway.</p>
<p>The told me she will refer to a more technical team and call me back.</p>
<p>Few hours after I had an email telling me the SR was updated and waiting for customer update. I went to metalink, and here is the answer from Oracle  :</p>
<pre>
<strong>26-MAR-08 11:35:44</strong><strong> GMT</strong>

.
ACTION PLAN
============
Please upload the alert.log and the trace files generated by this error.

Regards
Göran Sxxxxx
Oracle Support Services
</pre>
<p> <img src='http://www.lecentre.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Of course, I made an answer. It is just here under. Just before you read it, let me point out the conclusion : as long as you don&#8217;t upload a  RDA with your SR, you won&#8217;t get any usefull answer, even if your SR does not require more information to be resolved.<br />
Now you know what you pay for.<br />
My answer :</p>
<pre>
Hi,

I'm sorry your ticket system is so dumb you can't realise this SR was opened automaticaly by you, and is not about Oracle problem, but using Metalink web site.

I had a phonecall this morning from someone don't knowing what are Firefox and Safari.

I may provide you with those URL so you can check on your own :

http://www.apple.com/fr/safari/

http://www.mozilla.org/

I just tried to open another SR from Safari on Os X Tiger and got the error you can see on the first ticket (which was in fact an email sent to you as requested inside the error message).

I'm sorry, you won't get any alert.log or trace file on this one !
This just points out to me that the SRs are not read by a human intelligent brain UNTIL the result of the RDA is uploaded.

But heh, you guys have other things to do than answering to support calls from customers who pay millions for it...
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/273/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building MacPorts Py-Mysql on Leopard</title>
		<link>http://www.lecentre.net/blog/archives/235</link>
		<comments>http://www.lecentre.net/blog/archives/235#comments</comments>
		<pubDate>Fri, 15 Feb 2008 21:46:24 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/archives/235</guid>
		<description><![CDATA[If you installed over your old Tiger or if you are new user, you may have experienced errors when trying to build py-mysql.Py-mysql is a Python module to connect to Mysql.I&#8217;m using it to have Django, the Python Web Framework, to connect to Mysql database. This is what I got when trying to install :   # [...]]]></description>
			<content:encoded><![CDATA[<p>If you installed over your old Tiger or if you are new user, you may have experienced errors when trying to build py-mysql.Py-mysql is a Python module to connect to Mysql.I&#8217;m using it to have Django, the Python Web Framework, to connect to Mysql database. This is what I got when trying to install :  
<pre lang="bash"># port install py-mysql
--->  Building py-mysql with target build
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_python_py-mysql/work/MySQL-python-1.2.2" &#038;&#038; /opt/local/bin/python2.4 setup.py build " returned error 1
Command output: running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-ppc-2.4/MySQLdb
running build_ext
building '_mysql' extension
/usr/bin/gcc-4.0 -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -Dversion_info=(1,2,2,'final',0) -D__version__=1.2.2 -I/opt/local/include/mysql5/mysql -I/opt/local/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c _mysql.c -o build/temp.macosx-10.3-ppc-2.4/_mysql.o
In file included from /opt/local/include/mysql5/mysql/mysql.h:47,
                 from _mysql.c:40:
/usr/include/sys/types.h:92: error: duplicate 'unsigned'
/usr/include/sys/types.h:92: error: two or more data types in declaration specifiers
error: command '/usr/bin/gcc-4.0' failed with exit status 1

Error: Status 1 encountered during processing.
</pre>
<p>I tried to upgrade MacPorts&#8230; but I already had the latest.</p>
<pre lang="bash"># port selfupdate

MacPorts base version 1.600 installed

Downloaded MacPorts base version 1.600

The MacPorts installation is not outdated and so was not updated
selfupdate done!</pre>
<p>I finaly found the solution on <a href="http://rob.cogit8.org/blog/2007/Nov/14/installing-django-leopard-mac-os-105/" target="_blank">http://rob.cogit8.org/blog/2007/Nov/14/installing-django-leopard-mac-os-105/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/235/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the Page size in Sybase</title>
		<link>http://www.lecentre.net/blog/archives/117</link>
		<comments>http://www.lecentre.net/blog/archives/117#comments</comments>
		<pubDate>Wed, 26 Sep 2007 15:43:46 +0000</pubDate>
		<dc:creator>Prune</dc:creator>
				<category><![CDATA[Sybase]]></category>
		<category><![CDATA[UNIX]]></category>

		<guid isPermaLink="false">http://www.lecentre.net/blog/archives/117</guid>
		<description><![CDATA[Strange, I wasn&#8217;t able to find a way to get the database page size in a Sybase (12.x) server. Digging in sp_helpdb stored procedure gave me some more informations. To do this, or any stored proc, use this SQL command : use sybsystemprocs go sp_helptext sp_space_segment go You will get the stored proc as text. [...]]]></description>
			<content:encoded><![CDATA[<p>Strange, I wasn&#8217;t able to find a way to get the database page size in a Sybase (12.x) server.</p>
<p>Digging in sp_helpdb stored procedure gave me some more informations. To do this, or any stored proc, use this SQL command :</p>
<pre lang="sql">
use sybsystemprocs
go
sp_helptext  sp_space_segment
go
</pre>
<p>You will get the  stored proc as text.</p>
<p>Finaly, the solution to get the page size is :</p>
<pre lang="sql">
select v.low/1024  from master.dbo.spt_values v  where v.number = 1 and v.type = "E"
</pre>
<p>or the page size in octets:</p>
<pre lang="sql">
select v.low/1024  from master.dbo.spt_values v  where v.number = 1 and v.type = "E"
</pre>
<p>or how many pages there are in a mega-octet (Mo) :</p>
<pre lang="sql">
select (1048576 / v.low)
from master.dbo.spt_values v
where v.number = 1
and v.type = "E"
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lecentre.net/blog/archives/117/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

