Back in 1993, I discovered that I could get paid money for doing fun stuff with computers.
Over the years, I've specialised in Oracle Databses as a developer, a DBA and sometimes, an architect.
It's my evil alter-ego - The Antikyte - who writes a blog about my various technical adventures.
He reckons it's something to do until we finally get introduced into the Marvel Comic Universe.
I currently live in the South-West of England with Deb, my long-suffering wife.
I was going to begin with some extended Brexit metaphor to illustrate the chaos and confusion that can ensue when you first encounter Oracle’s CREATE SCHEMA command.
Fortunately, the Dutch Government saved me the trouble :
Much as I’d like to believe that the Cookie Monster has finally overcome his Sesame Street type casting, I can’t help noticing that the Brexit Monster never seems to in the same room as this guy…
In Oracle, the term “schema” is used interchangeably with the term “user”. Creating a user in Oracle automatically creates a schema of the same name belonging to that user.
The process is so seamless that it’s almost impossible to tell where one begins and the other ends.
You may therefore be somewhat confused the first time you encounter Oracle’s CREATE SCHEMA command…
What with Larry the Downing Street Cat and Palmerston, his counterpart at the Foreign Office, Teddy suspects he knows the real reason for the Country’s current travails.
Here he is, doing his best Boris Johnson impression :
“No wonder Brexit’s a Cat-astrophe !”
In an attempt to distract myself from the prospect of the country being ruined by this feline consipracy, I’ve been playing with my new Raspberry Pi Model 3 B-spec.
At some point, I’m going to want to connect remotely to the Desktop on the Pi. What follows is how I can do this using VNC… Continue reading →
“Proxy Users !” exclaimed Debbie.
“I say, that’s rather harsh don’t you think ?” came the rather startled reply from her boss.
Debbie sighed. They were in the midst of a discussion on the subject of how best to deploy database changes to multiple schemas.
“I meant”, she replied with iron patience, “that we could set up a proxy user to connect as each application owner in turn. That way, we wouldn’t have to grant those CREATE ANY privileges that get auditors so worried”.
“Oh, I see”, said Mike, who didn’t.
Not for the first time, Debbie wondered whether she had been lumbered with a less competent man as her boss simply in order to imbue this post with a semblance of social realism.
“I think”, she said, “that it’s time to move on to the techie bit.”
Debbie is right, as usual…
In order to make a change in Oracle ( or any database for that matter), you need at some point to connect to the database and run some SQL.
This is relatively straightforward if you are using the schema that is – or will be – the owner of the objects you are creating or changing.
However, this may not be possible if the account is identified externally or – in more recent releases – it’s a schema only account.
So, what is the best way to setup and use an account to make such changes in other schemas ?
At this point you may well ask yourself that what – apart from gratuitous puppy pics and cheesy-snack-based puns – is the difference between that post and this.
Well, if you’re a long-time user of 11gXE and you’re looking to upgrade then you will find 18cXE a rather different proposition.
The introduction of Multitenant databases aside, 18cXE differs greatly from it’s predecessor in terms of it’s functional scope.
Wheras 11gXE was – broadly speaking – functionally equivalent to Oracle Standard Edition, the approach for 18cXE has been to shoe-horn in as many Enterprise Edition features as possible.
No doubt, this will leave you anxious to play with the new version. However, there are some “home comforts” that were present in the old version that you’ll need to configure yourself this time around.
What I’m going to go through is :
Installing 18cXE on a Red Hat compatible distro (CentOS7)
Connecting to the database and exploring the containers
Checking the TNS Listener
Manual and Automatic Startup and Shutdown of the database and listener
Setting and persisting the Oracle environment variables
Accessing Enterprise Manager Express
Installing the HR demo application in a Pluggable Database (PDB)
Configuring the firewall to allow remote access to Oracle
The steps documented here have been performed on a vanilla installation of CentOS7. As such, they should work pretty much unaltered for other Red Hat based distros based on or similar to Red Hat Enterprise Linux (RHEL) version 7.
Debbie felt a shiver run down her spine. To be fair, that wasn’t much of a surprise since Lapland at this time of the year does tend to be a little chilly.
However, it wasn’t the weather that was the cause of her discomfort. Someone high up in the IT Department of her employer, The National Elf ( aka Santa’s Grotto) had decided that Continuous Integration was the way to go and had decreed that it should be used forthwith across all projects and technologies in the Company.
This included the application that Debbie was responsible for.
Written around 15 years ago, this Stock Control Application had already survived one major database upgrade but was now resolutely “stuck” on Oracle 11g.
The thing about so many modern software development techniques is that they were based on the premise that code was file based. Of course, this was also true ( or at least, true enough) for some database objects, but tables were a little different.
You couldn’t simply “replace” a table like you could any other program as doing so would destroy any data in that table. For this reason, any changes required to tables for a mature application such as this would be applied by means of DDL ALTER statements.
Of course, there are tools around for this sort of thing. Liquibase, FlexDeploy – these were just two of the tools that Debbie had no chance of getting approval to use in the face of a bureaucracy that made the Vogon Civil Service look like it was following Extreme Programming.
If she was going to get her changes through by her Christmas Eve deadline, she would have to get creative…
I’m currently indulging in the pastime that’s sweeping the country – trying not to think about Brexit.
It’s a craze that’s even spread as far our political elite. In their case, it manifests itself in slightly different ways.
On the one hand, there are those who are refusing to accept any solution offered to maintain a “soft” border on the island of Ireland. As far as I can tell, they haven’t managed to offer any practical solution that they would accept as that would involve thinking about Brexit.
On the other hand there are those who are pushing for a new referendum because, apparently, some politicians lied when campaigning. Maybe someone was “Putin” ’em up to it ?
For my part, as I don’t quite have the space for a bunker at the bottom of my garden, I’ve decided to hide out in to a world of make-believe…well Virtual Machines at any rate.
I want to setup a CentOS Virtual Machine (VM) that I can then use as to clone environments to host various software stacks that I may want to play with.
I’d like to be able to connect to these VMs directly from my host OS, just like a real-world server. However, I’d also like to be able to connect the VM to the outside world occasionally so I can run package updates via yum.
The specific steps I’m going to go through are :
Install CentOS7 into a Virtualbox VM
Setup Host Only Network in VirtualBox
Create a Network Interface on the Guest to use the Host Only Network
Cute and fluffy he may be, but he’s got to earn his keep. He can start making himself useful by helping me with this post.
It begins one Friday afternoon when an urgent request lands on my desk with a large splat.
The requirement is that some csv files be uploaded into the Oracle 11g Datbasae serving the UAT environment to facilitate some testing.
There are around 20 files, each with a slightly different set of attributes.
The files are currently sitting on the on the Red Hat Linux Server hosting the database.
I have sufficient OS permissions on the server to move them to a directory that has a corresponding database object in the UAT instance.
Nevertheless, the thought of having to knock out 20-odd external tables to read these files might leave me feeling a bit like this…
Fortunately, a certain Lee E. McMahon had the foresight to predict the potential risk to my weekend and wrote the Stream Editor (sed) program…