SQL*Plus + rlwrap + Terminator = tolerable environment

I have no doubt that those who are "full-time" users of sqlplus (that is a native Oracle's textmode client app to the database server), will agree that it provides a spartan and unimaginative command-line interface. Unlike most modern command-line utilities, such as `mysql' (in MySQL) or `psql' (in PostgreSQL), it lacks
* auto-completion (TAB key), not to mention context-sensitive auto-completion (SELECT ... FROM <TAB>)
* command history (UP/DOWN arrow keys)
* incremental search on the history (CTRL-r)
If you make any mistake typing a long statement, you have to re-enter it all over again. In addition, sqlplus also lacks
* an internal call to system $PAGER for paging query output instead of wrapping the text, without having to spool the output to a file
Since most unix/linux terminal emulators (xterm, rxvt, gnome terminal, kde konsole etc) don't support horizontal text scrolling, but wrap text upon the right margin, the use of sqlplus on unix/linux terminals is really horrific. By the way, it's a shame that a multi-billion company like Oracle, which reported nearly $18 billion total revenues ($4.3 billion net income) for this fiscal year, the company that charges $40,000 per CPU for its "World's Number One Database" with nearly 50% market share and considers Linux to be its supported platform for the future, doesn't take care of getting sqlplus finally doing right (mysql and postgresql are also multi-platform products). As Linux has very efficient gnu readline library and several well-known system pagers such as `more', `less', `most' etc, it's really shameful and ridiculous that we have to google for "workarounds". Fortunately, there are nice "workarounds" all over the internet thanks to opensource.
I. Terminator
Whoever is interested in running sqlplus to issue queries producing long-line text output in a virtual terminal wider than physical screen, and doesn't hesitate in-java-written applications, now can download and install a cross-platform GPL terminal emulator called Terminator with advanced features. Terminator provides horizontal and vertical scrollbars for horizontal and vertical scrolling. It's java application (internally calling bash shell) with Ruby startup script, so it requires Java 5 or later and Ruby 1.8 or later to be installed (Ruby is shipped as standard package with RHEL/OEL). Though written in java, Terminator has very good performance and very nice output. Prebuilt Terminator packages are available from software.jessies.org. Here are direct download links for
32-bit RHEL/OEL
http://software.jessies.org/downloads/redhat/org.jessies.terminator.i386.rpm
64-bit RHEL/OEL
http://software.jessies.org/downloads/redhat/org.jessies.terminator.x86_64.rpm
Just install the package (rpm -ivh) and start terminal by typing `terminator'. By default, the terminal window appears in black background and white foreground. I recommend changing default settings to obtain better-looking screen fonts. Go to Edit/Preferences, select the "Anti-alias text", click on the "Colors" tab and change background to white and text foreground to black, or just click preset "Black on White". Click on the "Save" button to save the settings. Restart the terminal.
II. rlwrap
Linux users working with sqlplus have an additional opportunity to use a readline wrapper `rlwrap' inside Terminator (or any other terminal). Since sqlplus is not built against readline library, rlwrap is just doing the job. It can be downloaded as a source tar package from
http://utopia.knoware.nl/~hlub/rlwrap/
Much better option is to download the newest source rpm package from Fedora 7, eg:
ftp://ftp-stud.hs-esslingen.de/pub/fedora/linux/releases/7/Everything/source/SRPMS/rlwrap-0.28-2.fc7.src.rpm
and build the binary rpm package by
# rpmbuild -bb rlwrap.specAfter installing the package, put the following line in /etc/bashrc (globally) or in ${HOME}/.bashrc (locally):
alias sqlplus='/usr/bin/rlwrap -m ${ORACLE_HOME}/bin/sqlplus'or whatever your <path_to_sqlplus> is. Relogin or just source .bashrc to take the effect. Start `terminator' terminal and then start "new" sqlplus inside it. Don't forget to SET LINESIZE to a desired value (practically unlimited), or just put the line in the glogin.sql.
Now you'll have an environment similar to that in windows (up/down arrows for command history, Ctrl-r for incremental search on the history, TAB key for auto-completion, all that in a terminal that doesn't wrap the output. It's a good practice to create your own `${HOME}/.sqlplus_completions' file (locally) or `/usr/share/rlwrap/sqlplus' file (globally) with all SQL reserved words (or whatever you want) as your auto-completion list (see rlwrap man page).
Have a lot of fun.
N.J.

... But honestly I wasn't facing to any problem with the older version.Neither I, but who knows... Here is a list of add-ons and bugs fixed since version 0.24. The list is extracted from rlwrap's "NEWS" file.
0.28 rlwrap bug that caused termcap problems on Fedora Core 6
fixed (thanks Tung Nguyen)
0.27 when stdin is not a terminal, rlwrap will now exec() the
specified command instead of complaining
when stdout or stderr is not a terminal, rlwrap will re-open
it to /dev/tty (the users terminal) after forking off the
specified command (so "rlwrap cat > file" will work as a
quick and dirty line editor)
rlwrap now remembers inputs of length 1
-D option to tell rlwrap how agressively it should weed out
duplicate history entries
-H option added (history format string)
Added temporary fix for termcap weirdness on Fedora Core 6
new -t option for a quick check of terminal capabilities
(requires configuration with --enable-debug)
rlwrap -s 0 <command> will now zap <commands> history
fixed broken reporting of unrecognised options
0.26 configure on FreeBSD 6.0 still didn't find libutil
some files were unnecessarily kept open (thanks Stephan Springl)
on each platform, rlwrap -h now accurately reflects whether
rlwrap can use long options or optional arguments
0.25 rlwrap would print input twice when in vi-mode
rlwrap under FreeBSD 6.0 now uses openpty() from libutil (config
script fixed)
-P option added (one-shot rlwrap with pre-given prompt)
Until now, whem the underlying command was killed by a signal,
rlwrap would just exit with exit code 0. Now rlwrap will
cleanup, reset its signal handlers and then send the same signal
to itself - so that rlwraps parent (usually a shell) doesn't see
the difference with an un-rlwrapped command
Regards
N.J.

Similar Messages

  • Quick SQL*Plus OS X questions

    I'm going to try to post quick OS X questions here that don't deserve their own threads.
    For starters:
    When I'm in the terminal I can hit the up arrow to scroll through previous commands. After I log into sqlplus and hit the up arrow I just get ^[[A.  I tried searching google but you could probably imagine I didn't get anything useful searching for that.  [b]Is there a way to enable the up arrow to scroll through previous commands?

    I am in the same boat (SQL*Plus on terminal on OS X) and the closest I came to cycle through old commands is the "/" which just runs the previous command. I did a lot of research, and was unsuccessful. I'll keep looking, but it doesn't look good for us.
    Rich

  • How I can run SQL*PLUS?

    On my notebook is instaled Oracle Client and Oracle SQL Developer. It is working correctly. I can connect to the Oracle DB on the Unix server so that my tnsnames.ora is correctly. But I don't know, how I can start SQL*PLUS on my client machine.
    Thanks in Advance :)

    hello
    did you mean to connect only to SQL * or to connect as sysdba?
    if your anwser is to connect only as normal user, then follow the above
    but in case you are looking to connect to the database server (Linux) from your laptop you have to connect to the server firest as root or the db user,
    then you can access oracle sql plus using terminal such as PUTTY (search in google it's free) look at this:
    [applprod@applprod 9.2.0]$ pwd
    /d01/oracle/proddb/9.2.0
    [applprod@applprod 9.2.0]$ sqlplus
    SQL*Plus: Release 9.2.0.6.0 - Production on Wed Oct 10 13:46:18 2007
    Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
    Enter user-name:
    Now what do you think?
    if you are looking to connect as sysdba, i think must from the termianl
    Regards
    Mohamed Tawfik

  • Restricting the user to operate DML's from SQL PLUS Environment

    how to Restrict the user to operate DML statements from SQL PLUS Environment.

    Once you restrict SCOTT user to not be able to do an INSERT command, the SQL*Plus returns an error for user SCOTT when he tries to execute an INSERT statement.
    Note however, that this is enforced by SQL*Plus, not the database!
    Look into the use of product_user_profile from Oracle documentation for more information.
    SQL> insert into product_user_profile values('SQL*Plus', 'SCOTT', 'INSERT', NULL, NULL, 'DISABLED', NULL, NULL) ;
    1 row created.
    SQL> commit ;
    Commit complete.
    SQL> disconnect
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.3.0 - Production
    SQL>
    SQL> connect scott
    Enter password:
    Connected.
    SQL>
    SQL> insert into emp select * from emp ;
    SP2-0544: invalid command: insert
    SQL>
    SQL>

  • Windows System Environment Variables in "Sql * plus"

    Can i use/reference Windows System Environment variables in "Sql * plus"?
    For example, i want to create sql-script to run in database server computer that asks variable "ORA_HOME" and uses this value to execute some sql/plsql sentences.
    Oracle 10g Personal, Windows 7.
    Edited by: CharlesRoos on 12.11.2010 17:28

    CharlesRoos wrote:
    Business problem:
    I have created 2 databases in my computer. Both databases needs tablespaces created by a script. Tablespaces' datafiles (.dbf files) names are same for both database. Both database has it's own directory where it holds datafiles at the moment. At the moment the datafiles for Database1 are in folder something like "%ORACLE_HOME%"\oradata\%databasename1%\*.dbf, and second database has its datafiles in other folder, somewhere ""%ORACLE_HOME%"\oradata\%databasename1%\*.dbf". I want now the script to create tablespace called "INDX" with same datafile name "indx1.dbf" into both database. So into both mentioned folder the file "indx1.dbf" must be created by script. I think the script should do following:
    1. get ORACLE_HOME.
    2. connect to database "databasename1"
    3. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename1 || indx1.dbf"
    4. connect to database "databasename2"
    5. EXECUTE IMMEDIATE "Create TableSpace INDX....file=%ORACLE_HOME% || databasename2 || indx1.dbf"I don't have Oracle database near by anymore, so the code was pseudocode.
    I don't understand how to use ?-shortcut.OK, my first impression is "why does this even NEED to be scripted? Creation of new tablespaces is usually a one-off operation.
    But that aside how about this sqlplus command-line substitution variables. This example is in linux, but will work as well in Windows with the change of the way environment variables are referenced:
    *nix - echo $myvariable
    Windows - echo %myvariable%
    First, the sqlscript to create the TS. Note the use of the substitution variable "&1"
    {code}
    [oracle@vmlnx01 ~]$ cat cat makets.sql
    set echo on feedback on verify on trimsp on
    prompt &1
    CREATE SMALLFILE TABLESPACE EDSTEST
    DATAFILE '/ora01/oradata/&1/edstest.dbf'
    SIZE 5M
    REUSE
    AUTOEXTEND ON
    NEXT 1280K
    MAXSIZE 32767M
    LOGGING
    EXTENT MANAGEMENT LOCAL
    SEGMENT SPACE MANAGEMENT AUTO
    drop tablespace edstest
    including contents and datafiles
    exit
    {code}
    So, at the OS prompt: Notice that the @ is separated by a space, makeing it a command line parm instead of part of the connect string
    {code}
    [oracle@vmlnx01 ~]$ export myparm=vlnxora1
    [oracle@vmlnx01 ~]$ sqlplus system/pswd @makets $myparm
    SQL*Plus: Release 10.2.0.4.0 - Production on Fri Nov 12 13:18:05 2010
    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> prompt &1
    vlnxora1
    SQL> --
    SQL> CREATE SMALLFILE TABLESPACE EDSTEST
    2 DATAFILE '/ora01/oradata/&1/edstest.dbf'
    3 SIZE 5M
    4 REUSE
    5 AUTOEXTEND ON
    6 NEXT 1280K
    7 MAXSIZE 32767M
    8 LOGGING
    9 EXTENT MANAGEMENT LOCAL
    10 SEGMENT SPACE MANAGEMENT AUTO
    11 ;
    old 2: DATAFILE '/ora01/oradata/&1/edstest.dbf'
    new 2: DATAFILE '/ora01/oradata/vlnxora1/edstest.dbf'
    Tablespace created.
    SQL> --
    SQL> drop tablespace edstest
    2 including contents and datafiles
    3 ;
    Tablespace dropped.
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    [oracle@vmlnx01 ~]$
    {code}

  • Unix Environment variable for connect string in SQL*Plus

    I am using some environment variables to connect to a sql*plus session in unix.
    they are exported as part of a file which contains the following and gets executed through the .profile.
    export db_username=xxx
    export db_password=xxx
    export db_name=xxx
    i have created a file abc.sql which contains the following
    connect $db_username/$db_password@$db_name
    Now, I have a shell script which uses this file inside it to connect to a sql*plus session and execute some queries.
    The contents of the shell script :
    API_CONNECT_SQL=abc.sql
    sqlplus /nolog << THEEND
    WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
    WHENEVER OSERROR EXIT FAILURE ROLLBACK
    set timing on
    @${API_CONNECT_SQL}
    ---- do something
    EXIT
    THEEND
    Now, the sql*plus session is able to get db_username and db_password, but not the db_name. It says "TNS service name not found".
    If I hardcode some database name in place of db_name, it connects properly.
    Please let me know the problem and solution as well.
    Any help appreciated.
    thanks,
    Vijay

    for me this one works
    # =========================================
    # begin of script
    # =========================================
    export db_username=alpha
    export db_password=bravo
    export db_name=charly
    echo "connect $db_username/$db_password@$db_name" > xxx.sql
    API_CONNECT_SQL=/cfs/dummy1/0/appl/dummy2/rev_04/zzz/tst/xxx.sql
    cat ${API_CONNECT_SQL}
    sqlplus /nolog << THEEND
    spool xxx
    WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
    WHENEVER OSERROR EXIT FAILURE ROLLBACK
    set echo on
    host cat ${API_CONNECT_SQL}
    @${API_CONNECT_SQL}
    select * from dual;
    spool off
    EXIT
    THEEND
    # =========================================
    # end of script
    # =========================================

  • SQL * PLUS environment is missing in Oracle 11g

    I installed Oralce 11g successfully in my windows XP system.. but Here SQL * PLUS environment in missing.. how will i retain the SQL * environment? please help me

    Hi;
    I installed Oralce 11g successfully in my windows XP system.. but Here SQL * PLUS environment in missing.. how will i retain the SQL * environment? please help meWhat do you mean with " SQL * PLUS environment in missing" please give us more details.
    Regard
    Helios

  • Environment variable PATH and Sql*Plus

    Hi all,
    i have a problem with sqlplus.
    It might seem not to be able to read the path environment variable.
    I need to launch some sqls without typing their path (to put the path i should modify morre than 300 shell scripts), e.g.: @script.sql.
    My shell scripts are invoked by the database using java.
    Inside the shell scripts we have commands like "sqlplus -silent <login> @script.sql [parameters]"
    So if sqlplus is not able to read the PATH environment variable, the command hangs waiting for something to do without the chance to close it.(it is silent).
    I run RDBMS v8.1.7 on compaq tru64 Unix.
    Can someone help me??
    Thanks in advance.
    Marco - Milan, Italy

    Where do I set SQL*Plus SQLPATH variable??As every other unix environment variable - either in your profile or in your current shell whatever you like
    Is this the PATH where SQL*Plus searches for .sql
    files??SQL*Plus searches for your files in your current directory, and then the directories you specify with the SQLPATH environment variable.
    SQL*Plus searches this colon-separated list of directories in the order they are listed.

  • What environment variable I will set  for the default SQL*plus file directory

    Hi there,
    I run sql*plus on windows 2000 professional. I want to set a file
    directory for sql*plus so that when I write something in a file,
    it will be in my default file directory. What environment
    variable I will set for that? Thanks in advance.

    hi , i have already install my oracle 8i personnel edition to my computer , but my sql plus don't seen to work ,
    i understand that they username are ( scott ) and password are ( tiger ) but after i type them and press ok there will be a box coming out and it said ( Cannot open registry Software \ORACLE\HOME1\SID_LIST Starting with default sid )
    after i click ok there will be another box asking for password , but i what is the password ? it look to me like a internal password , it can't be tiger for this , cos before that i have already type in my username and password , this is the later part , anyone can help? pls reply, thank alot Nigel,
    I'm not sure about Oracle8i Personal Edition. The default username/passwords are:
    scott/tiger
    system/manager
    sys/change_on_install as sysdba
    You could try the database installation discussion forum for more help. If you find out what the password for this dialog is, please post it to this group for the benefit of others.
    Alison

  • How to pass Unix environment variable to a SQL procedure or SQL * Plus

    Can any body suggest me how to ,
    How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
    I am trying to invoke a SQL Procedure from Unix
    by passing the value of a Unix environment variable.
    Is it possible..?
    Thanks in advance.
    Regards,
    Srinivas Jaltaru

    Within your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
    <pre>
    #!/bin/bash
    export ORACLE_SID=DEV05
    FILENO=1007351
    while [ ${FILENO} -le 1008400 ]
    do
    FILENAME=farm_${FILENO}.txt
    DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
    set lines 73
    set pages 0
    set head off
    set termout off
    set echo off
    set feedback off
    select rpad(searchx, 8)
    from blastx@PRODUCTION
    where searchx = ${FILENO} ### here's a shell variable
    spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
    spool off
    SQLSTOP`
    FILENO=`expr ${FILENO} + 1`
    done
    exit 0
    </pre>

  • Sql plus Environment:

    HI!
    1. When I want to query long data from tables using select, in sql +,
    the above data will go on,by scrolling upward it's not appearing,
    2. I have set linesize 4500 and pagesize 50000, but no change occure.
    3. As in dos prompt we set page to appear width wise, similarly it is possible to see this in sql/plsq(sql plus).
    thanks.

    If you want to query long data, then use
    SET LONG some_size;
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12040.htm#SQPUG088

  • Is it possible to run SQL*Plus with Putty?

    Hello everybody,
    I've just installed Oracle 11g on Windows Vista. When I click on SQL*Plus it opens the program in the default windows command line. I don't really like the look and feel of cmd. I would like to know whether it is possible to run SQL*Plus in a more advanced/user friendly environment such as Putty terminal client.
    Thanks in advance,
    Dariyoosh

    Kamran Agayev A. wrote:
    user8747515 wrote:
    Windows Command Line is ace! Arrow Up & Down to retrieve commnads... you don't get that (not without a rubbishy workaround) in UNIX!You can solve this issue using rlwrap package. See my vide tutorial
    http://kamranagayev.wordpress.com/2009/07/04/using-rlwrap-to-get-command-lines-history-in-sqlplus-video-tutorial/
    Dear Kamran,
    Thank a lot for this nice presentation, I had also this problem (no command history) under linux. This package is really interesting.
    Kind Regards,
    Dariyoosh

  • Signal 11 error in SQL Plus report

    Hi,
    While running the sql plus type of report in oracle apps environment, i'm getting below error in the log after generating half of the o/p.
    stat_low = 8B
    stat_high = 0
    emsg:was terminated by signal 11
    Please help if anyone have idea on this.
    Thanks in advance,
    Devaraj.K

    Please post the details of the application release, database version and OS.
    While running the sql plus type of report in oracle apps environment, i'm getting below error in the log after generating half of the o/p.
    stat_low = 8B
    stat_high = 0
    emsg:was terminated by signal 11
    Please help if anyone have idea on this.Is this a custom or seeded concurrent program?
    Please post the contents of the concurrent request log file here.
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Signal+AND+11&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Oracle10g Developer Suite - Application Development - SQL Plus Login Info

    I have installed Oracle10g Developer Suite and when I am trying to login into the sql*plus environment the username scott with the passcode tiger is not working. I have Oracle9i Enterprise Edition Release 9.2.0.1.0 as the database.
    Can anyone help me in setting up the username and password to login into Sql*plus Release 10.1.0.4.2

    It sounds like you may be new to Oracle and its products. I would recommend doing some reading.
    Oracle 9.2 Net Services Admin Guide
    http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96580/toc.htm
    Oracle Developer Suite Installation Guide
    http://download-west.oracle.com/docs/cd/B25016_06/doc/dl/core/B16012_03/toc.htm
    You create the "login" information when you install the database. If you are not the person who performed the installation, you will need to contact them or install it again. Also, be aware that the SCOTT schema is disabled by default in newer database versions for security reasons.
    The tnsnames.ora and sqlnet.ora files can be found in the ORACLE_HOME\network\admin directory. This is the same for all Oracle products that use Sql-Net for database connections. You can also use the TNS_ADMIN environment variable to point to a pre-existing tnsnames.ora file (see previously mentioned documents).
    The tnsnames.ora entry will be unique to your database and its listener however here is an example:
    ORCL =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = someServer.com)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = orcl)
    )

  • Explain plan results are different in SQL Developer than SQL Plus

    My Environment:
    SQL Developer 1.0.0.15.27
    Platform where SQL Developer is running: Windows XP 2002 SP2
    Oracle Database and Client 9.2.0.7
    Optimizer_mode: FIRST_ROWS
    I have the following SQL statement:
    SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE :b2 = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > :b1
    When I run an Explain in SQL Developer I get the following access path (which is the one I really want):
    SELECT STATEMENT                          TABLE ACCESS(BY INDEX ROWID) FEDLINK.AU_COMPANY          NESTED LOOPS                                   INDEX(RANGE SCAN)
    FEDLINK.UX2_TEMP_AU_COMPANY
              INDEX(RANGE SCAN) FEDLINK.PX1_COMPANY
    However, when I execute the statement with sql_trace turned on and use tkprof to generate the actual access path, the statement executes as follows (which is WAY more expensive):
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 3.58 6.68 28136 29232 0 0
    total 3 3.58 6.69 28136 29232 0 0
    Misses in library cache during parse: 1
    Optimizer goal: FIRST_ROWS
    Parsing user id: 979 (FEDLINK) (recursive depth: 1)
    Rows Row Source Operation
    0 NESTED LOOPS
    0 TABLE ACCESS FULL AU_COMPANY
    0 INDEX RANGE SCAN UX2_TEMP_AU_COMPANY (object id 49783)
    Notice the FULL access of au_company.
    I understand that SQL Developer has nothing to do with why the statement executed the way it did, but why is the Explain in SQL Developer different than the actual execution plan?
    Added note....when I run the explain in SQL Plus it is the same as the actual execution. Here is the explain from SQL Plus:
    explain plan for SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE '1' = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > '01-MAY-2006';
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 2 | 76 | 2597 |
    | 1 | NESTED LOOPS | | 2 | 76 | 2597 |
    | 2 | TABLE ACCESS FULL | AU_COMPANY | 2 | 42 | 2595 |
    | 3 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 1 | 17 | 2
    Thanks,
    Brenda

    The explain is different (full scan of au_company in SQL Plus / index access in SQL Developer) even when I use variables in SQL Plus. Here is the output for SQL Plus using variables instead of literals:
    SQL> variable b1 varchar2
    SQL> variable b2 char
    SQL> explain plan for SELECT a1.comp_id
    2 FROM temp_au_company a0, au_company a1
    3 WHERE :b2 = a0.temp_emp_code
    4 AND a0.comp_id = a1.comp_id
    5 AND a0.sls_terr_code != a1.sls_terr_code
    6 AND a1.last_mdfy_date > :b1
    7 /
    Explained.
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3184 | 118K| 2995 |
    | 1 | HASH JOIN | | 3184 | 118K| 2995 |
    | 2 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 3187 | 54179 | 3 |
    | 3 | TABLE ACCESS FULL | AU_COMPANY | 24009 | 492K| 2983 |
    Any other ideas? They should be the same.
    Brenda

