Pythian Blog: Technical Track

AWS's Top 5 Commands: ALTER SYSTEM and Managing SYS Objects in RDS

We often manage services over EC2, this is not news. But when migrating to Amazon RDS, it's usual for new users to have issues with performing some administrative actions on the database, especially when it's done via internal Oracle procedures or when it requires privileges beyond the ones we have available on RDS credentials, even though they are part of DBA work. Amazon Web Services created internal procedures so we can still execute those actions, but in a different manner. I decided to list five daily basis commands / procedures that frequently cause questions for initial users. Here it goes: Kill sessions:
begin
 rdsadmin.rdsadmin_util.kill(
 sid => &sid,
 serial => &serial,
 method => 'IMMEDIATE');
 end;
 /
Flush shared_pool or buffer_cache:
exec rdsadmin.rdsadmin_util.flush_shared_pool;
 exec rdsadmin.rdsadmin_util.flush_buffer_cache;
 
 
Grant Privileges to SYS Objects: # Grant
begin
  rdsadmin.rdsadmin_util.grant_sys_object(
  p_obj_name => 'V_$SESSION',
  p_grantee => 'PYTHIAN',
  p_privilege => 'SELECT');
 end;
 /
# Grant with Grant Option
begin
  rdsadmin.rdsadmin_util.grant_sys_object(
  p_obj_name => 'V_$SESSION',
  p_grantee => 'PYTHIAN',
  p_privilege => 'SELECT',
  p_grant_option => true);
 end;
 /
# Revoke
begin
  rdsadmin.rdsadmin_util.revoke_sys_object(
  p_obj_name => 'V_$SESSION',
  p_revokee => 'PYTHIAN',
  p_privilege => 'SELECT');
 end;
 /
Hope this helps!

No Comments Yet

Let us know what you think

Subscribe by email