Welkom

April 1st, 2011 by Robert No comments »

Welkom op mijn homepage.
Op deze pagina probeer ik wat van mijn dagelijkse leventje te vertellen.
Veel zal gaan over mijn werk: Oracle DBA.

Als DBA heb ik veel raakvlakken met zaken als O.S., storage, network, etc.
Er is hier dus meer te lezen dan alleen Oracle zaken.
» Read more: Welkom

Install testserver with CentOS 5.7

January 8th, 2012 by Robert No comments »

This blog is about installing CentOS 5.7 on a testnode.
These kind of installations is what i use in my testlab.

» Read more: Install testserver with CentOS 5.7

PGA

October 30th, 2011 by Robert No comments »

SET LINESIZE 145
SET PAGESIZE 9999

COLUMN sid FORMAT 999 HEADING ‘SID’
COLUMN oracle_username FORMAT a12 HEADING ‘Oracle User’ JUSTIFY right
COLUMN os_username FORMAT a9 HEADING ‘O/S User’ JUSTIFY right
COLUMN session_program FORMAT a18 HEADING ‘Session Program’ TRUNC
COLUMN session_machine FORMAT a8 HEADING ‘Machine’ JUSTIFY right TRUNC
COLUMN session_pga_memory FORMAT 9,999,999,999 HEADING ‘PGA Memory’
COLUMN session_pga_memory_max FORMAT 9,999,999,999 HEADING ‘PGA Memory Max’
COLUMN session_uga_memory FORMAT 9,999,999,999 HEADING ‘UGA Memory’
COLUMN session_uga_memory_max FORMAT 9,999,999,999 HEADING ‘UGA Memory MAX’

SELECT
s.sid sid
, lpad(s.username,12) oracle_username
, lpad(s.osuser,9) os_username
, s.program session_program
, lpad(s.machine,8) session_machine
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = ‘session pga memory’) session_pga_memory
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = ‘session pga memory max’) session_pga_memory_max
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = ‘session uga memory’) session_uga_memory
, (select ss.value from v$sesstat ss, v$statname sn
where ss.sid = s.sid and
sn.statistic# = ss.statistic# and
sn.name = ‘session uga memory max’) session_uga_memory_max
FROM
v$session s
ORDER BY session_pga_memory DESC
/

Create a virtual Oracle Node.

August 21st, 2011 by admin No comments »

After working with some virtualisation solutions (XEN, VMWare, virtualbox, etc) i have chosen to work with virtualbox.
Other solutions work just as well, every solutions has it’s pro’s en cons. Virtualbox seems to work for me, so that’s what i’ll use.
It has one advantage: Oracle owns it, and you can download many ready made images from Oracle. New to some technology? Download an image, boot it and your on your way. Other then that: All virtualisation solutions are just fine.

Creation a node (Centos).

So here’s the way i create most of my test node’s.

» Read more: Create a virtual Oracle Node.

Uptime, the nice way.

July 18th, 2011 by Robert No comments »

In unix and linux environments we have the well known uptime command.

It tells you, eeuhm well, the uptime of the node :-)

rlaat@ciber:~$ uptime
15:42:53 up 9 min, 2 users, load average: 0.10, 0.24, 0.20

So when is my system started ?
You have to do some calculations to know at what point in time the system has been started.

So i started looking for a better way to see this timestamp.
Ik would like to see it formatted in something like yyyy-mm-dd hh24:mi:ss.

I came up with the /proc/uptime file.
This file holds the time this node has been started.

rlaat@ciber:~$ cat /proc/uptime
786.40 1323.92

Hmmm, not the time, the amount of seconds (in the second column).
I should be able to do something with this number and the ‘date’ command.
I came up with :

rlaat@ciber:~$ date "+%Y-%m-%d %H:%M:%S" -d @$(( $(date +%s) - $(cut -f1 -d. /proc/uptime) ))
2011-07-18 15:33:27

Need Oracle books ?

July 15th, 2011 by Robert No comments »

Packt publishing has released it’s 50th book on Oracle.
I have worked on a book for them and have purchased several.
Nice books, good stuff.

Now they give great offers, so if you need a good book, act now !
Click the logo…

Oracle Certified Solutions.

July 5th, 2011 by Robert No comments »

Ever had to make a design for new solutions, or at least the oracle database part of it?
Oracle saves a lot of time with these sheet :

Oracle Solutions
Nice papers.

It provides solutions for several applications, the solutions are tested in the Oracle labs, benachmarked, etc.
Adopt these solutions, alter them if needed, it can save lots of time.

Session PGA

June 28th, 2011 by Robert No comments »

On a regular basis i check the PGA setting of databases.
I finaly got around to write a script to make this a nice report.
Simpel SQLPlus script, nice formatting, etc.

» Read more: Session PGA

RAC Book review

June 8th, 2011 by Robert No comments »

I have been busy with reviewing a book for Packt Publishing.
First time i have done this kind of work and i liked it a lot.
This book is now published and it’s a good book.
It covers many aspects of RAC and gives a pratical insight in what you should do when adminstering , upgrading, etc.

Click the packtlib icon in this post to visit the books page at packtpub.com.

SSH keys

April 13th, 2011 by Robert No comments »

Bij het aanloggen aan Unix/Linux servers via ssh moet je steeds je wachtwoord opgeven.
Da’s vervelend werk en niet echt plezierig.

Daarom deze beschrijving om middels een shared-key aan te melden.
Een wachtwoord opgeven is dan overbodig.
» Read more: SSH keys

Renaming files to lowercase.

April 6th, 2011 by Robert No comments »

I had to do a massive load into a newly created database, the software vendor supplied me with 38701 files with data ! Not really a nice way, but that’s what is was. So created a script to load them into the database, using sqloader.

The csv files came with strange names, it looked like someone had randomly used the shift-key
All files were a mix between lower and uppercase

DbFIjHtKnM.Csv
GrEdFYHnM.cSV
WqaSdeUUiKm.CSV
…. etc, etc

» Read more: Renaming files to lowercase.

Using crontab.

April 6th, 2011 by Robert No comments »

The crontab is the schedule system for unix / linux systems.
Nice things can be done using the crontab, so this post is my personal notepad.

crontab -e
Edit the crontab file, of create one if it doesn’t already exist.

crontab -l
Display the crontab file.

crontab -r
Remove your crontab file.

crontab -v
Display the last time you edited your crontab file. (This option is only available on a few systems.)

» Read more: Using crontab.

SSH Banner

April 5th, 2011 by Robert No comments »

Today, when working on unix/linux, ssh is what i use most to connect to my servers.
Sometimes you get a nice disclaimer and banner when connecting.

I thought i give my systems this banner :-)

» Read more: SSH Banner

info.sql

April 5th, 2011 by Robert No comments »

When connecting to any Oracle database via sqplus you see this :


SQL*Plus: Release 11.2.0.2.0 Production on Tue Apr 5 08:21:34 2011

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 – 64bit Production
With the Partitioning option

SQL>

Not very descriptive is it? You get zero information about the database you ended up.
And believe me, in complex, large environments you will be suprised.
Your collegue is performing a cloning, has changed the centralised tnsnames.ora and voila, screwup in the making.

So every time i connect to a database i would like to see some basic information about that database.
Information as databasename, hostname, version is very nice to see after a connection.

For this purpose i keep the info.sql script.
» Read more: info.sql