User Tools

Site Tools


dba:cli_commands

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dba:cli_commands [2025/12/02 16:25] – created mlivolsidba:cli_commands [2025/12/02 20:17] (current) – [Dumping and Restoring] mlivolsi
Line 4: Line 4:
  
  
-^ Command ^ Oracle ^ MySQL  ^ Posgres +^ Command ^ Oracle ^ MySQL  ^ Postgres 
-| Show databases (schema) | <code> select distinct owner from dba_objects where owner = </code> | show databases |  |+| Show databases (schema) |<code>select distinct owner  
 +from dba_objects  
 +where owner =' '</code>| show databases | \l |
 | Query Buffer | list | <up arrow >  | \p | | Query Buffer | list | <up arrow >  | \p |
 | Quit / Exit | exit | exit | \q | | Quit / Exit | exit | exit | \q |
 +| Display users |select * From dba_users;| | \du |
 +| Display Schemas | <same as show databases> | | \dn |
 +| Connect to a new DB | . |  | connect database |
 +| Dropping a schema | drop user <username> cascade | drop database <database_name> | drop schema <schema_name> cascade; ←- Will drop the schema and all objects |
 +| Show all tables | select * From dba_tables where owner = <owner> | show tables | \dt+ <schema_name>.* |
  
 +
 +
 +==== Privs ====
 +^ Command ^ Oracle ^ MySQL  ^ Postgres ^
 +| create user | create user <username> identified by <password>; | Same as Oracle | Create user <username> password <password>; |
 +
 +
 +==== Dumping and Restoring ==== 
 +^ Command ^ Oracle ^ MySQL  ^ Postgres ^
 +|dumping | expdp | mysqldump | pg_dump |
 +|Restore | impdp | mysql > source <file_name> | psql > \i <file_name>
dba/cli_commands.1764692711.txt.gz · Last modified: by mlivolsi