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
DBI::Shell(3)						User Contributed Perl Documentation					     DBI::Shell(3)

NAME
DBI::Shell - Interactive command shell for the DBI SYNOPSIS
perl -MDBI::Shell -e shell [<DBI data source> [<user> [<password>]]] or dbish [<DBI data source> [<user> [<password>]]] DESCRIPTION
The DBI::Shell module (and dbish command, if installed) provide a simple but effective command line interface for the Perl DBI module. DBI::Shell is very new, very experimental and very subject to change. Your milage will vary. Interfaces will change with each release. TO DO
Proper docs - but not yet, too much is changing. "/source file" command to read command file. Allow to nest via stack of command file handles. Add command log facility to create batch files. Commands: load (query?) from file save (query?) to file Use Data::ShowTable if available. Define DBI::Shell plug-in semantics. Implement import/export as plug-in module Clarify meaning of batch mode Completion hooks Set/Get DBI handle attributes Portability Emulate popular command shell modes (Oracle, Ingres etc)? COMMANDS
Many commands - few documented, yet! help /help chistory /chistory (display history of all commands entered) /chistory | YourPager (display history with paging) clear /clear (Clears the current command buffer) commit /commit (commit changes to the database) connect /connect (pick from available drivers and sources) /connect dbi:Oracle (pick source from based on driver) /connect dbi:YourDriver:YourSource i.e. dbi:Oracle:mysid Use this option to change userid or password. current /current (Display current statement in the buffer) do /do (execute the current (non-select) statement) dbish> create table foo ( mykey integer ) dbish> /do dbish> truncate table OldTable /do (Oracle truncate) drivers /drivers (Display available DBI drivers) edit /edit (Edit current statement in an external editor) Editor is defined using the enviroment variable $VISUAL or $EDITOR or default is vi. Use /option editor=new editor to change in the current session. To read a file from the operating system invoke the editor (/edit) and read the file into the editor buffer. exit /exit (Exits the shell) get /get (Retrieve a previous command to the current buffer) go /go (Execute the current statement) Run (execute) the statement in the current buffer. This is the default action if the statement ends with / dbish> select * from user_views/ dbish> select table_name from user_tables dbish> where table_name like 'DSP%' dbish> / dbish> select table_name from all_tables/ | more history /history (Display combined command and result history) /history | more option /option [option1[=value]] [option2 ...] /option (Displays the current options) /option MyOption (Displays the value, if exists, of MyOption) /option MyOption=4 (defines and/or sets value for MyOption) perl /perl (Evaluate the current statement as perl code) quit /quit (Leaves shell. Same as exit) redo /redo (Re-execute the previously executed statement) rhistory /rhistory (Display result history) rollback /rollback (rollback changes to the database) For this to be useful, turn the autocommit off. /option autocommit=0 table_info /table_info (display all tables that exist in current database) /table_info | more (for paging) trace /trace (set DBI trace level for current database) Adjust the trace level for DBI 0 - 4. 0 off. 4 is lots of information. Useful for determining what is really happening in DBI. See DBI. type_info /type_info (display data types supported by current server) AUTHORS and ACKNOWLEDGEMENTS The DBI::Shell has a long lineage. It started life around 1994-1997 as the pmsql script written by Andreas Konig. Jochen Wiedmann picked it up and ran with it (adding much along the way) as dbimon, bundled with his DBD::mSQL driver modules. In 1998, around the time I wanted to bundle a shell with the DBI, Adam Marks was working on a dbish modeled after the Sybase sqsh utility. Wanting to start from a cleaner slate than the feature-full but complex dbimon, I worked with Adam to create a fairly open modular and very configurable DBI::Shell module. Along the way Tom Lowery chipped in ideas and patches. As we go further along more useful code and concepts from Jochen's dbimon is bound to find it's way back in. COPYRIGHT
The DBI::Shell module is Copyright (c) 1998 Tim Bunce. England. All rights reserved. Portions are Copyright by Jochen Wiedmann, Adam Marks and Tom Lowery. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. perl v5.8.0 2002-11-29 DBI::Shell(3)