Oracle Tidbits – October 2017 #oratidbit

Oracle *daily* TidBits” (#oratidbit) published on Facebook, Twitter, and Google+ during weekdays in October 2017. You will also see these tidbits, one tidbit at a time, for each page refresh on the right side of this blog as well… Hope you find these helpful to learn something new or to remind you of its existence and use.

#oratidbit By default, the database retains optimizer statistics for 31 days. You can configure the retention period using the DBMS_STATS.ALTER_STATS_HISTORY_RETENTION procedure.
#oratidbit DBMS_STATS.REPORT_STATS_OPERATIONS generates a report of all statistics operations that occurred between two points in time. DBMS_STATS.REPORT_SINGLE_STATS_OPERATION generates a report of the specified operation.
#oratidbit #db12cR2 The terms ‘Patchset’, ‘Patchset Update’, and ‘Database Bundle Patch’ will no longer be meaningful for Oracle DB 12.2 software. RU (Release Update) and RUR (Release Update Revisions) replaces Patchset Update (PSU) strategy.
#oratidbit #db12cR2 New releases will be annual and the version will be the last two digits of the release year. The release originally planned as 12.2.0.2 will be release 18, and the release originally planned as 12.2.0.3 will be release 19.
#oratidbit #11gR2 11.2.0.4 Extended Support fee waived until Dec 2018. #12cR1 12.1.0.2 Extended Support fee waived until Jul 2019.
#oratidbit #db12cR2 New view DBA_STATEMENTS describes SQL statements in stored PL/SQL objects. It is now easier to find the stored program using SQL_ID of a statement.
#oratidbit #db12cR2 New view DBA_IDENTIFIERS displays information about the identifiers in all stored objects in the database.
#oratidbit #db12cR2 VALIDATE_CONVERSION function can be used to determine whether a given input value can be converted to the requested data type.
#oratidbit #db12cR2 The partition maintenance operations SPLIT PARTITION and SPLIT SUBPARTITION can be online operations, allowing concurrent DML operations with the ongoing partition maintenance operation.
#oratidbit #db12cR2 Database Configuration Assistant (DBCA) supports the creation of an Oracle Data Guard standby database from an existing primary database using the DBCA command-line interface.
#oratidbit #db12c Run SQL commands in RMAN without preceding the command with the SQL keyword and no need to enclose the SQL command in quotes.
#oratidbit #exadata18c New oedacli command to do various add/remove actions such as a node on a virtual cluster, database home on physical cluster, storage cell, database home, and so on.
#oratitbit #orcldb AWR_PDB_* Views on a CDB root show the AWR data stored on the CDB root, on a PDB show the AWR data stored on that PDB.
#oratidbit #orcldb The CDB_* views can be queried only by users with the SYSDBA system privilege or SELECT ANY DICTIONARY privilege, or SELECT_CATALOG_ROLE role, or by users with direct privileges granted to them.
#oratidbit #oracldb An INVISIBLE column in a table can be used as a partitioning key. A virtual column can be INVISIBLE.
#oratidbit #orcldb The ORAchk download zip file includes Health Check Catalog file ORAchk_Health_Check_Catalog.html. Catalog shows benefit and impact of the check and link to MOS notes.
#oratidbit #orcldb Oracle Health Check Collections Manager is a companion application (APEX) to ORAchk and EXAchk that gives an enterprise-wide view of the health check collection data.
#oratidbit #dbaas use the bkup_api utility to perform on-demand backups and to change how automatic backups are configured on Oracle Database Cloud Service.
#oratidbit #dbaas use the orec subcommand of the dbaascli utility to restore from backups on Oracle Database Cloud Service.
#oratidbit #dbaas use the dbpatchm subcommand of the dbaascli utility to apply patches on Oracle Database Cloud Service.
#oratidbit #dbaas use the oracle-dbcs-cli utility on your Linux computer to connect to Oracle Cloud and perform a variety of life-cycle and administration operations on Oracle Database Cloud Service deployments.

ODC Appreciation Day: Two Cool 12c Security Features #ThanksODC #ThanksOTN

There are quite a lot of new features in the 12c database that I like and have discussed and talked about them at various events. On this #ThanksODC day, I would like to take the opportunity to thank Oracle Technology Network (or Oracle Developer Community) and Oracle ACE Program for all the support they provide to the DBA and Developer community to share and gain knowledge.

Two simple addition to the 12c database makes my life much easier on the security front. The requirement was to lock the user accounts that are not logged into the database for consecutive 60 days.

1.  Last Login Time 

In releases prior to Oracle Database 12c 12.1 to find out when a user last successfully logged into the database, we need to enable session auditing, which has some overhead and the DBA needs to set up routines to clean the audit table, etc. In 11g database, I had to enable session auditing (keep the session audit records for at least 61 days) and write a SQL querying DBA_USERS and DBA_AUDIT_SESSION to list out all the active users who did not use the database for 60 days.

In 12.1, Oracle automatically registers the successful login time in SYS.USER$ table and is visible in DBA_USERS. The LAST_LOGIN column of DBA_USERS shows the last login time of the user in the database. In 12.1 database, my requirement is met by writing a simple SQL against DBA_USERS using the LAST_LOGIN column! No auditing required. The result is used to build dynamic SQL to lock each account using ALTER USER ACCOUNT LOCK statement (similar to 11g).

BTW, have you noticed, when you login to the database using SQL*Plus, you will see the last login time displayed as well.

2.  Inactive Account Lock

My requirement got completely automated in 12.2 database. Oracle introduced the INACTIVE_ACCOUNT_TIME parameter for user profiles. The INACTIVE_ACCOUNT_TIME profile parameter locks a user account that has not logged in to the database instance in a specified number of days. The default value for INACTIVE_ACCOUNT_TIME is 35. The minimum setting is 15 and the maximum is 24855.

Thanks, Oracle!

#ThanksOTN

#ThanksODC

And thank you, @OracleBase, for doing the appreciation day again!