Thursday, March 12, 2009

Useful scripts for DBA perspective -

http://www.dbapool.com/scripts.php

More stuff on finding free space available in a database -

http://forums.oracle.com/forums/thread.jspa?threadID=624042

A sql that we found useful is here - (from the above link itself) -

SELECT
NVL (b.tablespace_name, NVL (a.tablespace_name, 'UNKOWN')) NAME ,
mbytes_alloc mbytes ,
mbytes_alloc - NVL (mbytes_free, 0) used ,
NVL (mbytes_free, 0) free ,
((mbytes_alloc - NVL (mbytes_free, 0)) / mbytes_alloc) * 100 pct_used,
100 - (((mbytes_alloc - NVL (mbytes_free, 0)) / mbytes_alloc) * 100) pct_free
FROM
(
SELECT
SUM(BYTES) / 1024 / 1024 mbytes_free,
tablespace_name
FROM
SYS.dba_free_space
GROUP BY
tablespace_name
)
a,
(
SELECT
SUM(BYTES) / 1024 / 1024 mbytes_alloc,
tablespace_name
FROM
SYS.dba_data_files
GROUP BY
tablespace_name
)
b
WHERE
a.tablespace_name(+) = b.tablespace_name

UNION ALL

SELECT
f.tablespace_name ,
SUM (ROUND((f.bytes_free + f.bytes_used) / 1024 / 1024, 2) ) "total MB" ,
SUM (ROUND(NVL (p.bytes_used, 0) / 1024 / 1024, 2)) "Used MB" ,
SUM (ROUND ( ((f.bytes_free + f.bytes_used) - NVL (p.bytes_used, 0) ) / 1024 / 1024, 2 ) ) "Free MB" ,
(SUM (ROUND (NVL (p.bytes_used, 0) / 1024 / 1024, 2)) * 100) / (SUM (ROUND ((f.bytes_free + f.bytes_used) / 1024 / 1024, 2))),
100 - (SUM (ROUND (NVL (p.bytes_used, 0) / 1024 / 1024, 2)) * 100) / (SUM (ROUND ((f.bytes_free + f.bytes_used) / 1024 / 1024, 2)))
FROM
SYS.v_$temp_space_header f,
dba_temp_files d ,
SYS.v_$temp_extent_pool p
WHERE
f.tablespace_name(+) = d.tablespace_name AND
f.file_id(+) = d.file_id AND
p.file_id(+) = d.file_id
GROUP BY
f.tablespace_name
ORDER BY
5 DESC --&orderby
;

Monday, March 9, 2009

Another month and another vaccine...

Its been another fascinating month... As the book, "What to expect in the first year" says, third month onwards, its the golden time of the babies infancy, I would have to concur, it cant be more correct...

The baby is squealing, smiling, laughing, attempting to curl on his own, would make faces and return ur expressions. And crying too.. out loud.. at times for quite some long time without any apparent reason.

Its all so fascinating. I see him only for three nights/two days a week but then the time is almost good enough to give me memories worth much longer in time and happiness. Its very easy for me to remember his face and expressions now. Its a lovely feeling...

He had another round of his vaccinations this weekend, and I have to say this has been the easiest ones. The pain he has been through in the earlier vaccinations, the trouble he has taken, and the rest of the family shared with him... One time he was turning all colors & crying almost all the night and we had to figure out lots of ways to find soothers for him.

But this around, he had some fever, but it was nearly painless, or may be just that we have had experience of this situation.

Wednesday, February 25, 2009

Compile all invalid packages in a schema : oracle

Came across this from sql developer, Looks like a very useful script, especially when its made available readymade

begin
FOR cur IN
(SELECT OBJECT_NAME, OBJECT_TYPE, owner
FROM all_objects
WHERE object_type in ('PACKAGE','PACKAGE BODY')
and owner = :OBJECT_OWNER AND status = 'INVALID' )
LOOP
BEGIN
if cur.OBJECT_TYPE = 'PACKAGE BODY'
then
EXECUTE IMMEDIATE 'alter package "' || cur.owner || '"."' || cur.OBJECT_NAME || '" compile body';
else
EXECUTE IMMEDIATE 'alter ' || cur.OBJECT_TYPE || ' "' || cur.owner || '"."' || cur.OBJECT_NAME || '" compile';
end if;
EXCEPTION
WHEN OTHERS THEN NULL;
END;
end loop;
end;

