- Partner Webcast - Oracle Storage Cloud Services: Enabling Enterprises Evolve (OPN Innovation and Modernisation Center (EMEA))
via OPN Innovation and Modernisation Center (EMEA) http://ift.tt/1AAiVSD
- Partner Webcast - Docker Agility in Cloud: Introducing Oracle Contain…
via Blogs.Oracle.com/IMC - Slideshows by User: oracle_imc_team http://ift.tt/gEA7C8
- Sponsored: 64% off Code Black Drone with HD Camera
Our #1 Best-Selling Drone--Meet the Dark Night of the Sky!
The Cost is too high while selecting the records from the Staging Table named as JDSU_RPR_ORDER_HEADERS_STG
I ran across a stackoverflow question and it gave me an idea for a simpler use of Python to graph some Oracle database performance information. I looked at my PythonDBAGraphs scripts and I’m not sure that it is worth modifying them to try to simplify those scripts since I like what they do. But they may make people think that Python scripts to graph Oracle performance data are difficult to write. But, I think if someone just wants to put together some graphs using Python, Matplotlib, and cx_Oracle they could do it more simply than I have in my PythonDBAGraphs scripts and it still could be useful.
Here is an example that looks at db file sequential read waits and graphs the number of waits per interval and the average wait time in microseconds:
import cx_Oracle import matplotlib.pyplot as plt import matplotlib.dates as mdates connect_string = "MYUSER/MYPASSWORD@MYDATABASE" con = cx_Oracle.connect(connect_string) cur = con.cursor() query=""" select sn.END_INTERVAL_TIME, (after.total_waits-before.total_waits) "number of waits", (after.time_waited_micro-before.time_waited_micro)/ (after.total_waits-before.total_waits) "ave microseconds" from DBA_HIST_SYSTEM_EVENT before, DBA_HIST_SYSTEM_EVENT after, DBA_HIST_SNAPSHOT sn where before.event_name='db file sequential read' and after.event_name=before.event_name and after.snap_id=before.snap_id+1 and after.instance_number=1 and before.instance_number=after.instance_number and after.snap_id=sn.snap_id and after.instance_number=sn.instance_number and (after.total_waits-before.total_waits) > 0 order by after.snap_id """ cur.execute(query) datetimes =  numwaits =  avgmicros =  for result in cur: datetimes.append(result) numwaits.append(result) avgmicros.append(result) cur.close() con.close() title="db file sequential read waits" fig = plt.figure(title) ax = plt.axes() plt.plot(datetimes,numwaits,'r') plt.plot(datetimes,avgmicros,'b') # Format X axis dates fig.autofmt_xdate() ax.fmt_xdata = mdates.DateFormatter('%m/%d/%Y %H:%M') datetimefmt = mdates.DateFormatter("%m/%d/%Y") ax.xaxis.set_major_formatter(datetimefmt) # Title and axes labels plt.title(title) plt.xlabel("Date and time") plt.ylabel("num waits and average wait time") # Legend plt.legend(["Number of waits","Average wait time in microseconds"], loc='upper left') plt.show()
The graph it produces is usable without a lot of time spent formatting it in a non-standard way:
It is a short 68 line script and you just need matplotlib and cx_Oracle to run it. I’ve tested this with Python 2.
Is this the sort of column that gets inserted into not-null as a flag that some task needs to be run against it? The task would then set this column to null to mark it as processed. If you had a big batch to run, or the task hadn’t run in some time (looking at your 41K buffers, that must be quite a lot of rows!) then the index would have grown – setting the column back to null isn’t going to shrink it again on it’s own but will mean the index can shrink if asked to.
The same sort of thing happens with AQ tables, except the rows get deleted (although that can some time after processing)
We share our skills to maximize your revenue!