Posts

Cost of sorting (as in money cost)

 I'm watching a video on query tuning in Microsoft SQL Server and the tutor made an interesting point about sorts that probably also applies to Oracle as well. He argues that unless you're also using TOP to get the top N results (or something similar where a sort is required by another operation) you should not do sorts in the database but do them in the application layer.  His rationale is that SQL Server, like Oracle, is licensed per CPU; if you're using a cloud service then you will be billed per CPU allocated or by the execution time your code spends on the CPU.  Sorts are very CPU intensive, the example he showed took about 800ms to just return 2.5million rows unsorted but 3.5s (about 4.4 times as long) with a sort.  Applications are more likely to be licensed per user so it's probably cheaper to add more CPU there than in the database server.

Changing Oracle Database ID and Name (nid)

 Getting back into Oracle as a DBA I've been reading up and watching tutorials to try to get the old skills back and update to the new tools, last time I DBAed in anger we were still on Oracle 7 and 8i, 9i had been out a while and 10g was in early versions, but because much of our software was so old we weren't using it much.  I came across a tutorial on how to update the name and ID of a database.  This is useful if you have copied a database and want to rename the copy to stop it being confused with the old, or if you want to have it on the same machine as the old.  The database ID is an internal number used by Oracle to identify the database, it looks like the main reason you'd want to change the ID is if you use RMAN and want to have both in the same repository. PLEASE NOTE: The below is based on a tutorial I watched and has not been tested, errors and omissions are expected.  Before using in production do a few practice runs on sandbox databases.  Proc...

SQL*Server Import Export Wizard 2017 vs Office 64 bit

Not Oracle, but since we're having to multi-platform these days, it might be relevant to some. When you install SQL*Server Management Studio on 64-bit Windows, the Management Studio (SSMS, equivalent of SQL*Plus) is 64-bit, but it installs the 32-bit version of Import Export Wizard (SSIS). This is fine if you have the 32-bit version of Office installed or only import and export CSV or other non-Microsoft file types. If you have 64-bit Office and try importing an Excel spreadsheet, you will get an error message: "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. (System.Data)" Googling for this error message brings back a range of solutions (many dating back to SQL*Server 2008 and Office 2010), from installing the 64-bit Access Runtime redistributable to setting up a VM in Oracle Virtual Box and putting the SSMS/SSIS software on that, but not any form of Office. When I ran into this error today, we found, after some trial and err...

Oracle Midlands User Group May 2014 Meeting

On 20th May 2014 Oracle Midlands User Group will be hosting a couple of talks by Christian Antognini.  For full details see: http://oraclemidlands.com/ The first talk covers adaptive query optimisation in Oracle 12c and how it can be used to ensure that the query optimiser generates better plans more often.  The second talk delves into the internals of row chaining and migration. The venue is: InnovationBirmingham , Faraday Wharf, Holt St, Birmingham B7 4BB 

ROWID equivalent in Microsoft SQL*Server

The last few months I've been having to work with Microsoft SQL*Server 2008 R2 for a project I'm on.  I'm not finding it fun for a variety of reasons, including that it doesn't seem as capable as I recall Oracle being and that the source data I'm having to work with is very, very dirty. One of the complicating factors is often there will be exactly, or almost exactly, duplicate rows when each row should be unique.  Obviously I need to have something to uniquely identify the rows for the delete so looked for an equivalent of ROWID (the pseudo-column in Oracle that uniquely identifies a row).  I found a page that talks about this .  The pseudo column is %%physloc%%.

Tablet PCs - Why so pricey?

Is touch screen really expensive to do or something. I've been tossing around the idea of getting a tablet PC to stick OneNote on to use for note taking, reading documents and some web surfing (including Gmail) via WiFi. I'm having to attend a lot of meetings/briefings where the ability to take notes and link them to documents and web pages would be incredibly useful. Looking around the web the options seem to be: iPad, around the £500-900 mark but won't multitask or run OneNote and from what I've heard from all but the most ardent Apple worshipper is basically crap (iPhone without the ability to make calls) Tiny and low spec (more of a PDA than PC) around the £400-700 mark Equivalent spec to a, non-touchscreen, laptop that currently retails for about £300-450 but costing £1500-2100 I think I'm stick with pencil and paper with printouts of docs I want to read for now. In terms of specification what I'm looking for is: 10-12 inch screen Run OneNote 2007, Acroba...

Oracle aims to secure future of Sparc, Solaris and Sun hardware

Interesting article on ComputerWeekly.com about how Oracle are looking to secure the future of Sparc, Solaris and Sun Hardware . They don't mention it but I wouldn't be surprised if we see 'Database as an Appliance' coming soon with Oracle Database running on Sun Hardware with management taken out of the hands of the local DBA and automated or made accessible only to Oracle themselves. This isn't a 'Death of the DBA' thing, the sort of sites that could go for something like that are probably the ones that don't have a DBA, just a support tech who has a couple of books, the sort of sites that probably run M$ SQLServer now. One thing they mention, as an aside, is that Oracle plan to OpenOffice.org to position it as a competitor to Microsoft Office. If they want to do that then I think the thing they really need to introduce to the suite is a desktop RDBMS to beat Access. Ideally something that can also act as a front end to Oracle with a tool that will...

