MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/rdbms/xml/xsl/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/rdbms/xml/xsl/kudvauth.xsl

<?xml version="1.0"?>
<!-- 
NAME
    kudvauth.xsl
DESCRIPTION
    XSLT stylesheet for XML => DDL 
(1) conversion of ku$_dv_accts_t UDTs
    corresponding to Database Vault controlling DVSYS/DVF Accounts
    by enable_dv_dictionary_accts/disable_dv_dictionary_accts
(2) conversion of ku$_dv_auth_ddl_t UDTs
    corresponding to Database Vault Authorization for DDL
    by authorize_ddl
(3) conversion of ku$_dv_auth_dp_t UDTs
    corresponding to Database Vault Authorization for Data Pump
    by authorize_datapump_user
(4) conversion of ku$_dv_auth_job_t UDTs
    corresponding to Database Vault Authorization for Scheduler
    by authorize_scheduler_user
(5) conversion of ku$_dv_auth_maint_t UDTs
    corresponding to Database Vault Authorization for Maintenance
    by authorize_maintenance_user
(6) conversion of ku$_dv_auth_prep_t UDTs
    corresponding to Database Vault Authorization for Preprocessor
    by authorize_preprocessor
(7) conversion of ku$_dv_auth_proxy_t UDTs
    corresponding to Database Vault Authorization for Proxy User
    by authorize_proxy_user
(8) conversion of ku$_dv_auth_tts_t UDTs
    corresponding to Database Vault Authorization for Transportable Data Pump
    by authorize_tts_user
(9) conversion of ku$_dv_oradebug_t UDTs
    corresponding to Database Vault controlling ORADEBUG
    by enable_oradebug/disable_oradebug

NOTES
    Do NOT modify this file under any circumstance. Copy the file
    if you wish to use this stylesheet with an external XML/XSL parser
  
