Tuesday, August 31, 2010

What an Interesting Pasuram - VAIYATHU VAZHVIRGAL

I was listening to the discourse by Sri Velukuddi Swamy on Thiruppavai. The meaning of Vaiyathu Vazhvirgal, as explained by Swamy, is that we can convert the place we live by our actions.
I have copied a translation of the above pasuram, from "Sri Andal Thiruppavai Website" and it English meaning below. For those who are interested, here is the link:http://namperumal.tripod.com/TPMain.htm


At her cordial invitation a huge crowd gathered and the
wonder-struck ANDAL exclaims,"in this ignorance-spreading
world, are there so many interested in Emancipation!".She
proceeds to prescribe "dos" and "don'ts"( which actually
are the SAMBHAVITA SWABHAVA,the natural characteristics
of the Adhikari).


While we appear to be performing this vow for getting
rain,in reality it is different.She stresses the words
"NAMUM NAM Pavaikku"- NAMUM- WE are quite different
from others; we long for His company and firmly believe
that He alone is the Means for achieving it. NAM Pavai-
Indrajit did a malefic rite to put an end to Rama;but
OUR beneficent rite is for securing Lord's and His
World's prosperity and happiness.


The SriVaishnavite Code of Conduct as prescribed by
her is as follows:
Recite the Samskrita and Dravida Veda which sings the
glory of the Feet of the Lord reclining on the Serpent
in the Milky Ocean,all the while thinking about one's
Redemption.

Eschew all carnal and even worldly desires like eating
ghee,drinking milk etc.
Bathe early in the morning.Don't adorn your eyes with
collyrium,or your hair with flowers till the completion
of the vow;meaning thereby that a SriVaishnava needs
decoration etc only when he is in union with the Lord.
Never indulge in an act which was not practised by our
righteous minded ancestors.Bharata refused the kingship
though granted by his father and permitted by Rama
on the grounds that the tradition of Solar Kings did
not permit a younger son to rule when the elder was
living.

A SriVaishnava should not speak ill of others or
even think about it (which is tantamount to reporting
it to the God inside the heart,thereby ensuring their
fall);Sita never uttered a word to Rama about the
illtreatment by the Rakshasis.
He should ever be ready to do charity and impart
knowledge about God to all those who need it.


In short he should constantly be thinking about his
upliftment and keep his mind filled with peace and
happiness.

Friday, July 23, 2010

Workflow Guides URL

To Workflow guides, use the links provided below.

Download Workflow Developer's Guide: (HTML version): http://download.oracle.com/docs/cd/B19306_01/workflow.102/b15853/toc.htm
PDF version: http://download.oracle.com/docs/cd/B14099_19/integrate.1012/b12161.pdf

Workflow API Guide: http://download.oracle.com/docs/cd/B14099_19/integrate.1012/b12163.pdf
Workflow System Administrator Guide: http://download.oracle.com/docs/cd/B19306_01/workflow.102/b15852.pdf

Wednesday, June 30, 2010

How to help your heart

I recently got forwarded an email that discusses about how one can help heart - this was held at Bangalore, India, by Dr. Shetty a Heart Specialist. In the larger interest of serving the software community, I am posting it the chat transcript as it is. Please read on...


Dr. Devi Shetty (Heart Specialist)

A chat with Dr.Devi Shetty (Heart Specialist),
Narayana Hrudayalaya, Bangalore was arranged by WIPRO for its employees .
The transcript of the chat is given below. Useful for everyone.

Qn: What are the thumb rules for a layman to take care of his heart?

Ans:
1. Diet - Less of carbohydrate, more of protein, less oil
2. Exercise - Half an hour's walk, at least five days a week; avoid lifts and avoid sitting for a longtime
3. Quit smoking
4. Control weight
5. Control blood pressure and sugar

Qn: Is eating non-veg food (fish) good for the heart?

Ans: No

Qn: It's still a grave shock to hear that some apparently healthy person
gets a cardiac arrest. How do we understand it in perspective?

Ans: This is called silent attack; that is why we recommend everyone past the age of 30 to undergo routine health checkups.

