Skip to main content
Question

Iterate thru many oracle databases and get some data. How?

  • March 6, 2018
  • 5 replies
  • 20 views

Forum|alt.badge.img

Hi all,

I have ~50 oracle DBs. Each of them has instance name and the tnsnames.ora file is set up on the local machine. There is one same table in each of these DBs that I want to do a simple count on.

What is the best way to iterate thru all these DBs without the need to set up 50 or so readers?

Any input will be appreciated.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • March 6, 2018

Create a csv file (or similar) with the database credentials.

Then create a workspace to read the table for one of the databases (and output to a file or whatever you need). Publish username, password and service name.

Crate a runner workspace, reading the csv file and pass the credentials to a WorkspaceRunner transformer that runs the workspace reading the data.

The runner workspace loops through the databases and executes the "count" per database.


Forum|alt.badge.img
  • Author
  • 25 replies
  • March 6, 2018

Create a csv file (or similar) with the database credentials.

Then create a workspace to read the table for one of the databases (and output to a file or whatever you need). Publish username, password and service name.

Crate a runner workspace, reading the csv file and pass the credentials to a WorkspaceRunner transformer that runs the workspace reading the data.

The runner workspace loops through the databases and executes the "count" per database.

Hi

 

Thanks for that. I am not sure I understand it completely. Could you elaborate more. What transformers do I need?

 

 


erik_jan
Contributor
Forum|alt.badge.img+22
  • Contributor
  • 2179 replies
  • March 6, 2018
Hi

 

Thanks for that. I am not sure I understand it completely. Could you elaborate more. What transformers do I need?

 

 

csv reader in runner workspace followed by a WorkspaceRunner transformer.

 

Database reader in second workspace for reading the table followed by StatisticsCalculator if you just want a count and a Text writer to output the count for the table.

 

 


Forum|alt.badge.img
  • Author
  • 25 replies
  • March 8, 2018

I am a bit stuck still;

I created master WS (WS1) that has a csv reader. This gives me the service names of the DBs.

I connected to it a workspace runner transformer which runs WS2. In WS2 I have a published parameter for the service name (SID). Also I have a sql executor which uses the published SID as service name. And I just use a sql statement to count how many rows there are in a table.

How do I pass the service name from WS1 to the WS2?


jelle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • 122 replies
  • March 8, 2018

I am a bit stuck still;

I created master WS (WS1) that has a csv reader. This gives me the service names of the DBs.

I connected to it a workspace runner transformer which runs WS2. In WS2 I have a published parameter for the service name (SID). Also I have a sql executor which uses the published SID as service name. And I just use a sql statement to count how many rows there are in a table.

How do I pass the service name from WS1 to the WS2?

the WorkspaceRunner will create automatically the possibility to fill in an attribute value for each parameter. Select your SID attribute that you read from your CSV writer. In the example below, I pass the Windows Path coming from the PATH reader. Should be similar for you