How to install oracle 11g database and setup instant sqlplus client

Today I found how to set up sqlplus client on my computer!! So I wanna share this!!

Follow below steps!!

  • Download oracle 11g database from oracle wesite or you can go here directly http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
  • Install it on your computer.It will ask to where to save .You can select any drive or any folder but save it on the c: drive.
  • While installing it will ask you to set username and password. choose your username and password. Remember these credentials because we use them to login in client .
  • Now it will saved on c: like c:/oracle or c:/oracleexe .

Now you are done with the installing the oracle 11g database.

How to set up sqlplus instant client

  1. Now it is time to set up sqlplus client.
  2. Download sqlplus instant client from oracle web site or you can download here directly http://www.oracle.com/technetwork/indexes/downloads/index.html
  3. There you can find Instant Client . Download it .
  4. It will be zip file and extract it.
  5. Copy that folder to c:/oracle

2009-08-26_1556

  • Setup your system %PATH% and %TNS_ADMIN% variables

    In Windows explorer LEFT pane, right click on “My Computer” icon and click “Properties”
    Click “Advanced” tab
    Click Environment variables button:

    In the “System Variables” panel select “Path” variable and click “Edit” button:

    In the “Variable Value” field paste the following:
    C:\oracle\instantclient_11_1
    BEFORE all other path values that point to your OLD Oracle clients, then click “Ok”

    Now find a variable called TNS_ADMIN — it could be in either panel (System / User),
    if you have no such variable, create it in the User panel by clicking “New”:
    Variable Name: TNS_ADMIN
    Variable Value: C:\oracle\instantclient_11_1
    Click Ok

    Now click “Ok” on the Environment Variables screen
    and click “Ok” on the System Properties window to close it

    Setup tnsnames.ora file

    If you have an existing Oracle client copy tnsnames.ora file from there and place it to:

    C:\oracle\instantclient_11_1

    If you don’t have an existing Oracle client create a new tnsnames.ora file, for example:

    - - - - - - - - - - - - - - - - - - - - - - - 
    XRACQ_MYSERVICE_TAF =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = vip-qarac1)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = vip-qarac2)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = vip-qarac4)(PORT = 1521))
        (ADDRESS = (PROTOCOL = TCP)(HOST = vip-qarac3)(PORT = 1521))
        (LOAD_BALANCE = yes)
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XRACQ_MYSERVICE_TAF.domain.com)
          (FAILOVER_MODE =
            (TYPE = SELECT)
            (METHOD = BASIC)
            (RETRIES = 180)
            (DELAY = 5)
          )
        )
      )

    Test 11g client by running sqlplus

    Open a new CMD window by going to Start->Run
    In the Run Window type in: cmd and press “Ok”:

    in the CMD window prompt type in:

    sqlplus user/pass@TNS_ALIAS

    where:

    user: is the database username given to you by the DBA
    pass: is the database password given to you by the DBA
    TNS_ALIAS: The alias you setup in the tnsnames.ora file

    example:

       C:\>sqlplus xxx/xxxxxxxx@XRACQ_MYSERVICE_TAF
    
       SQL*Plus: Release 11.1.0.7.0 - Production on Wed Aug 26 16:24:23 2009
    
       Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    
       Connected to:
       Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
       With the Partitioning, Real Application Clusters, OLAP, Data Mining
       and Real Application Testing options
    
       SQL>

    If you get the ORA-12705 error while running sqlplus test:

    C:\>sqlplus xxxxxx/xxxxxxxx@xxxxxxxxxxx
    
    SQL*Plus: Release 11.1.0.7.0 - Production on Wed Aug 26 16:58:33 2009
    
    Copyright (c) 1982, 2008, Oracle.  All rights reserved.
    
    ERROR:
    ORA-12705: Cannot access NLS data files or invalid environment specified
    
    Enter user-name:

    Here’s the solution:

    To fix the “ORA-12705: Cannot access NLS data files or invalid environment specified” error, go to your registry editor (run regedit from Start->Run) and then:

    – Navigate to Windows Registry in \HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    – Remove the NLS_LANG from there (select it and delete)

    Re-run the sqlplus test to make sure it works (you will need to open a new CMD window for the registry changes to take place).

 

 

Setup your system %PATH% and %TNS_ADMIN% variables

In Windows explorer LEFT pane, right click on “My Computer” icon and click “Properties”
Click “Advanced” tab
Click Environment variables button:

Advertisements
This entry was posted in tech it !! and tagged , , , . Bookmark the permalink.

One Response to How to install oracle 11g database and setup instant sqlplus client

  1. anima says:

    Hey I am stuck right at login from cmd.
    I am getting
    Error
    ORA-01017: invalid username/password; logon denied

    I am pretty sure about the username and password. However is there an opiton to check the oracle db configuration to reset the username/password? Also is there uppercase/lowercase mixing up that I am missing out?

    Appreciate your help!
    Thanks in advance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s