Other people are your greatest resources! They give birth to you; they feed you, dress you, provide you with money, make you laugh and cry. They comfort you, heal you, invest your money, service your car and bury you. We can’t live without them. We can’t even die without them.

We were working on a monitoring script using HIGH_VLAUES in CDB_TAB_PARTITIONS and found the HIGH_VALUE column is missing in the CDB_TAB_PARTITIONS while the column is existing in DBA_TAB_PARTITIONS. Couldn’t find any reference in Oracle documentation (may be need a better search!) Why the column is missing in CDA view. Looking at the CDB_TAB_PARTITIONS view definition, oracle is using CONTAINERS clause to fetch all partition information, except the column HIGH_VALUE

Yes, column C3, which is LONG data type is missing! That means you can’t really access the LONG data type using CONTAINERS clause which is not a good thing. I haven’t seen any workaround or fix for this yet, please comment if you find any!
Oracle version

Every organization needs to change for its survival and keep its competitiveness. While change is not an easy procedure to complete, it can affect many lives both in positively and negatively. The change owners may take intentionally or unintentionally wrong decisions which can impact the stakeholders. However, each individual should follow the same rules to come out of the change whether the individual it is affected positively or negatively. Only the emotions changes and that will be temporary phenomena.

Each individual is going through the changes every day of his / her life both in personal and professional life. Without change life is meaningless. One should compete to himself and do better next time when he faces a change. Success is a battle between YOU and YOURSELF only. So, how do you pass through a change? There are multiple stages –

Phase 1: The Announcement: Change will come in many ways – I will classify them into two broad categories though not completely complementary. They are PLANNED and UNPLANNED. Organizational changes are mostly planned ones, however there are situations we hit unplanned ones as well. All the incidents, like death of a near and dear one, is the best example for an unplanned change. Depending on the type of the change, it will trigger a verity of emotions – Happy, Sad, Disgust, Anger, Fear, Surprise etc. None of these feelings are bad or evil. Categorizing these emotions in to positive or negative itself is not correct. They are just reaction to change that is happening currently. Apply your human wisdom to control your emotions and accept the change.

Phase 2: Ending Phase: This is the second phase of the change where the impact of the announcement is over and recover from the emotions. Now you know that the change is undoable and you must face it. In this phase, the most important action is to accept the change which is undergoing and level your emotions to the reality. This is applicable for both happy and frustrating impacted people. This is the time to end mourning about loses and stop rejoicing on your gains. Accept the change and move to the next phase.

It is important that, you must experience the Ending phase and move to the next phase. Some of us are not come out of the emotions and tied to it for a long time. This prolonged phase -1 may harm the individuals and may lead them to both professional and personal challenges. If you feel that the ending phase is not happening, the emotions are still ruling you, time to consult an experienced therapist and seek help, before it destroy you. Much prolonged Phase-1 may lead to depression, revenge, crime and even suicide tendencies. The fast you have the ending phase, the better it will be. Remember one thing – that one announcement or an incident is not the end of the world!

Phase 2 – Transition plan: Every change challenges you with the new set of hurdles. This is a new beginning of a painful end. You must ask yourself “Where are you?”, “Where you want to be?” and “How do you get there?” to prepare the transition plans. You may use a different template depends on the type of challenges you have to manage. It can be personal, profession or social. Apply you earlier experience and outcome of the ending phase thoughts will help you build a unbiased transition plan. I use the term “Unbiased” to mention the importance of having a transition plan to achieve your goals and not to hurt those who caused the change. They are the past and irrelevant for your future goals and objectives.

Phase 4: BAU (Business As Usual): You are back on track and waiting for the next change and again go through the same process. Not every change can bring success and it can bring lot learning and that lead you to ultimate success. All the best!

