ADF BC - Database session setting in AM

Hi,
I would like to call a database procedure whenever a user logs into the application. They can come from any page so I don't want it to be page specific. I am using container managed security and want to find current user using getUserPrincipal AM method and then call database procedure passing the current user.
I need something like the afterConnect() method, but it has to happen at the start of a HTTPSession. Or do I need to extend one of the controller lifecycle classes to do this?
any help would b greatly appreciated.
Brenden

Brenden,
what about the prepare session method on the AM. If you override this then after the call to super class you should be in an after connect. In my VPD examples I use this method to set the VPD application context getting the username from getUserPrincipal on teh Am
Frank

Similar Messages

  • ADF panel opening too many JDBC Thin Client database sessions.

    Hi All,
    I have several ADF Panels, which allows the user to run a few simple queries against an Oracle database done using ADF view objects and ADF view links and ADF application module.
    Each ADF panel as I said contains several View Link queries, and links under the form of Jbuttons to other ADF Panels running other ADF View Links.
    Running the ADF Panel as described here opens up to 21 database sessions displaying as “JDBC Thin Client” when I look them up from v$session.
    Why do I end up with that many database sessions.
    Why doesn’t it just use one or two database sessions to run all these View Links? It seems that it is opening one database session for each of these view links.
    How can I change this destructive behavior? I only one to see one or two database sessions for the entire ADF panel no matter how many ADF View Links it contains.
    Your suggestions are most appreciated.
    Thanks.
    Bobby A.

    Thanks for your response.
    I took a quick look at the docs you pointed me to. It seems that I can set some parameters in bc4j.xcfg of each application module Home to control number of database connections that the application module will create. In that case maybe you can recommend which parameters and what value they should be set to.
    Your response will be most helpful as my background is rather in database admin and not java.
    Thanks.
    Bobby A.

  • Single Database Session Per User in ADF/BC Application

    Hi, I am using ADF with BC (JDeveloper 11.1.1.1). My application contains multiple application modules, each connected to the same JDBC data source. On the app server, I have configured the data source to use Identity Based Connection Pooling.
    My current configuration is resulting in numerous database sessions for each user. I have a requirement to use only a single database session per user HTTP session. Is there any way to configure the application modules to achieve this?
    Thanks,
    Brad

    Hi,
    use a single root Am module and make sure the others are used as nested modules. This will create a single connection
    Frank

  • Database session rollback.

    How can I issue a database session rollback from within an ADF jpanel?
    Here are a few things I tryied:
    I used:
    panelBinding.getOperationBinding("Rollback");
         -->This does not seem to rollback anything.
    panelBinding.releaseDataControl();
    panelBinding.getApplication().getApplicationModule().getTransaction().rollback();
         -->This two look like they do rollback and release all data everywhere, not just in the panel it was issued, so all my pages will have to bind again (re-query) which makes the app very slow.
    This is supposed to be a read only app.
    I guess what I am looking for is to possible issue a session rollback when exiting an ADF jpanel, without forcing re-binding, equerry of all my ADF views and ADF view links.
    Or probably set a JOB parameter which would make the entire app read only and would never attempt update if any rows displayed were changed my mistake.
    Your input is most appreciated.
    Thanks.
    Edited by: user2456231 on Dec 20, 2010 3:29 PM
    Edited by: user2456231 on Dec 21, 2010 4:20 PM

    Thanks for you response.
    This is a read only app, all the object views are based on read only SQL, but because I have defined in the object view the field displayed to be always updatable so it can be highlighted, and copied into clipboard, so it would be easy to copy and paste stuff into email or other documents, sometime this copy and paste process causes a field to be modified accidentally, so I need to include a rollback statement every time an ADF jpanel is closed, just to clean up and rollback these type of situations.
    You wrote:
    “A rollback is on the transaction, which is held by the Application Module. If you only want to rollback partial changes then you need to first set a savepoint in ADF BC and recover to this savepoint”
    I understand that and I do want to rollback every thing that the application module might have accidentally modified, but once I issue the rollback using the following:
    panelBinding.getApplication().getApplicationModule().getTransaction().rollback();
    This causes the app to rebind, meaning all my ADF object views and pages will have to bind again (re-query) which makes the app very slow to navigate. Is there any way to avoid this? Meaning rollback but do not re-bind, requery or refresh the rows already displayed?
    Thanks.

  • OrdImage using its own database session?

    Hello,
    I have been searching on the Internet and this forums, but I am unable to find an answer to my question, so I am asking it here: I have noticed that when a user enters to a screen with an OrdImage being displayed in it, the application module opens 2 database sessions instead of one. Furthermore, if I comment the af:media component used to display the OrdImage and I repeat the same test, only one database session is created. So for some reason, the OrdImage is using a separate database session from the rest of the screen.
    Does the OrdImage type really need its own session? Is it possible to make it use the screen's one? Using two database sessions in the same screen is kind of a waste of resources, especially when that screen has a lot of users (like the one where he have the issue).
    Thank you
    Jordi
    PS: by the way, I am using JDeveloper 11.1.1.4.0.

    I have just found [this article|http://jobinesh.blogspot.com.es/2011/07/tips-on-using-afmedia-to-display.html] about OrdImage in ADF, and I see that the pagedef property CustomInputHandler="OrdDomainValueHandler" (which is already set in my application) is used to retrieve some information that cannot be get through the View Object. Is it possible that this property is the responsible for that second connection?
    Jordi

  • Connection Pool and Database Sessions

    Hi,
    Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?
    Thanks,
    Vinod

    Hi,
    Is there any way to use the connection pool or Datasource while connecting to database?If I am using a stateless sesssion bean and using a Data Access layer which just creates a database session to write the persistence toplink objects how I can make use of application server connection pool?Hi Vinod,
    Yes, TopLink allows you to use the app server's connection pooling and transaction services. Chapter 2 of the Oracle9iAS TopLink Foundation Library Guide provides details as do the TopLink examples. The easiest way to set this up is by using the sessions.xml file. The sample XML below is from the file <toplink903>\examples\ias\examples\ejb\sessionbean\sessions.xml. Here we are adding the datasource defined in OC4J and specifying that we are using the OC4J transaction controller also.
    <login>
    <user-name>sa</user-name>
    <password></password>
    <datasource>java:comp/env/jdbc/ejbJTSDataSource</datasource>
    <uses-external-transaction-controller>true</uses-external-transaction-controller>
    <uses-external-connection-pool>true</uses-external-connection-pool>
    </login>
    <external-transaction-controller-class>oracle.toplink.jts.oracle9i.Oracle9iJTSExternalTransactionController</external-transaction-controller-class>
    When using this approach you need to change your TopLink code slightly in the EJB methods:
    a. Acquire the ACTIVE unit of work from the server
    session (again, see the EmployeeSessionEJB code
    example) with something like:
    UnitOfWork uow = clientSession.getActiveUnitOfWork();
    b. Calls to uow.commit() can be ommitted or commented out
    because the EJB will handle this. Note that of course
    the methods you create in the EJB that are using this
    approach must have TX Required (default).
    Hope this helps.
    Pete

  • ORA-12709: error while loading create database character set after upgrade

    Dear All
    i m getting ORA-12709: error while loading create database character set, After upgraded the database from 10.2.0.3 to 11.2.0.3 in ebusiness suit env.
    current application version 12.0.6
    please help me to resolve it.
    SQL> startup;
    ORACLE instance started.
    Total System Global Area 1.2831E+10 bytes
    Fixed Size 2171296 bytes
    Variable Size 2650807904 bytes
    Database Buffers 1.0133E+10 bytes
    Redo Buffers 44785664 bytes
    ORA-12709: error while loading create database character set
    -bash-3.00$ echo $ORA_NLS10
    /u01/oracle/PROD/db/teche_st/11.2.0/nls/data/9idata
    export ORACLE_BASE=/u01/oracle
    export ORACLE_HOME=/u01/oracle/PROD/db/tech_st/11.2.0
    export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/perl/bin:$PATH
    export PERL5LIB=$ORACLE_HOME/perl/lib/5.10.0:$ORACLE_HOME/perl/site_perl/5.10.0
    export ORA_NLS10=/u01/oracle/PROD/db/teche_st/11.2.0/nls/data/9idata
    export ORACLE_SID=PROD
    -bash-3.00$ pwd
    /u01/oracle/PROD/db/tech_st/11.2.0/nls/data/9idata
    -bash-3.00$ ls -lh |more
    total 56912
    -rw-r--r-- 1 oracle oinstall 951 Jan 15 16:05 lx00001.nlb
    -rw-r--r-- 1 oracle oinstall 957 Jan 15 16:05 lx00002.nlb
    -rw-r--r-- 1 oracle oinstall 959 Jan 15 16:05 lx00003.nlb
    -rw-r--r-- 1 oracle oinstall 984 Jan 15 16:05 lx00004.nlb
    -rw-r--r-- 1 oracle oinstall 968 Jan 15 16:05 lx00005.nlb
    -rw-r--r-- 1 oracle oinstall 962 Jan 15 16:05 lx00006.nlb
    -rw-r--r-- 1 oracle oinstall 960 Jan 15 16:05 lx00007.nlb
    -rw-r--r-- 1 oracle oinstall 950 Jan 15 16:05 lx00008.nlb
    -rw-r--r-- 1 oracle oinstall 940 Jan 15 16:05 lx00009.nlb
    -rw-r--r-- 1 oracle oinstall 939 Jan 15 16:05 lx0000a.nlb
    -rw-r--r-- 1 oracle oinstall 1006 Jan 15 16:05 lx0000b.nlb
    -rw-r--r-- 1 oracle oinstall 1008 Jan 15 16:05 lx0000c.nlb
    -rw-r--r-- 1 oracle oinstall 998 Jan 15 16:05 lx0000d.nlb
    -rw-r--r-- 1 oracle oinstall 1005 Jan 15 16:05 lx0000e.nlb
    -rw-r--r-- 1 oracle oinstall 926 Jan 15 16:05 lx0000f.nlb
    -rw-r--r-- 1 oracle oinstall 1.0K Jan 15 16:05 lx00010.nlb
    -rw-r--r-- 1 oracle oinstall 958 Jan 15 16:05 lx00011.nlb
    -rw-r--r-- 1 oracle oinstall 956 Jan 15 16:05 lx00012.nlb
    -rw-r--r-- 1 oracle oinstall 1005 Jan 15 16:05 lx00013.nlb
    -rw-r--r-- 1 oracle oinstall 970 Jan 15 16:05 lx00014.nlb
    -rw-r--r-- 1 oracle oinstall 950 Jan 15 16:05 lx00015.nlb
    -rw-r--r-- 1 oracle oinstall 1.0K Jan 15 16:05 lx00016.nlb
    -rw-r--r-- 1 oracle oinstall 957 Jan 15 16:05 lx00017.nlb
    -rw-r--r-- 1 oracle oinstall 932 Jan 15 16:05 lx00018.nlb
    -rw-r--r-- 1 oracle oinstall 932 Jan 15 16:05 lx00019.nlb
    -rw-r--r-- 1 oracle oinstall 951 Jan 15 16:05 lx0001a.nlb
    -rw-r--r-- 1 oracle oinstall 944 Jan 15 16:05 lx0001b.nlb
    -rw-r--r-- 1 oracle oinstall 953 Jan 15 16:05 lx0001c.nlb
    Starting up:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options.
    ORACLE_HOME = /u01/oracle/PROD/db/tech_st/11.2.0
    System name: SunOS
    Node name: proddb3.zakathouse.org
    Release: 5.10
    Version: Generic_147440-19
    Machine: sun4u
    Using parameter settings in server-side spfile /u01/oracle/PROD/db/tech_st/11.2.0/dbs/spfilePROD.ora
    System parameters with non-default values:
    processes = 200
    sessions = 400
    timed_statistics = TRUE
    event = ""
    shared_pool_size = 416M
    shared_pool_reserved_size= 40M
    nls_language = "american"
    nls_territory = "america"
    nls_sort = "binary"
    nls_date_format = "DD-MON-RR"
    nls_numeric_characters = ".,"
    nls_comp = "binary"
    nls_length_semantics = "BYTE"
    memory_target = 11G
    memory_max_target = 12G
    control_files = "/u01/oracle/PROD/db/apps_st/data/cntrl01.dbf"
    control_files = "/u01/oracle/PROD/db/tech_st/10.2.0/dbs/cntrl02.dbf"
    control_files = "/u01/oracle/PROD/db/apps_st/data/cntrl03.dbf"
    db_block_checksum = "TRUE"
    db_block_size = 8192
    compatible = "11.2.0.0.0"
    log_archive_dest_1 = "LOCATION=/u01/oracle/PROD/db/apps_st/data/archive"
    log_archive_format = "%t_%s_%r.dbf"
    log_buffer = 14278656
    log_checkpoint_interval = 100000
    log_checkpoint_timeout = 1200
    db_files = 512
    db_file_multiblock_read_count= 8
    db_recovery_file_dest = "/u01/oracle/fast_recovery_area"
    db_recovery_file_dest_size= 14726M
    log_checkpoints_to_alert = TRUE
    dml_locks = 10000
    undo_management = "AUTO"
    undo_tablespace = "APPS_UNDOTS1"
    db_block_checking = "FALSE"
    session_cached_cursors = 500
    utl_file_dir = "/usr/tmp"
    utl_file_dir = "/usr/tmp"
    utl_file_dir = "/u01/oracle/PROD/db/tech_st/10.2.0/appsutil/outbound"
    utl_file_dir = "/u01/oracle/PROD/db/tech_st/10.2.0/appsutil/outbound/PROD_proddb3"
    utl_file_dir = "/usr/tmp"
    plsql_code_type = "INTERPRETED"
    plsql_optimize_level = 2
    job_queue_processes = 2
    cursor_sharing = "EXACT"
    parallel_min_servers = 0
    parallel_max_servers = 8
    core_dump_dest = "/u01/oracle/PROD/db/tech_st/10.2.0/admin/PROD_proddb3/cdump"
    audit_file_dest = "/u01/oracle/admin/PROD/adump"
    db_name = "PROD"
    open_cursors = 600
    pga_aggregate_target = 1G
    workarea_size_policy = "AUTO"
    optimizer_secure_view_merging= FALSE
    aq_tm_processes = 1
    olap_page_pool_size = 4M
    diagnostic_dest = "/u01/oracle"
    max_dump_file_size = "20480"
    Tue Jan 15 16:16:02 2013
    PMON started with pid=2, OS id=18608
    Tue Jan 15 16:16:02 2013
    PSP0 started with pid=3, OS id=18610
    Tue Jan 15 16:16:03 2013
    VKTM started with pid=4, OS id=18612 at elevated priority
    VKTM running at (10)millisec precision with DBRM quantum (100)ms
    Tue Jan 15 16:16:03 2013
    GEN0 started with pid=5, OS id=18616
    Tue Jan 15 16:16:03 2013
    DIAG started with pid=6, OS id=18618
    Tue Jan 15 16:16:03 2013
    DBRM started with pid=7, OS id=18620
    Tue Jan 15 16:16:03 2013
    DIA0 started with pid=8, OS id=18622
    Tue Jan 15 16:16:03 2013
    MMAN started with pid=9, OS id=18624
    Tue Jan 15 16:16:03 2013
    DBW0 started with pid=10, OS id=18626
    Tue Jan 15 16:16:03 2013
    LGWR started with pid=11, OS id=18628
    Tue Jan 15 16:16:03 2013
    CKPT started with pid=12, OS id=18630
    Tue Jan 15 16:16:03 2013
    SMON started with pid=13, OS id=18632
    Tue Jan 15 16:16:04 2013
    RECO started with pid=14, OS id=18634
    Tue Jan 15 16:16:04 2013
    MMON started with pid=15, OS id=18636
    Tue Jan 15 16:16:04 2013
    MMNL started with pid=16, OS id=18638
    DISM started, OS id=18640
    ORACLE_BASE from environment = /u01/oracle
    Tue Jan 15 16:16:08 2013
    ALTER DATABASE MOUNT
    ORA-12709 signalled during: ALTER DATABASE MOUNT...

    ORA-12709 signalled during: ALTER DATABASE MOUNT...Do you have any trace files generated at the time you get this error?
    Please see these docs.
    ORA-12709: WHILE STARTING THE DATABASE [ID 1076156.6]
    Upgrading from 9i to 10gR2 Fails With ORA-12709 : Error While Loading Create Database Character Set [ID 732861.1]
    Ora-12709 While Trying To Start The Database [ID 311035.1]
    ORA-12709 when Mounting the Database [ID 160478.1]
    How to Move From One Database Character Set to Another at the Database Level [ID 1059300.6]
    Thanks,
    Hussein

  • Database session management in APEX

    How is the database session managed in APEX? I found that sometimes a database session can last from page to pages in an APEX application, but sometimes every page starts a new database session.
    Is there a way to control the database session in APEX?
    Thanks,
    -Fengting

    Since HTTP is a stateless and connectionless protocol, you are not guaranteed to get the same database session between pages. APEX maintains the session state implicitly. Each session is assigned a unique identifier with APEX. The APEX engine uses the session ID to store and retrieve the applications working set of data or session state before and after each page view.
    The session information persists in the database until purged. Therefore, as long as the client's session cookie has not expired, a user can continue running the application long after having first launched it. This is also what allows a user to run multiple instances of an application simultaneously in different browser sessions.
    That being said, I think the answer to your question is that it is not necessarily going to be the same database session (but could be), nor can you control it. You should use session state.

  • Oracle database character set

    Hello all -
    Please help..................
    I will be exporting/importing 6/7 users/schemas/data from one database to the another database on solaris. Users are created.
    I am confused about NLS_LANG variable and database characterset.
    I have the following questions -
    1. What is impact of NLS_LANG variable setting of user session while import/export the data ?
    2. Why do we need to set this NLS_LANG user session variable before export/import ?
    3.If NLS_LANG variable is not set (doesnot have any value) what would happen ?
    4. If I have to set NLS_LANG varible, what should I set it to?
    5. How can I see the characterset of my database?
    6. Where can I get more info about database charaterset and What are the valid values for database characterset and NLS_LANG varibale ?
    Any help would really appreciated...
    Thanks a lot.....
    RAMA

    1. What is impact of NLS_LANG variable setting of user session while import/export the data ?
    On export, the data will be converted from the database character set to the character set specified by NLS_LANG. In import, the database will assume that the data is in the character set specified by NLS_LANG and use that value to perform the conversion to the database character set if the two values to not match.
    2. Why do we need to set this NLS_LANG user session variable before export/import ?
    If your database character set is the same as your OS, you don't necessarily have to set NLS_LANG. For instance, if you have a US7ASCII db, and your OS locale is set to AMERICA_AMERICAN.US7ASCII, there won't be any problems. The only time it's really important to set this is when the db and OS settings don't match.
    3.If NLS_LANG variable is not set (doesnot have any value) what would happen ?
    If your database character set doesn't match your OS, the data could be garbled because the db will incorrectly transcode the data on import/export.
    4. If I have to set NLS_LANG varible, what should I set it to?
    Depends on what your database character set is set to (see below).
    5. How can I see the characterset of my database?
    select * from nls_database_parameters and look for the value set for the NLS_CHARACTERSET parameter. Don't get confused by the NLS_NCHAR_CHARACTERSET, that's for NCHAR datatypes.
    So, for instance, if your NLS_CHARACTERSET value is set to UTF8, you would set NLS_LANG to .UTF8 (the dot is important because that's actually shorthand for territory_language.characterset, or language_territory.characterset, I can never remember which comes first. In any case, use the dot). For example:
    setenv NLS_LANG .UTF8
    6. Where can I get more info about database charaterset and What are the valid values for database characterset and NLS_LANG varibale ?
    It's all in the Oracle documentation.
    hope this helps.
    Tarisa.

  • How to alter database character set from AL32UTF8 to EE8MSWIN1250

    Hi folks,
    I'm using an Oracle 10g, XE database, which has a database character set set to AL32UTF8, what causes that some characters like "č ť ř ..." are not displayed.
    To fix this issue, I would like to change it to EE8MSWIN1250 character set as it's set on server.
    Unfortunatelly below steps don;t work for me:
    connect sys as sysdba;
    SHUTDOWN IMMEDIATE;
    STARTUP MOUNT;
    ALTER SYSTEM ENABLE RESTRICTED SESSION;
    ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
    ALTER SYSTEM SET AQ_TM_PROCESSES=0;
    ALTER DATABASE OPEN;
    ALTER DATABASE NATIONAL CHARACTER SET EE8MSWIN1250;
    ALTER DATABASE CHARACTER SET EE8MSWIN1250;
    SHUTDOWN IMMEDIATE; -- or SHUTDOWN NORMAL;
    STARTUP;Value in regedit: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_XE is set to CZECH_CZECH REPUBLIC.EE8MSWIN1250
    I'm struggling with this issue for hours and unfortunatelly can't make it work. Any advise is more than welcome.
    Thanks,
    Tomas
    I tried to use hints listed here , but always getting some ORA messages.

    Hi Sergiusz,
    Thank you for your reply. You're right, I've probably didn't provide a full details about my issue, but at least now I know, that database encoding(characterset) is correct.
    Here is my issue:
    Within my APEX application I would like to use a JasperReportsIntegration, so to be able to create and run iReports straight from APEX application. Installation, and implementation of JasperReports works fine, I had no issue with it.
    As a second step I've created a simple report using iReport tool, when if preview function is used, all static characters (from report labels) are displayed correctly. Database items are displayed incorectly - some Czech characters are not displayed. Language within report is set to cs_CS, but I've tried also other options. No sucess.
    When I run that report from APEX application (from server) then the same issue - data from database are returned without some czech characters.
    Kind regards,
    Tomas

  • Long Running SQL and ORDS Spawns Multiple Database Sessions

    Hi all.
    We have a strange situation when accessing a long running SQL Report (a single APEX Page).
    The SQL takes about 15 mins to run but when I monitor what database sessions are spawned by the APEX Listener, I see multiple sessions all executing the same SQL. It appears that after 6 minutes, the APEX Listener spawns a new database session to execute the same SQL.
    Has anyone seen this before and if so, is there a key setting I am missing as I don't want this to happen. I am new to the APEX Listener and WebLogic so apologies if this is the way it's meant to work but it seems odd that after a certain amount of time (6 minutes in my case) a new database session is spawned to do the same work.
    We are running:
    WebLogic: 10.3.0.6
    APEX_LISTENER_VERSION 2.0.0.354.17.06
    Datadate: 11.2.0.3.0 Production
    APEX: 4.2.1.00.08
    Cheers for any help.
    Duncs

    Hi Duncan,
    With all respect, you should please rethink your interface.  I would never consider writing a Web application with a request that knowingly takes 15 minutes to return the results.  You can consider doing this asynchronously via DBMS_SCHEDULER and then alerting the user (via email, perhaps) that their results are ready.  Or if you can precompute this in advance, consider using materialized views so that the user's response time is sub-second.
    In an era where the patience of the average end-user is measured in single-digit seconds, it is impractical to ever expect an end-user to wait 15 minutes for their resultant Web page.
    Joel

  • Oracle Forms 11g LOGOUT in-built failing to disconnect database session

    Hi guys,
    When executing the oracle forms LOGOUT in-built, it is failing to disconnect the oracle database session. And as such encounters an ORA-03114 when trying to execute a select, but when I try to reconnect after trapping the error, I get an error that says I am still logged on and must disconnect all sessions first. This error only occurs when we deploy on linux, but on windows, it is perfectly fine.
    Please assist, this is very urgent.

    http://www.4shared.com/file/o5ETXcZ4/PWDSETUP.html
    http://www.4shared.com/file/89JOb0Xm/p1_dept_2.html
    Download these two files and rename p1_dept_2.fmb to p1_dept.fmb
    1. Compile the forms and deploy on linux,
    2. Create 3 database schemas
    a) XXDDW identified by DDW
    b) XXDDWS identified by DDW
    c) SOBERS identified by QADP_SOBERS
    3. In your formsweb config, in the setup for your launch, use p1_dept.fmx as you entry form and also default login should be set as XXDDW
    4. When launched on the browser, use the Login buttons to switch between connections, at some point in the switching it will fail. Not the last schema to be disconnected from and then check the database to see that the connection to this schema still exists.

  • Change Database Character Set to Arabic!

    Dear All,
    My database is Oracle 11gR2 On Linux platform.
    I am trying to change the character set of my database to store Arabic characters.
    This is what I am doing:
    SHUTDOWN IMMEDIATE;
    STARTUP MOUNT;
    ALTER SYSTEM ENABLE RESTRICTED SESSION;
    ALTER SYSTEM SET JOB_QUEUE_PROCESSES=0;
    ALTER SYSTEM SET AQ_TM_PROCESSES=0;
    ALTER DATABASE OPEN;
    ALTER DATABASE CHARACTER SET INTERNAL_USE AR8ISO8859P6;
    SHUTDOWN IMMEDIATE;
    STARTUP;
    When i check:
    SQL> select value from NLS_DATABASE_PARAMETERS where parameter='NLS_CHARACTERSET';
    VALUE
    AR8ISO8859P6
    But still when i query data it shows it like this:
    "¿¿¿¿¿¿ç ¿¿ê ¿¿¿¿çê¿ ¿¿¿¿ ¿¿¿ ¿¿¿¿¿¿ ¿¿¿¿ ¿¿¿èê¿ ¿¿¿è¿ ¿¿¿¿ê¿¿ ¿¿¿ ¿¿â¿¿ ¿¿é ¿¿¿ è¿¿¿ ¿ê ¿¿¿¿ êè¿ ¿¿¿¿¿¿ 28/9 ¿ê ¿ ¿¿é ¿¿¿¿ ¿è¿¿ê èç¿¿¿ ¿è¿¿¿ âê¿¿ ¿¿¿ è¿¿â¿ ¿¿è¿"
    Can you help me to understand where is the problem and how to get through it.
    Regards, Imran

    Why on earth are you using the undocumented INTERNAL_USE command? The name alone should strongly imply that this isn't something that normal users should be playing with. It is extremely likely that you've corrupted your database.
    Do you have a backup of your database taken before you corrupted it? If so, can you restore that backup? Once you do that, tell us what character set you're starting with. If you are implying that there is existing data in the database, what character set is that data encoded with? Can you DUMP the data to verify this?
    Justin

  • 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 

  • Database level setting for timestamp format

    Is there any way by which I could set the timestamp format for a database
    Something similar to timestamp sesion setting like
    alter session set nls_timestamp_format = 'YYYY-MM-DD HH24:MI:SS.FF1'

    You can define NLS parameters at the instance level in the parameters file. But any redefinition at the client side will overcome this.

Maybe you are looking for