In this playground, we will show you how easy it is to use the standard available facts to see all there is to know about your database. We will also show you how you can make your own facts based on content that is available in records in your database.
You can use all of these facts in Puppet manifests describing your Oracle database systems. These facts are also available on the
PuppetDB, and you can use them to report on all of your systems.
The playground system contains a pre-installed puppet agent. There is no server available, so to run Puppet, you have to use the
puppet apply command. The playground text will guide you with this.
On the playground system, you will find an Oracle database with the sid DB01.
Under this text, you see the working area. You can inspect the system and issue any command you like in the terminal. In the editor window, you can see the Puppet production environment. You can edit anything you wish. The documentation tab shows the documentation for the
This system will self destruct in about one hour. So please don’t use it to build or create anything you wish to keep!
For many operations, it is essential to know all about your Oracle home. To make it easy to use this information, we have a fact that you can use in all of your Oracle related Puppet code. It is called
Here is a way to see the content of this fact:
Here is the output:
As you can see, all the information you might need in a Puppet run:
We use these facts for example, to determine if all required patches are installed and to see if the required version of Opatch is available. But you are free to use these facts in any way that helps you.
Other basic Oracle fact
Besides information about your Oracle home, you also need to know about the settings of your database.
The version of Oracle your database is running
And here is the output you might get:
Determine the kind of database you are running
Besides the versio there is more information you need to determine the kind of atabase you are running. To see those facts use this command:
This will give you an overview of all facts that tell you what kind of database you are running at the current node. Here is an example output:
Having these facts is very beneficial. But the way they are structured is pretty tough to use them. That’s why we created some helper functions.
Go to the editor and create a new file
Now run this Puppet manifest
Now let’s run this Puppet manifest and see what it will tell us”
This is the output you will see:
Create your own database facts
Besides the standard supplied facts, we also provide an API to make your own facts based on records in the database.
Create the fact
In the editor, go to the directory
Add this content to that file:
inspect the fact
To check if everything works, enter the next command:
This should show you this:
Let’s dissect this
So to define a fact base upon a query in your database, you can use
Do you like what you see here and want to test this on your own infrastructure? No problem. You can sign up for a free trial.
If you have any questions, don’t hesitate to contact us.