{"id":3865,"date":"2021-04-16T07:26:15","date_gmt":"2021-04-16T07:26:15","guid":{"rendered":"https:\/\/swiv.com.br\/using-pdb-lockdown-profile-to-control-values-in-sql-statement\/"},"modified":"2026-05-27T20:02:32","modified_gmt":"2026-05-27T19:02:32","slug":"using-pdb-lockdown-profile-to-control-values-in-sql-statement","status":"publish","type":"post","link":"https:\/\/swiv.com.br\/index.php\/2021\/04\/16\/using-pdb-lockdown-profile-to-control-values-in-sql-statement\/","title":{"rendered":"Using PDB Lockdown Profile to control values in SQL Statement"},"content":{"rendered":"\n<p>Esse recurso de criar a regra do Lockdown com um range de valores poss\u00edveis \u00e9 muito legal. Vamos observar o meu Lockdown Profile atual e quais as regras que o mesmo possui:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n&#x5B;oracle@quiasma ~]$ sqlplus \/ as sysdba\n \nSQL*Plus: Release 18.0.0.0.0 - Production on Fri Apr 16 04:15:19 2021\nVersion 18.13.0.0.0\n \nCopyright (c) 1982, 2018, Oracle.  All rights reserved.\n \n \nConnected to:\nOracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production\nVersion 18.13.0.0.0\n \nSQL&gt; set lin 200\nSQL&gt; col profile_name format a30\nSQL&gt; col rule format a25\nSQL&gt; col clause format a20\nSQL&gt; SELECT PROFILE_NAME, RULE, CLAUSE, STATUS FROM DBA_LOCKDOWN_PROFILES WHERE PROFILE_NAME=&#039;PROFILE_DO_BRUNO&#039;;\n \nPROFILE_NAME                   RULE                      CLAUSE               STATUS\n------------------------------ ------------------------- -------------------- -------\nPROFILE_DO_BRUNO               PARTITIONING                                   DISABLE\nPROFILE_DO_BRUNO               ALTER SYSTEM                                   DISABLE\nPROFILE_DO_BRUNO               ALTER SYSTEM              KILL SESSION         ENABLE\n<\/pre><\/div>\n\n\n<p>Criando uma nova regra, incluindo os valores m\u00ednimos e m\u00e1ximos do par\u00e2metro cpu_count:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER LOCKDOWN PROFILE PROFILE_DO_BRUNO DISABLE STATEMENT= (&#039;ALTER SYSTEM&#039;) CLAUSE = (&#039;SET&#039;) OPTION = (&#039;CPU_COUNT&#039;) MINVALUE=&#039;1&#039; MAXVALUE=&#039;3&#039;;\n \nLockdown Profile altered.\n<\/pre><\/div>\n\n\n<p>Conectando no PDB que possui o Lockdown Profile associado:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER SESSION SET CONTAINER=HIPOFISE1;\n \nSession altered.\n \nSQL&gt; SHO PARAMETER CPU_COUNT;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\ncpu_count                            integer     1\n<\/pre><\/div>\n\n\n<p>Alterando valor do par\u00e2metro dentro do range permitido:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER SYSTEM SET CPU_COUNT=3;\n \nSystem altered.\n \nSQL&gt; SHO PARAMETER CPU_COUNT;\n \nNAME                                 TYPE        VALUE\n------------------------------------ ----------- ------------------------------\ncpu_count                            integer     3\n<\/pre><\/div>\n\n\n<p>Alterando par\u00e2metro com valor que excede o permitido:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \\&quot;wp-block-syntaxhighlighter-code\\&quot;\"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nSQL&gt; ALTER SYSTEM SET CPU_COUNT=4;\nALTER SYSTEM SET CPU_COUNT=4\n*\nERROR at line 1:\nORA-01031: insufficient privileges\n<\/pre><\/div>\n\n\n<p>Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laborat\u00f3rio pessoal para fins de aprendizado.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Esse recurso de criar a regra do Lockdown com um range de valores poss\u00edveis \u00e9 muito legal. Vamos observar o meu Lockdown Profile atual e quais as regras que o mesmo possui: Criando uma nova regra, incluindo os valores m\u00ednimos e m\u00e1ximos do par\u00e2metro cpu_count: Conectando no PDB que possui o Lockdown Profile associado: Alterando [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3865","post","type-post","status-publish","format-standard","hentry","category-multitenant"],"_links":{"self":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=3865"}],"version-history":[{"count":1,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3865\/revisions"}],"predecessor-version":[{"id":9168,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/posts\/3865\/revisions\/9168"}],"wp:attachment":[{"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=3865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=3865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/swiv.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=3865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}