User cannot dropped after run "Kill Session" command

Hi ,
I’m facing problem with oracle user,
Oracle 10G R(2).Windows Xp
Application in .NET
1)I create user:
2)Then I check current session using this select”
"SELECT SID, SERIAL# FROM V$SESSION WHERE UserName =
3)Then I execute this statement from application”
ALTER SYSTEM KILL SESSION '{sid},{serialno}' IMMEDIATE”
4)In our scenario user is no more connected.
5) Now when we run below this statement from application oracle gives an error”CANNOT DROP THE USER THAT IS CURRENTLY CONNECTED”
DROP USER {0} CASCADE
Please advice.
Faheem Latif

Comments embedded
Hi ,
I’m facing problem with oracle user,
Oracle 10G R(2).Windows Xp
Application in .NET
1)I create user:Please post complete command
>
2)Then I check current session using this select”
"SELECT SID, SERIAL# FROM V$SESSION WHERE UserName =
Please post the complete command.
3)Then I execute this statement from application”
ALTER SYSTEM KILL SESSION '{sid},{serialno}'
IMMEDIATE”
Please post the complete command
4)In our scenario user is no more connected. How did you verify? Please post the complete command.
>
5) Now when we run below this statement from
application oracle gives an error”CANNOT DROP THE
USER THAT IS CURRENTLY CONNECTED” So the user is still connected.
Which user are you trying to drop? Yourself?
Again, please post the complete command.
>
DROP USER {0} CASCADE
Please advice.
Faheem LatifMy advice is you either provide sufficient detail, including all commands, and stop relying on crystal balls and fortunetellers.
No one here was looking over your shoulder, so no one can tell what happened, without you providing sufficient clues. I agree with you this is cumbersome, and doesn't comply with your custom to dump everything here, not doing any research yourself.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Can I change user name after running essbase from command prompt??

    Hi,
    I run essbase from command prompt and during this activity I was asked to give user name and password, but by mistake I put wrong user name and now wolud like to chanege it.
    Is it possible??
    cheers,

    It worked,
    now I was able to connect to easbase from planning, I ve created sample aplication and initialize it but cannot connect to Eas to download data for sample application. After I run the validation there is now only one error displayed:
    Essbase / Essbase Administration Services
    FAILED Web App Availability of web application context (POL-MPIKULSKI 10080, eas)
    Error: com.hyperion.cis.utils.BadResponseCodeException: Bad response code: 404
    Recommended Action: Check application is started
    I tried to start the eas from start>programs>epm system>essbase>administration services>start administration services(java embeded) but it didnt help.
    can I start in in different way??
    cheers,

  • Abend while executing alter system kill session command

    I have a ML350 G3 Hp server(Xeon 2.4 Ghz) running oracle 8.1.5 on Novell 5.1. Frequently i have locking problems in my software. So when i tried to kill the active session using alter system kill session 'sid, serial#' my server produce following error:
    Fatal Exception (Number 14, cause abend: Page fault running process: orcl_000000fe code executing in module core81.nlm v8.1d at offset +6c490h). Any suggestions.

    This forum is for posting feedback about the OTN site.
    The best place for your question is probably a Database forum.
    There is a list of Database forums here:
    http://forums.oracle.com/forums/index.jsp?cat=18

  • Users VPN drops after every 5 mins

                       Hi everyone,
    We have user whose remote VPN drops after every 5 mins.
    Need to know whats things i can check to troubleshoot the issue?
    User connects by RSA Token.
    ISP connection is ok its not issue.
    Any thing i can check in ASA ?
    Thanks
    Mahesh

    On the client side, have you tested wired vs wireless to see if the problems exists in both?  If it's only one of them but not the other, try updating the drivers.  Also, if it's windows 7, take a look at the power settings in control panel.  I've seen where agressive power settings will shut off the network port when idle.  Not that big of a deal in a LAN environment but it wreaks havoc on VPN.

  • Re Post: Http server cannot start after running the following JSP

    Hi,
    I have 9iAS 1.0.2.2 and it has been working fine.
    My http server was running fine until I ran the following Jsp. Now I cannot start the Http server at all.
    I check the Oracle home and the path and make sure they match (i.e. if my Oracle Home is iSuites, I have the PATH variable: c:\oracle\isuites\bin as the 1st one. And I reboot the system after I changed the Oracle Home, check the PATH variable etc.)
    I also check the oci.dll files, and I have the oci.dll file in the following directories:
    c:\oracle\ora81\BIN 87KB
    c:\oracle\806\BIN 38KB
    c:\oracle\iSuites\BIN 87KB
    I check the Registry (regedit) and found that I have ORACLE_HOME_KEY for ora81 home, iSuites home, but not
    806 home. And there are oracle.key files in c:\oracle\ora81\bin, c:\oracle\806\bin, c:\oracle\isuites\bin .
    The contents of oracle.key in c:\oracle\ora81\bin and c:\oracle\isuites\bin are correct (i.e. "Software\ORACLE\HOME0" "Software\ORACLE\HOME2" respectively.) However, the content in c:\oracle\806\bin is "Software\ORACLE" .
    Will this be a problem because there is no corresponding ORACLE_HOME_KEY for 806 in regedit?
    OR
    the OCI.DLL file is corrupted in one of the above directory.
    Below is the JSP code that I ran. Before that, my HTTP server is started correctly.
    I really appreciate if someone could give me some pointers about this.
    I also suspect that when the HTTP server was brought down for some reasons and it was not a clean shutdown.
    So how can I shutdown the http server cleanly before restarting that?
    Thanks;
    Kelly.
    <%@ page language="sqlj"
    import="sqlj.runtime.ref.DefaultContext,oracle.sqlj.runtime.Oracl
    e" %>
    <HTML>
    <HEAD> <TITLE> The SQLJQuery JSP </TITLE> </HEAD>
    <BODY BGCOLOR="white">
    <% String empno = request.getParameter("empno");
    if (empno != null) { %>
    <H3> Employee # <%=empno %> Details: </H3>
    <%= runQuery(empno) %>
    <HR><BR>
    <% } %>
    <B>Enter an employee number:</B>
    <FORM METHOD="get">
    <INPUT TYPE="text" NAME="empno" SIZE=10>
    <INPUT TYPE="submit" VALUE="Ask Oracle");
    </FORM>
    </BODY>
    </HTML>
    <%!
    private String runQuery(String empno) throws
    java.sql.SQLException {
    DefaultContext dctx = null;
    String ename = null; double sal = 0.0; String hireDate = null;
    StringBuffer sb = new StringBuffer();
    try {
    dctx = Oracle.getConnection("jdbc:oracle:oci8:@", "scott",
    "tiger");
    #sql [dctx] {
    select ename, sal, TO_CHAR(hiredate,'DD-MON-YYYY')
    INTO :ename, :sal, :hireDate
    FROM scott.emp WHERE UPPER(empno) = UPPER(:empno)
    sb.append("<BLOCKQUOTE><BIG><B><PRE>\n");
    sb.append("Name : " + ename + "\n");
    sb.append("Salary : " + sal + "\n");
    sb.append("Date hired : " + hireDate);
    sb.append("</PRE></B></BIG></BLOCKQUOTE>");
    } catch (java.sql.SQLException e) {
    sb.append("<P> SQL error: <PRE> " + e + " </PRE> </P>\n");
    } finally {
    if (dctx!= null) dctx.close();
    return sb.toString();
    %>

    I had this problem and the pkgchk mentioned above helped to get the admin server going (thanks!) but I could not run the admin console. I saw:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: org/GNOME/Accessibility/JavaBridge (Unsupported major.minor version 49.0)
    It turned out that something (I suspect the patch) had replaced my java1.5.0_06 binary with a java1.4.2_03 binary - but left the java1.5 directory structure alone! i.e. looking in /usr/jdk would have indicated that java1.5 was installed, but when I ran jdk1.5.0_06/bin/java -version , it reported java version "1.4.2_03". I was unimpressed.
    I ended up removing all the SUNWj5* packages and reinstalling them and then I could start the admin console.
    Now to find out what other damage this patch might have caused.....

  • Http server cannot start after running the following JSP

    Hi,
    I have 9iAS 1.0.2.2 and it has been working fine.
    My http server was running fine until I ran the following Jsp. Now I cannot start the Http server at all.
    I check the Oracle home and the path and make sure they match (i.e. if my Oracle Home is iSuites, I have the PATH variable: c:\oracle\isuites\bin as the 1st one. And I reboot the system after I changed the Oracle Home, check the PATH variable etc.)
    I also check the oci.dll files, and I have the oci.dll file in the following directories:
    c:\oracle\ora81\BIN 87KB
    c:\oracle\806\BIN 38KB
    c:\oracle\iSuites\BIN 87KB
    I check the Registry (regedit) and found that I have ORACLE_HOME_KEY for ora81 home, iSuites home, but not
    806 home. And there are oracle.key files in c:\oracle\ora81\bin, c:\oracle\806\bin, c:\oracle\isuites\bin .
    The contents of oracle.key in c:\oracle\ora81\bin and c:\oracle\isuites\bin are correct (i.e. "Software\ORACLE\HOME0" "Software\ORACLE\HOME2" respectively.) However, the content in c:\oracle\806\bin is "Software\ORACLE" .
    Will this be a problem because there is no corresponding ORACLE_HOME_KEY for 806 in regedit?
    OR
    the OCI.DLL file is corrupted in one of the above directory.
    Below is the JSP code that I ran. Before that, my HTTP server is started correctly.
    I really appreciate if someone could give me some pointers about this.
    Thanks;
    Kelly.
    <%@ page language="sqlj"
    import="sqlj.runtime.ref.DefaultContext,oracle.sqlj.runtime.Oracl
    e" %>
    <HTML>
    <HEAD> <TITLE> The SQLJQuery JSP </TITLE> </HEAD>
    <BODY BGCOLOR="white">
    <% String empno = request.getParameter("empno");
    if (empno != null) { %>
    <H3> Employee # <%=empno %> Details: </H3>
    <%= runQuery(empno) %>
    <HR><BR>
    <% } %>
    <B>Enter an employee number:</B>
    <FORM METHOD="get">
    <INPUT TYPE="text" NAME="empno" SIZE=10>
    <INPUT TYPE="submit" VALUE="Ask Oracle");
    </FORM>
    </BODY>
    </HTML>
    <%!
    private String runQuery(String empno) throws
    java.sql.SQLException {
    DefaultContext dctx = null;
    String ename = null; double sal = 0.0; String hireDate = null;
    StringBuffer sb = new StringBuffer();
    try {
    dctx = Oracle.getConnection("jdbc:oracle:oci8:@", "scott",
    "tiger");
    #sql [dctx] {
    select ename, sal, TO_CHAR(hiredate,'DD-MON-YYYY')
    INTO :ename, :sal, :hireDate
    FROM scott.emp WHERE UPPER(empno) = UPPER(:empno)
    sb.append("<BLOCKQUOTE><BIG><B><PRE>\n");
    sb.append("Name : " + ename + "\n");
    sb.append("Salary : " + sal + "\n");
    sb.append("Date hired : " + hireDate);
    sb.append("</PRE></B></BIG></BLOCKQUOTE>");
    } catch (java.sql.SQLException e) {
    sb.append("<P> SQL error: <PRE> " + e + " </PRE> </P>\n");
    } finally {
    if (dctx!= null) dctx.close();
    return sb.toString();
    %>

    Hi Jim,
    I have the same environment with almost similar problem, no IIS services being started, but HTTP_Server still failed to start. Below log:
    +10/09/28 23:35:04 Start process+
    +[Tue Sep 28 23:35:06 2010] [warn] pid file c:/oracle/frhome_1/apache/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous+
    Apache run?
    ap_spawn_child: Bad file descriptor
    Couldn't fork child for piped log process
    Regards,
    Chai
    Edited by: user13350226 on Sep 28, 2010 9:14 AM

  • SQL 2012 Management Studio messages outcome is not in english after running any statement/command

    I have recently installed SQL 2012 and by default I have selected "english" as first language. When I run any statement into SQL management studio the messages outcome shows into different language
    How I can change it back to English
    Example
    Przetworzono: 10 procent.
    Przetworzono: 20 procent.
    Przetworzono: 30 procent.
    Przetworzono: 40 procent.
    Przetworzono: 50 procent.
    Przetworzono: 60 procent.
    Przetworzono: 70 procent.
    Przetworzono: 80 procent.
    Przetworzono: 90 procent.
    Przetworzono: 100 procent.
    Muhammad Mehdi

    @ Sofiya
    After I run command I got message
    Changed language setting to us_english.
    But when I try other syntax like recovery of database it is not in english
    Przetworzono: 10 procent.
    Przetworzono: 20 procent.
    Przetworzono: 30 procent.
    Przetworzono: 40 procent.
    Przetworzono: 50 procent.
    Przetworzono: 60 procent.
    Przetworzono: 70 procent.
    Przetworzono: 80 procent.
    Przetworzono: 90 procent.
    Przetworzono: 100 procent.
    Muhammad Mehdi
    Hi,
    , you will have to use SET LANGUAGE to change the language in the above of syntax. If you have not installed the localized version of SQL Server, the default language is US English. I recommend you use the following stetament to check if you install
    the localized version of SQL Server.
    select @@language
     If you need to change the default language on this machine, then you will have to change the default language for individual logins, as doing it on a server level won't work. For more ifnormation, see:http://www.sqlservercurry.com/2010/11/change-default-language-for-sql-server.html
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Few users getting reconciled after running trusted recon

    Hi Experts,
    i ran a trusted recon for a particular Active Directory search base and it reconciled only 6 out of some 50 odd users. I checked if the remaininig users are already present in OIM, which they are not. I checked all the parameters and they look fine. Please kindly guide me on some pressure points to check for errors.
    Thank you for your time.

    Verify data of your users. Check reconciliation events, if they generated for all users. That would give you some idea. Click on re-evaluate button there to relink that specific user. Also make sure xlReconbatchsize system property is set to 500(by default). Also make sure (if this is cusomt code), bulk execute method of your schedule task is implemented properly.
    If nothing is clear, put logs here.
    regards,
    GP

  • Restricted session & Kill Session

    Hello everybody,
    1) In which case do I need enabled restricted sessions?
    2)Where “ALTER SYSTEM KILL SESSION” command will be useful?
    Thanks in advance

    Salman Qureshi wrote:
    Hi,
    1) In which case do I need enabled restricted sessions?Whenever you want to perform some maintenance operations in your database and you don't want anyone to access the database except user SYS, you can enable restricted session.
    2)Where “ALTER SYSTEM KILL SESSION” command will be useful?When you want to kill a session which is no longer responding or hung or doing some long running operation which is disturbing your performance or you want to stop that processing etc.
    SalmanHi Salman,
    I think you'll find that "restricted session mode" does not limit login ability to only the SYS user as you mention.
    As an example, consider the following.
    Session 1:
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 1 22:07:03 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    SQL> connect / as sysdba
    Connected.
    SQL> shutdown immediate;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup restrict;
    ORACLE instance started.
    Total System Global Area 2137886720 bytes
    Fixed Size                  2256912 bytes
    Variable Size            1258295280 bytes
    Database Buffers          872415232 bytes
    Redo Buffers                4919296 bytes
    Database mounted.
    Database opened.
    SQL>Session 2:
    SQL*Plus: Release 11.2.0.3.0 Production on Tue Jan 1 22:07:51 2013
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    SQL> connect markwill
    Enter password:
    Connected.
    SQL> select logins from v$instance;
    LOGINS
    RESTRICTED
    1 row selected.
    SQL>As you can see in Session 2 I am clearly not connecting as SYS user, yet I am capable of connecting to an instance started in restricted mode.
    Rather than limiting to only user SYS it limits login ability to users with the RESTRICTED SESSION System Privilege (granted directly or via role).
    Regards,
    Mark

  • ALTER SYSTEM KILL SESSION privilege

    Hi All,
    Is there any possibility to use this command from a without having DBA priviileges, what is the privilege to be grantd to the ordinary users to execute ALTER SYSTEM KILL SESSION... statement..
    Thanks in advance

    The procedure proposed by Rusell would be more or less so:
    SQL> create or replace procedure kill_session
      2  ( v_sid number, v_serial number )
      3  as
      4  v_varchar2 varchar2(100);
      5  begin
      6  execute immediate 'ALTER SYSTEM KILL SESSION '''
      7  || v_sid || ',' || v_serial || '''';
      8  end;
      9  /
    Procedure created.
    SQL> select username, sid, serial# from v$session;
    USERNAME                              SID    SERIAL#
                                          147       5078
    SYS                                   148       6161
                                          151       6769
                                          156          1
                                          158          1
                                          159          1
    REPOS_OWNER                           161      14502
                                          163          1
                                          164          1
                                          165          1
                                          166          1
    USERNAME                              SID    SERIAL#
                                          167          1
                                          168          1
                                          169          1
                                          170          1
    15 rows selected.
    SQL>
    SQL> exec kill_session(161,14502);
    PL/SQL procedure successfully completed.
    SQL>Joel Pérez
    http://otn.oracle.com/experts

  • Users cannot authenticate

    Hello
    I recently had a lot of errors on two ML servers actinbg as OD Master/Replica, so decided to reinstall from scratch. One is running OS X 10.8.2, the other 10.8. Both are vanilla installs (going so far as to recreate the RAID), and both have the latest version of server.app installed.
    Network users cannot authenticate.
    Running slapconfig -ver gives the following errors on both machines:
    bubbles:~ administrator$ sudo slapconfig -ver
    2012-11-27 20:17:31 +0000 command: /usr/libexec/slapd -T cat -c -f /etc/openldap/slapd.conf -s ou=macosxodconfig,cn=config,dc=test249,dc=home
    2012-11-27 20:17:31 +0000 Error execing slapcat: 50b51fdb /etc/openldap/slapd_macosxserver.conf: line 303: unknown directive <TLSCertificatePassphrase> inside backend database definition.
              slapcat: bad configuration file!
    LDAP Setup Tool (slapconfig), Apple, Inc.,  Version 1.2
    Obviously ou=macosxodconfig,cn=config,dc=test249,dc=home is wrong, but I don't know where this setting is held to correct it to ou=macosxodconfig,cn=config,dc=server,dc=domain,dc=tld
    Opeining slapd_macosxserver.conf shows the last four lines to be:
    TLSCertificateFile      /etc/certificates/server.mydomain.LONGHASH.cert.pem
    TLSCACertificateFile    /etc/certificates/server.mydomain.LONGHASH.chain.pem
    TLSCertificateKeyFile   /etc/certificates/server.mydomain.LONGHASH.key.pem
    TLSCertificatePassphrase        "Mac OS X Server certificate management.LONGHASH"
    I can 'fix' the second error by commenting out that last line. But that just results in a new and exciting error:
    bubbles:~ administrator$ sudo slapconfig -ver
    2012-11-27 20:43:00 +0000 command: /usr/libexec/slapd -T cat -c -f /etc/openldap/slapd.conf -s ou=macosxodconfig,cn=config,dc=test249,dc=home
    2012-11-27 20:43:00 +0000 Error execing slapcat: slapcat: slap_init no backend for "ou=macosxodconfig,cn=config,dc=test249,dc=home"
    LDAP Setup Tool (slapconfig), Apple, Inc.,  Version 1.2

    Hi
    i get the same error but authentication still works.
    Are you sure that the recovery of your password worked ?
    In case I have this issue i can only authenticate as a local user, not as an opeddir user.
    This user must have admin rights to make sudo, afaik.
    But it is interesting that my error comes on line 302 and yours on line 303.
    Below i have attache the auth part from my /etc/openldap/slapd_macosxserver.conf
    Check for any difference.
    macmini:~] user% sudo slaptest -f /private/etc/openldap/slapd.conf -v
    Password:
    52054639 /etc/openldap/slapd_macosxserver.conf: line 302: unknown directive <TLSCertificatePassphrase> inside backend database definition.
    slaptest: bad configuration file!
    # authdata database definitions
    database        bdb
    suffix          "cn=authdata"
    rootdn          "uid=root,cn=users,dc=macmini,dc=domain,dc=TL"
    directory       "/var/db/openldap/authdata"
    checkpoint      128 1
    index           default eq
    index           objectClass eq
    index           authGUID eq
    index           entryUUID eq
    index           entryCSN eq
    index           draft-krbPrincipalAliases eq
    index           draft-krbPrincipalName eq
    timelimit 60
    idletimeout 300
    cachesize       20000
    idlcachesize    10000
    sizelimit size.pr=11000 size.prtotal=unlimited
    #limits          set="computer/cn & [cn=com.apple.opendirectory.group,cn=computer_groups,dc=macmini,dc=domain,dc=TL ]/memberUid" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited
    access to *
                    by dn.exact="uid=_ldap_replicator,cn=users,dc=macmini,dc=domain,dc=TL" write
                    by sockurl="ldapi://%2Fvar%2Frun%2Fldapi" write
    TLSCertificateFile      /etc/certificates/macmini.D5473ED3099C09ACE59C2944EA9FDDFC024DC07.cert.pem
    TLSCertificateKeyFile   /etc/certificates/macmini.D5473ED3099C09ACE59C2944EA9FDDFC024DC07.key.pem
    TLSCertificatePassphrase        "Mac OS X Server certificate management.D5473ED3099C09ACE59C2944EA9FDDFC024DC07"
    TLSCACertificateFile    /etc/certificates/macmini.D5473ED3099C09ACE59C2944EA9FDDFC024DC07.chain.pem

  • Regarding kill session

    Hello Everybody,
    I am new to Oracle. I have few questions regarding session kill.
    1)Does “killed” session consume any system resources like RAM, CPU?
    2)Whether one should kill the process rather than the session?
    3) Does ALTER SYSTEM KILL SESSION command kill both user session and server process?
    With Regards.

    1)Does “killed” session consume any system resources like RAM, CPU? Killed Status In v$Session Indicates PMON is too busy to clean up.
    You could refer to
    http://www.oracle-base.com/articles/misc/KillingOracleSessions.php
    2)Whether one should kill the process rather than the session?Refer to
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4974573906087
    3) Does ALTER SYSTEM KILL SESSION command kill both user session and server process?session is not a process, a process is not a session.
    please refer to Tom Link.

  • Issue after running OSX Update

    I have a MacBook Pro running 10.8.5
    I ran the software update which required a reboot and ran until showing "About a Minute" then Hung
    I had to force a power off to clear it.  On Powering up it booted normally but on the last account opened Finder does not work (on clicking the ico the besktop folder flash as if finder is restarting but no windows open).  Additionally the computer will not connect to my network.  It can see the network.
    In the other account (also with admin rights) finder works fine but the same issue exists with the wifi.
    I have tried deleting the network in System preferences, then re-adding it - all I get is an immediate Network timeout error
    I have rebooted the network which my other devices all log on to normally.
    How can I get my MacBook back into action?  Any ideas gratefully received.

    In the account that isn't working.
    In Finder hold down the option/alt key while selecting the Go menu item. Select Library. Then go to Preferences/
    com.apple.finder.plist. Move the .plist to your desktop.
    Re-launch Finder by logging out/in and test. If it works okay, delete the plist from the desktop.
    If the same, return the .plist to where you got it  from, overwriting the newer ones.
    If you want to make your user library permanently visible, run the below command in Applications/Terminal.
    chflags nohidden ~/Library/
    You will need to do that after any updates.
    Troubleshooting Wi-Fi issues in OS X
    Wireless Connection Problems - Fix
    Wireless Connection Problems - Fix (2)
    Wireless Connection Problems - Fix (3)
    Wireless Connection Problems - Fix (4)
    Wireless Diagnostics - About

  • SQL performance drops after 20 mins

    Hello,
    I am using Oracle Version 9.2.0.5
    I have an SQL query that starts off fast but the performance drops after running for 20 mins. It continues to drop till a point where it becomes painfully slow.
    The query is as attached below:
    SELECT      /*+ INDEX (abe ASR_I_BID_PRD_TOD_5FAX)
    INDEX (aae ASR_I_AE_RC_BR)
    INDEX (ab ASR_UK_BASES)
    INDEX (aaac ASR_I_AFAC_SP)
    +*/aae.f8_code
    ||','||     aae.sector
    ||','||     aae.ouc
    ||','||     aae.rule_type
    ||','||     aae.base_ref
    ||','||     aae.prodlist_ref
    ||','|| aaac.L101
    ||','|| aaac.L201
    ||','|| aaac.L301
    ||','|| aaac.L401
    ||','|| aaac.L501
    ||','|| aaac.L601
    ||','|| aaac.L701
    ||','|| aaac.L801
    ||','|| aaac.L802
    ||','|| aaac.L830
    ||','|| aaac.L850
    ||','|| aaac.L870
    ||','|| aaac.L901
    ||','|| aaac.L1001
    ||','||     LTRIM(TO_CHAR((aae.disaggregated_amount*abe.percentage*aaac.chain_perc)/10000,'999999999999999.99'))
    FROM asr_owner.asr_account_entries aae
    , asr_owner.asr_base_elements_5fax abe
    , asr_ff_audit_chains aaac
    , asr_owner.asr_bases ab
    WHERE aae.run_code = '5fax'
    AND ab.run_code = aae.run_code
    AND ab.base_type = aaac.base_type
    AND ab.base_id = abe.base_id
    AND ab.base_ref = aae.base_ref
    AND aaac.base_type = 'L'
    AND aaac.business <> 'R'
    AND aae.trans_type IN ('A','C','D')
    AND abe.base_id = aae.base_id
    AND 100*(abe.exhaust_level)+abe.exhaust_sub_level = 101
    AND aaac.start_prod = abe.product
    AND ABS((aae.disaggregated_amount*abe.percentage*aaac.chain_perc)/10000) >= 0.01
    It has huge number of records. I have checked all join conditions and they are all fine.
    asr_owner.asr_account_entries - 3.6 millions rows
    asr_owner.asr_base_elements_5fax - 1.8 million rows
    asr_ff_audit_chains - 5.8 million rows
    asr_owner.asr_bases - 0.5 million rows
    The autotrace and plan are as follows
    Statistics
    0 recursive calls
    0 db block gets
    5264 consistent gets
    3522 physical reads
    0 redo size
    525 bytes sent via SQL*Net to client
    456 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    5 sorts (memory)
    0 sorts (disk)
    0 rows processed
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 83 | 13529 | 12465 |
    | 1 | TABLE ACCESS BY INDEX ROWID | ASR_FF_AUDIT_CHAINS | 83 | 6225 | 617 |
    | 2 | NESTED LOOPS | | 83 | 13529 | 12465 |
    | 3 | NESTED LOOPS | | 1 | 88 | 11848 |
    | 4 | NESTED LOOPS | | 2201 | 113K| 3044 |
    | 5 | TABLE ACCESS BY INDEX ROWID| ASR_BASES | 774 | 13158 | 722 |
    | 6 | INDEX FULL SCAN | ASR_UK_BASES | 104K| | 104 |
    | 7 | TABLE ACCESS BY INDEX ROWID| ASR_ACCOUNT_ENTRIES | 3 | 108 | 3 |
    | 8 | INDEX RANGE SCAN | ASR_I_AE_RC_BR | 8 | | 1 |
    | 9 | TABLE ACCESS BY INDEX ROWID | ASR_BASE_ELEMENTS_5FAX | 1 | 35 | 4 |
    | 10 | INDEX RANGE SCAN | ASR_I_BID_PRD_TOD_5FAX | 1 | | 3 |
    | 11 | INDEX RANGE SCAN | ASR_I_AFAC_SP | 8241 | | 9 |
    Note: cpu costing is off, PLAN_TABLE' is old version
    19 rows selected.
    I have also tried without the hints and the plan looks like
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 83 | 13529 | 679 |
    | 1 | TABLE ACCESS BY INDEX ROWID| ASR_FF_AUDIT_CHAINS | 83 | 6225 | 617 |
    | 2 | NESTED LOOPS | | 83 | 13529 | 679 |
    | 3 | HASH JOIN | | 1 | 88 | 370 |
    | 4 | HASH JOIN | | 2201 | 113K| 208 |
    | 5 | TABLE ACCESS FULL | ASR_BASES | 774 | 13158 | 16 |
    | 6 | TABLE ACCESS FULL | ASR_ACCOUNT_ENTRIES | 12125 | 426K| 191 |
    | 7 | TABLE ACCESS FULL | ASR_BASE_ELEMENTS_5FAX | 18325 | 626K| 161 |
    | 8 | INDEX RANGE SCAN | ASR_I_AFAC_SP | 8241 | | 9 |
    Note: cpu costing is off, PLAN_TABLE' is old version
    16 rows selected.
    I have tried increasing the hash_area_size parameter to 20MB (it is currently 10MB).
    I have tried setting the tuning parameters like optimizer_index_cost_adj but to no success.
    Could you please help.

    Thanks a lot for all the help.
    Here is another query that is running quite slow. Any help on this might be helpful
    EXPLAIN PLAN SET statement_id = 'auditextract' FOR
    SELECT /*+NO_INDEX(aaac)
           NO_INDEX(aae)
           NO_INDEX(abe)
           NO_INDEX(ab)
           NO_INDEX(agp)+*/
         aae.run_code
    ,     aae.f8_code
    ,     aae.sector
    ,     aae.ouc
    ,     aae.rule_type
    ,     aae.base_ref
    ,     aae.prodlist_ref
    ,     aae.trans_type
    ,     aaac.base_type
    ,DECODE(NVL(aaac.exhaust_chain,'NULL'),'NULL',',',NULL)||aaac.exhaust_chain||
      DECODE(NVL(aaac.exhaust_chain,'NULL'),'NULL',NULL,',')||LTRIM(RTRIM(aaac.final_prod))||
                RPAD(',',14-DECODE(aaac.final_level,1001,14,901,13,870,12,850,11,830,10,802,9,801,8,701,7,601,6,501,5,401,4,301,3,201,2,101,1),',') exhaust_chain,
         aaac.final_level     ,
         aaac.business ,
         L101,
         L101_TOD,
         L201,
         L201_TOD,
         L301,
         L301_TOD,
         L401,
         L401_TOD,
         L501,
         L501_TOD,
         L601,
         L601_TOD,
         L701,
         L701_TOD,
         L801,
         L801_TOD,
         L802,
         L802_TOD,
         L830,
         L830_TOD,
         L850,
         L850_TOD,
         L870,
         L870_TOD,
         L901,
         L901_TOD,
         L1001,
         L1001_TOD,
         (aae.disaggregated_amount*abe.percentage*aaac.chain_perc)/10000 money
    FROM   asr_owner.asr_account_entries aae
    ,      asr_owner.asr_base_elements_5fax abe
    ,      asr_owner.asr_bases ab
    ,      ASR_FF_AUDIT_CHAINS aaac
    WHERE  aae.run_code    = '5fax'
    AND    ab.run_code = aae.run_code
    AND    abe.run_code = ab.run_code
    AND    ab.base_type = aaac.base_type
    AND    ab.base_id = abe.base_id
    AND    aaac.base_type = 'L'
    AND    aaac.business = 'R'
    AND    ab.base_ref = aae.base_ref
    AND    aae.trans_type IN ('A','C','D','G','J')
    AND    abe.base_id     = aae.base_id
    AND    abe.exhaust_level = 1
    AND    abe.exhaust_sub_level = 1
    AND    aaac.start_prod = abe.product
    AND    NOT EXISTS (SELECT 1
                        FROM asr_group_prods agp
                        WHERE agp.product_group IN ('SW500','SR500','G176')
                        AND  (aaac.L101 =  agp.product OR
                                  aaac.L201 =  agp.product OR
                                     aaac.L301 =  agp.product OR
                                     aaac.L401 =  agp.product OR
                                     aaac.L501 =  agp.product OR
                                     aaac.L601 =  agp.product OR
                                     aaac.L701 =  agp.product OR
                                     aaac.L801 =  agp.product OR
                                     aaac.L802 =  agp.product OR
                                     aaac.L830 =  agp.product OR
                                     aaac.L850 =  agp.product OR
                                     aaac.L870 =  agp.product OR
                                     aaac.L901 =  agp.product OR
                                     aaac.L1001 =  agp.product))
    AND    abs((aae.disaggregated_amount*abe.percentage*aaac.chain_perc)) >= 100
    PLAN_TABLE_OUTPUT
    | Id  | Operation             |  Name                   | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT      |                         |   571 |   112K|  5586 |
    |*  1 |  FILTER               |                         |       |       |       |
    |*  2 |   HASH JOIN           |                         |   571 |   112K|  5586 |
    |*  3 |    HASH JOIN          |                         |    53 |  5406 |   370 |
    |*  4 |     HASH JOIN         |                         |  2974 |   177K|   178 |
    |*  5 |      TABLE ACCESS FULL| ASR_BASES               |   770 | 15400 |    16 |
    |*  6 |      TABLE ACCESS FULL| ASR_BASE_ELEMENTS_5FAX  | 26178 |  1048K|   161 |
    |*  7 |     TABLE ACCESS FULL | ASR_ACCOUNT_ENTRIES     | 17739 |   710K|   191 |
    |*  8 |    TABLE ACCESS FULL  | ASR_FF_AUDIT_CHAINS     |   126K|    12M|  5215 |
    |*  9 |   TABLE ACCESS FULL   | ASR_GROUP_PRODS         |     1 |    10 |     2 |
    Predicate Information (identified by operation id):
       1 - filter( NOT EXISTS (SELECT /*+ */ 0 FROM "ASR_GROUP_PRODS" "AGP" WHERE
                  ("AGP"."PRODUCT_GROUP"='G176' OR "AGP"."PRODUCT_GROUP"='SR500' OR
                  "AGP"."PRODUCT_GROUP"='SW500') AND ("AGP"."PRODUCT"=:B1 OR "AGP"."PRODUCT"=:B2
                  OR "AGP"."PRODUCT"=:B3 OR "AGP"."PRODUCT"=:B4 OR "AGP"."PRODUCT"=:B5 OR
                  "AGP"."PRODUCT"=:B6 OR "AGP"."PRODUCT"=:B7 OR "AGP"."PRODUCT"=:B8 OR
                  "AGP"."PRODUCT"=:B9 OR "AGP"."PRODUCT"=:B10 OR "AGP"."PRODUCT"=:B11 OR
                  "AGP"."PRODUCT"=:B12 OR "AGP"."PRODUCT"=:B13 OR "AGP"."PRODUCT"=:B14)))
       2 - access("SYS_ALIAS_14"."START_PROD"="ABE"."PRODUCT")
           filter(ABS("AAE"."DISAGGREGATED_AMOUNT"*"ABE"."PERCENTAGE"*"SYS_ALIAS_14".
                  "CHAIN_PERC")>=100)
       3 - access("AB"."BASE_REF"="AAE"."BASE_REF" AND
                  "ABE"."BASE_ID"="AAE"."BASE_ID")
       4 - access("AB"."BASE_ID"="ABE"."BASE_ID")
       5 - filter("AB"."RUN_CODE"='5fax' AND "AB"."BASE_TYPE"='L')
       6 - filter("ABE"."RUN_CODE"='5fax' AND "ABE"."EXHAUST_LEVEL"=1 AND
                  "ABE"."EXHAUST_SUB_LEVEL"=1)
       7 - filter("AAE"."RUN_CODE"='5fax' AND ("AAE"."TRANS_TYPE"='A' OR
                  "AAE"."TRANS_TYPE"='C' OR "AAE"."TRANS_TYPE"='D' OR "AAE"."TRANS_TYPE"='G' OR
                  "AAE"."TRANS_TYPE"='J'))
       8 - filter("SYS_ALIAS_14"."BASE_TYPE"='L' AND "SYS_ALIAS_14"."BUSINESS"='R')
       9 - filter(("AGP"."PRODUCT_GROUP"='G176' OR "AGP"."PRODUCT_GROUP"='SR500' OR
                  "AGP"."PRODUCT_GROUP"='SW500') AND ("AGP"."PRODUCT"=:B1 OR "AGP"."PRODUCT"=:B2
                  OR "AGP"."PRODUCT"=:B3 OR "AGP"."PRODUCT"=:B4 OR "AGP"."PRODUCT"=:B5 OR
                  "AGP"."PRODUCT"=:B6 OR "AGP"."PRODUCT"=:B7 OR "AGP"."PRODUCT"=:B8 OR
                  "AGP"."PRODUCT"=:B9 OR "AGP"."PRODUCT"=:B10 OR "AGP"."PRODUCT"=:B11 OR
                  "AGP"."PRODUCT"=:B12 OR "AGP"."PRODUCT"=:B13 OR "AGP"."PRODUCT"=:B14))
    Note: cpu costing is off
    47 rows selected.

  • Kill session script error

    Hello,
    I have create kill session script but while execute getting error. find the below scripts.
    (script name is t.sh)
    sqlplus -s '/as sysdba' << EOF
    alter user test account lock;
    spool kill_session.sql
    set heading off;
    select 'alter system kill session ' || '''' || sid || ',' || serial# || '''' || ' immediate;' from v$session
    where username ='TEST';
    spool off;
    *@$ORACLE_HOME/scripts/kill_session.sql*
    EOF
    Error:_
    *[oracle@indpund0201 scripts]$ ./t.sh*
    User altered.
    select 'alter system kill session ' || '''' || sid || ',' || serial# || '''' || ' immediate;' from v
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Please suggest.

    RK wrote:
    select 'alter system kill session ' || '''' || sid || ',' || serial# || '''' || ' immediate;' from v$session
    where username ='TEST';
    The $ character has a special meaning in shell scripting. The shell will read it as follows:
    .. from v${session}
    where:
      $session = environment variableAs there is no such variable the code will be parsed as follows:
    .. from vAnd thus result in the following error (table/object called v does not exist):
    select 'alter system kill session ' || '''' || sid || ',' || serial# || '''' || ' immediate;' from v
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Solution - escape the $ character as follows:
    .. from v\$sessionIt should work...

Maybe you are looking for

  • Connecting HP Laserjet 500N using ethernet cable and router

    I had my HP Laserjet 5000N connected to my wireless router via ethernet cable. It worked fine. But then I changed routers and can't remember how to reestablish the connect.  Can anyone help? Thanks

  • Serialization hierarchy without install base?

    Hi, all. Is it possible to create parent / child serialization linkage in SAP without employing an install base or linking them manually using COIB? We're trying to see an "as built" structure and not having any luck.  We're creating a custom report,

  • How to get the attribute of the xml tag

    I have the following xml file Example.xml <?xml version="1.0" encoding="iso-8859-1"?> <html><set label="09/07/29" value="1241.90"/> </html> Can any one help me in parsing this xml file I want to retrive the attribute values of the tag set Example I w

  • Record TV?

    is it possible to record a TV show onto the macbook pro? I just need to record about 15 minutes. How would i do this?

  • Poner calendario en labview para programar fechas de medición

    Hola, quisiera saber si es posible poner un calendario en el panel frontal de un vi, en el que al elegir alguna fecha esta se muestre en una tabla, esto con la finalidad de hacer la programación de la fecha y hora de inicio y de fin una medición de d