Responses to some Oracle v's MySQL Questions

I was asked a few questions by a reporter thru a collegue, here is an extract of the discussion.

1) Based on your initial experience with Oracle Database Express Edition, what are your initial thoughts on the product in terms of meeting developer needs?

Installing Oracle 10g Express Edition was a breeze. (Article). In the past Oracle products have been more difficult to install, however this has gradually improved with the more recent version releases of 8i, 9i and 10g. This easy installation via rpm under Linux, in particular the inclusion of HTMLDB provides an ideal database environment that is functional in just a few minutes. This is an important first step in gaining initial developer support.

With the database installation, the Web Based HTMLDB Interface and a sound amount of developer articles online at the Oracle Technology Network ( http://otn.oracle.com), there is a lot of information to meet a developers need. In particular, HTMLDB which offers Database Administration, general SQL tools, easy data management and a complete web forms development environment. There is a learning curve in understanding this functionality, however it is an extensive and powerful tool for developers, and requires a minimum of syntax specific knowledge. With the release of Raptor in December, Oracle will have a visual tool for development, which will complement this offering in meeting developer needs.

2) As a mySQL developer, do you think it is on par with proprietary database offerings?

MySQL celebrated it’s 10 anniversary this year, and with the Release of MySQL 5.0, gave the open source community a product to match the strengths of others products with new functionality including views, stored procedures, triggers and a data dictionary. Oracle provided these features with Oracle Version 7, released in 1992, long before MySQL was even a company. In a commercial world, MySQL now offers the strengths of an Oracle Database Product, however Oracle has grown extensively and offers not only a commercial database product but an entire suite of products. MySQL is on par in a great number of areas. Granted they are catching up quickly, and the Open Source community offers features that commercial companies cannot. This includes the ability for open source companies to change, adapt and correct more quickly, bringing features and functionality to the marketplace more often, and more open support and knowledge bases enabling users to gain easier and open access. These two points offer downsides that commercial product offerings in turn offer back, including more commercial strength functionality, and more consistent and managed knowledge management, particularly in support.

3) Do you think the efforts of vendors like Microsoft and Oracle to gain mindshare with entry level versions of their products would entice mySQL developers like you to consider their higher-end database products?

I think that Oracle 10g Express Edition caters to different markets. For existing users and developers with Oracle, the opportunity to provide their products for resale at a reduced cost, with a zero cost Oracle license is a definite market and opportunity for these Oracle Partners. I think the education sector, including universities is another potential market, where a genuine free product can be used in teaching, and then practical application, and lead into usage within the professional employment. The third sector, the competitor market, which includes MySQL and Microsoft is more complicated. Oracle will need to go further to bridge the gap in convenience for MySQL developers. To sight a few examples, MySQL is generally available now in online hosting packages, on Linux Distros. It’s quick, easy and convinient to access, and is gaining significant popularity in the open source community, a good barometer in success in a developer driven environment. When Oracle can provide it’s products within a Linux Distro and you can see Online Hosting providers offering packages including the Oracle 10g Express Edition database, gaining market share will at least be more convenient.
One other strength, is MySQL being part of LAMP, and the significant wealth of open source products developed with MySQL, makes it hard for Oracle to ever gain ground in these continued product offerings. Perhaps if Oracle considered a bounty system, much like Ubuntu, and enticed developers to ensure Open Source products were Oracle compatible, would further entice MySQL developers. (Article)
The downside of these two examples, is there is no return in investment to Oracle, so it will depend on which markets are ultimately intended for Oracle 10g Express Edition. (Article)

4) Among the proprietary database vendors, who do you think has the best offering in your opinion, and where would mySQL fit in?

