Просторы интернета

19 Февраль 2015
Earlier
Вт, Июн 13, 2017
Oracle XML Object-Relational Storage

After the post on models for storing XML data in Oracle and examples of binary XML storage, here's a detailed look at the rigorous and performant structured XML storage or object-relational storage.

Object-relational storage of XML data is based on "shredding" the XML content into a set of SQL [...]

Source: www.oratable.com
Пн, Июн 12, 2017

If you're familiar with SQL Profiles and SQL Baselines you may also know about SQL Patches – a feature that allows you to construct hints that you can attach to SQL statements at run-time without changing the code. Oracle 12c Release 2 introduces a couple of important changes to this [...]

Source: jonathanlewis.wordpress.com
Пт, Июн 09, 2017

At the end of my presentation to the UKOUG Database SIG yesterday I summed up (most) of points I'd made with a slide making the claim:

In 12.2 you can: Convert a simple table to partitioned with multi-column automatic list partitions, partially indexed, with read only segments, filtering out unwanted data, [...]

Source: jonathanlewis.wordpress.com
Ср, Июн 07, 2017
Oracle XDB Binary XML Storage

The previous post on storing XML data in Oracle gave an overview of binary XML storage: compact, flexible, compatible with XML data with or without associated XML schema.

This post shows working examples of binary XML storage

1.1. without XML Schema
1.2 with XML Schema

The scripts below [...]
Source: www.oratable.com
Пн, Июн 05, 2017
Storing XML Data in Oracle

Oracle provides an abstract SQL data type called XMLType for storing XML data in the database. You can create an XMLType table, or an XMLType column in a relational table, to persist XML data.

Different storage models are available in Oracle to best fit the nature of the XML data [...]

Source: www.oratable.com
Чт, Июн 01, 2017

While reading a blog post by Maria Colgan a couple of week ago I came across an observation about histograms that I'd not noticed before; worse still, it was a feature that seemed to make some “damage-limitation” advice I'd been giving for years a really bad idea! The threat [...]

Source: jonathanlewis.wordpress.com
Пн, Май 29, 2017
SQL XML in Oracle: Generating XML from Relational Data

Oracle has built-in functions to convert relational data into XML format easily. These functions comes under the umbrella of SQL/XML, a specification that supports the mapping and manipulation of XML from SQL.

This post shows you how to generate XML from relational data using Oracle SQL/XML functions as building blocks.

Let's [...]

Source: www.oratable.com
Чт, Май 25, 2017

Headline – if you don't want to read the note – the /*+ parallel(N) */ hint doesn't mean a query will use parallel execution, even if there are enough parallel execution server processes to make it possible. The parallel(N) hint tells the optimizer to consider the cost of using parallel [...]

Source: jonathanlewis.wordpress.com
Чт, Май 25, 2017
Активно читающий запрос из AWR: , заметность которого, похоже, обусловлена выбором и активным использованием, по-видимому, не самого оптимального плана 2944350538: — ASH TOP5: самые длинные выполнения использовали неудачный план 2944350538 — всё сходится) Сравним Outline удачного и неудачного планов: — отличия в LEADING и методе соединения "RESULT_PAGE_DATA@SEL$4 (*) Из ASH [...]
Source: iusoltsev.wordpress.com
Вт, Май 23, 2017

There's so many things that can go wrong when you start using tables with more than 255 columns – here's one I discovered partly because I was thinking about a client requirement, partly because I had a vague memory of a change in behaviour in 12c and Stefan Koehler [...]

Source: jonathanlewis.wordpress.com
Вс, Май 21, 2017
В дополнение к старому описанию особенностей DS версии 10.2 — Dynamic Sampling при индексном доступе к данным — на том же тесткейсе наблюдал как измененилось поведение Old Style Dynamic Sampling (DS) и Adaptive Dynamic Sampling (ADS) в новых версиях Oracle 12c Итак, тестовый DDL без изменений: 1) Old Style Dynamic [...]
Source: iusoltsev.wordpress.com
Пт, Май 19, 2017

This is one of my “black hole” articles – I drafted it six months ago, but forgot to publish it.

A recent post on OTN highlighted some of the interesting oddities that appear when you create tables with more than 255 columns. In fact this was a more subtle case [...]

Source: jonathanlewis.wordpress.com
Чт, Май 18, 2017
Fuzzy Match using UTL_MATCH

Oracle's UTL_MATCH package contains functions to perform fuzzy matching between two strings based on one of these algorithms:

Levenshtein Distance Jaro-Winkler Distance

Let's understand the algorithms and see UTL_MATCH subprograms in action.

Note: It is not necessary to understand the nitty-gritties of the algorithms to use UTL_MATCH. The deep dive is for [...]

Source: www.oratable.com
Пн, Май 15, 2017
SQL Find Differences between Two Tables

In a recent project, a "shadow" table had to be compared periodically with its main source table to identify the differences between the two tables.

The nature of differences fell into one of these buckets:

Insert Required [INS]: If the source had rows not present in the shadow table Update Required [UPD]: [...]
Source: www.oratable.com
Вс, Май 14, 2017
, т.е. в случаях, когда использование VARCHAR2-функций типа LISTAGG заканчивается LISTAGG_CLOB Использовавшаяся поначалу User-Defined Aggregate Function типа LISTAGG_CLOB в плане скорости выполнения показывала самые грустные рез-ты: *) — пересылая по SQL*Net 50MB клиенту и 27MB обратно(!), совершая 400,000(!) roundtrip-ов, что, вероятно, является неприятной особенностью передачи CLOB данных и коственно подтверждается [...]
Source: iusoltsev.wordpress.com
Чт, Май 11, 2017
Convert VARCHAR2 to DATE

