Oracle extra codes

User

  • Show user,
show user;
  • List all users,
select * from all_users;
  • drop user,
drop user username cascade;

Tables & Views

  • List all tables,
select * from all_tables;
  • List all views,
select * from all_views;
  • Drop table,
drop table table_name;
  • description of a table,
desc table_name;

Profile

  • List all profiles,
select * from dba_profiles;
  • display a user profile in oracle
SELECT * FROM dba_profiles
WHERE profile = 'DEFAULT';
  • view the account expiration dates of all users in oracle
SELECT username, account_status, expiry_date
FROM dba_users
ORDER BY expiry_date;

just remember the dba_users table contains the account expiration dates of all users in Oracle.

  • drop profile,
drop profile profile_name cascade;

Triggers

  • List all triggers,
select * from all_triggers;
  • Drop trigger,
drop trigger trigger_name;
  • disable a trigger in oracle
alter trigger trigger_name disable;
  • enable a trigger in oracle
alter trigger trigger_name enable;

Finally special thanks to Sadman Sensei for coordination!