msgbartop
News, views, tips and tricks on Oracle and other fun stuff
msgbarbottom

New book from Steven Feuerstein on … MySQL

With support for stored procedures, functions, and triggers in MySQL 5.0, last month, O’Reilly published a new book titled MySQL Stored Procedure Programming. The book is co-authored by non other than my favorite Oracle PL/SQL guru and author of many Oracle books Steven Feuerstein.

As far as I know, this is Steven’s first book that is about a database other than Oracle. Interesting.

2 Comments | Filed in Books | Tags: ,


Oracle vs. PostgreSQL

SearchOracle.com has just published an article about the different opinions of a few DBAs regarding the merits of the open source PostgreSQL database management system (DBMS) as compared to Oracle. Here is the summary of the different opinions and comments:

  • PostgreSQL 8.0 is much more than just a back end for Web sites.
  • PostgreSQL can be used instead of or as a complement to Oracle and other DBMSs.
  • Oracle’s rich feature set is second to none.
  • PostgreSQL is much more suitable for the casual database developer.
  • PostgreSQL has a solid set of features that includes most, if not all, of what developers would ever use.
  • Oracle has a feature set several orders of magnitude more rich, but few if any of these features would ever be used by developers.
  • In PostgreSQL, you can recompile a stored procedure on a live system, and only transactions starting after that compilation will see the changes. Transactions in process can complete with the old version. Oracle just blocks on the busy procedure.
  • PostgreSQL stored procedure parameters are not typed. Everything is passed as strings.
  • It makes more sense to compare PostgreSQL to OracleXE, a slimmed down and free version of the Oracle DBMS.
  • PostgreSQL is easy to use and complies with the SQL standard nicely.
  • PostgreSQL doesn’t behave as nicely as Oracle when the system fills up. In those instances, the system tends to crash quickly.
  • Setting up a TCP/IP connection capability with PostgreSQL is hardly an intuitive process.
  • Oracle and PostgreSQL don’t talk to each other except by externally built and most times highly customized connectors.

My opinion is that Oracle is the king, the leader in DBMS and is the logical choice when selecting a database to store and secure your important data – If you can afford it. If you cannot afford Oracle then there are many alternatives, including the free Oracle XE, PostgreSQL, MySQL…

Updated a few hours later: Heated discussion on Slashdot.

5 Comments | Filed in Oracle | Tags: ,


ColdFusion bug or feature?

Consider this simple ColdFusion code (CFMX Ent 7.0.1.116466 and Oracle DB 8.1.7.4): Continue reading…

4 Comments | Filed in ColdFusion | Tags:


A binary flag with three values

While troubleshooting a problem in the Order entry module of Oracle Applications (11.0.3), I query the column open_flag in the order header table so_headers_all for the order number in question. The column open_flag is supposed to be a Y/N flag that tells me whether the order is open or closed. Instead, for this order, the open_flag is NULL.

Come on! how am I supposed to know the meaning of NULL here? Does null mean ‘Y’ (order open) or ‘N’ (order closed). There should have been a NOT NULL and a CHECK constraint on the open_flag column.

In my definition, a flag is supposed to have two, and only two, values, Y/N, 0/1… Why allow a flag to have a third value, NULL? It only adds to the confusion and is definitely a bad design.

Relying on a NULL to give a meaning to a column is a bad practice.

5 Comments | Filed in Oracle | Tags: ,


I use Oracle Database 10g Express Edition to …

I like Oracle DB XE, not only because it is free and has all the power of an Oracle database, but also because it comes with Application Express, or APEX (formerly HTMLDB). I plan to learn APEX and use it as an ad hoc application builder for such applications that can be shared among team members or on the company’s Intranet.

I installed the demo Web Services application that comes with APEX. For testing purposes, I wanted to allow my coworkers access to this demo application on my Oracle DB XE instance on my PC. Not a big deal, I just gave them the URL to the application, something like this: http://10.10.2.132:8080/apex/f?p=100. But, they could not connect to the application.

Well, I discovered that there was a setting called “Manage HTTP Access” under the Administration section of APEX. By default, this setting was set to “Available only from local server”. I switched it to “Available from local server and remote clients”. Now anyone who is on the same network as my PC, is able to access the application.

Of course, if you are exposing access to the whole Internet, you may think twice before doing this. But since I’m sharing the application only among my team members and only inside the company’s firewall, I was not paranoid about security.

Another thing I find useful is to use my Oracle DB XE instance as a tool to load CSV or XML data to another non-XE database (or even XE) through database links.

Assuming you have a non-XE Oracle database instance called ENTORA, and you have a table in a schema in the ENTORA database that you want to populate from data in a CSV file. There are many ways to do that, here is one way to do it using your local Oracle XE instance.

First, in XE, you create a database link to ENTORA. Something like:

create database link ENTORA
  connect to <username> identified by <password>
  using '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)
    (HOST=ENTORA_db)(PORT=1521))(CONNECT_DATA=(SID=ENTORA)))'
/

Then, using APEX, you load the CSV file into either a new table or an exiting table. Loading the data into an Oracle XE user table is just a few clicks away.

Once you have the data loaded in the table, you could do this (connected to user@XE):

insert into t@ENTORA select * from t;
commit;

I’m assuming that both t@ENTORA and t@XE have the same structure and DB users have the right privileges.

Poof! Your CSV file is loaded into a table on your non-XE Oracle database.

For more Oracle DB XE benefits, check out Lewis Cunningham’s article on OTN: Oracle Database 10g Express Edition: Not Just for Learners.

If you have downloaded and installed Oracle DB XE, what do you use it, or plan to use it, for?

5 Comments | Filed in Oracle, Tips | Tags: , , ,


Breaking News

In other news:

BreakingNews

4 Comments | Filed in Interesting Stuff, Technology | Tags: