Tag Archives: Oracle Application Express

Building an Oracle 26ai Database Server from Scratch #JoelKallmanDay

In 2014, while teaching Oracle Database Administration courses at Austin Community College, I wrote a series of blog posts on how to create an Oracle Database server: Oracle Database 12c on Oracle Linux 6, so my students could build their own practice database servers.

Now, as the Director of Consulting Services in the Oracle Technologies division of Talan, I was recognized as an Oracle ACE. Part of the ACE program is promoting Oracle at Conferences (I presented two sessions at ODTUG’s Kscope26 conference in Colorado this year) and doing things like blogging. Blogging helps me maintain my ACE status (although I’ll have more than enough points from presenting at conferences this year).

Since I’ve been a bit sporadic about blogging lately, I thought I’d get back into the swing of things by putting out my complete step-by-step instructions for building an Oracle Database server on your own machine. Note that these days, you no longer really have to do this. You can simply go to Oracle Cloud and obtain a pre-configured database server. If you just need “the database” and don’t want to do anything at the operating system level, then an Oracle Autonomous Database is for you. However, there are several limitations associated with an Autonomous Database (which is essentially a pluggable database within a database maintained by Oracle for you) that are completely removed if you opt for an Oracle Base Database instead. With an Oracle Base Database, you get direct access to the operating system, and you could, for example, potentially attempt to do all of the examples within Tom & Darl’s incredibly awesome book Expert Oracle Database Architecture. (One of my presentations at Kscope this year was basically “Read this book, do all the examples while understanding what’s happening, and you’ll be a much better Oracle Database developer.”) That said, messing around with an Oracle Base Database on Oracle Cloud could possibly get you into a state where the automated patching tools and other things that Oracle does for you might not work. If you are just playing around, you could always blow away the database and create a new one if you mess it up too much.

However, if you would like to build a practice database server from scratch on your own machine, and along the way, learn much more about how an Oracle Database server is built, then this series of blog posts is for you.

A note about my philosophy when it comes to Oracle Database servers and the rules I like to follow.

  1. Ease of understanding, especially during a crisis, is important
  2. Less configuration is, almost certainly, better configuration
  3. The more you understand how, and why, and where the Oracle database does its things, the better you can respond in an emergency situation

As an example, when I make my post about the systemd services that I create for Oracle backups, you’ll notice that the entirety of the RMAN backup configuration is entirely within the system command. This means that if there are changes to be made, I go to the one place where my backup is configured and just address changes there. The ‘traditional’ approach of a cron job (1) that calls a script (2) that calls RMAN (3) with another file for the RMAN commands (4) spreads “How are backups done?” all across your OS in different files in different directories.

As I get time, I’ll be adding posts for each of the items below (almost certainly in order as I do these steps on my own new Talan laptop) and linking them from here.

Building an Oracle 26ai Database Server

  1. Install Oracle VirtualBox & VirtualBox Extension Pack
  2. Download Oracle Linux ISO
  3. Create Linux Virtual Machine
  4. Log in as root & Improve Quality of Life
  5. Disable selinux
  6. Disable firewalld
  7. Update /etc/hosts
  8. Install Guest Additions Into Virtual Machine
  9. Install Oracle Linux 9 EPEL & Oracle Software Repos
  10. Install rlwrap
  11. Install Oracle Database Preinstall RPM
  12. Install Oracle JDK
  13. Install Nginx (optional)
  14. Set oracle OS user password
  15. Create Oracle directories
  16. Initial Oracle login and quality of life improvements
  17. Install autoupgrade
  18. Create autoupgrade download keystore
  19. Download Oracle Database with autoupgrade
  20. Download Oracle APEX with patch (if available)
  21. Download ORDS
  22. Create Oracle software home with autoupgrade
  23. Configure read only home (poorly named)
  24. Create Oracle container database with pluggable
  25. Create listener
  26. Install ORDS
  27. Install & Patch Oracle APEX
  28. Set APEX internal workspace password
  29. Enable APEX network services
  30. Create and enable an APEX resource manager plan
  31. Turn on database flashback
  32. Create systemd services for database and ORDS
  33. Create systemd backup service
  34. Configure APEX static images (CDN or local)
  35. Install mkcert for signed certificates
  36. Configure Nginx
  37. Disable annoying password stuff in APEX

A note about the Joel Kallman Day tag on this post:

Joel was a really nice person who dedicated his life to being a good and kind person. He did so much for the Oracle APEX community and for his family. Those of us who knew him still really miss him.

My last correspondence with Joel was this:

                Got a few minutes to chat? Trying to help a CIO find a good APEX hire? - me
                          
Sorry, on medical leave. - Joel

                No problem at all. Sorry, I didn't know. Here's to a speedy recovery! - me                          

That speedy recovery never came, and the world is at a loss because of it.

Technician servicing Oracle server rack with labeled equipment and hardware
A technician services an Oracle server rack beside components prepared for deployment.

Kscope23 Recap

I’ve been back for a while but thought I’d post some plans for my Kscope content and talk about the conference itself now that it’s in the bag.

I arrived late Friday night and things were pretty quiet. I spent some time in the bar trying various bourbons and whiskeys before calling it an early night.

The next morning I ran into Connor McDonald (check out his amazing content on Youtube). He mentioned that he was planning to go visit the famous Tom Kyte (the original creator of Ask TOM, and author of one of the very best Oracle books, Expert Oracle Database Architecture) but apparently Tom fell off a ladder and broke some ribs. Hopefully, Tom will recover soon. A bit later I joined the team going to the community service day event. They gave us matching shirts to wear and we boarded buses to Mile High Behavioral Healthcare and did a bunch of cleaning, gardening, and painting. I was on the painting crew and painted a gazebo and a few tables with a great team of folks. I ended up buying MHBH some picnic tables after we went to pick up one of their existing picnic tables and it essentially disintegrated. When one of the guests of MHBH asked me “How do I get one of those shirts?” I gave him mine. While the shirt was cool I’m sure he’ll get more use out of it than I would have.

By Sunday the rest of the Insum team had started to show up and we had a great time re-connecting.

Both of my main presentations were on Monday. Thankfully I’d delivered both before, so I was really comfortable with the content although it was going to be my first time delivering my “You know you might have a bad data model when…” presentation in just thirty minutes (I’d been given one of the 30 minute sessions for this presentation). It’s a bunch of slides with the type of queries that you would either see in your applications or queries you can run against your application schemas to see if there might be opportunities for enhancements. Upon the advice of Steven Feuerstein, another member of the Insum team, instead of starting with the theory of normalization, I started with the actual queries. Since the theory portion would take about 5 minutes, my plan was to cut it off at 25 minutes and jump to the theory. I set an alarm on my phone for 25 minutes, let the audience know what I planned to do, and dove in. When I finished my queries section, I glanced at my watch to see how much time I had left. As I was glancing at my watch, the alarm on my phone went off! It was perfect and I got a bit of applause from the audience. I finished off the theory portion and then got a lot of good feedback including from some of the very experienced folks in the audience (Oracle ACE directors, etc.).

Later in the day, I did my “APEX and ORDS for DBAs and System Admins” presentation. While I’ve delivered the content at other events before, I always update my presentations to the latest and greatest software, and with the very frequent updates of both ORDS and APEX I had to update everything a few days before the conference.

This presentation is actually about 2 to 4 hours of content, but I only had an hour to deliver it. Basically, I cut the presentation in half and gave folks a preview of what would be in the 2nd half if I had more time. I also went through the first half of the presentation pretty quickly. The premise of the presentation is that people often come to Kscope and they see all these really cool APEX solutions, but then when they go back to their own IT department the DBA or System Admin just says “No.” The reason for the “No” can be anything they feel like coming up with at the time (“Security”, “Too complicated”, “I don’t know how to do it”, etc.) but the conference attendee doesn’t get the very cool APEX and/or ORDS features that they saw at the conference. To solve this problem, I broke the first half of the presentation into three sections.

  1. Install the APEX database component and patch it in the database.
    This section shows that APEX is just a component of the database (it shows up in the dba_registry view) and, by showing what is happening in the database we see that there are NO security changes in the database when you do this. It also showed how the installation and patch take under 10 minutes. On my boxes, the APEX install takes usually takes under six minutes and the patch takes under 30 seconds.
  2. Now that you have the APEX component in the database, you have access to bunches of very cool APIs. Some of those APIs enable you to reach out of the database to access things on remote servers if the DBAs allow it. I show exactly how to enable this and how to create and manage an Oracle TLS wallet (yes, people and Oracle often refer to this as an SSL wallet, but we really stopped using SSL back in the 1990s. It’s been TLS for over 20 years… and it really is a TLS wallet). Wallet management can be very tricky and I can’t tell you the number of times I’ve seen very bad wallet setups on Oracle servers. I explain the various wallet types (TDE wallet, SEPS wallet, XDB wallet, and TLS wallet) and show how I build and maintain them.
  3. Finally, we get to the last step which is setting up and configuring ORDS for a production-ready deployment. While Kris Rice, the Oracle lead for the ORDS team, disagrees with me, I really don’t like deploying ORDS with /ords/ in the URL. As Sir Tim Berner’s Lee explains, cool URLs don’t have the technology used to deploy them in the URL. Yes, that link is from 1998. I figure when Kris is knighted by the King he can tell me I’m wrong. I also show how to maintain ORDS over time. I show how to create the best