Oracle to buy Sun

Oracle announced today that they will be buying Sun Microsystems. Their plan is to produce 'pre-integrated' systems where everything from the bare metal, silicon and spinning rust up to the application front end is from themselves. The idea is that customers will save money on systems integration costs but reliability will go up.

Ada Lovelace Day

Apparently today is Ada Lovelace Day . Ada Lovelace (aka Augusta Ada King, Countess of Lovelace) is widely recognised as the first computer programmer. The daughter of Lord Byron, she was encouraged away from her father's dissolute lifestyle by her mother, who encouraged her interest in mathematics. Ada excelled at mathematics and became a friend for Charles Babbage. When Babbage created his Difference Engine, the first programmable computer, Ada wrote out the method to configure it to calculate Bernoulli numbers. Hence her appellation as the first computer programmer. Ada Lovelace day was created by Suw Charman-Anderson as a way to promote women in IT.

New Blog - Stephen's SAP Blog

As I'm now beginning to work on SAP I've started a blog about it , mostly just somewhere to make notes about interesting/useful things I come across. If it also helps anyone else then great but if it doesn't then no worries. One of the things I have noticed, comparing Oracle with SAP, is that whilst for Oracle you can find online free resources at pretty much any level (both official Oracle sites and individual sites and blogs) in SAP there seems to be loads of 'salesy' type sites telling you how wonderful SAP is and how it will revolutionise the way you do business (presumably for the better) and some very in depth technical sites (mostly forums), where you're sunk if you can't get in an manually edit the data and code, there's nothing anywhere in between. There certainly don't seem to be any how-tos, any pages that seem to be telling you howto when they come up in Google searches are actually saying "If you want to find out how to sign up fo...

Old tech you'd like to see updated and rereleased

Note an Oracle post, but I know a lot of DBAs and into tech as well. Yesterday I found my old Psion3 mx (which I used before having to switch to Palm handhelds due to work). I had a play and was reminded why I liked it so much. The key advantage it had, and still has over many more modern devices, is the size. It's small enough to fit in a suit jacket or coat pocket whilst being large enough to have a keyboard you can actually type on and a decent screen size. It also has a decent battery life and, as it runs off a couple of AA batteries, you don't have to worry to much if you're going to be away from the mains for a while. The Psion 5 (that superceded the 3 in 1998) had a larger and slightly more usable keyboard and screen but the size (about that of the Eee PC) meant that it couldn't fit in a pocket so reduced it's utility. I then got to thinking, how would I improve the Psion3 taking account of the changes of the 10 years since it went out of production? Her...

Dataguard, documentation/scripts for non-DBAs during failover

We're looking at implementing Dataguard as part of an implementation of Documentum (a document management system from EMC) and I have been asked to look at producing documentation and scripts for non-DBA users to use during a failover. The actual failover of the database itself will be handled by our DBAs, this is for the sys admins, network admins, application admins &c who may need to do things during fail over. I'm currently going through the Dataguard concepts guide and have found some other documentation on OTN but was hoping that someone with more knowledge of Dataguard could point me towards any documentation that might help with the non-Oracle side of failover. If anyone has any documentation/scripts like this they have prepared themselves that they are prepared to share and I could adapt to our environment then I'd be very grateful. Here is the background: We have a pair of IBM p590 servers, running AIX 5, currently sitting in different parts of the same dat...

Where should data be validated?

This just came up on the mailing list for my local Linux Users Group following last night's meeting (which I didn't attend), the original mail and my response is below: > In the pub, there was an interesting conversation going on regarding > validation of data in databases. > > Excuse the omissions, as I said, it was overheard > > Someone brought up the point that in databaseX If say, you have a > varchar field set to a limit of 10, and put 26 chars of data into it > databaseX silently truncates it. > > So my question is, in your opinion, should it be up to the front end or > the database to do this kind of data validation? > I'm a Database Administrator, mostly working with Oracle. The reverse of this problem (data validated in the client but not in the database) is something I come accross a lot. Most RDBMS/ODBMS/ORDBMS, certainly any that can claim to be enterprise class, will have functionality to implement data validation (key con...

Preventing record deletion

