How to disable PL/SQL in Oracle queries

前端 未结 1 779
余生分开走
余生分开走 2021-01-14 18:57

Here\'s an example of the sort of query I would like to prevent from running on my server:

begin
  While True
  LOOP
     dbms_output.put_line(\'tst\');
  EN         


        
相关标签:
1条回答
  • 2021-01-14 19:07

    You can't prevent people from writing procedural PL/SQL code against your server. Depending on the exact nature of the problem you're trying to solve, however, you may have other options. Two options that spring to mind...

    You can create a profile associated with the database user that enforces various resource limits. So you can limit the amount of CPU a single call can consume or the number of reads it can do. That lets you automatically kill sessions that do something like coding an infinite loop. Note that the RESOURCE_LIMIT initialization parameter needs to be set to TRUE in order for Oracle to enforce resource limits in profiles.

    You can use Oracle Resource Manager to prioritize access to resources to reduce the risk that a developer's mistake will take all the resources available on the server and starve the important production processes.

    0 讨论(0)
提交回复
热议问题