In a oracle data guard environment Log Network Server (LNS) process transports the redo from the primary to the standby site. The behavior of LNS process is different from SYNC and ASYNC mode replication. In ASYNC mode transport, LNS read the redo from log buffer and hand over it to the RFS process in the target site. It is not necessary the redo is always available in the buffer cache. If there is not enough buffer to hold the rate of redo generation, LNS transport lags behind, then read from the Online Redo File causing physical I/O, reducing overall redo transport performance. So, it is important to ensure that, database is configured with enough log buffers so that redo will be available in the log buffer. In certain cases, we may need to analyze network performance and make sure the band width supporting the redo generation rate.
Oracle externalized buffer hit ratios through the view x$logbuf_readhist and the important columns are –
BUFSIZE – Actual and estimated buffer sizes. CURRENT row is the configured log buffer row
RDMEMBLKS – Actual and estimated reads from the log buffer
RDDISKBLKS – Actual and estimated reads from the Online Redo Log files
HITRATE – Memory hit ratio for the corresponding buffer size. CURRENT (BUFINFO) is the line for present log buffer. Ratio is calculated by RDMEMBLKS/( RDMEMBLKS+ RDDISKBLKS). It is important that we keep the hit ratios close to 100% in a healthy performing data guard environment.

In the above case LOG_BUFFER is configured to 81920K and the corresponding hit ratio is 84% showing possible LNS degrade in redo transport. In this case, upgrading LOG_BUFFER to a higher value or make sure there is no network bottleneck between primary and standby. This may improve over all dataguard syncing performance.

Oracle 12c Unified Auditing is a brand new feature in the latest Oracle version which consolidates database level auditing records into a single location. DBAs can access the audit information from the view UNIFIED_AUDIT_TRAIL for all kind audit records, and they are

Any database user who got ADUIT_ADMIN and AUDIT_VIEWER roles can administer and view the audit records respectively. Oracle separated the AUDITOR role from the traditional DBA/ SYSDBA roles so that and independent database auditor can operate outside the DBA group. To harden the security, no DBA or SYSDBA users can UPDATE or DELETE the audit records outside DBMS_AUDIT_MGMT.

Audit records are physically stored in AUDSYS schema along with other supporting indexes and BLOBS.

You can see a table CLI_SWP$7e10621c$1$1 and the audit records are writing to this table and UNIFIED_AUDIT_TRAIL must be a view built on this table – just an assumption as the view is getting the records from the audit base table. Let us confirm that assumption by checking the execution plan for UNIFIED_AUDIT_TRAIL.

That is bit interesting – the base table for UNIFIED_AUDIT_TRAIL is not the actual audit table in the SYSAUD schema, rather the records are coming from an X$ table known as X$UNIFIED_AUDIT_TRAIL and that is confusing. Moreover, the x$ fixed table is owned by SYS user, not in SYSAUD schema! You can see the fixed table X$UNIFIED_AUDIT_TRAIL existing in the V$FIXED_TABLE view.

So, there is some relation existing between the fixed table X$UNIFIED_AUDIT_TRAIL and CLI_SWP$7e10621c$1$1, the physical table where the actual data is existing. Moreover, every X$ table is a non-physical volatile table interfacing a memory structure and not really suitable to store the audit records. Trace 10046 should tell us more inside stories and relation between X$UNIFIED_AUDIT_TRAIL and CLI_SWP$7e10621c$1$1.

From the 10046 tracing came to a conclusion – the reading the audit records happening in two phases.

I just got 158836 audit records and it took 76.35 seconds! Where the time is spent? Look at the recursive calls. I believe, these are DB calls for populating the fixed table, X$UNIFIED_AUDIT_TRAIL from the SYSAUD physical table where the consolidated audit records are located. Compared to traditional tables, your audit table access will be much slow.

Currently, I have only few days of STANDARD audit records for a single PDB. It will be interesting to see, what will be response time and memory usage if I am hosting few years of audit records for security compliance and for a number of PDBs. One needs to do test the real impact before enabling the unified auditing and retaining the records for a longer period.

Note: These are my own opinions and research and can be wrong. Do your research before implementing and I will not accept any liabilities or damages.

Oracle PARTIAL INDEXES – a new feature in Oracle 12c, initial impression was really good, but the implementation is quite poor. With this feature, you can define INDEXING OFF for a partition so that any index with PARTIAL clause will skip this partition while creating the index. The advantage is you can selectively create indexes on partitions. And for a global index or a global partitioned index, the rows from the INDEXING OFF partitions will be skipped while creating the index.

You need to create the partitions with INDEXING OFF while creating the table to opt PARTIAL INDEXES

My expectation was it will create two indexes on column P4, but Oracle created UNUSABLE indexes on rest of the columns where INDEXING is OFF. Not really impressed on the fact that, I have to keep UNUSABLES indexes in my production databases, just because of I choose the new feature, PARTIAL indexes! This is challenge to identify the difference between real UNUSABLE indexes and UNUSABLE indexes due to PARTIAL indexes. Well, Oracle should have avoided creating these unwanted objects if this is a serious implementation.

