Search code examples
oracle-databaseamazon-rdsprivileges

How to use "alter system.." sql statement in AWS RDS oracle?


"ALTER SYSTEM FLUSH BUFFER_CACHE;" 

to delete data buffer cache of oracle db command was used.

But then the error occurred. SQL Error [1031] [42000]: ORA-01031

So I used another command:

"EXEC rdsadmin.rdsadmin_util.flush_buffer_cache; 

The following error occurred. SQL Error [900] [42000]: ORA-00900

According to the documentation, "exec admin.admin_util.flush_buffer_cache;" This command says it can be used, but can you tell me why it can't?

And is there any other way to do flust_buffer_cache?


Solution

  • The first error indicates that your user doesn't have privileges to use alter system.

    The second error indicates your command is incorrect. You seem to have lost the "rds" from "rdsadmin". Have you tried this:

    EXEC rdsadmin.rdsadmin_util.flush_buffer_cache;
    

    or

    begin
        rdsadmin.rdsadmin_util.flush_buffer_cache;
    end;
    /
    

    Per the AWS documentation, here: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.Oracle.CommonDBATasks.System.html