Qn: Are heart diseases hereditary?

Ans: Yes

Qn: What are the ways in which the heart is stressed? What practices do you suggest to de-stress?


Ans: Change your attitude towards life. Do not look for perfection in everything in life.

Qn: Is walking better than jogging or is more intensive exercise required to keep a healthy heart?

Ans: Walking is better than jogging since jogging leads to early fatigue and injury to joints

Qn: You have done so much for the poor and needy. What has inspired you to do so?

Ans: Mother Theresa , who was my patient

Qn: Can people with low blood pressure suffer heart diseases?

Ans: Extremely rare

Qn: Does cholesterol accumulates right from an early age
(I'm currently only 22) or do you have to worry about it only after you are above 30 years of age?

Ans: Cholesterol accumulates from childhood.

Qn: How do irregular eating habits affect the heart ?

Ans: You tend to eat junk food when the habits are irregular and your body's enzyme release for digestion gets confused.

Qn: How can I control cholesterol content without using medicines?

Ans: Control diet, walk and eat walnut.

Qn: Can yoga prevent heart ailments?

Ans: Yoga helps.

Qn: Which is the best and worst food for the heart?

Ans: Fruits and vegetables are the best and the worst is oil.

Qn: Which oil is better - groundnut, sunflower, olive?

Ans: All oils are bad .

Qn: What is the routine checkup one should go through? Is there any specific test?

Ans: Routine blood test to ensure sugar, cholesterol is ok. Check BP, Treadmill test after an echo.

Qn: What are the first aid steps to be taken on a heart attack?

Ans: Help the person into a sleeping position , place an aspirin tablet under the tongue with a sorbitrate tablet if available, and rush him to a coronary care unit since the maximum casualty takes place within the first hour.

Qn: How do you differentiate between pain caused by a heart attack and that caused due to gastric trouble?

Ans: Extremely difficult without ECG.

Qn: What is the main cause of a steep increase in heart problems amongst youngsters? I see people of about 30-40 yrs of age having heart attacks and serious heart problems.

Ans: Increased awareness has increased incidents.. Also, sedentary lifestyles, smoking, junk food, lack of exercise in a country where people are genetically three times more vulnerable for heart attacks than Europeans and Americans.

Qn: Is it possible for a person to have BP outside the normal range of 120/80 and yet be perfectly healthy?

Ans: Yes.

Qn: Marriages within close relatives can lead to heart problems for the child. Is it true?

Ans : Yes, co-sanguinity leads to congenital abnormalities and you may not have a software engineer as a child

Qn: Many of us have an irregular daily routine and many a times we have to stay late nights in office. Does this affect our heart ? What precautions would you recommend?

Ans : When you are young, nature protects you against all these irregularities. However, as you grow older, respect the biological clock.

Qn: Will taking anti-hypertensive drugs cause some other complications (short / long term)?

Ans : Yes, most drugs have some side effects. However, modern anti- hypertensive drugs are extremely safe.

Qn: Will consuming more coffee/tea lead to heart attacks?

Ans : No.

Qn: Are asthma patients more prone to heart disease?

Ans : No.

Qn: How would you define junk food?

Ans : Fried food like Kentucky , McDonalds , samosas, and even masala dosas..

Qn: You mentioned that Indians are three times more vulnerable. What is the reason for this, as Europeans and Americans also eat a lot of junk food?

Ans: Every race is vulnerable to some disease and unfortunately, Indians are vulnerable for the most expensive disease.

Qn: Does consuming bananas help reduce hypertension?

Ans : No.

Qn: Can a person help himself during a heart attack (Because we see a lot of forwarded emails on this)?

Ans : Yes. Lie down comfortably and put an aspirin tablet of any description under the tongue and ask someone to take you to the nearest coronary care unit without any delay and do not wait for the ambulance since most of the time, the ambulance does not turn up.

Qn: Do, in any way, low white blood cells and low hemoglobin count lead to heart problems?

Ans : No. But it is ideal to have normal hemoglobin level to increase your exercise capacity.

Qn: Sometimes, due to the hectic schedule we are not able to exercise. So, does walking while doing daily chores at home or climbing the stairs in the house, work as a substitute for exercise?

Ans : Certainly. Avoid sitting continuously for more than half an hour and even the act of getting out of the chair and going to another chair and sitting helps a lot.

Qn: Is there a relation between heart problems and blood sugar?

Ans: Yes. A strong relationship since diabetics are more vulnerable to heart attacks than non-diabetics.

Qn: What are the things one needs to take care of after a heart operation?

Ans : Diet, exercise, drugs on time , Control cholesterol, BP, weight.

Qn: Are people working on night shifts more vulnerable to heart disease when compared to day shift workers?
Ans : No.

Qn: What are the modern anti- hypertensive drugs?

Ans : There are hundreds of drugs and your doctor will chose the right combination for your problem, but my suggestion is to avoid the drugs and go for natural ways of controlling blood pressure by walk, diet to
reduce weight and changing attitudes towards lifestyles.

Qn: Does dispirin or similar headache pills increase the risk of heart attacks?

Ans : No.

Qn: Why is the rate of heart attacks more in men than in women?

Ans : Nature protects women till the age of 45.

Qn: How can one keep the heart in a good condition?

Ans : Eat a healthy diet, avoid junk food, exercise everyday, do not smoke and, go for health checkup s if you are past the age of 30 ( once in six months recommended) ..

Send it to all your friends u care about …..

The dark side of terrorists revealed in MSN Internal Security Get it now.












Manage your finance and manage money through MSN Money Special Drag n’ drop

Friday, May 28, 2010

Where to download latest EBS Workflow Client?

If you need to download latest workflow client, for EBS,  search in metalink for Doc ID # 261028.1.There are different versions, to be downloaded depending on what version of Oracle RDBMS you would be working on. For example if the RDBMS version is 10g or above, then download patch # 4066964 click here.to go there.
If you intend to work on non-EBS Oracle installation, then you can download from OTN - click here to go there.

Sunday, May 23, 2010

SQLDeveloper - Connection parameters



Here is how I am able to connect to the database using SQLDeveloper, without using TNSNAMES option.
Note:  All the notes have been written for *nix (Linux/UNIX) OS versions
Leave the connection Type as "Basic"
 
 Determine the Hostname, port and global database name as mentioned below:

  • open a terminal 
  • type lsnrctl (the prompt will change to LSNRCTL>)
  • type show pid
  • This will display host (which you will enter in hostname) and the port values.
  • Next determine service name by running the following SQL:
  • SELECT VALUE AS "Service Name" FROM v$parameter WHERE name = 'service_names'
  • Enter value  into Service Name
  • Click on Test and ensure that you are able to connect. 
  • Finally click on save to save it in the connection list.


Tuesday, May 18, 2010

How to reconfigure Oracle Enterprise Manager on Linux




I was unable to connect to Enterprise Manager Console for the last one week. I had tried out everything that I could search for from the web, but nothing seemed to work. I was able to start the dbconsole, connect, but it would give me a message stating "Enterprise Manager could not to connect to the database". Finally, in sheer desperation,I thought of dropping and recreating the EM. I chanced upon a well written article, by MacLochlainns, (See References below) on recreating the EM in windows. Although, I am running on Linux, I was sure, the commands would be same or similar. It turned to be the same!. In fact, I did not face any of the problems mentioned in his blog (Point # 7). Users, SYSMAN and MGMT_VIEW, the PUBLIC Synonyms setemviewusercontext & mgmt_target_blackouts and the role mgmt_user, were all automatically dropped,.
Other than that, rest of it, I just followed his instructions and I have the EM running. Thanks a lot MacLochlainns
The commands I used, are listed below:
Start the Oracle Listener and Database
emca -deconfig dbcontrol db -repos drop
Once the above command finishes, run the following one:
The emca command required me to enter Oracle SID, Listener port; passwords were keyed-in without using double or single quotes (again there was a difference between my reconfiguration and  MacLochlainns web article). In other words, key-in just the passwords, encasing them within double quotes is not needed. 
Finally, I accepted default values for Email notifications, Outgoing Mail Server for notifications, and I was done.

emca -config dbcontrol db -repos create
Important: Backup emkey.ora, since the database is kept in encrypted mode. If the key gets corrupted then, all the data will be lost.
once it is completed, test run it by logging onto the Enterprise Manager console.

References :-

How to reconfigure Oracle Enterprise Manager on Windows | MacLochlainns Weblog
Oracle's page on Enterprise Manager Configuration Assistant (EMCA)

Saturday, May 15, 2010

Errorlogging Clause in 10.1 and above



I was working on the Errorlogging clause in the Insert statement which can be used to capture errors that may occur while inserting, and I noticed that Errorlogging clause does not automatically create an error logging table, if it is not specified. I was trying this using SQLDeveloper, so was not sure whether it was a bug in the SD or not. To test it, I ran it using SQL*Plus.

Here is the Insert statement with Error logging clause

Log Errors Syntax (Screen -01)
Since it appeared that Error log table can be optional, I decided to omit and run the Insert statement. However, Oracle returned an Error (Screen -02)

Not mentioning table is Not an option (Screen -02)
So, decided to follow the textbook approach and created the errorlog table (Screen -03)

Created Error Log Table (Screen -03)

As you can see from the screen below, the procedure got executed successfully (Screen -04)

Procedure to generate Error (Screen -04)

The data got inserted into the Err$_Employees Table (Screen -05). So, I think I might have hit into a Bug, however, I am still researching about it.
Data Inserted Into Error Log Table (Screen -05)



References:  

Click here to view Insert Statement
Click here to view DBMS_ERRLOG Statement

Click here to view well written example @orafaq.com
Bug: Could not find any bug other that this old one in Metalink # Bug 5255455

Sunday, May 9, 2010

Date display in Oracle/SQLDeveloper



    A post in OTN forum (forum question was, How can I tell SQL Developer to always display datetime values in full?) asked how SQLDeveloper will display "Hours & seconds" in a "DATE" datatype, when the data entered is Date with no time component. Will it error out or will it display '00:00:00"? To this, I was certain, SQLDeveloper would gracefully display the timestamp at midnight. However, to prove it, I have to key-in data in date column and display them.
Before we get to that, let us first understand how Oracle stores DATE datatype.
Oracle stores date in 7 bytes (Ref: Oracle Advanced Application Developer's Guide. to access click here) Quote: Oracle Database stores dates in its own internal format. Date data is stored in fixed-length fields of seven bytes each, corresponding to century, year, month, day, hour, minute, and second. End Quote
So let us get back to SQLDeveloper and analyze how it displays date datatype
I would use the seeded table EMPLOYEES which has "hire_date" column defined as DATE datatype for demonstration purposes.
Emp table Columns and Datatypes (Screen -01)

Let us take an internal dump of the date and display the data (Screen -02)

Data Display (Screen -02)
As you can see in the above screen, SQLDeveloper displays all Hire_date column data with the time component. How does it do it, when the data keyed in does not contain time component? Well, if the data does not contain time details, then Oracle stores it as 12:00:00 AM.
A brief note on the Datadump column:-
Let us take line # 6 and analyze. 120 represents Century, 109 represents Year (both are displayed as 100+Century/100+Year), then comes the month, and date. Next you would see 1,1,1 which represents the time portion (or in other words the time here is 12:00:00 AM). Time is stored as (HH+1),(MI+1),(SS+1) and displayed as 12+(HH-1) and so on. For example Line # 3 diplays 23-FEB-2010 06:34:12 AM and is stored as CC=(100+20), YY=(100+10), MM=2, DD=23, Hours=7 (6+1), Minutes=35(34+1), Seconds=13(12+1).


Why Century and Year are stored in excess 100 notation? so that we can represent BC numbers. If you look at Line # 4, you would notice that for Century and Year column the value is less that 100. That is because, the data represents BC.90-100=-10, the century inserted and the negative value will tell Oracle that it is a BC and not AD.Another point is that, we know that BC 1010 is greater than BC 1011 (line # 5). So it works  perfectly well in binary sorting too.

So, to conclude, there is absolutely no issues in displaying date by SQLDeveloper

Saturday, May 8, 2010

TNS-12541: TNS:no listener



The command lsnrctl start ORCLPLSQL resulted in "TNS-12541:TNS:no listener " error yesterday; I was puzzled (See below).

(Screen -01)



Oracle was working perfectly fine till then; moreover, I had not installed any new s/w at all.What could then be the issue?
A search on Google brought up this page: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

As listed in that web page, I tried the first one.
The Command, show parameter local listener displayed that tns port has not changed, listener.ora is pointing to the correct port.
Next, I tried tnsping avs.ramanujam.com, which resulted in the same error message.


(Screen -02)

Another thing I noticed was, both starting up the listener and tnsping was taking more time than usual. Next I ran the ifconfig command, I noticed that the ipaddress had changed. (I have to make a confession here. Even though the best practices and the recommendation is that "servers" should have static ipaddress, I had not made it static.) Bang- sound of myself hitting my head  -changed the ipaddress in the /etc/hosts and I was back into business in no matter of time.
Final screen is after successful connection is shown below

(Screen -03)

Wednesday, May 5, 2010

(Not a ) Bug in Debug Procedures in SQLDev

Today an OP in SQLDeveloper forum at OTN had complained about "disappearing" Green icon on Procedures (To read the post click here Note: Sue has pointed out that it is not a bug.I have posted an update below on how to use compiler with debug option. So if you just want to know how to turn on or off the compiler with debug option, just scroll down. If you have time to kill  :-), go ahead and read the entire post. ) . So, back to my original post.... 
I just happen to have Windows version SQLDeveloper (Build Version 2.1.1.63) and Linux Version (Build Version 2.1.1.64) installed. Just a heads up for those who are wondering about the "green" icons, when you compile a procedure, in SQLDeveloper, if the procedure compiles successfully, then it will display a Green icon on the left of the procedure name. If the procedure fails to compile a "red" stop icon is displayed - pretty cute isn't it? Only that it does not seem be consistent across versions (or is it across OS versions, I wonder)?
Since I usually used Linux, I was not sure what the OP was talking about. I created a few test procedures in 63 (windows version) first (Screen -01).
Windows Build version 63. Notice missing Proc toolbar (Screen -01)

Everything went off without any hitch, although it did not display the Procedure Complier bar, it was not a show stopper. I could compile repeatedly the procedure without any issue, and update the parameter for this procedure (Screen -02).
Modify the parameter (Screen -02)


Next, I started my linux version and recreated the same procedure. Bingo! The first time procedure got compiled and the green icon was displayed. I could see the Procedure 'Compilation' Toolbar. However, when I compiled again, (Screen -03)

Linux Build 64 (notice the Procedure Tool bar (Screen 03)

When I complied "with Debug option", I could see the green icon now (Screen -04)

Go for Green (Compiled with Debug) (Screen -04)

But, I cannot modify the parameter window (Screen -05). I hope SQLDeveloper team will take note of this and correct the bug.

Cann't change the parameter (Screen -05)

Update:
As Sue Harper had pointed out, it was a case of how I compiled. Default Compilation option for SQLDeveloper is to "Compile with Debug"
If you want to reset the default preferences to "compile and no Debug" go to Tools-->Database-->PLSQL Compiler and click on the optimization level and set it to 2. Note: This setting "tells" compiler to optimize the PLSQL Library units. (Screen -06)


After setting the preferences to zero, I reran the procedure and was able to change the input parameter ( See below) .



The log ouput window is shown below. Thanks Sue.


You might also want to read this post ( If using windows:-

How to get SQLDeveloper working on Windows 7

If you are using *nix then

How to make SQLDeveloper work on Linux

)

Oracle Learning Library



Thanks to Sue's post (click here to read her post), I learned that, Oracle has introduced a Learning Library, includes online demonstrations, including APEX tutorials and SQLDeveloper demos. Truly worth watching. Click here to go to Oracle Learning Library. It is easy to search either by Product or by Category. For example to find out how to use SQLDeveloper for Microsoft Access, you would select "Database" under the "Category" and "SQL Developer" under "Product Component" and system provides a search output as shown below. Click on hyperlink under the column "Title" and a new window is launched displaying the Demo.




Monday, May 3, 2010

How to get SQLDeveloper working on Windows 7




Oracle SQL Developer 2.1

I have a 64 Bit Windows 7 installed in my laptop. So I downloaded and installed 64 bit Java software in my machine. Next I found where the jdk was installed (usually it is in the "C:\Program files\Java\jdk<version>". If you cannot find it, go to c:\ and type dir jdk*.* /s /p - 's' will search recursively and 'p' will pause after each page of display). Go to the directory where you have unzipped the SQLDeveloper and open the SQLDEVELOPER.conf file and updated the variable SetJavaHome (This file is located at sqldeveloper\sqldeveloper\bin directory. Then click on the sqldeveloper.exe (located in the same directory), a command window is opened and lanuches SQLDeveloper in a new window. (Note:Do not use the SQLDeveloper.bat - available in the same directory - to launch SQLDeveloper. This would result in problems Procedures/Packages/Function toolbar (see below)


This is the Screen from as launched from SQLDeveloper.bat;As you can see, Both the Compiler options and Procedure Toolbar are missing(Screen -01)


This is the Screen from as launched from SQLDeveloper.exe;As you can see, Both the Compiler options and Procedure Toolbar are present(Screen -02)



Version Screen for Sqldeveloper.bat(Screen -03)



Version Screen for Sqldeveloper.exe(Screen -04)







SO Exception, TNS-12514 and other errors



My Windows 7 was giving troubles of late and was crashing (Blue-screen-of-death) almost 3/4 times daily (Need to figure out that one at some other point of time). Naturally, the Linux OS installed in the VMware, also started giving problems. For the last two days, I could not connect to Oracle from SQLDeveloper. First I got ORA-12541 (Screen -1), then, ORA-12514 error and lastly, a "SO Exception".

Lastly, I logged into SQLPLUS as sys and ran the following command:-
Show parameter local listener (Screen -02).

Bingo! I found that the port number was wrong. Instead of 25000,my tnsnames and listener was set at 3801. Modified the listener.ora and tnsnames.ora and SQLDeveloper was able to connect again (Screen -03)

Sunday, May 2, 2010

PLSQL Document Stds from Steven Feuerstein

I missed noticing that Steven Feuerstein has published a PLSQL Standards Document nearly a week ago. For those who have not download you can do that by clicking here

Thursday, April 29, 2010

Search and Highlight in SQLDeveloper

Search & Highlight -1

I stumbled upon by chance, on a nice cool feature in SQLDeveloper - Search and Highlight rows. Run a Query, by pressing F9 and place cursor in the result window. Now press CTRL & F together, you would a popup window. Type a search text ( I typed 'Toibas' and clicked on  "Highlight", on the top. It would enable "Persist Highlight" and "Highlight Row" (See Search & Highlight -1 above). Check both of them and you would see a result as shown below (Search and Highlight Screen 2)
Search and Highlight -2

Monday, April 26, 2010

11g Default Schema & Scott Schema

11g comes with quite a number of demo schemas (seeded tables which can be queried to understand /Learn various SQL commands). To know more about it, go to: Download Oracle Schema
Scott User which used to come unlocked and OPEN in every version, is no longer the case. You need to manually unlock the user. To learn more about SCOTT Schema go to: http://wiki.oracle.com/page/scott%2Ftiger  

To learn about installing Sample schemas in 10g, go to :- Installing Sample Schema's
Sample Schemas reside under $ORACLE_HOME/demo/schema.  Demobld.sql resides under $ORACLE_HOME/sqlplus/demo

Saturday, April 24, 2010

SP2-0027 error in SQLPLUS



Screen -1
While running a script, from SQLPLUS, I came across an error: "SP2-0027: Input is too long (> 2499 characters) - line ignored" (Screen -1) - even though I had already run SET SERVEROUTPUT ON SIZE UNLIMITED.
There is a lengthy discussion on resolving this at tom kyte's website - click here to go there. However, I ran the same script under SQLDeveloper, it worked! (Screen-2). Now, that's an easy solution :-)

Screen -2
To download SQLDeveloper click here

Thursday, April 22, 2010

How to set login preferences (SQLDeveloper)?

Screen-1
Although, setting login preferences for SQLDeveloper v2.1.1.64,is straight-forward, it just doesn' t seem to work.
To set login preference for goto Tools --> preferences; select database, click on browse to choose the login you have just created and you are done (see Screen -1 above).
After setting the preferences, I ran the following SQL: "exec DBMS_OUTPUT.PUT_LINE ('1234567890123456789012345678901234567890');" and ran the script. The script output window display is shown below (Screen -2). hmm, not what I expected.
Screen -2
I opened the DBMS Output window (Screen -3) (navigation View-->"DBMS Output") and reran the above window, only to end up with same results as displayed above - no luck again.
Screen -3

So, I ran the command SERVEROUTPUT manually and ran it - success!  Unfortunately, Session parameters seems to be manually run each time a you run a script and does not get set automatically. you can see the results in (Screen -4).
Screen -4

How to set login preferences (for SQLPLUS)?

I am too lazy to keep setting debugging messages or pagesize for every session in SQLPLUS. Also, I would like to set the SQLPROMPT look much like the UNIX Prompt. There are essentially two places where I can do it. Either use a file glogin.sql (oracle creates a glogin.sql file - nothing but a shell - at $ORACLE_HOME/sqlplus/admin ) or create a login.sql at the directory where I start sqlplus.
Note: In order to change glogin, super user access is needed. If you do not have super user access, create a login.sql at a local directory.

To display debugging messages on, use SET SERVEROUTPUT ON
To set the output size (below 10g) SET SERVEROUTPUT ON SIZE 10000. (for 10g & above), it is "SET SERVEROUTPUT ON SIZE UNLIMITED
To set the sqlprompt, enter SET SQLPROMPT "Srini" - the value given between the double quotes is displayed as SQL Prompt. If you want it to be generic, then type, SET SQLPROMPT "_USER'@'_CONNECT_IDENTIFIER _PRIVILEGE >"
The above command displays the user, database name, connected (sysdba or normal)
Screen shot of my glogin.sql (Screen -1) is displayed below:


After modifying the login file, the effects are shown in the Screen -2 & Screen -3.


Note: If the SERVEROUTPUT is not set right, Oracle will raise ORA-20000 error as shown below (Screen -4):


References: To learn more about SQLPLUS commands click here

SQLDeveloper copying Connections.xml

Sharing connections across the team members in SQLDEVELOPER is a breeze.
Step1: get the connections.xml from any one of the users and copy to your local directory (In Linux it is found at .sqldeveloper/system2.1.1.64.45/o.jdeveloper.db.connection.11.1.1.2.36.55.30/ directory).

Step 2: When I started the SQLDEVELOPER (if you want to know how to add SQLDEVELOPER to your linux menu click here), and clicked on one of the connections that appears on the left, I got an error (Screen 01)


A little investigation showed that I had missed setting the ORACLE_HOME variable correctly. After correcting this, reclicking on the connection I got ocijdbc11.in.java not in library path (Screen -2)

Step 3:
 If I select connection type as Basic (instead of TNS), and the enter values needed, I am connected!. (Screen -3)

Wednesday, April 21, 2010

SQLDeveloper: Sharing Shortcuts across the team

SQLDeveloper has an utility to export the short-cuts. It is an excellent way to ensure that short-cuts, are kept uniform, can be shared across the team. I have listed below steps to export the preferences and import them back.
1) Navigation: Tools-->Preferences (Screen -1)


2) Select Shortcut Keys (Screen -2)


3) Click on More Actions and select Export in the drop-down list (Screen -3)


4) Select the directory to save the file (Screen -4)

5) Importing the preferences is similar; follow the steps 1 & 2 and in step 3, select "Import" instead of "Export" and select file to import. (screen -5)


6). An confirmation window will appear (Screen -6), click on "yes" and the Short-cut preferences will be imported.