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 output

Re: SQLPlus output

From: <Christopher.Jones_at_oracle.comX>
Date: 30 May 2002 18:50:28 +1000
Message-ID: <ug00a3tpn.fsf@oracle.comX>


nmangalath_at_hotmail.com (Naru Mangalath) writes:

> Thanks Sybrand,
> But I am afraid that is no good. The piece of code from the shell script:
> ==============================================================================
> sqlplus "${LOGINID}" <<EOF
> set echo on
> set feedback on
>
> alter database backup controlfile to '${BACKUP_DIR}/controlfile';
> alter database backup controlfile to trace;
> exit
>
> EOF
> ==============================================================================
> produces the following output - without the commands:
> ==============================================================================
> SQL*Plus: Release 8.1.7.0.0 - Production on Thu May 30 15:42:33 2002
>
> (c) Copyright 2000 Oracle Corporation. All rights reserved.
>
>
> Connected to:
> Oracle8i Enterprise Edition Release 8.1.7.3.0 - Production
> With the Partitioning option
> JServer Release 8.1.7.3.0 - Production
>
> SQL> SQL> SQL> SQL>
> Database altered.
>
> SQL>
> Database altered.
>
> SQL> Disconnected from Oracle8i Enterprise Edition Release 8.1.7.3.0 - Production
> With the Partitioning option
> JServer Release 8.1.7.3.0 - Production
> ==============================================================================

The SET ECHO command echoes commands that are being run from a .SQL file, e.g. with "@file.sql" or "START file.sql" commands. See the manual at http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a90842/ch13.htm#1012498

Perhaps your easiest solution is something like this:

    #!/bin/sh

    cat > /tmp/my.sql <<EOF
    set echo on
    show user
    exit
    EOF     sqlplus system/manager @/tmp/my.sql

    /bin/rm -f /tmp/my.sql

Chris


SQL*Plus Tip for the day: SQL*Plus 9.2 has a -LOGON command line option. It tells SQL*Plus _not_ to re-prompt if the initial database connection is not successful. Mighty handy for shell scripts. See http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a90842/ch4.htm#1005759


-- 
Christopher Jones, Oracle Corporation, Australia.
Received on Thu May 30 2002 - 03:50:28 CDT

Original text of this message

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