ALTER SESSION in sql script produces strange results

Why would "alter session set NLS_DATE_FORMAT" interfere with the operation of a sql script?
First, the script without the ALTER SESSION:
SQL> !cat doit1.sql
--alter session set NLS_DATE_FORMAT = "DD-MON-YYYY"
set pagesize 99
set trimspool on
col BIRTH_MONTH for a11
break on BIRTH_MONTH skip 1
spo doit.txt
prompt My Membership
set feedback off heading off
select 'As of ' || sysdate from dual;
set heading on
select count(*) from dual;
spool offAnd its execution:
SQL> @doit1
My Membership
As of 14-JAN-10
  COUNT(*)
1All's well with the world. Now let's throw in the ALTER SESSION:
SQL> !cat doit2.sql
alter session set NLS_DATE_FORMAT = "DD-MON-YYYY"
set pagesize 99
set trimspool on
col BIRTH_MONTH for a11
break on BIRTH_MONTH skip 1
spo doit.txt
prompt My Membership
set feedback off heading off
select 'As of ' || sysdate from dual;
set heading on
select count(*) from dual;
spool offAnd its execution
SQL> @doit2
set pagesize 99
ERROR at line 2:
ORA-00922: missing or invalid option
  COUNT(*)
1
not spooling currently
SQL> Doesn't like the SET commands (I've played around with serveral, it doesn't like any of them) and ignores the opening SPOOL command
I first noticed this with a 10.2.0.1 client (windows) connected to a 10.2.0.4 database (HP-UX). Confirmed on my laptop VM lab, 10.2.0.4 under OEL5, client and db on same VM.

Chris Poole wrote:
You're just missing the trailing ';' at the end of the alter session line. Add this, it all works.DOH! (in my best Homer Simpson imitation!)

