Coskan’s Approach to Oracle

December 22, 2008

How to use “top” effectively on Linux as a DBA

Filed under: Linux, Tips — coskan @ 7:28 pm

I have been familiar with linux since 2000, when I was at second class of university, but I have never worked  on a  linux machine which was hosting primary production database.   The first OS  I used Oracle on, was IBM AIX then, I always worked on HP/UX with a Server management team  so, I never go that much deep for monitoring tools of Unix based systems, till last couple of weeks at which I started to study for managing oracle on linux exam.

Before studying, my   top command  usage was always like ,  run top / topas  command  then check the processes and quit the screen. I never asked myself, if I can do anything more. on top screen.  Another reason about this laziness, is that , I never liked the layout of manual pages. I always got bored in 5th second :) . On the other hand, when you are studying something on linux, you have to leave all your boredom about man pages behind and start to read them completely.

After reading the manual, I discovered that top screen is very powerfull interactive tool  on which you can do many modifications by parameters like changing the default sort option filtering by users changing the layout refresh time.  You will find small tutorial about what you can do with top at the pages below.

1-Basic top screen

$ top

top

2- For changing the default layout press f or o in the top screen.  After you press you will see the screen below. Letter with star indicator  are the fields you can see on the default page.

top2

3- When you press any of the starred letter on keyboard their star will diseppear and letter will be lowercase this means you deselected them from fields. When you press any on the non starred letter a star will apper at each one of them and letter will be uppercase This means you selected them as field.

top3

After you change the fields top screen will be like below with UID SWAP PPID and CPU Time columns are added to fields

top4

4- If you want to filter the processes from oracle user only (which is the best option for me) press u to filter the screen and write the username / userid . To remove the filter just press enter after u.

top5

processes from oracle user only

top6

5- If you want only top 10 processes from oracle user just press n and enter 10. To revert back enter 0

top7n

Ta daaa you have top 10 oracle sessions  list on your top screen

top8n

6- To change the screen refreshment period press d and set the delay with seconds

top9s

7- To kill a session press k and give the PID of the session. top10k

After you entered the pid, It will ask you the signal with default of 15

top11k

9-  Suppose that you want to change the sort order. There are two ways to do it. First way is press F and set the sorting column from the next screen by pressing the column letter . Second way is using moving by < > keys when you are at the top screen. It can also sort to a field which is not shown on the screen.

top-sort

Now its all sorted bymemory usage  instead of CPU

topsort-mem

10- you can also press W and it will write your current configuration to the conf file to keep it for future usage as a default.

These are all I wanted to mention about interactive usage of TOP command as a DBA.

For more info about the top command just write man top on you command line :)

Wish you Happy Christmas  for all.

December 19, 2008

ORA-29701 when starting oracle during server boot

Filed under: ASM, Tips — coskan @ 6:53 pm

I finally passed 11G New Features exam to upgrade my 10G OCP and now the new target is becoming Managing Oracle on Linux Certified Expert. I will write a blog post about my opinions and my approach to Oracle Certification when I find time,  but now, what I want to write is, a problem I faced during my tests for the exam.

When I was testing to start oracle (ASM Database Listener and dbconsole together) as a service during the server boot , my ASM instance was always failing with the error

“ORA-29701: unable to connect to Cluster Manager”

ASM needs CSS daemons to start before it starts, no matter  the sequence was right(  like below)  ASM wasn’t starting because  CSS daemons wasn’t  starting  in time.

service startup sequence
init.cssd start
dbora start
init.cssd run

On Metalink this problem  listed as  Bug 3458327 . As explained on Metalink Note Id: 264235.1 the workaround is changing the  location of the line in which CSS daemon start  (which is probably at the bottom of inittab) to between run levels rc2.d and rc3.d to make it ready for use of ASM instance like below,

.

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
h1:35:respawn:/etc/init.t/init.cssd run >/dev/null 2>&1 </dev/null
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

Another option is to change your service script to sleep for 120 sec (thanks Martin for correction) but I prefer the one on the top.

Tests are done on 11.1.0.7 running on Oracle EL5

December 17, 2008

ASMLib and undiscovered disks

Filed under: ASM, Tips — coskan @ 1:03 pm

I won’t give any detailed information but just a quick tip for users who are struggling with discovery of disks they mounted by ASM Lib

If you follow the steps as Tim Halls article ASM using ASMLib and Raw Devices normally everthing should go fine,  but somehow,  if your disks are not discovered, you can first follow very well written ASMLib  troubleshooting guide of Jason Arneil.

If checks are ok,  but disks are still not discovered

you should first try to put ORCL:* (Thanks Saurabh- see the comment) to your ASM disk discovery path

Still doesnt work,   like it did not in my case ?

Try this magical discovery path

/dev/oracleasm/disks/*

If you are lucky as me it will work like charm.

Theme: Silver is the New Black. Get a free blog at WordPress.com

Follow

Get every new post delivered to your Inbox.

Join 203 other followers