Maybe you are looking for

  • How do I get my bookmark toolbar back on the top instead of in a drop down box under bookmarks.

    I have a check mark in the "view bookmark toolbar" but it still doesn't show. This just changed after I turned my computer on again. When you go to bookmarks and click on "bookmark toolbar", all the websites are still there, but I want them to show u

  • Function RA_AFABUCHEN

    Hi all, I need some help regarding the function module RA_AFABUCHEN. Sample Code:     CALL FUNCTION  'RA_AFABUCHEN'          EXPORTING                      I_AFBGJR   = G_GJAHR                     I_AFBPER   = G_AFBLPE                     I_AGAIN   

  • Portal users logon average

    Hi, I would like to know if there is a way to find out how many users were logged on to portal yesterday or the users logon average. Anything that could show what is the time when most of the users are on the portal. Really appreciate your help. Than

  • Custom Views - list showing cancelled alerts (vROps 6.0.1)

    Hi all, I've created a custom View of a list to report on Host Compliance. The view displays all of the symptoms that are alerting, even though they have been rectified and the symptom's metric is reporting the 'cancelled on' time. As most the sympto

  • Www not required?

    Hello!  I hope that my situation is not unique and someone out there can help me solve a problem.  I have an internal mail server and an external web host.  When my users go to mydomain.com there is an error but when they go to www.mydomain.com all i