Similar Messages

  • Ability to perform ALTER SESSION SET SQL TRACE but not all alter clauses

    I see that in order to run the ALTER SESSION SET SQL TRACE command, the user should be explicitly granted alter session privilege as the CREATE SESSION privilege alone is not enough. Is there a way to grant the ability to perform ALTER SESSION SET SQL TRACE but not the other clauses such as GUARD, PARALLEL & RESUMABLE?.
    Thanks
    Sathya

    If you are using Oracle 10g and above, you can use DBMS_SESSION.session_trace_enable procedure,
    it doesn't require alter session system privilege.
    Simple example:
    SQL> connect test/test@//192.168.1.2:1521/xe
    Connected.
    SQL> alter session set tracefile_identifier='my_id';
    Session altered.
    SQL> alter session set sql_trace = true
      2  ;
    alter session set sql_trace = true
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> execute dbms_session.session_trace_enable;
    PL/SQL procedure successfully completed.
    SQL> select * from user_sys_privs;
    USERNAME                 PRIVILEGE                    ADM
    TEST                      CREATE PROCEDURE                NO
    TEST                      CREATE TABLE                    NO
    TEST                      CREATE SEQUENCE                    NO
    TEST                      CREATE TRIGGER                    NO
    TEST                      SELECT ANY DICTIONARY               NO
    TEST                      CREATE SYNONYM                    NO
    TEST                      UNLIMITED TABLESPACE               NO
    7 rows selected.
    SQL> execute dbms_session.session_trace_disable;
    PL/SQL procedure successfully completed.
    SQL> disconnect
    Disconnected from Oracle Database 10g Release 10.2.0.1.0 - Productionand here is result from tkprof:
    TKPROF: Release 10.2.0.1.0 - Production on So Paź 23 00:53:07 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Trace file: xe_ora_176_my_id.trc
    ( ---- cut ---- )
    select *
    from
    user_sys_privs
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.08       0.08          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           0
    Fetch        2      0.01       0.01          0         15          0           7
    total        4      0.09       0.09          0         15          0           7
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 61 
    Rows     Row Source Operation
          7  HASH GROUP BY (cr=15 pr=0 pw=0 time=11494 us)
          7   CONCATENATION  (cr=15 pr=0 pw=0 time=4913 us)
          0    MERGE JOIN CARTESIAN (cr=4 pr=0 pw=0 time=1169 us)
          0     NESTED LOOPS  (cr=4 pr=0 pw=0 time=793 us)
          0      TABLE ACCESS FULL SYSAUTH$ (cr=4 pr=0 pw=0 time=592 us)
          0      INDEX RANGE SCAN I_SYSTEM_PRIVILEGE_MAP (cr=0 pr=0 pw=0 time=0 us)(object id 312)
          0     BUFFER SORT (cr=0 pr=0 pw=0 time=0 us)
          0      TABLE ACCESS FULL USER$ (cr=0 pr=0 pw=0 time=0 us)
          7    NESTED LOOPS  (cr=11 pr=0 pw=0 time=3429 us)
          9     HASH JOIN  (cr=9 pr=0 pw=0 time=2705 us)
          9      TABLE ACCESS FULL SYSAUTH$ (cr=4 pr=0 pw=0 time=512 us)
         63      TABLE ACCESS FULL USER$ (cr=5 pr=0 pw=0 time=914 us)
          7     INDEX RANGE SCAN I_SYSTEM_PRIVILEGE_MAP (cr=2 pr=0 pw=0 time=510 us)(object id 312)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      SQL*Net message to client                       2        0.00          0.00
      SQL*Net message from client                     2       20.64         20.65
    BEGIN dbms_session.session_trace_disable; END;
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.01       0.00          0          0          0           0
    Execute      1      0.00       0.00          0          0          0           1
    Fetch        0      0.00       0.00          0          0          0           0
    total        2      0.01       0.00          0          0          0           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 61 

  • SQL Query produces different results when inserting into a table

    I have an SQL query which produces different results when run as a simple query to when it is run as an INSERT INTO table SELECT ...
    The query is:
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      The INSERT INTO code:
    TRUNCATE TABLE applicant_summary;
    INSERT /*+ APPEND */
    INTO     applicant_summary
    (  account_number
    ,  main_borrower_status
    ,  num_apps
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      When run as a query, this code consistently returns 2 for the num_apps field (for a certain group of accounts), but when run as an INSERT INTO command, the num_apps field is logged as 1. I have secured the tables used within the query to ensure that nothing is changing the data in the underlying tables.
    If I run the query as a cursor for loop with an insert into the applicant_summary table within the loop, I get the same results in the table as I get when I run as a stand alone query.
    I would appreciate any suggestions for what could be causing this odd behaviour.
    Cheers,
    Steve
    Oracle database details:
    Oracle Database 10g Release 10.2.0.2.0 - Production
    PL/SQL Release 10.2.0.2.0 - Production
    CORE 10.2.0.2.0 Production
    TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    Edited by: stevensutcliffe on Oct 10, 2008 5:26 AM
    Edited by: stevensutcliffe on Oct 10, 2008 5:27 AM

    stevensutcliffe wrote:
    Yes, using COUNT(*) gives the same result as COUNT(1).
    I have found another example of this kind of behaviour:
    Running the following INSERT statements produce different values for the total_amount_invested and num_records fields. It appears that adding the additional aggregation (MAX(amount_invested)) is causing problems with the other aggregated values.
    Again, I have ensured that the source data and destination tables are not being accessed / changed by any other processes or users. Is this potentially a bug in Oracle?Just as a side note, these are not INSERT statements but CTAS statements.
    The only non-bug explanation for this behaviour would be a potential query rewrite happening only under particular circumstances (but not always) in the lower integrity modes "trusted" or "stale_tolerated". So if you're not aware of any corresponding materialized views, your QUERY_REWRITE_INTEGRITY parameter is set to the default of "enforced" and your explain plan doesn't show any "MAT_VIEW REWRITE ACCESS" lines, I would consider this as a bug.
    Since you're running on 10.2.0.2 it's not unlikely that you hit one of the various "wrong result" bugs that exist(ed) in Oracle. I'm aware of a particular one I've hit in 10.2.0.2 when performing a parallel NESTED LOOP ANTI operation which returned wrong results, but only in parallel execution. Serial execution was showing the correct results.
    If you're performing parallel ddl/dml/query operations, try to do the same in serial execution to check if it is related to the parallel feature.
    You could also test if omitting the "APPEND" hint changes anything but still these are just workarounds for a buggy behaviour.
    I suggest to consider installing the latest patch set 10.2.0.4 but this requires thorough testing because there were (more or less) subtle changes/bugs introduced with [10.2.0.3|http://oracle-randolf.blogspot.com/2008/02/nasty-bug-introduced-with-patch-set.html] and [10.2.0.4|http://oracle-randolf.blogspot.com/2008/04/overview-of-new-and-changed-features-in.html].
    You could also open a SR with Oracle and clarify if there is already a one-off patch available for your 10.2.0.2 platform release. If not it's quite unlikely that you are going to get a backport for 10.2.0.2.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Mathscript contourf function produces strange results

    the code "contourf(magic(8))" typed into the mathscripts window produces a different result from the same single line in matlab.  The resolution and colormap differences don't bother me, but the line fragments are clearly incorrect.  This is a simple example of a problem I'm having in my data.  Further, if I'd like to plot the contour line myself, the "hold on" function does not seem to work with the contour.  Any help would be much appreciated.  A simple example demonstrating both problems:
    clf
    colormap(jet)
    contourf(magic(8));
    hold on
    plot(1:8,1:8,'r*')
    shg
    piyrwq
    Attachments:
    matlabmagic8.jpg ‏35 KB
    mathscriptsmagic8.jpg ‏143 KB

    Hello,
    I have looked into this issue some more.  I talked to the developer who wrote the colormap function and it turns out we do have all the colormaps.  However, their use is not documented.  They are passed to the function as an option, e.g. colormap('jet').
    In addition, the order of calls matters.  The colormap only applies to the current plot.  If you generate a new one, the colormap disappears.  Consequently, reverse the order of your colormap and contourf calls as follows:
    contourf(magic(8));
    colormap('jet')
    Grant M.
    Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments

  • Masks not working, producing strange results?...

    Hello, I'm having problems with an animated mask.
    I have a leg graphic (contains 3 tweened leg pieces), and then a gradient.
    In the editor they behave how they should, properly masking the leg. However
    the SWF output produces some crazy results shown below:
    I've tried setting both as movieclips, using the "Layer" blend mode on the leg, using leg.mask = legMask;
    but whatever I try produces the exact same result.
    Any ideas?
    Thanks!

    It sounds like you've applied the Blur filter to the mask instead of the object the Mask is applied to.
    This will blur the masked footage:
    GROUP
         Footage copy
              Mask
              Gaussian Blur
         Footage
    This will blur the edges of the mask:
    GROUP
         Footage copy
              Mask
                   Gaussian Blur
         Footage
    Hope that helps.

  • Exporting to Quicktime produces strange results

    Greetings:
    I have been working on a fairly large project in FCE for many months. I am finally ready to export to burn onto a DVD but am having some strange problems. Although everything looks fine within FCE, when exported to a Quicktime movie as either a self-contained movie or as a reference file, the movie is not plating properly. Specifically, there are problems with images that I have animated using keyframes and with some transitions between images using cross dissolve.
    There are no problems with the video or sound, only when still images are involved in some fashion or another.
    Does anyone have any experience with this issue? Does anyone have a suggestion for a fix?
    Thanks in advance for any help...

    A couple of different problems.
    The first is as follows:
    I have an image in one video track. Using keyframe animation the image slides across the screen, stops and then fills the screen The underlying videotrack is a movie interview that I conducted. In FCE, all looks as it should. Once exported as a Quicktime movie, the image is transparent, allowing the underlying clip to be seen and the image seems to be appearing in duplicate. One image overlying another with the images being of different sizes and not matching the keyframes I used.
    The other problem relates to a photo montage that I did. I recreated the 'Ken Burns effect' using key frames and added cross dissolve transitions between photos. Again, in FCE all appears as it should but in Quicktime, some images are again duplicated and move in ways not defined by me, transitions flicker or flash and occasionally the images appear very dark.
    Does this help you help me?

  • Unable to upload sql scripts in oracle database express edition 10g

    Hi!
    To start, I inform you that I am beginner with Oracle. I installed Oracle 10g Express Edition on my Ubuntu 9.10 like this:
    :~$ dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb
    :~$ /etc/init.d/oracle-xe configure
    and I keep default value. Then I go on http://127.0.01:8080/apex, I login with system account, I create another dba account etc ... all looks very well ! Then I follow this tutorial: http://st-curriculum.oracle.com/tutorial/DBXETutorial/index.htm
    and I am unable to load sql script which is given in this tutorial: load_sample.sql (page:What to do first> Loading Data). I try with a little sql script and same result. I use gedit with UTF-8 and load in UTF-8, my browser is Firefox (I try with Epiphany also).
    The result is: when I upload a script, The browser returns "script uploaded." Then I can click on my script but the file is empty ! Nothing is done when i click on "run". Also I can' create a script; With Epiphany browser, the frame to write is all red. To import a script I have to copy one by one request in sql commands. I try also to change the owner of load_sample.sql:
    -rw-r--r-- 1 oracle dba 49969 2010-01-10 12:05 load_sample.sql
    But it doesn't work. If someone has an idea ? Thanks for your help.
    regards
    Alex.
    load_sample.sql:
    CREATE TABLE regions
    ( region_id NUMBER
    CONSTRAINT region_id_nn NOT NULL
    , region_name VARCHAR2(25)
    CREATE UNIQUE INDEX reg_id_pk
    ON regions (region_id);
    ALTER TABLE regions
    ADD ( CONSTRAINT reg_id_pk
    PRIMARY KEY (region_id)
    ) ;

    Hi,
    So, go to shell ,position yourself in the path where load_sample.sql is, login to the XE as the user with whom you need to run load_sample.sql , and execute
    +@load_sample.sql.+
    Sorry to hijack this thread but I am having exactly the same problem in Ubuntu, it seems as if IE is the only browser that allows you to do this, but installing that in Ubuntu looks like a whole other world of pain I do not really want to get involved in at the moment.
    I like the sound of just shortcutting the sql upload through the shell but I'm a beginner and I do not understand your comment well enough to implement it myself.
    Could you please explain these in more granular layman's terms for someone who is unfamiliar with Linux syntax?
    By 'Shell' do you mean the Terminal or the SQL Command Line? What exactly should I be typing in there to execute the sql?
    I have saved the SQL file on my desktop (jon@jon-pc, it's a virtual Ubuntu machine on a Windows Vista host).
    Thanks in advance
    Jon

  • Unable to load sql script which is given in this tutorial: load_sample.sql

    Hi!
    To start, I inform you that I am beginner with Oracle. I installed Oracle 10g Express Edition on my computer(O/S: window xp)
    Then I go on http://127.0.0.1:8080/apex/f?p=4550:9:4181329966856697::NO:::, I login with system account, I create another dba account etc ... all looks very well ! Then I follow this tutorial: http://st-curriculum.oracle.com/tutorial/DBXETutorial/index.htm
    and I am unable to load sql script which is given in this tutorial: load_sample.sql (page:What to do first> Loading Data). I try with a little sql script and same result. I use gedit with UTF-8 and load in UTF-8, my browser is Firefox .
    The result is: when I upload a script, The browser returns "script uploaded." Then I can click on my script but the file is empty ! Nothing is done when i click on "run". Also I can' create a script. To import a script I have to copy one by one request in sql commands. I try also to change the owner of load_sample.sql:
    But it doesn't work. If someone has an idea ? Thanks for your help.
    regards
    meraj

    Problem Solved.
    When I switched default browser from mozilla firefox to ie(internet explorer) the problem is solved i got this from forum post (Script Editor Not Working
    But still i want to know why "load_sample.sql" is not run with the default browser(mozilla firefox).

  • Kill the session Using Pl/sql Script

    Hi,
    I wrote a PL/SQL Script which kills the Specified Schema name..... the Script Run Successfully i got this output message "PL/SQL procedure successfully completed." But the Problem is in session status the status is in KILLED" state for more than 30 minutes.
    Please Advice Why the Session in Killed State for more than 30 minutes and please tell me how to kill the session immediate;
    I am Using Oracle DB 11g R1 and OS is Windows 2003 Server R2
    My Pl/sql Script
    SET SERVEROUTPUT ON;
    DECLARE
    KILLER1 V$SESSION.SID%TYPE;
    KILLER2 V$SESSION.SERIAL#%TYPE;
    CURSOR KILL_SESSION IS SELECT SID,SERIAL# FROM V$SESSION WHERE SCHEMANAME='NAME';
    BEGIN
    OPEN KILL_SESSION;
    LOOP
    FETCH KILL_SESSION INTO KILLER1,KILLER2;
    EXIT WHEN KILL_SESSION%NOTFOUND;
    DBMS_OUTPUT.put_line ('ALTER SYSTEM KILL SESSION '''||KILLER1||','||KILLER2||''' IMMEDAITE');
    EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION'||chr(39)||KILLER1||','||KILLER2||chr(39);
    END LOOP;
    IF (KILLER1 > 0)
    THEN
    EXECUTE IMMEDIATE 'ALTER SYSTEM KILL SESSION'||chr(39)||KILLER1||','||KILLER2||chr(39);
    END IF;
    CLOSE KILL_SESSION;
    END;
    Thank You
    Shan

    Hello,
    In fact you may use orakill it's an Oracle utility for Windows so as to Kill the thread corresponding
    to the session.
    It's equivalent to a kill -9 on Unix.
    Please find here a link about the use of orakill:
    http://articles.techrepublic.com.com/5100-10878_11-5224960.html
    Hope this help.
    Best regards,
    Jean-Valentin
    Edited by: Lubiez Jean-Valentin on Mar 27, 2010 5:17 PM

  • Altering session variable from PL/SQL

    Does any one have an idea what's wrong with this code, or any suggestion how to perform similar operation.
    I am trying to set my timezone using
    declare
    local_timezone TIMESTAMP WITH LOCAL TIME ZONE;
    begin
    DBMS_UTITLITY.EXEC_DDL_STATEMENT ('Alter Session Set TIME_ZONE = ' || '''' || 'GMT' || '''');
    local_timezone := systimestamp;
    dbms_output.put_line ('Time is : ' || local_timezone);
    end;
    This seems to work since no error is produced but does not set requested timezone. I still get local time.
    Any suggestion.
    Very Urgent.. Thanks for feedback in advance.

    Hi,
    I am trying to get the parameter from pg1(OAPage) to pg2(web pl/sql page) but i can't do it ...
    The link OAPage is :OA_HTML/OA.jsp?_rc=HR_P_RATE_TOP_SS&_ri=800&OAFunc=HR_NEWHIRE_SS&_ti=713401982&retainAM=Y&addBreadCrumb=N&dialogAction=NEXT&oapc=11...
    here i need to pass _ti, retainAM and other parameters to web pl/sql procedure.
    i can't decalare a procedure staring ti like procedure(ti varchar2) coz while executing i am getting error... if i do with this procedure(ti varchar2) i am unable to get _ti parameter in web pl/sql.
    i can get the value of ti from the table(ICXTransactions,icx_sessions) but this is not the feasible to do.
    what is the expansion of parameter &oapc and &oas...
    Please Help....

  • Strange symbols appear on my desktop, producing even stranger results!

    Strange symbols appear on my desktop, producing even stranger results!

    These symbols are for short cuts. could be a command to move text insertion point to beginning of document or if you have been in system preferences keyboard and clicked on the modifier key and set one of the options it would be for setting cap lock. Don't know why you are showing a screen  shot of it. Have you clicked on it. Have you been doing any work with documents. You could go to disk utilities and repair permissions or do an pram reset. Command/Option?P/R while holding down the power button for three chimes and release.

  • RMAN-10006: error running SQL statement: alter session set remote_dependenc

    Backups are failing with following error
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-12001: could not open channel default
    RMAN-10008: could not create channel context
    RMAN-10002: ORACLE error: ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must be from among MANUAL, AUTO
    RMAN-10006: error running SQL statement: alter session set remote_dependencies_mode = signature
    Not able to change to signature
    SQL> alter session set remote_dependencies_mode=signature;
    ERROR:
    ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must
    be from among MANUAL, AUTO
    I dont see MANUAL or AUTO as valid value for this parameter (http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1175.htm#1023124) DB version is 9.2.0
    Parameter type
    String
    Syntax
    REMOTE_DEPENDENCIES_MODE = {TIMESTAMP | SIGNATURE}
    Default value
    TIMESTAMP
    Parameter class
    Dynamic: ALTER SESSION, ALTER SYSTEM
    =======================================
    I believe it could be because of following bug
    "A PRE-PATCHED ORACLE IMAGE CAN BE INSTALLED IN MEMORY "
    Refer: "https://metalink2.oracle.com/metalink/plsql/f?p=130:15:1613505143885559758::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4610411,1,1,1,helvetica"
    I appreciate your effort in fixing this issue.
    Edited by: user10610722 on Nov 25, 2008 4:37 PM

    Hi:
    It seems when you are starting RMAN it's executing some commands (one 'ALTER SESSION...'. It's seems to be a batch which has a bad value for SORT_AREA_SIZE. Find it and modify to a proper value as message shows. If you can't find start RMAN by calling directly the executable ($ORACLE_HOME/bin/rman or %ORACLE_HOME%/bin/rman.exe).

  • Execute immediate 'alter session set current_schema = ' failed in PL/SQL

    Hi
    I am trying to run
    EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = TEST ' ;
    in a pl/sql block but it is failing.Can anyone update me on this.
    CREATE OR REPLACE PROCEDURE test3
    IS
    A_COUNT NUMBER(15);
    BEGIN
    EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = TEST ' ;
    SELECT COUNT(*) INTO A_COUNT FROM (
    select id from solutions );
    END;
    /

    The user who owns the procedure needs to be granted direct select rights on table test.solutions (not via a role). Still will not help. Look what OP is trying to do. In a stored procedure owned by some user (other than TEST) OP is trying to reference user TEST owned table solution without prefixing it with owner. Something like:
    SQL> create table u1.test_tbl(x number);
    Table created.
    SQL> select * from test_tbl;
    select * from test_tbl
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> alter session set current_schema = U1;
    Session altered.
    SQL> select * from test_tbl;
    no rows selected
    SQL> However, OP tries to do it in a SP using dynamic SQL to change current schema to test. Such change will occur when SP will be executed, not when is it compiled. At compile time we are still under SP owner's schema and therefore select from solutions implies table solutions owned by SP owner, not by TEST. The only way to make SP compile and work OK is to select from solutions also dynamically:
    SQL> select sys_context('userenv','current_schema') from dual
      2  /
    SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    SCOTT
    SQL> CREATE OR REPLACE PROCEDURE test3
      2  IS
      3  A_COUNT NUMBER(15);
      4  BEGIN
      5  EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = U1' ;
      6  SELECT COUNT(*) INTO A_COUNT FROM (
      7  select x from test_tbl );
      8  END;
      9  /
    Warning: Procedure created with compilation errors.
    SQL> sho err
    Errors for PROCEDURE TEST3:
    LINE/COL ERROR
    6/1      PL/SQL: SQL Statement ignored
    7/15     PL/SQL: ORA-00942: table or view does not exist
    SQL> set serveroutput on
    SQL> CREATE OR REPLACE PROCEDURE test3
      2  IS
      3  A_COUNT NUMBER(15);
      4  c sys_refcursor;
      5  BEGIN
      6  EXECUTE IMMEDIATE 'ALTER SESSION SET CURRENT_SCHEMA = U1' ;
      7  OPEN C FOR 'SELECT COUNT(*) FROM (select x from test_tbl )';
      8  FETCH c INTO A_COUNT;
      9  dbms_output.put_line(a_count);
    10  CLOSE c;
    11  END;
    12  /
    Procedure created.
    SQL> insert into u1.test_tbl select rownum from emp;
    14 rows created.
    SQL> exec test3
    14
    PL/SQL procedure successfully completed.
    SQL> Obviously, as you noted SP owner must have directly granted select on test3.solutions.
    SY.

  • FDM Mapping script produces result #script

    Hello,
    I am trying to use the following mapping script and instead of getting the result defined in the script it is producing the result #script. It is as if it is taking that as the target rather than processing the script. Has anyone else seen this behavior in FDM?
    strTrgAcct = varValues(14)
    Select Case strTrgAcct
    Case "100900","100925","101310","201690","201700"
    Result = "010"
    Case "104200", "104300", "104500", "104700", "104800", "104900", _
    "105000", "105200", "105300", "105450"
    Result = "060"
    Case "107300"
    Result = "210"
    Case Else
    Result = "[None]"
    End Select

    Hello,
    If you are sure that all the columns are filled out correctly and there is nothing in your user error log; I would then suggest you create an SR to have an engineer review it.
    Thank you,

  • SQL job running DTEXEC.EXE via PowerShell step produces wrong characters in result tables. Running the same DTEXEC.EXE in PowerShell x86 window produces correct results.

    I've created a package in SSDT (Visual Studio 2012) to import DBF tables into MSSQL 2014 via a wizard.
    Source DBF files contain tables with Russian (Cyrillic) characters in records fields.
    Created package works fine, produces correct results (imports Cyrillic characters as needed) while:
    •debugging in VS2012
    •deploying package in SSISDB and running the package via PowerShell x86:
    &"c:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\DTExec.exe" /Server "server\mssql2014" /ISServer "\SSISDB\import\Integration Services Project16\Package1.dtsx";
    But when I create a SQL Agent job with a single PowerShell step that contains the same command and run the job it produces wrong characters in resulting tables. So, the problem is in wrong code page (or encoding). The correct tables with records are
    produced and job runs without errors.
    I tried
    chcp 1251; # 855, 866 -- all of them
    &"c:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\DTExec.exe" /Server "server\mssql2014" /ISServer "\SSISDB\import\Integration Services Project16\Package1.dtsx";
    in SQL Agent PowerShell step, but with no positive result.
    Anyone encountered such a behavior? How to fix it?
    v

    What if you run this package without PowerShell?
    Arthur My Blog

Maybe you are looking for

  • Subreport data use to group Values in Main Report

    Hello, I create a Subreport in my header to calculate values, the formula is based on a specific sorting and comparison of previous values. In my main report I need to Group my values depending on the result. Because the group I will made on the Main

  • Export panel bridge cs5 - image quality only to 10

    Hi Is anyone else having problems with the image quality settings in the image options.  It cannot seem to save the max setting of 12 it only save jpegs at 10. Any suggestions,  Thanks Andy

  • Ipod Nano & Iphone on same Mac

    How can I create a 2nd library on itunes for my wife's new ipod nano that will conflict with my iphone account? She wants different music and selections than mine.

  • Cutover Activities for Upgrade Project

    Experts What are the cutover support activities for the administration of the ECC 6.0 (SAP) upgrade project. Also please do let me know how to prepare cutover strategy , and how do we develp cutover plans. Regards, Mahesh

  • CS5.5 Premiere export to Quicktime

    I have been trying to export to Quicktime .mov files in bothCS5.5 Premiere Pro and After Effects and keep getting popups that the files are unrecognizable in any player.  Is there a bug here?  I run Windows Vista, 64bit, AMD 3.2 Quad core, 8GB Ram Th