Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display databases in Oracle 11g using SQL*Plus

With help of this command show databases; I can see databases in MySQL.

How to show the available databases in Oracle?

like image 418
Nubkadiya Avatar asked Jun 09 '10 08:06

Nubkadiya


People also ask

How do I find the database name in Oracle 11g?

There is column named 'Name' in V$database view. So you can use following query to find out the database name which is connected. The Complexsql is the database name on which the user is connected. The second method for finding out database name is using global_name system table.

How do I display a SQL Plus output?

To do this we use a procedure called dbms_output. put_line to place the results in a buffer that SQL*Plus will retrieve and display. SQL*Plus must be told to retrieve data from this buffer in order to display the results. The SQL*Plus command 'set serveroutput on' causes SQL*Plus to retrieve and display the buffer.

How can I see all tables in Oracle SQL Plus?

SELECT owner, table_name FROM all_tables; This query returns the following list of tables that contain all the tables that the user has access to in the entire database.


2 Answers

SELECT NAME FROM v$database; shows the database name in oracle

like image 69
Shan Avatar answered Sep 18 '22 07:09

Shan


You can think of a MySQL "database" as a schema/user in Oracle. If you have the privileges, you can query the DBA_USERS view to see the list of schemas:

SELECT * FROM DBA_USERS; 
like image 40
dpbradley Avatar answered Sep 19 '22 07:09

dpbradley