Shell Variable Indirection in a Database Build Script
Ever wanted to set a variable to the name of another variable, and from there, somehow get the value of the other variable? I did, recently, and this is what I had to do. I work with numerous databases...
View ArticleTnsnames Checker Utility
I have made available for free a utility that will parse a tnsnames.ora file and report back on anything that it doesn’t like such as duplicate entries, invalid characters, redefinitions of parameters,...
View ArticleConvert a Tnsnames.ora File to a Toad Session Import File
Have you ever wanted a quick and easy way of converting all those database entries in your tnsnames.ora file, into something that Toad can use to populate the “sessions” grid? Read on. Normally Toad...
View ArticleBeware of the Silent Database Killer!
There is, out there in Oracle Land, a silent database killer. You never know when it will strike and it affects all databases right up to and including 12c. When it strikes, it does so silently, there...
View ArticleOracle RAC – Flashback Database
It was a simple enough request, flashback this particular database to a guaranteed restore point. What could possibly go wrong? Database names etc have been changed to protect the innocent, and me! $...
View ArticleRMAN Error ORA-15028: Archived Log Not Dropped.
The following error popped up in an RMAN backup which was attempting to delete archived logs that had been backed up twice, at least, and were created more than two days ago: RMAN-03009: failure of...
View ArticleAsmcmd or ASM Instance Backups or Queries Hang
Sometimes an ASM instance hangs for no apparent reason and this causes problems when backing up the ASM Metadata. Running queries against V$ASM_DISK and similar views may also hang. This blog post...
View ArticleHow to Fix a Broken ASM SPFILE, held within ASM
My server rebooted itself and when it came back up, none of the databases or ASM had restarted. Everything is 11.2.0.3 or 11.2.0.1 with ASM being 11.2.0.3 – so Oracle Restart should have kicked in. As...
View ArticleImpdp Hangs Importing Materialized Views
A simple exercise to refresh a schema in a test database caused no end of problems when it hung at 99% complete. The last message on screen indicated that it was importing the Materialized Views (yes,...
View ArticleTnsnames.ora Parser
Have you ever wanted to use a tool to parse the manually typed up “stuff” that lives in a tnsnames.ora file, to be absolutely certain that it is correct? Ever wanted some tool to count all the opening...
View ArticleAdd and Drop Discs From ASM in a Single Command
Recently I was tasked to do something that I hadn’t done before. I was required to swap out all the existing discs in the two diskgroups +DATA and +FRA, with minimal downtime. Almost all the places I...
View ArticleSo, How Do You Change a User’s Password
The Oracle database allows the users to change their passwords as follows: SQL> ALTER USER me IDENTIFIED BY my_new_password; or, alternatively, to use the PASSWORD command, which prompts for the old...
View ArticleInteresting Data Guard Problem
While checking out a dataguarded database prior to being handed over into production, I needed to test that both OEM and dgmgrl could carry out a switchover and failover from the (stand-alone) primary...
View ArticleCannot Send Emails, or Read Web Servers From Oracle 11g
Accessing a web server or an email server, directly from within a database, used to be quite simple. However, it all stops working at 11g. Why is that and what can be done to fix it? Introduction Prior...
View ArticleTransportable Tablespace Migrations with Expdp/Impdp
In the old days of exp/imp doing a Transportable Tablespace export/import was relatively simple – unless you had Spatial data, in which case, it wasn’t. Then we got hold of expdp/impdp and it became...
View ArticleSetting Oracle Environment in Scripts
A quickie! How do you set the correct Oracle environment in scripts? Do you hard code? You better not. I’ve lost count of the times I’ve ended up with, for example, a 10g database running with bits of...
View ArticleTNS-01189: The listener could not authenticate the user
Ever see this error? I have, just today. An interesting one to debug. I got there in the end though. The database is running on a two node VERITAS cluster. To protect the innocent, I shall refer to...
View ArticleEver deleted a Data File From a Running Database?
http://jarneil.wordpress.com/2013/04/23/recovering-from-rm-rf-on-a-datafile/ has all you need to know to help avert a total disaster. Tanel Poder, who knows these things, advises that the file should...
View ArticleSwap 2 Values, in SQL, Without Using a Temporary Variable
Recently, I saw a mention of an interview question for SQL developers. It was something along the lines of: There is a table with a sex column. It has been discovered that the values are swapped around...
View ArticleStatspack Snapshot Fails ORA-01400 Cannot Insert NULL …
Oh hum. An 11.2.0.3 Enterprise Edition production database has statspack taking a regular snapshot under the control of a dbms_scheduler job. For no apparent reason, the snapshot started failing with...
View ArticleInternet Explorer Won’t Upload Files to MOS?
Are you forced to use Internet Explorer at work? Are you, like me, forced to use an old, insecure, broken version of IE at work, because it’s the Government Standard version? And are you, like me,...
View ArticleORA-03262 While Dropping Empty Datafile
Tired of trying to drop empty datafiles from a tablespace, which you know is empty? Keep getting errors telling you the data file isn’t empty? Getting frustrated with the whole thing? Me too. This link...
View ArticleThis Listener Problem is Driving Me Mad!
I have been looking at this far too long, and I’m stumped. I resolved a similar problem yesterday on another server. That was down to the ORACLE_HOME setting in listener.ora having a ‘1’ in it rather...
View ArticleSpatial Indexes and Oracle Errors. How to fix.
If, like me, you have suffered from ORA-29902 Error in executing ODCIIndexStart() routine errors where Spatial indexes are involved, the following might help you fix it. The error involved in the...
View ArticleOracle Proxy Users – What Are They Used For?
This post has also been categorised under “rants and raves” as you will see below! Oracle 10g was the first time that proxy users could be used easily from SQL. Prior to that only Java and/or OCI...
View ArticleOracle RMAN for Beginners – Part 9
It’s been a while since the previous post in this series, but I’m back again. This time out, we are looking at incremental backups. What they are, how they work, and how – of course – to take them and...
View ArticleOracle RMAN for Beginners – Part 10
A slight variation on the incremental backups. In this (short) article, I demonstrate the use of database file copy backups which are themselves updated on a regular basis to avoid having to restore...
View ArticleIntroduction to Oracle Datapump – Part 1
Oracle Datapump, aka expdp and impdp were introduced at Oracle 10g to replace the old faithful exp and imp utilities. Many DBAs around the world find that it’s hard to change from what we know like the...
View ArticleIntroduction to Oracle Datapump – Part 2
In this, the second part of the Introduction to Oracle Datapump mini-series, we take a look at importing dump files using impdp. If you missed the first part which concentrated on exporting with expdp,...
View ArticleUTL_FILE Operation fails with ORA-29283
A process that called ”UTL_FILE” was failing in the test system, but worked fine with exactly the same set up in production. Why? The error was ORA-29283: invalid file operation. How do we find out...
View ArticleArchivelog Deletion Policy Changes Don’t Always Take Immediate Effect.
The standby database had the RMAN archivelog deletion policy set to ‘NONE’ instead of being ‘APPLIED ON ALL STANDBY’ and the FRA filled up to within an inch of its life, or 99% of its allocated quota!...
View ArticleTraceMiner – An Oracle Utility to Mine 10046 Trace Files
Have you ever needed to trawl through an Oracle Trace file to extract the SQL statements executed and found a whole load of bind variables have been used, so you need to find the BINDS section, extract...
View ArticleTnsnames.ora, IFILE and Network Drives on Windows
I’ve recently begun a new contract migrating a Solaris 9i database to Oracle 11gR2 on Windows, in the Azure cloud. I hate windows with a vengeance and this hasn’t made me change my opinion! One of the...
View ArticleRMAN Connection Troubles, RMAN-03010 & RMAN-10038
For no reason, after many weeks of use, RMAN suddenly cannot connect: rman target sys/******@dbadb01 catalog ... ... RMAN-00571: =========================================================== RMAN-00569:...
View ArticleHow to Start an Oracle Database When You Are Not in the DBA Group
This applies to Linux, Unix as well as Windows, but affected me on a Windows 2012 Server running Oracle 11.2.0.4 Enterprise Edition. My user on the server was an administration user, but not in the...
View ArticleDropping Temporary Tables (With Bonus, Broken Check Constraints!)
I found a broken check constraint, one that simply wouldn’t work, on a database. It was created as: ... CHECK(COLUMN_NAME IN ('Y','N',NULL)) ; Try it yourself, it doesn’t work! Anyway, I needed to find...
View ArticleWhich Extra Cost Oracle Options is my Windows Server Running?
It’s always nice to know which extra cost Oracle options are enabled, whether deliberately or silently as the result of some patching that has taken place. Copy and paste the code below into a Windows...
View ArticleOraenv for Windows
Having recently had to learn a whole new way of working when I took on a contract migrating a database to the Windows “cloud”, I realised that there’s no equivalent to the useful Unix oraenv utility. I...
View ArticleOraenv for Windows – Updated
I recently posted a useful oraenv for Windows utility. This has been updated so that you can run it in batch files by passing the desired Oracle SID on the command line. Details at...
View ArticleInteresting Foible with Oracle Dates
I have a table with dates in, and some NULLs. Two people, on the same database, running the same SELECT query, in the same schema, with the same privileges, get vastly differing results. Why? Fine...
View ArticleTraceMiner Utility – Updated
TraceMiner has been updated after a couple of foibles were found during the processing of a trace file. The version has been bumped to 0.19 as of today, 2nd December 2016. The bugs fixed were: The...
View ArticleTraceMiner Updated Again
TraceMiner has been updated again. Mostly bug fixes, but there’s a little enhancement too. The current release is 0.21. TraceMiner is a utility that parses an Oracle trace file, with binds listed...
View ArticleTraceMiner2 and TraceAdjust
TraceMiner has been updated and rewritten. Numerous bugs and foibles have been fixed. TraceAdjust is a new, useful, utility to carry out some pre-processing on a trace file before you have to use your...
View ArticleIMPDP Hangs, or Appears to Hang – But Has it?
You know the score, you are running an impdp and it looks to have hung up. You’ve watched the log file (or on screen messages) and it’s sitting at something like: Processing object type...
View ArticleSnorkelling in the Oracle Listener Logs.
(Snorkelling is not quite as in depth as a “deep dive”!) Attempting to parse a listener.log will probably bend your brain, but I needed to do it recently to determine which unique servers and/or...
View ArticleGenerate Entity Relationship Diagrams from a SQL Script.
Sometimes, just occasionally, you find yourself as a DBA on a site where, for some strange and unknown reason, you don’t have an Entity Relationship Diagram (ERD) for the database that you are working...
View ArticleRMAN-20033: control file SEQUENCE# too low
Have you ever seen the error RMAN-20033: control file SEQUENCE# too low and wondered what could be causing it? If you look on MOS, you will probably see that the error is caused by the control file in...
View ArticleENQ: TS – Contention
Thanks to http://www.dbaglobe.com/2010/08/drop-temporary-tablespace-hang-with-enq.html it was a simple matter to resolve the above enqueue wait on an attempt to drop a previously default temporary...
View ArticleOracle Deadlock Analysis
There’s a new utility to assist in diagnosing the underlying cause of Oracle deadlocks. Interested? You can download source code as well as binaries for Linux and Windows at...
View ArticleBuild 64bit OCILIB Libraries for CodeBlocks
I tend to compile with gcc, in a bash session, on Windows 7. I use Code::Blocks as my IDE of choice and one of my projects, well, quite a few, use the excellent OCILIB library for accessing Oracle...
View Article