“Successful discovery of 0 disks” during Oracle cluster launch

by Brian Fitzgerald

Introduction

This article covers “Successful discovery of 0 disks” errors during grid launch. I know of three fixes.

System

Installing Oracle Clusterware 19c on top of ASMLIB 3.0 on Red Hat Linux.

Installation notes

In this article, the grid owner is oracle, group dba. The ASM disks are named ORA_ASM_GRID1_01, and so on, and you can refer to them that way:

/dev/disk/by-label/ORA_ASM_GRID1_01

and so on.

The error

After running gridSetup.sh as the grid owner, the DBA runs root.sh. On the first node, the error happens in step 16 of 19: ‘InitConfig’. On the second node, the failure appears at step 17 of 19: ‘StartCluster’. root.sh runs for 10 minutes and fails.

The root.sh refers to a log such as $ORACLE_HOME/install/root_$(hostname)$(date…).log, which begins:

Performing root user operation.

On the first node, the error is:

[FATAL] [DBT-30002] Disk group GRID1 creation failed.
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification 'ORCL:ORA_ASM_GRID1_01' matches no disks
ORA-15031: disk specification 'ORCL:ORA_ASM_GRID1_02' matches no disks
ORA-15031: disk specification 'ORCL:ORA_ASM_GRID1_03' matches no disks

And on the second, you will find:

CRS-1705: Found 0 configured voting files but 1 voting files are required, terminating to ensure data integrity; details at (:CSSNM00065:) in /u01/app/oracle/diag/crs/<hostname>/crs/trace/ocssd.trc
CRS-2883: Resource 'ora.cssd' failed during Clusterware stack start.

ocssd.trc shows this message repeating for 10 minutes:

2026-07-15 10:23:54.351 : CSSD:1956423232: [ INFO] clssnmvDiskVerify: Successful discovery of 0 disks
2026-07-15 10:23:54.351 : CSSD:1956423232: [ INFO] clssnmCompleteInitVFDiscovery: Completing initial voting file discovery
2026-07-15 10:23:54.351 : CSSD:1956423232: [ INFO] clssnmvFindInitialConfigs: No voting files found
2026-07-15 10:23:54.353 : CSSD:1956423232: [ INFO] (:CSSNM00070:)clssnmCompleteInitVFDiscovery: Voting file not found. Retrying discovery in 15 seconds

Cause

The error appears if you have disabled asmlib filtering. Linux tends to change disk device ownership to root. Disabling filtering breaks a handler that tends to change disk device ownership back to oracle.

Oracle ships a per-event ownership handler (/usr/lib/oracleasm/iofilter-asm-disk-addmap, invoked by udev). When filtering is disabled, the handler exits before reaching its chown. With no rule asserting ownership, udev’s defaults set devices to root:disk whenever device nodes are reprocessed or recreated.

1. Workaround while root.sh is running

While root.sh is running, you have plenty of time to correct the underlying issue. Run:

ls -Ll /dev/disk/by-label/ORA_ASM_GRID1_0?

If you see root ownership

brw-rw----. 1 root   disk 8, 193 Jul 26 12:52 /dev/disk/by-label/ORA_ASM_GRID1_01

and so on, then simply run

chown oracle:dba /dev/disk/by-label/ORA_ASM_GRID1_0?

root.sh will resume and run to successful completion. Finish the gridSetup.sh installation. Chances are, the system will give you no trouble after that, even if you reboot the cluster.

2. Enable filtering

crsctl stop crs
or
crsctl stop has
oracleasm configure -f y
Configuration changes only come into effect after the 
Oracle ASM system service is restarted. 
Please run 'systemctl restart oracleasm' after making changes.
systemctl restart oracleasm
crsctl start crs
or
crsctl start has

Caution: my own testing shows unless you restart ASM, filtering will not protect your data as it is designed to.

3. udev rule

If you have decided not to implement filtering, then install this file at /etc/udev/rules.d/99-oracle-asm.rules. That way, whenever something else changes device ownership to root, the rule will change it back. “Something else” is any non-Oracle tool, such as partprobe.

# Brian Fitzgerald
# 2026-07-22

# RHEL 9 / ASMLIB 3 / grid 19c workaround for gridSetup.sh, root.sh
# failing on node a, step 16 'InitConfig', and on node b, step 17, 'StartCluster'.
# ocssd.trc was showing "clssnmvDiskVerify: Successful discovery of 0 disks"
#
# The rule fires whenever a disk is discovered, or is written to and closed.
#
# Firing condition:
# 1. block device
# 2. labeled with oracleasm createdisk

# Action:
# 1. Change the ownership to oracle:dba
# 2. Change the mode to 0660

SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="oracleasm", OWNER="oracle", GROUP="dba", MODE="0660"

Run:

udevadm control --reload-rules
udevadm trigger --subsystem-match=block

Conclusion

The launch failure is a configuration interaction, and any of the three fixes above closes it permanently.

EC2 maximum number of volumes

Introduction

The documented AWS EC2 EBS volume attachment limit is 27. The attachment limit affects the maximum number of Oracle ASM disks.

EC2 volume limit

Amazon AWS documents a 27-volume attachment limit. I have found that a t2 type creation attempt with 28 EBS volumes will abort.

error.png

Attempting to create an m5 (Nitro)  with 28 or more volumes will hang.

creating

The attachment limit is 28, including network interfaces, volumes, and instance store volumes. EC2 instances with one network interface can have up to 27 volumes attached.

EC2 instances with more than 27 volumes

I am aware of t2 EC2 systems with as many as 44 volumes attached. I have no information about how this was done, and what the customer’s support expectations are. I would be concerned about how such a system would respond to a change of instance type.

Oracle Database

In planning an Oracle database installation, you may need file system mounts as well. /u01, for example. The underlying volume counts against the maximum attachment count.

In laying out an ASM setup, consider a simple design, with as few ASM disks and ASM disk groups as needed.

Conclusion

Based on the available public information, I recommend limiting the number of EBS volume attachments to 27. Oracle database administrators might want to simplify their ASM implementation.

Gremlin Graph database statements

By Brian Fitzgerald

Introduction

This blog post covers some basic Gremlin data operations on a graph database. The database platforms tested are TinkerPop implementations in Azure Cosmos DB and AWS Neptune.

Initialization

Azure

Create a Cosmos DB account. For API, select “Gremlin (graph)”.

In data explorer, create a new graph.

AWS

Create a Neptune database and an EC2 instance. Setup your security group. Connect via gremlin.sh as described in the manual.

Insert Data

All statements in this blog post will run as well on Azure and AWS, but there are differences in the output display.

Add vertices.