At this point, I’ve covered the first half of the presentation but an hour has passed and I have to just show folks what the next three sections are:

  • Adding a database resource manager plan that ‘just works’ for APEX deployments.
  • Building a Systemd service to run ORDS.
  • Deploying the ORDS service as a ‘regular’ operating system user instead of the root user. The root user can, of course, deploy ORDS on port 443 (the default HTTPS port) trivially, but some folks would prefer not to run ORDS as root, so I show how to do this.

My plan is to take all of that content and publish it here (update: The entire 2-hour APEX & ORDS for DBAs and System Admins is now live!), but it will take a while. Life is very busy and I’m not exactly sure when I’ll be able to finish it all. Until then, all of the code and examples from my both presentations can be found in the following Github repos:

Finally, I was a co-presenter with Cary Milsap of Method R in a presentation on tracing APEX. It was also well-received and sparked a lot of interesting discussions.

When I do get the time to post everything from my presentations I’ll try to remember to come back and here and link it in. Update: Here’s the link to the whole presentation from start to finish!

Until then, happy DBAing, System Admining, APEXing, and ORDSing.


Expert Oracle Application Express

Expert Oracle Application ExpressOne of the fundamental problems with most documentation from most technology companies is that the documentation usually contains a bunch of assumed knowledge.

Take for example, the Oracle Application Express Installation Guide for Release 4.1. This document has the following line in Section 1.4 About Choosing an HTTP server. “In order to run, Oracle Application Express must have access to Oracle Application Express Listener, Oracle HTTP Server and mod_plsql or the embedded PL/SQL gateway.” Yep. That’s right… sort of. As an experienced installer of APEX, I know that they mean: There are three different ways to connect to Oracle Application Express:

  1. The Oracle Application Express Listener
  2. An Oracle HTTP Server and mod_plsql
  3. The embedded PL/SQL gateway

But, if I was a brand new person with no experience, I might wonder if I need the Oracle Application Express Listener + an Oracle HTTP Server + mod_plsql, or the embedded PL/SQL gateway. Reading the rest of the guide might give me an idea, but for a while I might be confused.

However, I often waffle back and forth between what the biggest problem with technology documentation is: Is it assumed knowledge? Or is it the fact that almost all technology documentation tells you what some setting or button does, but it almost always leaves out the ‘and here is why you would want to do this’ information. You could make the argument that they are one in the same, but I usually see them as different problems. The second problem really comes into play when there are choices. If there are no choices then just telling me what I have to do is fine. Just make sure I know how to do it. I once saw a step in an installation guide that was “Configure SQL/Net”. No links to other documentation. No explanation on how to do it. Just “Configure SQL/Net”. Ummm… Aren’t you kind of assuming that I know how to do that? (And lest it seem like I’m picking on Oracle here, I’ve seen this in all types of documentation from other technology companies like Microsoft and Dell to even simple things like power tools.) But when I have choices, let me know what those choices mean to me and why I’d choose one over the other.

While it would be great if all the documentation from technology vendors addressed both problems, I doubt it will happen soon. Until then we have books like Expert Oracle Application Express.

This book is 13 chapters long and each chapter was written by a different author. At first that sounds like a recipe for disaster. But when you realize that each author is a pillar of the APEX community and a subject matter expert on their chapter and (most importantly) each of the chapters is excellent, you suddenly realize you’re holding a treasure in your hands.

Each chapter contains real world experience including the all important ‘and here is why you would want to do this’. If fact chapter 1 by John Scott addresses the above connection to Oracle Application Express issue. Sure there are three ways to do it, but why would I want to use one way or the other? Well, read chapter 1 and you will know.

I spent 14 years at Oracle and taught hundreds of people how to use Oracle Application Express and I thought at least some of the chapters would be a bit of a review for me, but I can truly say that I learned valuable information from each and every chapter.

I highly recommend this book to anyone who is going to be using Oracle Application Express.