Preventing License Violation with CHOPT

Hi all,
So, in past weeks I’ve been publishing some material on how to prevent Licensing violations. Check below for my posts on last weeks:

Cool, but what about RAT, OLAP, Data Mining and Partitioning?

Well, we can use the chopt tool to disable the unlicensed options in the binaries. Check below:
Note: In a RAC with non shared Oracle homes, this has to be executed on every node.

For 12.1:

  1. Oracle Data Mining RDBMS Files (dm)
  2. Oracle OLAP (olap)
  3. Oracle Partitioning (partitioning)
  4. Oracle Real Application Testing (rat)

For 12.2:

  1. Oracle Advanced Analytics (oaa)
  2. Oracle OLAP (olap)
  3. Oracle Partitioning (partitioning)
  4. Oracle Real Application Testing (rat)

1. Shutdown all Oracle services running out of the Oracle RDBMS home (srvctl, SQL*Plus or lsnrctl as required)

srvctl stop home -oraclehome Oracle_home -statefile state_file

2 Disable the options as required

cd $ORACLE_HOME/bin
chopt disable dm # If Oracle version is 12.1
chopt disable oaa # If Oracle version is 12.2
chopt disable olap
chopt disable partitioning
chopt disable rat

3. Startup all Oracle services running out of the Oracle RDBMS home using either

srvctl, SQL*Plus or lsnrctl as required
srvctl start home -oraclehome Oracle_home -statefile state_file


EXTRA)
 It’s even easier for a 18c databases. The execution takes only a few seconds to complete.

[oracle@greporasrv ~]$ chopt disable oaa dm # If Oracle version is 18c

Writing to /opt/oracle/product/18c/dbhome_1/install/disable_oaa_2019-05-13_34-18-06PM.log...
/usr/bin/make -f /u01/oracle/product/18c/dbhome_1/rdbms/lib/ins_rdbms.mk dm_off ORACLE_HOME=/u01/oracle/product/18c/dbhome_1
/usr/bin/make -f /u01/oracle/product/18c/dbhome_1/rdbms/lib/ins_rdbms.mk ioracle ORACLE_HOME=/u01/oracle/product/18c/dbhome_1

How to Prevent Violate Active Dataguard License?

Hey folks,
As you all liked last week posts about preventing to violate Oracle Licensing, so let’s go another one, a quick one this time: Active Dataguard.

Matheus, is there a way to prevent using the Active Dataguard Option?

Well, there is. If you consider that this is basically a regular Dataguard that is opened in Read Only mode, here you go:

srvctl modify database -d GREPORADB_STBY -s MOUNT

By preventing the database open, we are preventing it to violate the Active Dataguard feature.

Quick reference on this:
– Which are Supported Methods to Prevent Active Data Guard Usage When License is Not Available? (Doc ID 2269239.1)

Hope it helps!

How to Disable AWR and Prevent Violating Diagnostic Tuning Pack License

Hey folks,
Seems you like it, so on same line that the post from last week: Let’s say you want to prevent yourself to violate Oracle licensing of your Enterprise Edition database… But as you know, Oracle is tricky sometimes. For example, all Diagnostic Pack features are enabled by default, you just need a JR DBA to go there and used for you to be stuck.

By the way, here is the first mistake: No, AWR is not part of Enterprise Edition, it also requires Diagnostic Pack!

Ok Matheus, so how to prevent it? Here it goes:

Disable AWR with Oracle provided script

Use the script dbmsnoawr.plb provided in MOS Doc ID 1909073.1 to disable AWR once the database has been created.

To install, run the package as SYS from SQL*Plus:
SQL> @dbmsnoawr.plb

To execute the package, use the command:
SQL> begin dbms_awr.disable_awr(); end;

Modify the CONTROL_MANAGEMENT_PACK_ACCESS init parameter to NONE and disable the AWR related advisors.

Disable AWR Related Options

ALTER SYSTEM SET control_management_pack_access=NONE;

SQL> select client_name, operation_name, status from dba_autotask_operation;

CLIENT_NAME                                                      OPERATION_NAME                                                   STATUS 
---------------------------------------------------------------- ---------------------------------------------------------------- --------
auto optimizer stats collection                                  auto optimizer stats job                                         ENABLED
auto space advisor                                               auto space advisor job                                           ENABLED
sql tuning advisor                                               automatic sql tuning task                                        ENABLED


BEGIN
  dbms_auto_task_admin.disable(
    client_name => 'sql tuning advisor',
    operation   => NULL,
    window_name => NULL);

  dbms_auto_task_admin.disable(
    client_name => 'auto space advisor',
    operation   => NULL,
    window_name => NULL);

END;
/

SQL> select client_name, operation_name, status from dba_autotask_operation;

CLIENT_NAME                                                      OPERATION_NAME                                                   STATUS 
---------------------------------------------------------------- ---------------------------------------------------------------- --------
auto optimizer stats collection                                  auto optimizer stats job                                         ENABLED
auto space advisor                                               auto space advisor job                                           DISABLED
sql tuning advisor                                               automatic sql tuning task                                        DISABLED

Some reference on it?
– How To Avoid the AWR Usage Without Having Diagnostic Pack License (Doc ID 2276199.1)
– Controlling Diagnostic and Tuning Pack Usage (Doc ID 436386.1)
– Disabling and Uninstalling AWR (Doc ID 1909073.1)

Hope it helps!

Licensing: Remove Options During DB Creation

Hi all,
So, let’s say you want to prevent yourself to violate Oracle licensing of your Enterprise Edition database… What a better moment to do it then when you are creating the database?

During database creation, there are several options that can be opted out. DBCA CLI has the option “-dbOptions” to disable options at will. For example, see below how to disable all the options.