g.addV('person').property('firstName', 'Marko')
g.addV('person').property('firstName', 'Stephen')
g.addV('person').property('firstName', 'Ben')
g.addV('person').property('firstName', 'Mary')

Add edges.

g.V().has('firstName','Marko').addE('knows').to(g.V().has('firstName','Stephen'))
g.V().has('firstName','Marko').addE('knows').to(g.V().has('firstName','Ben'))
g.V().has('firstName','Marko').addE('knows').to(g.V().has('firstName','Mary'))

Update data (set properties)

Set vertex properties

g.V().has('person','firstName','Marko').property('lastName','Rodriguez')

The output in this section is from  Azure Cosmos DB Data explorer:

[
  {
    "id": "7cf848d1-0b87-412c-87fe-267e6f259a86",
    "label": "person",
    "type": "vertex",
    "properties": {
      "firstName": [
        {
          "id": "b45eb2be-a0b7-4c55-a956-85b985b88b35",
          "value": "Marko"
        }
      ],
      "lastName": [
        {
          "id": "a28f96e7-8e17-4be7-8a15-a3a0d3aeba87",
          "value": "Rodriguez"
        }
      ]
    }
  }
]

Notice that each vertex property has an “id” field. In this example, the “lastName” “id” is “a28f96e7-8e17-4be7-8a15-a3a0d3aeba87”. If you update a property, even by setting it to the same value, the “id” changes.

g.V().has('person','firstName','Marko').property('lastName','Rodriguez')
[
  {
    "id": "7cf848d1-0b87-412c-87fe-267e6f259a86",
    "label": "person",
    "type": "vertex",
    "properties": {
      "firstName": [
        {
          "id": "b45eb2be-a0b7-4c55-a956-85b985b88b35",
          "value": "Marko"
        }
      ],
      "lastName": [
        {
          "id": "0d5e4855-4d78-45d9-85c2-de774ca21e87",
          "value": "Rodriguez"
        }
      ]
    }
  }
]

Now the “lastName” “id” is “0d5e4855-4d78-45d9-85c2-de774ca21e87”

Set edge properties

Add a weight property to each edge.

g.V().has('person','firstName','Marko').outE('knows').as('e').inV().has('firstName','Stephen').select('e').property('weight', 0.055)
g.V().has('person','firstName','Marko').outE('knows').as('e').inV().has('firstName','Ben').select('e').property('weight', 0.075)
g.V().has('person','firstName','Marko').outE('knows').as('e').inV().has('firstName','Mary').select('e').property('weight', 0.075)

Notice that edge properties to not have an “id” attribute:

g.V().has('person','firstName','Marko').outE('knows').as('e').inV().has('firstName','Stephen').select('e')
[
  {
    "id": "a37cdd6d-9e72-44f9-b36a-256f824eba64",
    "label": "knows",
    "type": "edge",
    "inVLabel": "person",
    "outVLabel": "person",
    "inV": "a9067638-e56d-4fd0-9522-c955c4062fa3",
    "outV": "7cf848d1-0b87-412c-87fe-267e6f259a86",
    "properties": {
      "weight": 0.055
    }
  }
]

Search

Search for Stephen

g.V().has('person','firstName','Stephen')

Azure Cosmos DB

Here is what the output looks like in Azure Cosmos DB Data Explorer.

[
  {
    "id": "a9067638-e56d-4fd0-9522-c955c4062fa3",
    "label": "person",
    "type": "vertex",
    "properties": {
      "firstName": [
        {
          "id": "3ac1eb02-6255-4787-a32c-2b61359f127c",
          "value": "Stephen"
        }
      ]
    }
  }
]

AWS

By comparison, here is gremlin console display.

gremlin> g.V().has('person','firstName','Stephen')
==>v[32b57f9f-703e-722a-ac4c-2cca662a7bd9]

Only the vertex id is displayed.

Here are some more search queries. Find one edge from Marko with the highest weight.

g.V().has('person','firstName','Marko').outE('knows').order().by('weight', decr).limit(1)

[
  {
    "id": "7c13d3a5-efca-4fc6-8ef4-38924e80c5eb",
    "label": "knows",
    "type": "edge",
    "inVLabel": "person",
    "outVLabel": "person",
    "inV": "1bcbdc44-6b0d-47c6-bbdb-96665b034847",
    "outV": "7cf848d1-0b87-412c-87fe-267e6f259a86",
    "properties": {
      "weight": 0.075
    }
  }
]

Find one vertex adjacent to Marko connected by an edge with the highest weight.

g.V().has('person','firstName','Marko').outE('knows').order().by('weight', decr).limit(1).inV().properties('firstName').value()
[
  {
    "id": "1bcbdc44-6b0d-47c6-bbdb-96665b034847",
    "label": "person",
    "type": "vertex",
    "properties": {
      "firstName": [
        {
          "id": "ebdf5e09-c511-472f-8b14-405fad956146",
          "value": "Ben"
        }
      ]
    }
  }
]

Notice that that vertex “Ben” id “1bcbdc44-6b0d-47c6-bbdb-96665b034847” matches edge inV.

Drop vertices

Drop one vertex.

g.V().has('firstName','Mary').drop()

Drop all vertices

g.V().drop()

All edges get dropped as well.

Scala AWS Lambda function

By Brian Fitzgerald

Introduction

This is a step-by-step procedure on how to create Scala AWS Lambda implementation in Eclipse with Maven. The compiled classes will run in the cloud in AWS Lambda’s java runtime environment (JRE).

Eclipse

To begin with, install these packages into your Eclipse, or check that they are installed:

  • AWS Toolkit for Eclipse
  • Scala IDE for Eclipse

Begin with Hello from Lambda!

The instructions in this section are based on the AWS manual. Setup AWS Toolkit for Eclipse.

Setup the AWS Lambda project

Click AWS Toolkit for Eclipse,

aws.toolkit.for.eclipse

and select “New AWS Lambda Java project…” from the dropdown. In the dialog box, enter the project name, i.e. “FiboLam”, change “Input Type” from “S3 Event” to “Custom”, and press “Finish”.

new.aws.lam.proj

Test the existing java function

Right click the project and select “Amazon Web Services” -> “Upload Function to AWS Lambda…”. In the dialog box, select “Create a new Lambda function:”. Enter a name and press “Next”. If you have not done so previously, create your role and S3 bucket. Press “Finish”.

upload.func

Again, right click the project and select “Amazon Web Services” -> “Run function on AWS Lambda…”. Note that the Lambda Handler is in the form “package.class”, i.e. “com.amazonaws.lambda.demo.LambdaFunctionHandler”. Press “Invoke”. Check the console:

