smithvoice.com
 Y'herd thisun? 

“Philip also watched and learned from the democratic assembly at Thebes. He saw the grave weakness of a system in which every man could voice his opinion and vote. Debates in the assembly were endless, while political parties worked to destroy the power of their rivals. Philip began to see how an old-fashioned monarchy like Macedonia could act much more decisively than a Greek city and be unstoppable”
-Philip Freeman


from Alexander The Great

MONO/Ubuntu part 19 - Installing Oracle 10g XE Server

TaggedDatabase, Linux

Databases, databases, which one to pick. A religious issue with battles bigger than Islam vs Judaism and almost as bloody as the computer language wars.

But let's be practical.

If you're on Windows with a clean slate your first reach is for SQLServer, even the free single-core, 4gb maxed "Express" versions are right up to date with the latest and greatest full-on paid product. MS does the product very well. And if you have SQLServers running you're all set connecting to SQLS2000, 2005 and 2008 via Mono with all of your standard ADO.Net code.

If however you want to drop a database server on a linux machine, SQLServer is not an option. And I'd suggest, for an experience close to SQLServer Express, that will be trusted by most corporate managers, you go with Oracle 10g Express. Oracle still has that common-ground appeal, in that if you can do Oracle then many smart companies using anything else will trust that you can do their dbms too.

 

For the rabbids:

According to an April 2009 Software Development Times cover story we are in the middle of a "Database Renaissance" with the fork of MySQL and lots of little esoteric data storage systems. It can be hard to pick a long-term tool from all of the cool new stuff.

If you've been around for a while, though, you know that the hype of recent mutations can also be chalked up to a slow news week. Over the years and decades there have been lots of bursts of nifty database engines. I remember jumping on POET and CascadeDB (CascadeDB's OOP engine was really, really cool till a major player bought them and removed it from the world) and then there have also just been more mainstream 'bases that had their day and went away.

It's always fun and educational to set up an isolated test box and give a few days to shiny new and yet for a system that you have to trust for at least a year going with one of the major big players is just a safer bet. Like Office being the God of productivity suites (like it or not), trustworthiness and features and stability comes from lots of users doing lots of things and breaking stuff and fixing it and documenting it all and the vendor adjusting each new version to accomodate the evolving needs. Trustworthiness comes from big userbases of professional companies. The order depends on the source of the useage data but there's no doubt that the Big userbases for Databases are still in the old names: Oracle, SQLServer and DB2.

For the fanatics: A long downturn in the economy may help it notch up, but Postgres is still pretty far in the rear. And yes, MySQL has a load of rabid fans - reminds me a lot of Jet/Access in a LOT of ways - but in my experience it's not got the business trust of the others. That's just me, and my experiences of candidates getting jobs based on their backgrounds, If you only want to work for a non-profit with non-revenue then MySQL may have the hippage to get you a cube with other folks of like mind. Another tipping point consideration of MySQL is that now that Oracle owns it there is a chance that anything can happen including Oracle doing to MySQL what Microsoft did to Jet... repositioning it in the corporate world as a baby-toy no matter how truly powerful it is.

So! Which db server to use for apps that need to "just work" on your Ubuntu box? Since we're doing this for "free" development with a mind to scaling up to full-iron paid instances/support if our product takes off we've got the choice of DB2 Express-C and Oracle 10g Express.

IBM has a special Ubuntu package. It's a bit long in the tooth being released for Ubuntu 7.10. On the upside it allows 2 procs instead of Oracle/SQLServerExpress's 1 proc limit... on the other hand it has a 2gb data limit compared to Oracle/SQLServer Express's 4gb upper boundary.

Technically for just the server the Oracle vs DB2 call is coin flip. Realistically, Oracle is still the fork to take because it is still the bigger winner in worldwide deployments, has more documentation and more of that ellusive "crossover trust factor".

In my experience.

There are a few steps to getting Oracle Express running in a useful way for Mono. The first is the server install, the second is the installation and configuration of the Oracle InstantClient (needed on all machines that will be hitting the database server), the installation and configuration of the SQLPLus client so that you can directly do the DDL and DML *and* so that you can get a nice GUI available to off-box devs/dbadmins, then there's the Mono driver installation and the configuration settings that let your Apache ASP.Net connect to the server over the InstantClient.

