I create connection to the server (successfully).

string oracleDbConnection = "Data Source=(DESCRIPTION=" + "(ADDRESS_LIST=" + "(ADDRESS=" + "(PROTOCOL=TCP)" + "(HOST=111.111.11.111)" \\ Здесь написал фейковый адрес + "(PORT=1521)" + ")" + ")" + "(CONNECT_DATA=" + "(SERVER=DEDICATED)" + "(SERVICE_NAME=ORCL)" + ")" + ");" + "User Id=test;Password=test;"; OracleConnection connection = new OracleConnection(oracleDbConnection); 

Further I wanted to see all the schemes (get their names, and other parameters in the future)

 connection.Open(); OracleCommand cursCmd = new OracleCommand("select * from all_users", connection); OracleDataReader reader = cursCmd.ExecuteReader(); 

Did everything right, gentlemen, and how to get a list of schemes further?

In the connection string, the connection is made via the main test circuit. As I explained, through it you can get information about all the other schemes on the server.

Ideally, you need to get a list of schemes in which the application will upload dumps.

  • Well, as if all right with the mind. in the all_users view, all_users really a list of all users. And in the user = the scheme. And then ... apparently read from the resulting cursor lines as with any other select - Mike
  • "get information about all other schemes" - what schemes are needed? if the tables, then so var tables = connection.GetSchema("Tables"); - Stack
  • Probably not quite. On the server there are about 30 schemes for each of which you can roll out application dumps. Each scheme, respectively, contains its own tables - Dmitry
  • list of schemes for oracle - here - Stack
  • @Stack In Oracle, the scheme is called only one thing, the same thing as the "database" in mysql, for example. And the schema contains the tables - Mike

1 answer 1

select * from all_users will list all users (schemas) on the Oracle server, including a bunch of system users.

For a list of charts on which there are tables available to the user under which you are connected, it is better to use the all_tables . And it is better to further limit the list, for example, by finding the schemas that contain a specific table:

 select owner from all_tables where table_name='xxx'