Wednesday, September 27, 2017

Script to create Oracle User account from Backend

DECLARE
   v_user_id   NUMBER;
BEGIN
   v_user_id :=
      fnd_user_pkg.createuserid (x_user_name              => 'FIRSTNAME.LASTNAME',
                                 x_owner                  => 'X',
                                 x_unencrypted_password   => 'welcome',
                                 x_description            => ' ',
                                 x_start_date             => SYSDATE);

   fnd_user_resp_groups_api.insert_assignment (
      user_id                         => v_user_id,
      responsibility_id               => 20420,  -- SYSADMIN Responsibility ID
      responsibility_application_id   => 1,         -- SYSADMIN APPLICATION ID
      start_date                      => SYSDATE,
      end_date                        => NULL,
      description                     => NULL);
   COMMIT;
   DBMS_OUTPUT.put_line (
      'Successfully created user and assigned Sysadmin responsibility');
EXCEPTION
   WHEN OTHERS
   THEN
      ROLLBACK;
      DBMS_OUTPUT.put_line (SQLERRM);
END;
/

Unix commands to get the count of files

 ls -l *.rdf | wc -l