Why you should, and should not, worry about the new era of inteligent databases

These days I fell like an terminator movie, with Ciberdyne working really hard to make Skynet a cient being – to become inteligent.

We all know that some activities are a best fit to automation, reason why we spend hours learning phyton or perl. If you gain your daily bread by executing scripts, loading data into the database, creating users, increasing tablespace sizes, making basic health checks – YES – you need to step up and advance in your Oracle DBA game. The machines are getting smarter on a dailly bases, you should grow smarter as well.

So, in my opinion, what activities will not be feasible to the machines in the short, perhaps medium run? Performance analysis, deep troubleshooting, installation cenarios that escape from the next-next-finish rule, Database architecture,  Data migration and consolidation…things that usually people have to think and design more (using the 80/20 plan/execute rule) will not be played by the machines in the short run.

If your performance analysis in done by the dbms_sqltune – you need to worry too 🙂

As always feedbacks are always welcome.

See you around,

Hang.

 

Advertisements
Posted in database, mindset | Tagged | Leave a comment

The infamous jdbc closed connection

Sometimes you, as an DBA, is blamed for everything. The database is slow, unavailable, unpatched, and the list goes on and on.

Sometimes, in rare situations, you can prove then wrong 😀

Last week we have been called to analyze a intermitent application issue. The app team blame the database, showing the “java.sql.SQLException: Closed Connection” error on app logs. Everything at database level was checked out, and rechecked again, until they call us. Long debugging hours and still no results, we tried a different approach. What about sniffing the eth card at app server..checking the communication flow between APP and Database.

And so we did it:

tcpdump -i eth0 tcp port 1521 -A -s1500 | awk ‘$1 ~ “ORA-” {i=1;split($1,t,”ORA-“);while (i <= NF) {if (i == 1) {printf(“%s”,”ORA-“t[2])}else {printf(“%s “,$i)};i++}printf(“\n”)}’

This give us the nice output:

bla@app_blaserver:~ # tcpdump -i eth0 tcp port 1521 -A -s1500 | awk ‘$1 ~ “ORA-” {i=1;split($1,t,”ORA-“);while (i <= NF) {if (i == 1) {printf(“%s”,”ORA-“t[2])}else {printf(“%s “,$i)};i++}printf(“\n”)}’
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 1500 bytes
ORA-01403:no data found
ORA-00913:too many values
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01403:no data found
ORA-01438:value larger than specified precision allowed for this column
ORA-06512:at line 2
ORA-00937:not a single-group group function
ORA-01403:no data found
ORA-01403:no data found
ORA-00937:not a single-group group function
ORA-01403:no data found
ORA-00937:not a single-group group function
ORA-01403:no data found
ORA-00937:not a single-group group function
ORA-01403:no data found

The ORA-01403 is expected after the fetch of each cursor being processed – no bad news here.

Hummmm…and when the ORA-01438/ORA-06512/ORA-00937 are raised what happens to the connection? You got it right?

After checking what was causing the errors, the intermittent issue stops, everyone was happy – incluing the DBA team 😀

(You need to adapt the script to fit the listener port and eth card in your box, okay?)

As always feedbacks are very welcome.

See you around,

Hang.

Posted in database, Troubleshooting | Tagged , | Leave a comment

12cR1 + Suse 12 SP2 = take a look on this post

Today I face a weird issue during a HAS 12.1.0.2 in Suse 12 SP2 for a customer.

Everything went smooth during the runInstaller, but roothas.pl failed with the follow error:

SERVER_BLA:/u01/grid/12.1.0.2 # /u01/grid/12.1.0.2/perl/bin/perl -I/u01/grid/12.1.0.2/perl/lib -I/u01/grid/12.1.0.2/crs/install /u01/grid/12.1.0.2/crs/install/roothas.pl
Using configuration parameter file: /u01/grid/12.1.0.2/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user ‘ora12c’, privgrp ‘dba’..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root’, privgrp ‘root’..
Operation successful.
CRS-4664: Node SERVER_BLA successfully pinned.
2017/06/10 00:46:42 CLSRSC-330: Adding Clusterware entries to file ‘oracle-ohasd.service’
PRCR-1006 : Failed to add resource ora.ons for ons
PRCR-1115 : Failed to find entities of type resource type that match filters (TYPE_NAME ends .type) and contain attributes
CRS-0184 : Cannot communicate with the CRS daemon.
2017/06/10 00:47:04 CLSRSC-180: An error occurred while executing the command ‘srvctl add ons’ (error code 0)
2017/06/10 00:47:55 CLSRSC-115: Start of resource ‘ora.evmd’ failed
2017/06/10 00:47:55 CLSRSC-202: Failed to start EVM daemon

