Oracle: Get Database Server Host Name

In Oracle, it is possible to get a database server host name using a simple SQL query.

In this note i will show how to SELECT the Oracle database server host name you’re currently connected to, using the SQL query that doesn’t require any special permissions.

I will also show how to get the database name, the current schema/user and the name and IP address of the host machine from which the client has connected. (more…)

Oracle: Show Tables – SQL*Plus

Tables are the basic unit of data storage in Oracle databases.

In this note i will show how to list all tables in an Oracle database (equivalent to SHOW TABLES command in MySQL) using the command-line interface of SQL*Plus.

I will also show how to list only tables owned by the current user, show the tables that the current user has access to and how to show the tables owned by the particular user or in the particular schema. (more…)

Oracle: Show Databases – SQL*Plus

Oracle has no databases but schemas and users (that are essentially the same thing).

The schema/user in Oracle can be considered as an equivalent to a “database” concept in MySQL, PostgreSQL or MS SQL.

In this note i will show how to list all Oracle “databases” (equivalent to SHOW DATABASES command in MySQL), get the current schema name and how to switch to a different schemas using the command-line interface of SQL*Plus. (more…)