Oracle Basics
Oracle Basics
delete table: drop table [table_name]; 2, Check the DB Version: select * from v$version; 3, Get current active User: show user; 4, Show the table structure: desc [table_name]; 5, Conn DB using user name and password: conn hr/hr; if you use Conn sys/pswd; have the following issue oracle ora-28009 connection as sys should be as sysdba or sysoper. You might need more privilege. conn sys/[email protected] as sysdba; 6,Disconnect from current User: disconnect; 7, Get all the tables under certain user: select * from tabs; select * from user_tables;
select * from v$database; !-- I do not like this one but sometime it might helpful! select name from v$database; 9,Check the Structure of DB desc v$database; 10, Get all users from one DB select * from v$instance; select instance_name from v$instance; 11, Get all the table names fr: select * from all_tables; select table_name from all_tables; select table_name from user_tables; select table_name from all_tables where owner='username'; 12, Clear the table data but keep the table structure. truncate table [table_name]