In this marketplace, there is a platitude of Database Offerings (can provide a list if you want), Oracle has always been the market leader in the commercial space, and there still is no other offering to match this. Historically, software development with databases was undertaken by IT professionals and there were a small number of commercial products available. Oracle gained a large market share in the past 20 years and has kept up with technology advancement. In the past 10 years, the Open Source community has changed the shape of the product offerings, and has also change the type of developers. There is a divide between the professional developers with qualifications and specific experience in software development in a structured development environment, and the new age of developers that have easy access to tools and information, and can easily contributed to an open source project that may have hundreds or thousands of developers worldwide, but they do at times lack solid grounding, and this can lead to bad habits. Depending on your requirements, a large commercial organisation, or a small webstore and blog, there are different needs, and you can’t therefore compare database products based solely on features. You need to include the customer requirements, as well as the ability for a database product to grow and adapt to your business in the ever changing environment.

I think in this day and age, there needs to be a tolerance between multiple database offerings within organisations. As the CIO or CTO of a large organisation, I would hope that different needs within the organisation would lead to two database products in use and synergy, both Oracle and MySQL.

How can Oracle 10g Express Edition target MySQL?

As I mentioned earlier, is MySQL a target of the new Oracle 10g Express Edition. Maybe not specifically, but let’s assume it’s on the radar screen. What can Oracle do to woe MySQL users and developers?

I see distinct marketing will be required for Oracle 10g Express Edition, marketing for example to existing partners must be different to “Competitor Marketing”. While I’m sure Oracle will now be able to get benefits from Parters trying to sell their products, now being able to reduce costs to customers (at least initially). Other partners that never considered selling developed applications due to the license cost may now reconsider.

But back onto MySQL. Oracle needs to target specific information to MySQL. OTN Technical Articles for Developers and Architects has nothing on MySQL. I can see the need for a Cookbook to attract MySQL users. The Oracle 10g Express Edition page has some information on developer docs, but not on Conversion, Migration and comparison. Some more opportunity here!

While on Migration, I attempted using the Oracle Migration Workbench to migrate my Version 5 database, without success. MySQL would be low on the agenda if a Version 5 migration was not available for a product that’s been in a pre-production release for most of 2005.

So, there is a clear need for some documentation, Quick Start Guides and How To’s for the MySQL community. Obviously being able to do a database migration also very high. But again this is not a practical application, it’s just the icing.
Until some Open Source projects actively engage in Oracle 10g Express Edition, it will always be a novelty to the MySQL community that won’t get off the ground.

I can see one way to jump start the process. Oracle could offer bounties, much like Ubuntu, to get some of the large open source projects Oracle 10g Express Edition compatible.
For example, http://www.phpbb.com, http://www.oscommerce.com, http://www.phpwebsite.appstate.edu, http://www.dotproject.net.

Now offering $200 per project, that would shake some things up!

Oracle 10g Express Edition Target Audience. Is it MySQL?

Just where is Oracle planning on targeting the new Oracle 10g Express Edition?
The obvious answer would be to counter the arch nemesis Microsoft, and the low end product offerings, like the MS SQL Server and the low end free engine MSDE. I didn’t realise to recently, that Microsoft have finally released the next version of MS SQL Server, being 2005, and at the same time provide a free cut down offering, strangely enough called “Express Edition”. It’s taken Microsoft 5 years. Makes you wonder if Database Technology is a high priority!

Is Oracle also now threatened in anyway by MySQL? I think not, however the continued growth of MySQL, it’s availability on any Linux server and in many distros, and now with the MySQL 5.0 GA release with features like Views, Triggers, Stored Procedures, Information Schema and ANSI SQL compliance allows MySQL to compare itself in features with Oracle. Certainly from our local MySQL Users Group, the inside MySQL news is it’s targeted against Microsoft.

Of course Oracle has been around for quite some time, and when I started working with Oracle 7 and Oracle Designer 1.2 back in 1996, these features were already available.

Oracle 10g Express Edition is a specialist database product from a database company, and with the wealth of knowledge that has lead the lasted version 10, everybody else has a long way to go to match this strength. From MySQL, the feature set even in Version 3 and 4, was adequate for application development in many areas, and the community is driving additional features to match other database product offerings.