It is well-acknowledged that attributes in the database should use the correct datatypes (numbers should go into NUMBER columns, dates into DATE columns, etc). Storing date values in VARCHAR2 columns is an open invitation for bugs and issues due to date format such as the one I'm about to [...]

Source: www.oratable.com
Пт, Май 05, 2017
наблюдались в виде: — очень похоже на Bug 17323222 ORA-1555 / ORA-3170: deadlocked on readable physical standby (undo segment x) on ADG, т.е. ORA-3170 аналогично указывает на несуществующий SEGMENT_ID, а ORA-1555 возникает на коротком Query Duration Похоже, лечится изменением параметра: — случайно в то же время применённым для исправления ORA-07445 [...]
Source: iusoltsev.wordpress.com
Пн, Май 01, 2017

A recent posting on SQL.RU asked why Oracle doesn't raise such errors like “ORA-00979 not a group by expression” during PL/SQL compilation. Since I couldn't find a link to the answer (though I read about it many years ago, but I don't remember where…), I've decided to post [...]

Source: orasql.org
Пт, Апр 21, 2017

I've wrote in previous post

4. Next row piece can be stored in the same block only with inserts. When you run update, oracle will place new row piece into another block.

But it's not valid anymore 🙂 Since 12.2 Oracle optimizes updates too.
You can check it on 12.2 and [...]

Source: orasql.org
Вт, Мар 28, 2017
Interval Range Partitioning

Oracle 11G brought with it a beautiful new twist to range partitioning – the ability to create partitions on-the-fly rather than having to pre-create all partitions.

Hello interval partitioning.

Before Oracle 11G, DBAs would have to define all the partitions on a partitoned table and ensure there were no "cracks" between [...]

Source: www.oratable.com
Ср, Фев 22, 2017
The plan_baseline hintset is just the list of hints SPM tried to use to reproduce the plan В ТОПе Library Cache периодически появлялся непривычный объект: необычайно крупного размера SHARABLE_MEM > 600MB с цифровым наименованием, под коим числилось 2 объекта: — судя по наименованям типов, относящихся к SQL Management Base, где [...]
Source: iusoltsev.wordpress.com
Пн, Фев 20, 2017

Recently I have had an issue with slow unicode migration of the database upgraded from 10g to 12.1.0.2. The main problem was a table with xmltype: we spent about 4 hours for this table(~17GB) during test migration, though all other tables (~190GB) migrated just for about 20 minutes.
We used DMU(Database [...]

Source: orasql.org
Вс, Фев 12, 2017

You may know about Intra-block row chaining which may occur when the number of columns in a table are more than 255 columns.
But do you know that intra-block chaining works with inserts only? not updates!

Documentation says:

When a table has more than 255 columns, rows that have data after the 255th [...]

Source: orasql.org
Пт, Фев 10, 2017
Joins

For those new to SQL, terms like INNER JOIN and OUTER JOIN can seem like fearsome foes. As the wise say, understanding conquers fear. Behind those geeky terms lie concepts rooted in simple real-world knowledge.

Here's a quickstart guide to these two basic joins in SQL: INNER JOIN and OUTER JOIN.

Case [...]
Source: www.oratable.com
Вт, Фев 07, 2017
Grant Select on V$ Views

When querying v$instance or v$session[1] as a non-admin user, you might come across this error:

SQL> select version 2 from v$instance; from v$instance * ERROR at line 2: ORA-00942: table or view does not exist

The error suggests that the non-admin user does not have the SELECT privilege [...]

Source: www.oratable.com
Вт, Янв 31, 2017
Database Version

Just as you sometimes need to find out your database name when connected to Oracle, you may also need to find out your database version.

Here's a rundown of ways to identify the Oracle database version using SQL and PL/SQL.


Query V$VERSION

V$VERSION displays version numbers of core library components [...]

Source: www.oratable.com
Пн, Янв 30, 2017
В процессе подготовки семинара, столкнулся с любопытным случаем, для адаптивного плана выполнения: *) в условиях реального отсутствия какого-либо Adaptive Bitmap Pruning! Неадаптивный план: Наибольший диссонанс вызвал вывод скрипта отличий секций Notes и Outline Data из OTHER_XML вышеприведённых планов выполнения: — точнее даже, несовпадение хинтов в Outline для планов с совпадающими [...]
Source: iusoltsev.wordpress.com
Вс, Янв 29, 2017
Коллега Леонид Борчук в процессе практического применения скрипта sql_profile_from_sql.sql обнаружил ошибку: и указал на ограничение: — т.е. нашёл-таки запрос с хинтом длиною более 500 символов! — для запросов OEBS нет пределов:) А, поскольку, в мировом масштабе, эта проблема уже была разрешена Carlos Sierra — Running "coe_xfr_sql_profile.sql Script (Shipped with SQLT) [...]
Source: iusoltsev.wordpress.com
Вт, Янв 24, 2017
Access Control Lists in Oracle

I recently upgraded Oracle XE from 10G to 11G, and found that none of the PL/SQL code using UTL_HTTP was working after upgrade. The code failed with the error:

declare * ERROR at line 1: ORA-29273: HTTP request failed ORA-06512: at "SYS.UTL_HTTP", line 1130 ORA-24247: network access denied by access control list (ACL) ORA-06512: at [...]
Source: www.oratable.com
Ср, Янв 11, 2017
UNPIVOT: Transpose Columns to Rows

Sometimes we need to transpose columns as rows in SQL. Oracle 11G onwards, this requirement can be easily implemented using the UNPIVOT clause.

A typical scenario:

Customer data is validated against a set of audit checks and the validation results are stored against the Customer Id as Y/N flags. The checks [...]

Source: www.oratable.com
Комментирование отключено.