This video and set of resources is a follow up to the webinar broadcast by Red Gate on 13th September 2012. Please see further down the page for a follow up to the Q+A.
The video above is accompanied by the following downloadable scripts:
- 01_show_db_version.sql
- 02_show_dbms_assert.sql
- 03_show_parallel_execution.sql
- 04_show_utl_match.sql
- 05_show_dbms_alert.sql
- 06_show_utl_compress.sql
- 07_show_utl_inaddr.sql
- 08_show_owa_util.sql
- 09_show_apex_util.sql
- user_and_objects.sql
I will make the test data available on our FTP server as soon as possible.
Summary
In this session we will take a look at some of the lesser known PL/SQL packages that come with the Oracle database. Packages like DBMS_ASSERT, DBMS_CRYPTO and DBMS_PARALLEL_EXECUTE. We will take a look at some of the utility packages that could come in handy such as UTL_NLA and UTL_MATCH, look briefly at some of the helper functions from UTL_INADDR and UTL_URL. At the end, I will take a look at some of the good packages from the Oracle community that will help you get your work done faster and smarter.
A live Q&A session with Morten Egan follows the presentation.
Follow up from the QA
Question: Could the compressed data be presented as a virtual column instead of a pipelined function?
I did a quick test, and yes it can. The code to do it, is here:
create or replace function get_compressed_content(compressed_in blob) return varchar2 deterministic as l_blob blob := empty_blob; ret_text varchar2(4000); begin dbms_lob.createtemporary(l_blob, true); l_blob := utl_compress.lz_uncompress(compressed_in); ret_text := utl_raw.cast_to_varchar2(l_blob); dbms_lob.freetemporary(l_blob); return ret_text; end get_compressed_content; / create table do_compress2 ( nyhed_id number, nyhed_titel varchar2(4000), nyhed_content_compress blob, nyhed_contet_uncompress varchar2(4000) generated always as (get_compressed_content(nyhed_content_compress)) virtual ); insert into do_compress2 (nyhed_id, nyhed_titel, nyhed_content_compress) select nyhed_id, nyhed_titel, do_compress_content(nyhed_content) from no_compress; select nyhed_contet_uncompress from do_compress2;
Question: Are any of the packages specific to a special edition of Oracle?
All the packages are available on both Standard Edition and Enterprise Edition.
Question: What is the URL to the site, where the compare tool ran?
The url is www.dbping.com/stats/compare_ui.welcome
Please note that I have noticed a couple of people just went to the main site www.dbping.com, and registered there instead. That site is a different product, but you are more than welcome to use that as well
It is a tool to do a simple monitoring of your database uptime. Think of it as a database version of pingdom.com.











12 Comments
Donna A
13/09/2012
This presentation was very informative and increased my awareness of available DB packages for use as a PL/SQL DB Developer. Thank you Morten.
Anton
14/09/2012
when video will be available ?
All Things Oracle
14/09/2012
Hi Anton,
The video has now been published above.
Thanks,
James
prashant
14/09/2012
utl_match.edit_distance
utl_match.edit_distance_similarity
utl_match.jaro_winkler
utl_match.jaro_winkler_similarity
what is the difference between these functions , and what is that normalize value mean , for utl_match.edit_distance_similarity
Morten Egan
17/09/2012
With,
S1 = martin
S2 = morten
SQL> select 2 to_char(utl_match.edit_distance('Martin', 'Morten'),'999') "Edit Distance" 3 , to_char(utl_match.edit_distance_similarity('Martin', 'Morten'),'999') "Edit Distance Similarity" 4 , to_char(utl_match.jaro_winkler('Martin', 'Morten'),'999d9999') "Jaro Winkler" 5 , to_char(utl_match.jaro_winkler_similarity('Martin', 'Morten'),'999') "Jaro Winkler Similarity" 6 from dual; Edit Edit Jaro Wink Jaro ---- ---- --------- ---- 2 67 ,8000 80 SQL>This is the difference:
edit_distance - Equals the number of characters we either have to add/change/remove, to get from S1 to S2. So we need to change the "a" and the "i" to get from martin to morten, hence the value 2.
edit_distance_similarity - Equals the percentage of characters that are the same, in S1 and S2. So out of 6 characters in S1 and S2, 4 are alike. So 67 = (100/6)*4 ~ 66.666 ~ 67%, hence the value of 67.
The Jaro Winkler score of 0,800 is a function of the Jaro Winkler algorithm as described here http://en.wikipedia.org/wiki/Jaro-Winkler (better to read that, then for me to try and explain it :))
jaro_winkler_similarity - Is simply the 0,800 expressed in a percentage.
prashant
17/09/2012
It was really good example and example , very impresseive , thanks alot
prashant
14/09/2012
which is the best possible way to generate xml files
Morten Egan
17/09/2012
That depends on where data is coming from, and how it should be formatted. Could you please write a little more about what your problem is, and what you are trying to achieve.
prashant
17/09/2012
I have a table, and xml needs to be generated out of that ,
columns of the table to be xml tags, date and table count also be be tags
All Things Oracle
18/09/2012
Hi Prashant,
Does the following article help you?: http://allthingsoracle.com/generating-xml-from-sql-and-plsqlintroduction-part-1/
James
prashant
18/09/2012
No , this is just to print data, in xml format , insted it should physically generate xml , like in uti_file utility , something like xmldom
Morten Egan
18/09/2012
I am teaching a weblogic course today, but will answer your question tonight, when I'm home again.
No trackbacks yet.