I think it will be interesting to see what additional information Oracle releases targeted against the MySQL community. I’ve got a number of thoughts here, will post more details soon.

Oracle 10g Express, Free v's Open Source and OFA

In lunching with an old Oracle Friend, the topic turned to Oracle 10g Express Edition, and we discussed the pros and cons for organisations. The first thing he asked me was, “Have you tried loading the database larger then the 4G limit yet”. Some People?

In general the consensus seemed that it was viable for a small organisation, good for a startup company to get into a no cost entry solution, but appealing to those venture capitalists as you have a definite growth pattern.

I’m warming to more actively pursing Oracle 10g Express Edition, especially with HTMLDB, and at present while preparing to submit a paper for an upcoming Open Source conference which I hope is accepted, I’ve allocated some time on the significant topic of Open Source Verses Free. Stay tuned.

It dawned on me later in the day to more closely investigate the Oracle RPM installation and where exactly everything went in the FileSystem. I was surprised that it was not OFA compliant.

What if an existing Oracle customer with licenses was trialling Oracle 10g Express Edition and using the same staff.
Or more importantly, what if a new Oracle person picked up some bad habits from the Oracle 10g Express Edition, and when placed in a more commercial Oracle DBA environment got caught out?

I’m a Database Modeler, I’ve studied it, and I’ve practiced it, I’ve applied it and I’ve learnt some things from time to time of other “experts”, but nowadays, you put a database in somebody’s hands, like MySQL which is readily available, and all of a sudden you have people claiming to know and understand database design. Food for thought.

I hope from this new Oracle 10g Express product, also comes some good support from the Oracle Community to ensure a high standard in all things databases.

Oracle for FREE

Oracle software has always been free to develop with, however to deploy you have to buy a license and for web apps, it could never be limited to users, it was limited to CPU’s and that was expensive. Well now that have released
Oracle 10g Express Edition. A free little brother to Oracle 10g Enterprise. The software I understand is identical in the base sense, with a cut back set of additional features, and limitations to CPU/Memory/Disk usage. So providing your application, or applications all on one server never reach these limits you will be fine, but if overtime your product grows or database grows you may get caught out.

Still it’s not open source, but it is FREE, and for old Oracle people such as myself, a huge benefit as it keeps my skills a little more up to date.

How do I rate it. Well if installation is any guide, I am very, very impressed (and that’s a lot for me). After downloading the RPM here is what I had to do to get be operational.

# missing library found when running rpm of oracle
# CentOS 4.1 CD #3
$ rpm -ivh /media/cdrecorder/CentOS/RPMS/libaio-0.3.103-3.i386.rpm

$ rpm -ivh oracle-xe-10.2.0.1-0.1.i386.rpm

$ /etc/init.d/oracle-xe configure

Oracle Database 10g Express Edition Configuration
————————————————-
This will configure on-boot properties of Oracle Database 10g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press to accept the defaults.
Ctrl-C will abort.

Specify the HTTP port that will be used for HTML DB [8080]:

Specify a port that will be used for the database listener [1521]:

Specify a password to be used for database accounts. Note that the same
password will be used for SYS, SYSTEM and FLOWS_020100. Oracle recommends
the use of different passwords for each database account. This can be done
after initial configuration:
Confirm the password:

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y

Configuring Database…
Starting Oracle Net Listener.
Starting Oracle Database 10g Express Edition Instance.

HTMLDB interface accessible at http://localhost:8080/htmldb
I had to find a rogue Tomcat install running on my default IP and 8080, so I had to stop and restart using /etc/rc.d/init.d/oracle-xe

And it was that easy. Now for a person that used and Installed Oracle for a living it was more complicated, and at the best of times, you would need to allocate at least an hour for a basic install. This was complete and operational in under 10 mins.

Now I’ve never installed MySQL from RPM, but I’d like to compare how easy it is to install MySQL and also required tools for administration.

MySQL 5 differences

Just a note, while MySQL provide a list of Version 5 Features (Official Data Sheet), I’ve so far found a few small things.

