Controversy regarding "restricted session" mode

Hi,
I am preparing for OCP (DBA F1) exams and have read couple of books for that. But found the following quite controversial.
One book states that, The OSOPER and SYSOPER privilege enables you to change database access to "restricted session" mode.
While another book states that only SYSDBA privilege enables you to change database access to "restricted session" mode.
Same is the case with "alter database backup controlfile" and "alter database [begin | end] backup".
I am quite confused because of this controversy and was wondering what should I do if I encounter a question regarding this in my exams.
Please guide.
latin.

With sysoper privileges (enabled by way of OSOPER os group, or some other way) on a 9.2 system I could do 'startup restrict' but were not allowed to use alter system enable/disable restricted session commands. In fact no alter system ... command, since this would require the system privilege 'alter system'.
Sysoper authorization allows alter database backup controlfile to...
What can we learn from this? When learning the database, you should practice on it! Not only when you're feeling confused. Try a lot. If you think it is easy enough not to try it, you are probably missing something. Practice also let's you pick up goodies along the way.
Good luck with the exam! :)

Similar Messages

  • Detecting Restricted Session mode

    Hi,
    We are using the RESTRICTED SESSION mode to disable logins during batch runs and backup. We are using JDBC-connection pools for web services.
    Since these pools remain connected, no ORA-01035 will be raised when a connection is taken from the pool. It's not a new login.
    Is there a way to detect RESTRICTED SESSION mode (eg. by queying a DBA-view)?
    Greets,
    Roel

    SQL> select logins from v$instance;
    LOGINS
    RESTRICTED

  • 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

  • DMU 2.0 Disable Restricted session

    I've just run a conversion from win-1252 to al32utf8 and we noticed that restricted session was not disabled after the conversion had finished. Is this is known bug? I shut the GUI down before I noticed, but there is nothing in the dmu0.log to show that this was attempted.
    On dmu1.1 and 1.2 This was never an issue - the conversion would finish disable restricted session: e.g.
    18.14:22:28:764;V003;T;05000 SQL text is UPDATE SYSTEM.DUM$COLUMNS DC SET DC.DCCS_ID = 0 WHERE DC.DCCS_ID > 0;
    18.14:22:28:764;V002;T;05000 SQL text is ALTER SYSTEM DISABLE RESTRICTED SESSION;
    18.14:22:28:811;V003;T;05000 SQL text is UPDATE system.dum$sqltext SET time_end=SYS_EXTRACT_UTC(systimestamp), sqlcode=0 WHERE step# = 560 AND obj#= 0 AND order# = 563;
    18.14:22:29:061;V002;T;05000 SQL text is UPDATE system.dum$sqltext SET time_end=SYS_EXTRACT_UTC(systimestamp), sqlcode=0 WHERE step# = 560 AND obj#= 0 AND order# = 564;
    18.14:22:29:452;V001;T;05000 SQL text is UPDATE system.dum$sqltext SET time_end=SYS_EXTRACT_UTC(systimestamp), sqlcode=0 WHERE step# = 560 AND obj#= 284929 AND order# = 562;
    18.14:22:29:483;V000;F;45010 Thread 2, connection 2 finished converting post-conversion POST_CONVERSION, and elapsed time is 00:00:00.406.
    18.14:22:29:483;V000;C;05007 About to close connection to jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=xxx))).
    18.14:22:29:483;V000;T;05000 SQL text is SELECT USERENV('SID') FROM DUAL;
    18.14:22:29:499;V000;T;05000 SQL text is SELECT s.SERIAL# from v$session s where s.sid = (SELECT USERENV('SID') FROM DUAL);
    18.14:22:29:499;V000;C;05006 Connection ID is 2, session ID is 2840, serial number is 439.
    18.14:22:29:514;V000;C;00001 Disconnected successfully from jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=xxx))).
    18.14:22:29:514;V000;F;45010 Thread 3, connection 3 finished converting post-conversion POST_CONVERSION, and elapsed time is 00:00:00.156.
    18.14:22:29:514;V000;C;05007 About to close connection to jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=xxx))).
    18.14:22:29:514;V000;T;05000 SQL text is SELECT USERENV('SID') FROM DUAL;
    18.14:22:29:514;V000;T;05000 SQL text is SELECT s.SERIAL# from v$session s where s.sid = (SELECT USERENV('SID') FROM DUAL);
    18.14:22:29:530;V000;C;05006 Connection ID is 3, session ID is 3, serial number is 13.
    18.14:22:29:546;V000;C;00001 Disconnected successfully from jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521))(CONNECT_DATA=(UR=A)(xxx))).
    18.14:22:29:546;V000;F;45010 Thread 1, connection 1 finished converting post-conversion POST_CONVERSION, and elapsed time is 00:00:00.781.
    18.14:22:29:546;V000;C;05007 About to close connection to jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=xxx))).
    18.14:22:29:546;V000;T;05000 SQL text is SELECT USERENV('SID') FROM DUAL;
    18.14:22:29:546;V000;T;05000 SQL text is SELECT s.SERIAL# from v$session s where s.sid = (SELECT USERENV('SID') FROM DUAL);
    18.14:22:29:561;V000;C;05006 Connection ID is 1, session ID is 2363, serial number is 157.
    18.14:22:29:561;V000;C;00001 Disconnected successfully from jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=xxx))).
    18.14:22:29:561;V000;I;40005 Execute Post-Conversion Tasks elapsed 00:00:47.843.
    But in my 2.0 migration I had this:
    23.16:39:08:919;V001;T;05000 SQL text is UPDATE SYSTEM.DUM$COLUMNS DC SET DC.DCCS_ID = 0 WHERE DC.DCCS_ID > 0;
    23.16:39:08:934;V001;T;05000 SQL text is UPDATE system.dum$sqltext SET time_end=SYS_EXTRACT_UTC(systimestamp), sqlcode=0 WHERE step# = 560 AND obj#= 0 AND order# = 1;
    23.16:39:08:950;V000;F;45010 Thread 1, connection 1 finished converting post-conversion OBJECT_REBUILD, and elapsed time is 00:00:00.250.
    23.16:39:08:950;V000;C;05007 About to close connection to jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=xxx))).
    23.16:39:08:950;V000;T;05000 SQL text is SELECT USERENV('SID') FROM DUAL;
    23.16:39:08:966;V000;T;05000 SQL text is SELECT s.SERIAL# from v$session s where s.sid = (SELECT USERENV('SID') FROM DUAL);
    23.16:39:08:966;V000;C;05006 Connection ID is 1, session ID is 682, serial number is 31.
    23.16:39:08:981;V000;C;00001 Disconnected successfully from jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=x)(PORT=1521))(CONNECT_DATA=(UR=A)(SERVICE_NAME=xxx))).
    23.16:39:08:981;V000;I;40005 Execute Post-Conversion Tasks elapsed 00:13:01.292.
    This migrations are on two different databases at different time, but both are on the same Oracle version
    > select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    My Log File Message Level is FINEST
    Please let me know it there is any more useful diagnostic information in the log files that I can post.
    Thanks,
    Ben

    To add to Weiran's answer: We have removed disabling the restricted session so that nobody except SYSDBA can connect to the database before it is restarted. The instance restart automatically disables the restricted session (unless you explicitly open the database in restricted session mode).
    We request the instance to be restarted as precaution because it is very difficult to guarantee in such a complex system as Oracle Database that the old (stale) database character set information is not cached somewhere in SGA by some existing or future component.
    Note, the instance restart in Oracle Database 12c is required for non-CDB databases only. PDB databases need to be closed and reopened. The CDB instance itself does not have to be restarted.
    The documentation may not talk about it yet. We will fix it.
    Thanks,
    Sergiusz
    Message was edited by: Sergiusz Wolicki (Oracle)

  • Privileged user cannot access restricted session

    There is a bug (Doc ID 444120.1) that stops a 10g listener from accepting connections for an instance in "restricted session" mode, even though the user has the required privilege.
    The solution is to put (UR=A) in the CONNECT_DATA part of the tnsnames.ora file. However, v1.5.1 of SQL Developer ignores this parameter and still won't allow connections. Can this be fixed in the next version please?
    Thanks, Paul

    Tablespace doesn't matter, but the owner does. You have to prefix the table with its scheme/owner (OWNER.EXPENSEREPORT), or assign a (public) synonym to it.
    Have fun,
    K.

  • Restricted session privilege in 9i and 10g

    We recently upgraded from 9.2.0.7 to 10.2.0.3. Oracle 9i allowed a user with RESTRICTED SESSION priv to connect (sqlplus user /@db) when the database was in restricted mode as it should. However, our Oracle 10g database will not allow a user with RESTRICTED SESSION privilege to log in after 'alter system enable restricted session' is executed. The DBA role does not work nor does granting the system privs CREATE SESSION and RESTRICTED SESSION directly to the user. The error I get when trying to log on is ORA-12526. Any advice on how to remedy this would be much appreciated.
    what is the alternative to achieve the same in 10g other than locally?
    Thanks,
    Vishal

    From 10g doc (Oracle® Database Administrator's Guide):
    Typically, all users with the CREATE SESSION system privilege can connect to an open database. Opening a database in restricted mode allows database access only to users with both the CREATE SESSION and RESTRICTED SESSION system privilege. Only database administrators should have the RESTRICTED SESSION system privilege. Further, when the instance is in restricted mode, a database administrator cannot access the instance remotely through an Oracle Net listener, but can only access the instance locally from the machine that the instance is running on.

  • Running Job Scheduler in Restricted Session

    I want the database to be in Restricted Session while my ETL load is running via the Job Scheduler so that users will not be able to access tables during the load. When I put it in restricted session however all scheduled jobs cease to run. What user needs Restricted Session privilege? Is it DBSNMP? Is this an acceptable practice?
    Thanks,
    Susan

    Hi Susan,
    Sorry for the delay in replying, I was testing this out and talking with another developer. It turns out that you are right.
    The Scheduler will not begin running any new jobs or new job chain steps while the database is in restricted mode.
    This is intended behaviour and there is no workaround for this. The job coordinator will simply not start any new jobs if it sees that the database is in restricted mode.
    This design choice was made a long time ago and isn't currently planned to be changed (although there have been some questions about it so it may in future).
    Unfortunately you will need to find another way around this.
    -Ravi

  • Executing alter system enable restricted session on RAC nodes

    alter system enable restricted session command enables restricted mode only on the node on which it runs. I need that all nodes entering this node after executing this statement.
    Please help.

    Something like this using ssh and ksh:
    export db_name=<your database name as appears in crs_stat>
    srvctl status database -d ${db_name} | while read a inst b c d e node
    do
    ssh -f $node "print $inst | . oraenv; print 'alter system enable restricted session;' | sqlplus / as sysdba"
    done
    or you using dbms_job (old but easer to tie to instance than dbms_scheduler):
    declare
    job binary_integer;
    begin
    for i in (select inst_id from gv$instance)
    loop
    dbms_job.submit (
    job=>job,
    what=> 'begin execute immediate ''alter system enable restricted session''; end;',
    instance=>i.inst_id
    commit;
    end loop;
    end;
    /

  • Vmconnect - enhanced session mode - drag & drop

    Host: Windows Server 2012 R2, Guest: Windows Server 2012 R2
    I am trying to drag and drop a file from the host to the guest, but it does not allow this.
    The icon on the vm windows indicates I have enhanced session mode working.. i can copy, and paste but just not drag and drop in either direction.
    I was under the impression that was possible?
    Tim
    P.S. The form for posting questions does not work on safari or chrome on an ipad. the body field does not display. I had to use my PC to post this.
    Tim

    Hi Tim,
    Has the problem been solved ?
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Issues during restricted session

    I have placed my database in restricted mode.
    I am trying to run a few DML's with one user which has dba role assigned.
    When i executed that procedure through shell scripts I got the following error.
    ERROR:
    ORA-12526: TNS:listener: all appropriate instances are in restricted mode
    But Manually i connected to server & connected to that oracle user, i was able to execute those statements perfectly.
    How to enable the user to do the same dml's through procedures?
    I granted restricted session privilege to that user.

    Also, there's a workaround, add "(UR=A)" to the CONNECT_DATA portion of your connect string definition. This is documented in MetaLink Doc ID 444120.1.
    For Example:
    DFM2 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.20.3)(PORT = 1521))
    (CONNECT_DATA =
    (UR = A)
    (SERVICE_NAME = DFM.uservices.umn.edu)
    Sources :http://dbaforums.org/oracle/index.php?showtopic=9500
    ORA-12526: TNS:listener: all appropriate instances are in restricted mode
    HTH
    Girish Sharma

  • Restricted Sessions

    I set the database to be in restricted session by issuing alter system enable restricted session and then tried to login with a userid that has restricted session privileges and I get ora-12526. We just upgrade from 9.2.0.6 to 10.2.0.3 and I know in 9.2.0.6 I was able to do this without any issues. Does anyone know if I need to do anything different in 10.2.0.3 to make this work?

    It is an expected behavior:
    lsnrctl status
    Service "orcl.us.oracle.com" has 1 instance(s).
      Instance "orcl", status RESTRICTED, has 1 handler(s) for this service...
    Service "orclXDB.us.oracle.com" has 1 instance(s).
      Instance "orcl", status RESTRICTED, has 1 handler(s) for this service...
    The command completed successfully
    f:\Oracle\Consulting>sqlplus system/manager@localhost:1521/orcl.us.oracle.com
    SQL*Plus: Release 11.1.0.4.0 - Beta on Fri Jan 25 11:06:53 2008
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    ERROR:
    ORA-12526: TNS:listener: all appropriate instances are in restricted modeYou should perform the connect operation directly at the host.
    ORA-12526: TNS:listener: all appropriate instances are in restricted mode
    Cause: Database instances supporting the service requested by the client were in restricted mode. The Listener does not allow connections to instances in restricted mode. This condition may be temporary, such as during periods when database administration is performed.
    Action: Attempt the connection again. If error persists, then contact the database administrator to change the mode of the instance, if appropriate.
    ~ Madrid

  • Running Chain Job in Restricted Session

    I have my normal jobs running is Restricted Session
    DBMS_SCHEDULER.SET_ATTRIBUTE('job_name', 'ALLOW_RUNS_IN_RESTRICTED_MODE', TRUE);
    I did the same for my chain job. The chain job starts but the first step doesn't start until out of restricted session.
    I get this if I try to set_attribute on a program
    ORA-27469: ALLOW_RUNS_IN_RESTRICTED_MODE is not a valid program attribute
    ORA-06512: at "SYS.DBMS_ISCHED", line 4436
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 2925
    Is there some way to run the steps of a chain in restricted session?
    11gR2

    Greg Here is an example I created for you. It is very close to what I am doing and I was able to duplicate the problem with it.
    -- replace sch_util.send_mail()   with your own PL SQL code.
    DECLARE
    v_job_name VARCHAR2(32) := 'example_job';
    v_chain_name VARCHAR2(32) := 'example_chain';
    BEGIN
    --drop chain and job
    BEGIN
      DBMS_SCHEDULER.DROP_CHAIN(v_chain_name,TRUE);
    EXCEPTION WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Error DROP_CHAIN ' || v_chain_name);
    END;
    BEGIN
      DBMS_SCHEDULER.DROP_JOB(v_job_name, TRUE);
    EXCEPTION WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Error DROP_JOB ' || v_job_name);
    END;
    --create all the programs for chain
    DECLARE
      v_pl_sql VARCHAR2(4000) := 'BEGIN sch_util.send_email(''example chain step 1'', ''Hellow world 1''); END;';
      v_prog_name VARCHAR2(32) := 'example_1_prog';
    BEGIN
      --drop program
      BEGIN
       DBMS_SCHEDULER.DROP_PROGRAM(v_prog_name);
      EXCEPTION WHEN OTHERS THEN
       DBMS_OUTPUT.PUT_LINE('Error DROP_PROGRAM ' || v_prog_name);
      END;
      --create program
      DBMS_SCHEDULER.CREATE_PROGRAM (
         program_name           => v_prog_name,
         program_action         => v_pl_sql,
         program_type           => 'PLSQL_BLOCK',  
         enabled                => TRUE,
         number_of_arguments    => 0,
         comments               => 'example chain step 1');
      DBMS_SCHEDULER.SET_ATTRIBUTE (
         name                   => v_prog_name,
         attribute              => 'max_run_duration',
         value                  => interval '240' minute );
    END;
    DECLARE
      v_pl_sql VARCHAR2(4000) := 'BEGIN sch_util.send_email(''example chain step 2'', ''Hello world 2''); END;';
      v_prog_name VARCHAR2(32) := 'example_2_prog';
    BEGIN
      --drop program
      BEGIN
       DBMS_SCHEDULER.DROP_PROGRAM(v_prog_name);
      EXCEPTION WHEN OTHERS THEN
       DBMS_OUTPUT.PUT_LINE('Error DROP_PROGRAM ' || v_prog_name);
      END;
      --create program
      DBMS_SCHEDULER.CREATE_PROGRAM (
         program_name           => v_prog_name,
         program_action         => v_pl_sql,
         program_type           => 'PLSQL_BLOCK',  
         enabled                => TRUE,
         number_of_arguments    => 0,
         comments               => 'example chain step 1');
      DBMS_SCHEDULER.SET_ATTRIBUTE (
         name                   => v_prog_name,
         attribute              => 'max_run_duration',
         value                  => interval '240' minute );
    END;
    -----------------------------Start Chain Definition -----------------------------------
    DBMS_SCHEDULER.CREATE_CHAIN (
         chain_name            =>  v_chain_name,
         comments              =>  'Example chain!');
    --- define steps for this chain.
    DBMS_SCHEDULER.DEFINE_CHAIN_STEP(v_chain_name, 'example_step1', 'example_1_prog');
    DBMS_SCHEDULER.DEFINE_CHAIN_STEP(v_chain_name, 'example_step2', 'example_2_prog');
    -- define corresponding rules for the chain.
    DBMS_SCHEDULER.DEFINE_CHAIN_RULE(v_chain_name, 'TRUE', 'START example_step1');
    DBMS_SCHEDULER.DEFINE_CHAIN_RULE(v_chain_name, 'example_step1 SUCCEEDED', 'START example_step2');
    DBMS_SCHEDULER.DEFINE_CHAIN_RULE(v_chain_name, 'example_step2 COMPLETED', 'END');
    -- enable the chain
    DBMS_SCHEDULER.ENABLE(v_chain_name);
    --- create a chain job to start the chain 
    DBMS_SCHEDULER.CREATE_JOB (
         job_name        => v_job_name,
         job_type        => 'CHAIN',
         job_action      => v_chain_name,
         start_date    => '6-AUG-2014 9.35.00 AM AMERICA/CHICAGO',
         enabled         => FALSE);
       DBMS_SCHEDULER.SET_ATTRIBUTE(v_job_name , 'max_run_duration' , interval '4' hour);
       DBMS_SCHEDULER.SET_ATTRIBUTE(v_job_name, 'raise_events',DBMS_SCHEDULER.JOB_FAILED);
       DBMS_SCHEDULER.SET_ATTRIBUTE(v_job_name, 'ALLOW_RUNS_IN_RESTRICTED_MODE', TRUE);
       DBMS_SCHEDULER.ENABLE(v_job_name);
    END;

  • DBLINK not working in restricted session.

    Hi
    All,
    I have just upgraded database from 9.2.0.6 to 10.2.0.3. everything was working before upgradation but after upgradation DBLINK not working in restricted sesion.
    it has all the restricted session privilage. and also like after upgradation it is working without restricted session. when I put in restricted session it's not working .it was working under restricted session in 9.2.0.6.
    Thanks,
    Vishal

    From 9.2.0.6 to 10.2.0.3 there is some difference in the privileges granted to the roles. So you need to be aware of the new features before you upgrade.
    For instance, in 10g, the CONNECT role only has the CREATE SESSION privilege and has been striped off the following privileges:
    CREATE CLUSTER
    CREATE DATABASE LINK
    CREATE SEQUENCE
    ALTER SESSION
    CREATE SYNONYM
    CREATE TABLE
    CREATE VIEW
    So, if your DBLINK user had these privileges via the CONNECT role, you need to grant them the privileges again to be able to carry out any related tasks. it may not just be because of the restricted session.

  • Unable to Serialize ReportClientDocument using "StateServer" session mode

    Hello,
    In my ASP.NET application, I am using "StateServer" session state mode for maintaining session variables. The problem however is that this mode requires all the objects inside the session variables to be serialized and for some reason ReportClientDocument doesn't seem to be serializable.
    Here is the code that's not working:
    ceSession = Session.Item("ceSession")
    ceEnterpriseService = ceSession.GetService("", "InfoStore")
    ceInfoStore = New InfoStore(ceEnterpriseService)
    rptAppFactory = ceInfoStore.EnterpriseSession.Interface.Service("", "RASReportFactory")
    rptClientDoc = rptAppFactory.OpenDocument(rptId, CdReportClientDocumentOpenOptionsEnum.cdReportClientDocumentOpenAsReadOnly)
    Session.Add(rptClientDoc)
    At the end of the request it throws an exception
    "Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is done by the custom session state store in 'Custom' mode."
    [SerializationException: Type 'CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass' in Assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=12.0.1100.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' is not marked as serializable.]
    Is anybody having any idea on how to successfully store ReportClientDocument in the session variable by using "StateServer" session state mode?
    Thanks

    There is a sample that demonstrates serializing the ReportClientDocument [here|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0a4791b-9d3b-2c10-94a5-86088b6224d4]

  • Regarding BDC session

    Hi
    i am processing my BDC pro. in Session method.
    my requirement is i have to capture the error records into a file
    and i have to write that file on appl. server.
    how to capture the error records from error log?
    please reply

    Hai  Saritha,
    Usually if there are any errors in CALL TRANSACTION we send those records to SESSION METHOD by using below logic.
    eg:
    CALL TRANSACTION 'XK01' USING
    t_bdcdata MODE 'N' .
    IF sy-subrc 0.
    PERFORM session_bdc.
    ENDIF.
    ENDLOOP.
    IF s_flag = 'X'.
    CALL FUNCTION 'BDC_CLOSE_GROUP'.
    ENDIF.
    This is subroutine .
    FORM session_bdc .
    IF s_flag = ' '.
    CALL FUNCTION 'BDC_OPEN_GROUP'
    EXPORTING
    client = sy-mandt
    group = 'vcentric'
    holddate = filler8
    keep = 'X'
    user = sy-uname
    prog = sy-cprog.
    s_flag = 'X'.
    ENDIF.
    CALL FUNCTION 'BDC_INSERT'
    EXPORTING
    tcode = 'XK01'
    TABLES
    dynprotab = t_bdcdata.
    ENDFORM. " SESSION_BDC
    or we can send the error records on into an flat file by using the below logic.
    CALL TRANSACTION 'XK01' USING
    T_BDCDATA MODE 'N' MESSAGES INTO T_BDCMSG.
    IF SY-SUBRC 0.
    APPEND W_UPLOAD TO T_ERROR.
    ENDIF.
    CLEAR W_BDCMSG.
    READ TABLE T_BDCMSG INTO W_BDCMSG INDEX 1.
    CLEAR L_MSG.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
    ID = W_BDCMSG-MSGID
    LANG = SY-LANGU
    NO = W_BDCMSG-MSGNR
    V1 = W_BDCMSG-MSGV1
    V2 = W_BDCMSG-MSGV2
    V3 = W_BDCMSG-MSGV3
    V4 = W_BDCMSG-MSGV4
    IMPORTING
    MSG = L_MSG
    EXCEPTIONS
    NOT_FOUND = 1
    OTHERS = 2.
    IF SY-SUBRC = 0.
    WRITE:/ W_UPLOAD-NAME1, '----', L_MSG.
    ENDIF.
    ENDLOOP.
    this is subroutine.
    FORM ERROR_RECORDS .
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:/ERROR.TXT'
    FILETYPE = 'ASC'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = T_ERROR.
    ENDFORM. " ERROR_RECORDS
    Reward is useful.
    Regards.
    Eshwar.

Maybe you are looking for