This entry is partly an aide memoire for me, partly to try to get something that has been keeping me awake for the past hour or so out of my brain so I can sleep and partly in the hope that someone can suggest a way forward. A quick bit of background. Until April 06 most of our major systems were looked after by an external Faccilities Management company. In April 06 IT was kind of outsourced to a joint venture company, support of the systems transferred to that company and a couple of the DBAs transferred in as well under TUPE. A reccurring problem on one of the systems is that the users keep deleting records which, by law, they must not delete so we (actually one of the DBAs who transferred in who is responsible for that system) has to restore from backup to another machine and copy the deleted records over (she's tried using LogMiner but finds it too unwieldy). The core problem is that the application is faulty and lets the users delete the records when it shouldn't. The...

Remote automated install of Oracle 10g client

We have a situation where we need to rationalise the range of installed Oracle clients (i.e. the bit that sits between the app and the network stack) we have installed. We currently have versions from 7.x through to 10.2 installed accross approximately 12,000 desktops (accross various locations in an area of around 26 square miles) running various apps on Windows versions from NT4 to XP (mostly Windows 2000). We are also introducing a standard TNSNAMES.ORA file (this is the impetus to standardise on a single client version as different locations on disk and formats of the TNSNAMES.ORA file would make it pretty much impossible to manage the rollout of the file otherwise). With the number of desktops to be updated and the area they are spread over it would not be possible to do this by visiting every desktop so management are proposing automated installation of the Oracle client through scripts run at logon requiring no user interaction. Has anyone ever tried something like this? Are...

du and ls report very different file sizes for Oracle Tempfiles on NFS v3 mounted volume on NetApp filer under Solaris 9

We have a NetApp FAS filer attached via Gigabit Ethernet to a Sun V440 running Oracle databases the files for which are stored on the filer The NetApp volume is mounted under NFS version 3 at $ORACLE_BASE/oradata. Under that directory are 7 directories .snapshot, AXEM, AXER, AXEM_backup, AXER_backup, AXEM_nobackup, AXER_nobackup. .snapshot is where the NetApp filer stores snapshots of the volume. The server runs two databases, AXEM and AXER. The AXEM and AXER directories hold the datafiles (and a small tempfile) for the appropriate database, *_backup holds the RMAN and cold backup sets for the appropriate databases. *_nobackup holds the bulk of the tempfiles (temporary tablespace, used for sorting) for the appropriate database (when we do cold backups we don't bother to backup the tempfiles). For AXEM, AXER and *_backup both du and ls report the same file sizes for both data and tempfiles. For *_nobackup ls reports the correct sizes (as specified in the Oracle data dictionary) but ...

How people find this blog

I was just looking at my stat counter analysis for this blog, it's usually a good way to find out if anyone has linked to me. From the results it looks like the vast majority of people (around 97%) find this blog through a search engine, virtually all (over 99%) through Google. Most common search strings are or include " ORA-07445 ", " opmnctl failed to start process " and " ORA-01031 ".

Never volunteer

During his presentation on " Inside RAC " Julian Dyke appeared to suffer laptop difficulties so asked for 4 volunteers to assist in a demonstration. Being the helpful soul (i.e. idiot) that I am, I volunteered. Mr Dyke did seem remarkably wellprepared in terms of props, almost as if he had been expecting his laptop to have problems :-)! Photographic evidence (courtesy of Connor McDonald) can be found here and here . I'm the fat, ugly, balding, bearded one on the far left, aka Node 1. Node 2 was Babbette Turner-Underwood , Node 3 (aka Master) was Murali Vallath and Node 4 was Carel-Jan Engel .

Histogram problems

A question just appeared on the Oracle-L mailing list about whether there are any issues with using histograms. I've seen a number of presentations over the last couple of years that have warned about issues where you have histograms on highly skewed data and use bind variable (or have cursor_sharing=force, which synthesises bind variable from literals in queries), so I responded: On 19/11/06, A Joshi wrote: > Hi, > About use of histograms : I think histograms are useful for indexes on > columns that are not very selective. However I came across note 1031826.6 on > metalink. About maintenance and space cost. I think space cost is negligible > and can be ignored. About maintenance : does it mean statistics need to be > gather often? Or does it mean some other cost. > > Question : Is there any other overhead or any other negative impact of using > histograms? One downside I've been hearing a lot about over the last couple of years results from Bind ...

UKOUG 2006 - Day 1

Today was the first day of the United Kingdom Oracle User Group 2006 conference . The day itself was pretty good, lots of good talks (more on that later), but I ran into a couple of issues in the evening. The first issue was when I went into the Handmake Hamburger just accross the canal from the ICC , I was alone and the waitress/Maitre d' said they didn't have any free tables suitable for one person (looking around they had several free tables, just they were for 2, 4 or more people) so after expressing my disatisfaction and feeling about the poor quality of service I went accross Broad Street to Walkabout and had a Kangaroo Burger. The second issues was that I had hoped to go to the bloggers' meetup at All Bar One. Although I blog about Oracle I'm not sure if I qualify as a true Oracle Blogger so when everyone disapeared upstairs to a private party (UKOUG had laid on some sort of 'Thank You' event for the volunteers) I didn't follow. I know I'...