Tables to query to find users for database from shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tables to query to find users for database from shell script
# 1  
Old 04-10-2009
Tables to query to find users for database from shell script

I am coding shell script.

I need to connect to different databases like DB2, Oracle and Sybase.
I would then need to query tables where it has all the groups, users for that database.
I would also need who has what kind of permissions.
EG: I know for DB2 some TABAUTH table needs to be queried , i need help with other databases.


I have a list of server names.
I need to loop through each of them and connect and get this data.
what command can be used to connect to this servers.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script automation using cron which query's MySQL Tables

What I have: I have a input.sh (script which basically connect to mysql-db and query's multiple tables to write back the output to output1.out file in a directory) note: I need to pass an integer (unique_id = anything b/w 1- 1000) next to the script everytime I run the script which generates... (3 Replies)
Discussion started by: kkpand
3 Replies

2. Shell Programming and Scripting

How to use V$tables in UNIX shell script?

Hi All, In my script I have used the below code to retrieve the instance name V_INSTANCE_NAME=`sqlplus -s ${APPS_USR_PSWD} <<+ set pagesize 0 linesize 256 feedback off verify off head off echo off set serveroutput off select... (2 Replies)
Discussion started by: kalidoss
2 Replies

3. Shell Programming and Scripting

Help with script to create users from database query

#!/bin/bash user=`mysql userList -uuserlist -puserlistpassword -s -N -e "SELECT userName FROM users WHERE activated='n'"` for i in $user; do useradd "$i" -m doneThis is what I have done so far. But obviously it still does not work. I'm trying to create users based on information stored in a... (5 Replies)
Discussion started by: bucketuk
5 Replies

4. Shell Programming and Scripting

Need help in updating the tables inside shell script

I have an input file with contents like : 1LMXTJJD0W28TX2 1LS1XJGDEVWAC5T 1LK81JVDE2HRNDG 1LMXTJJD0W28TX2 1LS1XJGDEVWAC5T 1LK81JVDE2HRNDG 1LMXTJJD0W28TX2 I need to read each field from the file pass it to a query: select count(*) from usage_error where usage_id='$field... (17 Replies)
Discussion started by: Rajesh Putnala
17 Replies

5. Shell Programming and Scripting

Korn Script to connect and query oracle database

I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error: ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
Discussion started by: jackmorgan2007
2 Replies

6. Shell Programming and Scripting

How to run a SQL select query in Oracle database through shell script?

I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this? Is there a way to have a persistent connection to oracle database... (9 Replies)
Discussion started by: vel4ever
9 Replies

7. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

8. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

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

9. Shell Programming and Scripting

shell script to find unowned users and groups

Hello, I am new to Unix and shell scripting. I am trying to find unowned files and groups on my servers. I know, i could use the below command to find it on individual server. #find / -nouser -o -nogroup -print But I was wondering, if someone could help with a shell script so that I can... (2 Replies)
Discussion started by: ut916
2 Replies

10. Shell Programming and Scripting

compare two tables using shell script

Hi, I want to compare two tables fieldwise using shell script. Can anyone help me regarding the same. The approach which i tried is to first move the two tables in simple txt file where each field is now seperated by space. But i can't retrive each field with "space" as a seperator b'coz there... (1 Reply)
Discussion started by: dtidke
1 Replies
Login or Register to Ask a Question
NEWGRP(1)						    BSD General Commands Manual 						 NEWGRP(1)

NAME
newgrp -- change to a new group SYNOPSIS
newgrp [-l] [group] DESCRIPTION
The newgrp utility creates a new shell execution environment with modified real and effective group IDs. The options are as follows: -l Simulate a full login. The environment and umask are set to what would be expected if the user actually logged in again. If the group operand is present, a new shell is started with the specified effective and real group IDs. The user will be prompted for a password if they are not a member of the specified group. Otherwise, the real, effective and supplementary group IDs are restored to those from the current user's password database entry. EXIT STATUS
The newgrp utility attempts to start the shell regardless of whether group IDs were successfully changed. If an error occurs and the shell cannot be started, newgrp exits >0. Otherwise, the exit status of newgrp is the exit status of the shell. SEE ALSO
csh(1), groups(1), login(1), sh(1), su(1), umask(1), group(5), passwd(5), environ(7) STANDARDS
The newgrp utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A newgrp utility appeared in Version 6 AT&T UNIX. BUGS
For security reasons, the newgrp utility is normally installed without the setuid bit. To enable it, run the following command: chmod u+s /usr/bin/newgrp Group passwords are inherently insecure as there is no way to stop users obtaining the password hash from the group database. Their use is discouraged. Instead, users should simply be added to the necessary groups. BSD
February 8, 2013 BSD