Now I re-built all the UNUSABLE indexes – just want to know how Oracle implemented this feature – it is going to stop me while re-building the indexes, because the option INDEXING OFF?

Since the index partitions are UNUSABLE, I was very curious to know what will happen if I set SKIP_UNUSABLE_INDEXES to FALSE, while thedefault value is TRUE.

SQL&gt; alter session set skip_unusable_indexes =false;
Session altered.
SQL&gt; insert into test select rownum n,'B' from all_objects where rownum &amp;lt; 10;
insert into test select rownum n,'B' from all_objects where rownum &amp;lt; 10
*
ERROR at line 1:
ORA-01502: index 'USR1.I_C2' or partition of such index is in unusable state

As expected the PARTIAL indexes started failing with the error “ORA-01502: index ‘USR1.I_C2’ or partition of such index is in unusable state”! So, PARTIAL indexes is just a UNUSABLE LOCAL index which can implement in 11g as well!

However, INDEXING OFF got some good effect on GLOBAL indexes – partitioned or non-partitioned. Global indexes, indeed skip the rows from the INDEXING OFF partitions.

The first index with FULL option created an index with size 7340032 bytes while the second option with PARTIAL index created with 2097152 bytes. That is cool – Oracle is able to skip the rows from INDEXING OFF partitions while creating the global index!

Recently we had a tablespace space run out and ended up in an application failure. I have questioned my DBA and he just plainly blamed the application team members who loaded large number records without a prior notice. A convincing answer, but you can’t really fool Oracle.

Oracle introduced a new DBA_TABLESPACE_USAGE_METRICS view from 10g onwards to report the space usage with in a tablespace. I created a new tablespace and immediately space usage was reported in the view.

Both the USED_SPACE and TABLESPACE_SIZE are reported in number of database blocks. A non-auto extensible data file reported 500MB. I have made the data file auto extensible and the size of the tablespace grown to MAXSIZE of the data file.

Now this view is captured as part of the AWR report in the history tables as DBA_HIST_TBSPC_SPACE_USAGE. So, it is easy for a DBA to report the growth of a tablespace with in the retention period. Even though my DBA said, the failure was because of a sudden data growth, I know where to see the data growth. And my report was –

Oracle caches the data blocks in buffer cache in various modes depends on the block usage. As per the Oracle documentation it can CR (Consistent mode – reads), XCUR (Current mode – updates), FREE etc. I understand and other heard saying – whenever a block READs into memory will be in CR mode while if the block is fetching for UPDATE it will be in XCUR mode so that sessions can apply the transactions under the exclusive lock mode. And the working set of the buffer cache is divided into multiple working set and I believe each working set has a cold and hot region based on the touch count algorithm. Arming with these details, I did the following test and the results were little confusing – not just little!

When I read the 6th time, the count of CR blocks did not increase and that was expected. At any point in time, a single block can have maximum of 7 versions in the buffer cache. Any subsequent reads will use one of the existing CR block to build the new CR block. The more interesting finding was, the touch count was never increased during a CR block build thus the access was unaccounted. Each time Oracle build a new CR block and that block was send to the user, hence the original XCUR block touch count was not increased. I am not sure why Oracle showing this discrimination to XCUR blocks which is having an active transaction.

Then I did execute the READ from the session where the transaction was active – and that increased the touch count again – to 8!

I will not give much importance to reduction of 1 CR block as the temporary CR blocks can re-use any time.

So, my assumptions are –

When Oracle reads a block in to buffer cache first time it will be in XCUR mode not in CR mode

I consider this XCUR list as Master List of blocks and all the updates will go the master XCUR list only. Master List can be read directly if no transactions are active.

Under no transactions – any READ will reuse the XCUR block and increase the touch count

Too many consistent reads leads to CBC Latch waits as everyone will be contending on the XCUR block list

A transaction will modify the XCUR block and will increase the touch count

Any other session reading a XCUR block will create fresh CR block and rollback the transactions. There are can be maximum of 7 versions of a block can exist. During the CR block access, the touch count will not increase

Transaction session read directly from the XCUR block without creating a CR block and the touch count will increase.