The basic server install

To get your Oracle Express server on a box, you just have to follow the bouncing ball. There are a number of sites on the web that bullet this out and the one I keep in my favorites list is from cybercities

Call this section a cut&paste but, with all due respect to that site poster, I'm somewhat duplicating it here anyway. This is for the "just in case" of that site ever going down or going away just when I need it most. It's happened too many times in the past, so the safety net is required. (I will skip the part about hainvg less than 1GB RAM, I don't think I'll ever have that limitation, and it is fully documented elsewhere if needed.)

Step minus one: Pick a machine.

Just as with any database server it's best to install on a machine dedicated or partially dedicated to the service. When your data storage and access needs grow that is very important, but for getting your feet wet and smaller needs you can throw it on the same box and/or OS instance taht's already hosting other services. Using a Virtual Machine is also a perfectly good option if you have the iron for it. It just depends on your real-world requirements and availability of hardware.

For our example we're putting Oracle Express on the same box as Apache/Mono used all along in the tutorial, and will point out special stuff for multi-box deployments as the need arises.

Step one: Add oracle to the machine's apt sources.

sudo nano /etc/apt/sources.list

Scroll to the bottom of the file, copypaste this line in:

deb http://oss.oracle.com/debian unstable main non-free

CTL-X to save the changes and close the sources.list file

Step two: Import the GnuPrivacyGuard key

sudo wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle -O- | sudo apt-key add -

Step three: Update the apt package database.

sudo aptitude update

Step four: call the installation of Oracle Express 10g

sudo aptitude install oracle-xe

You'll get the standard confirmation prompt, accept it.

Step five: When the install is done, run the configuration script. This will verify/set the port used by the useful web interface ("APEX") which defaults to 8080, the port for the database listener which defaults to 1521, and let you specify the initial passwords for the system and sys accounts.

After several seconds the process will be finished and Oracle Express 10g will be running on your server.

Congrats, but don't get too excited yet.

Of course there's a catch

In the last shot above, notice the url for the "Database Home Page". This is the location of the "Application Express" ("Apex") webapp that lets you click to set up various objects in the db, and it's a catch-22 problem for textmode Linux servers.

Saying "d'oh" is appropriate here. ;-)

Apex has a lot of java script and graphicals that only work in a full-GUI operating system's full GUI web browsers - not a textual OS using a textual browser. Also, by default Apex will only run via "localhost" so you can't connect to Apex from another box. Tipsites tell you to just shut off the remote access restriction ... but they tell you to do that using Apex. Funny huh?

Worry not, there is a relatively simple way out of this jam and part of it is required to use Oracle from Mono ASP.Net anyway. The fixer is called "InstantClient" and it is soooooo much nicer than the olde Oracle 8 and 9i days of TNSNames and setting up the full-blown oracle client.

BTW: if you're wondering if you can skip Apex and just do your database work via scripts and SQL at the commandline, the answer is Yes. You don't absolutely need Apex, us old guys who did Oracle professionally years ago never had a UI tool and we got all of our work done. But, honestly, it does make lots of stuff easier at least in the beginning.


Coming next: Getting and installing Oracle InstantClient and connecting from Mono ASP.Net.Click here for that


jump to:

  • 1: Why?
  • 2: Installation
  • 3: Update the OS with APT
  • 4: Remoting to the box with SSH
  • 5: NANO quickies for 95% of the jobs
  • 6: Firewalling Ubuntu 8.10 Server
  • 7: Installing Apache2 and MONO
  • 8: Test client host files
  • 9: Configure MONO on Apache2
  • 10: Apache default pages
  • 11: Handling Apache and Mono Errors
  • 12: Subdomains and Christian porn
  • 13: Virtual Host Tweak: unmanaged cAse sensitiviTy
  • 14: Managed cAse sensitiviTy
  • 15: Managing files and folders
  • 16: Logging Apache Accesses and Errors
  • 17: Ubuntu Task Managers
  • 18: Ubuntu Services and Service Managers
  • 19: Installing Oracle 10g XE Server
  • 20: Connecting Mono to Oracle


  • home     who is smith    contact smith     rss feed π
    Since 1997 a place for my stuff, and it if helps you too then all the better smithvoice.com