Disclaimer

These scripts come without warranty of any kind. Use them at your own risk. I assume no liability for the accuracy, correctness, completeness, or usefulness of any information provided by this site nor for any sort of damages using these scripts may cause.
Showing posts with label apps DBA. Show all posts
Showing posts with label apps DBA. Show all posts

Monday, October 6, 2014

Oracle Apps: How to copy responsibilities assgined to a user to another user on same instance.

In the PROD instance, there is a user X who has 10 responsibilities assigned. Now you want to assign these 10 responsibilities to another user Y.  User Y already has 2 responsibility and want to copy remaining 8 responsibilities to user Y. You do not want to assign these responsibilities manually on the User Define form in System Administrator responsibility.

You can use a PL/SQL block similar to below to get it done.

 DECLARE

  resp_count NUMBER := 0;

  CURSOR src_user_resps
  IS
    SELECT DISTINCT fa.application_short_name,
      fr.responsibility_key                  ,
      fsg.security_group_key
       FROM fnd_application fa      ,
      fnd_responsibility fr         ,
      fnd_user fu                   ,
      fnd_user_resp_groups_all furga,
      fnd_security_groups fsg,
      fnd_responsibility_tl frt
      WHERE 1=1
      AND fu.user_name                        = '&From_Username'
      AND fu.user_id                          = furga.user_id
      AND fa.application_id                   = fr.application_id
      AND furga.responsibility_id             = fr.responsibility_id
      and furga.responsibility_id = frt.responsibility_id
      AND furga.responsibility_application_id = fa.application_id
      AND fsg.security_group_id               = furga.security_group_id
      AND furga.end_date IS NULL
minus
SELECT DISTINCT fa.application_short_name,
      fr.responsibility_key                  ,
      fsg.security_group_key
       FROM fnd_application fa      ,
      fnd_responsibility fr         ,
      fnd_user fu                   ,
      fnd_user_resp_groups_all furga,
      fnd_security_groups fsg,
      fnd_responsibility_tl frt
      WHERE 1=1
      AND fu.user_name                        = '&To_Username'
      AND fu.user_id                          = furga.user_id
      AND fa.application_id                   = fr.application_id
      AND furga.responsibility_id             = fr.responsibility_id
      and furga.responsibility_id = frt.responsibility_id
      AND furga.responsibility_application_id = fa.application_id
      AND fsg.security_group_id               = furga.security_group_id
      AND furga.end_date IS NULL;


BEGIN
  FOR user_resp_rec IN src_user_resps
  LOOP
    BEGIN
      --
      fnd_user_pkg.addresp
                 (username            => '&To_Username',
                  resp_app            => user_resp_rec.application_short_name,
                  resp_key            => user_resp_rec.responsibility_key,
                  security_group      => user_resp_rec.security_group_key,
                  description         => 'Demo',
                  start_date          => SYSDATE,
                  end_date            => NULL
                 );
    
      resp_count := resp_count + 1;
    
 EXCEPTION
    WHEN OTHERS THEN
    
      DBMS_OUTPUT.put_line ( 'Error while Adding Responsibility: ' || SQLERRM );
      DBMS_OUTPUT.put_line ( 'resp_app: ' || user_resp_rec.application_short_name );
      DBMS_OUTPUT.put_line ( 'resp_key: ' || user_resp_rec.responsibility_key );
    
    END;
  END LOOP;

  DBMS_OUTPUT.put_line (resp_count || '  Responsibilities copied Successfully!!' );

  COMMIT;

END;


Sunday, October 7, 2012

EBusiness - "Authentication Failed" while Save As Concurrent Output in the Internet Explorer

How to solve Oracle Apps "Authentication Failed" error while saving a concurrent output in IE

Got the error "Authentication Failed" when i try to save a concurrent output on my computer.
The saved concurrent request output does not contain anything other than "Authentication Failed"

Solution

1.  From Internet Explorer, select Tools > Interent Options
2.  On the General tab, in the "Temporary Internet files"  select the Settings
      For IE 8 and Above: Click on the Settings button under Browsing history
3. Change "Check for newer versions of stored pages:" to "Automatically"
4. Save changes

Saturday, August 13, 2011

Quick Reference on Database Characterset.

Recently i was upgrading the Oracle apps 11i to R12 and the customer want Arabic NLS. So i need to convert my database characterset form US7ASCII to a characterset that supports Arabic. I have confused which one should i use, UTF8 or AL32UTF8.  I did some reserch on oracle support and decided to use AL32UTF8.  Below given points helped me to make that decision.


The default UTF-8 (Unicode) characterset for 9i/10G is AL32UTF8, however this characterset is NOT recognized by any pre-9i clients/server systems.

Recommend that you use UTF8 instead of AL32UTF8 as database characterset if you have 8i (or older) servers and clients connecting to the 9i/10g system
until you can upgrade the older versions to 9i or higher.
UTF8 is Unicode revision 3.0 in 8.1.7 and up. AL32UTF8 is updated with newer Unicode versions in each major release

Besides the difference in Unicode version the "big difference" is that AL32UTF8 has build in support for "Surrogate Pairs", also known as "Surrogate characters"
or "Supplementary characters". Practically this means that in 99% of the cases you can use UTF8 instead of AL32UTF8 without any problem.
There is no performance difference between UTF8 and AL32UTF8. But seen UTF8 is NOT updated with newer Unicode versions we however suggest to use AL32UTF8 when possible.

Summary:
If you use 8.1 or 8.0 clients or servers or connect to 8.1 or 8.0 databases then use UTF8 as NLS_CHARACTERSET for the 9i (or up) databases, otherwise
(unless the application vendor explicit mentions UTF8 of course) use AL32UTF8.

For an Unicode database Oracle does not need "Unicode support" from the OS where the database is running on because the Oracle AL32UTF8 implementation is not depending on OS features
There is also no need to "install Unicode" or so for the Oracle database/client software, all character sets known in a database version , and this includes
Unicode character sets, are always installed. You simply cannot choose to not install them
If your current Oracle version is 8.1.7 or lower then it's best to upgrade first to a higher release, mainly because
a) you then can use AL32UTF8 (not possible in 8i)
b) Csscan has a few issues in 817 who might provoke confusion.
If your current Oracle version is 9i or up then both (before or after) are a good choice, it simply depends on your preference or needed application changes
Storage.
AL32UTF8 is a varying width characterset, which means that the code for 1 character can be 1 , 2 , 3 or 4 bytes long. This is a big difference with
character sets like WE8ISO8559P1 or WE8MSWIN1252 where 1 character is always 1 byte.