MacDevCenter    
 Published on MacDevCenter (http://www.macdevcenter.com/)
 See this if you're having trouble printing code examples


Installing Oracle 9i on Mac OS X, Part 2

by David Simpson
11/19/2002

What the FileMaker developer can expect from Oracle 9i on Mac OS X

Editor's note: In the first part of a three-part series exploring Oracle 9i on Mac OS X, David Simpson provided you with some excellent background information and a look at the ramifications for Solaris administrators. Here in Part 2 he discusses the conversion process for FileMaker administrators.

Why license Oracle 9i? Is it worth the extra cost?

The quick answer to these questions is the standard Oracle DBA answer of "It depends", followed by more questions.

Do you need better scalability beyond the 250 user FileMaker Server limit?

If your users simply need read only access to their data via desktop or Web interfaces, FileMaker database files can simply be duplicated on a periodic basis from a master server to multiple cloned servers. But this type of scalability may not work very well for databases that require both read and write access to the data because each database will contain differing data.

It would be possible to extract newly created records from each of the cloned databases and aggregate the data together on one master server. But in this scenario, how do you handle existing records, which have simply been updated? User #1 might update field #1 of a record on one server, and user #2 might update field #2 of the same record on another server. Which version of the record should be retained? Now you start to see some of the issues involved with writing database replication software.

Oracle reports that Oracle 9i has been tested with 64,000 simultaneous users connected to a single database instance using the shared servers (formerly MTS) feature. Therefore, if you need hundreds or thousands of users to be directly connected to your database via client software, an enterprise class database like Oracle will be necessary. If you need to have hundreds or thousands of users connecting to your database via a Web-based application server like Apple's WebObjects server, then it will not be mandatory to have as many simultaneous connections to the database.

In this scenario, the application server will manage the aggregation of connections to the database. In order to conclusively answer these types of questions, it is generally necessary to prototype the installation in advance in order to perform load testing of all of the components. In any case, the use of an Oracle database for even dozens of users should be considered for the many recoverability features available within the database.

Do you need to create a highly available database configuration to provide availability to the data under a wide range of disaster scenarios?

Related Reading

Mac OS X for Unix Geeks
By Brian Jepson, Ernest E. Rothman

Oracle offers multiple high availability features, which is one of the key reasons customers implement a database like Oracle. These features include:

Do you need to create a no data-loss configuration with transaction rollback?

If the Oracle database is configured to operate in archivelog mode--which is generally recommended--then redo data is written to disk as transactions occur within the database. During a serious recovery situation, the database can be restored to some point in time in the past from backup files, and then the database is rolled forward to a specified point in time by using the archived redo from the archivelog files.

The database can be recovered as long as database backups and archivelog files are available. It's even possible to read through archivelog files on the disk with the graphical version of the Log Miner utility in order to manually undo individual transactions. These features can be used along with database export files, standby/replication implementations, and RMAN backups to provide the DBA with a comprehensive set of tools to recover from almost every potential data loss scenario.

Do you need to create automated tasks that are more sophisticated than the FileMaker ScriptMaker feature?

Programs can be written within the Oracle database using either the PL/SQL language or Java. The PL/SQL language is actually used by the Oracle corporation to implement many of the newest features within the database. With Oracle 9i and higher, both the PL/SQL and Java code can be compiled into native machine code with the resulting object code stored as files on the server. PL/SQL code can run 2x to 8x faster after it has been compiled natively. This functionality is primarily useful for customer-written code at this time because some of the internal database procedures and packages do not work correctly if they are natively compiled.

Do you have the financial resources to license and manage an Oracle database?

If spending $1,000 for FileMaker Server sounds like a lot of money, then you will be shocked at the licensing costs associated with an enterprise class database like Oracle.

The database can be downloaded at no charge from otn.oracle.com for evaluation purposes, but once the database is ready to go into production it does need to be properly licensed. Oracle encourages customers to license the database on the per-processor licensing model. With this licensing method you count up the number of CPUs in your computer, and multiply that number by the licensing cost of the database and database options you need.

Currently the Standard (STD) edition of the database is priced at $15,000 per processor, and the Enterprise (EE) edition is priced at $40,000 per processor. The RAC feature is $20,000 per processor extra, and you need to add 22 percent annually for the support contract.

It's possible to license the database on a per-user basis, which makes financial sense if there'll never be many users accessing the database. However, the licensing method can't be changed after it is initially licensed. So if the business grows and requires significantly more users to access the database, the costs could exceed the costs under the per-processor model. You also have to understand what Oracle corporation considers to be a user for the purposes of licensing purposes. If 1,000 users access the database through an application server, which only makes five connections to the database, then Oracle will require that either 1,000 user licenses be purchased or that the database be licensed via the per-processor pricing model.

The Oracle STD edition is licensed at $300 per user (with a five user minimum), and EE edition costs $800 per user (with a 25 user minimum). There is still an annual support fee of 22 percent, which should be budgeted in addition to the licensing fees. If the support contract is not paid each year, then the customer is not licensed to upgrade to the latest version of the database and must re-purchase all of the licenses over again in order to upgrade versions. This section only gives you a brief overview of the available licensing options and costs, so if you have additional questions you really should contact an Oracle sales representative.

You will need a DBA to set up and manage your database(s).

Unlike a FileMaker database in which even a casual user can set up and administer the database, you do need an experienced DBA to manage a production Oracle configuration. If you are continually making changes to the structure of your database, you'll probably need a DBA on your staff full-time. The DBA will need to work with the programmer(s) in order to plan the structure of the database, create/drop indexes, and create views and stored procedures to improve usability and performance of the database. These tasks will be in addition to the DBA's responsibilities to maintain both the production and development databases. A database installation that makes use of pre-packaged software, which rarely needs changes, could be maintained remotely by any number of different companies that provide remote DBA services via the Internet.

You will need a support contract.

It's possible to manage a production FileMaker database without having any type of support contract. To FileMaker Inc.'s credit, they have created a very manageable product and generally make free database patches available to their customers.

But with an Oracle database you have to maintain a support contract before you can even download patches to fix problems. Due to the complexity of the Oracle database, there is no way a single person can know everything about managing every aspect of the database. Oracle's own support department is subdivided into over a dozen different support areas just to provide support to customers. Additionally, there are bugs, incorrect and poorly worded documentation for complex tasks for which only Oracle has the answers. And there are some issues for which even Oracle doesn't have the answers because they come under the category of being bugs that will be fixed in the next major patch release.

Oracle 9i is not FileMaker Pro

Being a faceless server application there's no graphical user interface built directly into the Oracle database as there is with FileMaker. The first tool that most DBAs will use is SqlPlus, which is available in command line, Java, and Web-based versions. Most DBAs will generally use the command line version shown below in Figure 1.

Screen shot
Figure 1. SqlPlus window on Mac OS X.

This tool provides access to the actual database server software for database creation, database startup, database shutdown, and for running SQL queries. With Developer Release 1, SqlPlus is one of the few tools available for managing the database. The production release will include the full Oracle Enterprise Manager Console application, providing a graphical interface for database instance management, import/export, backup, recovery, graphical Log Miner interface, creation of database objects, and graphical data editing. Please see Figure 2 for an example of the OEM Console running on Windows.

Screen shot.
Figure 2. Oracle Enterprise Manager Console running on Windows.

Until the OEM software is available, it is possible to use external tools like DBArtisan (unfortunately only available under Windows), SQLGrinder or SQLX Manager J which run natively on Mac OS X.

You need external tools to develop applications for an Oracle database.

This is not the case with FileMaker. Everything you need to develop and deploy a database is contained within the FileMaker application. If you want to create a stand-alone FileMaker application, then you would purchase FileMaker Developer, but for most databases accessed either locally or across a network you won't need to make this extra cost purchase when working with FileMaker. (You will have to purchase a copy of FileMaker for each user who will be accessing the FileMaker database.)

Screen shot.
Figure 3. Browsing records in FileMaker Pro.

A view of the data within a similar Oracle database table is shown in Figure 4.

Screen shot.
Figure 4. SqlPlus query of Oracle addresses table.

It will be necessary to purchase some type of development environment to create a stand-alone graphical application for an Oracle database.

One development tool, which works very well on Mac OS X and works cross-platform too, is Revolution. If you are familiar with Apple's Hypercard, then you will feel very comfortable with this development environment. Compiled double-clickable database applications can be created that make full use of a graphical interface.

If you want to create Web-based applications, you could write Perl scripts making use of the DBI and DBD:Oracle Perl modules to access the Oracle database. These applications could run within the Apache Web server that is already installed on Mac OS X. This would be the lowest cost development and deployment environment that you could put together by using these open source tools. But low cost does not mean low performance. Using the mod_perl Apache module will enable this type of Web environment to serve many times the load of the same system that just runs Perl code as standard cgi scripts.

One interesting product, which could be helpful for automating the development of Perl, ASP, PHP, ColdFusion .NET, and JSP Web-based applications is Code Charge Studio. Once you define the application functionality in the graphical environment, you just pick the output programming language, and the application generates the code. There are no deployment licensing costs or royalties required on the resulting code that this tool generates. Unfortunately this tool is only available for Windows, so you would need to either run it on a PC or under Virtual PC.

Oracle has developed their own product named JDeveloper for creating Web-based Java applications. This tool provides a wealth of graphical features for RAD development, project/team management, UML modeling, and software configuration management. JDeveloper provides a graphical interface to the feature-rich Oracle BC4J Java framework that handles the management of data between the Web user and the database. It is important to note that if you make use of some of these features like BC4J, you do need to purchase licenses for the Oracle 9iAS application server product. This $20,000 per-processor cost is in addition to the $995 licensing cost of the JDeveloper software. As with many Oracle products, you can download JDeveloper at no charge for evaluation purposes from otn.oracle.com, but you will need to license the product for a production implementation. JDeveloper is now written as a Java application but is only officially supported on Windows NT/2000/XP, HU/UX, Linux, and Solaris at this time. Since it is a Java application containing no x86 code, it is possible that Oracle will add official support for Mac OS X in the future.

Apple also has a full-featured Java development environment with their WebObjects product. One of the notable features of WebObjects is that it's very economical to license and deploy compared to most of the other application servers on the market. Java capable applications servers (IBM WebSphere, BEA WebLogic, Oracle 9iAS) are often licensed for prices in the range of $20,000 - $30,000 per processor.

Apple's WebObjects development product is priced at $700, and it includes an unlimited processor deployment license and software that can be deployed on any Java 2 capable Web server, including Mac OS X, Linux, and Solaris. In fact Mac OS X server (both 10 user and unlimited editions) include a WebObjects deployment license as part of the purchase price. As you would expect with a product from Apple, WebObjects provides a rich user interface for creating HTML or desktop Java client applications. Apple implements an enterprise objects framework in Java for managing database access, sessions, events, and Web requests. Quick prototypes can be created with the Direct to Java and Direct to HTML Assistants. Apple is one of the few development tool vendors that does not provide any type of demo software download directly from their Web site.

You need to know some UNIX commands.

Actually with Developer Release 1 of Oracle for Mac OS X you need to know a lot of UNIX commands just to build, start, and stop the database. When the production version is released, you'll have the option to install the database with the Java-based Oracle Universal Installer and create the database 3instance with the graphical database creation wizard. You will also be able to use the OEM Console application to view/edit data, create tables, and manage the instance.

You need to know SQL commands.

With Developer Release 1 you will need to know quite a few commands in order to create and manage the database instance since none of the graphical management tools are available.

You will need to read at least some of the Oracle documentation.

Nobody can complain that Oracle doesn't provide enough documentation for their database. There are 118 HTML/PDF reference books provided on the documentation CD for the production Windows version of Oracle 9.2.0. This info is also available via the Web at tahiti.oracle.com (there is no www prefix to this URL). The "getting started" link at the top of the Oracle 9.2 documentation page is a good place to start in order to read about the duties of a database administrator, developer, network administrator, or security officer. Each of these topics includes links to a subset of the entire list of books.

As a DBA, I find that I generally need to be familiar with almost all of the books to some extent even if I have not completely read each of them. This way I can suggest appropriate topics for reading and examples for various people I work with who need to access, maintain, or write programs for the database.

Learning Unix for Mac OS X

Related Reading

Learning Unix for Mac OS X
By Dave Taylor, Jerry Peek

Once a database license and support contract are purchased, an additional set of information resources becomes available via Oracle's Metalink website. It is often very helpful to be able to perform a quick search of Metalink when a new or unusual error message is logged by the database. The Metalink search provides a search of previous issues submitted by customers via the Metalink forums, knowledge base records, white papers, and example documentation. If a Metalink search does not produce results. then a Google web/newsgroup search is a good second choice. There is also a built in error number reporter included on UNIX systems (even in Developer Release 1). For example if the error is ORA-32006, you type the following in the Terminal window:

oerr ora 32006

And you get the following response:

32006, 00000, "%s initialization parameter has been deprecated"
  // *Cause: A deprecated parameter was specified at startup
  // *Action: Consult Oracle documentation to find new parameters
  // to use instead.

Summary for FileMaker developers:

There are many items to consider when contemplating a migration from FileMaker to Oracle. If you have the budget and need for a high performance and highly scalable database, then Oracle would make a great choice. There is a wealth of information in the form of books, Web sites, and consultants for Oracle databases. Oracle's own technical support service is also an excellent reason to consider Oracle. But if your budget can't afford an Oracle database, then a more economical alternative such as MySQL using a Mac OS X graphical front-end application like SQL4X Manager is worth considering. Future production releases of MySQL 4.0.X will even include replication and online backup features. OpenBase and FrontBase are additional commercial alternatives available for Mac OS X, which offer database replication and online backup features.

Final thoughts

The availability of the Oracle database for Mac OS X is a significant event for Apple. Even in its development release status, Oracle 9.2 for Mac OS X is functionally very complete and suitable for testing and evaluation. Its modest hardware requirements make it a viable install even for the laptop of a DBA or software developer.

Glossary of Terms

Instance: An instance is one running copy of the Oracle executable software. You can run multiple copies of the Oracle executable on the same computer with the appropriate amount of memory, disk space, processing power and configuration steps. You can even run different versions of the database on the same server.

SQL: Structured Query Language. These are the commands available to manage data and objects within the database. These commands are broken up into DML (Data Manipulation Language) and DDL (Data Definition Language) commands. The DML commands are used to query, insert, and delete information. The DDL commands are used to make structural changes to the database such as creating the database itself, adding/dropping tables, tablespaces and columns.

PL/SQL: This is an Oracle specific procedural language that is compiled and stored either within the database or externally by the gcc compiler for higher performance. Many of the newest database features are actually written in PL/SQL. As features become more popular or require higher performance they are re-written in C and incorporated into the core of the database.

SqlPlus: SqlPlus provides a command line interface to startup, shutdown, create, query, and maintain the database. This little explanation doesn't really do justice to the complete functionality of SqlPlus. There are entire books written about SqlPlus.

Oerr: This handy little command line utility prints out the text of error messages for Oracle databases running on UNIX servers. This way you don't have to go searching the Error messages manual in order to read a quick summary of the error message text. There may be additional info located within the Error messages HTML manual, and searching Metalink is also helpful if you need more info.

Book References

Other Resources

otn.oracle.com - Discussion Forums - Technologies > Platforms > Apple. (Requires free OTN membership account)

David Simpson is president of .com Solutions Inc. and the developer of the Installgen application.


Related articles:

Installing Oracle 9i on Mac OS X, Part 1 -- The Oracle 9i Developer Release for Mac OS X opens up a new world of corporate database management for both Apple and Oracle. David Simpson begins this series with a look at the issues for DBAs who are considering making the move to Oracle on OS X.

Return to the Mac DevCenter.


Copyright © 2009 O'Reilly Media, Inc.