Triggers & SET ROLE

Hi,
I appreciate, if somebody could me help out of this senario :
we have a BRS Front end App. on the ORACLE 8.0.5,
there are end users working on the application through the SQL net, the users are having the OPS$ and Regular oracle a/c's, with a default profile.
However multiple roles couldnot be assigned,may misuse the a/c
Requirement :
The profile needs to be altered, using database triggers, depending on the action of the user for that particular session.
Thanks in advance,
Ramana
null

Can you explain us what is trying to do with this procedure? Are you basically trying to give dba role to whomever is logged on OS and give that user a DBA priv? How many users are going to logging into database from OS? Please tell us your scenario and then we can help you knowing what you are trying to accomplish.

Similar Messages

  • SET Role and PL/SQL

    Hello folks
    Is there a way/workaround to do a SET ROLE using PL/SQL ? Please advise
    Thanks,
    N K

    >
    Is there a way/workaround to do a SET ROLE using PL/SQL ? Please advise
    >
    No - you cannot set roles within a definer's rights procedure.
    See How Roles Work in PL/SQL Blocks in the Database Security doc
    http://docs.oracle.com/cd/B28359_01/network.111/b28531/authorization.htm
    >
    How Roles Work in PL/SQL Blocks
    The use of roles in a PL/SQL block depends on whether it is an anonymous block or a named block (stored procedure, function, or trigger), and whether it executes with definer's rights or invoker's rights.
    Roles Used in Named Blocks with Definer's Rights
    All roles are disabled in any named PL/SQL block (stored procedure, function, or trigger) that executes with definer's rights. Roles are not used for privilege checking and you cannot set roles within a definer's rights procedure.
    >
    And be careful to heed this warning about LOGON triggers (see Using triggers in the PL/SQL doc - http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/triggers.htm)
    >
    •If you use a LOGON trigger to monitor logons by users, include an exception-handling part in the trigger, and include a WHEN OTHERS exception in the exception-handling part. Otherwise, an unhandled exception might block all connections to the database.

  • How to use the Oracle's SET ROLE?

    Hi all,
    does anyone know how I can call SET ROLE (for Oracle) from java before the report is produced with
    Crystal Reports API?
    I'm using Crystal Reports 2008 for the report design and new crystal report java sdk of JRC (v12.2 with SP1) which know as CRJ in my J2EE application.
    I tried to insert a Command (SET ROLE role) into a working fine report.
    The report runned into Crystal Reports 2008 works fine.
    Since has been made a high number of reports without a SET ROLE, to avoid to modify all the reports already made, I tried to run the SET ROLE from JAVA adding a CommandTable to report.
    Below the code inserted into java class:
              ConnectionInfos connInfos = new ConnectionInfos();
              IConnectionInfo iConnInfo = new ConnectionInfo();
              PropertyBag propertyBag = new PropertyBag();
              try {
              String usernameOracle = GestoreContesto.getAttributo("usernameOracleReport");
              String passwordOracle = GestoreContesto.getAttributo("passwordOracleReport");
              String connectString = GestoreContesto.getAttributo("dbUrl");
              String driverName = "oracle.jdbc.OracleDriver";
              //String driverName = "oracle.jdbc.OracleConnectionCacheImpl";
              //String JNDIName = "jdbc/nsisrdatasource";
              String userName = usernameOracle;               
              String password = passwordOracle;
              String TRUSTED_CONNECTION = "false";
              String SERVER_TYPE = "JDBC (JNDI)";
              String USE_JDBC = "true";
              String DATABASE_DLL = "crdb_jdbc.dll";
              //String JNDI_OPTIONAL_NAME = JNDIName;
              String CONNECTION_URL = connectString;
              String DATABASE_CLASS_NAME = driverName;
              propertyBag.put("Trusted_Connection", TRUSTED_CONNECTION);
              propertyBag.put("Server Type", SERVER_TYPE);
              propertyBag.put("Use JDBC", USE_JDBC);
              propertyBag.put("Database DLL",DATABASE_DLL );
              //propertyBag.put("JNDIOptionalName",JNDI_OPTIONAL_NAME );
              propertyBag.put("Connection URL", CONNECTION_URL);
              propertyBag.put("Database Class Name", DATABASE_CLASS_NAME);
              iConnInfo.setAttributes(propertyBag);
              iConnInfo.setUserName(userName);
              iConnInfo.setPassword(password);
              connInfos.add(iConnInfo);
              String TableName = "Custom_Query";
              String TableAlias= "Custom_Query";
              CommandTable table = new CommandTable ();
              table.setAlias (TableAlias);
              table.setName (TableName);
              table.setConnectionInfo(iConnInfo);
              table.setCommandText("SET ROLE role");
              databaseController.addTable(table, null);
              catch (ReportSDKException e) {
                   System.out.println("......");
    When I tries to render a report from Java I received this ERROR:
    15:32:52,935 INFO  [STDOUT] 15:32:52,935 FATAL [JRCCommunicationAdapter] Request failed and JRC Command failed to be undone
    15:32:52,966 INFO  [STDOUT] 15:32:52,951 ERROR [JRCCommunicationAdapter]  detected an exception: Nessun risultato restituito dalla query.
         at com.crystaldecisions.reports.queryengine.Table.u7(Unknown Source)
         at com.crystaldecisions.reports.dataengine.datafoundation.AddDatabaseTableCommand.new(Unknown Source)
         at com.crystaldecisions.reports.common.CommandManager.a(Unknown Source)
         at com.crystaldecisions.reports.common.Document.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.f.a(Unknown Source)
         at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(Unknown Source)
         at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(Unknown Source)
         at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.a(Unknown Source)
         at com.businessobjects.sdk.erom.jrc.a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.ds.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.an.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.b0.if(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.b0.b(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.bb.int(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(Unknown Source)
         at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.a(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.byte(Unknown Source)
         at com.crystaldecisions.sdk.occa.report.application.DatabaseController.addTable(Unknown Source)
         at it.ServletHelper.querySetRole(ServletHelper.java:627)
    It's a big problem. If anyone has any idea, I'd greatly appreciate it.
    Thanks

    Hi all,
    running a report with two command from java (the first contains a simple "SEt ROLE role",
    the second contains a simple select) is raised the error "No results returned by the query" while in
    Crystal Reports 2008's preview the report works fine.
    Therefore I ask: "Is it possible to run a report that contains a query without result from Java?
    How can do with the SET ROLE command, which is essential for me?"
    Thanks

  • How to set roles from JDBC connections

    Hi guys,
    I have a jdbc connection which purpose is to run queries based on a string that I construct in my program.
    My question is: if I have to run a DCL, like: SET ROLE RL_XXX TO USER1;
    What's the easiest way to do it with my same connection?
    Thanks.

    Hi Marc,
    Sorry for the typo. It's a BDC source, I use a WCF client to access a SQL Database (HR External System) that has 4 fields that are necessary to present in the Sharepoint User Profile. The issue occurs with a Full or a Delta Sync. The problem is that if the
    BDC source is not present the fields are deleted (I get a SPS-Dummy Added and all of the pbjects in the BDC Connector Space are deleted).
    I do not want this to happen. I do not want the User Profile Attributes/Fields to be empty/deleted if there is no connection I simply want them to stay what they are... I have two issues.
    1) Is that the even if i change my data on SQL Server side, the changes do not get picked up by the sync. Since the only field that is being tested for change is an ADid, since the id does not change the BDC does not consider them changes.
    2) If there is no connection I do not want the attributes to be deleted. I have not figured out a way to effectively do this.
    So my issue appears to be simple to solve, but after 4 days and hundreds of tutorial pages read I have yet to figure out a proper way to do this.
    Here is the pseudo-specification
    The Fields that come form the HR System (SQL Server) are to be presented in the user profile. If there is no connection to the BDC file the fields remain as they are until there is a connection and updates can be made. Changes to any of the fields are performed
    manually in the HR system. These changes must be picked up by the daily sync.

  • Set role does not appear to be working

    Below, I've listed two blocks of code. The first block executes just fine. The second block throws an exception on the last line. The error returned from the server is "ORA-04043: object PERSON_VIEW does not exist". The only difference between the two blocks of code is how they log in. The first block logs in as a user with more rights. The second block logs in as a user with very little rights, but obtains more rights using the "set role" statement. I used SQL Plus to log in manually as the second user, executed the "set role" statement, and had no problem describing PERSON_VIEW. What am I doing wrong in the second block of code?
    Environment *pEnv = Environment::createEnvironment( Environment::OBJECT);
    Connection *pCon = pEnv->createConnection( "MYAPP", "PASSWORD", "MYDB");
    MetaData data = pCon->getMetaData( "PERSON_VIEW", MetaData::PTYPE_VIEW);
    Environment *pEnv = Environment::createEnvironment( Environment::OBJECT);
    Connection *pCon = pEnv->createConnection( "USER", "PASSWORD", "MYDB");
    Statement *pStatement = pCon->createStatement( "set role MYAPP_ROLE identified by PASSWORD");
    pStatement->executeUpdate();
    MetaData data = pCon->getMetaData( "PERSON_VIEW", MetaData::PTYPE_VIEW);

    In case anyone cares, the actual problem is that the OCCI throws an Ora-4043 when describing a SYNONYM in 10.1.0.3. This has been designated a bug and assigned to the development team. :o)

  • How can I set roles in Forms?

    I have a user granted with diferents roles, is there any posibility when he log on to the application( IN FORMS) to force him to choose with which role he would wants to work and start the application as if he had been granted only with this role?

    FORMS_DDL('SET ROLE MY_ROLE [IDENTIFIED BY PWD]');
    enables the given role and disables all others.

  • How to set role which can issue only one command

    I am thinking about setting role, which will be allowed to issue olny one command. I have created role test. Which has the following entries in the following files:
    /etc/user_attr
    test::::profiles=OneCommand;type=role
    /etc/security/exec_attr
    OneCommand:solaris:cmd:::/tmp/data.sh:euid=0
    After this I sill could issue all comands, not only test command /tmp/data.sh.
    When I issued comand profiles on test role I received the following:
    bash-3.00$ profiles test
    OneCommand
    Basic Solaris User
    All
    So I commented line in the /etc/policy.conf to read:
    #PROFS_GRANTED=Basic Solaris User
    After that, when I try to issue /tmp/data.sh command as a test role I receive the following error:
    $ /tmp/data.sh
    pfexec: Exec format error
    Does anybody know how to set up the role which can issue only one command ? Maybe there is a way to do this in the way which wil not affect another roles (ie, not to touch /etc/policy.conf).
    Best regards

    RadekW wrote:
    I am thinking about setting role, which will be allowed to issue olny one command. I have created role test. Which has the following entries in the following files:They will need the ability to run at least a profile shell otherwise all bets are off. So now you're down to two commands. :-)
    bash-3.00$ profiles test
    OneCommand
    Basic Solaris User
    AllFirst you need to define what already exists by default. (policy.conf)
    Then you get to change those defaults or create a new default list just for test.
    Then you get to add a role or profile for test that allows the execution of a profile shell and one command.
    Then you should test all of the user accounts to ensure that something didn't break. This step might be a little overkill.
    alan

  • How to set role based Authorization in JAAS

    how to set role based Authorization in JAAS
    i had user name , password and role in FileLogin
    thanks
    arun .v.

    http://dev2dev.bea.com/pub/a/2003/04/Kemp_Helton.html?page=last

  • Set Role from procedure

    I get this error if I try to execute SET ROLE <rolename> from
    the procedure
    Error::: ORA-06565: cannot execute SET ROLE from within stored procedure
    May I know how to activate the role from the procedure ?

    I tried DBMS_SESSION.SET_ROLE, but get the same error
    Error::: ORA-06565: cannot execute SET ROLE from within stored procedure

  • Why does SET ROLE start a transaction?

    Hi,
    I wonder why SQL command SET ROLE starts a transaction?
    Is it considered to be a DML command?
    If yes, then why?
    Check this simple PL/SQL example (where FND_ADMIN is any role granted to the user executing the code):
    SET SERVEROUT ON
    BEGIN
    dbms_output.put_line('[1]');
    dbms_output.put_line(dbms_transaction.local_transaction_id);
    dbms_output.put_line('[2]');
    dbms_session.set_role('FND_ADMIN');
    dbms_output.put_line('[3]');
    dbms_output.put_line(dbms_transaction.local_transaction_id);
    dbms_output.put_line('[4]');
    END;
    It gives the following output:
    [1]
    [2]
    [3]
    6.40.1217
    [4]
    Regards
    Håkan

    Hm... as documentation states, DBMS_SESSION.SET_ROLE is, quote, "... equivalent to the SET ROLE SQL statement", unquote.
    However, seems that it's doing something more than just SET ROLE:
    SQL> commit;
    Commit complete.
    SQL> select sid, taddr
      2    from v$session
      3   where sid = (select sid from v$mystat where rownum = 1);
           SID TADDR
            46
    SQL> set role CTXAPP;
    Role set.
    SQL> select sid, taddr
      2    from v$session
      3   where sid = (select sid from v$mystat where rownum = 1);
           SID TADDR
            46TADDR is empty – we don't have transaction and there is no transaction state object for our session.
    However:
    SQL> exec dbms_session.set_role('CTXAPP')
    PL/SQL procedure successfully completed.
    SQL> select sid, taddr
      2    from v$session
      3   where sid = (select sid from v$mystat where rownum = 1);
           SID TADDR
            46 5756BD74Why so? I don't know :) But obviously, DBMS_SESSION.SET_ROLE is not a precise equivalent to SET ROLE.
    Regards.

  • Need to call SET ROLE for Oracle before running report

    Hi all,
    does anyone know how I can call SET ROLE for Oracle with Crystal Reports, before running report? I'm using Crystal Reports 2008 to design report (with Server Oracle connection) and Java Reporting Component to run report within a J2EE apllication. If anyone has any idea, I'd greatly appreciate as I'm in trouble.
    Thanks a lot.

    Just a thought...
    If your report's datasource was an Oracle stored procedure, you could call a function to set the role from that SP
    You would be in the same Oracle session from  Report --> SP --> Function, so the role would be retained

  • Set role on/off

    Hello All Oracle Experts,
    I have a query regarding set role command.
    I was sybase user and migrated to Oracle. Now oracle user.
    I have two queries.
    1. In sybase, By default, all the roles granted to a user are disabled. You need to enable it if you want to use. But in Oracle, it looks like by default, all the roles granted to a user are enabled. that means, when you login using that user, all the roles granted to it are enabled.
    Can we change this behaviour ? I mean by default disabled all the roles
    2. It looks like there is no way i can disable only one role in a particular session.. For example, i logged in with user User1. it has roles Role1 and Role2 (which are enabled). Now i want to disable only Role1 for that session and not Role2.
    In sybase, i can do that by using Set role Role1 OFF.
    Is there any equalent in oracle?
    Please help me out in finding the answers. Please do let me know whether my observation regarding oracle or correct or not. You can even direct me to any documentation to know the answers.
    I searched in this forum to see if there is any exisitng post. But unfortunately, looks like nobody got the problem which i was facing.
    Thank you very much in advance for your time,
    Venkatesh.

    what if there are 10 roles(R1,R2...R10) and u don't
    know all of them. Have you really gone through the link which I had posted..
    Here you go …
    http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96521/privs.htm
    Read it again..
    Here you will find a view which gives info about - what are the roles are granted to you and which of them are default.
    Select * from ….<read the doc and find the view and place it here t> ;
    All you want is you have enabled role R3 in that
    session and you want to disable it.
    I read the posted links . But i didn't find the answer for whether we can disable one role >or not?I was wrong, that I thought you had read / understood what can be done with SET ROLE
    Again in nut shell
    Activating & Decactivating Roles
    Activating A Role      --->SET ROLE <role_name>;
    Activating A Password Protected Role      ---> SET ROLE <role_name> IDENTIFIED BY <role_password>;
    Activating All Roles      --->SET ROLE all;
    Activating All Roles Except One      --->SET ROLE all EXCEPT <role_name>;
    Deactivating A Role      --->Can not be done on an individual basis

  • SET ROLE WITH PASSWORD

    How can i to set role with password from a package ?
    the package dbms_session.set_role can set the password ?
    regards
    MDF

    Check this out.
    http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_10004.htm#sthref7302

  • Set role with Java JPA using NativeSQL

    Hi,
    using 10g setting roles with Java JPA and NativeSQL works fine. After the upgrade to 11g the same commands will not work.
    Ars ther any significant changes to set roles in 11g?
    Regards
    Siegwin

    Hi Siegwin,
    if you want to get help on a specific issue it would be helpful if you provide specific information. Despite the fact that this doesn't seem to be an XE specific question, you could provide additional information on your environment (JDK version, possibly container used, etc.; actual command issued, other things you may have done before to open/modify the session, etc.).
    I have one general hint anyway:
    Did you update your database drivers to support 11.2 as well? You probably use JDBC for your data source, so you should try the 11.2 JDBC drivers that fit to the JDK your application uses. I'm not sure if this already solves your problem, but it's highly recommended anyway as the 10.2 drivers will definetly come back with some trouble sooner or later when used against 11.2.
    -Udo

  • Set role with Java JPA and NativeSQL

    Hi,
    using 10g setting roles with Java JPA and NativeSQL works fine. After the upgrade to 11g the same commands will not work.
    Ars ther any significant changes to set roles in 11g?
    Regards
    Siegwin

    siegwin.port wrote:
    using 10g setting roles with Java JPA and NativeSQL works fine. After the upgrade to 11g the same commands will not work.
    Ars ther any significant changes to set roles in 11g?When I eval'd 11g, I did not notice any changes in setting my roles. I did notice a significant difference in Java. I cannot remember the JDK version change from 10g to 11g. We ended up settling back to 10g for other reasons.

Maybe you are looking for

  • Setup E-mail to yourself

    Hi Guys: How to setup a printer and How to setup en e-mail option in SAP , Example I Saved a Purchase order and I want to E-mail the Purchase order to myself Thanks Sweth

  • Adcfgclone.pl error

    Hi we are try to clone freshly installed linux server from the backup.db is over but we are try to run cfgclone in appstier we are facing this problem give below. [AutoConfig Error Report] The following report lists errors AutoConfig encountered duri

  • Lost my iPhoto program/will not open

    I am unable to open my iPhoto-any suggestions?

  • Full Import from 8.1.5 to 9.2 errors

    Hi Guys We are running with WinNT SP6, I created a 9.2 database, carried out a full import from a 8.1.5 database, no problems. When I try to do a full import again into the 9.2 database, I get IMP-00019: row rejected due to ORACLE error 1 IMP-00003:

  • Recording Via Iphone

    Hi, is this possible ? I go to the settings to look for On your YouView box, go to Settings>Device Management>Mobile Devices and select 'Connect Device'. After a few seconds, an eight digit code will appear on your TV screen the option for device man