1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Installation of Oracle 10g.

Discussion in 'Installation - Windows' started by sonia_1985, Jun 15, 2012.

  1. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    I have installed the Oracle 10g at the following location : -
    C:\oracle\product\10.2.0\client_1\NETWORK\ADMIN

    But I was trying to ping Oracle Client from Command Prompt. See Below : -
    c:\Oracle>tnsping SONIA
    ERROR IS COMING no listener

    MINE tnsnames.ora File : -

    Code (Text):

    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\client_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.

    SONIA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = sonia)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = SONIA)
        )
      )
     
    What this error means??? Help me in connecting to the ORACLE 10g.
    I have studied on the net that for Oracle to connect three ora files need to be there. But in my ADMIN Folder two files are created by Oracle Configuration Tools names SqlNet.ORA , TNSNAMES.ORA. LISTENER.ORA file is not created.
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Re: Installation of Oracle 10g

    You've installed the client, not the database server software, so there will be no listener. You need to install the database server software, much larger in size. You will have nothing to connect to otherwise.
     
    sonia_1985 likes this.
  3. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    Can you please give me the link from where to download Oracle Server 10g. Moreover, I have the exe named ODTwithODAC1020221.exe --> THIS IS THE ORACLE SERVER 10g ?????
     
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    sonia_1985 likes this.
  5. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    I have installed the oracle 11g database server. Now when I am tryygin to PING, See Below : -
    Code (Text):

    C:\Oracle>tnsping SONIA
    I get the following message.
    Use HOSTNAME Adapter to resolve the alias.
    Attempting tp contact <DESCRIPTION - <CONNECT_DATA_<SERVICE NAME ->><ADDRESS-<PROTOCOL=TCP><HOST=127.0.0.1><PORT=1521>
    OK <20 msec>
     
    I think so, oracle is working Now, If I am not wrong. But I am not getting where to write the QUERY to CREATE TABLE.
     
  6. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    That is a program named sqlplus.exe and you should have a shortcut to that on your Start menu:

    Start -> All Programs -> Oracle - OraDb11g_dbhome1 -> Application Development -> Sql*Plus

    You will need a username and a password; SYS is the user that can create other users so that's the account you should start with. Create a personal user for your learning exercises -- DO NOT USE SYS AS A PLAYGROUND. Alternatively you can connect from the command prompt:

    c:\> sqlplus / as sysdba

    and you will be connected to your database.

    The online documentation is found here:

    http://tahiti.oracle.com

    Select the Oracle Database 11g Release 2 documentation and start reading on how to create user accounts, how to grant privileges and create tables. You will also need to read the Concepts Guide as that will provide a wealth of information about the database itself.

    Return here to ask questions; we're happy to help those who hslp themselves.
     
    sonia_1985 likes this.
  7. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    I have installed SQL Developer, but dont know SQL Plus is also installed.




    In SQL Plus User Name :- SYS . What is the Default Password & Host String to get into the database?
     
  8. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    When creating the database you should have been asked to set the SYS and SYSTEM passwords. If you cannot remember what you set these passwords to you can always open a command prompt and type

    C:\> sqlplus / as sysdba

    and you should be connected provided the database service and database are running:

    sqlplus.JPG

    At that point you can set the passwords for SYS and SYSTEM to whatever you like, and you can also create a personal user account (which I would STRONGLY recommend) to play with:

    Code (SQL):

    CREATE USER sonia IDENTIFIED BY mypass;
    GRANT CONNECT, CREATE SESSION TO sonia;
     
    These would be the basic privileges to allow this account to connect to the database and create a session. You should then use this account anytime you connect to the database that does not require elevated privileges (such as startup and shutdown of the database).
     
    sonia_1985 likes this.
  9. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    Uff This Oracle will Kill Me One Day. I am not able to create table in ORACLE from last so many days...UFF.
    I have executed the foll. statements in command Prompt . CREATE TABLE is giving me the ERROR - no privileges on tablespace 'SYSTEM'
    Code (Text):


    SQL> SHOW USER
    USER is "SONIA"
    SQL>

    SQL> SELECT username,privilege FROM USER_SYS_PRIVS;

    USERNAME                       PRIVILEGE
    ------------------------------ ----------------------------------------
    SONIA                          CREATE SESSION
    SONIA                          CREATE TABLE

    SQL> CREATE TABLE CUSTOMER(CustID Number(5) Primary Key, CustName Varchar(20));
    CREATE TABLE CUSTOMER(CustID Number(5) Primary Key, CustName Varchar(20))
    *
    ERROR at line 1:
    ORA-01950: no privileges on tablespace 'SYSTEM'
     
     
  10. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You won't have privileges on SYSTEM and you shouldn't. Connect again as SYS to your database and execute the following statement:

    alter user sonia default tablespace users quota unlimited on users;

    You may then connect as SONIA and be able to create tables and indexes.
     
    sonia_1985 likes this.
  11. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    Finally I am able to create table in oracle using Command Prompt. Thanks very very much David Fitzjarrell.
    I want to ask just one question before closing this thread.

    When I connect in command prompt using username,password & Host String(tnsNames.ora). Its succeed as seen below.

    Code (Text):

    C:\>sqlplus sonia/mypass@sonia - In this line First sonia is the userName & second Sonia is the host from the tnsnames.ora

    SQL*Plus: Release 11.2.0.2.0 Production on Wed Jul 4 13:12:43 2012

    Copyright (c) 1982, 2010, Oracle.  All rights reserved.


    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
     

    But When I use the sqlPlus screen to connect to Oracle -
    UserNAme - sonia
    Password - mypass
    HostString - sonia

    I am getting ERROR - ORA-12514 TNSlistener does not currently know of service requested in connect descriptor.
    I am not getting why I am not able to LOGIN FROM SQLPLUS SCREEN.

    I searched on the net, But still No LUck.My database is also started which I find using the
    Code (Text):
     C:>sc query OracleServiceXE

    tnsnames.ora (LOCATION - C:\oracle\product\10.2.0\client_1\network\admin\tnsnames.ora
    )

    # tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\client_1\network\admin\tnsnames.ora
    # Generated by Oracle configuration tools.

    SONIA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = sonia)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVICE_NAME = SONIA)
    )
    )
    [/code]


    tnsNAmes.ora -C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
    Code (Text):

    XE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = sonia)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XE)
        )
      )

    EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        )
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
        )
      )

    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        )
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
        )
      )
     
    Listener.ora -C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
    Code (Text):

    XE =
    SID_LIST_LISTENER =
      (SID_LIST =
        (SID_DESC =
          (SID_NAME = PLSExtProc)
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (PROGRAM = extproc)
        )
        (SID_DESC =
          (SID_NAME = CLRExtProc)
          (ORACLE_HOME = C:\oraclexe\app\oracle\product\11.2.0\server)
          (PROGRAM = extproc)
        )
      )

    LISTENER =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
          (ADDRESS = (PROTOCOL = TCP)(HOST = sonia)(PORT = 1521))
        )
      )

    DEFAULT_SERVICE_LISTENER = (XE)
     

    I am still confused in that I have two tnsNames.ora in different locations.Is that OK?
     
  12. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You will use one or the other depending upon which ORACLE_HOME is declared in your registry entries for Oracle; I suspect that from the command line you are using the client_1 software (it shows up first in your PATH variable) and with the shortcut on your desktop to other SQL*Plus you are using the database server home. To connect to your database using the shortcut you will need to use xe instead of sonia as your tnsnames alias:

    sonia/mypass@xe

    You will then be connected to your database. To eliminate confusion you can edit the tnsnames.ora in your database server home (the one with XE as the alias) and change the XE alias to SONIA. Then you can connect using one connect string through either tnsnames.ora file. If it were my installation I would remove the client_1 home entirely (you do not need it as the database server installs the full client software) and edit the tnsnames.ora in the database server home (you will then only have one file) so you can connect with the same string regardless of whether you connect from the command prompt or from the desktop shortcut. If you do remove the client_1 home make sure you also remove all references to that in your PATH variable.
     
  13. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    hi david fitzjarrell. I succeed in login through SQL Plus Screen. I make the two tnsNames.ora files exactly same & it worked for me.

    Tell me exactly, there is need to install oracle client , for oracle to work. Because one tnsnames.ora file is created by the oracle Client Installation & other tnsnNames.ora file is created by the database server 11g.
     
  14. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    As I said in a prior response there is no need for a separate client install when you've installed the database server sorftware as the full client software is part of the database server installation.

    You can remove the separate client installation if you want as it is not needed.
     
  15. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    OK Got it.Thanks .
     
  16. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    Now I want to install Oracle on Windows 7.
    Code (Text):

    http://www.oracle.com/technetwork/products/express-edition/downloads/index.html
     
    So installation of Oracle Database Express Edition 11g Release 2 for Windows x32 from the above following link is sufficient. Or Do I need to install anything before it?
     
  17. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You shouldn't need to install anything before installing Oracle but the Windows 7 machine must meet the minimum requirements for the install with regard to installed RAM and disk space.
     
  18. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    hi David, I installed oracle 11g on windows 7. & I am succeed in connecting with the Oracle using SQL Developer. But Error is dere in connecting the .Net with Oracle : -
    *My tnsNames.Ora File -*
    Code (Text):

    XE =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = Sonia-PC)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = XE)
        )
      )

    EXTPROC_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        )
        (CONNECT_DATA =
          (SID = PLSExtProc)
          (PRESENTATION = RO)
        )
      )

    ORACLR_CONNECTION_DATA =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
        )
        (CONNECT_DATA =
          (SID = CLRExtProc)
          (PRESENTATION = RO)
        )
      )
     
    *.Net Code -
    Code (Text):

    public partial class Default2 : System.Web.UI.Page
    {
       
        OracleCommand cmd = new OracleCommand();
        OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = Sonia-PC)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE))),UserID=user_test,Password=sonia;");
       
        protected void Page_Load(object sender, EventArgs e)
        {
            cmd.CommandText = "INSERTSTUDENT";
            cmd.Connection = conn;
            cmd.Parameters.Add("p_roll", OracleDbType.Long, 64, 1, ParameterDirection.Input);
            cmd.Parameters.Add("p_name", OracleDbType.Varchar2, 2000, "sonia", ParameterDirection.Input);
            cmd.Parameters.Add("p_marks", OracleDbType.Long, 64, "10", ParameterDirection.Input);
            conn.Open();
            cmd.ExecuteNonQuery();
        }
    }
     
    When the line conn.Open() is executed ERROR is dere - ORA-12154: TNS:could not resolve the connect identifier specifiedI have set Data Source = XE also but it also giving the same ERROR.
     
  19. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    You may need to set the TNS_ADMIN environment variable to the directory where your tnsnames.ora file is located so that .NET can 'see' it. Normally an ORA-12154 error indicates the entry is not defined in the tnsnames.ora the applkcation is reading.
     
  20. sonia_1985

    sonia_1985 Active Member

    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    80
    Sorry but this you are wrong. I just change my connection string as follows & it worked:-
    Code (Text):

    "Data Source=XE;User Id=user_test;Password=sonia;"