Skip uploading function code since no local change is found...
Invoking function...
==================== FUNCTION OUTPUT ====================
"Hello from Lambda!"
==================== FUNCTION LOG OUTPUT ====================
START RequestId: 45a20261-f9aa-4104-a0a3-b3a65cc37c07 Version: $LATEST
Input: {}END RequestId: 45a20261-f9aa-4104-a0a3-b3a65cc37c07
REPORT RequestId: 45a20261-f9aa-4104-a0a3-b3a65cc37c07	Duration: 0.74 ms	Billed Duration: 100 ms 	Memory Size: 512 MB	Max Memory Used: 82 MB	

Up to here, we have a working AWS Lambda Java project.

Delete the existing java code

Now wipe out the java code

Expand src/main/java. Delete file LambdaFunctionHandler.java. Delete package com.example.lambda.demo

Expand src/test/java. You may delete file LambdaFunctionHandlerTest.java. Fixing it is out of scope for now.

Expand Maven Dependencies. You will see no scala runtime libraries, so far.

Scala

Add scala runtime library

Right click on the project, select “Configure->Add Scala Nature”

Refresh Maven Dependencies and take note of the version number, i.e. 2.12.3

Right click on the project and select “Maven”->”Add Dependency”, In the dialog box enter:

Group Id: org.scala-lang

Artifact Id: scala-library

Version: the version. i.e 2.12.3

Press “OK”

add.maven.dependency

Expand Maven Dependencies. Note that the scala-library jar appears. A screenshot of the updated Maven tree appears later in this blog.

Create Scala Sources

Set scala perspective

Select Window->Perspective->Open Perspective->Other..” Scroll down and select “Scala”. Press “Open”

Create Scala classes

At “src/main/java”, you can create a new package, let’s say “com.yourcompany.fibo”. Then, create your scala source file. Select “New->Scala Class”, and enter the class name, i.e. “com.yourcompany.fibo.Fibo”.

Replace the code with:

import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.RequestHandler

class YourClass extends RequestHandler[Object, String] {

  def handleRequest(o: Object, cx: Context): String =
    yourCode

}

Method “handleRequest” is mandatory. In practice, input Object will be JSON serializable. The return must be of type String. For example, Fibo.scala:

package com.yourcompany.fibo

import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.RequestHandler
import com.yourcompany.fibo.FibTailRec.fib

class Fibo extends RequestHandler[Object, String] {

  def handleRequest(o: Object, cx: Context): String =
    fibTailRec(o.toString.toInt).toString

  def fibTailRec(n: Int): Int =
    fib(n, 0, 1)

}

press ctrl-S to save.

FibTailRec.scala

package com.yourcompany.fibo

import scala.annotation.tailrec

object FibTailRec {

  @tailrec def fib(i: Int, p: Int, f: Int): Int = i match {
    case 0 => {
      p
    }
    case _ => fib(i - 1, f, p + f)
  }
}

By the way, this function demonstrates Scala tail call optimization, and is examined in more detail here.

The project tree

Examine the Package Explorer. Expand src/main/java. Note that there is only your package, your sources, and no demo code. Expand Maven Dependencies. Note the scala library jar. Note that no folders or files are flagged with errors.

explorer

Upload the Lambda function

Right click the project and select “Amazon Web Services”->”Upload Function to AWS Lambda..”. Select the correct handler (there should be only one), i.e. “com.yourcompany.fibo.Fibo”. That way, AWS Lambda will automatically look to run method handleRequest. Choose existing Lambda Function: FiboLam

upload.scala

Run the Lambda function

Again, right click the project and select “Amazon Web Services” -> “Run function on AWS Lambda…”. Select your handler, i.e. “com.yourcompany.fibo.Fibo”. For the sake of this blog, we’re not going to delve into scala JSON parsing, so in the text pane, enter a nonnegative integer, i.e. 7. Press “Invoke”.

run.dialog

Output:

Skip uploading function code since no local change is found...
Invoking function...
==================== FUNCTION OUTPUT ====================
"13"
==================== FUNCTION LOG OUTPUT ====================
START RequestId: 0f0990fe-497d-4f78-9709-5c67085d7a78 Version: $LATEST
END RequestId: 0f0990fe-497d-4f78-9709-5c67085d7a78
REPORT RequestId: 0f0990fe-497d-4f78-9709-5c67085d7a78	Duration: 0.54 ms	Billed Duration: 100 ms 	Memory Size: 512 MB	Max Memory Used: 93 MB	

Interpretation: 13 is the 7th Fibonacci number.

The upload file

You can go to your S3 bucket and find your file there (FiboLam.zip). You can download and explore the zip file and find your class files and the library jar files.

Summary

I have implemented a Scala AWS Lambda Function using these tools:

  • Eclipse
    • AWS Toolkit
    • Scala IDE
  • AWS
    • Lambda Function
    • IAM role
    • S3 bucket
  • Maven

The finished Lambda is made from only Scala classes. Now you can replace the Fibonacci code with your own code, and replace the test event with events from other AWS components in your own project.

Using operators >> and << for push and pop in a C++ stack

By Brian Fitzgerald

The C++ “>>” (extraction operator) and “<<” (insertion operator) are normally used with I/O streams (cin/cout), but you can overload these operators in your own classes and make them do other things. In this case, I implement a stack of integers. “>>” is used for push and “<<” is used for pop. Here is Stk.cpp, containing the Stk class routines:

#include "Stk.h"

// push i onto the stack

Stk& operator >>(Stk& st, int i) {
	st.ints = (int *) realloc(st.ints, (++st.len * sizeof(int)));
	st.ints[st.len - 1] = i;
	return st;
}

// pop i off the stack
Stk& operator <<(Stk& st, int &i) {
	if (st.len == 0) {
		throw "empty stack";
	}
	i = st.ints[--st.len];
	return st;
}

int Stk::size() {
	return len;
}

int Stk::peek() {
	return ints[len - 1];
}
bool Stk::isempty() {
	return len == 0;
}

A few things to notice:

  • The stack is implemented as ints, an array of int.
  • Push resizes the array with a call to realloc.
  • Operators >> and << are not members of class Stk
  • They are implemented as friends.
  • The friend functions have access to private variables ints and len.
  • In >> and <<, the type of the first argument and the return is &Stk.

Here is the header:

#include 

#ifndef STK_H_
#define STK_H_

class Stk {
public:
	int size();
	int peek();
	bool isempty();
	friend Stk& operator >>(Stk& st, int i);
	friend Stk& operator <<(Stk& st, int &i);
private:
	int *ints = NULL;
	int len = 0;
};

#endif /* STK_H_ */

