08-22-2018
Dear Robin
1. This is just learning exercise
2. I did try to rank option but looking for better approach
3. Looking for other option
4.Windows 10, DB2 v9
5.NA
Well I ranked based on roles first and have stored as reference tables. Since the roles may increases and example posted above has only 2 role examples .
Just to clear - I am new to DB2 and hope to learn from this post. Between I don't need exact code but the idea or heads up would work
Thanks
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Dear Guyz:)
I have 2 different input files like this. I would like to pick the values or letters from the inputfile2 based on inputfile1 keys (A,F,N,X,Z).
I have done similar task by using awk but in that case the inputfiles are similar like in inputfile2 (all keys in 1st column and values in... (16 Replies)
Discussion started by: repinementer
16 Replies
2. Shell Programming and Scripting
Hi ,
I am using a db2 query to get the maximum sequence number from a field.Now this value is taking up only 2 places.(i.e its less than 100).It can grow up to 3 places later but me requirement is that when i write it in a text file, it should be padded upto 8 places.
Please help (1 Reply)
Discussion started by: lifzgud
1 Replies
3. Shell Programming and Scripting
Hi,
I have a requirement as below which needs to be done viz UNIX shell script
(1) I have to connect to an Oracle database
(2) Exexute "SELECT field_status from table 1" query on one of the tables.
(3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies
4. Shell Programming and Scripting
Hi All,
I want to connect two tables in DB2 using shell script and then compare the contents of two tables field by field.and i should return on the screen the un matched records ..
Could any one please help me in connecting database tables using Unix and retriving data from the same. (1 Reply)
Discussion started by: kanakaraju
1 Replies
5. AIX
I am new to AIX, but not new to the UNIX world. Recently I got a request to come with some kind of report to do the following: report if user query is using > 70% CPU (within DB2) > 5 minutes. I am by no means a DB2 guru so I do not know how to get that from within it, so I was wondering if there... (4 Replies)
Discussion started by: savigabi
4 Replies
6. Shell Programming and Scripting
Hi,
Im new to DB2.
I need to connect to DB2 from shell script and return the query output back to shell script variable.
this is my code
#!/bin/ksh
db_name=db
db_user=usr
db_pwd=pwd
db2 <<EOSQL
connect to $db_name user $db_user using "$db_pwd"
select count(1) from table
quit
EOSQL ... (3 Replies)
Discussion started by: sup
3 Replies
7. Shell Programming and Scripting
Hi,
I want to replace a chain of if-else statement in an old AWK file with values from Db2 table or CSV file. The part of code is below...
if (start_new_rec=="true"){
exclude_user="false";
user=toupper($6);
match(user, "XXXXX.");
if (RSTART ==2 ) {
... (9 Replies)
Discussion started by: asandy1234
9 Replies
8. Shell Programming and Scripting
Hello,
i need some help with a script. I made a script, which connect to different hosts to get some informations. But i got now some problems with getting informations of a database (db2) which is on a other host. I tried something like
var=$(rsh HOST su - db2adm -c "db2 connect to database;... (2 Replies)
Discussion started by: Cyver
2 Replies
9. Programming
Hi Team
I am using DB2 artisan tool and struck to handle multi values present in columns that are comma(,) separated. I want to convert those column values in separate rows .
For example :
Column 1 Column2
Jan,Feb Hold,Sell,Buy
Expected Result
Column1 ... (3 Replies)
Discussion started by: Perlbaby
3 Replies
10. UNIX for Beginners Questions & Answers
I am using DB2 v9 and trying to get country values in comma seperated format using below query
SELECT distinct LISTAGG(COUNTRIES, ',') WITHIN GROUP(ORDER BY EMPLOYEE)
FROM LOCATION ;
Output Achieved
MEXICO,UNITED STATES,INDIA,JAPAN,UNITED KINGDOM,MEXICO,UNITED STATES
The table... (4 Replies)
Discussion started by: Perlbaby
4 Replies
roles(1) User Commands roles(1)
NAME
roles - print roles granted to a user
SYNOPSIS
roles [ user ...]
DESCRIPTION
The command roles prints on standard output the roles that you or the optionally-specified user have been granted. Roles are special
accounts that correspond to a functional responsibility rather than to an actual person (referred to as a normal user).
Each user may have zero or more roles. Roles have most of the attributes of normal users and are identified like normal users in passwd(4)
and shadow(4). Each role must have an entry in the user_attr(4) file that identifies it as a role. Roles can have their own authorizations
and profiles. See auths(1) and profiles(1).
Roles are not allowed to log into a system as a primary user. Instead, a user must log in as him-- or herself and assume the role. The
actions of a role are attributable to the normal user. When auditing is enabled, the audited events of the role contain the audit ID of the
original user who assumed the role.
A role may not assume itself or any other role. Roles are not hierarchical. However, rights profiles (see prof_attr(4)) are hierarchical
and can be used to achieve the same effect as hierarchical roles.
Roles must have valid passwords and one of the shells that interprets profiles: either pfcsh, pfksh, or pfsh. See pfexec(1).
Role assumption may be performed using su(1M), rlogin(1), or some other service that supports the PAM_RUSER variable. Successful assumption
requires knowledge of the role's password and membership in the role. Role assignments are specified in user_attr(4).
EXAMPLES
Example 1: Sample output
The output of the roles command has the following form:
example% roles tester01 tester02
tester01 : admin
tester02 : secadmin, root
example%
EXIT STATUS
The following exit values are returned:
0 Successful completion.
1 An error occurred.
FILES
/etc/user_attr
/etc/security/auth_attr
/etc/security/prof_attr
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO
auths(1), pfexec(1), profiles(1), rlogin(1), su(1M), getauusernam(3BSM), auth_attr(4), passwd(4), prof_attr(4), shadow(4), user_attr(4),
attributes(5)
SunOS 5.10 14 Feb 2001 roles(1)