dbca -silent -createDatabase -responseFile /home/oracle/dbca/dbca.rsp -dbOptions IMEDIA:false, CWMLITE:false, SAMPLE_SCHEMA:false, ORACLE_TEXT:false, APEX:false, OMS:false, DV:false, JSERVER:false, SPATIAL:false

If any of the options is required after the database has been created, let’s say you bought the license, you can simply look up on how to install them from Oracle Docs public documentation.

Hope it helps, cheers!

Reduce Exadata Core Count

Ok, so I was preparing for a DC services migration with a client and this would involve resizing the CPU count of Exadatas for better attending those services. This way, one of the steps will require reduce CPU counts in one of the sites to be aligned with the license terms.

Checking for the steps to accomplish that, I found references to change CPU and core count, but always described in the case of increasing allocation. As per 2.7 Increasing the Number of Active Cores on Database Servers. But not so much about reducing, as this seems to be unusual…

Also considering that the planned change would be within the minimum number requirement: 2.1 Restrictions for Capacity-On-Demand on Oracle Exadata Database Machine.

Reviewing on MOS, we found the When Attempting to Change the Number of Cores, Errors With: DBM-10004 – Decreasing the Number of Active Cores is not Supported ( Doc ID 2177634.1 ), pointing to use the clause “FORCE” on “ALTER DBSERVER pendingCoreCount =x” command.

And this worked. I just disabled the iaasMode to play safe. Have a look:

[root@grepora01~]# dbmcli
DBMCLI: Release  - Production on Mon Jan 05 01:10:12 EEST 2019
Copyright (c) 2007, 2014, Oracle.  All rights reserved.
DBMCLI> LIST DBSERVER attributes coreCount
	 36/44
DBMCLI> ALTER DBSERVER pendingCoreCount = 24 force
DBM-10022: At least 26 physical cores need to be active in order to support IaaS.
DBMCLI> ALTER DBSERVER iaasMode = "off"
DBServer exadb01 successfully altered
DBMCLI> ALTER DBSERVER pendingCoreCount = 24 force
DBServer grepora01 successfully altered. Please reboot the system to make the new pendingCoreCount effective.
DBMCLI> LIST DBSERVER attributes pendingCoreCount
24/44

–> Restart the server
After restarting, it should look like:

DBMCLI> LIST DBSERVER attributes coreCount
	 24/44
DBMCLI> LIST DBSERVER attributes pendingCoreCount

Hope this helps!

Oracle Licensing: Weblogic Tip!

Like a complement to yesterday post, about Oracle Database Licensing, today’s post is a little tip to Weblogic licensing evaluating, considering an auditing…

The restricted services can be checked on WebLogic Server Basic – Restricted Primary Services in WebLogic Server.

There is also a py script on Orace Support that can be executed via WLST on Admin Sever. Please take a look on: WebLogic Server Basic License Feature Usage Measurement Script (Doc ID 885587.1)

And it’s all by now! 🙂

Hugs!
Matheus.

Oracle Database Licensing: First Step!

Oracle licensing is always a complex question, right?
I made some search about it today and decided to share, on quick mode. As I usually do. I focused on Database, by the way. 🙂

The first step is to understand Features vs Options vs Packs relation. Oracle documentation is always good for that. I recommend you to spend some time on Database Licensing Information User Manual.

Ok, now the best way to undestand how evaluate my environment is searching on Oracle Support, right?
And it do not disappoint: Database Options/Management Packs Usage Reporting for Oracle Databases 11gR2 and 12c (Doc ID 1317265.1)
In this note you can get a complete and actual script used to evaluate features/options/packs utilization (options_packs_usage_statistics.sql). This is a good way if you are preparing for an auditing…

SOFTWARE-LICENSE-REVIEW-300x199

I made some simple queries to validate/understand results from Oracle Script. So, if you don’t have access to Oracle Support, it might help you:

Get Features usage:

SELECT u1.name,
u1.detected_usages,
u1.currently_used,
u1.version,
u1.description
FROM   dba_feature_usage_statistics u1
WHERE  u1.version = (SELECT MAX(u2.version)
FROM   dba_feature_usage_statistics u2
WHERE  u2.name = u1.name)
AND    u1.dbid = (SELECT dbid FROM v$database)
--WHERE DETECTED_USAGES>0 -- To get used features only
ORDER BY name
/

Get Options usage:

col parameter for a50
select parameter,value from v$option
--where value='TRUE' -- To get used options only
/

Information about Session license limits:

SELECT sessions_max s_max,sessions_warning s_warning,
sessions_current s_current,sessions_highwater s_high,users_max
FROM v$license;

Information about CPU license limits:

select cpu_count_current, cpu_core_count_current,CPU_SOCKET_COUNT_CURRENT,
CPU_COUNT_HIGHWATER,CPU_CORE_COUNT_HIGHWATER,CPU_SOCKET_COUNT_HIGHWATER
FROM v$license;

An interesting point is that you can disable and enable options through the command chopt. But, you must to get database down first. Example to disable partitioning option:

chopt disable partitioning

The complete explanation and examples (including right values to activate/deactivate options) can be found on Oracle Database Postinstallation Tasks – Enabling and Disabling Database Options.

Some time ago I wrote a post about evaluating Database license in all database park through OEM. It remains valid, I recommend you take a look in this post too.

 

KB and other interesting stuffs:
Database Options/Management Packs Usage Reporting for Oracle Databases 11gR2 and 12c (Doc ID 1317265.1)
12c Release 1 Database Licensing Information User Manual
11g Release 1 Database Licensing Information User Manual
Enabling and Disabling Database Options
Excellent and actual presentation by Martin Berger
Article about top license pitfalls. Good to reflection. Written by OMTCO Consulting

Matheus.