Here is the main program:

#include 
#include "Stk.h"
using namespace std;

int main() {
	cout << "begin" << endl;

	Stk st;
	cout << "push 3: 13, 17, 19" << endl; 	st >> 13 >> 17 >> 19;

	cout << "stack size=" << st.size() << endl;
	cout << "pop the stack" << endl;
	while (!st.isempty()) {
		int n;
		st << n;
		cout << "popped n=" << n << endl;
	}
	cout << "stack size=" << st.size() << endl;

	cout << "push 3: 29, 31, 37" << endl; 	st >> 29 >> 31 >> 37;
	int i, j, k;
	cout << "pop 2" << endl;
	st << i << j;
	cout << "i=" << i << " j=" << j << endl;
	cout << "peek " << st.peek() << endl;
	cout << "stack size=" << st.size() << endl;
	cout << "push 2: 41, 47" << endl; 	st >> 41 >> 47;
	cout << "pop 1" << endl;
	st << k;
	cout << "popped k=" << k << endl;
	cout << "stack size=" << st.size() << endl;
	// int p, q, r;
	// st << p << q << r; // empty stack exception
	cout << "done" << endl;
	return 0;
}

Points to notice:

  • Expression st >> 13 >> 17 >> 19 is evaluated left to right.
  • st >> 13 is evaluated. The result is st, the stack with 13 pushed.
  • Internally, the partially evaluated expression is now st >> 17 >> 19.
  • st >> 17 is evaluated, and so on.

Output:

C:\Users\Brian Fitzgerald\eclipse-workspace\Stk\Debug>Stk.exe
begin
push 3: 13, 17, 19
stack size=3
pop the stack
popped n=19
popped n=17
popped n=13
stack size=0
push 3: 29, 31, 37
pop 2
i=37 j=31
peek 29
stack size=1
push 2: 41, 47
pop 1
popped k=47
stack size=2
done

This is my Saturday project. The purpose was to refresh some skills and to use C++ language features in an interesting way. I saw something similar in one client’s Sybase CT-Library variable binding code. If we’re going to migrate the application to some other database connectivity library, we need to understand how the existing code works, and from there, develop a a migration action plan.

I am a database administrator, not a developer. Any comments or suggestions from anyone in any field are welcome.

 

neater python logging messages

By Brian Fitzgerald

Here are a few notes on cleaner-looking python logging messages. Some package defaults lead to verbose, ragged looking output.

from threading import Thread
from logging import debug, info, warning, error, critical
from logging import DEBUG, basicConfig
def hello():
    warning('Something is up')
basicConfig(level=DEBUG,
            format='%(asctime)s %(levelname)s %(threadName)s %(message)s'
            )
debug('begin')
error('problem')
critical('danger')
threads = []
for i in [1, 2]:
    th = Thread(target=hello)
    th.start()
    threads.append(th)
for th in threads:
    th.join()
    info('joined')
info('done')
"C:\Users\Brian Fitzgerald\PycharmProjects\blog\venv\Scripts\python.exe" "C:/Users/Brian Fitzgerald/PycharmProjects/blog/threadlogging.py"
2018-05-03 21:12:51,098 DEBUG MainThread begin
2018-05-03 21:12:51,099 ERROR MainThread problem
2018-05-03 21:12:51,099 CRITICAL MainThread danger
2018-05-03 21:12:51,099 WARNING Thread-1 Something is up
2018-05-03 21:12:51,100 WARNING Thread-2 Something is up
2018-05-03 21:12:51,100 INFO MainThread joined
2018-05-03 21:12:51,100 INFO MainThread joined
2018-05-03 21:12:51,100 INFO MainThread done

Process finished with exit code 0

Notes:

  • The timestamp field is 23 characters
  • The level field is 4 to 8 characters
  • The thread identifier in this example is up to 10 characters
  • The logger prefix requires up to 43 characters
  • The content has a ragged appearance

Next, we will make three changes

  1. use datefmt for a shorter date string: %Y%m%d.%H%M%S
  2. use single character abbreviations for level: D, I, W, E, and C
  3. format short, fixed-width thread identifiers using th%02d
from threading import Thread, currentThread
from logging import debug, info, warning, error, critical
from logging import DEBUG, basicConfig, addLevelName
def hello():
    warning('Something is up')
basicConfig(
    level=DEBUG,
    datefmt='%Y%m%d.%H%M%S',
    format='%(asctime)s %(levelname)s %(threadName)s %(message)s')
currentThread().setName('main')
addLevelName(10, 'D')
addLevelName(20, 'I')
addLevelName(30, 'W')
addLevelName(40, 'E')
addLevelName(50, 'C')
debug('begin')
error('problem')
critical('danger')
threads = []
for i in [1, 2]:
    th = Thread(target=hello)
    th.setName('th%02d' % i)
    th.start()
    threads.append(th)
for th in threads:
    th.join()
    info('joined')
info('done')
"C:\Users\Brian Fitzgerald\PycharmProjects\blog\venv\Scripts\python.exe" "C:/Users/Brian Fitzgerald/PycharmProjects/blog/threadlogging.py"
20180503.211759 D main begin
20180503.211759 E main problem
20180503.211759 C main danger
20180503.211759 W th01 Something is up
20180503.211759 W th02 Something is up
20180503.211759 I main joined
20180503.211759 I main joined
20180503.211759 I main done

Process finished with exit code 0

Now, each log file entry has a fixed 22-character width. There is more space to the right for the actual content.

python sys.exit vs. os._exit

By Brian Fitzgerald

Here are some notes on the behavior of python functions sys.exit() vs os._exit() in a threaded program.

from threading import Thread, currentThread
from time import sleep, time
import sys
import atexit

def pt(str=None):
    print('el=%ss th=%s: %s' % (
        round(time() - t0, 1),
        currentThread().name, str)
          )

def testexit():
    pt('sleeping')
    sleep(int(currentThread().getName()))
    pt('calling sys.exit')
    sys.exit(0)
    pt('returning')

def alldone():
    pt('all done')

t0 = time()
atexit.register(alldone)
threads = []
for i in [1, 2]:
    th = Thread(target=testexit)
    th.setName(i)
    th.setDaemon(False)
    th.start()
    threads.append(th)
for th in threads:
    pt('waiting to join thread th=%s' % th.name)
    th.join()
    pt('main: joined to th=%s' % th.name)

In the threads, the sleep time equals the thread id, i.e. 1 or 2 seconds. We have arranged that function alldone will execute when the program exits.

