Query Management Pack Acess from OMR in Enterprise Manager 13c

Like most of Oracle’s products, Enterprise Manager comes with options that are enabled by default, but licensed when used. In order to prevent these options from being used and to avoid having to pay the corresponding license fee, your company may ask you to list the status of these options on a regular basis.

On Oracle Enterprise Manager, these options are called “Management Packs” :

  • Oracle Cloud Management Pack for Oracle Database
  • Oracle Cloud Management Pack for Oracle Fusion Middleware
  • Application Replay Pack
  • Management Pack for Oracle Coherence
  • Database Diagnostics Pack
  • Oracle Database Lifecycle Management Pack
  • Oracle Data Masking and Subsetting Pack
  • Database Tuning Pack
  • Configuration Management Pack for Applications
  • WLS Management Pack EE

Recently, my client asked me to automate the collection of the status of these management packs. The information is easily retrievable from the Enterprise Manager console (Setup=>Management Packs=>Management Pack Access), but there is no possibility to export the list to Microsoft Excel for example, which is not practical to include in a reporting.

After some research, I developed a query that extracts this information from the OMR database in CSV format.

Continue reading “Query Management Pack Acess from OMR in Enterprise Manager 13c”

Force metric collection in Oracle Enterprise Manager

When working on the implementation of monitoring via Oracle Enterprise Manager, it is sometimes necessary to perform several tests with different thresholds in order to refine alerting, or simply to verify that the monitoring is working properly.

The main problem is that you have to wait until the collection is done to see the result. Since most metrics have a “Collection Schedule” of more than 5 minutes, this can quickly become a waste of time.

To avoid this wait, it is possible to force the collection of a particular metric for a target directly from the EM agent.

Continue reading “Force metric collection in Oracle Enterprise Manager”

Error “platform=${platform/\)/%29}: bad substitution” when installing an Enterprise Manager Agent with AgentPull method on AIX

Today, I have been asked to deploy several Oracle Enterprise Manager agents on AIX 7.1 servers.
For this type of request, I have a preference for the “AgentPull” method when I don’t have a suitable Gold Image available.
Unfortunately, it seems that the “AgentPull” script does not work properly on AIX machines because when executing it, I got the following error: “platform=${platform/)/%29}: bad substitution“.

Continue reading “Error “platform=${platform/\)/%29}: bad substitution” when installing an Enterprise Manager Agent with AgentPull method on AIX”

How “Oracle Flashback Query” can save you from performing a full database restore or a TSPITR

Recently, I have been contacted several times by developers following manipulation errors that led to unwanted deletions of rows in a table on Oracle database. This can unfortunately happen frequently, especially on test or development environments.

The first thing that comes to mind is to restore a full backup of the database or perform a restore of the tablespace where the table is located (TSPITR) to retrieve the deleted rows. But there may be another faster solution if you do it quickly: using “Oracle Flasback Query“.

This feature can also be used to compare the content of a table with its content in the past, see the rows inserted/deleted/updated since a certain time,…

Continue reading “How “Oracle Flashback Query” can save you from performing a full database restore or a TSPITR”

Avoid TNS-00584 errors on listener restart

If you use the “TCP.VALIDNODE_CHECKING“, “TCP.INVITED_NODES” or “TCP.EXCLUDED_NODES” parameters in your listener’s sqlnet.ora file, you may have already encountered the following error when starting or restarting your listener:

TNS-12560: TNS:protocol adapter error
TNS-00584: Valid node checking configuration error

The problem is easy to fix when you have only a few hostnames referenced, but when the list is long, finding the server that caused the error can be much more time consuming.

Continue reading “Avoid TNS-00584 errors on listener restart”

Simulate a where clause on a “long” type column from SQLPlus

As a DBA you sometimes have to take time to look for tricks to accomplish tasks that seem simple at first glance. A few days ago, I was asked to identify tables that had sequences prefixed by the schema name as a default value in the columns. You may think: it’s an easy task, just filter on the “data_default” column of the “dba_tab_columns” view, but unfortunately it’s not that simple using SQLPlus. The “data_default” column is in “longdatatype, so you cannot include it directly in the “where” clause of a query.

Continue reading “Simulate a where clause on a “long” type column from SQLPlus”

Install EM13c agent and add targets using the Linux command line only

A few days ago, I was asked to find a way to automate the addition of newly created Linux virtual machines and databases in our EM13c console. Of course, no action should be performed via the EM web interface!

For the first part (installing the EM13c agent on newly created virtual machines), it’s quite simple, because Oracle gives you many methods (for example, “agent pull” method), in order to carry out this task. But the second part seemed more delicate according to the documentation and my constraints: everything must be done on the virtual machine. I am not allowed to connect to the EM server using SSH.

Fortunately, there is a simple solution that only requires a few extra lines in your shell script!

Continue reading “Install EM13c agent and add targets using the Linux command line only”

Recovering from loss of all control files

“Sometimes shit happens”. That’s what I thought when I realized that I had lost all the control files of one of my test databases. Of course, I had no backup because “it’s just a test database”…

Fortunately, I only lost my control files but no datafiles or redo log files. This is a very important point because if you are in this situation, all is not lost!

So today, I will show you how you can recover your Oracle database after the loss of all control files.

Continue reading “Recovering from loss of all control files”