This Friday Philosophy was prompted by a discusion between some OakTable people about did we think “good” DBAs should know PL/SQL? Not all the tricks, bulk processing, using all the built-ins, but able to write PL/SQL with cursor loops and some exception handling that could eg cycle thorough tables and archive off data or implement some logon trigger functionality.
My response was “that depends on the age of the DBA”.
If you had asked me that question 15 years ago I would have said Yes, a good DAB would and should know PL/SQL.
If you had asked me 10 years (more...)
The latest version of Alexandria, the utility library for PL/SQL
, is now available for download
. The previous version has been downloaded more than 2,000 times in the last 8 months.
file contains a fairly detailed list of additions, enhancements and bug fixes. Below are some of the more noteworthy changes:
Improved installation script
You can now choose between installing the full library (close to 50 packages as of this version), by running the main /setup/install.sql
script, or you can install just the core set of packages via setup/install_core.sql
and then choose additional sets of (more...)
In every other profession having a 20 year experience is a good thing, in ours you are treated as a has-been who is kept around only to maintain the legacy system. This is insane.
Native PLSQL execution has changed significantly since the version 10G. The effects are less than spectacular, in the ideal case I got about 10% of the performance boost. This is much easier to administer now, there are no shared libraries in the file system, as was the case with version 10G. Oracle has re-invented the dlopen routine, with the shared library residing in the database. The gory details can be found at:
On the same web site, there is also a PDF version of the same page but WordPress displays some inane commercial, rather than to (more...)
Carlos Sierra of Oracle Corp. created a very useful tool called TRCA, intended for analyzing Oracle trace files, much like tkprof. The tool is written entirely in PL/SQL, so there is no command line interface distributed with the tool. It is easy to write a command line wrapper, like this one:
The only problem with the TRCA is the fact that it is written entirely in PL/SQL, which makes it significantly slower than orasrp or Method-R profiler, written in D or Perl, respectively. That can be helped by using native compilation. It is not enough to (more...)
Many companies tend to have mixed environments, with Oracle databases (and PL/SQL) running business-critical back-office systems, as well as Microsoft products for front-office applications such as email, word processing and collaboration/file sharing (ie Outlook, Office and Sharepoint), and of course the desktop operating system itself (Windows, with Internet Explorer, Internet Information Server, all integrated via Active Directory).
Working in these mixed environments means that you, as an Oracle PL/SQL developer, frequently need to work/integrate with various Microsoft technologies from PL/SQL.
Over the last couple of years, I've written a number of blog posts on this topic. This post is just (more...)
In regular SQL, you can use the DISTINCT qualifier with the COLLECT function.
Here it removes the duplicates for PETER and DAVID.SQL> select cast(collect(first_name) as sys.dbms_debug_vc2coll) 2 from HR.employees 3 where job_id = 'SA_REP' 4 and manager_id in (147,145);
CAST(COLLECT(FIRST_NAME)ASSYS.DBMS_DEBUG_VC2COLL)--------------------------------------------------------------------------------DBMS_DEBUG_VC2COLL('Peter', 'David', 'Peter', 'Christopher', 'Nanette', 'Oliver', 'Clara', 'Danielle', 'Mattea', 'David', 'Sundar', 'Amit')
SQL>SQL> select cast(collect(distinct first_name) as sys.dbms_debug_vc2coll) 2 from HR.employees 3 where job_id = 'SA_REP' 4 and manager_id in (147,145);
CAST(COLLECT(DISTINCTFIRST_NAME)ASSYS.DBMS_DEBUG_VC2COLL)--------------------------------------------------------------------------------DBMS_DEBUG_VC2COLL('Amit', 'Christopher', 'Clara', 'Danielle', 'David', 'Mattea' (more...)
Last week the OTN SQL and PL/SQL Forum hosted of those threads which generate heat and insight without coming to a firm conclusion: this one was titled WHEN OTHERS is a bug
. Eventually Rahul, the OP, complained that he was as confused as ever. The problem is, his question asked for a proof of Tom Kyte's opinion that, well, that WHEN OTHERS is a bug. We can't proof an opinion, even an opinion from a well-respected source like Tom. All we can do is weigh in with our own opinions on the topic.
One of the most interesting things in (more...)
Extreme programming is old hat now, safe even. The world is ready for something new, something tougher, something that'll... break through. You know? . And here is what the world's been waiting for: Transgressive Programming.
The Transgressive Manifesto is quite short:
It's okay to use
The single underlying principle
is that we value willful controversy over mindless conformity.
I do have a serious point here. Even programmers who haven't read the original article (because they can't spell Dijkstra and so can't find it through Google) know that
GOTOs are "considered harmful". But as Marshall and Webber point out, (more...)
Tom Kyte on many new Database 12c features: http://t.co/z98lLxHH Via: (https://twitter.com/lucasjellema/status/257019546974683136) Filed under: DB Architecture, Oracle 12c, plsql Tagged: LinkedIn, New Features, OOW, Oracle 12c, Tom Kyte
We were recently looking for a way to easily anonymize some customer data, specifically bank account numbers.
Part of our testing mechanism is to verify that a bank account and sort-code combination is valid and we retrieve the bank details for that combination (using a commercial account lookup service). So we couldn't just replace the sort-code and/or account number with random numbers.
Conversely, replacing all account numbers with a handful of known, "safe" working values would lead to skewed data spreads, so that wouldn't work.
A better solution is to shuffle the existing data, moving the sort-code and account (more...)
One of things I don't like about Oracle SQL Developer is that if you are browsing and clicking on tables, it can automatically open the table on the right side of the IDE.There is a simple way to switch that off, just heard how to switch this feature off. Navigate to the Preferences settings:
Goto Database >> Objectviewer, and uncheck the tickbox labelled "Open Object on Single Click"
And that's it.
Yesterday Bryn Llewellyn, Distinguished Product Manager, did a session called "PL/SQL Enhancements brought by the latest generation of database technology". The room was packed. For the upcoming release of the Oracle 12c database the enhancements were broken into three areas:
SQL vs NoSQL: Third International NoCOUG SQL & NoSQL Challenge sponsored by Pythian
As published in the 102nd issue of the NoCOUG Journal
THE WICKED WITCH OF THE WEST NEEDS HELP
BE IT KNOWN BY THESE PRESENTS that the Wicked Witch of the West needs your help to create
In my last blog post
I described using the DBMS_DATAPUMP and DBMS_JOB packages to automate database schema backups from the database itself, rather than using batch files to do so. I also mentioned that "since the files are written to the database server itself, you need some kind of process to move the files to another server or storage location, so the backups don't disappear along with the database if the database server itself is somehow lost or corrupted. [One] option is to upload the backup file from the database to some online ("cloud") storage service, such as Amazon S3. (more...)
Usually, database backups are the responsibility of DBAs, and not something that developers really care or think too much about. However, if you are a lone developer, or part of a small team that doesn't have the luxury of having a dedicated DBA, then you might have to deal with backups yourself.
There are several ways to make Oracle backups; what I will be concentrating on here is the "Data Pump Export" method. You may already be familiar with the command-line "expdp" command which allows you to create a dump (.dmp) file containing your database objects (schemas, tables, procedures, (more...)
Para quem usa o SQL Navigator 6.7 e tem notado que "às vezes" prende, tal parece ter origem na "feature History" que guarda os SQL (tec..) efetuados e permite uma pesquisa nos mesmos. É possivel efetuar uma "limpeza dos comandos efetuados" antes de uma data data ou toidos de modo a evitar que o ficheiro fique muito grande (parece que apartir de 600K é que o problema é encontrado) "Before you deleting your history file, you can have a backup if needed, the history file is in: xp: C:\Documents and Settings\UserName\Application Data\Quest Software\SQL Navigator 6.6.0\Unified (more...)
Just recently a service request was opened with Oracle Support regarding the “when others then null” exception handler when it was found in an Oracle-supplied form for the Oracle Inventory application from the E-Business suite. It appears the person who opened the SR believes (and rightly so) this is not the most informative of exception handlers nor is it proper coding practice; the request was opened in hopes of disallowing such constructs. I originally posted:
“Sadly Oracle Support may not do anything about this for two reasons:
1) It’s valid code.
2) It’s not causing another error to surface.
The following SQL pattern can be used to simulate DML operations on XML data by utilizing XU (XQuery Update) functionalities.
This query will do the following XML data transformation by using XU insert/delete/rename/replace statements.
1) Convert all the XML Attributes to Elements. ( XU Delete & Insert)
2) Change the (more...)
Starting from 11.2 its possible to use SSL client certificates to authenticate yourself to a remote web service using SSL client certificates. I did not find much information on it using Google or documentation, that is why I'm writing this post.
Please refer to this post by Tim Hall to get started on connecting to HTTPS service using UTL_HTTP, all of this is needed before continuing with SSL client certificate authentication.
The first thing you need is to generate user certificate request inside Oracle Wallet, sign it by CA and load the returned certificate back to Wallet. I'm not (more...)