mysql> DESC [table], the Null column now shows NO when it was blank

When you grant ALL to a user, it’s gets CREATE VIEW privilege, but when upgrading, you have to manually specify the privilege for previous users that had grant ALL>

Some OUTER JOINS no longer work

MySQL 5 Production Release

MySQL has offically released Version 5 (5.0.15).

Just installed over the RC (5.0.13) and restarted had my development machine working fine, however now I need to more closely investigate 2 complicated queries with Outer Joins that no longer work between 4 and 5, and 2 update queries that have crashed my 5.0.13 install.

The following steps were used to upgrade from 4 to 5.0.13

MYSQL=mysql-standard-5.0.13-rc-linux-i686
cp $MYSQL.tar.gz /opt
cd /opt
tar xvfz $MYSQL.tar.gz
/etc/rc.d/init.d/mysql stop
ps -ef | grep mysql
rm -f mysql
ln -s $MYSQL mysql
cp -r $OLD/data/ mysql

du mysql/data

chown -R root /opt/mysql
chown -R mysql /opt/mysql/data
chgrp -R mysql /opt/mysql
chown -R root /opt/mysql/bin
/etc/rc.d/init.d/mysql start
ps -ef | grep mysql

/opt/mysql/bin/mysql_fix_privilege_tables –basedir=/opt/mysql –password=******

mysql -uroot -p mysql
show tables;

Mount Window Share under Linux with Samba

First check what shares are available for your Windoze Box (in this case it is at 192:168.100.36 with a login of <username> and a password of <password>)

$ smbclient -L 192.168.100.36 -U <username>
$ mkdir /mnt/<sharedir>
$ mount -t smbfs -o username=<username>,password=<password> //192.168.100.36/<share> /mnt/<sharedir>
$ ls /mnt/<sharedir>

Installing Samba

Running on CentOS 4.1 the following steps were use to install Samba.

Install RPM’s
$ rpm -ivh samba-3.0.10-1.4E.i386.rpm
$ rpm -ivh samba-swat-3.0.10-1.4E.i386.rpm

Start Processes
$ /etc/rc.d/init.d/smb start


Check Processes
$ ps -ef | grep smb
root 21243 1 0 10:19 ? 00:00:00 smbd -D
root 21244 21243 0 10:19 ? 00:00:00 smbd -D
$ ps -ef | grep nmb
root 21248 1 0 10:19 ? 00:00:00 nmbd -D

Enable on System Reboot
$ chkconfig smb on
$ chkconfig –list smb

Configure SWAT (web interface to administer samba)
$ vi /etc/xinetd.d/swat

# default: off
# description: SWAT is the Samba Web Admin Tool. Use swat 
#              to configure your Samba server. To use SWAT, 
#              connect to port 901 with your favorite web browser.
service swat
{
        port            = 901
        socket_type     = stream
        wait            = no
#       only_from       = 127.0.0.1
        user            = root
        server          = /usr/sbin/swat
        log_on_failure  += USERID
        disable         = no
}

$ killall -SIGHUP xinetd
$ tail /var/log/messages

Sep 13 10:17:18 omega xinetd[2160]: Starting reconfiguration
Sep 13 10:17:18 omega xinetd[2160]: Swapping defaults
Sep 13 10:17:18 omega xinetd[2160]: Reconfigured: new=1 old=0 dropped=0 (services)

Verify Settings

Using the installed SWAT, simply point the browser to http://111.111.111.111:901/

Htaccess is root and the system root password

Configuring Samba, well that’s another story.

Brisbane MySQL Users Group

By accident I came across a MySQL Users Group in Brisbane .http://mysql.meetup.com/84/. I guess I should have thought about it sooner, I go to the QLD Java Users Group, I spent a long time going to the Oracle Users Group, and have been involved in an XP Users group.