MODIFIED        MM/DD/YY
    sjavagal    10/04/17 - Bug 26882631: handle mixed case usernames
    sjavagal    08/15/17 - Bug 26325568: support for new datapump_auth APIs 
    qinwu       01/19/17 - proj 70151: add DV checks for DB Capture and Replay
    youyang     02/15/16 - bug22672722:add index functions
    jibyun      11/01/15 - introduce DIAGNOSTIC authorization
    yanchuan    07/27/15 - Bug 21299533: support for Database Vault
                           Authorization
    yanchuan    07/27/15 - Created
 -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <!-- Import the kucommon.xsl script, otherwise this template will never get invoked. See line 43 in kucommon.xsl, where the comment is "Top level template for all objects", this is the xsl equivalent of 'main'.  -->
 <xsl:import href="kucommon.xsl"/>
 <!-- Top-level parameters -->
 <!-- Parameters for DDL generation -->
 <xsl:param name="PRETTY">1</xsl:param>
 <xsl:param name="SQLTERMINATOR">0</xsl:param>
 <!-- Parameters required for DoParse to function correctly. -->
 <xsl:param name="PRS_DDL">0</xsl:param>
 <xsl:param name="PRS_DELIM">\{]`</xsl:param> 
 <xsl:param name="PRS_VERB">0</xsl:param>
 <xsl:param name="PRS_OBJECT_TYPE">0</xsl:param>
 <xsl:param name="PRS_SCHEMA">0</xsl:param>
 <xsl:param name="PRS_NAME">0</xsl:param>
 <xsl:param name="PRS_GRANTEE">0</xsl:param>
 <xsl:param name="PRS_GRANTOR">0</xsl:param>
 <xsl:param name="PRS_BASE_OBJECT_SCHEMA">0</xsl:param>
 <xsl:param name="PRS_BASE_OBJECT_NAME">0</xsl:param>
 <xsl:param name="PRS_BASE_OBJECT_TYPE">0</xsl:param>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to control DVSYS/DVF accounts in Database Vault environment -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_ACCTS_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_ACCTS</xsl:with-param>
  </xsl:call-template>
  <xsl:choose>
   <xsl:when test="STATE = 'ENABLED'">
    <xsl:text>BEGIN DVSYS.DBMS_MACADM.ENABLE_DV_DICTIONARY_ACCTS; END;</xsl:text>
   </xsl:when>
   <xsl:otherwise>
    <xsl:text>BEGIN DVSYS.DBMS_MACADM.DISABLE_DV_DICTIONARY_ACCTS; END;</xsl:text>
   </xsl:otherwise>
  </xsl:choose>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for DDL -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_DDL_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_DDL</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_DDL(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>, sname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="SCHEMA_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for Data Pump -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_DP_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_DP</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_DATAPUMP_USER(uname => </xsl:text>
    <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>, sname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="SCHEMA_NAME"/>
  </xsl:call-template>
  <xsl:text>, objname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="OBJECT_NAME"/>
  </xsl:call-template>
  <xsl:text>, action => </xsl:text>
  <xsl:call-template name="EscapeString">
   <xsl:with-param name="OrigStr" select="ACTION"/>
   <xsl:with-param name="Leading">'</xsl:with-param>
   <xsl:with-param name="Trailing">'</xsl:with-param>
   <xsl:with-param name="NullVal">NULL</xsl:with-param>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for SCHEDULER -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_JOB_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_JOB</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_SCHEDULER_USER(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>, sname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="SCHEMA_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for Maintenance -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_MAINT_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_MAINT</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_MAINTENANCE_USER(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>, sname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="SCHEMA_NAME"/>
  </xsl:call-template>
  <xsl:text>, objname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="OBJECT_NAME"/>
  </xsl:call-template>
  <xsl:text>, objtype => </xsl:text>
  <xsl:call-template name="EscapeString">
   <xsl:with-param name="OrigStr" select="OBJECT_TYPE"/>
   <xsl:with-param name="Leading">'</xsl:with-param>
   <xsl:with-param name="Trailing">'</xsl:with-param>
   <xsl:with-param name="NullVal">NULL</xsl:with-param>
  </xsl:call-template>
  <xsl:text>, action => </xsl:text>
  <xsl:call-template name="EscapeString">
   <xsl:with-param name="OrigStr" select="ACTION"/>
   <xsl:with-param name="Leading">'</xsl:with-param>
   <xsl:with-param name="Trailing">'</xsl:with-param>
   <xsl:with-param name="NullVal">NULL</xsl:with-param>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for Preprocessor  -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_PREP_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_PREP</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_PREPROCESSOR(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for Proxy -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_PROXY_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_PROXY</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_PROXY_USER(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>, sname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="SCHEMA_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for Transportable Data Pump
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_TTS_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_TTS</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_TTS_USER(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>, tsname => </xsl:text>
  <xsl:call-template name="EscapeString">
   <xsl:with-param name="OrigStr" select="TS_NAME"/>
   <xsl:with-param name="Leading">'</xsl:with-param>
   <xsl:with-param name="Trailing">'</xsl:with-param>
   <xsl:with-param name="NullVal">NULL</xsl:with-param>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for Diagnostic    -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_DIAG_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_DIAG</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_DIAGNOSTIC_ADMIN(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to enable ORADEBUG in Database Vault environment  -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_ORADEBUG_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_ORADEBUG</xsl:with-param>
  </xsl:call-template>
  <xsl:choose>
   <xsl:when test="STATE = 'ENABLED'">
    <xsl:text>BEGIN DVSYS.DBMS_MACADM.ENABLE_ORADEBUG; END;</xsl:text>
   </xsl:when>
   <xsl:otherwise>
    <xsl:text>BEGIN DVSYS.DBMS_MACADM.DISABLE_ORADEBUG; END;</xsl:text>
   </xsl:otherwise>
  </xsl:choose>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to add index functions  -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_INDEX_FUNC_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_INDEX_FUNC</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.ADD_INDEX_FUNCTION(OBJECT_NAME => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="OBEJCT_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for DBCAPTURE    -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_DBCAPTURE_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_DBCAPTURE</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_DBCAPTURE(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
 <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   - Template to grant Database Vault Authorization for DBREPLAY    -
   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
 <xsl:template match="DVPS_DV_AUTH_DBREPLAY_T">
  <xsl:call-template name="DoParse">
   <xsl:with-param name="Verb">DBMS_MACADM</xsl:with-param>
   <xsl:with-param name="ObjectType">DVPS_DV_AUTH_DBREPLAY</xsl:with-param>
  </xsl:call-template>
  <xsl:text>BEGIN DVSYS.DBMS_MACADM.AUTHORIZE_DBREPLAY(uname => </xsl:text>
  <xsl:call-template name="TSQuoteObject">
   <xsl:with-param name="Schema" select="GRANTEE_NAME"/>
  </xsl:call-template>
  <xsl:text>); END;</xsl:text>
  <!-- Terminate inner SQL statement -->
  <xsl:call-template name="DoTerminator">
   <xsl:with-param name="Text"/>
  </xsl:call-template>
 </xsl:template>
</xsl:stylesheet>


OHA YOOOO