This discussion is archived
1 2 Previous Next 17 Replies Latest reply: Jan 18, 2013 12:18 AM by Aman.... RSS

Need help in connecting

982690 Newbie
Currently Being Moderated
Hello,

I have created database using Oracle "Database configuration assistant tool" and i have provided values like

for password:Abc@123456
SID:testdb
DataBAse name:testdb

and rest setting accepted as default provided by the tool.

Now when i try to connect to the database using "sql developer" ,credentials that i am using while creating a new connection is :

connection name:testdb
username :testdb
pasword:Abc@123456
HostName:localhost
port:1521(default)
SID:testdb

Error thrown on test :ORA-01017:invalid usename/password :logon denied

Can any one help in identifying my incorrect steps:

Regards
Vivekk
  • 1. Re: Need help in connecting
    Niket Kumar Pro
    Currently Being Moderated
    testdb is your database name not username.....

    you can use HR user provided in oracle database:

    cmd>set ORACLE_SID=testdb
    cmd>sqlplus / as sysdba
    sql>alter user hr identified by password account unlock;
    sql>exit

    then you can use

    connection name:testdb
    username :hr
    pasword:password
    HostName:localhost
    port:1521(default)
    SID:testdb

    and work with hr account
  • 2. Re: Need help in connecting
    982690 Newbie
    Currently Being Moderated
    Hi,
    Thanx for the prompt reply, i have one doubt:

    where i should move to the directory/folder while giving the command . i have installed my oracle db in C:\app\310628\....and have certain folders in it like C:\app\310628\admin...
  • 3. Re: Need help in connecting
    EdStevens Guru
    Currently Being Moderated
    Vivekk.Arora wrote:
    Hello,

    I have created database using Oracle "Database configuration assistant tool" and i have provided values like

    for password:Abc@123456
    The "@" in your password will wreak havoc in trying to connect. TNS sees "@" as a metacharacter to indicate the beginning of the net service name in the connection string. If I construct a connection string like this:
    sqlplus scott/tiger@orcl
    TNS will see a user id of 'scott', a password of 'tiger' and a net service name of 'orcl'

    But with
    sqlplus scott/ABC@123456@orcl
    TNS will see a user id of 'scott', a password of 'ABC' and a net service name of '123456@orcl'



    SID:testdb
    DataBAse name:testdb

    and rest setting accepted as default provided by the tool.

    Now when i try to connect to the database using "sql developer" ,credentials that i am using while creating a new connection is :

    connection name:testdb
    username :testdb
    pasword:Abc@123456
    HostName:localhost
    port:1521(default)
    SID:testdb

    Error thrown on test :ORA-01017:invalid usename/password :logon denied

    Can any one help in identifying my incorrect steps:

    Regards
    Vivekk
  • 4. Re: Need help in connecting
    Niket Kumar Pro
    Currently Being Moderated
    any directory...which is come at start of cmd....
  • 5. Re: Need help in connecting
    EdStevens Guru
    Currently Being Moderated
    Vivekk.Arora wrote:
    Hi,
    Thanx for the prompt reply, i have one doubt:

    where i should move to the directory/folder
    who said anything about moving a directory?
    while giving the command .
    what command?
    i have installed my oracle db in C:\app\310628\....and have certain folders in it like C:\app\310628\admin...
    Looks like you are describing your ORACLE_HOME directory, though "C:\app\310628\" is a rather odd naming convention. Is '310628' the name of the user account used to install Oracle? I've noticed that with 11g the installation suggests as a default location (c:\app\<account name of installing user>) which I always thought as rather odd. I always override that with C:\app\oracle, substituting 'oracle' for <account name of installing user>
  • 6. Re: Need help in connecting
    Niket Kumar Pro
    Currently Being Moderated
    @Ed

    vivek is asking for cmd prompt from where it will fire / as sysdba

    lik

    C:\Users\niketk>
  • 7. Re: Need help in connecting
    982690 Newbie
    Currently Being Moderated
    Hi ,

    I have fired two commands on cmd
    cmd>set ORACLE_SID=testdb
    AND
    cmd>sqlplus / as sysdba

    after that in cmd window i get SQl*PLUS info and some list of commands

    now what shud i do after this as for alter command it is throwing me an error like "alter is not recognised as internal or external command"......

    please suggest
  • 8. Re: Need help in connecting
    982690 Newbie
    Currently Being Moderated
    Database Configuration Summary

    Global Database Name:     testdb
    Database Configuration Type:     Single Instance
    SID:     testdb
    Management Option Type:     Database Control
    Storage Type:     File System
    Memory Configuration Type:     Automatic Memory Management
    Database Configuration Details

    Database Components

    Component     Selected
    Oracle JVM     true
    Oracle Text     true
    Oracle XML DB     true
    Oracle Multimedia     true
    Oracle OLAP     true
    Oracle Spatial     true
    Oracle Label Security     false
    Sample Schemas     false
    Enterprise Manager Repository     true
    Oracle Application Express     true
    Oracle Warehouse Builder     true
    Oracle Database Vault     false
    Oracle Database Extensions for .NET     false
    Initialization Parameters

    Name     Value
    audit_file_dest     {ORACLE_BASE}\admin\{DB_UNIQUE_NAME}\adump
    audit_trail     db
    compatible     11.2.0.0.0
    control_files     ("{ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\control01.ctl", "{ORACLE_BASE}\flash_recovery_area\{DB_UNIQUE_NAME}\control02.ctl")
    db_block_size     8KB
    db_domain     
    db_name     testdb
    db_recovery_file_dest     {ORACLE_BASE}\flash_recovery_area
    db_recovery_file_dest_size     3852MB
    diagnostic_dest     {ORACLE_BASE}
    dispatchers     (PROTOCOL=TCP) (SERVICE={SID}XDB)
    local_listener     LISTENER_TESTDB
    memory_target     1228MB
    open_cursors     300
    processes     150
    remote_login_passwordfile     EXCLUSIVE
    undo_tablespace     UNDOTBS1
    Character Sets

    Name     Value
    Database Character Set     WE8MSWIN1252
    National Character Set     AL16UTF16
    Data Files

    Name     Tablespace     Size(M)
    {ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\SYSTEM01.DBF     SYSTEM     670
    {ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\SYSAUX01.DBF     SYSAUX     430
    {ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\UNDOTBS01.DBF     UNDOTBS1     25
    {ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\USERS01.DBF     USERS     5
    {ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\TEMP01.DBF     TEMP     20
    Control Files

    Name
    {ORACLE_BASE}\oradata\{DB_UNIQUE_NAME}\control01.ctl
    {ORACLE_BASE}\flash_recovery_area\{DB_UNIQUE_NAME}\control02.ctl
    Redo Log Groups

    Group     Size(K)
    1     51200
    2     51200
    3     51200
  • 9. Re: Need help in connecting
    Niket Kumar Pro
    Currently Being Moderated
    paste everything you have done in cmd
  • 10. Re: Need help in connecting
    982690 Newbie
    Currently Being Moderated
    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\310628>set ORACLE_SID=testdb

    C:\Users\310628>sqlplus/as sysdba

    SQL*Plus: Release 11.2.0.1.0 Production

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

    Use SQL*Plus to execute SQL, PL/SQL and SQL*Plus statements.

    Usage 1: sqlplus -H | -V

    -H Displays the SQL*Plus version and the
    usage help.
    -V Displays the SQL*Plus version.

    Usage 2: sqlplus [ [<option>] [{logon | /nolog}] [<start>] ]

    <option> is: [-C <version>] [-L] [-M "<options>"] [-R <level>] [-S]

    -C <version> Sets the compatibility of affected commands to the
    version specified by <version>. The version has
    the form "x.y[.z]". For example, -C 10.2.0
    -L Attempts to log on just once, instead of
    reprompting on error.
    -M "<options>" Sets automatic HTML markup of output. The options
    have the form:
    HTML ON [HEAD text] [BODY text] [TABLE text]
    [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] ON]
    -R <level> Sets restricted mode to disable SQL*Plus commands
    that interact with the file system. The level can
    be 1, 2 or 3. The most restrictive is -R 3 which
    disables all user commands interacting with the
    file system.
    -S Sets silent mode which suppresses the display of
    the SQL*Plus banner, prompts, and echoing of
    commands.

    <logon> is: {<username>[<password>][@<connect_identifier>] | / }
    [AS {SYSDBA | SYSOPER | SYSASM}] [EDITION=value]

    Specifies the database account username, password and connect
    identifier for the database connection. Without a connect
    identifier, SQL*Plus connects to the default database.

    The AS SYSDBA, AS SYSOPER and AS SYSASM options are database
    administration privileges.

    <connect_identifier> can be in the form of Net Service Name
    or Easy Connect.

    @[<net_service_name> | [/]Host[:Port]/<service_name>]

    <net_service_name> is a simple name for a service that resolves
    to a connect descriptor.

    Example: Connect to database using Net Service Name and the
    database net service name is ORCL.

    sqlplus myusername/mypassword@ORCL

    Host specifies the host name or IP address of the database
    server computer.

    Port specifies the listening port on the database server.

    <service_name> specifies the service name of the database you
    want to access.

    Example: Connect to database using Easy Connect and the
    Service name is ORCL.

    sqlplus myusername/mypassword@Host/ORCL

    The /NOLOG option starts SQL*Plus without connecting to a
    database.

    The EDITION specifies the value for Session Edition.


    <start> is: @<URL>|<filename>[.<ext>] [<parameter> ...]

    Runs the specified SQL*Plus script from a web server (URL) or the
    local file system (filename.ext) with specified parameters that
    will be assigned to substitution variables in the script.

    When SQL*Plus starts, and after CONNECT commands, the site profile
    (e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile
    (e.g. login.sql in the working directory) are run. The files may
    contain SQL*Plus commands.

    Refer to the SQL*Plus User's Guide and Reference for more information.

    C:\Users\310628>alter user hr
    'alter' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\310628>alter user hr Vivek@310628 account unlock
    'alter' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\310628>
  • 11. Re: Need help in connecting
    Niket Kumar Pro
    Currently Being Moderated
    there is a gap b/w sqlplus and / as sysdba

    sqlplus / as sysdba

    C:\Users\niketk>sqlplus / as sysdba
    
    SQL*Plus: Release 11.2.0.2.0 Production on Thu Jan 17 19:44:34 2013
    
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    
    
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    
    SQL> alter user hr identified by password account unlock;
    
    User altered.
    
    SQL> exit
    Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
  • 12. Re: Need help in connecting
    982690 Newbie
    Currently Being Moderated
    yes it got connected but now when i give command
    alter user hr Vivek@310628 account unlock;

    i get an error


    C:\Users\310628>set ORACLE_SID=testdb

    C:\Users\310628>sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 17 19:59:06 2013

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


    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL> alter user hr Vivek@310628 unlock;
    alter user hr Vivek@310628 unlock
    *
    ERROR at line 1:
    ORA-00922: missing or invalid option


    SQL> alter user hr Vivek@310628 account unlock;
    alter user hr Vivek@310628 account unlock
    *
    ERROR at line 1:
    ORA-00922: missing or invalid option
  • 13. Re: Need help in connecting
    Niket Kumar Pro
    Currently Being Moderated
    check again what i have suggested earlier....


    alter user hr Vivek@310628 unlock;

    check this again
  • 14. Re: Need help in connecting
    EdStevens Guru
    Currently Being Moderated
    Vivekk.Arora wrote:
    yes it got connected but now when i give command
    alter user hr Vivek@310628 account unlock;

    i get an error


    C:\Users\310628>set ORACLE_SID=testdb

    C:\Users\310628>sqlplus / as sysdba

    SQL*Plus: Release 11.2.0.1.0 Production on Thu Jan 17 19:59:06 2013

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


    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options

    SQL> alter user hr Vivek@310628 unlock;
    alter user hr Vivek@310628 unlock
    *
    ERROR at line 1:
    ORA-00922: missing or invalid option


    SQL> alter user hr Vivek@310628 account unlock;
    alter user hr Vivek@310628 account unlock
    *
    ERROR at line 1:
    ORA-00922: missing or invalid option
    Please take a look at the syntax for ALTER USER, located [url http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_4003.htm#sthref3863] here 
    your command is attempting to ALTER USER on a user named 'hr', but what is intended by ' Vivek@310628'? How does that fit into the syntax of ALTER USER?
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points