Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Join Date
    Feb 2003
    Location
    china
    Posts
    11

    Unanswered: I want to connect Oracle DB via sqlplus as user root,how to do?

    Hi All,

    I try to connect Oracle DB via sqlplus as usr root,but the following error occur:

    # sqlplus

    SQL*Plus: Release 8.0.4.0.0 - Production on 4 4 17:2:34 2003

    (c) Copyright 1997 Oracle Corporation. All rights reserved.

    Enter user-name: system
    Enter password: password
    ERROR:
    ORA-01034: ORACLE not available

    The Oracle DB had startup as user oracle.


    Can you help me?

    Thanks a lot.

  2. #2
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    118
    The database you're connecting to isn';t up and running.
    Please post tyhr following:

    $ ps -elf |grep -i smon


    Remi
    Remi Visser

    Oracle Database Administrator
    (OCP certified 8i)

    Homepage: http://home.remidian.com/

  3. #3
    Join Date
    Apr 2003
    Location
    Bahrain
    Posts
    11
    Hi,

    First check the service for the database is running or not! If not, start it first!

    If it's running, connect to sqlplus with sysdba privilege and issue the command

    sql>startup


    Heber

  4. #4
    Join Date
    Feb 2003
    Location
    china
    Posts
    11

    Thank you all

    The service for the database had startup with the user oracle.

    I had added following line in the /etc/profile file:
    ../$ORACLE_HOME/.profile

    However it is still not.

  5. #5
    Join Date
    Apr 2003
    Location
    Bahrain
    Posts
    11
    Hi,
    Did you give startup command as a user with sysdba privilege?

    If yes, what is the result?

    Heber

  6. #6
    Join Date
    Feb 2003
    Location
    china
    Posts
    11

    Thanks!

    The Oracle service had startup as the user oracle.

    # su - oracle
    Sun Microsystems Inc. SunOS 5.8 Generic February 2000

    $ svrmgrl

    Oracle Server Manager Release 3.0.4.0.0 - Production

    (c) Copyright 1997, Oracle Corporation. All Rights Reserved.

    Oracle8 Enterprise Edition Release 8.0.4.0.0 - Production
    PL/SQL Release 8.0.4.0.0 - Production

    SVRMGR> connect internal
    connected.
    SVRMGR> startup
    ORACLE instance started.
    Total System Global Area 9980096 bytes
    Fixed Size 47296 bytes
    Variable Size 5447680 bytes
    Database Buffers 4403200 bytes
    Redo Buffers 81920 bytes



    Can you give me some detail operations which you said?


    Thanks!
    Last edited by alexguo; 04-07-03 at 03:23.

  7. #7
    Join Date
    Apr 2003
    Location
    Bahrain
    Posts
    11
    Hi,
    Did u get the following message?

    Database Mounted
    Database Opened

    Heber

  8. #8
    Join Date
    Feb 2003
    Location
    china
    Posts
    11

    Thanks

    There are these messages!

    How will I do?

    Can you help me?

    Thanks a lot!
    Last edited by alexguo; 04-07-03 at 06:05.

  9. #9
    Join Date
    Apr 2003
    Location
    Bahrain
    Posts
    11
    ya,
    now try

    sqlplus> connect root/password

    What is the output?

    Heber

  10. #10
    Join Date
    Sep 2002
    Location
    Ohio
    Posts
    204

    Re: Thanks

    Originally posted by alexguo
    There are these messages!

    How will I do?

    Can you help me?

    Thanks a lot!
    What Flavor and Version of UNIX are you running? When you are logged in as root, and are trying to log into sqlplus, are your Oracle environment variables setup correctly? Before running sqlplus, type
    #echo $ORACLE_SID the output should be the name of the database you are trying to connect to. If it isn't, then type:
    # sqlplus system@SID, where SID= name of database you want to connect to.

    If this still doesn't work, try cutting the output from your session and posting it, so we can see exactly what's happening.

    HTH,
    Patrick

  11. #11
    Join Date
    Feb 2003
    Location
    china
    Posts
    11

    Thanks

    To heber

    # su - oracle
    Sun Microsystems Inc. SunOS 5.8 Generic February 2000

    $ sqlplus

    SQL*Plus: Release 8.0.4.0.0 - Production on Tues 4Month 8 11:54:58 2003

    (c) Copyright 1997 Oracle Corporation. All rights reserved.

    Enter user-name: system
    Enter Password:

    connected to:
    Oracle8 Enterprise Edition Release 8.0.4.0.0 - Production
    PL/SQL Release 8.0.4.0.0 - Production

    SQL> connect root/root
    ERROR:
    ORA-01017: invalid username/password; logon denied

    Warning: You are no longer connected to ORACLE.

    To buckeye234

    OS : Sun OS 5.8
    DB : Oracle 804

    I think that my Oracle environment variables were setup correctly ,because the Oracle run well as the user oracle.

    # echo $ORACLE_SID
    bsp
    # sqlplus system@bsp

    SQL*Plus: Release 8.0.4.0.0 - Production on Tues 4Month 8 12:4:25 2003

    (c) Copyright 1997 Oracle Corporation. All rights reserved.

    Enter password:
    ERROR:
    ORA-01034: ORACLE not available


    Enter user-name:

    Can you help me?


    Thanks a lot!
    Last edited by alexguo; 04-08-03 at 03:35.

  12. #12
    Join Date
    Apr 2003
    Location
    Bahrain
    Posts
    11
    hi,
    After conencted using the user system

    give the following command and check whether you have the user called root

    select username from dba_users;

    if you have the user root

    give the following command to change his password

    alter user root identified by root;
    then try
    connect root/root;

    Tell me what is the output

    else

    create the user root with the password root

    then try

    connect root/root

    Heber

  13. #13
    Join Date
    Sep 2002
    Location
    Ohio
    Posts
    204

    Re: Thanks

    Originally posted by alexguo
    To heber

    # su - oracle
    Sun Microsystems Inc. SunOS 5.8 Generic February 2000

    $ sqlplus

    SQL*Plus: Release 8.0.4.0.0 - Production on Tues 4Month 8 11:54:58 2003

    (c) Copyright 1997 Oracle Corporation. All rights reserved.

    Enter user-name: system
    Enter Password:

    connected to:
    Oracle8 Enterprise Edition Release 8.0.4.0.0 - Production
    PL/SQL Release 8.0.4.0.0 - Production

    SQL> connect root/root
    ERROR:
    ORA-01017: invalid username/password; logon denied

    Warning: You are no longer connected to ORACLE.

    To buckeye234

    OS : Sun OS 5.8
    DB : Oracle 804

    I think that my Oracle environment variables were setup correctly ,because the Oracle run well as the user oracle.

    # echo $ORACLE_SID
    bsp
    # sqlplus system@bsp

    SQL*Plus: Release 8.0.4.0.0 - Production on Tues 4Month 8 12:4:25 2003

    (c) Copyright 1997 Oracle Corporation. All rights reserved.

    Enter password:
    ERROR:
    ORA-01034: ORACLE not available


    Enter user-name:

    Can you help me?


    Thanks a lot!
    OK, repeat your example above. SU to Oracle, then type:
    $echo $ORACLE_SID

    $echo $TNS_ADMIN

    exit out to root and repeat:
    #echo $ORACLE_SID

    #echo $TNS_ADMIN

    If your ORACLE_SID is set to the same value for both users, then we need to verify that your are looking at the same tnsnames.ora file.

    I can recreate the symptoms you experience as root, but only when the ORACLE_SID value is defined in tnsnames.ora and the database that the ORACLE_SID entry points to is not running. So, it would seem that the two users (root and oracle) are not connecting to the same database, we need to determine why.

    In fact, as each user, type:

    env | grep oracle

    and compare the outputs. See if there are any differences at all in the environment variables that reference oracle.

    Please post the results of all.

    HTH,
    Patrick

  14. #14
    Join Date
    Feb 2003
    Location
    china
    Posts
    11

    Thanks!

    Sorry , I am a jackeroo. I do not konw what is the variable TNS_ADMIN.I had not set the variable.
    Could you give me more detail information?

    The following is my example :

    $ echo $ORACLE_SID
    bsp

    # echo $ORACLE_SID
    bsp

    # more /baan/oracle/804/network/admin/tnsnames.ora
    #
    # Installation Generated Net8 Configuration
    # Version Date: Oct-27-97
    # Filename: Tnsnames.ora
    #
    extproc_connection_data =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = bsp))
    (CONNECT_DATA = (SID = extproc))
    )

    bsp =
    (DESCRIPTION =
    (SDU= 8192)
    (TDU= 8192)
    (ADDRESS = (PROTOCOL= TCP)(Host= sun3)(Port= 1521))
    (CONNECT_DATA = (SID = bsp))
    )

    # env | grep oracle
    LD_LIBRARY_PATH=/baan/oracle/804/lib
    ORACLE_BASE=/baan/oracle
    ORACLE_DOC=/baan/oracle/doc
    ORACLE_HOME=/baan/oracle/804
    ORACLE_OWNER=oracle
    PATH=/baan/oracle/804/bin:/usr/bin:/usr/ucb:/etc:.

    # su - oracle
    Sun Microsystems Inc. SunOS 5.8 Generic February 2000

    $ env | grep oracle
    HOME=/baan/oracle/804
    LD_LIBRARY_PATH=/baan/oracle/804/lib
    LOGNAME=oracle
    ORACLE_BASE=/baan/oracle
    ORACLE_DOC=/baan/oracle/doc
    ORACLE_HOME=/baan/oracle/804
    ORACLE_OWNER=oracle
    PATH=/baan/oracle/804/bin:/usr/bin:/usr/ucb:/etc:.


    Can you help me?

    Thank you very much.

  15. #15
    Join Date
    Sep 2002
    Location
    Ohio
    Posts
    204

    Re: Thanks!

    Originally posted by alexguo
    Sorry , I am a jackeroo. I do not konw what is the variable TNS_ADMIN.I had not set the variable.
    Could you give me more detail information?

    The following is my example :

    $ echo $ORACLE_SID
    bsp

    # echo $ORACLE_SID
    bsp

    # more /baan/oracle/804/network/admin/tnsnames.ora
    #
    # Installation Generated Net8 Configuration
    # Version Date: Oct-27-97
    # Filename: Tnsnames.ora
    #
    extproc_connection_data =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = bsp))
    (CONNECT_DATA = (SID = extproc))
    )

    bsp =
    (DESCRIPTION =
    (SDU= 8192)
    (TDU= 8192)
    (ADDRESS = (PROTOCOL= TCP)(Host= sun3)(Port= 1521))
    (CONNECT_DATA = (SID = bsp))
    )

    # env | grep oracle
    LD_LIBRARY_PATH=/baan/oracle/804/lib
    ORACLE_BASE=/baan/oracle
    ORACLE_DOC=/baan/oracle/doc
    ORACLE_HOME=/baan/oracle/804
    ORACLE_OWNER=oracle
    PATH=/baan/oracle/804/bin:/usr/bin:/usr/ucb:/etc:.

    # su - oracle
    Sun Microsystems Inc. SunOS 5.8 Generic February 2000

    $ env | grep oracle
    HOME=/baan/oracle/804
    LD_LIBRARY_PATH=/baan/oracle/804/lib
    LOGNAME=oracle
    ORACLE_BASE=/baan/oracle
    ORACLE_DOC=/baan/oracle/doc
    ORACLE_HOME=/baan/oracle/804
    ORACLE_OWNER=oracle
    PATH=/baan/oracle/804/bin:/usr/bin:/usr/ucb:/etc:.


    Can you help me?

    Thank you very much.
    TNS_ADMIN is an environment variable that points to where the tnsnames.ora and listener.ora files are, if not in the default location.
    You can try two things. First, in the root session, try explicitly setting TNS_ADMIN to /baan/oracle/804/network/admin and exporting the variable. I am guessing this will force the oracle user and root user to use the same tnsnames.ora file.

    Additionally, I believe the default location for tnsnames.ora, on Solaris, is /var/opt/oracle. For the second thing, please look in /var/opt/oracle and see if there is a different tnsnames.ora file in that location. If there is, look at the contents and see if the settings for the bsp database are the same as ion the other tnsnames.ora file. Please let us know the results.

    HTH,
    Patrick

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •