Tuesday 27 November 2007

Oracle for Sysadmins

Set the 'EDITOR' variable for the user 'oracle'. Doing so will allow you to edit your sqlplus commands using a reasonable editor. After executing a piece of SQL in sqlplus, just type 'edit' or 'ed' and you'll be transported to your editor. In vi just type :q to get back to the sqlplus prompt.


Create an oracle environment file in your home directory and have Oracle execute it every time you start sqlplus. Oracle will execute a command file called login.sql if it finds one in the path defined by $SQLPATH. For DBA activity you can format commonly used columns to display in a more user friendly way e.g.

set linesize 200
col file_name for a40
col tablespace_name for a20

I store this file in $HOME/env/oracle and put this directory in $SQLPATH

Other things in the login.sql

  • set timing on Automatically print the duration of a sqlplus command.


You can store your DBA scripts in the $SQLPATH too.


Supplementry packages


You'll want to add in these packages to allow you to monitor the database

  • statspack - sample counters in the database then report on them. Very useful for performance analysis
  • dbms_space



Statspack


Install the statspack tools
SQL>  @?/rdbms/admin/spcreate


Ensure timed statistics is set to true
SQL> show parameter timed_statistics


SQL> exec statspack.snap

PL/SQL procedure successfully completed.

Elapsed: 00:00:09.57
SQL> exec statspack.snap

PL/SQL procedure successfully completed.

Elapsed: 00:00:01.20
SQL> @$ORACLE_HOME/rdbms/admin/spreport


If you ever need to get rid of statspack (sometimes useful if the instll crashed part way through) just run the script
SQL>  @?/rdbms/admin/spdrop

Saturday 24 November 2007

UNC vs Duke

Poker

Our neighbor has invited me to his monthly poker evening. The only problem is that I don't know how to play. I have month to learn enough to not look an idiot.

Photos

This should be a photo slideshow linked to picassa.



Tuesday 20 November 2007

Tag cloud

I got fed up with not beign able to find things I'd noted down here, so I added the ubiquitous tag cloud, using these instructions.

Monday 19 November 2007

American TV

So it turns out that the best thing about American TV is that there are so many adverts (which are a special type of annoying) that you *really* have to want to watch something in order to put up with it. Even BBC America . On a lot of the minor channels where we sometimes watch college sport, the advertisers obviously don't have a large marketing budget. So they JUST SHOUT and hope you'll buy the product. I guess it must work. We don't watch a lot of TV.

I heard from a bloke in the pub that a lot of people download their TV from usenet. I'm not surprised.

Wednesday 14 November 2007

One blog per week

According to my favourite blog, Coding Horror the path to blog greatness is to set a schedule and stick to it. It has to be said that I am not the worlds best at sticking to things. Our bookshelf as at least three books that I started and never finished. Since nobody outside my family and friends really cares what I do on a day-to-day basis - unless I happen to win the lottery in the next year I don'thttp://www.blogger.com/img/gl.link.gif expect the readership to exceed... more than a handfull. However, I think it's worth keeping a journal even if it's only for myself. Lots of folks are currently using facebook - and once the novelty of the apps has worn off, the real interest in facebook - for me at least is to see what people are up to (Status updates) and seeing their photo's. I don't see why blogs and things like 'twitter' couldn't do the same thing but using a more open platform. It will be interesting to see what happens with facebook during the coming year - it's currently very hot.