Oracle: Query column name with reserved keyword from a table

I happen to see a table(say X) created with column name using key words like NUMBER, GROUP . I could query the table X for all columns as

Select * from X;

To query one or two particular columns named as keywords, you need to use double quotes.

Select "NUMBER" from X;

Make note of the 'case'  as Select "number" from X; won't work.

Where table creation script is:

Create table X
( "NUMBER" varchar2(90),
   Creation_date date,
...
...
...);

Oracle: Memory Parameters Math

It is always challenging for Oracle Administrator to define Oracle Memory Parameters. Recently while creating new database with Oracle 11g (11.2.0.3) using DBCA, I noticed the values DBCA assigns to the following memory parameters.

Total Memory: 1024 M (or 1 GB)
Shared Pool - 160 M
Buffer Cache- 482 M
Java Pool - 48 M
Large Pool - 76M
PGA - 256 M

These value can help Oracle DBA to multiply or divide to get accurate numbers. I chose 'custom database' option with 8K block size in DBCA.

Oracle: Change the SQL Prompt with Glogin.sql

DBAs usually work with so many servers, databases at the same time. They toggle from one screen to another within few seconds. There are a lot hidden opportunities where you can make mistakes. Being a superuser  brings in more responsibilities and adds up cautions.

Following are some best practices to ensure you are on right database before you do any critical task like shutdown or drop is very relevant :


  1. Login as SYSDBA only when required, otherwise create a database user and grant DBA role.
  2. Use shell script to perform task like shutdown, startup of databases.
  3. Change the color of putty sessions for example Red for Production, Blue for QA, Yellow for Test.
  4. SQL Prompt: Change the SQL prompt on the database to show the Database Name/SID with user whom you have connected as. Oracle by default calls login.sql or glogin.sql whenever 'sqlplus' command is given on a UNIX machine. The script login.sql or glogin.sql is located in $ORACLE_HOME/sqlplus/admin. You can add a line to query from v$instance table something like below:
select host_name||':'||user||' @ '||UPPER(instance_name) X from v$instance;

The problem with the above SQL in login.sql is that SQLPLUS will hang if the database is down. When database is down, you cannot query any v$ views. The other way which does the same but safe way is by the command below:





The SQL prompt will be SYSTEM@TESTDB SQL> .

What can you sell to a depressed consumer?

The world is shaking more with economical woes than earthquakes. Everyone is in shock about what might happen to them. Am I going to breathe in peace? Can I go ahead and buy a house? There are lot of confused and depressed consumer. They are not sure what they want  and when and where.

Ten years ago, one of the best seller in this situation would be a counseling books or a session in person. There are many things that I still believe sells in this market condition. Safety and Security sells. Are you open to get bruised or would like to prevent it. Any company that provides innovative approach to secure the mind of a person is sold. Be it a medical insurance, security device at home or safety system in car. I am sure you are not going to buy a less safe automobile to save some dollars.

The big challenging product that can marketed is Technology. There is no shutdown for technology. This doesn't mean that the jobs are recession proof. There are job loss but innovation always steps up. You need a team to convert new concepts to final products. Here you can never believe that you do not have a competition. Technology innovation isn't always about developing a new tablet, re-engineering a software or finding what is in Mars or find a cure. Reverse engineering, Bio-Technological life sciences are areas that can open the wallets. The best example is the revamped automobile industry. Chrysler redesigned their popular models. Toyota had been teased in news, movies for their huge recalls. In reality, They are correcting their faults to build an impressive future. 

Movies and Music, Have you observed the movies released in summer of 2011? There are bunch of superheros -  Green Lantern, Transformers, X Men, Captain America and so on. Does this mean common people are turning comic pages and looking for superheros to relieve them from their stress? If you say yes to the question. You are sold to the superhero. Comic books, movies, music are simple sources of entertainment for half a century now. We forget our issues and try to relax when you catch humor or plugin white headphone of iPod. (I believe that is why Google introduced Google Music last Wednesday).

Education, This is one commodity that brings lot of confidence to some who directly got burned by economy. Many people who lost jobs decided to take education seriously. Universities are one of the most growing industry now.

Fashion, Fashion world is certainly  affected but it still breathes. You know that you have to save but you also want to look good. Even in crying economy, you have social get together, college reunions, romantic dates, theme parties, dance clubs, weddings that you want to be astonishing. Companies makes wardrobe for seasons, sports jerseys, proms, halloween costumes, glass heels to sneakers. No wonder why Victoria Secret displayed 2.5 Million dollar bra two weeks ago at their fashion show.

Food & Drinks, You don't want to cook every day of the year. You need a break from kitchen to relax and get hot sizzling food on the table. Another area where people can't resist to swipe their cards.

Travel and Vacations, Another activity that brings emotional break from routine life. I can see people flying down seeking relief  from long family, school, destination weddings. 

The list don't end here, I simply wanted to give you an overview. I am going to evaluate what is the hot-seller this Thanksgiving. I am positive the graph of expenditure per family will be high as in 2005-06. That does bring to another question why the uncertainty? Where are the green Washingtons, Lincolns, Benjamins disappearing?

One Last Thing

All we strive is for a little more money, little more luxury but if you want to make a change a sensible motivation do help.

"When you grow up, you tend to get told that the world is the way it is, and your life is just to live your life inside the world. Try not to bash into the walls too much. Try to have a nice family life. Have fun, save a little money. That's a very limited life. Life can be much broader, once you discover one simple fact, and that is everything around that you call life was made up by people who were no smarter than you. And you can change it. You can influence it. You can build your own things that other people can use. Once you learn that, you'll never be the same again."

This is a quote from late Steven Paul Jobs.