"C:\Users\Brian Fitzgerald\PycharmProjects\blog\venv\Scripts\python.exe" "C:/Users/Brian Fitzgerald/PycharmProjects/blog/threadexit.py"
el=0.0s th=1: sleeping
el=0.0s th=2: sleeping
el=0.0s th=MainThread: waiting to join thread th=1
el=1.0s th=1: calling sys.exit
el=1.0s th=MainThread: main: joined to th=1
el=1.0s th=MainThread: waiting to join thread th=2
el=2.0s th=2: calling sys.exit
el=2.0s th=MainThread: main: joined to th=2
el=2.0s th=MainThread: all done
Process finished with exit code 0

Notes:

  • sys.exit() causes the thread to exit
  • statement “pt(‘returning’)” is not reached
  • The main thread finishes
  • Function alldone is executed
  • The output is identical if th.setDaemon(True)

Now changing “import sys” to “import os”, and “sys.exit(0)” to “os._exit(0)”:

from threading import Thread, currentThread
from time import sleep, time
import os
import atexit

def pt(str=None):
    print('el=%ss th=%s: %s' % (
        round(time() - t0, 1),
        currentThread().name, str)
          )

def testexit():
    pt('sleeping')
    sleep(int(currentThread().getName()))
    pt('calling os._exit')
    os._exit(0)
    pt('returning')

def alldone():
    pt('all done')

t0 = time()
atexit.register(alldone)
threads = []
for i in [1, 2]:
    th = Thread(target=testexit)
    th.setName(i)
    th.setDaemon(False)
    th.start()
    threads.append(th)

for th in threads:
    pt('waiting to join thread th=%s' % th.name)
    th.join()
    pt('main: joined to th=%s' % th.name)
"C:\Users\Brian Fitzgerald\PycharmProjects\blog\venv\Scripts\python.exe" "C:/Users/Brian Fitzgerald/PycharmProjects/blog/threadexit.py"
el=0.0s th=1: sleeping
el=0.0s th=2: sleeping
el=0.0s th=MainThread: waiting to join thread th=1
el=1.0s th=1: calling os._exit

Process finished with exit code 0

Notes:

  • MainThread is terminated while waiting to join thread 1.
  • thread 2 is terminated while sleeping
  • alldone is not reached
  • The output is identical if th.setDaemon(True)

Beware that os._exit can terminate a thread while it is in an exception handler:

def testexit():
    pt('try')
    try:
        raise Exception()
    except:
        pt('sleeping')
        sleep(int(currentThread().getName()))
        pt('done except')
    finally:
        pt('done finally')
    pt('calling os._exit')
    os._exit(0)
    pt('returning')
"C:\Users\Brian Fitzgerald\PycharmProjects\blog\venv\Scripts\python.exe" "C:/Users/Brian Fitzgerald/PycharmProjects/blog/threadexit.py"
el=0.0s th=1: try
el=0.0s th=1: sleeping
el=0.0s th=MainThread: waiting to join thread th=1
el=0.0s th=2: try
el=0.0s th=2: sleeping
el=1.0s th=1: done except
el=1.0s th=1: done finally
el=1.0s th=1: calling os._exit

Process finished with exit code 0

Note:

  • In thread 2, pt(‘done except’) is not reached.

os._exit can also interrupt a finally block:

def testexit():
    pt('try')
    try:
        raise Exception()
    except:
        pt('done except')
    finally:
        pt('sleeping')
        sleep(int(currentThread().getName()))
        pt('done finally')
    pt('calling os._exit')
    os._exit(0)
    pt('returning')
"C:\Users\Brian Fitzgerald\PycharmProjects\blog\venv\Scripts\python.exe" "C:/Users/Brian Fitzgerald/PycharmProjects/blog/threadexit.py"
el=0.0s th=1: try
el=0.0s th=1: done except
el=0.0s th=1: sleeping
el=0.0s th=2: try
el=0.0s th=2: done except
el=0.0s th=MainThread: waiting to join thread th=1
el=0.0s th=2: sleeping
el=1.0s th=1: done finally
el=1.0s th=1: calling os._exit

Process finished with exit code 0

Note:

  • In thread 2, pt(‘done finally’) is not reached

Python variable scope

By Brian Fitzgerald

Python variable scoping rules are different from other languages. If you are accustomed to java, the behavior may surprise you. Scope can be file, class, or function; however, control blocks such as if-else, try-except, or while do not define scope. A variable that is defined in a control block can be used after the control block.

A simple demonstration case is the if-else block. In function test, variable a is set in the if and else blocks, and is used after the if-else structure.

scope1

Not defining a variable before entering a control block is considered idiomatic python. IDE PyCharm reports no warnings. If you try to define variable a before the if-else block, as you would in java, PyCharm greys out a and reports it as an unused variable.

scope2.png

Finally, if statement “a = 0” is changed to “pass”, then in statement “a = None”, a is no longer reported as an unused variable, and is displayed in dark grey.

scope3.png

In conclusion, python scoping is different from java’s. You should not carry java variable declaration habits into python projects.

10053 diff: where categoryid and status

[oracle@stormking db12201 12.2]$ diff run1/db12201_ora_20225_CAT.trc run2/db12201_ora_20607_CAT.trc
1c1
< Trace file /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20225_CAT.trc
---
> Trace file /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20607_CAT.trc
12,13c12,13
< Oracle process number: 41
< Unix process pid: 20225, image: oracle@stormking (TNS V1-V3)
---
> Oracle process number: 40
> Unix process pid: 20607, image: oracle@stormking (TNS V1-V3)
16,22c16,22
< *** 2018-02-11T14:23:23.119343-05:00
< *** SESSION ID:(84.19304) 2018-02-11T14:23:23.119343-05:00
< *** CLIENT ID:() 2018-02-11T14:23:23.119343-05:00
< *** SERVICE NAME:(SYS$USERS) 2018-02-11T14:23:23.119343-05:00
< *** MODULE NAME:(SQL*Plus) 2018-02-11T14:23:23.119343-05:00
< *** ACTION NAME:() 2018-02-11T14:23:23.119343-05:00
< *** CLIENT DRIVER:(SQL*PLUS) 2018-02-11T14:23:23.119343-05:00
---
> *** 2018-02-11T14:25:26.881036-05:00
> *** SESSION ID:(84.15782) 2018-02-11T14:25:26.881036-05:00
> *** CLIENT ID:() 2018-02-11T14:25:26.881036-05:00
> *** SERVICE NAME:(SYS$USERS) 2018-02-11T14:25:26.881036-05:00
> *** MODULE NAME:(SQL*Plus) 2018-02-11T14:25:26.881036-05:00
> *** ACTION NAME:() 2018-02-11T14:25:26.881036-05:00
> *** CLIENT DRIVER:(SQL*PLUS) 2018-02-11T14:25:26.881036-05:00
25c25
< *** TRACE CONTINUED FROM FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20225_STATUS.trc ***
---
> *** TRACE CONTINUED FROM FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20607_STATUS.trc ***
27c27
< Registered qb: SEL$1 0xf972ef68 (PARSER)
---
> Registered qb: SEL$1 0x6bfd6f68 (PARSER)
817c817
< kkoqbc-subheap (create addr=0x7fddf9729810)
---
> kkoqbc-subheap (create addr=0x7f286bfd1810)
876a877,878
> Column (#3):
> NewDensity:0.000050, OldDensity:0.000050 BktCnt:10000.000000, PopBktCnt:9999.000000, PopValCnt:1, NDV:2
878,879c880,882
< AvgLen: 9 NDV: 2 Nulls: 0 Density: 0.500000
< Estimated selectivity: 0.500000 , col: #3
---
> AvgLen: 9 NDV: 2 Nulls: 0 Density: 0.000050
> Histogram: Freq #Bkts: 2 UncompBkts: 10000 EndPtVals: 2 ActualVal: no
> Estimated selectivity: 0.999900 , endpoint value predicate, col: #3
886c889
< Estimated selectivity: 0.500000 , col: #3
---
> Estimated selectivity: 0.999900 , endpoint value predicate, col: #3
888c891
< Card: Original: 10000.000000 Rounded: 5 Computed: 5.000000 Non Adjusted: 5.000000
---
> Card: Original: 10000.000000 Rounded: 10 Computed: 9.999000 Non Adjusted: 9.999000
893c896
< io = NOCOST, cpu = 50.000000, sel = 0.500000 flag = 2048 ("ORDS"."STATUS"='COMPLETE')
---
> io = NOCOST, cpu = 50.000000, sel = 0.999900 flag = 2048 ("ORDS"."STATUS"='COMPLETE')
916c919
< Estimated selectivity: 0.500000 , col: #3
---
> Estimated selectivity: 0.999900 , endpoint value predicate, col: #3
919,921c922,924
< resc_io: 30.000000 resc_cpu: 2414493
< ix_sel: 0.500000 ix_sel_with_filters: 0.500000
< Cost: 30.064126 Resp: 30.064126 Degree: 1
---
> resc_io: 60.000000 resc_cpu: 4827696
> ix_sel: 0.999900 ix_sel_with_filters: 0.999900
> Cost: 60.128217 Resp: 60.128217 Degree: 1
933c936
< Estimated selectivity: 0.500000 , col: #3
---
> Estimated selectivity: 0.999900 , endpoint value predicate, col: #3
937c940
< Estimated selectivity: 0.500000 , col: #3
---
> Estimated selectivity: 0.999900 , endpoint value predicate, col: #3
940,942c943,945
< resc_io: 14.000000 resc_cpu: 1100550
< ix_sel: 0.500000 ix_sel_with_filters: 0.500000
< Cost: 14.029229 Resp: 14.029229 Degree: 0
---
> resc_io: 28.000000 resc_cpu: 2200050
> ix_sel: 0.999900 ix_sel_with_filters: 0.999900
> Cost: 28.058430 Resp: 28.058430 Degree: 0
946,950c949,950
< Used STATUS_IDX
< Cost = 14.047156, sel = 0.500000
< Access path: Bitmap index - accepted
< Cost: 16.017750 Cost_io: 15.970067 Cost_cpu: 1795404.871128 Sel: 5.0000e-04
< Not Believed to be index-only
---
> Not used STATUS_IDX
> Cost = 28.094281, sel = 0.999900
968c968
< resc: 14.029229 card: 5000.000000 bytes: deg: 1 resp: 14.029229
---
> resc: 28.058430 card: 9999.000000 bytes: deg: 1 resp: 28.058430
970,972c970,972
< Cost per ptn: 0.029254 #ptns: 1
< hash_area: 256 (max=41035) buildfrag: 1 probefrag: 19 ppasses: 1
< Hash join: Resc: 15.058748 Resp: 15.058748 [multiMatchCost=0.000000]
---
> Cost per ptn: 0.042531 #ptns: 1
> hash_area: 256 (max=41035) buildfrag: 1 probefrag: 38 ppasses: 1
> Hash join: Resc: 29.101226 Resp: 29.101226 [multiMatchCost=0.000000]
976c976
< resc: 1.000265 card 5.000000 bytes: deg: 1 resp: 1.000265
---
> resc: 1.000265 card 9.999000 bytes: deg: 1 resp: 1.000265
980c980
< Cost per ptn: 0.042514 #ptns: 1
---
> Cost per ptn: 0.042534 #ptns: 1
982c982
< Hash join: Resc: 22.099868 Resp: 22.099868 [multiMatchCost=0.000000]
---
> Hash join: Resc: 22.099888 Resp: 22.099888 [multiMatchCost=0.000000]
986c986
< Cost: 37.158616
---
> Cost: 51.201114
990c990
< Cost: 11.002220 Degree: 1 Resp: 11.002220 Card: 5.000000 Bytes: 0.000000
---
> Cost: 11.002220 Degree: 1 Resp: 11.002220 Card: 9.999000 Bytes: 0.000000
1004c1004
< Best so far: Table#: 0 cost: 11.002220 card: 5.000000 bytes: 85.000000
---
> Best so far: Table#: 0 cost: 11.002220 card: 9.999000 bytes: 170.000000
1026c1026
< Cost: 11.002220 Degree: 1 Card: 5.000000 Bytes: 85.000000
---
> Cost: 11.002220 Degree: 1 Card: 10.000000 Bytes: 170.000000
1029c1029
< kkoqbc-subheap (delete addr=0x7fddf9729810, in-use=42200, alloc=49272)
---
> kkoqbc-subheap (delete addr=0x7f286bfd1810, in-use=42200, alloc=49272)
1032c1032
< call(in-use=10064, alloc=65760), compile(in-use=93904, alloc=97328), execution(in-use=2936, alloc=4032)
---
> call(in-use=9856, alloc=65760), compile(in-use=95696, alloc=99072), execution(in-use=2936, alloc=4032)
1038c1038
< call(in-use=10064, alloc=65760), compile(in-use=94912, alloc=97328), execution(in-use=2936, alloc=4032)
---
> call(in-use=9856, alloc=65760), compile(in-use=96704, alloc=99072), execution(in-use=2936, alloc=4032)
1043c1043
< SPD: Inserted felem, fid=11333809974545767572, ftype = 1, freason = 1, dtype = 0, dstate = 0, dflag = 0, ver = NO, keep = NO
---
> SPD: Modified felem, fid=11333809974545767572, ftype = 1, freason = 1, dtype = 0, dstate = 0, dflag = 0, ver = NO, keep = NO
1047c1047
< SPD: Inserted felem, fid=2757520453804995358, ftype = 1, freason = 1, dtype = 0, dstate = 0, dflag = 0, ver = NO, keep = NO
---
> SPD: Modified felem, fid=2757520453804995358, ftype = 1, freason = 1, dtype = 0, dstate = 0, dflag = 0, ver = NO, keep = NO
1083c1083
< | 1 | TABLE ACCESS BY INDEX ROWID BATCHED | ORDS | 5 | 85 | 11 | 00:00:01 |
---
> | 1 | TABLE ACCESS BY INDEX ROWID BATCHED | ORDS | 10 | 170 | 11 | 00:00:01 |
2973c2973
< SEL$1 0xf972ef68 (PARSER) [FINAL]
---
> SEL$1 0x6bfd6f68 (PARSER) [FINAL]
2976c2976
< call(in-use=17648, alloc=65760), compile(in-use=123424, alloc=183352), execution(in-use=10112, alloc=12144)
---
> call(in-use=17440, alloc=65760), compile(in-use=125208, alloc=187496), execution(in-use=10112, alloc=12144)
2983c2983
< *** TRACE CONTINUES IN FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20225_GBY.trc ***
---
> *** TRACE CONTINUES IN FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20607_GBY.trc ***

10053 diff: where status = ‘PENDING’

 

[oracle@stormking db12201 12.2]$ diff run1/db12201_ora_20225_STATUS.trc run2/db12201_ora_20607_STATUS.trc

1c1
< Trace file /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20225_STATUS.trc
---
> Trace file /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20607_STATUS.trc
12,13c12,13
< Oracle process number: 41
< Unix process pid: 20225, image: oracle@stormking (TNS V1-V3)
---
> Oracle process number: 40
> Unix process pid: 20607, image: oracle@stormking (TNS V1-V3)
16,22c16,22
< *** 2018-02-11T14:23:22.737391-05:00
< *** SESSION ID:(84.19304) 2018-02-11T14:23:22.737391-05:00
< *** CLIENT ID:() 2018-02-11T14:23:22.737391-05:00
< *** SERVICE NAME:(SYS$USERS) 2018-02-11T14:23:22.737391-05:00
< *** MODULE NAME:(SQL*Plus) 2018-02-11T14:23:22.737391-05:00
< *** ACTION NAME:() 2018-02-11T14:23:22.737391-05:00
< *** CLIENT DRIVER:(SQL*PLUS) 2018-02-11T14:23:22.737391-05:00
---
> *** 2018-02-11T14:25:26.553076-05:00
> *** SESSION ID:(84.15782) 2018-02-11T14:25:26.553076-05:00
> *** CLIENT ID:() 2018-02-11T14:25:26.553076-05:00
> *** SERVICE NAME:(SYS$USERS) 2018-02-11T14:25:26.553076-05:00
> *** MODULE NAME:(SQL*Plus) 2018-02-11T14:25:26.553076-05:00
> *** ACTION NAME:() 2018-02-11T14:25:26.553076-05:00
> *** CLIENT DRIVER:(SQL*PLUS) 2018-02-11T14:25:26.553076-05:00
25c25
< *** TRACE CONTINUED FROM FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20225_STATS.trc ***
---
> *** TRACE CONTINUED FROM FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20607_STATS.trc ***
27c27
< Registered qb: SEL$1 0xf972ef68 (PARSER)
---
> Registered qb: SEL$1 0x6bfd6f68 (PARSER)
816c816
< kkoqbc-subheap (create addr=0x7fddf9729810)
---
> kkoqbc-subheap (create addr=0x7f286bfd1810)
873a874,875
> Column (#3):
> NewDensity:0.000050, OldDensity:0.000050 BktCnt:10000.000000, PopBktCnt:9999.000000, PopValCnt:1, NDV:2
875,876c877,879
< AvgLen: 9 NDV: 2 Nulls: 0 Density: 0.500000
< Estimated selectivity: 0.500000 , col: #3
---
> AvgLen: 9 NDV: 2 Nulls: 0 Density: 0.000050
> Histogram: Freq #Bkts: 2 UncompBkts: 10000 EndPtVals: 2 ActualVal: no
> Estimated selectivity: 1.0000e-04 , endpoint value predicate, col: #3
878c881
< Card: Original: 10000.000000 Rounded: 5000 Computed: 5000.000000 Non Adjusted: 5000.000000
---
> Card: Original: 10000.000000 Rounded: 1 Computed: 1.000000 Non Adjusted: 1.000000
882c885
< io = NOCOST, cpu = 50.000000, sel = 0.500000 flag = 2048 ("ORDS"."STATUS"='PENDING')
---
> io = NOCOST, cpu = 50.000000, sel = 0.000100 flag = 2048 ("ORDS"."STATUS"='PENDING')
896c899
< Estimated selectivity: 0.500000 , col: #3
---
> Estimated selectivity: 1.0000e-04 , endpoint value predicate, col: #3
899,901c902,904
< resc_io: 30.000000 resc_cpu: 2164493
< ix_sel: 0.500000 ix_sel_with_filters: 0.500000
< Cost: 30.057486 Resp: 30.057486 Degree: 1
---
> resc_io: 2.000000 resc_cpu: 15483
> ix_sel: 1.0000e-04 ix_sel_with_filters: 1.0000e-04
> Cost: 2.000411 Resp: 2.000411 Degree: 1
904c907
< Estimated selectivity: 0.500000 , col: #3
---
> Estimated selectivity: 1.0000e-04 , endpoint value predicate, col: #3
908c911
< Estimated selectivity: 0.500000 , col: #3
---
> Estimated selectivity: 1.0000e-04 , endpoint value predicate, col: #3
911,913c914,916
< resc_io: 14.000000 resc_cpu: 1100550
< ix_sel: 0.500000 ix_sel_with_filters: 0.500000
< Cost: 14.029229 Resp: 14.029229 Degree: 0
---
> resc_io: 1.000000 resc_cpu: 8171
> ix_sel: 1.0000e-04 ix_sel_with_filters: 1.0000e-04
> Cost: 1.000217 Resp: 1.000217 Degree: 0
916c919
< Cost = 14.047156, sel = 0.500000
---
> Cost = 1.000221, sel = 1.0000e-04
931c934
< resc: 14.029229 card 5000.000000 bytes: deg: 1 resp: 14.029229
---
> resc: 1.000217 card 1.000000 bytes: deg: 1 resp: 1.000217
935,937c938,940
< Cost per ptn: 0.062413 #ptns: 1
< hash_area: 256 (max=41035) buildfrag: 19 probefrag: 32 ppasses: 1
< Hash join: Resc: 35.148731 Resp: 35.148731 [multiMatchCost=0.000000]
---
> Cost per ptn: 0.042498 #ptns: 1
> hash_area: 256 (max=41035) buildfrag: 1 probefrag: 32 ppasses: 1
> Hash join: Resc: 22.099804 Resp: 22.099804 [multiMatchCost=0.000000]
941c944
< Cost: 35.148731
---
> Cost: 22.099804
943,944c946,948
< Best:: AccessPath: TableScan
< Cost: 11.070360 Degree: 1 Resp: 11.070360 Card: 5000.000000 Bytes: 0.000000
---
> Best:: AccessPath: IndexRange
> Index: STATUS_IDX
> Cost: 2.000411 Degree: 1 Resp: 2.000411 Card: 1.000000 Bytes: 0.000000
958c962
< Best so far: Table#: 0 cost: 11.070360 card: 5000.000000 bytes: 65000.000000
---
> Best so far: Table#: 0 cost: 2.000411 card: 1.000000 bytes: 13.000000
970,971c974,975
< AutoDOP: Consider caching for ORDS[ORDS](obj#93045)
< cost:11.070360 blkSize:8192 objSize:35.00 marObjSize:33.25 bufSize:469047.00 affPercent:80 smallTab:YES affinitized:NO
---
> AutoDOP: Consider caching for ORDS[ORDS](obj#-1)
> cost:2.000411 blkSize:8192 objSize:35.00 marObjSize:33.25 bufSize:469047.00 affPercent:80 smallTab:YES affinitized:NO
974c978,979
< id=0 frofand predicate="ORDS"."STATUS"='PENDING'
---
> id=0 frofkks[i] (index start key) predicate="ORDS"."STATUS"='PENDING'
> id=0 frofkke[i] (index stop key) predicate="ORDS"."STATUS"='PENDING'
978,981c983,986
< Cost: 11.070360 Degree: 1 Card: 5000.000000 Bytes: 65000.000000
< Resc: 11.070360 Resc_io: 11.000000 Resc_cpu: 2649250
< Resp: 11.070360 Resp_io: 11.000000 Resc_cpu: 2649250
< kkoqbc-subheap (delete addr=0x7fddf9729810, in-use=41016, alloc=49272)
---
> Cost: 2.000411 Degree: 1 Card: 1.000000 Bytes: 13.000000
> Resc: 2.000411 Resc_io: 2.000000 Resc_cpu: 15483
> Resp: 2.000411 Resp_io: 2.000000 Resc_cpu: 15483
> kkoqbc-subheap (delete addr=0x7f286bfd1810, in-use=41112, alloc=49272)
984c989
< call(in-use=9096, alloc=65760), compile(in-use=86264, alloc=89040), execution(in-use=2936, alloc=4032)
---
> call(in-use=8888, alloc=65760), compile(in-use=88344, alloc=89040), execution(in-use=2936, alloc=4032)
990c995
< call(in-use=9096, alloc=65760), compile(in-use=87272, alloc=89040), execution(in-use=2936, alloc=4032)
---
> call(in-use=8888, alloc=65760), compile(in-use=89352, alloc=93184), execution(in-use=2936, alloc=4032)
992a998,1004
> CBRID: ORDS @ SEL$1 TableLookup allocation - Failure - bug-fix control
> kkeCostToTime: using io calibrate stats maxpmbps=200(MB/s)
> block_size=8192 mb_io_count=1 mb_io_size=8192 (bytes)
> tot_io_size=0(MB) time=0(ms)
> kkeCostToTime: using io calibrate stats maxpmbps=200(MB/s)
> block_size=8192 mb_io_count=1 mb_io_size=8192 (bytes)
> tot_io_size=0(MB) time=0(ms)
1002c1014
< sql_id=03y2yj25g7d27 plan_hash_value=1252245826 problem_type=3
---
> sql_id=03y2yj25g7d27 plan_hash_value=1807741764 problem_type=3
1016,1021c1028,1034
< -------------------------------------+-----------------------------------+
< | Id | Operation | Name | Rows | Bytes | Cost | Time |
< -------------------------------------+-----------------------------------+
< | 0 | SELECT STATEMENT | | | | 11 | |
< | 1 | TABLE ACCESS FULL | ORDS | 5000 | 63K | 11 | 00:00:01 |
< -------------------------------------+-----------------------------------+
---
> ---------------------------------------------------------+-----------------------------------+
> | Id | Operation | Name | Rows | Bytes | Cost | Time |
> ---------------------------------------------------------+-----------------------------------+
> | 0 | SELECT STATEMENT | | | | 2 | |
> | 1 | TABLE ACCESS BY INDEX ROWID BATCHED | ORDS | 1 | 13 | 2 | 00:00:01 |
> | 2 | INDEX RANGE SCAN | STATUS_IDX| 1 | | 1 | 00:00:01 |
> ---------------------------------------------------------+-----------------------------------+
1024a1038
> 2 - SEL$1 / ORDS@SEL$1
1028c1042
< 1 - filter("STATUS"='PENDING')
---
> 2 - access("STATUS"='PENDING')
1034,1036c1048,1050
< plan_hash_full : 2095704957
< plan_hash : 1252245826
< plan_hash_2 : 2095704957
---
> plan_hash_full : 2670720227
> plan_hash : 1807741764
> plan_hash_2 : 2670720227
1045c1059,1060
< FULL(@"SEL$1" "ORDS"@"SEL$1")
---
> INDEX_RS_ASC(@"SEL$1" "ORDS"@"SEL$1" ("ORDS"."STATUS"))
> BATCH_TABLE_ACCESS_BY_ROWID(@"SEL$1" "ORDS"@"SEL$1")
2906c2921
< SEL$1 0xf972ef68 (PARSER) [FINAL]
---
> SEL$1 0x6bfd6f68 (PARSER) [FINAL]
2909c2924
< call(in-use=16696, alloc=65760), compile(in-use=108432, alloc=168664), execution(in-use=6504, alloc=8088)
---
> call(in-use=13888, alloc=65760), compile(in-use=113288, alloc=175064), execution(in-use=9136, alloc=12144)
2916c2931,2933
< *** TRACE CONTINUES IN FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20225_CAT.trc ***
---
> *** 2018-02-11T14:25:26.880036-05:00
>
> *** TRACE CONTINUES IN FILE /u01/app/oracle/diag/rdbms/db12201/db12201/trace/db12201_ora_20607_CAT.trc ***