The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

So I decided to take Oracle for a spin

Last post 03-02-2013 9:26 AM by Cassidy. 17 replies.
Page 1 of 1 (18 items)
Sort Posts: Previous Next
  • 01-31-2013 12:18 PM

    • db2
    • Top 200 Contributor
    • Joined on 06-15-2006
    • Posts 348

    So I decided to take Oracle for a spin

    I mostly work with SQL Server, and thought I'd like to try out Oracle a bit, in case I ever need to work with a client that uses it. I downloaded and installed Enterprise Edition on my desktop. Created a listener. So far so good.

    Now it's time to create The Database. I run DBCA, use the General Purpose template with a few tweaks, get to the end, and tell it to start creating.

    ORA-12154: TNS:could not resolve the connect identifier specified

    Sweet. Abort. I searched around a little bit, and figured I needed a tsnames.ora. I set that up, and tried connecting with sqlplus (which I expected to fail, since no database has been created, but it ought to at least find the listener and talk to it). And sure enough, that part seemed to work. Ran DBCA again. Same error.

    So a little more Google work leads me to this thread:

    http://dbaforums.org/oracle/index.php?showtopic=1333

    Here's the interesting line:

    but I think my original attempts were failing b/c I was specifying passwords (for the SYS, SYSTEM. SYSMAN, etc.) that contained special characters that the dbca somehow didn't handle and/or pass long properly. In my case, the special character seemed to be "@".

    Wait a minute. I'm using p@ssw0rd for the passwords. Could it possibly be? I ran DBCA again, using Passw0rd instead (it's a test machine, who gives a shit). This time:

    Database creation complete. For details check the logfiles at:
    C:\Oracle\cfgtoollogs\dbca\ORCL.

    What the pissing fuck? You can't use @ in a password? Please tell me this is just a DBCA bug.

  • 01-31-2013 2:33 PM In reply to

    Re: So I decided to take Oracle for a spin

    It's not that you can't use "@" signs, it's that you can't use "@"s with tools that connect via "ezconnect", which I'm guessing was happening here. Ezconnect manages its DB connection string like so: username/password@[//]host[:port][/service_name] See the problem with "@" signs in the password? There are other connection modes that don't have this issue. Yes, it's completely insane.
  • 01-31-2013 2:56 PM In reply to

    • db2
    • Top 200 Contributor
    • Joined on 06-15-2006
    • Posts 348

    Re: So I decided to take Oracle for a spin

    Duly noted, though I can't imagine there's no way to quote/escape characters in the connection string.
  • 01-31-2013 5:08 PM In reply to

    Re: So I decided to take Oracle for a spin

    db2:
    Duly noted, though I can't imagine there's no way to quote/escape characters in the connection string.
     

    sqlplus 'username'/'password'@host-string

    If your username and/or pass don't contain "illegal" characters, you can leave out the quotes. Most people omit them because their username and pass don't contain slash or "@".

    Alternatively, try (assuming Windows):

    SET LOCAL=myDBname

    sqlplus username/'P@ssword'

    But yeah, it can be annoying when you realise some characters are misinterpreted.

  • 01-31-2013 5:11 PM In reply to

    Re: So I decided to take Oracle for a spin

    db2:
    I searched around a little bit, and figured I needed a tsnames.ora.
     

    Actually, you don't. It's only needed for networking (and even then it can be bypassed - think of it as a HOSTS file).

    An alternative is:

    SET ORACLE_SID=myinstancename

    sqlplus / as sysdba

    .. that should let you "rootwalk" directly in, no tnsnames required.

  • 02-26-2013 11:04 AM In reply to

    • Nagesh
    • Top 50 Contributor
    • Joined on 01-31-2011
    • Hyderabad, India
    • Posts 1,064

    Re: So I decided to take Oracle for a spin

    That is just common sense. Nobody uses "@" in passwords with Oracle.
  • 02-26-2013 11:11 AM In reply to

    Re: So I decided to take Oracle for a spin

    Why not? I use it in other passwords.

  • 02-26-2013 4:18 PM In reply to

    • Nagesh
    • Top 50 Contributor
    • Joined on 01-31-2011
    • Hyderabad, India
    • Posts 1,064

    Re: So I decided to take Oracle for a spin

    Cassidy:

    Why not? I use it in other passwords.

    Oracle 7.3 manual tells you not to do it.
  • 02-26-2013 4:44 PM In reply to

    Re: So I decided to take Oracle for a spin

    Nagesh:
    Oracle 7.3 manual tells you not to do it.
     

    Do later manuals mention it? Or are you still using 7.3?

  • 02-27-2013 12:24 PM In reply to

    • Nagesh
    • Top 50 Contributor
    • Joined on 01-31-2011
    • Hyderabad, India
    • Posts 1,064

    Re: So I decided to take Oracle for a spin

    Cassidy:

    Nagesh:
    Oracle 7.3 manual tells you not to do it.
     

    Do later manuals mention it? Or are you still using 7.3?

    They stopped printing manuals and now they are available online only. We are using 8.1.7 and 9.2.0.7.0. We are also having use of Sql Server 2008 R2.
  • 02-27-2013 12:36 PM In reply to

    Re: So I decided to take Oracle for a spin

    Nagesh:
    We are using 8.1.7 and 9.2.0.7.0. We are also having use of Sql Server 2008 R2.
    Wow! 2008? That's pretty bleeding edge, don't you think?
    I denounce myself for this post
  • 02-27-2013 2:01 PM In reply to

    Re: So I decided to take Oracle for a spin

    Nagesh:
    Cassidy:

    Nagesh:
    Oracle 7.3 manual tells you not to do it.
     

    Do later manuals mention it? Or are you still using 7.3?

    They stopped printing manuals and now they are available online only.
     

    I presume you meant "documentation" when you said "manual", so my question could have been interpreted as "does documentation for later versions of Oracle still insist on this rule?"

    Simply put, the "@" in a password is like a space in a filename - you'll need to escape it or hide it in some way so it doesn't get misinterpreted, but it's not a banned character. Just a nuisance one.

     

  • 02-28-2013 9:37 AM In reply to

    • Nagesh
    • Top 50 Contributor
    • Joined on 01-31-2011
    • Hyderabad, India
    • Posts 1,064

    Re: So I decided to take Oracle for a spin

    Cassidy:

    Nagesh:
    Cassidy:

    Nagesh:
    Oracle 7.3 manual tells you not to do it.
     

    Do later manuals mention it? Or are you still using 7.3?

    They stopped printing manuals and now they are available online only.
     

    I presume you meant "documentation" when you said "manual", so my question could have been interpreted as "does documentation for later versions of Oracle still insist on this rule?"

    Simply put, the "@" in a password is like a space in a filename - you'll need to escape it or hide it in some way so it doesn't get misinterpreted, but it's not a banned character. Just a nuisance one.

     

     

     

    I did some checking and testing. You can have @ character in the password. Just do not use sql plus to make connection. If your client is java or vb or vc++, the password will work and you'll make valid connection to the database. It appear that the warning was put in there for dba who frequently used to use sqlplus tool to make connections.

     

  • 02-28-2013 11:01 AM In reply to

    Re: So I decided to take Oracle for a spin

    Nagesh:
    You can have @ character in the password. Just do not use sql plus to make connection.
     

    Incorrect.

    Nagesh:
    It appear that the warning was put in there for dba who frequently used to use sqlplus tool to make connections.

    No, the warnings were there for people who didn't understand that it was a reserved character and needed to be escaped. That's Oracle being patronising by making out it can't be used when it can in certain circumstances.

     

  • 03-01-2013 9:56 AM In reply to

    • Nagesh
    • Top 50 Contributor
    • Joined on 01-31-2011
    • Hyderabad, India
    • Posts 1,064

    Re: So I decided to take Oracle for a spin

    Cassidy:

    Nagesh:
    You can have @ character in the password. Just do not use sql plus to make connection.
     

    Incorrect.

    Nagesh:
    It appear that the warning was put in there for dba who frequently used to use sqlplus tool to make connections.

    No, the warnings were there for people who didn't understand that it was a reserved character and needed to be escaped. That's Oracle being patronising by making out it can't be used when it can in certain circumstances.

     

     

     

    I am basing this on my own testing. I have oracle database to practice this on. Do you? Make user. Create password with "@" character. Then use java to make connection.

    It will make successful connection. What part of that is incorrect? I am going to make guess and state taht you're refer to my second comment. You can make sqlplus to make connection.

     

  • 03-01-2013 10:59 AM In reply to

    Re: So I decided to take Oracle for a spin

     

    Nagesh:
    You can have @ character in the password. Just do not use sql plus to make connection.

     

    Nagesh:
    You can make sqlplus to make connection.

    Make your mind up...

  • 03-01-2013 3:51 PM In reply to

    • Nagesh
    • Top 50 Contributor
    • Joined on 01-31-2011
    • Hyderabad, India
    • Posts 1,064

    Re: So I decided to take Oracle for a spin

    Cassidy:

     

    Nagesh:
    You can have @ character in the password. Just do not use sql plus to make connection.

     

    Nagesh:
    You can make sqlplus to make connection.

    Make your mind up...

    I am saying if you use "@" in your password, you SHOULD not sure sqlplus to make a connection, but you can if you want to go for stuff like escape sequences.
  • 03-02-2013 9:26 AM In reply to

    Re: So I decided to take Oracle for a spin

    Better and more accurate, yup.

Page 1 of 1 (18 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems