Oracle in the real world

I recently started using oracle after several years of using mysql. I was immediately struck by how verbose oracle compares with mysql. Four-word queries (e.g. SHOW INDEX IN < table> ) become four-row queries in oracle.

My question is: how real oracle administrators effectively interact with the oracle. There must be some way to use the aliases of commonly used commands (for example, in a unix shell). I find it hard to believe that they would write something like

 select index_name, column_name, column_position from user_ind_columns where table_name='MYTABLENAME' order by index_name, column_position 

every time they wanted to do something as simple as listing the indexes of a table. Otherwise, how can they do any job?

+4
source share
1 answer

You can use an IDE like SQL Developer or Toad ; they have an interface for viewing tables, indexes, and other objects without entering any commands.

Or in SQL Plus, you can simply save frequently used queries as scripts in files, for example, a script called show_index might contain:

 select index_name, column_name, column_position from user_ind_columns where table_name=upper('&TABLENAME.') order by index_name, column_position; 

You would run this in SQL Plus as follows:

 SQL> @show_index Enter value for tablename: mytable 
+6
source

Source: https://habr.com/ru/post/1300741/


All Articles