Entries by Zohar Elkayam

Figuring Out What EXPDP and IMPDP are Doing Right Now

Starting Oracle 10g, the old export/import tools were replaced by a newer, more sophisticated tool: the data pump.
This new tool had some advantages over the older tool – it was able to run in parallel, it has a better interface and it can be ran from PL/SQL code easily. It can even be restarted or resumed if needed. On the con side, it uses the database DIRECTORY object which means the file we’re exporting to or importing from must reside on the server.

The problem start when we try to diagnose what is going on when there is a performance issue. Since the process we use for exporting might be forked into multiple processes, we can’t really know what is going on behind the scenes.

So, how can we resolve that?

Read more

,

Using Read Only Tables

While visiting a customer, we had a conversation about the correct way to stop users from writing to code tables. The customer described his ancient logic: when he wanted to move table to a read only state, he removed the write (insert/update/delete) permissions from all of his users. That was good enough for him for years – since he started using this method way back in Oracle 8. All was well, util this week he found out that the table owner’s privileges could not be revoked – and due to a bug, someone accidentally deleted the table content…

So I asked him why didn’t they change it to read only tables and he had no idea what I am talking about.
Well, I wrote about read only table like 6 years ago (in Hebrew), but I never thought I should translate it – since it’s a fairly “old” (11gR1) feature and everybody knows about it, right?
Well, this week proved me wrong. Here is what I wrote about it years ago.

Read more

Fixing Dataguard Wrong File Location Problem

When we add a new datafile to the primary environment of a dataguard setup, we need to add the datafile to the standby environment as well if we want the manged recover to continue working. We can do that manually if we want – but fortunately for us Oracle comes with a built in feature for automatically creating the file in the standby as well. All we need to do to set it up is to set the parameter “standby_file_management” to AUTO and create a conversion map for the files location using DB_FILE_NAME_CONVERT parameter.

All of this should be running well, until some Junior DBA (hey D., you know I’m talking about you.. 🙂 ) decides to create a new datafile in the non-default location.
Once that happens, the dataguard is unable to create the new datafile and the managed recovery will stop working.

This is a short guide I created years ago for how to identify and solve the problem.

Read more

, ,

Oracle Week 2016: Introduction to Apache Spark (slides)

This is the presentation for Rapid Cluster Computing with Apache Spark session I did in Oracle Week few weeks ago.

I wrote about the Oracle Week conference in a previous post so I won’t go over that again – this was my 3rd session of that week.

Although Oracle Week was for years about Oracle related products, this year they decided to open it up for other technologies as well. They had NoSQL sessions, Hadoop sessions, and even open stack sessions (including ElasticSearch and others). I was fortunate enough to be accepted to give this session which was about Apache Spark.

Apache Spark is the ad-hoc solution for every new Big Data project we encounter in the last year or so. Spark is a cluster solution which uses the Map Reduce paradigm without the need for a Hadoop cluster. It is based on handling the different map-reduce function in-memory and orchestrate everything internally. If you do have a Hadoop deployment, it can interact with it very easily using its internal master or using YARN instead.

This seminar is an introduction level for Oracle DBAs and other database developers. It’s main goal is to get to know this amazing technology. In the session we go over Spark Core, RDDs, how to develop for clusters and some behind the scenes for better understanding. Some of the presentation does require programming backgrounds (Java, Scala, Python) but I tried to cut it to the minimum.

To my surprise, this seminar had around 35 percipient (which was way more than I expected), and got 4.91/5 in the feedback. I presented a similar session in another conference back in March but this is an updated version of that slide deck.

Here is the Agenda:

  • The Big Data problem and possible solutions
  • Basic Spark Core
  • Working with RDDs
  • Working with Spark Cluster and Parallel programming
  • Spark modules: Spark SQL and Spark Streaming (by Ishay Wayner)
  • Performance and Troubleshooting

Read more

,

Oracle Week 2016: Advanced PL/SQL Optimizing for Better Performance (slides)

This is the presentation for Oracle Advanced PL/SQL session I did in Oracle Week 2016, a few weeks ago.

I wrote about the Oracle Week conference in the previous post so I won’t go over that again… 🙂

This presentation was all about PL/SQL. Most of it are things that are quite some old, but for some reason people seem to miss out on them. The presentation is divided into 3 parts.

The first one is development and it takes up most of the day. We talk about complex data types, cursors and things that are into PL/SQL should probably know. In this part I also try to add some new features and stuff that people will find interesting, or else it gets really boring. The second part is about the compilation processes and the last part is about tuning.

This year presentation was quite big – around 40 people in the class and got excellent feedback: 4.97/5 for overall satisfaction.

Here is the agenda:

  • Developing PL/SQL:
    • Composite datatypes, advanced cursors, dynamic SQL, tracing, and more…
  • Compiling PL/SQL:
    • Dependencies, optimization levels, and DBMS_WARNING
  • Tuning PL/SQL:
    • GTT, Result cache and Memory handling
  • Oracle 11g, 12cR1 and 12cR2 new useful features
  • SQL Developer Command Line tool

Read more

,

Oracle Week 2016: Oracle Database Advanced Querying 2016 (slides)

This is the presentation for Oracle Advanced Querying session I did in Oracle Week few weeks ago.

Since most of my readers aren’t from Israel, let explain a bit about this event. Oracle Week is by far the biggest Oracle oriented conference/event in Israel. It’s a 5 days conference that is being organized by John Bryce Education (a technology schooling company) and has around 1500 participants each year. It’s an educational event – meaning, as less promotion/sell speeches as possible.

One of the main differences between this event and other conferences is the platform: instead of having five or six 45-60 minutes sessions, back to back – the event has 10-12 different day long sessions every day, for 5 days. Each session is from 9:00 until 16:30 (with breaks, of course) so there are enough time to go over many different aspects of the same topic.

This session is one of the crown jewels. For years it was considered to be the largest session in the conference (with 60-80 attendees) and couple of years ago it landed in my laps.

This year session was very good. The participant reviews was around 4.8/5 and course material were around 4.9/5 which was awesome.  We had around 45 people in the class what smaller than last year but still the biggest session of the day.

This year agenda included some of 12.2 new features (the ones I got to actually test, not all of them) which was a big improvment on last years session.

In the agenda:

  • Aggregative and advanced grouping options
  • Analytic functions, ranking and pagination
  • Hierarchical and recursive queries
  • Regular Expressions
  • Oracle 12c new rows pattern matching
  • XML and JSON handling with SQL
  • Oracle 12c (12.1 + 12.2) new features
  • SQL Developer Command Line tool

Read more