Friday, July 31, 2009

Query to find locked objects in oracle

The following query will find the objects which have been locked by the user.
The query will return session id which can be used to alter the session which can release the lock.

SELECT SESS.OSUSER,
OBJ.OBJECT_NAME, SESS.SID,
sess.SERIAL#,SESS.USERNAME, SESS.MACHINE, SESS.TERMINAL, SESS.PROGRAM FROM V$LOCKED_OBJECT LO,V$SESSION SESS,DBA_OBJECTS OBJ WHERE LO.SESSION_ID=SESS.SID AND LO.OBJECT_ID=OBJ.OBJECT_ID

Then the session can be killed by the following alter command

ALTER SYSTEM KILL SESSION ‘sid, serial#’

Sid and serial# should be taken from the above query to find the locked objects

Thursday, July 30, 2009

Materialized view log

Before creating materialized view in fast refresh mode ,it is necessary to create materialized view log for the table which the view needs to be created.

The syntax for creating materialized view log is

CREATE MATERIALIZED VIEW LOG on TABLE_NAME

Once the log is created then we can create materialized view with fast refresh option.

For more idea about it ,please cisit the following site:

http://stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_6003.htm

Monday, July 27, 2009

Massa, the brave man

Felipe Massa’s accident news started haunting me. How the things in life can change upside down in few seconds? A driver with tantalizing talent now doesn’t know whether he can continue racing or not. He’s in hospital recovering well, but he couldn’t speak till now.F1 is the most dangerous sports in this world which needs real guts to be a part of the race. The race doesn’t guarantee your life.


After reading the news I choked up a bit. I started worrying about this volatile life which doesn’t guarantee anything.


I got a strong message from a brave man in F1. I want to do things that I’m more passionate about; because I never know when my turn is goanna come in this volatile life.

Saturday, July 25, 2009

Add traffic live feed in your blog

Just check out this link to add live feed to your blog:
http://feedjit.com/joinjs/

The page contains the link which needs to be clicked which will add the live feed to your blog.

Refrshing a materialized view in oracle

The DBMS_SNAPSHOT package is providing us a procedure to refresh the materialized view in oracle.

BEGIN
DBMS_SNAPSHOT.REFRESH('VIEW_NAME','c');
END;

The first parameter is the view's name and the second parameter is the refresh option.
c - complete refresh
f - fast refresh

If you exexcute the above block the view will be refreshed.

Wednesday, July 22, 2009

Load images using SQL loader:

The following code for ctl(control) file will load images into an oracle table using sqlloader.
load data
infile image.csv
into table image1
append
fields terminated by ','
(
imageid,
filename,
image_data lobfile(filename) terminated by eof
)

The infile will mention the source data what’s the name of the file to be loaded and it should look like this :

1,image010.jpg
2,image020.jpg

The following command should be used to load the images:

Sqldr username/password@DB control=image.ctl

ORA-12014 error while creating materialized view

When materialized view is created with REFRESH COMPLETE option and the table for which the view has to be created doesn’t contain any primary keys then an error will be thrown while creating the view.

The error would be ‘ORA-12014 ‘

To overcome this error ‘WITH ROWID’ option should be used along with the refresh option.

Then you can create the materialized view.

CREATE MATERIALIZED VIEW VIEW_NAME
REFRESH COMPLETE ON DEMAND
WITH ROWIDASSELECT * FROM TABLE_NAME

Saturday, July 18, 2009

Naadi jothidam ,is it plausible?

Curiosity got better of me and I went to know what I have it in the palm leaf. Driven by craziness of how naadi jyothidam tell about my past and future, I was insomniac.

When I went to a naadi jyothidam center, I was asked to imprint my thumb print. Then the astrologer went to inside a room in search of the palm leaf matching my thumb impression. Every impression got some names. He came outside with a bundle of palm leaves.

Then he took the first leaf from the bundle and he started asking questions. I was asked to answer only yes or no for those questions. Then the questions from a particular leaf got most of YES from me. Then the astrologer told me that, this is the leaf.

On the top of the leaf there’s a name written which is the hint to the main book which will contain details about me. All the details on the leaf were written in ancient tamil that I couldn’t understand without the translation from the astrologer.

Then he had written down about the details that I’ve asked for in a notebook. When he started reading I was amazed when he said my name correctly along with my parent’s name. He even told my DOB with my exact horoscope which matched with my horoscope written when I was born.

I’m still wondering how on earth that is possible. Naadi jyothidam, is it plausible? It’s the only question that’s keep on popping up in my mind.
Powered By Blogger