Anyway, it was great to meet with other MySQL users, meet some local MySQL staff, get some inside news of events and products.
There was also a presentation on Ruby, yet another scripting language. The software creator had however introduced some nice features including build-in Unit Tests with the release, easy inspection of class methods, easy extensibility of system classes. The langauge architecture was very inteperative, based in C, however all system functions are provided and run from Ruby source.

Password protecting Apache Site for external users only

In order to make an intranet an extranet, you need to place the intranet on a server in the DMZ.
From here, configure a virtual server accordingly (e.g. intranet.site.com.au)

You will need to configure on an internal DNS (or smoothwall /etc/hosts when using a webproxy) a reference to intranet.site.com.au

Your global DNS for site.com.au should not have intranet specified. This should be invalid in some way. For example in my sites, I have a catch all domain that is an unknown.site.com.au and with wildcard DNS, any invalid domain URL’s in the *.site.com.au go here. For example, try http://intranet.ucb.com.au

Now, within your Apache Httpd conf VirtualHost directive you need to add the following.


<Directory "/home/intranet/www">
  Options Indexes

  Order deny,allow
  Deny from all
  Allow from 192.168.100
  Allow from 10.1.1
  Require valid-user
  Satisfy any

  AllowOverride AuthConfig
  AuthType Basic
  AuthName "Administration Access Only"
  AuthUserFile /home/intranet/.htaccess
</Directory>

You just need to create the appropiate .htaccess file, and restart Apache httpd. Access from the internal network is allowed via IP, and everything else must use the authentication model used.

To setup external access, I created a sepearate subdomain called extranet. To further restrict this past basic access, I configured to to connect to the firewall only on port 81, and then had a rule to redirect to port 80 on the DMZ machine.

So what I ended up with was:

http://intranet.site.com.au internally accesses the intranet.
http://intranet.site.com.au externally redirects to a custom invalid/unknown subdomain page
http://extranet.site.com.au throws a browser not error
http://extranet.site.com.au:81 prompts for a username/password to access intranet.

Moving from standard Apache httpd install to virtual hosts

1. First you need to create an appropiate directory for virtual host. (Using the example of creating an intranet)

$ su –
$ useradd intranet
$ chmod 755 /home/intranet # needed for apache nobody process
$ cd /home/intranet
$ mkdir www logs
$ cd www
$ echo “<html>
<head>
<title>intranet test index</title>
</head><body></body></html>
” > index.htm

2. Second, you need to reconfig Apache Httpd for virtual host management.

$ cd /opt/httpd/conf
echo “Include conf/httpd.include” >> httpd.conf
$ vi httpd.include

NameVirtualHost 111.111.111.111
<VirtualHost 111.111.111.111>
    ServerAdmin [email protected]
    DocumentRoot /home/intranet/www
    ServerName intranet.site.com.au
    ServerAlias intranet
    LogLevel info
    ErrorLog /home/intranet/logs/error.log
    CustomLog /home/intranet/logs/access.log combined
</VirtualHost>

3. Reboot Apache Httpd

$ apachectl graceful

Configuring SSH for automated rsync

In order to rsync files between two servers in an automated sense, you need to setup an appropiate SSH key between both the source and destination servers.

Destination Server

$ cd
$ mkdir .ssh
$ chmod 700 .ssh

Source Server

$ cd
$ mkdir .ssh
$ chmod 700 .ssh
$ ssh-keygen -t rsa
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/userch/.ssh/id_rsa.pub.
$ scp id_rsa.pub [email protected]:.ssh

Destination Server

$ cd .ssh
$ cat id_rsa.pub >> authorized_keys
$ chmod 600 authorized_keys

Source Server
$ ssh [email protected]

Should it not work, and you are prompted with password the ‘-v’ option may provide some more information to diagnose the problem.

Throttling the CPU on my laptop

Using CentOS 4.1 as the Operating System on my laptop for all my work, I’ve been able to throttle down my CPU when running on battery power to extend my battery life, much like the modes that Windoze provides.

$ echo 5 > /proc/acpi/processor/CPU0/throttling

