How to Create host concurrent

Source: Internet
Author: User
Purpose:
--------
To explain how to create a custom concurrent program with host as the method
(Shell script) and pass a number of user parameters from the concurrent program
To the shell script.

This example will implement a concurrent program that contains es two parameters
At the runtime of the concurrent program: the database username and the user's new
Password to be changed. The shell script. will connect to the database as system.
It will verify if the user's password can be changed.
(Note: allowed users will be stored in a flat file on the CM-node .)

Assumptions:
-----------

1. Oracle Applications release 11i is used. We are changing the Database User
Password, not Oracle Applications user's password.

2. We will not define a new application, responsibility, etc. Within 11i. We
Will use the existing application object library application and System
Administrator responsibility.

3. At runtime, the concurrent program will need two parameters: database username
And the new password. If the database username is not listed in allowed_list.lst,
The user's password can not be changed.

4. the DBA group will be notified by email once there is an attempt to change
Database user's password.

5. fndcpass cocould be used, but this is not the subject of this note.

6. If there is any user listed in the allowed_list.lst (one user per line, no
Extra spaces) and that user does not exist in the database, the concurrent
Request will complete OK, but the DBA group will get a notification that
"Database User doesn' t exist ".

7. Ensure the you test the procedure in a test environment several times
Become familiar with the procedure. Verify that the program does what you
Require prior to making the changes into production.

9. This procedure is not supported by Oracle Support Services. This is just
An example and will have to be adjusted for your own needs.

Scope & application:
--------------------
Technical Consultants, apps dBA, DBA.

Steps to create a custom concurrent program with host method and pass parameters to the shell script.
Bytes ----------------------------------------------------------------------------------------------------

1. Copy/modify (if needed) chgdbpwd to your cm-tier under $ fnd_top/bin.

2. Create File allowed_list.lst under <applmgr_home_directory>/scripts.

3. logon to Oracle Application 11i-> System Administrator responsibility

Navigate concurrent> program> executable and enter a new one:
Executable: Change Database User Password
Short Name: chgdbpwd
Application: Application Object Library
Description: Change Database User Password
Execution method: Host
Execution file name: chgdbpwd
Save your work.

4. navigate concurrent> program> define and enter a new one:
program: Change Database User Password
short name: chgdbpwd
application: application Object Library
Description: Change Database User Password
name: chgdbpwd
method: Host
click on parameters and add the following:
-seq: 10, parameter: Database User, Description: Enter database user to change the password for, value set: 15 characters, and click on the required: checkfield.
-seq: 11, parameter: Database User Password, Description: Enter database user's new password, value set: 15 characters, and click on the required: checkfield.
Save your work.

5. navigate Security> responsibility> request
Query for group: System Administrator reports and add one request
Type: Program, name: Change Database User Password
Save your work.

6. Restart the concurrent managers.

7. Submit the concurrent request "Change Database User Password", pass
Parameters, under System Administrator responsibility.

8. Connect using sqlplus to confirm the database user password has changed.

This procedure might help in case that helpdesk will be allowed to reset
Specific Database Password, without having access to database users system/sys.
Only the responsibility associated with the concurrent request "Change Database
User Password "defined above is needed.

----- Script. chgdbpwd starts here exist -----------------------------------------------------------------------------------
#! /Bin/KSh
# This script. is intended to change a Database User Password
#23. mar.2004, by Catalin ciontu
# Arguments: database username and password
# Setting of the environment...
Term = VT100
Export term
./D00/applvis/visdbappl/eclipora. env
Workdir = ~ /Scripts
Export workdir
CD $ workdir
Systempwd = <! Put_your_system_pwd_here!>
Export systempwd
Mailto = "cciontu@yahoo.com"
Export mailto
# Testing for passing the argument from CM...
If [-z "$1"]
Then
Echo "please pass the 1st argument... make sure that CM program passes the parameters to this script ...."
Exit 1
Fi
# Please build the allowed_list.lst prior to executing this script ....
Test-F allowed_list.lst
If [$? = 1]
Then
Echo "there is no list of allowed database users to have password changed... please create such a file under $ workdir/allowed_list.lst on the CM-tier: Enter one database user account per line... no extra spaces..."
Exit 1
Fi
# Because OA 11i passes its internal Params to any cm Program (ie. 1 to 8 are occupied by prog_name, req_id, login_id, userid, username, printer, save, copies), starting with the 9th we can have our own customized parameters: IE: database username and Its passwd.
USR = 'echo $1 | cut-F9-d "" | cut-F2-d '"''
Export USR
Pwd = 'echo $1 | cut-F10-d "" | cut-F2-d '"''
Export pwd
/Usr/bin/fgrep-I-x $ USR $ workdir/allowed_list.lst
If [$? = 0]
Then
# Connect to the database and change user's password...
Sqlplus-silent system/$ systempwd>/dev/null 2> & 1 <EOF
Set serveroutput on
Set feedback on
Set echo on
Spool chgdbpwd. lst
Alter user $ USR identified by $ PWD;
Spool off
Exit;
EOF
# Now, we'll sort y the DBA group for password change attempts...
/Usr/bin/mailx-s "Please be notified that an attempt to change a Database User Password-listed in the allowed_to_change_list: $ usr/$ PWD-was made in $ two_task instance... see Body for results... "$ mailto <$ workdir/chgdbpwd. LST>/dev/null 2> & 1
Rm chgdbpwd. lst
Fi
----- Script. chgdbpwd ends here exist -------------------------------------------------------------------------------------

----- Example of allowed_list.lst follows ----------------------------------------------------------------------------
Catalin
Mihaela
ADA
----- Example of allowed_list.lst ends here --------------------------------------------------------------------------

Remarks:
--------
1. As of Oracle Applications 11.5.9, the order of default parameters is like:
Fcp_reqid = 154870 fcp_login = "apps/..." fcp_userid = 1109 fcp_username = "Catalin"
Fcp_printer = "noprint" fcp_save_out = y fcp_num_copies = 0
If you want to specify your own parameters, you'll start with parameter Number 9. See the script. chgdbpwd.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.