user362283
user362283

Reputation: 95

Script to query multiple Oracle servers & instances

If I have a list of either database servers, or database instances, is there any way I can create and run a single script-query that would give me a list of all users in all databases? Are there any tools that would do this? Perhaps an OEM based enhancement?

Ideally I'd like to just point the script-query at a tnsnames file, with the appropriate username/password and let it run from there. We have Oracle v10.2 environment in AIX and Linux & windows.The database are not Oracle GRID managed.

Thanks

Upvotes: 0

Views: 681

Answers (1)

Dave
Dave

Reputation: 151

It might not be what you are after but you could create a set of dblinks from one db to all the others and then run a simple select statement across the dblinks

SELECT username from all_users@dblink1
UNION 
SELECT username from all_users@dblink2
UNION
SELECT username from all_users@dblink3 

etc.

If you had the DBLinks in place you could even create the select dynamically

Upvotes: 1

Related Questions