And then another one to check as to what all objects are invalid -

select object_type, count(*)
from user_objects
where status = 'INVALID'
GROUP BY object_type

Sunday, February 15, 2009

Deep Blue and Snow white...


20090212_10-56-43_119, originally uploaded by _maze_.

Amazing shot from a friend in Slovakia...

Thursday, February 12, 2009

Oracle : count(1) vs count(*)

It seems we should prefer using count (*) over count(1)
read the article from asktom here...
there've been other discussions and debates on this as well.

Monday, February 9, 2009

Feeling exhausted by happiness, laughter and work... :)

From 3rd of Feb, the festivities started and lasted till 7th night.
It was a great week.

The whole week was full of something or other. One fine day we had event A, on other we had B and so on... Every day of the week was full of some or other event giving a renewed reason to celebrate the day.

The festivities started on 3th with "Charua-Satiya" placing function. Here in, sisters of the father put on holy symbols (SWASTICAS) at the doors of the room where the newborn and the new mother spend most of their time, (basically their room). The idea is to initiate another round of omnious prayers.

These symbols are created using cow-dung, and are covered with a piece of cloth till the day of "Kuaan Poojan". The original idea of Kuaan Poojan was to purify the new mother and remove restrictions of movement in and about house. (Generally, in Indian households, the new mother is/was not supposed to move around and execute daily chores for quite some time after delivery. It was considered that she was not pure enough after deliver, I believe it was another excuse created by the learned people to make public follow their guideline, since its very helping to the new mother if she is resting a lot after delivery. Public in India is more prone to following an advice if its linked to religion somehow)

Then there was the Ekadashi Udyaapan program on 6th and 7th Feb. Basically, this is a closure of a ritual (of fasting) followed by someone for a lifetime. Here, the person is supposedly mentioning to the gods that the body doesnt allow anymore exertion of that level and the fast (of Ekadashi) is going to be discontinued.

A celebration is due since its a big thing anyway, also because its nice to have people around you and celebrate on every little occasion. For us it was even bigger because, it was posthumously done for my mom, and it was clubbed together with the Kuaan Poojan of our newborn. My mom originally wanted to perform the Udyaapan in June last year only, but when she got to know about the pregnancy, she postponed the udyaapan to be held together with the ceremonies for the baby. But, gods had planned it differently... :(

Knowing her (mom) as much as I knew her, she would have been the happiest person around on this birth. She was the single most excited person about the pregnancy and waiting for it to happen forever...

So, on the Udyaapan thing, there is quite a lot of religious acts performed. Donations being given to the Braahmins, a special meal-feast organized for Brahmins and loads and loads of relatives invited for the same.

It was very hectic for me personally, due to the fact that as a son, I had to be part of some of the ceremonies for my father. On the other hand, I was supposedly managing the whole procession singlehandedly. It was really really huge. For the first time, I was managing something of that scale. But it all paid off with the fun-laughter-satisfaction of having it done for my parents and son... the feeling is priceless...

Here are some snaps...

Wednesday, January 28, 2009

Invite for the weekend of 6&7th Feb

We request the honour of your presence on the auspicious occasion of

  Ekadashi Udyaapan
ceremony of our parents

Mr. Ramesh Chandra Sharma
&
Late Mrs. Shakuntala Sharma

I would also like to take this opportunity to
extend the invitation on their behalf for the

Kuaan Poojan

ceremony of their grandson

Krishna
(Son of Raghvendra and Pooja)
at

12/A, Sector B,
Govind Nagar, Mathura

 
as per the following programme : 

Ekadashi Falaahar    6-Feb-2009    12:00 pm
Kuaan Poojan          7-Feb-2009     4:00 pm
Dinner                   7-Feb-2009     7:00 pm
Devi Jaagran           7-Feb-2009    11:00 pm
 
 
Sharing happiness with you
Raghvendra and Pooja