Operating System - HP-UX
1752273 Members
5053 Online
108786 Solutions
New Discussion юеВ

Check database SQL Statement?

 
SOLVED
Go to solution
Jacky Wong_1
Occasional Advisor

Check database SQL Statement?

Dear All,

Any one know the SQL statement if I want to check how many database, what database, what table inside the database and the owner of database inside the oracle DB server?

Thousand thanks!
Jacky Wong
3 REPLIES 3
Shahbaz_1
Regular Advisor
Solution

Re: Check database SQL Statement?

Hi,
At the o/s level (unix) you can know how many database instances are running by follwing command

$ ps -ef | grep pmon
--- It gives you the SID of all the database instances, which are running now.

Generally the owner of database will be Oracle.
goto
# su - oracle
# ls -lt

If you want to know, what tables the database containts, then you'll have to login to database.

$ sqlplus username/password@connect_string
or
$ sqlplus username/password

sqlplus> select * from user_tables;

Hope, it may helps you!!!
Regards
Syed
Let's share the great thing "THE KNOWLEDGE"
John Strang
Regular Advisor

Re: Check database SQL Statement?

Hello Jacky,

There is a file /etc/oratab which gives information about the database instances on the machine.

It contains 1 line for each instance, with 3 fields on each line.
1st field is the SID name
2nd field is the Oracle home directory
3rd field is Y or N for whether database should be started when machine is booted

Regards,

John
If you never make a mistake you'll never make anything.
Alexander M. Ermes
Honored Contributor

Re: Check database SQL Statement?

Hi there.
Did you try to get the Oracle Enterprise Manager ? This tool ( standard no extra packages ) should help to find and log all the necessary info.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"