Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQLPLUS on OpenVMS

Re: SQLPLUS on OpenVMS

From: hpuxrac <johnbhurley_at_sbcglobal.net>
Date: Mon, 09 Jul 2007 11:37:09 -0700
Message-ID: <1184006229.028709.85760@n2g2000hse.googlegroups.com>


On Jul 9, 2:21 pm, Cuyler <cuy..._at_gmail.com> wrote:
> I'm new with Oracle on VMS and I'm having a few difficulties with
> getting a SQL script to run properly on the system. I can connect to
> the database and manually run the script (copy and paste from it) just
> fine but when I put those into a .SQL script and call it it I get an
> error. I've recreated the script manually to ensure I don't have any
> non-printable characters in the file causing me grief.
>
> Here's the output (server name, user names and passwords obviously
> changed). Extra blank lines removed. I'd appreciate any light you
> folks could she don this - I'm sure it's something really simple I'm
> over looking.
>
> VMSHOST::VMS_USER $ sqlplus my_username/my_password
> SQL*Plus: Release 9.2.0.8.0 - Production on Mon Jul 9 14:07:29 2007
> Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
> Connected to:
> Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
> With the Partitioning and Real Application Clusters options
> JServer Release 9.2.0.8.0 - Production
> SQL> exit
> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 -
> Production
> With the Partitioning and Real Application Clusters options
> JServer Release 9.2.0.8.0 - Production
>
> VMSHOST::VMS_USER $ sqlplus /nolog
> SQL*Plus: Release 9.2.0.8.0 - Production on Mon Jul 9 14:07:43 2007
> Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
> SQL> connect my_username/my_password
> Connected.
> SQL> exit
> Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 -
> Production
> With the Partitioning and Real Application Clusters options
> JServer Release 9.2.0.8.0 - Production
>
> VMSHOST::VMS_USER $ type test.sql
> CONNECT my_username/my_password
> EXIT
>
> VMSHOST::VMS_USER $ sqlplus @test.sql
> SQL*Plus: Release 9.2.0.8.0 - Production on Mon Jul 9 14:08:06 2007
> Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
> SP2-0306: Invalid option.
> Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
> where <logon> ::= <username>[/<password>][@<connect_string>] | /
> Enter password:
> ERROR:
> ORA-01005: null password given; logon denied
> Enter user-name:
> ERROR:
> ORA-01017: invalid username/password; logon denied
> SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting
> SQL*Plus

It doesn't quite work like that.

When you invoke sqlplus with the name of a file after it that doesn't make sense to sqlplus it want some kind of connect information ( unless you give it /nolog ) first before it would even think about something else.

On a unix system you would do something like this.

#!/bin/ksh
#
Dot in some file to establish oracle environment first ORACLE_HOME etc

sqlplus /nolog <<EOF
@myconnect.sql
EOF Received on Mon Jul 09 2007 - 13:37:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US