SQLPlus Help

Hello:
When I tried the following:
SQLPlus sys/<password>@<dbname>, I get the following error:
ERROR:
ORA-28009: connection to sys should be as sysdba or sysoper
Can somebody tell me what the syntax is to log in with the account SYS?
Thanks.

Thank you very much for your quick reply.
Venkat

Similar Messages

  • SQLPLUS Help with a Linux Script

    I am receiving an SQLPLUS error of 155.
    Apparently my SQL code is being truncated (I believe).
    I originally had all of this code on separate lines to make it readable. Unfortunately for that try I also received a return code of 155.
    I copied this SQL from my SQL DEVELOPER where this SQL works properly.
    Can anybody make any suggestions?
    BTW, I am newbie to both Linux Shell Scripts, SQL, and SQLPLUS.
    Here is the log from the run of the script:
    SQL*Plus: Release 11.2.0.2.0 Production on Fri May 4 17:49:38 2012
    Copyright (c) 1982, 2010, Oracle. All rights reserved.
    SQL> SQL> Connected.
    SQL> SQL> SQL>           SELECT to_char(c.update_date, 'FMMonth, YYYY') 'Shipment Update Date'||'|'||b.SHIPMENT_GID 'Shipment Number'||'|'||count (distinct (b.SHIPMENT_GID)) 'No of Shipments'||'|'||count(distinct(a.i_transaction_no)) 'Auctions per Shipment'||'|'||count(*) 'No. of Carriers Notified'||'|'||sum (case when a.responding_gl_user_gid is null then 0 else 1 end) 'No of Bidders'||'|'||min (numtodsinterval((b.expected_response - b.insert_date),'day')) 'Duration of Auction'||'|'||min (numtodsinterval((a.update_date - a.transaction_time),'day')) 'Elapse time for first bid'||'|'||max (numtodsinterval((a.update_date - a.transaction_time),'day')) 'Elapse time for last bid'||'|'||numtodsinterval((max(a.update_date) - min(a.update_date)),'day') 'Elapse time of bidding'||'|'||numtodsinterval((max(b.shipment_time) - max(c.insert_date)),'day') 'Lead Time of Auction to P/U'||'|'||(max(a.bid_amount) - min(a.bid_amount)) 'High Bid- Low Bid Diff' from tender_collab_servprov a, tender_collaboration b, shipment c where a.i_transaction_no = b.i_transaction_no and b.shipment_gid not in (select sqa.shipment_gid from tender_collaboration sqa, tender_collab_servprov sqb where sqa.i_transaction_no = sqb.i_transaction_no and sqb.acceptance_code = 'A') and a.i_transaction_no in (select i_transaction_no from tender_collaboration where tender_type = 'Spot Bid') and b.shipment_gid = c.shipment_gid AND c.update_date >= trunc(last_day(to_date((to_char(add_months(SYSDATE,-2), 'MM-DD-YYYY')),'MM-DD-YYYY')) + 1) group by c.update_date, b.SHIPMENT_GID order by c.update_date, b.shipment_GID
    ERROR at line 1:
    ORA-00923: FROM keyword not found where expected
    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Here is the Linux Shell script:
    /bin/sh
    LOGFILE="$(date +"%Y-%m-%d %H") Oracle REPORT LOG.TXT"
    FILENAME="$(date +"%Y-%m-%d") PROD Unfinished Spot Bids.CSV"
    echo "File Name for the spool is:" "$FILENAME"
    #spool "$FILENAME"
    sqlplus /nolog <<EOF >$LOGFILE
    whenever sqlerror exit sql.sqlcode
    connect glog_read/parker@OTMDEV
    spool PROD_Unfinished.CSV
    set linesize 32000 trimspool on pagesize 3000
              SELECT to_char(c.update_date, 'FMMonth, YYYY') 'Shipment Update Date'||'|'||b.SHIPMENT_GID 'Shipment Number'||'|'||count (distinct (b.SHIPMENT_GID)) 'No of Shipments'||'|'||count(distinct(a.i_transaction_no)) 'Auctions per Shipment'||'|'||count(*) 'No. of Carriers Notified'||'|'||sum (case when a.responding_gl_user_gid is null then 0 else 1 end) 'No of Bidders'||'|'||min (numtodsinterval((b.expected_response - b.insert_date),'day')) 'Duration of Auction'||'|'||min (numtodsinterval((a.update_date - a.transaction_time),'day')) 'Elapse time for first bid'||'|'||max (numtodsinterval((a.update_date - a.transaction_time),'day')) 'Elapse time for last bid'||'|'||numtodsinterval((max(a.update_date) - min(a.update_date)),'day') 'Elapse time of bidding'||'|'||numtodsinterval((max(b.shipment_time) - max(c.insert_date)),'day') 'Lead Time of Auction to P/U'||'|'||(max(a.bid_amount) - min(a.bid_amount)) 'High Bid- Low Bid Diff' from tender_collab_servprov a, tender_collaboration b, shipment c where a.i_transaction_no = b.i_transaction_no and b.shipment_gid not in (select sqa.shipment_gid from tender_collaboration sqa, tender_collab_servprov sqb where sqa.i_transaction_no = sqb.i_transaction_no and sqb.acceptance_code = 'A') and a.i_transaction_no in (select i_transaction_no from tender_collaboration where tender_type = 'Spot Bid') and b.shipment_gid = c.shipment_gid AND c.update_date >= trunc(last_day(to_date((to_char(add_months(SYSDATE,-2), 'MM-DD-YYYY')),'MM-DD-YYYY')) + 1) group by c.update_date, b.SHIPMENT_GID order by c.update_date, b.shipment_GID;
    spool off
    EOF
    RV=$?
    echo "The return code fronm the sqlplus was:" "$RV"

    Looks the SELECT clause have missing pipes. See corrected one below :
    The shell script format has alread been given above.
    SELECT TO_CHAR(c.update_date, 'FMMonth, YYYY')                                  || 'Shipment Update Date'        || '|' ||
           b.shipment_gid                                                        || 'Shipment Number'             || '|' ||
           COUNT(DISTINCT(b.shipment_gid))                                       || 'No of Shipments'             || '|' ||
           COUNT(DISTINCT(a.i_transaction_no))                                   || 'Auctions per Shipment'       || '|' ||
           COUNT(*)                                                              || 'No. of Carriers Notified'    || '|' ||
           SUM(CASE WHEN a.responding_gl_user_gid IS NULL THEN  0  ELSE  1 END)  || 'No of Bidders'               || '|' ||
           MIN(numtodsinterval((b.expected_response - b.insert_date), 'day'))    || 'Duration of Auction'         || '|' ||
           MIN(numtodsinterval((a.update_date - a.transaction_time), 'day'))     || 'Elapse time for first bid'   || '|' ||
           MAX(numtodsinterval((a.update_date - a.transaction_time), 'day'))     || 'Elapse time for last bid'    || '|' ||
           numtodsinterval((MAX(a.update_date) - MIN(a.update_date)), 'day')     || 'Elapse time of bidding'      || '|' ||
           numtodsinterval((MAX(b.shipment_time) - MAX(c.insert_date)), 'day')   || 'Lead Time of Auction to P/U' || '|' ||
           (MAX(a.bid_amount) - MIN(a.bid_amount))                               || 'High Bid- Low Bid Diff'
    FROM   tender_collab_servprov a,
           tender_collaboration b,
           shipment c
    WHERE  a.i_transaction_no = b.i_transaction_no
    AND    b.shipment_gid NOT IN  ( SELECT sqa.shipment_gid
                                    FROM   tender_collaboration sqa,
                                           tender_collab_servprov sqb
                                    WHERE  sqa.i_transaction_no = sqb.i_transaction_no
                                    AND    sqb.acceptance_code = 'A')
    AND    a.i_transaction_no IN (SELECT i_transaction_no
                                  FROM   tender_collaboration
                                  WHERE  tender_type = 'Spot Bid')
    AND    b.shipment_gid = c.shipment_gid
    AND    c.update_date >= trunc(last_day(to_date((to_char(add_months(SYSDATE, -2),'MM-DD-YYYY')),'MM-DD-YYYY')) + 1)
    GROUP  BY c.update_date, b.shipment_gid
    ORDER  BY c.update_date, b.shipment_gid
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 很全的help.sql 安装Oracle的sqlplus帮助系统

    在linux系统下的时候,我们可以通过man命令,获得系统里对某个命令的usage的解释。
    在sqlplus里我们也可以通过help和?命令。
    sqlplus的帮助主题对应的是数据库里的一张表(system.help)。
    在$ORACLE_HOME/sqlplus/admin/help/目录下的helpus.sql包含了这个表的帮助主题
    不过oracle自带的help和?的解释太少了
    在网上找了很久终于找到一个很全的help.sql叻
    下载文中附件,用system登录,因为这个是建立在system的schema里的help表里的。
    直接执行脚本就可以了。比如我把这个sql保存到$ORACLE_HOME\sqlplus\admin\help里,
    大家在这里可以看到有
    helpbld.sql
    helpdrop.sql
    helpus.sql
    hlpbld.sql
    这四个文件,这就是oracle自带的help脚本。可以执行
    helpbld.sql来安装oracle默认的help, 这里会提示你输入两个参数,看了这个源文件。
    两个参数一个是当前路径,一个是helpus.sql, 还是用system来执行,执行完就安装了help,
    就可以使用我上面的那些方式。这个是默认会安装的。
    要安装我这个最新的help文件,只需要执行就可以了
    SQL>conn system/systempwd;
    SQL>@?/sqlplus/admin/help/helpbld.sql
    输入 1 的值: F:\developer\oracle\product\10.2.0\db_1\sqlplus\admin\help
    输入 2 的值: F:\developer\oracle\product\10.2.0\db_1\sqlplus\admin\help\help.sql
    这里就会执行了,执行是有一些和默认的有冲突,可以忽略这些错误。
    成功以后,我们执行一下
    SQL> select count(*) from system.help ;
    COUNT(*)
    5085
    呵呵呵一下多了好多条了哟
    SQL> help create database;
    引用:
    CREATE DATABASE
    Use this command to create a database, making it available for
    general use, with the following options:
    * to establish a maximum number of instances, data files, redo
    log files groups, or redo log file members
    * to specify names and sizes of data files and redo log files
    * to choose a mode of use for the redo log
    * to specify the national and database character sets
    Warning: This command prepares a database for initial use and erases
    any data currently in the specified files. Only use this command
    when you understand its ramifications.
    .......这里还要好多有关create table的帮助信息,我就不写了。
    有了这个帮助系统,要查一个命令的详解,正是太方便叻。
    help.sql文件【 下载 】

  • Sqlplus to connect to remote oracle database server

    Hi,
    I have oracle 10g database server on solaris 10 and I usually connect using my solaris account and run sqlplus on the server itself. this works !
    I have downloaded and installed oracle instant client for solaris 64 and I can run sqlplus command but I am confused on what should be the syntax on the command to connect to remote solaris 10 databse server where I have both system and oracle account.
    I have tried sqlplus help but still I could not get correct sysntax which could be used to authenticate myself to oracle server.
    I tried
    sqlplus user@hostname:1512/SID
    then it asked for password but when I typed password and pressed enter, it gave some error
    but it again asked for username so I type user@SID and then password prompt - typed password and this works!
    so I don't understand what should be the correct syntax so that in the first attempt only I am able to connect.
    if possible please give the exact command with realworld examples,(I have tried with sqlplus -help already)
    Thanks in advance.

    wonder what if I did not have tnsnames.ora on the client machine, how will be the syntax?You generally need (or at least strongly want) a tnsnames.ora file on the client machine.
    - You could configure Oracle Internet Directory and let that product provide TNS alias resolution for the organization (similar to setting up DNS for a local network).
    - Many tools (I haven't personally tried SQL*Plus and it may be version dependent) allow you to specify the entire TNS alias from the tnsnames.ora file (i.e. everything after the abcd.domain.com = entry) but that is hugely cumbersome to type
    - Depending on the Oracle client version, the sqlnet.ora file, the complexity of your configuration (i.e. if you are trying to use more sophisticated features like failover), you may be able to use the EZConnect syntax
    sqlplus username/password@host:port:SID/service_nameWhere host is the server that the database is running on, port is the port the listener is listening on (i.e. 1521 by default) and SID/service_name is the SID or service name you're trying to connect to.
    Justin

  • Sqlplus -prelim command is not working.

    Hi ,
    sqlplus -prelim command is not working for me. It is giving me the below error.
    oracle@xyz: /app/oracle/product/10.2.0/bin $*sqlplus -prelim*
    SQL*Plus: Release 10.2.0.3.0 - Production on Fri Aug 7 10:31:54 2009
    Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
    Enter user-name: oracle
    Enter password:
    ERROR:
    ORA-24300: bad value for mode.
    I am solaris 5.10 and database is 10g.
    Thanks
    Naveen.

    what -prelim command?
    sqlplus -help
    SQL*Plus: Release 10.2.0.4.0 - Production
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    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>] [<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|OFF] [HEAD text] [BODY text] [TABLE text]
                 [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]
        -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 | AS SYSOPER] | /NOLOG
        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 and AS SYSOPER options are database administration
        privileges.
        The /NOLOG option starts SQL*Plus without connecting to a
        database.
      <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.

  • SQL*PLUS 에서 ONLINE HELP 기능

    제품 : SQL*PLUS
    작성날짜 : 1999-10-08
    SQL*PLUS Help
    =============
    SQL*PLUS 에서 Online Help 기능을 제공하여 굳이 SQL Reference 를 참조하지
    않아도 Online 상에서 확인이 가능하다.
    그런데 간혹 help 에 문제가 생기는 경우 다음과 같이 새로 생성하면 된다.
    1. help 디렉토리로 이동한다.
    % cd $ORACLE_HOME/sqlplus/admin/help
    2. SYSTEM user 로 SQL*Plus 에 Login 한다.
    % sqlplus system/<password>
    3. 해당 디렉토리의 "helptbl.sql" script 를 수행한다.
    SQL> @helptbl
    해당 스크립트는 Help 라는 테이블을 생성하고 Public 으로 지정한다.
    4. SQL*Loader 로 필요한 Record 를 Help 테이블에 로딩한다..
    % sqlldr system/manager control=plushelp.ctl
    % sqlldr system/manager control=sqlhelp.ctl
    % sqlldr system/manager control=plshelp.ctl
    5. SYSTEM user 로 SQL*Plus 에 Login 한다.
    "helpindx.sql" script 를 수행한다.
    SQL> @helpindx
    해당 스크립트는 필요한 각종 view 와 index 를 생성한다.
    // 위의 사항은 Unix 계열의 SQL*PLUS 에서 적용이 되는 내용이다
    Windows 95/98/NT 에서는 현재 On-line Help 가 지원되지 않는다.
    다만 Oracle install CD 에서 Oracle Online Documentation 을 인스톨 한
    후 Adobe Acrobat runtime 으로 보아야 한다.
    DB SERVER 8.1.6 이상에서는
    SQLPLUS에서 사용되는 help 기능만 제공됩니다.
    8.1.6 이상에서 help를 생성하기 위해서는
    % cd $ORACLE_HOME/sqlplus/admin/help
    % sqlplus system/<password>
    SQLPLUS>helpbld.sql
    SQLPLUS>helpus.sql

    I personally don't like SQL Developer or TOAD, though perhaps I'm in a minority. I agree completely. Toad does a lot of things but many of are ill thought out, the most obvious is the default feature of displaying a result time after fetching the first screen of rows. This alone has led to hundreds of posting along the lines of, I have this query that returns 12 billion rows. In a stored procedure it takes days, but it completes in 12 milliseconds in TOAD?
    The last I looked SQL Developer had that typical Java sluggishness on a Windows box, and I am still not interested in whether that is a Windows or Java problem. I just know that if I have to use Windows I tend to choose applications that are not written in Java if possible.
    It also was unable to connect using OS authenticated accounts which effectively ruled it out as anything other than a toy as our development environment mandates it. I believe there may be a workaround, but there are always hints of waving a rubber chicken at it and frankly why bother at this stage.
    PL/SQL Developer is by far the best.

  • Lsnrctl services does not show service XE - new install of Oracle Express

    It's a time-consuming and problematic installation of Oracle Express 11g, but for the moment just one question: why isn't service XE showing up in lsnrctl services? Here's that output, with Service XE missing:
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    The command completed successfully
    listener.ora is:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    DEFAULT_SERVICE_LISTENER = (XE)
    tnsnames.ora is:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    slqnet.ora is:
    SQLNET.AUTHENTICATION_SERVICES = (NONE)
    NAMES.DIRECTORY_PATH = (TNSNAMES, EZCONNECT)

    Well, I think this is progress, attempting to connect in sqlplus gives the error I had in SQL Developer when I had service XE showing up in lsnrctl services (that was the 2nd installation, now on the 3rd)
    SQL> connect system/xxxxxxx
    ERROR:
    ORA-01034: ORACLE not available
    ORA-27101: shared memory realm does not exist
    Process ID: 0
    Session ID: 0 Serial number: 0
    So, couldn't connect and no luck with alter system register.
    Yes, I should be OK with 127.0.0.1, both client and server are my home PC. Thanks for the idea of testing with no listener.ora at all - I renamed and moved listener.ora, for this interesting result: in sqlplus I either get the same ORA-01034 and ORA-27101, or 2 pages of a sqlplus help file, depending on the logon syntax used. I'm sure that's user error. In SQL Developer New Database Connection Test I get ORA-12514.
    I've been closely following the thread from Marco ORA-01034 , ORA-27101 in windows Domain, and have learned a lot from you, Srini and TSharma. I think I'm leaning towards the possibility of a bad install. Task Manager shows process oracle.exe running (this may not mean much) and Services shows all the Oracle services Started. I don't know enough to interpret what I'm seeing for oracle.exe in Windows Process Explorer, although it looks like something is running. But suppose, hypothetically, that it was a bad installation, how would I test that?
    Looking at the log files, I'm seeing clsc1.log is nearly identical to what Marco reported in that other thread:
    Oracle Database 11g Clusterware Release 11.2.0.2.0 - Production Copyright 1996, 2010 Oracle. All rights reserved.
    2013-04-12 01:25:47.968: [ default][3228]ut_read_reg:2:ocr registry key SOFTWARE\Oracle\olr cannot be opened. error 2
    [    CLSE][3228]clse_get_crs_home: Error retrieving OLR configuration [0] [Error opening olr registry key. The system cannot find the file specified.
    This may be another clue, the listener log file has this after a SQL Developer New Database Connection Test (test of Connection Type TNS + Network Alias XE, XE shows up just fine in the dropdown). My computer name is newamptron, and that host_addr IP is my DSL provider. Note the completely random port 2051. Essentially same message data with or without listener.ora in place.
    <msg time="2013-04-12T23:55:46.593+00:00" org_id="oracle" comp_id="tnslsnr" type="UNKNOWN" level="16" host_id="NEWAMPTRON" host_addr="75.79.62.xxxx">
    <txt>12-APR-2013 23:55:46 * (CONNECT_DATA=(CID=(PROGRAM=SQL Developer)(HOST=__jdbc__)(USER=Paul))(SERVER=DEDICATED)(SERVICE_NAME=XE)) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=2051)) * establish * XE * 12514</txt>
    </msg>
    <msg time="2013-04-12T23:55:46.609+00:00" org_id="oracle" comp_id="tnslsnr" type="UNKNOWN" level="16" host_id="NEWAMPTRON" host_addr="75.79.62.xxxx">
    <txt>TNS-12514: TNS:listener does not currently know of service requested in connect descriptor</txt>
    </msg>
    Thanks!

  • Sqlplus_exec_template.sql

    Hi Guys,
    I am trying to kick off my process flow via a batch file.
    I have read a couple of tutorials now, every of those giving a slightly different example.
    What I have now is:
    sqlplus OWBREPOS_OWNER/password@bise1db D:\Oracle\bise1\owb\owb\rtp\sql\sqlplus_exec_template.sql IMPORT_FLOW_EURO1 CSV_IMPORTS_LOCATION "," ","
    but when executing it just jumps to the sqlplus help and tells me what nice options I have i.e. -h -c...
    Does someone know what I am missing here ?

    sqlplus OWBREPOS_OWNER/password@bise1db @D:\Oracle\bise1\owb\owb\rtp\sql\sqlplus_exec_template.sql OWBREPOS_OWNER CSV_IMPORTS_LOCATION PROCESS IMPORT_FLOW_EUROL "," ","
    ok I made some progress no more errors but the sql plus command seems to be stuck at
    Session Altered
    Role Set
    Edited by: metalray on 08-Jan-2010 04:13

  • Noobie school student needing some help with sqlplus on linux Oracle 10 XE

    I'm just learning so take it easy on me. I spent all night installing Oracle 10 XE on linux and trying to play catchup with my class. The problem I'm having is. When using sqlplus from the command prompt, I have setup a table called CUSTOMER. When I display the table with the select command the table output is messed up. I understand the default line size is 80, I used to SET LINESIZE command to change it to 150 char long. That helped a little. however its still messed up. I'm wondering if it now has to do with the way I set the table up. From the example in my book
    it says to setup a column with the name CUSTOMER_NAME char(35) or set aside 35 spaces for the name could this be why its still messed up just to many spaces set aside? or Is there another
    setting I'm missing? or could use.

    I get the same thing still here are the commands I'm using.
    SQL>   CREATE TABLE CUSTOMER
            2  (CUSTOMER_NUM CHAR(3) PRIMARY KEY,
            3  CUSTOMER_NAME VARCHAR2(35) NOT NULL,
            4  STREET VARCHAR2(15),
            5  CITY VARCHAR2(15),
            6  STATE CHAR(2),
            7  ZIP CHAR(5),
            8  BALANCE DECIMAL(8,2),
            9  CREDIT_LIMIT DECIMAL(8,2),
          10  REP_NUM CHAR(2) );--------adding to the table I just made-------
    SQL> INSERT INTO CUSTOMER
      2  VALUES
      3  ('148','Al''s Appliance and Sport','2837 Greenway','Fillmore','FL','33336',6550.00,7500.00,'20');
    1 row created.------------output----------------
    SQL> set linesize 150
    SQL> select * from customer
      2  ;
    CUSTOMER_ CUSTOMER_NAME
    STREET                                        CITY                                          STATE  ZIP                BALANCE CREDIT_LIMIT REP_NU
    148       Al's Appliance and Sport
    2837 Greenway                                 Fillmore                                      FL     33336                 6550         7500 20I hate to keep asking but I have got to get this done before class on Monday class started without me and I need to catch up. Thanks again BTW I am going through the release notes currently.

  • Need Help: Urgent:(sqlplus: cannot execute)

    Hi,
    This is the content in my .profile on a unix server,
    MAIL=/usr/mail/${LOGNAME:?}
    umask 027 #added by enRole Agent
    PATH=${PATH}:/opt/app/p1crm1c3/informatica/oracle/product/10.2.0
    export PATH
    PATH=$PATH:/opt/app/p1crm1c3/informatica/oracle/product/10.2.0/network/admin/sqlnet.ora;export PATH
    ORACLE_HOME=/opt/app/p1crm1c3/informatica/oracle/product/10.2.0
    export ORACLE_HOME
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
    LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/bin
    The paths are set correctly, however when i try to login to the server through the below line,
    sqlplus username/password@oracleservername
    ksh: sqlplus: cannot execute
    It says, sqlplus cannot execute.. Please help me out with this! :( :(

    please execute: which sqlplus to see if you can reach sqlplus. probably you can, because otherwise the shell can not determine it can not execute.
    execute: id to determine your current user and groups.
    execute: ls -ls $(which sqlplus) to determine security settings of sqlplus.
    my guess would be you are not allowed to execute sqlplus.

  • Help needed to take control back from sqlplus for expired password

    Hi,
    I am executing the following line for Oracle 11g in Windows from my application
    sqlplus -L "aaaa"/"aaaa" @connectonly.sql >>"D:\tempDBlogs\connectonly.log"
    connectonly.sql file contains the following code:
    whenever sqlerror exit 1
    whenever oserror exit 2
    exit
    This piece of code executes fine for both correct & incorrect userid & password and gives proper messages. Now the problem is when password of the user in DB gets expired. The controls waits for user input. But my problem is I am runinng this code from an application which waits for sqlplus.exe to end, as it can't proceed without validation. But sqlplus runs as background process and the command prompt never comes to user. Moreover I dont want to give the user the option to change DB password from my application front end.
    So I need to find a way so that if password is expired sqlplus will return the control and will not wait for user input. Or atleast my application gets to know that the password is expired so that it can kill sqlplus process.
    Can somebody help me in this.

    interesting question. I tried something on unix and this seems to work. I simply piped a line through this which leads to an error with the expire-prompt and doesnt do any harm when there is no such prompt:
    oracle@oracle:~$ echo "" | sqlplus brost/secret @test.sql
    SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 19 10:18:36 2009
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    ERROR:
    ORA-28001: the password has expired
    Changing password for brost
    New password:
    Retype new password:
    ERROR:
    ORA-00988: missing or invalid password(s)
    Password unchangedSomething similar should be possible on windows. Of course, the real solution would be flag for sqlplus that makes it absolutely non-interactive.

  • Noob needs help with SQLPLUS

    I googled all over, here is my problem:
    I cannot run sqlplus from command dos window, I get that ORA-12560: TNS:protocol adapter error, but I can run sqlplus from all programs--> oracleclient10g_1-->application development->SQLPLUS.
    Why?

    Making sqlplus work is one thing, but cloning a complete database is accelerating from 0 to 100 at the speed of a wink. I suggest you to get involved with recovery manager and recovery concepts. Once you understand how a recovery process is being carried out I suggest you this link: --> Clone a Database Using RMAN
    ~ Madrid
    http://hrivera99.blogspot.com/

  • Help needed in auto-increment in Oracle SQLPlus

    hi everybody
    I have a table in which the id column should be autoincrementing. Whenever i insert a row in the table, the id should be autoincremented. How to create the table in Oracle SQL Plus. I insert the row using JDBC connection. So how to insert the value for id in java program.
    Thanks in advance

    How to use Oracle SQLPlus has absolutely nothing to do with Java or JDBC; you should ask this question in a different forum, such as one of the Oracle database forums, here:
    http://forums.oracle.com/forums/category.jspa?categoryID=18

  • Help!Can not start the database by sqlplus!!!ORA-12514:

    OS:window xp
    oracle 10g
    sqlplus /nolog
    SQL*Plus: Release 10.1.0.2.0 - Production on &#26143;&#26399;&#20845; 5&#26376; 20 15:08:26 2006
    Copyright (c) 1982, 2004, Oracle. All rights reserved.
    SQL> connect sys/demo@demo as sysdba
    ERROR:
    ORA-12514: TNS:listener does not currently know of service requested in connect
    descriptor
    Message was edited by:
    [email protected]

    Yes!
    lsnrctl services
    LSNRCTL for 32-bit Windows: Version 10.1.0.2.0 - Production on 20-5&#26376; -2006 15:1
    2:44
    Copyright (c) 1991, 2004, Oracle. All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
    Services Summary...
    Service "PLSExtProc" has 1 instance(s).
    Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    The command completed successfully
    no "demo" service,why?

  • Help with sqlplus problem

    So I installed Oracle for Linux 8.0.5 and applied the
    glibc patches. The database is up and running.
    I can connect to the database from my pc clients and from the
    local machine, so I know the listener is set right. But my
    problem isn't inbound connections, it's outbound connections...
    My problem is, when I try to use sqlplus to connect to another
    oracle database, I get a:
    ORA-01017: invalid username/password; logon denied.
    However, if I use svrmgrl to connect to that same database -
    using the same username and password, I am able to connect! A
    tnsping shows OK (30 msec) and I have connectivity, so my
    tnsnames.ora file is configured right...
    Any ideas anyone?
    Thanks in advance,
    Philip Adams
    null

    dave torgerson (guest) wrote:
    : Phil Adams (guest) wrote:
    : : So I installed Oracle for Linux 8.0.5 and applied the
    : : glibc patches. The database is up and running.
    : : I can connect to the database from my pc clients and from the
    : : local machine, so I know the listener is set right. But my
    : : problem isn't inbound connections, it's outbound
    connections...
    : : My problem is, when I try to use sqlplus to connect to
    another
    : : oracle database, I get a:
    : : ORA-01017: invalid username/password; logon denied.
    : : However, if I use svrmgrl to connect to that same database -
    : : using the same username and password, I am able to connect! A
    : : tnsping shows OK (30 msec) and I have connectivity, so my
    : : tnsnames.ora file is configured right...
    : : Any ideas anyone?
    : : Thanks in advance,
    : : Philip Adams
    : Are you connecting to a v7 database?
    : You may look at the $ORACLE_HOME/network/admin/sqlnet.ora file.
    : add a line like "DISABLE_OOB = ON". I've seen this solution
    : somewhere before and it worked for me when I had the same
    : problem. There are other lines you may need to add in this
    file
    : to turn certain "features" on or off.
    Maybe Sql*Plus is not linked with TCP/IP: the "adapters" program
    looks inside a program to see the protocols:
    adapters sqlplus
    If a "ls -l" for sqlplus shows a create date older than
    the svrmgrl, relink sqlplus.
    Regards,
    Gilles
    http://perso.club-internet.fr/gbriard
    null

Maybe you are looking for

  • How do I get my iPhone iPad n MacBook pro to all be in sync?

    I really just don't get it

  • Podcast download failure

    I just downloaded the new iTunes, and my podcasts are not updating.  A right click used to show a dialog box that said update podcast. that has disappeared.  there is a download choice but it doesn't seem to do anything

  • Apple TV multi screen

    Hello, I would like to get the possibility to change a powerpoint presentation on 8 screens at the same time from an ipad. I thought an apple TV can do the job but i have no idea how ? For me : one apple TV = one screen How can i get a replication on

  • How can Photo's be sorted other than by date taken?

    Is there a way to sort Photo's on my iPad 2 other than the standard Apple method (date taken). .??

  • Files without extensions not recognizing program

    Recently I used my new lacie firewire drive to transfer files from my G4 to a PC laptop. Now the files on the Lacie (when I work on the G4) are missing their icons. Only files without the extension .ai, .m4a etc. Some files will open via right click