This PRCR-1006 drive me nuts. Turns out, after long hours digging the web + metalink + caffeine, that you need to:

vi /etc/ld.so.conf and add /lib64/noelision on top of it.

The file should be like this after vi:

SERVER_BLA:/u01/grid/12.1.0.2/crs/install# cat /etc/ld.so.conf
/lib64/noelision
/usr/local/lib64
/usr/local/lib
include /etc/ld.so.conf.d/*.conf

And then, add the symlink on GI_HOME:

SERVER_BLA:/u01/grid/12.1.0.2/lib# lns -s /lib64/noelision/libpthread-2.22.so libpthread.so.0

And only after this run root.sh/roothas.pl. If you are reading this post problably you already executed roothas.pl ( =[ sadly). So you need to deconfigure first, execute the steps above, and then execute roothas.pl again.

After this, happiness is back =]

See you around

Posted in database, Installation, Sem categoria | Tagged , , , | Leave a comment

db_multiblock_read_count – to be or not to be?

Sometimes you wanna to use things with default options…and sometimes the default is not good enough.

We all know that db_file_multiblock_read_count is bumped by default on startup, usually you get 128 blocks per read. Why?

From Oracle documentation, this value is high, but CBO will not favor full tables scans.

“Even though the default value may be a large value, the optimizer will not favor large plans if you do not set this parameter. It would do so only if you explicitly set this parameter to a large value.”

Okay. But Why? From a 10053 trace within a session, you can see that the CBO will compute db_file_multiblock_read_count always as “8”…even if you see 128 in spfile.

CBO you always use 8, if you dont set db_file_multiblock_read_count explicitly. How to know if you set db_file_multiblock_read_count as 128? Use this:

SELECT nvl(value,’*NULL*’) AS value
FROM v$spparameter
WHERE name = ‘db_file_multiblock_read_count’;

If this return *NULL*, you have not set db_file_multiblock_read_count, Oracle is showing you 128, but CBO uses 8. Sad no?

You all read the documentation and know the effects of bumping db_file_multiblock_read_count high. Full table scans will happen more often and as a result, in a OLTP system, usually you will get a call from your boss (hehe)

But there is a way to set correctly the db_file_multiblock_read_count…by testing…for example, take a look on the block below. Its silly, I know, but it can give you a magic value for this parameter.

set serveroutput on
DECLARE
l_count PLS_INTEGER;
l_time PLS_INTEGER;
l_starting_time PLS_INTEGER;
l_ending_time PLS_INTEGER;
BEGIN
dbms_output.put_line(‘dbfmbrc seconds’);
FOR l_dbfmbrc IN 1..64
LOOP
EXECUTE IMMEDIATE ‘ALTER SESSION SET db_file_multiblock_read_count=’||l_dbfmbrc;
EXECUTE IMMEDIATE ‘ALTER system flush buffer_cache’;
EXECUTE IMMEDIATE ‘ALTER session disable parallel dml’;
l_starting_time := dbms_utility.get_time();
SELECT /*+ full(t) */ count(*) INTO l_count FROM big_table t;
l_ending_time := dbms_utility.get_time();
l_time := round((l_ending_time-l_starting_time)/100);
dbms_output.put_line(l_dbfmbrc||’ ‘||l_time);
END LOOP;
END;
/

(Thanks to Chris Antognini, you’re great)

With this block (be carefull, it will take 60-90 minutes depending of the big table’s size, as a advice, use a 5GB table), you will have values, plot a graph and see the behavior. Dont choose a high value for OLTP.

See you around!

Posted in Performance, Troubleshooting | Tagged , , | Leave a comment

12c Upgrade Exam – 1z0-060

Today we will describe some impressions about 1z0-060 exam.

