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

Similar Messages

  • Default role  with password - reality check

    I support the database for an application. We upgraded from Oracle10 to Oracle11 9 months ago. Then recently we applied the OCT CPU.
    The application admin says that they have a program that has recently stopped working that worked after the Oracle11 upgrade.
    The application user has a default role which has a password. Is that possible? A default role with a password. Would this have ever worked in any version of Oracle?

    Default role with password is a feature even available with Oracle XE. Default roles are activated without requiring role password in Oracle 10.2:
    SQL> drop user admin cascade;
    User dropped.
    SQL> drop user test cascade;
    User dropped.
    SQL> drop role rwp;
    Role dropped.
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    SQL>
    SQL> create user admin identified by oraclexe;
    User created.
    SQL> grant create session, create table to admin;
    Grant succeeded.
    SQL> grant unlimited tablespace to admin;
    Grant succeeded.
    SQL> grant create user to admin;
    Grant succeeded.
    SQL> grant create role to admin;
    Grant succeeded.
    SQL>
    SQL> create user test identified by oraclexe;
    User created.
    SQL> grant create session to test;
    Grant succeeded.
    SQL>
    SQL> connect admin/oraclexe;
    Connected.
    SQL> create table t(x varchar2(10));
    Table created.
    SQL> insert into t values('admin OK');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create role rwp identified by oraclexe;
    Role created.
    SQL> grant all on t to rwp;
    Grant succeeded.
    SQL> grant rwp to test;
    Grant succeeded.
    SQL>
    SQL> connect test/oraclexe;
    Connected.
    SQL> select * from session_roles;
    ROLE
    RWP
    SQL> select * from admin.t;
    X
    admin OK
    SQL> insert into admin.t values('test OK');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from admin.t;
    X
    admin OK
    test OK
    SQL>There have been changes between Oracle 10.2 and 11.2 because the same script fails in 11.2 unless the role is set with the password:
    SQL> drop user admin cascade;
    User dropped.
    SQL> drop user test cascade;
    User dropped.
    SQL> drop role rwp;
    Role dropped.
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>
    SQL> create user admin identified by oraclexe;
    User created.
    SQL> grant create session, create table to admin;
    Grant succeeded.
    SQL> grant unlimited tablespace to admin;
    Grant succeeded.
    SQL> grant create user to admin;
    Grant succeeded.
    SQL> grant create role to admin;
    Grant succeeded.
    SQL>
    SQL> create user test identified by oraclexe;
    User created.
    SQL> grant create session to test;
    Grant succeeded.
    SQL>
    SQL> connect admin/oraclexe;
    Connected.
    SQL> create table t(x varchar2(10));
    Table created.
    SQL> insert into t values('admin OK');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> create role rwp identified by oraclexe;
    Role created.
    SQL> grant all on t to rwp;
    Grant succeeded.
    SQL> grant rwp to test;
    Grant succeeded.
    SQL>
    SQL> connect test/oraclexe;
    Connected.
    SQL> select * from session_roles;
    no rows selected
    SQL> select * from admin.t;
    select * from admin.t
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> insert into admin.t values('test OK');
    insert into admin.t values('test OK')
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> commit;
    Commit complete.
    SQL> select * from admin.t;
    select * from admin.t
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL>
    SQL> set role rwp identified by oraclexe;
    Role set.
    SQL> select * from session_roles;
    ROLE
    RWP
    SQL> select * from admin.t;
    X
    admin OK
    SQL> insert into admin.t values('test OK');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from admin.t;
    X
    admin OK
    test OK
    SQL>10.2 Security Guide says:
    If you are granted a role protected by a password, then you can enable or disable the role by supplying the proper password for the role in a SET ROLE statement. However, if the role is made a default role and enabled at connect time, then the user is not required to enter a password.
    11.1 and 11.2 Secuirty Guide says:
    If a user is granted a role protected by a password, then you can enable or disable the role by supplying the proper password for the role in the SET ROLE statement. You cannot authenticate a password-authenticated role on logon, even if you add it to the list of default roles. You must explicitly enable it with the SET ROLE  statement using the required password.
    Edited by: P. Forstmann on 20 févr. 2010 10:28

  • 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.

  • Setting apps with passwords

    my son who has autism has an ipas2 wifi for home and school.  he has several apps that we have set up as free choice items.  but if you turn your back he is into them.  so i have set them up in one of those menu boxes.  can i setup that menu box with a pasword so that he has to finish his tasks before he can play.
    thanks

    I assume by 'menu box' that you mean an app folder - and no, they can't be protected by passwords. Depending on what the actual apps are, you might be able to hide some of them via the app age rating setting in Settings > General > Restrictions, but apart from what you can do via Restrictions you can't hide anything else.

  • Set role in a form

    Hi,
    If I use DBMS_SESSION.SET_ROLE in a form to set a role with password protected, I must put the role password in my form. That what I do not want.
    Any idea to prevent this from happen?
    Thanks a lot
    Stephen

    A solution (which we used in the past within a application) is to put the role and password in a database table. The password should be stored encrypted (use e.g. dbms_obfuscation_toolkit to perform the encryption/descryption).
    At start up of the form you query the database table and set the role. The logged-in user should of course have select access to the table. The query of the database table can also be done by calling a database (package) procedure in which the query is done.
    Hope this will give you an idea how to proceed.

  • HT204053 My iPhone is set up with my old iCloud details. I can't remember the password, it is an old email address and it is not recognising my date of birth!! How can I delete it from my phone and enter my new Apple ID?

    My iPhone is set up with my old iCloud details - how do I change it to my new Apple ID - my email has changed. I can't remember old password and it's not recognising my date of birth. I no longer have the trusted device or key thing??

    Try going to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.

  • My ipad2 was set up with my apple id, i restored it and asked my apple id and password to set it up but i havent used that id for a long time i forgot everything about it what should i do?

    My ipad2 was set up with my apple id, i restored it and asked my apple id and password to set it up but i havent used that id for a long time i forgot everything about it what should i do? And i promise to my dead body i didnt steal my ipad it was a bday gift from my mom... Can anybody help me?

    If you at least know your Apple ID you can go to this Apple Support page.
    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/
    Click on Forgot My Password.
    Try to recover or set a new password. Hopefully your email addresses still get mail from Apple.

  • Set computer to lock with password in 5 seconds. now cannot open in time because of the 5 second shutdown. What can I do to now get into my computer??

    Set computer to lock with password in 5 seconds. now cannot open in time because of the 5 second shutdown. What can I do to now get into my computer??

    I'm not sure which option you set.  Requiring the password after 5 seconds in System Preferences > Security only kicks in after the sleep or screen saver.  The smallest option for sleep or screen saver is 1 minute.
    Which options did you set?

  • So my iphoto is set up with a different apple account from my current one... the email on the old account is out of date and i do not know the password for it. my copmuter will not let me update my iPhoto nor will my old email account allow me to accessit

    so my iphoto is set up with a different apple account from my current one... the email on the old account is out of date and i do not know the password for it. my copmuter will not let me update my iPhoto nor will my old email account allow me to accessit

    Did you try this Apple website regarding your old Apple ID and its password: Apple ID: If you forget your password
    OT

  • I signed up yesterday with synch. I dont know my password and I need it to reset a new password. Please advise how to set a new password when I dont know old 1

    I signed up yesterday with synch. I don't know my password and I need it to reset a new password. Please advise how to set a new password when I dont know old 1
    I set it up on my "upstairs computer" and then came to my "downstairs computer" to synch and I can not get into the account because of the above password problem. I write down my passwords. I must have mistyped it or mis written.
    I want to change my password

    The new Sync version uses the Firefox account and stores the login data (username/email and password) under the https://accounts.firefox.com site heading in the Password Manager and use the signedInUser.json file in the profile folder to store the credentials once connected to the account to avoid having to enter the master password on each start.

  • Got premium with Facebook login - how do i set a username/password for regular login

    Hello all,i got the student premium whilest logged in with facebook, but i would like to set a usename/password to log in 'normally'. how can i do that?thank you!

    Hey there , welcome to the community!
    I apologize for the late reply. The workaround for this would be to create a new account. If you contact the accounts team through the online contact form they can set you up with a new account and transfer over all your content. If you receive an automated reply directing you back to the community, just reply to it and you will be connect with an agent that can assist you.

  • What can i do? i forgot my password (iCloud) and i don't know the security questions also, the email that was set up with that account was deleted a long time ago, so i cannot update my applications on my iphone 4S.... THANK YOU!!!!

    URGENT What can i do? i forgot my password (iCloud) and i don't know the security questions also, the email that was set up with that account was deleted a long time ago, so i cannot update my applications on my iphone 4S.... THANK YOU!!!!

    Try the methods described here in this link:  Apple ID: All about Apple ID security questions
    If neither your recovery email works nor do you know the answers to the security questions, you need to give Apple Support a call - only they will be able to help you. See this webpage on how to contact Apple Support in your country: There are either telephone numbers given or an email form:
         Apple ID: Contacting Apple for help with Apple ID account security
    Explain, that you need help with an account security problem.
    You can also try to email the iTunes Support using this form: https://ssl.apple.com/emea/support/itunes/contact.html

  • ORA-01924 - pb with a set role

    Hi,
    When I launch a workflow with sqlplus_exec_template.sql I have the following error:
    set role wb_r_owb_rt, wb_u_owb_rt
    ERROR at line 1:
    ORA-01924: role 'WB_R_OWB_RT' not granted or does not exist
    What do I have to do ?

    I was executing the sqlplus_exec_template.sql as user my_user.
    I had to login as sys and execute these 2 stmts:
    grant WB_U_OWB_RT_REP to my_user;
    grant WB_R_OWB_RT_REP to my_user;
    I gathered this info from this doc:
    http://www.oracle.com/technology/sample_code/products/warehouse/files/restore_runtime.txt

  • Connection to MS Access 2002 with password setting

    Hello together,
    i have a MS Access 2002 file with password protection. Now i want to connect with SQL Developer 1.1 (Win) to these "Database" File. The Connection to a unprotected File is running well. I it possible to connect to a protected Access Database File?
    Tanks for your comments
    have a nice evening
    Sven

    Right now no, I have it swiched off and doc to remove the password. I will change it tho so you can add a password to the connection.

Maybe you are looking for