If you want to go back up again:

$ echo 0 > /proc/acpi/processor/CPU0/throttling

Not to be thrown, the output of this file looks like:


[root@lamda ~]# cat /proc/acpi/processor/CPU0/throttling
state count:             8
active state:            T7
states:
    T0:                  00%
    T1:                  12%
    T2:                  25%
    T3:                  37%
    T4:                  50%
   *T5:                  62%
    T6:                  75%
    T7:                  87%

Dell 5150 Wireless under CentOS 4.0

1. Download ndiswrapper from http://ndiswrapper.sourceforge.net/

2. Install
make
make install
lspci
lspci -n

3. Identify and download Windows Driver.

http://ndiswrapper.sourceforge.net/phpwiki/index.php/List

# Laptop: Dell Inspiron 5100
Card: Wireless 1350 (802.11b/g) WLAN miniPCI Card
Chipset: Broadcom Corporation BCM4306 802.11b/g Wireless LAN Controller (rev 02) notice this is revision 02, below is revision 03, Idon’t know if it matters or not
pciid: 14e4:4320
Driver: http://ftp.us.dell.com/network/R90501.EXE
Other: This card is in the miniPCI slot of the Inspiron 5100. The driver below (R83097.exe) did not work, but this one did. To install unzip (program “unzip” works on the .exe) the exe file and use bcmwl5.inf.

Dell 5150 64MB DDR nVidia Corporation GeForce FX Go 5200 under CentOS 4.0

ftp://download.nvidia.com/XFree86/Linux-x86/1.0-7174/README.txt

Directly following the Fedora Core 3 installation I had to get the video to
work. Therefore, at boot time, I went into the grub config file by pressing “e”
and added the following to the end of the kernel line.

linux single

sh NVIDIA-Linux-x86-1.0-7174-pkg1.run
vi etc/X11/xorg.conf

Driver “nv”
(or Driver “vesa”)

with

Driver “nvidia”

In the Module section, make sure you have:

Load “glx”

You should also remove the following lines:

Load “dri”
Load “GLcore”

Reference:

http://www.ccs.neu

Development Software Suite As At 26 June 2004

Java J2SDK 1.4.2_4 http://java.sun.com/j2se/1.4.2/download.html
Tomcat 5.0.25 http://jakarta.apache.org/site/binindex.cgi
JSTL 1.1 http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
MySQL 5.0.20 http://dev.mysql.com/downloads/mysql/4.0.html

Apache HTTP 2.0.49 http://httpd.apache.org/download.cgi
PHP 4.3.7 http://www.php.net/downloads.php
PHPMyAdmin 2.5.7 http://www.phpmyadmin.net/

Eclipse 3.0 http://eclipse.org/downloads/index.php

Eclipse 3.0 was released today.
PHP 5.0 is in RC3
MySQL 4.1.2 is still in Alpha

Adding a second IP address to Linux Server

If say you want to run apache and tomcat both on port 80 (default), you can create a seperate IP address on an internal network.

For RedHat Distros

$ cd /etc/sysconfig/network-scripts/
$ more ifcfg-eth0:0

DEVICE=”eth0:0″
BOOTPROTO=”none”
ONBOOT=”yes”
IPADDR=”XXX.XXX.XXX.XXX”
NETMASK=”255.255.254.0″
BROADCAST=”XXX.XXX.XXX.255″

$ ifup-aliases eth0

Changing A Server's Timezone

For RedHat 9

$ redhat-config-date (except this requires X)

or

$ clock
$ rm /etc/localtime
$ ln -s /usr/share/zoneinfo/Australia/Brisbane /etc/localtime
$ /usr/bin/rdate -s time.nist.gov
$ /sbin/hwclock –systohc

The last two commands can be added to cron for regular syncing with running ntp

0,30 * * * * /usr/bin/rdate -s time.nist.gov >/dev/null 2>&1
1,31 * * * * /sbin/hwclock –systohc >/dev/null 2>&1