So, for get success in exam, you need:

  • Study hard on 12c architecture (CDB / PDB): how to start/ stop, create, drop, secure, etc.
  • Do not believe on dumps answers.

We recommend to do new features course, or have some experience on 12c first – some questions have direct relation with daily DBA tasks.

Posted in database, exam, New Features 12c, oracle | Tagged , , | Leave a comment

First impression on 12cR2 Oracle Clusterware install

Today we will gonna discuss about first impression on fresh install of Oracle Clusterware 12cR2 (for database, you could found some considerations here).

I install on new Oracle Linux 6.9 on Virtualbox 5.1.18 and I observe some points:

  • Like database install, the grid software has only one file to download (take care with uncompress the zip file. You need to uncompress on the location that you need to use the cluster software).
  • Oracle has added 2 diskgroups types (in 11gR2 its doesn’t are present): Flex and Extended (more information you could found here).

Screen Shot 2017-03-30 at 14.38.17

  • Pay attention with pre-requisites and space: at least, almost 40 GB was necessary for grid diskgroup if you have less than 4 nodes clusterware.
  • Gavin Soorma has upgrade a 12R1 Cluster. If you are planning to upgrade your cluster, consider to read this post
  • I install with old way Oracle ASMLIB for test purposes and it’s works! 🙂
  • If you install on graphical mode be aware in unzip the cluster software where ORACLE_HOME grid software resides because you can not change the location of install home, as you could see below:

Screen Shot 2017-04-12 at 17.44.12

So, I’ll perform more tests in this test cluster. So, if you are planning to construct your own test cluster, i recommend:

 

Posted in database, Installation, New Features 12c, oracle | Leave a comment

First impression on 12cR2 database install

Today I’ll describe my first impressions on install the new 12cR2 (available for premises on march 2017) for linux and Solaris.

Inicially I felt a little bit strange because there are only one file for database and only one for grid install (on other versions since 11gR2, there are 2 files for database and one or more for grid – depends of version that you install).

So I downloaded and install it on OEL6.8 for study purposes.

The install process is almost similar than 12cR1 process, except you need more free space to install it (at least 8 GB).

Other point, when you unzip the single file, keep careful in uncompress on a folder (for organization, because all files will be uncompress in same directory that you are).

Then  I will keep study and publish some more new features! 🙂

Posted in database, New Features 12c, oracle | Tagged , , | 1 Comment

Release schedules dates document was updated!!

Continue Hanganalyze’s post: 12.2 on-prem available for download, we see that realease date document was update on MOS (742060.1).

Basically Oracle 12.2 was released for cloud (in March 2017 for premises) and 12.2 have been supported until 2021.

roadmap

So, now it’s time to think about and plan to upgrade databases 11.2.0.4 and 12.1.0.2, of course if  application was compatible too! 🙂

Remember, now Oracle Recertification program follow the schedules date (more information you could see in this video).

Posted in cloud, database, Exadata, Installation, My Oracle Support, New Features 12c, ODA, oracle, Supercluster | Leave a comment

A good starting point on DevOps culture

Hello there! Hope this article find you well.

Sometimes the new stuff seems to be full of dark places and complexities. When you find a book, a link, a song, a magazine article that lights the path, is always a happy moment.

Today I gonna share a very good reading, The Phoenix Project, a kick start on DevOps culture. Reading this book, you will follow the journey of Bill, responsible in DevOps addoption on Parts Unlimited – a fictional company.

You will understand the key concepts, like a day by day diary. Totally worth reading – check the amazon link here.

So take you coffee mug, sit on the couch and read on!

See you around.

Posted in DevOps | Tagged , | Leave a comment

To be or not to be (lazy)

Sometimes you are an Oracle DBA just tired of perform setup ( I like to install everything from scratch…since oracle 7.3 it was always an adventure for me 🙂 )

If you only want to download and have fun on some cool new features, a pre-installed ova is the gold medal for you..

Check out last this Jeff Smith (SQL Developer and lots of fun on his blog)  here.

Its a OVA with 12.2, APEX, SQL Developer and other cool stuff 🙂

See you around!

Posted in database, New Features 12c | Tagged , , , | Leave a comment