Author: techfox9

Oracle basic info ..

Thursday, March 2nd, 2006 @ 1:55 am

sqlplus user@db/password

  • Execute a script from sqlplus
  • List schemas:
    SELECT username FROM all_users ORDER BY username;
  • List tables in a schema:
    SELECT object_name, created FROM user_objects WHERE object_type=’TABLE’;
  • Get number of rows
    SELECT COUNT(*) FROM table;
  • Show table schema
    DESC table;
  • Limit number of rows
    SELECT * FROM table WHERE rownum < N;
  • Get current datetime
    SELECT to_char(sysdate, ‘mm/dd/yyyy hh:mi:ss’) FROM dual;

See for
a procedure to list table names and number of rows.

for an introduction to sqlplus.

Objects and resources:

Database, Oracle


Comments are closed.