<?xml version="1.0" encoding="UTF-8" ?>
<!--
  ~ Copyright (c) DbVis Software AB. All Rights Reserved.
  -->

<!DOCTYPE DatabaseProfile SYSTEM "dbvis-defs.dtd">
 
<DatabaseProfile
        desc="Profile for Oracle"
        minver="9.5"
        extends="generic">

   <!-- =================================================================== -->
   <!-- Definition of initialization commands                               -->
   <!-- =================================================================== -->

   <InitCommands extends="true">
      <Command id="oracle.javasnmExists">
         <SQL>
            <![CDATA[
SELECT
    1
FROM
    ${#cp.SystemTablePrefix}_OBJECTS
WHERE
    OBJECT_NAME = 'JAVASNM' AND
      (OBJECT_TYPE = 'TABLE' OR OBJECT_TYPE = 'VIEW');
            ]]>
         </SQL>
         <Output index="1" name="JAVASNM_EXISTS"/>
      </Command>

      <Command id="oracle.initInstanceNumber">
         <If test="#util.isDatabaseVersionLT(9)">
            <SQL><![CDATA[select -1 from dual]]></SQL>
            <Output name="OWN_INSTANCE_NUMBER" index="1"/>
         </If>
         <Else>
            <SQL><![CDATA[select instance_number from v$instance]]></SQL>
            <Output name="OWN_INSTANCE_NUMBER" index="1"/>
         </Else>
         <OnError>
          
            <If test="#result.getErrorCode() eq 942" context="runtime">
               <Message type="info">
                  <![CDATA[
Could not to retrieve own INST_ID (probably due to missing privileges) which is needed to browse DBA->Sessions, etc. DbVisualizer will work fine but related features will be disabled
                ]]>
               </Message>
            </If>
         </OnError>
      </Command>
       
      <Command id="oracle.rolesTableExists">
         <SQL>
            <![CDATA[
SELECT
    1
FROM
    SYS.DBA_ROLES
            ]]>
         </SQL>
         <Output index="1" name="ROLES_TABLE_EXISTS"/>
         <OnError>
            <If test="#result.getErrorCode() eq 942" context="runtime">
               <Message type="info">
                  The SYS.DBA_ROLES table is not readable (probably due to missing privileges). DbVisualizer will work fine but roles are not available for Grant Privilege actions
               </Message>
            </If>
         </OnError>
      </Command>
   </InitCommands>

   <!-- =================================================================== -->
   <!-- Definition of the commands -->
   <!-- =================================================================== -->

   <Commands extends="true">

      <!-- =================================================================== -->
      <!-- Definition of the generic error handler (for all Commands). Its -->
      <!-- conditions will be evaluated with possible errors produced by each -->
      <!-- commands. If a match is found then the text in the <Message> -->
      <!-- element will be displayed in DbVisualizer. -->
      <!-- =================================================================== -->

      <OnError>
         <!-- The ORA-942 error means "the table or view doesn't exist" -->
         <!-- It is catched here since these errors typically indicates -->
         <!-- that the user don't have privileges to access the SYS and/or -->
         <!-- V$ tables. -->
         <If test="#result.getErrorCode() eq 942" context="runtime">
            <Message>
               <![CDATA[
               You probably don't have the required privileges to view/manage this object.
               ]]>
            </Message>
         </If>
         <ElseIf test="#result.getErrorCode() in {17410, 17447}" context="runtime">
            <!--
              Oracle may report several errors while the connection is
              interrupting. This take care of those that are reported while
              Connection.isClosed() is still false. At some point the Oracle
              driver think the connection is really dead and returns true
              for Connection.isClosed(). That condition is taken care of by
              DbVisualizer and a generic message is displayed.
            -->
            <Message>
               <![CDATA[
               Your Oracle connection with the database server has been interrupted!
               Please <a href="connect" action="connect">connect</a> to re-establish the connection.
               ]]>
            </Message>
         </ElseIf>
      </OnError>

      <!--
        The "getTableNamesFor" command is used by Database getTableNamesFor().
        It must return table names for the catalog and schema named by
        the ${table_catalog} and ${table_catalog} variables in the first
        column.
      -->
      <Command id="oracle.getTableNamesFor">
         <SQL>
            SELECT TABLE_NAME
            <If test="#util.isDatabaseVersionGT(7)">
               FROM SYS.ALL_ALL_TABLES
            </If>
            <Else>
               FROM SYS.ALL_TABLES
            </Else>
            WHERE OWNER = '${table_schema}'
            ORDER BY TABLE_NAME
         </SQL>
      </Command>

      <!--
        The "getColumnNamesFor" command is used by Database getColumnNamesFor().
        It must return column names for the catalog, schema and table named by
        the ${table_catalog}, ${table_catalog} and ${table_name} variables in
        the first column.
      -->
      <Command id="oracle.getColumnNamesFor">
         <SQL>
            <![CDATA[
SELECT COLUMN_NAME
FROM SYS.ALL_TAB_COLUMNS
WHERE OWNER = '${table_schema}'
  AND TABLE_NAME = '${table_name}'
ORDER BY COLUMN_NAME
            ]]>
         </SQL>
      </Command>

      <!-- =================================================================== -->
      <!-- Here follows all <Command>'s -->
      <!-- =================================================================== -->

      <!-- Our own getSchemas as the generic.getSchemas doesn't include the -->
      <!-- PUBLIC user. We need it to be able to present public synonyms. -->
      <!-- The SQL should optimally get owners from ALL_OBJECTS instead of -->
      <!-- ALL_USERS. -->
      <!-- This would give the most accurate listing of schemas since -->
      <!-- only schemas having objects would be presented. Problem is that -->
      <!-- the exec time increases to a couple of seconds and that is not -->
      <!-- acceptable. -->

      <Command id="oracle.getSchemas">
         <If test='! #cp.getBool("ShowEmptySchemas")'>
            <!-- Just show the users that have objects in order to
                 prevent a huge list of schemas but do include PUBLIC -->
            <SQL>
               <![CDATA[
SELECT
    username AS TABLE_SCHEM
FROM
    ${#cp.SystemTablePrefix}_users
WHERE
    exists (select 'x' from sys.obj$ where user_id = owner# and type# != 5)
union
SELECT
    'PUBLIC' AS TABLE_SCHEM
FROM
    dual
ORDER BY
    TABLE_SCHEM
               ]]>
            </SQL>
         </If>
         <Else>
            <SQL>
               <![CDATA[
SELECT
    username AS TABLE_SCHEM
FROM
    ${#cp.SystemTablePrefix}_users
UNION
SELECT
    'PUBLIC' AS TABLE_SCHEM
FROM
    dual
ORDER BY
    TABLE_SCHEM
               ]]>
            </SQL>
         </Else>
      </Command>

      <Command id="oracle.getSchemaNames">
         <If test='! #cp.getBool("ShowEmptySchemas")'>
            <!-- Just show the users that have objects in order to
                 prevent a huge list of schemas but do include PUBLIC -->
            <SQL>
               <![CDATA[
SELECT
    username AS TABLE_SCHEM
FROM
    ${#cp.SystemTablePrefix}_users
WHERE
    exists (select 'x' from sys.obj$ where user_id = owner# and type# != 5)
union
SELECT
    'PUBLIC' AS TABLE_SCHEM
FROM
    dual
ORDER BY
    TABLE_SCHEM
               ]]>
            </SQL>
         </If>
         <Else>
            <SQL>
               <![CDATA[
SELECT
    username AS TABLE_SCHEM
FROM
    ${#cp.SystemTablePrefix}_users
UNION
SELECT
    'PUBLIC' AS TABLE_SCHEM
FROM
    dual
ORDER BY
    TABLE_SCHEM
               ]]>
            </SQL>
         </Else>
         <!--Must have Filter element here since this command is fetched from code-->
         <Filter index="TABLE_SCHEM" label="Name"/>
      </Command>

      <!-- Overridden since we want a lot more then the std one gives -->
      <Command id="oracle.getTables">
         <SQL>
            select * from
            <If test="#util.isDatabaseVersionGT(7)">
               ${#cp.SystemTablePrefix}_all_tables
            </If>
            <Else>
               ${#cp.SystemTablePrefix}_tables
            </Else>
            where owner = '${owner}'
            and temporary = '${temporary}'
            order by table_name
         </SQL>
      </Command>

      <!-- Overridden since we want a lot more then the std one gives -->
      <Command id="oracle.getTable">
         <SQL>
            select * from
            <If test="#util.isDatabaseVersionGT(7)">
               ${#cp.SystemTablePrefix}_all_tables
            </If>
            <Else>
               ${#cp.SystemTablePrefix}_tables
            </Else>
            where owner = '${owner}' and table_name = '${table}'
         </SQL>
      </Command>

      <Command id="oracle.getTableComments">
         <SQL>
            select b.owner, b.table_name , b.comments from
            <If test="#util.isDatabaseVersionGT(7)">
               ${#cp.SystemTablePrefix}_all_tables
            </If>
            <Else>
               ${#cp.SystemTablePrefix}_tables
            </Else>
            a, ${#cp.SystemTablePrefix}_tab_comments b
            where a.owner = '${owner}'
            and b.table_type = '${type}'
            and a.owner = b.owner
            and a.table_name = b.table_name
            order by a.table_name
         </SQL>
      </Command>

      <!-- Overridden since we want a lot more then the std one gives -->
      <Command id="oracle.getColumns">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_tab_columns
where owner = '${owner}' and
table_name = '${table}' order by column_id
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getColumnsComment">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_col_comments
where owner = '${owner}' and table_name = '${table}'
            ]]>
         </SQL>
      </Command>

      <!-- Overridden since the Oracle getIndexInfo call also does an
           analyze table which is bad -->
      <Command id="oracle.getTableIndexes">
         <SQL>
            <![CDATA[
select i.owner as index_owner,
       i.index_name,
       i.table_owner,
       i.table_name,
       i.uniqueness,
       c.column_position,
       c.column_name,
       c.descend,
       i.index_type,
       i.generated,
       i.status,
       i.last_analyzed
from ${#cp.SystemTablePrefix}_indexes i,
     ${#cp.SystemTablePrefix}_ind_columns c
where i.table_name = '${table}'
and (i.owner = '${owner}'
or  i.table_owner = '${owner}')
and i.index_name = c.index_name
and i.table_owner = c.table_owner
and i.table_name = c.table_name
and i.owner = c.index_owner
order by i.owner, i.table_name, i.index_name, c.column_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableConstraints">
         <SQL>
            <![CDATA[
select owner, table_name, constraint_name,
decode(constraint_type, 'C', 'Check',
                        'P', 'Primary Key',
                        'U', 'Unique',
                        'R', 'Foreign Key') as constraint_type,
decode(constraint_type, 'C', 'CONSTRAINT',
                        'P', 'CONSTRAINT',
                        'U', 'CONSTRAINT',
                        'R', 'REF_CONSTRAINT') as ddl_type,
search_condition, r_owner, r_constraint_name, delete_rule, status,
deferrable, deferred, validated, generated, bad, rely, last_change
            ]]>
             <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[
,index_owner, index_name, invalid, view_related
              ]]>
            </If>
            <![CDATA[
from ${#cp.SystemTablePrefix}_constraints
where owner = '${owner}' and table_name = '${table}'
order by constraint_name, constraint_type
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableReferencedBy">
         <SQL>
            <![CDATA[
select ref.owner, ref.table_name, ref.constraint_name,
decode(ref.constraint_type, 'C', 'Check',
                        'P', 'Primary Key',
                        'U', 'Unique',
                        'R', 'Foreign Key') as constraint_type,
decode(ref.constraint_type, 'C', 'CONSTRAINT',
                        'P', 'CONSTRAINT',
                        'U', 'CONSTRAINT',
                        'R', 'REF_CONSTRAINT') as ddl_type,
ref.search_condition, ref.r_owner, ref.r_constraint_name, ref.delete_rule, ref.status,
ref.deferrable, ref.deferred, ref.validated, ref.generated, ref.bad, ref.rely, ref.last_change
            ]]>
             <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[
,ref.index_owner, ref.index_name, ref.invalid, ref.view_related
              ]]>
            </If>
            <![CDATA[
from   ${#cp.SystemTablePrefix}_constraints this
,      ${#cp.SystemTablePrefix}_constraints ref
where  this.owner = '${owner}' and  this.table_name = '${table}'
and    this.owner = ref.r_owner
and    this.constraint_name = ref.r_constraint_name
order by ref.table_name, ref.constraint_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableConstraintColumns">
         <SQL>
            <![CDATA[
select owner, table_name, constraint_name, column_name, position
from ${#cp.SystemTablePrefix}_cons_columns
where owner = '${owner}' and table_name = '${table}' and constraint_name = '${constraint}'
order by position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTablePartitions">
         <SQL>
            <![CDATA[
select *
from   ${#cp.SystemTablePrefix}_tab_partitions
where  table_name = '${table}'
and    table_owner = '${owner}'
order by partition_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableSubPartitions">
         <SQL>
            <![CDATA[
select *
from   ${#cp.SystemTablePrefix}_tab_subpartitions
where  table_name = '${table}'
and    table_owner = '${owner}'
and    partition_name = '${part_name}'
order by subpartition_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTablePrivileges">
         <SQL>
            <![CDATA[
SELECT *
FROM   ${#cp.SystemTablePrefix}_tab_privs
WHERE  table_name = '${table}'
]]>
   <If test='#cp.getProperty("SystemTablePrefix") eq "dba"'>
<!-- In DBA_TAB_PRIVS the 'schema' column is named 'owner' -->
<![CDATA[
AND    owner = '${schema}'
]]>
   </If>
   <Else>
      <!-- In ALL_TAB_PRIVS the 'schema' column is named 'table_schema' -->
<![CDATA[
AND    table_schema = '${schema}'
]]>
</Else>
<![CDATA[
ORDER BY grantee;
]]>
         </SQL>
         <ProcessDataSet action="renamecolumn" index="TABLE_SCHEMA" value="OWNER"/>
         <ProcessDataSet action="renamecolumn" index="TABLE_NAME" value="OBJECT_NAME"/>
      </Command>

      <!-- Get info about Views. This picks all columns except the "text".
           The reason is that the text column may be quite large i.e
           performance penalty, it will also cause the grid viewer to
           be really wide. -->
      <Command id="oracle.getViews">
         <SQL>
            <![CDATA[
select owner, view_name, text_length, type_text_length, type_text,
oid_text_length, oid_text, view_type_owner, view_type
from ${#cp.SystemTablePrefix}_views where owner = '${owner}' order by view_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getViewComments">
         <SQL>
            <![CDATA[
select b.owner, b.table_name , b.comments
from ${#cp.SystemTablePrefix}_views a,
     ${#cp.SystemTablePrefix}_tab_comments b
where a.owner = '${owner}'
and b.table_type = 'VIEW'
and a.owner = b.owner
and a.view_name= b.table_name
order by a.view_name
            ]]>
         </SQL>
      </Command>

      <!-- Pick the "text" for the view -->
      <Command id="oracle.getViewSource">
         <SQL>
            <![CDATA[
select text
from ${#cp.SystemTablePrefix}_views
where owner = '${owner}' and view_name = '${name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getMaterializedViews">
         <SQL>
            <![CDATA[
select owner,mview_name,container_name,query_len,updatable,update_log,
master_rollback_seg,master_link,rewrite_enabled,rewrite_capability,
refresh_mode,refresh_method,build_mode,fast_refreshable,last_refresh_type,
last_refresh_date,staleness,after_fast_refresh,compile_state
from ${#cp.SystemTablePrefix}_mviews
where owner = '${owner}' order by mview_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getMaterializedViewSource">
         <SQL>
            <![CDATA[
select query
from ${#cp.SystemTablePrefix}_mviews
where owner = '${owner}' and mview_name = '${name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSequences">
         <SQL>
            <![CDATA[
select *
from ${#cp.SystemTablePrefix}_sequences
where sequence_owner = '${owner}'
order by sequence_name
            ]]>
         </SQL>
      </Command>

      <!-- Gets all synonyms and their source object type. If DB_LINK is -->
      <!-- not null then the remote object_type cannot be determined and -->
      <!-- it is always SYNONYM. The select will check if DB_LINK is not -->
      <!-- null and explicitly set the type to TABLE since this is the   -->
      <!-- commonly synonymed object i.e the Table ObjectView will be used for -->
      <!-- these. -->
      <!-- Note: The select is made by joining xxx_synonyms with xxx_objects. -->
      <!-- The join clause will return null in the case there is no -->
      <!-- match in the xxx_objects table. This happen for DB Links as -->
      <!-- these only have an entry in the xxx_synonyms table. -->
      <!-- DBVIS-692: If DB_LINK is null then all DbVis views defined for the -->
      <!-- target object type will be displayed based on the source object name -->
      <!-- rather than the synonym identifier (schema/name). If DB_LINK is -->
      <!-- not null then use the synonym identifier (schema/name) in all views. -->

      <Command id="oracle.getSynonyms">
         <SQL>
            <![CDATA[
SELECT
    s.owner "Synonym Owner",
    s.synonym_name "Synonym Name",
    s.table_owner "Object Owner",
    s.table_name "Object Name",
    CASE
      WHEN o.object_type is null THEN 'UnknownSynonymType'
      ELSE decode(s.db_link, null, replace(o.object_type, ' ', ''), 'TABLE') 
    END "Type",
    s.db_link "DB Link",
    decode(s.db_link, null, s.table_owner, '<Unknown>') "RefObjOwner",
    decode(s.db_link, null, s.table_name, s.synonym_name) "RefObjName"
]]>
            <If test="#util.isDatabaseVersionGTE(8)">
               <![CDATA[
FROM
    ${#cp.SystemTablePrefix}_synonyms s
    LEFT JOIN
        ${#cp.SystemTablePrefix}_objects o
        ON
            s.table_name  = o.object_name
            and s.table_owner = o.owner
WHERE
    (o.object_type is null or o.object_type like '${objecttype}'
     and o.object_type not in ('PACKAGE BODY', 'TABLE PARTITION'))
    and s.owner = '${owner}'
    and s.synonym_name like '${synonymname}'
    order by 2
]]>
            </If>
            <Else>
               <![CDATA[
FROM
    ${#cp.SystemTablePrefix}_synonyms s,
    ${#cp.SystemTablePrefix}_objects o
WHERE
    s.owner = '${owner}'
    and s.synonym_name   like '${synonymname}'
    and o.object_type    like '${objecttype}'
    and s.table_name     = o.object_name(+)
    and s.table_owner    = o.owner(+)
    and o.object_type(+) not in ('PACKAGE BODY', 'TABLE PARTITION')
    order by 2
]]>
            </Else>
         </SQL>
      </Command>

      <Command id="oracle.getSynonymedObjects">
         <SQL>
            <![CDATA[
SELECT
    s.owner "Synonym Owner",
    s.synonym_name "Synonym Name",
    s.table_owner "Object Owner",
    s.table_name "Object Name",
    CASE
      WHEN o.object_type is null THEN 'UnknownSynonymType'
      ELSE decode(s.db_link, null, replace(o.object_type, ' ', ''), 'TABLE') 
    END "Type",
    s.db_link "DB Link",
    decode(s.db_link, null, s.table_owner, s.owner) "RefObjOwner",
    decode(s.db_link, null, s.table_name, s.synonym_name) "RefObjName"
FROM
    ${#cp.SystemTablePrefix}_synonyms s,
    ${#cp.SystemTablePrefix}_objects o
WHERE
    s.table_owner = '${owner}'
    and s.owner != '${owner}'
    and s.table_name       = o.object_name(+)
    and s.table_owner      = o.owner(+)
    and o.object_type(+) not in ('PACKAGE BODY', 'TABLE PARTITION')
    order by 2
            ]]>
         </SQL>
      </Command>

      <!--SELECT-->
      <!--s.owner "Synonym Owner",-->
      <!--s.synonym_name "Synonym Name",-->
      <!--o.owner "Object Owner",-->
      <!--o.object_name "Object Name",-->
      <!--decode(o.object_type, 'CONSUMER GROUP', 'ConsumerGroup',-->
      <!--'EVALUATION CONTEXT', 'EvaluationContext',-->
      <!--'FUNCTION', 'Function',-->
      <!--'INDEX', 'Index',-->
      <!--'INDEXTYPE', 'IndexType',-->
      <!--'JAVA CLASS', 'JavaClass',-->
      <!--'JAVA RESOURCE', 'JavaResource',-->
      <!--'JOB CLASS', 'Job Class',-->
      <!--'LIBRARY', 'Library',-->
      <!--'LOB', 'Lob',-->
      <!--'OPERATOR', 'Operator',-->
      <!--'PACKAGE', 'Package',-->
      <!--'PACKAGE BODY', 'PackageBody',-->
      <!--'PROCEDURE', 'Procedure',-->
      <!--'PROGRAM', 'Program',-->
      <!--'QUEUE', 'Queue',-->
      <!--'SCHEDULE', 'Schedule',-->
      <!--'SEQUENCE', 'Sequence',-->
      <!--'SYNONYM', 'Synonym',-->
      <!--'TABLE', 'Table',-->
      <!--'TRIGGER', 'Trigger',-->
      <!--'TYPE', 'Type',-->
      <!--'TYPE BODY', 'TypeBody',-->
      <!--'VIEW', 'View',-->
      <!--'WINDOW', 'Window',-->
      <!--'WINDOW GROUP', 'WindowGroup',-->
      <!--o.object_type) "Type",-->
      <!--s.db_link "DB Link"-->
      <!--FROM-->
      <!--${#cp.SystemTablePrefix}_synonyms s,-->
      <!--${#cp.SystemTablePrefix}_objects o-->
      <!--WHERE-->
      <!--(s.owner = '${owner}' or s.table_owner = '${owner}')-->
      <!--and s.table_name       = o.object_name-->
      <!--and s.table_owner      = o.owner-->
      <!--order by 2-->


      <Command id="oracle.getPublicSynonyms">
         <SQL>
            <![CDATA[
SELECT
    s.synonym_name "Synonym Name",
    o.owner "Object Owner",
    o.object_name "Object Name",
    replace(o.object_type, ' ', '') "Type",
    s.db_link "DB Link"
FROM
    ${#cp.SystemTablePrefix}_synonyms s,
    ${#cp.SystemTablePrefix}_objects o
WHERE
    s.owner                = 'PUBLIC'
    and s.table_name       = o.object_name
    and s.table_owner      = o.owner
    and o.object_type not in ('JAVA CLASS', 'JAVA SOURCE')
    order by 1
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getJavaPublicSynonyms">
         <SQL>
            <![CDATA[
SELECT
    nvl(j.longname, s.synonym_name) "Synonym Name",
    o.owner "Object Owner",
    dbms_java.longname(o.object_name) "Object Name",
    replace(o.object_type, ' ', '') "Type",
    s.db_link "DB Link"
FROM
    ${#cp.SystemTablePrefix}_synonyms s,
    ${#cp.SystemTablePrefix}_objects o,
    javasnm j
WHERE
    s.owner                = 'PUBLIC'
    and s.table_name       = o.object_name
    and s.table_owner      = o.owner
    and s.synonym_name     = j.short(+)
    and o.object_type in ('JAVA CLASS', 'JAVA SOURCE')
    order by 1
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getIndexes">
         <SQL>
            <If test="#util.isDatabaseVersionGTE(8)">
               <![CDATA[
select i.*
from   ${#cp.SystemTablePrefix}_indexes i
left join sys.all_constraints c on
   i.index_name = c.index_name
   and i.table_name = c.table_name
   and i.owner = c.owner
where i.${indexOwner} and i.table_name like '${table}'
and c.table_name is null
and c.owner is null
and c.index_name is null
order by i.owner, i.index_name
]]>
            </If>
            <Else>
               <![CDATA[
select *
from ${#cp.SystemTablePrefix}_indexes i
where ${indexOwner} and table_name like '${table}'
and
(
    i.table_name not in
    (
        select
            c.table_name
        from
            sys.all_constraints c
        where
            i.index_name = c.index_name
        and i.table_name = c.table_name
        and i.owner      = c.owner
    )
)
order by owner, index_name
]]>
</Else>
         </SQL>
      </Command>

      <Command id="oracle.getIndexColumns">
         <SQL>
            <![CDATA[
select *
from ${#cp.SystemTablePrefix}_ind_columns
where index_owner = '${indexOwner}'
and index_name = '${indexName}' order by column_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getIndexPartitions">
         <SQL>
            <![CDATA[
select *
from   ${#cp.SystemTablePrefix}_ind_partitions
where  index_name = '${name}'
and    index_owner = '${owner}'
order by partition_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getIndexSubPartitions">
         <SQL>
            <![CDATA[
select *
from   ${#cp.SystemTablePrefix}_ind_subpartitions
where  index_name = '${name}'
and    index_owner = '${owner}'
and    partition_name = '${part_name}'
order by subpartition_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getColumnTypes">
         <SQL>
            <![CDATA[
select *
from ${#cp.SystemTablePrefix}_coll_types
where coll_type = 'TABLE' and owner = '${owner}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getObjectsByType">
         <SQL>
            <![CDATA[
select owner, object_name, object_type, status, created, timestamp
from ${#cp.SystemTablePrefix}_objects
where owner = '${owner}' and object_type in (${type})
order by object_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getObjectsByTypeAndName">
         <SQL>
            <![CDATA[
select owner, object_name, object_type, status, created, timestamp
from ${#cp.SystemTablePrefix}_objects
where owner = '${owner}' and object_type in (${type}) and object_name like '${name}'
order by object_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getInvalidObjects">
         <SQL>
            <![CDATA[
SELECT
    owner "Object Owner",
    object_name "Object Name",
    replace(object_type, ' ', '') "Type",
    status "Status",
    created "Created"
FROM
    ${#cp.SystemTablePrefix}_objects
WHERE
    owner      = '${owner}'
    and status = 'INVALID'
ORDER BY
    object_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.compileInvalidObjects">
         <SQL>
            <![CDATA[
SELECT
    'ALTER ' ||
      DECODE(A.object_type,
             'PACKAGE BODY',
             'PACKAGE',
             'TYPE BODY',
             'TYPE',
             'SYNONYM',
             DECODE(A.owner,
                    'PUBLIC',
                    'PUBLIC SYNONYM',
                    'SYNONYM'),
             A.object_type) || ' "' ||
      DECODE(A.owner,
             'PUBLIC',
             NULL,
             A.owner || '"."') ||
      A.object_name || '" ' ||
      DECODE(A.object_type,
             'JAVA CLASS',
             'RESOLVE',
             'COMPILE') ||
      DECODE(A.object_type,
             ' PACKAGE BODY',
             ' BODY',
             ' TYPE BODY',
             ' BODY') || ';' text
FROM
    ${#cp.SystemTablePrefix}_objects A,
    (SELECT
       MAX(level) dlevel, object_id
         FROM public_dependency
         START WITH object_id IN (
           SELECT object_id
           FROM ${#cp.SystemTablePrefix}_objects
        WHERE status = 'INVALID'
     )
     CONNECT BY object_id = PRIOR referenced_object_id
     GROUP BY object_id) B
WHERE
    A.object_id  = B.object_id (+)
    AND A.status = 'INVALID'
    AND A.OWNER  = '${schema}'
ORDER BY
    B.dlevel DESC ,
    A.object_name ASC;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getObjectSource">
         <SQL>
            <![CDATA[
select text from ${#cp.SystemTablePrefix}_source
where type = '${type}' and owner = '${owner}' and name = '${name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getObjectInterface">
         <SQL>
            <![CDATA[
SELECT
    owner,
    object_name,
    argument_name,
    nvl(pls_type, type_owner || '.' || type_name || '.' || type_subname) AS "DATA_TYPE",
    in_out
FROM
    all_arguments
WHERE
    owner           = '${owner}'
    and object_name = '${name}'
    and package_name is null
ORDER BY
    object_name,
    position
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getPackageInterface">
         <SQL>
            <![CDATA[
select * from all_arguments
where owner = '${owner}' and package_name = '${name}'
order by object_name, in_out, position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getJavaObjects">
         <SQL>
            <![CDATA[
SELECT
    NVL(l.longname, s.object_name) "Name",
    s.created "Created",
    s.last_ddl_time "Last Modified",
    s.status "Status"
FROM
    ${#cp.SystemTablePrefix}_objects s,
    javasnm l
WHERE
    s.object_name     = l.short(+)
    and s.object_type = '${type}'
    AND s.owner       = '${owner}'
ORDER BY
    1
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getJavaSource">
         <SQL>
            <![CDATA[
SELECT text FROM ${#cp.SystemTablePrefix}_source s, javasnm l
WHERE s.owner = '${owner}' AND s.name = l.short(+) and
NVL(l.longname, s.name) = '${name}' AND s.type = 'JAVA SOURCE'
ORDER BY s.line
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTriggers">
         <SQL>
            <![CDATA[
SELECT
    owner,
    trigger_name,
    trigger_type,
    triggering_event,
    table_owner,
    base_object_type,
    table_name,
    column_name,
    referencing_names,
    when_clause,
    status,
    action_type,
    decode(table_name, null, base_object_type || ' - ' || triggering_event, base_object_type || ' - ' || triggering_event || ': ' || table_owner || '.' || table_name) "LABEL"
FROM
    ${#cp.SystemTablePrefix}_triggers
WHERE
    ${condition}
    and trigger_name not like 'BIN$%'
ORDER BY
    owner, trigger_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTriggerSource">
         <SQL>
            <!--
            NOT DOING THIS SINCE THE NEW DDL VIEW SHOWS THE COMPLETE DDL
            select 0 line, 'CREATE OR REPLACE ' text from dual
            union
            -->

            <![CDATA[
select line, text
from ${#cp.SystemTablePrefix}_source
where type = 'TRIGGER' and owner = '${owner}' and name = '${name}'
order by 1
            ]]>
         </SQL>
      </Command>

      <!-- This works from Oracle9i -->
      <Command id="oracle.getDDL">
         <SQL>
            <![CDATA[
select DBMS_METADATA.GET_DDL('${type}', '${name}', '${owner}') from dual
              ]]>
         </SQL>
      </Command>

      <!-- This works from Oracle9i -->
      <Command id="oracle.getDDL2">
         <SQL>
            <![CDATA[
SELECT
    decode('${type}'||'${name}','USERPUBLIC',
           'DDL is not available since "PUBLIC" is not a real user',
           DBMS_METADATA.GET_DDL('${type}', '${name}'))
FROM
    dual
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getObjectTypes">
         <SQL>
            <![CDATA[
select owner,type_name,typecode,attributes,methods,predefined,incomplete
            ]]>
             <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[
,final,instantiable,supertype_owner,supertype_name,local_attributes,local_methods,typeid
              ]]>
            </If>
            <![CDATA[
from ${#cp.SystemTablePrefix}_types where typecode in ('OBJECT', 'COLLECTION', 'XMLTYPE') and owner = '${owner}' order by type_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getObjectTypeAttributes">
         <SQL>
            <![CDATA[
select * from
${#cp.SystemTablePrefix}_type_attrs
where owner = '${owner}' and type_name = '${name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getObjectTypeMethods">
         <SQL>
            <![CDATA[
select * from
${#cp.SystemTablePrefix}_type_methods
where owner = '${owner}' and type_name = '${name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getErrors">
         <SQL>
            <![CDATA[
select sequence, line, position, text
from ${#cp.SystemTablePrefix}_errors
where owner = '${owner}' and name = '${name}' and type in (${type})
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDatabaseProperties">
         <SQL>
            <![CDATA[
select property_name "Name", property_value "Value", description "Description"
from database_properties order by property_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDatabaseInitParameters">
         <SQL>
            <![CDATA[
select *
from v$parameter
order by name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSessionNLSProperties">
         <SQL>
            <![CDATA[
select parameter "Name", value "Value"
from sys.nls_session_parameters order by parameter
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSessionRoles">
         <SQL>
            <![CDATA[
select role "Role"
from session_roles order by role
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSessionPrivs">
         <SQL>
            <![CDATA[
select privilege "Privilege"
from session_privs order by privilege
            ]]>
         </SQL>
      </Command>

      <!--
        The "schema = login_schema" test is needed since there is no
        all_recyclebin i.e it is not possible to login as one user and
        browse the recycle bin for another. Since we want the Recycle Bin
        object to appear among the other objects in a schema we need to
        check that the schema being explored is the same as the login schema.
      -->
      <Command id="oracle.getRecycleBin">
         <SQL>
            <![CDATA[
select * from user_recyclebin
where type = 'TABLE'
and '${schema}' = '${login_schema}'
order by type, original_name, droptime
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getAllRecycleBin">
         <SQL>
            <![CDATA[
select * from dba_recyclebin
where type = 'TABLE'
order by owner, type, original_name, droptime
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getJobs">
         <SQL>
            <![CDATA[
SELECT
    JOB,
    LOG_USER,
    PRIV_USER,
    SCHEMA_USER,
    LAST_DATE,
    LAST_SEC,
    THIS_DATE,
    THIS_SEC,
    NEXT_DATE,
    NEXT_SEC,
    TOTAL_TIME,
    BROKEN,
    INTERVAL,
    FAILURES,
    WHAT,
    NLS_ENV,
    INSTANCE,
    to_char(JOB) job_char
FROM
    ${#cp.SystemTablePrefix}_jobs
WHERE
    LOG_USER = '${owner}'
OR  SCHEMA_USER = '${owner}'
ORDER BY
    JOB;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerGlobalAttributes">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_global_attribute
union
select name||'(parameter)', value from v$parameter where name = 'job_queue_processes'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerChains">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_chains where owner='${owner}' and chain_name like '${chain_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerChainRules">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_chain_rules where owner='${owner}' and chain_name like '${chain_name}' and rule_name like '${rule_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerChainSteps">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_chain_steps where owner='${owner}' and chain_name like '${chain_name}' and step_name like '${step_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerChainsRunning">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_running_chains where owner='${owner}' and chain_name like '${chain_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerJobs">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_jobs where owner='${owner}' and job_name like '${job_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerCredentials">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_credentials where owner='${owner}' and credential_name LIKE '${credential_name}' order by credential_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerJobArguments">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_job_args where owner='${owner}' and job_name like '${job_name}' and argument_position like '${argument_position}' order by argument_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerJobClasses">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_job_classes where job_class_name like '${job_class_name}' order by job_class_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerJobLogs">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_job_log where owner='${owner}' and job_name like '${job_name}' order by LOG_DATE desc
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerJobRunDetails">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_job_run_details where owner='${owner}' and job_name like '${job_name}' order by LOG_DATE desc
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerJobsRunning">
         <SQL>
            <![CDATA[
select j.last_start_date start_date, r.*
from ${#cp.SystemTablePrefix}_scheduler_running_jobs r,
${#cp.SystemTablePrefix}_scheduler_jobs j
where r.job_name = j.job_name
and j.state    = 'RUNNING'
and j.owner    = r.owner
order by j.last_start_date
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerPrograms">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_programs where owner='${owner}' and program_name like '${program_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerProgramArguments">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_program_args where owner='${owner}' and program_name like '${program_name}' and argument_name like '${argument_name}' order by argument_position
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerSchedules">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_schedules where owner='${owner}' and schedule_name like '${schedule_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerWindows">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_windows where window_name like '${window_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerWindowDetails">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_window_details where window_name like '${window_name}' order by LOG_DATE desc
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerWindowLog">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_window_log where window_name like '${window_name}' order by LOG_DATE desc
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerWindowGroups">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_window_groups where window_group_name like '${window_group_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSchedulerWindowGroupMembers">
         <SQL>
            <![CDATA[
select * from ${#cp.SystemTablePrefix}_scheduler_wingroup_members where window_group_name like '${window_group_name}' and window_name like '${window_name}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDatabaseLinks">
         <SQL>
            <![CDATA[
SELECT
    OWNER,
    DB_LINK,
    USERNAME,
    HOST,
    CREATED
FROM
    ${#cp.SystemTablePrefix}_db_links
WHERE
    owner = '${owner}'
    or OWNER = 'PUBLIC'
ORDER BY
    owner,
    db_link
            ]]>
         </SQL>
      </Command>

      <!-- It seems that DBMS_METADATA.GET_DDL will not work for -->
      <!-- PUBLIC DB_LINK until 10.2, generating SQL manually is -->
      <!-- easy enough -->
      <Command id="oracle.getDatabaseLinkDDL">
         <SQL>
            <![CDATA[
SELECT 'CREATE' || decode('${owner}','PUBLIC',' PUBLIC','') || ' DATABASE LINK "'|| db_link ||'" CONNECT TO ' || username || ' IDENTIFIED BY "<password>" USING ''' || host || ''';' FROM ${#cp.SystemTablePrefix}_db_links WHERE OWNER = '${owner}' and DB_LINK = '${objectname}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDependentObjects">
         <SQL>
            <![CDATA[
            FIX THIS. Requires a new viewer being able to
            show two grids vertically. The top should show referenced
            objects while the bottom should show refering objects.
            Ultimately using a graph.

            --- NOT USED: Lists the objects that $$ID$$ references ---
SELECT
    owner,
    object_type,
    object_name,
    object_id,
    status ,
    decode(replace(object_type,' ','_'),'PACKAGE_BODY','PACKAGE',replace(object_type,' ','_')) type_link
FROM
    ${#cp.SystemTablePrefix}_objects
WHERE
    object_id IN
    (
    SELECT
        object_id
    FROM
        public_dependency CONNECT BY PRIOR object_id = referenced_object_id START
    WITH
        referenced_object_id = $$ID$$
    )

            --- NOT USED: Lists the objects that references $$ID$$ ---

SELECT
    B.OBJECT_ID,
    b.owner,
    b.object_type,
    b.object_name,
    b.status,
    replace(b.object_type,' ','_') type_link
FROM
    ${#cp.SystemTablePrefix}_objects a,
    ${#cp.SystemTablePrefix}_objects b,
    (
    SELECT
        object_id,
        referenced_object_id
    FROM
        public_dependency START
    WITH
        object_id = $$ID$$ CONNECT BY PRIOR referenced_object_id = object_id
    )
    c
WHERE
    a.object_id        = c.object_id
    AND b.object_id    = c.referenced_object_id
    AND a.owner NOT   IN ('SYS', 'SYSTEM')
    AND b.owner NOT   IN ('SYS', 'SYSTEM')
    AND a.object_name != 'DUAL'
    AND b.object_name != 'DUAL'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableDependencies">
         <SQL>
            <![CDATA[
SELECT
    owner,
    name,
    type,
    referenced_owner,
    referenced_name
FROM
    ${#cp.SystemTablePrefix}_dependencies
WHERE
    referenced_owner='${schema}'
AND referenced_name='${table}'
AND referenced_type='TABLE'

UNION ALL

SELECT
    owner,
    synonym_name,
    'SYNONYM',
    table_owner,
    table_name
FROM
    ${#cp.SystemTablePrefix}_synonyms
WHERE
    table_owner='${schema}'
AND table_name='${table}'
ORDER BY
    owner;
            ]]>
         </SQL>
      </Command>

      <!-- ================================================================= -->
      <!-- DBA related commands requiring certain privileges in the database -->
      <!-- ================================================================= -->

      <Command id="oracle.getUsers">
         <SQL>
            <![CDATA[
SELECT
    USERNAME,
    USER_ID,
    PASSWORD,
    ACCOUNT_STATUS,
    LOCK_DATE,
    EXPIRY_DATE,
    DEFAULT_TABLESPACE,
    TEMPORARY_TABLESPACE,
    CREATED,
    PROFILE,
    INITIAL_RSRC_CONSUMER_GROUP,
    EXTERNAL_NAME
FROM
    sys.dba_users
WHERE
    username like '${user}'
UNION
SELECT
    'PUBLIC' USERNAME,
    USER_ID,
    null PASSWORD,
    ACCOUNT_STATUS,
    LOCK_DATE,
    EXPIRY_DATE,
    null DEFAULT_TABLESPACE,
    null TEMPORARY_TABLESPACE,
    CREATED,
    null PROFILE,
    null INITIAL_RSRC_CONSUMER_GROUP,
    null EXTERNAL_NAME
FROM
    sys.dba_users
WHERE
    username = 'SYS'
    AND
    (
        '${user}'    = 'PUBLIC'
        OR '${user}' = '%'
    )
ORDER BY
    username
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getUserAndRoleNames">
         <SQL>
            <![CDATA[
select * from (
select ' ', 1 from dual
union all
select '--- Users ---', 2 from dual
union all
select distinct username, 3 from sys.all_users 
            ]]>
            <If test="#ROLES_TABLE_EXISTS eq 1">
            <![CDATA[
union all
select '--- Roles ---', 4 from dual
union all
select distinct role, 5 from sys.dba_roles
            ]]>
            </If>
            <![CDATA[
) order by 2, 1;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getGranteeRoles">
         <SQL>
            <![CDATA[
select * from sys.dba_role_privs where grantee = '${grantee}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getRoleUsers">
         <SQL>
            <![CDATA[
select granted_role, username
from sys.dba_role_privs drp, sys.dba_users du
where drp.grantee = du.username and drp.granted_role = '${role}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getGranteePrivileges">
         <SQL>
            <![CDATA[
select * from sys.dba_sys_privs where grantee = '${grantee}'
order by privilege
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getGranteeTablePrivileges">
         <SQL>
            <![CDATA[
select * from sys.dba_tab_privs where grantee = '${grantee}'
order by privilege, owner, table_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTablespaceQuota">
         <SQL>
            <![CDATA[
SELECT tablespace_name "Tablespace", username "User",
       (round(bytes)/1024/1024) "Used MB",
       decode(max_bytes, -1, 'Unlimited', round(max_bytes)/1024/1024) "Quota MB"
FROM sys.dba_ts_quotas
where username like '${user}'
AND  tablespace_name like '${tablespace}'
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getRoles">
         <SQL>
            <![CDATA[
select * from sys.dba_roles order by role
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableSpaces">
         <SQL>
            <![CDATA[
select * from sys.dba_tablespaces
where tablespace_name like '${tablespace}'
and contents like '${contents}'
order by tablespace_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableSpacesUsage">
         <SQL>
            <![CDATA[
SELECT
    a.tablespace_name "Tablespace",
    b.status          "Status",
    b.contents        "Type",
    b.extent_management "Extent Mgmt",
    ROUND(a.bytes_alloc / 1024 / 1024, 0) "Size MB",
    ROUND(NVL(c.bytes_free, 0) / 1024 / 1024, 0) "Free MB",
    ROUND((a.bytes_alloc - NVL(c.bytes_free, 0)) / 1024 / 1024, 0) "Used MB",
    ROUND((NVL(c.bytes_free, 0) / a.bytes_alloc) * 100,2) "Free %",
    100 - ROUND((NVL(c.bytes_free, 0) / a.bytes_alloc) * 100,2) "Used %",
    ROUND(maxbytes/1048576,2) "Max Size MB"
FROM
    (
     SELECT
            a.tablespace_name,
            SUM(a.bytes)                                                  bytes_alloc,
            SUM(DECODE(a.autoextensible, 'YES',a.maxbytes,'NO', a.bytes)) maxbytes
       FROM
            dba_data_files a
   GROUP BY
            tablespace_name) a,
    sys.dba_tablespaces b,
    (
     SELECT
            a.tablespace_name,
            SUM(a.bytes) bytes_free
       FROM
            dba_free_space a
   GROUP BY
            tablespace_name) c
WHERE
    a.tablespace_name = c.tablespace_name (+)
AND a.tablespace_name = b.tablespace_name
AND b.contents LIKE '${contents}'
UNION ALL
SELECT
    a.tablespace_name "Tablespace",
    b.status          "Status",
    b.contents        "Type",
    b.extent_management "Extent Mgmt",
    ROUND(SUM(a.bytes_free + a.bytes_used) / 1048576, 2) "Size MB",
    ROUND(SUM((a.bytes_free + a.bytes_used) - NVL(c.bytes_used, 0)) / 1048576, 2) "Free MB",
    ROUND(SUM(NVL(c.bytes_used, 0)) / 1048576, 2) "Used MB",
    ROUND((SUM((a.bytes_free + a.bytes_used) - NVL(c.bytes_used, 0)) / SUM(a.bytes_used + a.bytes_free)) * 100,2) "Free %",
    100 - ROUND((SUM((a.bytes_free + a.bytes_used) - NVL(c.bytes_used, 0)) / SUM(a.bytes_used + a.bytes_free)) * 100,2) "Used %",
    ROUND(SUM(d.maxbytes) / 1048576, 2) "Max Size MB"
FROM
    sys.v_$TEMP_SPACE_HEADER a,
    sys.dba_tablespaces b,
    sys.v_$Temp_extent_pool c,
    dba_temp_files d
WHERE
    c.file_id(+) = a.file_id
AND c.tablespace_name(+) = a.tablespace_name
AND d.file_id = a.file_id
AND d.tablespace_name = a.tablespace_name
AND b.tablespace_name = a.tablespace_name
AND b.contents LIKE '${contents}'
GROUP BY
    a.tablespace_name,
    b.status,
    b.contents,
    b.extent_management,
    d.maxbytes
ORDER BY
    1
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTableSpacesUsageByUser">
         <SQL>
            <![CDATA[
SELECT
    us.name "User Name",
    ts.name "Tablespace",
    sum(seg.blocks*ts.blocksize) / 1024 "Size KB"
FROM
    sys.ts$ ts,
    sys.user$ us,
    sys.seg$ seg,
    dba_tablespaces dts
WHERE
    seg.user#  = us.user#
    and ts.ts# = seg.ts#
    and dts.tablespace_name = ts.name
    and ts.name like '${tablespace}'
    and dts.contents like '${contents}'
GROUP BY
    us.name,
    ts.name
ORDER BY
    us.name;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDataFiles">
         <SQL>
            <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[
SELECT
    d.file_name       "Name",
    v.status          "Status",
    d.tablespace_name "Tablespace",
    ROUND(NVL(d.bytes / 1024 / 1024, 0) , 2) "Size MB",
    ROUND(NVL((d.bytes - NVL(s.bytes, 0)) /1024/1024, 0) , 2) "Used MB",
    ROUND(NVL((d.bytes - NVL(s.bytes, 0)) / d.bytes * 100, 0) , 2) "Used %",
    NVL(d.autoextensible, 'NO') "Auto Extensible",
    ROUND(NVL(d.maxbytes/1024/1024, 0) , 2) "Max MB",
    ROUND(NVL((d.increment_by*ts.block_size) /1024/1024,0) , 2) "Increment MB"
FROM
    sys.dba_data_files d,
    v$datafile v,
    (
     SELECT
            file_id,
            SUM(bytes) bytes
       FROM
            sys.dba_free_space
      WHERE
            tablespace_name LIKE '${tablespace}'
   GROUP BY
            file_id) s,
    sys.dba_tablespaces ts
WHERE
    s.file_id (+)= d.file_id
AND d.file_name = v.name
AND d.tablespace_name = ts.tablespace_name
AND ts.tablespace_name LIKE '${tablespace}'
AND ts.contents LIKE '${contents}'
ORDER BY
    2,1;
               ]]>
            </If>
            <Else>
               <![CDATA[
SELECT
    /*+
    OPT_ESTIMATE(@"SEL$13", JOIN, ("FI"@"SEL$13", "F"@"SEL$13"), SCALE_ROWS=279.94)
    OPT_ESTIMATE(@"SEL$13", JOIN, ("FI"@"SEL$13", "F"@"SEL$13", "TS"@"SEL$13"), SCALE_ROWS=301.0673427)
    OPT_ESTIMATE(@"SEL$2134B70D", JOIN, ("TS"@"SEL$16", "S"@"SEL$1", "D"@"SEL$1"), SCALE_ROWS=0.753998696)
    OPT_ESTIMATE(@"SEL$2134B70D", TABLE, "TS"@"SEL$16", SCALE_ROWS=108.9290323)
    OPTIMIZER_FEATURES_ENABLE(default)
    IGNORE_OPTIM_EMBEDDED_HINTS
    ALL_ROWS
    OPT_ESTIMATE(@"SEL$2134B70D", JOIN, ("TS"@"SEL$16", "D"@"SEL$1"), SCALE_ROWS=211.0970149)
    */
    d.file_name       "Name",
    v.status          "Status",
    d.tablespace_name "Tablespace",
    ROUND(NVL(d.bytes / 1024 / 1024, 0) , 2) "Size MB",
    ROUND(NVL((d.bytes - NVL(s.bytes, 0)) /1024/1024, 0) , 2) "Used MB",
    ROUND(NVL((d.bytes - NVL(s.bytes, 0)) / d.bytes * 100, 0) , 2) "Used %",
    NVL(d.autoextensible, 'NO') "Auto Extensible",
    ROUND(NVL(d.maxbytes/1024/1024, 0) , 2) "Max MB",
    ROUND(NVL((d.increment_by*parms.bsize) /1024/1024,0) , 2) "Increment MB"
FROM
    sys.dba_data_files d,
    v$datafile v,
    (
     SELECT
            file_id,
            SUM(bytes) bytes
       FROM
            sys.dba_free_space
      WHERE
            tablespace_name LIKE '${tablespace}'
   GROUP BY
            file_id) s,
    sys.dba_tablespaces ts,
    (
     SELECT
            value bsize
       FROM
            v$parameter
      WHERE
            name = 'db_block_size') parms
WHERE
    s.file_id (+)= d.file_id
AND d.file_name = v.name
AND d.tablespace_name = ts.tablespace_name
AND ts.tablespace_name LIKE '${tablespace}'
AND ts.contents LIKE '${contents}'
ORDER BY
    2,1;
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="oracle.getTempFiles">
         <SQL>
            <![CDATA[
SELECT
    /*+ ordered no_merge(v) */
    d.file_name "Name",
    v.status "Status",
    d.tablespace_name "Tablespace",
    ROUND(NVL(d.bytes / 1024 / 1024, 0), 2) "Size MB",
    ROUND(NVL((d.bytes - NVL(d.bytes, 0))/1024/1024, 0), 2) "Used MB",
    ROUND(NVL(t.bytes_cached / d.bytes * 100, 0), 2) "Used %",
    NVL(d.autoextensible, 'NO') "Auto Extensible"
FROM
    sys.dba_temp_files d,
    v$temp_extent_pool t,
    v$tempfile v
WHERE
    t.file_id (+)= d.file_id
    AND d.file_id = v.file#
    AND d.tablespace_name like '${tablespace}'
ORDER BY 2,1;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDatafileIO">
         <SQL>
            <![CDATA[
SELECT
    a.file# "File #",
    a.name "File Name",
    c.name "Tablespace Name",
    a.status "Status",
    a.bytes "Bytes",
    b.phyrds "Physical Reads",
    b.phywrts  "Physical Writes"
FROM
    v$datafile a,
    v$filestat b,
    v$tablespace c,
    dba_tablespaces dts
WHERE
    a.file#    = b.file#
    and a.ts#  = c.ts#
    and c.name = dts.tablespace_name
    and dts.tablespace_name like '${tablespace}'
    and dts.contents like '${contents}'
ORDER BY
    a.file#;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getTablespaceObjects">
         <SQL>
            <![CDATA[
SELECT
    ds.owner "Owner",
    ds.segment_name "Object Name",
    ds.segment_type "Object Type",
    ds.tablespace_name "Tablespace",
    ds.bytes / (1024 * 1024) "Size MB",
    ds.initial_extent "Initial Ext",
    NVL(ds.next_extent, 0) "Next Ext",
    ds.extents "Num Ext",
    ds.max_extents "Max Ext"
FROM
    dba_segments ds,
    dba_tablespaces dts
WHERE
    ds.tablespace_name = dts.tablespace_name
    and dts.tablespace_name LIKE '${tablespace}'
    and dts.contents LIKE '${contents}'
ORDER BY
    ds.owner,
    ds.segment_type,
    ds.segment_name
            ]]>
         </SQL>
      </Command>

      <!-- This is the same SQL as used by Oracle Enterprise Manager -->
      <Command id="oracle.getOEMTableSpacesUsage">
         <SQL>
            <![CDATA[
SELECT
    d.tablespace_name "Name",
    d.status "Status",
    d.contents "Type",
    d.extent_management "Extent Mgmt",
    ROUND(NVL(a.bytes / 1024 / 1024, 0), 2) "Size MB",
    ROUND(NVL(a.bytes - NVL(f.bytes, 0), 0)/1024/1024, 2) "Used MB",
    ROUND(NVL((a.bytes - NVL(f.bytes, 0)) / NVL(a.bytes,0) * 100, 0), 2) "Used %"
FROM
    sys.dba_tablespaces d,
    (
    SELECT
        tablespace_name,
        sum(bytes) bytes
    FROM
        sys.dba_data_files
    GROUP BY
        tablespace_name
    )
    a,
    (
    SELECT
        tablespace_name,
        sum(bytes) bytes
    FROM
        sys.dba_free_space
    GROUP BY
        tablespace_name
    )
    f
WHERE
    d.tablespace_name     = a.tablespace_name(+)
    AND d.tablespace_name = f.tablespace_name(+)
    AND NOT
    (
        d.extent_management like 'LOCAL'
        AND d.contents like 'TEMPORARY'
    )
UNION ALL
SELECT
    d.tablespace_name "Name",
    d.status "Status",
    d.contents "Type",
    d.extent_management "Extent Mgmt",
    ROUND(NVL(a.bytes / 1024 / 1024, 0), 2) "Size MB",
    ROUND(NVL(t.bytes, 0)/1024/1024, 2) "Used MB",
    ROUND(NVL(t.bytes / NVL(a.bytes,0) * 100, 0), 2) "Used %"
FROM
    sys.dba_tablespaces d,
    (
    SELECT
        tablespace_name,
        sum(bytes) bytes
    FROM
        sys.dba_temp_files
    GROUP BY
        tablespace_name
    )
    a,
    (
    SELECT
        tablespace_name,
        sum(bytes_cached) bytes
    FROM
        sys.v_$temp_extent_pool
    GROUP BY
        tablespace_name
    )
    t
WHERE
    d.tablespace_name     = a.tablespace_name(+)
    AND d.tablespace_name = t.tablespace_name(+)
    AND d.extent_management like 'LOCAL'
    AND d.contents like 'TEMPORARY'
order by 1
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDatafileObjects">
         <SQL>
            <![CDATA[
SELECT
    a.owner "Owner",
    a.segment_name "Segment Name",
    a.segment_type "Segment Type",
    a.tablespace_name "Tablespace Name",
    SUM(a.bytes) "Bytes Used"
FROM
    dba_extents a,
    dba_data_files b
WHERE
    a.file_id=b.file_id
AND b.file_name='${datafile}'
GROUP BY
    a.owner,
    a.segment_name,
    a.segment_type,
    a.tablespace_name
ORDER BY
    a.segment_name;
            ]]>
         </SQL>
      </Command>


      <Command id="oracle.getRollbackSegments">
         <SQL>
            <![CDATA[
SELECT
    r.status "Status",
    r.segment_name "Name",
    r.tablespace_name "Tablespace",
    s.extents "Extents",
    TO_CHAR((s.bytes / 1024 / 1024), '99999990.000') "Size MB"
FROM
    sys.dba_rollback_segs r,
    sys.dba_segments s
WHERE
    r.segment_name     = s.segment_name
    AND s.segment_type = 'ROLLBACK'
            ]]>
         </SQL>
      </Command>

      <!-- f.type from 10.1 -->
      <Command id="oracle.getRedoLogs">
         <SQL>
            <![CDATA[SELECT l.group#, l.status "LOG STATUS", l.archived,  l.bytes, f.member, f.status "FILE STATUS"]]>
            <If test="#util.isDatabaseVersionGTE(10,1)">
             <![CDATA[, f.type "FILE TYPE" ]]>
            </If>
 <![CDATA[ FROM v$logfile f, v$log l WHERE f.group# = l.group# and f.member like '${member}' order by 1]]>
         </SQL>
      </Command>
      
       <Command id="oracle.getRedoLogGroups">
         <SQL>
            <![CDATA[SELECT * FROM v$log l order by 1]]>
         </SQL>
      </Command>

       <Command id="oracle.getRedoLogMembers">
         <SQL>
            <![CDATA[SELECT * FROM v$logfile lf where lf.group# = ${groupNumber}]]>
         </SQL>
      </Command>

      <Command id="oracle.getRedoLogActivity">
         <SQL>
            <![CDATA[
SELECT
    TO_CHAR(TRUNC(first_time), 'MM-DD-YYYY') "Date",
    TO_CHAR(first_time, 'Dy') "Day",
    COUNT(1) "Total",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'00',1,0)) "00:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'01',1,0)) "01:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'02',1,0)) "02:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'03',1,0)) "03:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'04',1,0)) "04:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'05',1,0)) "05:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'06',1,0)) "06:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'07',1,0)) "07:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'08',1,0)) "08:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'09',1,0)) "09:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'10',1,0)) "10:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'11',1,0)) "11:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'12',1,0)) "12:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'13',1,0)) "13:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'14',1,0)) "14:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'15',1,0)) "15:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'16',1,0)) "16:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'17',1,0)) "17:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'18',1,0)) "18:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'19',1,0)) "19:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'20',1,0)) "20:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'21',1,0)) "21:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'22',1,0)) "22:00",
    SUM(DECODE(TO_CHAR(first_time, 'hh24'),'23',1,0)) "23:00"
FROM
    V$log_history
GROUP BY
    TRUNC(first_time),
    TO_CHAR(first_time, 'Dy')
ORDER BY
    1 DESC;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDirectories">
         <SQL>
            <![CDATA[
select * from dba_directories where directory_name like '${directory}' order by directory_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDirectoryPrivileges">
         <SQL>
            <![CDATA[
select grantee, min(v_read) read, min(v_write) write
from ( select grantee, 'read' v_read, null v_write
       from dba_tab_privs
       where privilege = 'READ'
       and table_name = '${directory}'
       and owner='SYS'
       and privilege in ('READ','WRITE')
       union all
       select grantee, null v_read, 'write' v_write
       from dba_tab_privs
       where privilege = 'WRITE'
       and table_name = '${directory}'
       and owner='SYS'
       and privilege in ('READ','WRITE')
     )
group by grantee order by grantee
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSessions">
         <SQL>
               <![CDATA[
SELECT 
       si.sid "SID",
       NVL(s.username, '(oracle)') AS "UserName",
       s.osuser "OSUser",
       s.status  "Status",
       s.lockwait "Lock Wait",
       s.program "Program",
       s.machine  "Machine",
       s.logon_time "Connect Time",
        s.inst_id,
       s.module "Module",
       s.sql_hash_value "Hash Value",
       rawtohex(s.sql_address) "Address",
       p.program "P Program",
       si.physical_reads "Physical Reads",
       si.block_gets "Block Gets",
       si.consistent_gets "Consistent Gets",
       si.block_changes "Block Changes",
       si.consistent_changes "Consistent Changes",
       s.process "Process",
       p.spid,
       p.pid,
       s.serial#,
       s.resource_consumer_group, ]]>
 
       <If test="#util.isDatabaseVersionGTE(10)">
         <![CDATA[
          nvl(s.sql_id, '<unknown>') "SQLid",
          nvl(s.sql_child_number, 0) "ChildNumber",
         ]]>
       </If>
       <If test="#util.isDatabaseVersionGTE(10,2)">
       s.SQL_TRACE
       </If>
       <Else>
       'DISABLED' "SQL_TRACE"
       </Else>
       
       <![CDATA[
FROM   gv$sess_io si,
       gv$session s,
       gv$process p
WHERE  s.username IS NOT NULL 
AND si.sid(+)   = s.sid
AND p.addr(+)   = s.paddr
AND    s.inst_id = p.inst_id
${INSTANCE_CONDITION}
ORDER BY s.username, s.sid;
               ]]>
        
         </SQL>
      </Command>

      <Command id="oracle.getInstances">
         <SQL>
            select
    "INST_ID",
    "INSTANCE_NUMBER" "Instance Number",
    "INSTANCE_NAME" "Instance Name",
    "HOST_NAME" "Host Name",
    "VERSION" "Version",
    "STARTUP_TIME" "Startup Time",
    "STATUS" "Status",
    "PARALLEL" "Parallel",
    "THREAD#" "Thread#",
    "ARCHIVER" "Archiver",
    "LOG_SWITCH_WAIT" "Log Switch Wait",
    "LOGINS" "Logins",
    "SHUTDOWN_PENDING" "Shutdown Pending",
    "DATABASE_STATUS" "Database Status",
    "INSTANCE_ROLE" "Instance Role",
     <If test="#util.isDatabaseVersionGTE(9)">
       "ACTIVE_STATE" "Active State",
     </If>
     <If test="#util.isDatabaseVersionGTE(11)">
       "BLOCKED" "Blocked",
     </If>  
     <If test="#util.isDatabaseVersionGTE(12)">
       "CON_ID" "Container ID" ,
       "INSTANCE_MODE" "Instance Mode",
       "EDITION" "Edition",
       "FAMILY" "Family"
     </If>
 from gv$instance;
         </SQL>
      </Command>

      <Command id="oracle.getActiveSessions">
         <SQL>
            <![CDATA[select sess.sid "SID",
       sess.username "UserName",
       sess.osuser "OSUser",
       sess.status  "Status",
       sess.lockwait "Lock Wait",
       sess.program "Program",
       sess.machine  "Machine",
       sess.logon_time "Connect Time",
       optimizer_mode "Optimizer Mode",
       sess.INST_ID "Instance Id",
       hash_value "Hash Value",
       rawtohex(address) "Address",
       cpu_time "CPU Time",
       elapsed_time "Elapsed Time"
  from v$sqlarea area, gv$session sess
 where sess.sql_hash_value = area.hash_value
   and sess.sql_address    = area.address
   and sess.username is not null
   ${INSTANCE_CONDITION}
            ]]>
         </SQL>
      </Command>
      

      <Command id="oracle.getTracedSessions">
         <SQL>
            <![CDATA[
SELECT
    s.sid "SID",
    s.username "UserName",
    s.osuser "OSUser",
    s.status  "Status",
    s.serial#,
    s.sql_trace,
    s.sql_trace_waits,
    s.sql_trace_binds,
    s.inst_id
FROM
    gv$session s
WHERE
    sql_trace!='DISABLED'
    ${INSTANCE_CONDITION};
            ]]>
         </SQL>
      </Command>
  
      

      <Command id="oracle.getSessionWait">
         <SQL>
            <![CDATA[
select * from gv$session_wait where sid = ${sid}
and INST_ID = ${instanceId};
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSessionEvents">
         <SQL>
            <![CDATA[
select
  se.event,
  sum(se.total_waits) "Total Waits",
  sum(se.total_timeouts) "Total Timeouts",
  sum(se.time_waited/100) "Time Waited"
from
  gv$session_event se,
  gv$session s
where
  s.sid = ${sid}
and
  s.sid = se.sid
and s.INST_ID = ${instanceId}
group by
  se.event
order by
  4 desc, 2 desc;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getInstanceSummary">
         <SQL>
            <![CDATA[
select name, value
from sys.v_$sysstat
where name in ('user commits', 'user rollbacks','cumulative open cursors','consistent gets',
'db block gets','physical reads','user calls','recursive calls','table scans (short tables)',
'table scans (long tables)','sorts (memory)','sorts (disk)','buffer busy waits',
'db block changes','user commits','sorts (rows)', 'table fetch continued row',
'table scan rows gotten','table fetch by rowid','execute count','parse count',
'enqueue waits','enqueue requests','enqueue timeouts','user commits','redo size',
'redo wastage','CPU used by this session','parse time cpu','free buffer inspected',
'free buffer requested','summed dirty queue length','write requests',
'db block changes', 'consistent changes','summed dirty queue length',
'redo log space requests','redo entries','physical writes','redo writes','redo write time')
order by 1
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getAWRHist">
         <SQL>
            <![CDATA[
select * from dba_hist_snapshot
order by begin_interval_time
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getWaits">
         <SQL>
            <![CDATA[
select event "System Event",
       total_waits "Total Waits",
       total_timeouts  "Timeouts",
       decode(time_waited, null, 0, 0, 0, time_waited/100) "Time Waited"
from sys.v_$system_event order by upper(event)
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSystemStatistics">
         <SQL>
            <![CDATA[
select * from sys.aux_stats$ order by sname, pname
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getLatches">
         <SQL>
            <![CDATA[
select sum(gets) latch_gets,
       sum(misses) latch_misses,
       sum(sleeps) latch_sleeps,
       sum(misses-spin_gets) spin_misses,
       sum(decode(substr(name, 1, 13), 'library cache', gets+immediate_gets, 0)) lib_cache_latch_gets,
       sum(decode(substr(name, 1, 4), 'redo',
  gets+immediate_gets,
  0))  redo_latch_gets,
  sum(decode(substr(name,
  1,
  12),
  'cache buffer',
  gets+immediate_gets,
  0))  buffer_latch_gets,
  sum(decode(substr(name,
  1,
  13),
  'library cache',
  misses+immediate_misses,
  0)) lib_cache_latch_misses,
  sum(decode(substr(name,
  1,
  4),
  'redo',
  misses+immediate_misses,
  0)) redo_latch_misses,
  sum(decode(substr(name,
  1,
  12),
  'cache buffer',
  misses+immediate_misses,
  0))  buffer_latch_misses,
  sum(decode(substr(name,
  1,
  13),
  'library cache',
  sleeps,
  0)) lib_cache_latch_sleeps,
  sum(decode(substr(name,
  1,
  4),
  'redo',
  sleeps,
  0)) redo_latch_sleeps,
  sum(decode(substr(name,
  1,
  12),
  'cache buffer',
  sleeps,
  0))  buffer_latch_sleeps
FROM
  sys.v_$latch
            ]]>
         </SQL>
      </Command>

      <!-- Find out SQL statements that perform poorly -->
      <Command id="oracle.getPoorSQLs">
         <SQL>
            <![CDATA[
SELECT
    executions,
    disk_reads,
    buffer_gets,
    hit_ratio,
    round(disk_reads/executions,2) disk_exec,
    round(buffer_gets/executions,2) buf_exec,
    sql_text,
    address,
    hash_value,
    INST_ID
FROM
    (
    SELECT
        executions,
        disk_reads,
        buffer_gets,
        round((buffer_gets - disk_reads) / buffer_gets, 2) hit_ratio,
        sql_text,
        rawtohex(address) address,
        hash_value,
        INST_ID
    FROM
        gv$sqlarea
    WHERE
        executions      > 0
        and buffer_gets > 0
        and
        (
            buffer_gets - disk_reads
        )
        / buffer_gets < 0.80
    )
ORDER BY
    4 desc
            ]]>
         </SQL>
      </Command>

      <!-- This performs really slow -->
      <Command id="oracle.getLocks1">
         <SQL>
            <![CDATA[
select b.sid,
       c.username,
       c.osuser,
       c.terminal,
       decode(b.id2, 0, a.object_name, 'Trans-'||to_char(b.id1)) object_name,
       b.type,
       decode(b.lmode, 0, '--Waiting--',
                       1, 'Null',
                       2, 'Row Share',
                       3, 'Row Excl',
                       4, 'Share',
                       5, 'Sha Row Exc',
                       6, 'Exclusive',
                       'Other') "Lock Mode",
                       decode(b.request, 0, ' ',
                                         1, 'Null',
                                         2, 'Row Share',
                                         3, 'Row Excl',
                                         4, 'Share',
                                         5, 'Sha Row Exc',
                                         6, 'Exclusive',
                                         'Other') "Req Mode"
       from dba_objects a,
            sys.v_$lock b,
            sys.v_$session c
where a.object_id (+) = b.id1
and b.sid = c.sid
and c.username is not null
order by
b.sid, b.id2
            ]]>
         </SQL>
      </Command>

      <!-- Display database locks and latches -->
      <!-- Source: http://www.orafaq.net/scripts/sql/lock.txt -->
      <!-- "Display database locks and latches (with tables names, etc)" -->
      <Command id="oracle.getLocks2">
         <SQL>
            <![CDATA[
select s.sid, s.serial#,
       decode(s.process, null,
          decode(substr(p.username,1,1), '?',   upper(s.osuser), p.username),
          decode(       p.username, 'ORACUSR ', upper(s.osuser), s.process)
       ) process,
       nvl(s.username, 'SYS ('||substr(p.username,1,4)||')') username,
       decode(s.terminal, null, rtrim(p.terminal, chr(0)),
              upper(s.terminal)) terminal,
       decode(l.type,
                      'TM', 'DML/DATA ENQ',   'TX', 'TRANSAC ENQ',
                      'UL', 'PLS USR LOCK',
                      'BL', 'BUF HASH TBL',  'CF', 'CONTROL FILE',
                      'CI', 'CROSS INST F',  'DF', 'DATA FILE   ',
                      'CU', 'CURSOR BIND ',
                      'DL', 'DIRECT LOAD ',  'DM', 'MOUNT/STRTUP',
                      'DR', 'RECO LOCK   ',  'DX', 'DISTRIB TRAN',
                      'FS', 'FILE SET    ',  'IN', 'INSTANCE NUM',
                      'FI', 'SGA OPN FILE',
                      'IR', 'INSTCE RECVR',  'IS', 'GET STATE   ',
                      'IV', 'LIBCACHE INV',  'KK', 'LOG SW KICK ',
                      'LS', 'LOG SWITCH  ',
                      'MM', 'MOUNT DEF   ',  'MR', 'MEDIA RECVRY',
                      'PF', 'PWFILE ENQ  ',  'PR', 'PROCESS STRT',
                      'RT', 'REDO THREAD ',  'SC', 'SCN ENQ     ',
                      'RW', 'ROW WAIT    ',
                      'SM', 'SMON LOCK   ',  'SN', 'SEQNO INSTCE',
                      'SQ', 'SEQNO ENQ   ',  'ST', 'SPACE TRANSC',
                      'SV', 'SEQNO VALUE ',  'TA', 'GENERIC ENQ ',
                      'TD', 'DLL ENQ     ',  'TE', 'EXTEND SEG  ',
                      'TS', 'TEMP SEGMENT',  'TT', 'TEMP TABLE  ',
                      'UN', 'USER NAME   ',  'WL', 'WRITE REDO  ',
                      'TYPE='||l.type) type,
       decode(l.lmode, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
                       4, 'S',    5, 'RSX',  6, 'X',
                       to_char(l.lmode) ) lmode,
       decode(l.request, 0, 'NONE', 1, 'NULL', 2, 'RS', 3, 'RX',
                         4, 'S', 5, 'RSX', 6, 'X',
                         to_char(l.request) ) lrequest,
       decode(l.type, 'MR', decode(u.name, null,
                            'DICTIONARY OBJECT', u.name||'.'||o.name),
                      'TD', u.name||'.'||o.name,
                      'TM', u.name||'.'||o.name,
                      'RW', 'FILE#='||substr(l.id1,1,3)||
                      ' BLOCK#='||substr(l.id1,4,5)||' ROW='||l.id2,
                      'TX', 'RS+SLOT#'||l.id1||' WRP#'||l.id2,
                      'WL', 'REDO LOG FILE#='||l.id1,
                      'RT', 'THREAD='||l.id1,
                      'TS', decode(l.id2, 0, 'ENQUEUE',
                                             'NEW BLOCK ALLOCATION'),
                      'ID1='||l.id1||' ID2='||l.id2) object
from   sys.v_$lock l, sys.v_$session s, sys.obj$ o, sys.user$ u,
       sys.v_$process p
where  s.paddr  = p.addr(+)
  and  l.sid    = s.sid
  and  l.id1    = o.obj#(+)
  and  o.owner# = u.user#(+)
  and  l.type   != 'MR'
UNION ALL
select s.sid, s.serial#, s.process, s.username, s.terminal,
       'LATCH', 'X', 'NONE', h.name||' ADDR='||rawtohex(laddr)
from   sys.v_$process p, sys.v_$session s, sys.v_$latchholder h
where  h.pid  = p.pid
  and  p.addr = s.paddr
UNION ALL
select s.sid, s.serial#, s.process, s.username, s.terminal,
       'LATCH', 'NONE', 'X', name||' LATCH='||p.latchwait
from   sys.v_$session s, sys.v_$process p, sys.v_$latch l
where  latchwait is not null
  and  p.addr      = s.paddr
  and  p.latchwait = l.addr
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getRegisteredLogs">
         <SQL>
            <![CDATA[
SELECT c.capture_name,
      r.SOURCE_DATABASE,
      r.SEQUENCE#,
      decode ( lag(r.sequence#,1) over (partition by r.source_database, c.capture_name order by r.sequence#),sequence#-1,'','GAP') gap,
      r.NAME,
      r.DICTIONARY_BEGIN,
      r.DICTIONARY_END,
      r.first_scn
 FROM DBA_REGISTERED_ARCHIVED_LOG r, DBA_CAPTURE c
WHERE r.CONSUMER_NAME = c.CAPTURE_NAME
order by capture_name, source_database, sequence#
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDbRol">
         <SQL>
            <![CDATA[
select * from v$database;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDGConfig">
         <SQL>
            <![CDATA[
select * from v$dataguard_config;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getArchDests">
         <SQL>
            <![CDATA[
select * from v$archive_dest order by dest_id;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getCapExtra">
         <SQL>
            <![CDATA[
select * from DBA_CAPTURE_EXTRA_ATTRIBUTES order by capture_name, attribute_name;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getCapParameters">
         <SQL>
            <![CDATA[
select * from DBA_CAPTURE_parameters order by capture_name, parameter;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getApplyParameters">
         <SQL>
            <![CDATA[
select * from DBA_apply_parameters order by apply_name, parameter;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getApplyLat">
         <SQL>
            <![CDATA[
SELECT apply_name,
       round((DEQUEUE_TIME-DEQUEUED_MESSAGE_CREATE_TIME)*86400) LATENCY,
       DEQUEUED_MESSAGE_CREATE_TIME CREATION,
       DEQUEUE_TIME LAST_DEQUEUE,
       DEQUEUED_MESSAGE_NUMBER
FROM  V$STREAMS_APPLY_READER
order by apply_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getCapApplLat">
         <SQL>
            <![CDATA[
SELECT apply_name,round((HWM_TIME-HWM_MESSAGE_CREATE_TIME)*86400) "Latency in Seconds",
      HWM_MESSAGE_CREATE_TIME "Event Creation",
      HWM_TIME "Apply Time",
      HWM_MESSAGE_NUMBER "Applied Message Number"
FROM V$STREAMS_APPLY_COORDINATOR
order by apply_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getApplyStatus">
         <SQL>
            <![CDATA[
SELECT r.APPLY_NAME,
       ap.APPLY_CAPTURED,
       SUBSTR(s.PROGRAM,INSTR(s.PROGRAM,'(')+1,4) PROCESS_NAME, ap.status,
       r.STATE,
       r.TOTAL_MESSAGES_DEQUEUED
FROM V$STREAMS_APPLY_READER r,
     V$SESSION s,
     DBA_APPLY ap
WHERE r.SID = s.SID AND
      r.SERIAL# = s.SERIAL# AND
      r.APPLY_NAME = ap.APPLY_NAME
order by r.apply_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getCaptureStatus">
         <SQL>
            <![CDATA[
SELECT c.CAPTURE_NAME,
       SUBSTR(s.PROGRAM,INSTR(s.PROGRAM,'(')+1,4) PROCESS_NAME,
       c.SID,
       c.SERIAL#,
       dc.status,
       c.STATE,
       c.TOTAL_MESSAGES_CAPTURED,
       c.TOTAL_MESSAGES_ENQUEUED
FROM V$STREAMS_CAPTURE c,
     V$SESSION s,
     dba_capture dc
WHERE c.SID = s.SID AND
      c.SERIAL# = s.SERIAL#
      and dc.capture_name = c.capture_name
order by c.capture_name
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getArchDestStat">
         <SQL>
            <![CDATA[
select * from v$archive_dest_status order by dest_id;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDGStatus">
         <SQL>
            <![CDATA[
select * from v$dataguard_status order by message_num desc;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getLogStbyEvents">
         <SQL>
            <![CDATA[
select * from dba_logstdby_events;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getLogNotSupported">
         <SQL>
            <![CDATA[
select * from dba_logstdby_unsupported;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getArchiveGap">
         <SQL>
            <![CDATA[
select * from v$archive_gap order by thread#, low_sequence#;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getMgtStbyProcs">
         <SQL>
            <![CDATA[
select * from v$managed_standby order by pid;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getStbyLogFiles">
         <SQL>
            <![CDATA[
select * from v$standby_log order by group#;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getLocks3">
         <SQL>
            <![CDATA[
select owner || '.' || object_name "Object",
       os_user_name "Terminal",
       oracle_username "Locker",
       program "Program",
       nvl(lockwait, 'ACTIVE') "Wait",
       decode(locked_mode, 2, 'ROW SHARE',
                           3, 'ROW EXCLUSIVE',
                           4, 'SHARE',
                           5, 'SHARE ROW EXCLUSIVE',
                           6, 'EXCLUSIVE',
                           'UNKNOWN') "Lockmode",
       object_type "Object Type",
       session_id "Session ID",
       serial#   "Serial",
       c.sid
from sys.v_$locked_object a,
     sys.all_objects b,
     sys.gv_$session c
where a.object_id = b.object_id and
      c.sid = a.session_id
order by 1 asc, 5 desc
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getBlockingLocks">
         <SQL>
            <![CDATA[
SELECT
    a.username,
    a.osuser,
    a.machine,
    a.program,
    a.module,
    a.sid,
    a.serial#
FROM
    v$session a,
    dba_blockers b
WHERE
    a.sid = b.holding_session;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSGA">
         <SQL>
             <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[
SELECT
    a.SQL_TEXT,
    u.USERNAME,
    trunc(a.SHARABLE_MEM / 1024, 2) "SHARABLE_MEM (KB)",
    trunc(a.PERSISTENT_MEM / 1024, 2) "PERSISTENT_MEM (KB)",
    trunc(a.RUNTIME_MEM / 1024, 2) "RUNTIME_MEM (KB)",
    a.SORTS,
    a.VERSION_COUNT,
    a.LOADED_VERSIONS,
    a.OPEN_VERSIONS,
    a.USERS_OPENING,
    a.FETCHES,
    a.EXECUTIONS,
    a.USERS_EXECUTING,
    a.LOADS,
    a.FIRST_LOAD_TIME,
    a.INVALIDATIONS,
    a.PARSE_CALLS,
    a.DISK_READS,
    a.BUFFER_GETS,
    a.ROWS_PROCESSED,
    a.COMMAND_TYPE,
    a.OPTIMIZER_MODE,
    a.PARSING_USER_ID,
    a.PARSING_SCHEMA_ID,
    a.KEPT_VERSIONS,
    rawtohex(a.ADDRESS) "ADDRESS",
    a.HASH_VALUE,
    a.MODULE,
    a.MODULE_HASH,
    a.ACTION,
    a.ACTION_HASH,
    a.SERIALIZABLE_ABORTS,
    a.CPU_TIME,
    a.ELAPSED_TIME,
    a.IS_OBSOLETE,
    a.CHILD_LATCH,
    a.INST_ID
FROM
    gv$sqlarea a,
    sys.all_users u
WHERE
    A.parsing_user_id = U.user_id
               ]]>
            </If>
            <Else>
               <![CDATA[
SELECT
    a.SQL_TEXT,
    u.USERNAME,
    a.SORTS,
    a.VERSION_COUNT,
    a.LOADED_VERSIONS,
    a.OPEN_VERSIONS,
    a.USERS_OPENING,
    a.EXECUTIONS,
    a.USERS_EXECUTING,
    a.LOADS,
    a.FIRST_LOAD_TIME,
    a.INVALIDATIONS,
    a.PARSE_CALLS,
    a.DISK_READS,
    a.BUFFER_GETS,
    a.ROWS_PROCESSED,
    a.COMMAND_TYPE,
    a.OPTIMIZER_MODE,
    a.PARSING_USER_ID,
    a.PARSING_SCHEMA_ID,
    a.KEPT_VERSIONS,
    rawtohex(a.ADDRESS) "ADDRESS",
    a.HASH_VALUE,
    a.MODULE,
    a.MODULE_HASH,
    a.ACTION,
    a.ACTION_HASH,
    a.SERIALIZABLE_ABORTS,
    a.INST_ID
FROM
    gv$sqlarea a,
    sys.all_users u
WHERE
    A.parsing_user_id = U.user_id
               ]]>
            </Else>
         </SQL>
      </Command>

      <!-- Need to convert any "null" characters in the SQL_TEXT as this is -->
      <!-- the last char in each row. The INSTANCE_CONDITION should contain a condition
            Such as AND INST_ID=1. -->
      <Command id="oracle.getSGASQL">
         <SQL>
            <![CDATA[
SELECT
    replace(sql_text, chr(0), '') sql_text
FROM
    gv$sqltext
WHERE
    address = '${address}'
    AND hash_value = ${hashvalue}
    ${INSTANCE_CONDITION}
ORDER BY
    piece
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSGASQLcursor">
         <SQL>
            <![CDATA[
select * from table(dbms_xplan.display_cursor('${sqlid}', '${childNumber}'))
]]>
         </SQL>
      </Command>
      
      <Command id="oracle.getSGASQLcursorRac">
         <SQL>
            <![CDATA[
SELECT 
  RPAD('Inst: '||v.inst_id, ${instanceId})||' '||RPAD('Child: '||v.child_number, ${childNumber}) inst_child,
  t.plan_table_output

  FROM gv$sql v,
    TABLE(DBMS_XPLAN.DISPLAY('gv$sql_plan_statistics_all', NULL, 'ADVANCED ALLSTATS LAST', 'inst_id = '||v.inst_id||' AND sql_id = '''||v.sql_id||''' AND child_number = '||v.child_number)) t
    WHERE v.sql_id = '${sqlid}'
    AND v.loaded_versions > 0;
]]>
         </SQL>
         <ProcessDataSet action="dropcolumn" index="inst_child"/>
      </Command>

      <Command id="oracle.getObjectCache">
         <SQL>
            <![CDATA[
SELECT
    owner,
    name,
    type,
    sharable_mem,
    loads,
    kept,
    executions,
    locks,
    pins
FROM
    v$db_object_cache
WHERE
    owner IN
    (
        SELECT
            username
        FROM
            dba_users
    )
AND type IN ('INDEX', 'TABLE', 'CLUSTER', 'VIEW', 'SET', 'SYNONYM', 'SEQUENCE', 'PROCEDURE', 'FUNCTION', 'PACKAGE', 'PACKAGE BODY', 'TRIGGER', 'CLASS', 'OBJECT', 'USER', 'DBLINK')
ORDER BY
    owner,
    name;
            ]]>
         </SQL>
      </Command>

      <!-- Display number of objects grouped per object types per schema -->
      <Command id="oracle.getObjectsCount1">
         <SQL>
            <![CDATA[
select owner, object_type, count(*) objects_count
from   sys.dba_objects
group by owner, object_type
order by owner, object_type
            ]]>
         </SQL>
      </Command>

      <!-- Display number of objects grouped per object types per tablespace and schema -->
      <Command id="oracle.getObjectsCount2">
         <SQL>
            <![CDATA[
select tablespace_name, owner, segment_type, count(*) objects_count,
       trunc(sum(bytes/1024),0) "KBYTES"
from   sys.dba_segments
group by tablespace_name, owner, segment_type
order by tablespace_name, owner, segment_type
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getInstanceInfo">
         <SQL>
            <![CDATA[
select * from sys.v_$instance
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSegmentAdvisorTasks">
         <SQL>
            <![CDATA[
select * from sys.dba_advisor_tasks where task_name like 'dbvis%' and task_name like '${task_name}' and advisor_id=5 order by task_name;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSegmentAdvisorObjects">
         <SQL>
            <![CDATA[
select * from sys.dba_advisor_objects where object_id like '${object_id}' and task_name like 'dbvis_%' and task_name like '${task_name}' order by object_id;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSegmentAdvisorParameters">
         <SQL>
            <![CDATA[
select * from sys.dba_advisor_parameters where parameter_name like '${parameter_name}' and task_name like 'dbvis_%' and task_name like '${task_name}' order by parameter_name;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSegmentAdvisorLog">
         <SQL>
            <![CDATA[
select * from sys.dba_advisor_log where task_name like 'dbvis_%' and task_name like '${task_name}' order by task_name;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSegmentAdvisorFindings">
         <SQL>
            <![CDATA[
select * from sys.dba_advisor_findings where task_name like 'dbvis_%' and task_name like '${task_name}' order by task_name;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getSegmentAdvisorRecommendations">
         <SQL>
            <![CDATA[
select * from sys.dba_advisor_recommendations where finding_id like '${finding_id}' and task_name like 'dbvis_%' and task_name like '${task_name}' order by task_name;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getResourceUsage">
         <SQL>
            <![CDATA[
select * from v$rsrc_consumer_group order by name
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getResourceConsumerMapping">
         <SQL>
            <![CDATA[
select * from (
select def.*, decode(def.status,NULL,' ', def.status) pstat from DBA_RSRC_group_mappings def
where attribute = '${objectname}')
order by pstat, value
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getResourceConsumerMappings">
         <SQL>
            <![CDATA[
select * from (
select def.*, decode(def.status,NULL,' ', def.status) pstat from DBA_RSRC_MAPPING_PRIORITY def
where attribute like '${objectname}'
)
order by pstat, priority
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getResourceConsumerGroups">
         <SQL>
            <![CDATA[
select * from (
select def.*, decode (def.status,NULL,' ',def.status) pstat from dba_rsrc_consumer_groups def where consumer_group like '${consumer_group}'
)
order by pstat,consumer_group;
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getResourceConsumerGroupPrivs">
         <SQL>
            <![CDATA[
select * from DBA_RSRC_CONSUMER_GROUP_PRIVS
where granted_group like '${consumer_group}'
and grantee like '${grantee}'
order by grantee;
           ]]>
         </SQL>
      </Command>

      <Command id="oracle.getResourcePlans">
         <SQL>
            <If test="#util.isDatabaseVersionGTE(10)">
               <![CDATA[
select * from (
select def.*, decode (def.status,NULL,' ', def.status) pstat, decode (cur.name,NULL,' ','*') active, decode (cur.is_top_plan,'TRUE','T','FALSE','S',' ') top_plan
from V$RSRC_PLAN cur, DBA_RSRC_PLANS def where upper(def.plan) = upper(cur.name(+)) and PLAN LIKE '${plan}'
)
order by status desc, active desc, top_plan desc, plan;
               ]]>
            </If>
            <Else>
               <![CDATA[
select * from (
select def.*, decode (def.status,NULL,' ', def.status) pstat, decode (cur.name,NULL,' ','*') active, decode
(cur.name,par.value,'T','FALSE','S',' ') top_plan
from V$RSRC_PLAN cur, DBA_RSRC_PLANS def, v$parameter par
 where upper(def.plan) = upper(cur.name(+))
 and par.name = 'resource_manager_plan'
 )
 order by status desc, active desc, top_plan desc, plan;
            ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="oracle.getResourcePlanDirectives">
         <SQL>
            <![CDATA[
select * from DBA_RSRC_PLAN_DIRECTIVES where plan like '${plan}' and group_or_subplan like '${group_or_subplan}' and nvl(status,'(null)') =
nvl ('${planStatus}','(null)') order by group_or_subplan;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getASMClients">
         <SQL>
            <![CDATA[
select  a.group_number
,       b.name
,       a.instance_name
,       a.db_name
,       a.status
            ]]>
            <If test="#util.isDatabaseVersionGTE(10,2)">
               <![CDATA[
,       a.software_version
,       a.compatible_version
               ]]>
            </If>
            <![CDATA[
from   V$ASM_CLIENT a
,      V$ASM_DISKGROUP b
where a.group_number = b.group_number
order by a.INSTANCE_NAME;
]]>
         </SQL>
      </Command>

      <Command id="oracle.getUsedClient">
         <SQL>
            <![CDATA[
SELECT
    gname,
    dbname,
    file_type,
    round(SUM(space)/1024/1024) mb,
    round(SUM(space)/1024/1024/1024) gb,
    COUNT(*) "#FILES"
FROM
    (
        SELECT
            gname,
            regexp_substr(full_alias_path, '[[:alnum:]_]*',1,4) dbname,
            file_type,
            space,
            aname,
            system_created,
            alias_directory
        FROM
            (
                SELECT
                    concat('+'||gname, sys_connect_by_path(aname, '/')) full_alias_path,
                    system_created,
                    alias_directory,
                    file_type,
                    space,
                    level,
                    gname,
                    aname
                FROM
                    (
                        SELECT
                            b.name            gname,
                            a.parent_index    pindex,
                            a.name            aname,
                            a.reference_index rindex ,
                            a.system_created,
                            a.alias_directory,
                            c.type file_type,
                            c.space
                        FROM
                            v$asm_alias a,
                            v$asm_diskgroup b,
                            v$asm_file c
                        WHERE
                            a.group_number = b.group_number
                        AND a.group_number = c.group_number(+)
                        AND a.file_number = c.file_number(+)
                        AND a.file_incarnation = c.incarnation(+) ) START WITH (mod(pindex, power(2, 24))) = 0
                AND rindex IN
                    (
                        SELECT
                            a.reference_index
                        FROM
                            v$asm_alias a,
                            v$asm_diskgroup b
                        WHERE
                            a.group_number = b.group_number
                        AND (
                                mod(a.parent_index, power(2, 24))) = 0
                            --and a.name like '&&db_name'
                    ) CONNECT BY prior rindex = pindex )
        WHERE
            NOT file_type IS NULL
            and system_created = 'Y' )
GROUP BY
    gname,
    dbname,
    file_type
ORDER BY
    gname,
    dbname,
    file_type
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getASMDiskGroups">
         <SQL>
            <![CDATA[
select group_number,name, state,type,total_mb, free_mb
            ]]>
            <If test="#util.isDatabaseVersionGTE(10,2)">
               <![CDATA[
,offline_disks
               ]]>
            </If>
            <![CDATA[
,round(100 - ((free_mb/total_mb)*100),2) "used %"
from v$asm_diskgroup
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getASMDiskGroupsDetails">
         <SQL>
            <![CDATA[
select *
from v$asm_diskgroup
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getASMDiskGroup">
         <SQL>
            <![CDATA[
select *
from v$asm_disk where group_number = '${groupnumber}'
order by disk_number
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getASMDiskGroupOperations">
         <SQL>
            <![CDATA[
select sysdate, a.*
from v$asm_operation a where group_number = '${groupnumber}'
            ]]>
         </SQL>
      </Command>
      <Command id="oracle.getASMDisks">
         <SQL>
            <![CDATA[
select * from v$asm_disk where group_number = decode ('${groupnumber}', '(null)','0','${groupnumber}')
order by disk_number
            ]]>
         </SQL>
      </Command>
      <Command id="oracle.getASMDisk">
         <SQL>
            <![CDATA[
select * from v$asm_disk where name = '${diskname}'
            ]]>
         </SQL>
      </Command>
      
      <Command id="oracle.getASMDiskGroupFileInfo">
         <SQL>
            <![CDATA[
SELECT concat('+'||gname, sys_connect_by_path(aname, '/')) full_path,
       file_number,
       system_created, nvl(file_type, 'Directory') file_type,
       decode(file_type, null, 'N', decode (system_created, 'N', 'Y', 'N')) file_alias,
       block_size, blocks, bytes, space, redundancy, striped, creation_date,
       modification_date
       , redundancy_lowered
FROM (SELECT  g.name gname, g.group_number gnumber, a.parent_index pindex, a.name aname,
              a.reference_index rindex , a.system_created, a.alias_directory,
              f.file_number,
              f.type file_type, f.block_size, f.blocks, f.bytes, f.space, f.redundancy, f.striped, f.creation_date, f.modification_date
              ,f.redundancy_lowered
      FROM   v$asm_alias a, v$asm_diskgroup g, v$asm_file f
      WHERE  a.group_number = g.group_number
      and    a.group_number = ${groupnumber}
      and    a.group_number = f.group_number (+)
      and    a.file_number = f.file_number (+))
START WITH (mod(pindex, power(2, 24))) = 0
CONNECT BY PRIOR rindex = pindex
ORDER BY 1;
            ]]>
         </SQL>
      </Command>

      <Command id="oracle.getDNFSServers">
         <SQL>
            <![CDATA[
select * from v$dnfs_servers order by dirname;
            ]]>
         </SQL>
      </Command>
      <Command id="oracle.getDNFSFiles">
         <SQL>
            <![CDATA[
select * from v$dnfs_files order by filename;
            ]]>
         </SQL>
      </Command>
      <Command id="oracle.getDNFSChannels">
         <SQL>
            <![CDATA[
select * from v$dnfs_channels;
            ]]>
         </SQL>
      </Command>
      <Command id="oracle.getDNFSStats">
         <SQL>
            <![CDATA[
select * from v$dnfs_stats;
            ]]>
         </SQL>
      </Command>

   </Commands>

   <!-- =================================================================== -->
   <!-- Definition of the object actions that are used by the tree -->
   <!-- =================================================================== -->

   <ObjectsActionDef extends="false">

      <!-- RRD: tasks only work when jdbc can connect using sysasm (or pre 11g) -->
      <ActionGroup type="ASMDisk">
        <Action id="oracle-drop-disk" label="Drop Disk" reload="true" icon="remove">
          <Input label="Rebalance Power" name="rebalance" style="list" editable="false">
             <Labels>off|1|2|3|4|5|6|7|8|9|10|max</Labels>
             <Values>0|1|2|3|4|5|6|7|8|9|10|11</Values>
             <Default>5</Default>
          </Input>
          <Command>
             <SQL>
                <![CDATA[
                  alter diskgroup ${groupname} drop disk '${diskname}' rebalance power ${rebalance}
               ]]>
             </SQL>
          </Command>
        </Action>
      </ActionGroup>
      <ActionGroup type="ASMDiskGroup">
        <Action id="oracle-rebalance-disk-group" label="Rebalance Disk Group" icon="execute">
          <Input label="Rebalance Power" name="rebalance" style="list" editable="false">
             <Labels>off|1|2|3|4|5|6|7|8|9|10|max</Labels>
             <Values>0|1|2|3|4|5|6|7|8|9|10|11</Values>
             <Default>5</Default>
          </Input>
          <Command>
             <SQL>
                <![CDATA[
                  alter diskgroup ${groupname} rebalance power ${rebalance}
               ]]>
             </SQL>
          </Command>
        </Action>
        <Action id="oracle-drop-disk-group" label="Drop Disk Group" reload="true" icon="remove">
          <Command>
             <SQL>
                <![CDATA[
                  drop diskgroup ${groupname}
               ]]>
             </SQL>
          </Command>
        </Action>
        <Action id="oracle-add-disk-to-group" label="Add Disk to Group" reload="true" icon="add">
          <Input label="Failgroup a" name="fga" style="list" editable="true">
             <Values>
                <Command>
                   <SQL>
                      <![CDATA[select distinct failgroup from v$asm_disk d, v$asm_diskgroup g
                      where d.group_number = ${groupnumber}
                      and   d.group_number = g.group_number
                      and   g.type != 'EXTER'
                      order by d.failgroup]]></SQL>
                </Command>
             </Values>
             <Default>
              <Command>
                <SQL>
                  <![CDATA[select min(d.failgroup) from v$asm_disk d, v$asm_diskgroup g
                  where d.group_number = ${groupnumber}
                  and   d.group_number = g.group_number
                  and   g.type != 'EXTERN'
                  order by failgroup]]>
                </SQL>
              </Command>
             </Default>
          </Input>
          <Input label="Disk a" name="diska" style="list" editable="false">
             <Values>
                <Command>
                   <SQL>
                      <![CDATA[select path from v$asm_disk where group_number = 0 order by path]]></SQL>
                </Command>
             </Values>
          </Input>
          <Input label="Failgroup b" name="fgb" style="list" editable="true">
             <Values>
                <Command>
                   <SQL>
                      <![CDATA[select distinct d.failgroup from v$asm_disk d, v$asm_diskgroup g
                      where d.group_number = ${groupnumber}
                      and   d.group_number = g.group_number
                      and   g.type != 'EXTERN'
                      and d.failgroup != '${fga}'
                      order by d.failgroup]]></SQL>
                </Command>
             </Values>
             <Default>
              <Command>
                <SQL>
                  <![CDATA[select min(d.failgroup) from v$asm_disk d, v$asm_diskgroup g
                  where d.group_number = ${groupnumber}
                  and   d.group_number = g.group_number
                  and   g.type != 'EXTERN'
                  and d.failgroup != '${fga}'
                  order by d.failgroup]]>
                </SQL>
              </Command>
             </Default>
          </Input>
          <Input label="Disk b" name="diskb" style="list" editable="false">
             <Values>
                <Command>
                   <SQL>
                      <![CDATA[select path from v$asm_disk where group_number = 0 and path != '${diska}'
                      order by path]]></SQL>
                </Command>
             </Values>
          </Input>
          <Input label="Failgroup c" name="fgc" style="list" editable="true">
             <Values>
                <Command>
                   <SQL>
                      <![CDATA[select distinct d.failgroup from v$asm_disk d, v$asm_diskgroup g
                      where d.group_number = ${groupnumber}
                      and   d.group_number = g.group_number
                      and   g.type != 'EXTERN'
                      and d.failgroup not in  ('${fga}', '${fgb}')
                      order by d.failgroup]]></SQL>
                </Command>
             </Values>
             <Default>
              <Command>
                <SQL>
                  <![CDATA[select min(d.failgroup) from v$asm_disk d, v$asm_diskgroup g
                  where d.group_number = ${groupnumber}
                  and   d.group_number = g.group_number
                  and   g.type != 'EXTERN'
                  and d.failgroup not in ('${fga}','${fgb}')
                  order by d.failgroup]]>
                </SQL>
              </Command>
             </Default>
          </Input>
          <Input label="Disk c" name="diskc" style="list" editable="false">
             <Values>
                <Command>
                   <SQL>
                      <![CDATA[select path from v$asm_disk where group_number = 0 and path not in ('${diska}','${diskb}')
                      order by path]]></SQL>
                </Command>
             </Values>
          </Input>
          <Input label="Rebalance Power" name="rebalance" style="list" editable="false">
             <Labels>off|1|2|3|4|5|6|7|8|9|10|max</Labels>
             <Values>0|1|2|3|4|5|6|7|8|9|10|11</Values>
             <Default>5</Default>
          </Input>
          <SetVar name="_fga" value='#fga.equals("") ? " " : "failgroup ${fga}"'/>
          <SetVar name="_fgb" value='#fgb.equals("") ? " " : "failgroup ${fgb} disk \u0027${diskb}\u0027"'/>
          <SetVar name="_fgc" value='#fgc.equals("") ? "  " : "failgroup ${fgc} disk \u0027${diskc}\u0027"'/>
          <Command>
             <SQL>
                <![CDATA[
                  alter diskgroup ${groupname} add ${_fga} disk '${diska}' ${_fgb} ${_fgc} REBALANCE POWER ${rebalance}
               ]]>
             </SQL>
          </Command>
        </Action>
      </ActionGroup>

      <ActionGroup type="ASMDiskGroups">
         <Action id="oracle-add-disk-group" label="Add Disk Group" reload="true" icon="add">
            <Input label="Disk Group" name="dg" style="text" editable="true"/>
            <Input label="Redundancy" name="redundancy" style="radio">
               <Labels>external|normal|high</Labels>
               <Values>EXTERNAL|NORMAL|HIGH</Values>
               <Default>normal</Default>
            </Input>
            <Input label="Failgroup a" name="fga" style="text" editable="true"/>
            <Input label="Disk a" name="diska" style="list" editable="false">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select path from v$asm_disk where group_number = 0 order by path]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Failgroup b" name="fgb" style="text" editable="true"/>
            <Input label="Disk b" name="diskb" style="list" editable="false">
               <Values>
            <Command>
               <SQL>
                        <![CDATA[select path from v$asm_disk where group_number = 0
                          and path != ('${diska}')
                          order by path]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Failgroup c" name="fgc" style="text" editable="true"/>
            <Input label="Disk c" name="diskc" style="list" editable="false">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select path from v$asm_disk where group_number = 0
                        and path not in ('${diska}','${diskb}')
                        order by path]]></SQL>
                  </Command>
               </Values>
            </Input>
            <If test="#util.isDatabaseVersionGTE(11)">
              <Input label="au size" name="ausize" style="list" editable="true">
                 <Labels>1m|2m|4m</Labels>
                 <Values>1M|2M|4M</Values>
                 <Default>2m</Default>
              </Input>
              <Input label="ASM Compatibility" name="asmcomp" style="list" editable="true">
                 <Labels>10.2|11.1|11.2</Labels>
                 <Values>10.2|11.1|11.2</Values>
                 <Default>
                  <Command>
                    <SQL>
                      <![CDATA[select min(substr(version,1,instr(version,'.',1,2)-1)) from v$instance]]>
                    </SQL>
                  </Command>
                 </Default>
              </Input>
              <Input label="RDBMS Compatibility" name="rdbmscomp" style="list" editable="true">
                 <Labels>10.2|11.1|11.2</Labels>
                 <Values>10.2|11.1|11.2</Values>
                 <Default>
                  <Command>
                    <SQL>
                      <![CDATA[select min(substr(compatible_version,1,instr(compatible_version,'.',1,2)-1)) from v$asm_client]]>
                    </SQL>
                  </Command>
                 </Default>
              </Input>
            </If>
            <SetVar name="_fga" value='#fga.equals("") ? "" : "failgroup ${fga}"'/>
            <SetVar name="_fgb" value='#fgb.equals("") ? "" : "failgroup ${fgb} disk \u0027${diskb}\u0027"'/>
            <SetVar name="_fgc" value='#fgc.equals("") ? "" : "failgroup ${fgc} disk \u0027${diskc}\u0027"'/>
            <Command>
                <If test="#util.isDatabaseVersionLT(11)">
                 <SQL>
                  <![CDATA[
                      create diskgroup ${QB}${dg}${QE} ${redundancy} redundancy
                      ${_fga} disk '${diska}'
                      ${_fgb}
                      ${_fgc}
                 ]]>
               </SQL>
               </If>
               <Else>
                 <SQL>
                    <![CDATA[
                      create diskgroup ${QB}${dg}${QE} ${redundancy} redundancy
                      ${_fga} disk '${diska}'
                      ${_fgb}
                      ${_fgc}
                      attribute 'au_size'='${ausize}','compatible.asm'='${asmcomp}', 'compatible.rdbms'='${rdbmscomp}'
                   ]]>
                 </SQL>
               </Else>
            </Command>
         </Action>
      </ActionGroup>

      <ActionGroup type="AWR">
         <Action id="oracle-create-awr-snapshot" label="Create Snapshot" reload="true" icon="add">
            <Input label="Level" name="level" style="radio">
               <Values>TYPICAL|ALL</Values>
               <Labels>typical|all</Labels>
               <Default>typical</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[
begin
dbms_workload_repository.create_snapshot(flush_level=> '${level}');
end;
                 ]]>
               </SQL>
            </Command>
         </Action>
         <Action id="oracle-run-awr_report" label="Run Report" icon="report">
            <Input label="dbid" name="dbid" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct rpad(db_name,10)||' '||lpad(dbid,12)||' '|| rpad(host_name,12) dbid from dba_hist_database_instance order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Instance NUM" name="instnum" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct to_char(instance_number) from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid}','[^ ]+',1,2)) order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Begin Snapshot" name="beginSnap" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(snap_id)||' '||end_interval_time from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid}','[^ ]+',1,2)) and instance_number = ${instnum} order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="End Snapshot" name="endSnap" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(snap_id)||' '||end_interval_time from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid}','[^ ]+',1,2)) and instance_number = ${instnum} and snap_id > to_number(regexp_substr('${beginSnap}','[^ ]+',1)) order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Format" name="Format" style="radio">
               <Values>html|text</Values>
               <Labels>HTML|TEXT</Labels>
               <Default>html</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[
select output from table(dbms_workload_repository.awr_report_${Format}( to_number(regexp_substr('${dbid}','[^ ]+',1,2)), ${instnum}, regexp_substr('${beginSnap}','[^ ]+',1), regexp_substr('${endSnap}','[^ ]+',1) ))
                  ]]>
               </SQL>
            </Command>
         </Action>
         <Action id="oracle-diff-awr_report" label="Diff Report" icon="diff">
            <Input label="dbid1" name="dbid1" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct rpad(db_name,10)||' '||lpad(dbid,12)||' '|| rpad(host_name,12) dbid from dba_hist_database_instance order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Instance NUM 1" name="instnum1" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(instance_number) from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid1}','[^ ]+',1,2)) order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Begin Snapshot 1" name="beginSnap1" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(snap_id)||' '||end_interval_time from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid1}','[^ ]+',1,2)) and instance_number = ${instnum1} order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="End Snapshot 1" name="endSnap1" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(snap_id)||' '||end_interval_time from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid1}','[^ ]+',1,2)) and instance_number = ${instnum1} and snap_id > to_number(regexp_substr('${beginSnap1}','[^ ]+',1)) order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="dbid2" name="dbid2" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct rpad(db_name,10)||' '||lpad(dbid,12)||' '|| rpad(host_name,12) dbid from dba_hist_database_instance order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Instance NUM 2" name="instnum2" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(instance_number) from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid2}','[^ ]+',1,2)) order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Begin Snapshot 2" name="beginSnap2" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(snap_id)||' '||end_interval_time from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid2}','[^ ]+',1,2)) and instance_number = ${instnum2} order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="End Snapshot 2" name="endSnap2" style="list">
               <Values>
                  <Command>
                     <SQL>
                       <![CDATA[select distinct to_char(snap_id)||' '||end_interval_time from dba_hist_snapshot where dbid = to_number(regexp_substr('${dbid2}','[^ ]+',1,2)) and instance_number = ${instnum2} and snap_id > to_number(regexp_substr('${beginSnap2}','[^ ]+',1)) order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Format" name="Format" style="radio">
               <Values>html|text</Values>
               <Labels>HTML|TEXT</Labels>
               <Default>html</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[
select output from table(dbms_workload_repository.awr_diff_report_${Format}( to_number(regexp_substr('${dbid1}','[^ ]+',1,2)), regexp_substr('${instnum1}','[^ ]+',1), regexp_substr('${beginSnap1}','[^ ]+',1), regexp_substr('${endSnap1}','[^ ]+',1), to_number(regexp_substr('${dbid2}','[^ ]+',1,2)), ${instnum2}, regexp_substr('${beginSnap2}','[^ ]+',1), regexp_substr('${endSnap2}','[^ ]+',1) ))
                  ]]>
               </SQL>
            </Command>
         </Action>
      </ActionGroup>

      <ActionGroup type="SegmentAdvisorTasks">
         <Action id="oracle-segmentadvisortasks-create" label="Create Task" reload="true" icon="add">
            <Input label="Task Name" name="task_name" style="text"/>
            <Input label="Task Description" name="task_description" style="text"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.create_task(advisor_name=>'Segment Advisor', task_name=>'dbvis_${task_name}', task_desc=>'${task_description}'); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Create segment advisor task?]]></Confirm>
            <Result>
               Segment advisor task created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SegmentAdvisorTask">
         <Action id="oracle-segmentadvisortask-delete" label="Delete Task" reload="true" icon="remove">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.delete_task(task_name=>'${objectname}'); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Delete segment advisor task?]]></Confirm>
            <Result>
               Segment advisor task deleted!
            </Result>
         </Action>
         <Action id="oracle-segmentadvisortask-cancel" label="Cancel Task" icon="stop">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.cancel_task(task_name=>'${objectname}'); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Cancel segment advisor task?]]></Confirm>
            <Result>
               Segment advisor task canceled!
            </Result>
         </Action>
         <Action id="oracle-segmentadvisortask-execute" label="Execute Task" icon="execute">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.execute_task(task_name=>'${objectname}'); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Execute segment advisor task?]]></Confirm>
            <Result>
               Segment advisor task executed!
            </Result>
         </Action>
         <Action id="oracle-segmentadvisortask-interrupt" label="Interrupt Task" icon="disable">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.interrupt_task(task_name=>'${objectname}'); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Interrupt segment advisor task?]]></Confirm>
            <Result>
               Segment advisor task interrupted!
            </Result>
         </Action>
         <Action id="oracle-segmentadvisortask-reset" label="Reset Task" icon="clear">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.reset_task(task_name=>'${objectname}'); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Reset segment advisor task?]]></Confirm>
            <Result>
               Segment advisor task reset!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SegmentAdvisorObjects">
         <Action id="oracle-segmentadvisorobjects-segment" label="Segment" icon="add">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Object Type" name="object_type" style="list">
               <Labels>INDEX|INDEX PARTITION|INDEX SUBPARTITION|TABLE|TABLE
                  PARTITION|TABLE SUBPARTITION
               </Labels>
               <Values>INDEX|INDEX PARTITION|INDEX SUBPARTITION|TABLE|TABLE
                  PARTITION|TABLE SUBPARTITION
               </Values>
            </Input>
            <Input label="Schema" name="attr1" style="list" tip="enter schema name.">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct owner from dba_segments where segment_type = '${object_type}' order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Object" name="attr2" style="list" tip="enter the index or table name.">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[
                        select distinct object_name from dba_objects where object_type =
                        substr('${object_type}',1,decode (instr('${object_type}',' '),
                                                          0,length('${object_type}')+1,
                                                          instr('${object_type}',' ')-1))
                                    and object_type in ('INDEX','TABLE')
                          and owner = '${attr1}' order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Sub-partition" name="attr3" style="list" tip="Enter partition or subpartition name">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct partition_name from dba_segments where segment_type = '${object_type}'
                          and segment_type like '%PARTITION' and segment_name = '${attr2}' and owner = '${attr1}' order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <SetVar name="_attr1" value='#attr1 != null ? #attr1.toUpperCase() : null'/>
            <SetVar name="_attr2" value='#attr2 != null ? #attr2.toUpperCase() : null'/>
            <SetVar name="_attr3" value='#attr3 != null ? #attr3.toUpperCase() : null'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[declare l_object_id number; begin dbms_advisor.create_object(task_name=>'${objectname}', object_type=>'${object_type}', attr1=>'${_attr1}', attr2=>'${_attr2}', attr3=>'${_attr3}', attr4=>NULL, attr5=>NULL, object_id => l_object_id); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Create tablespace advisor object?]]></Confirm>
            <Result>
               Tablespace advisor object created!
            </Result>
         </Action>
         <Action id="oracle-segmentadvisorobjects-ts" label="Tablespace" reload="true" icon="add">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Object Type" name="object_type" style="list">
               <Labels>TABLESPACE</Labels>
               <Values>TABLESPACE</Values>
            </Input>
            <Input label="Tablespace" name="attr1" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select tablespace_name from dba_tablespaces order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <SetVar name="_attr1" value='#attr1 != null ? #attr1.toUpperCase() : null'/>
            <SetVar name="_attr2" value='#attr2 != null ? #attr2.toUpperCase() : null'/>
            <SetVar name="_attr3" value='#attr3 != null ? #attr3.toUpperCase() : null'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[declare l_object_id number; begin dbms_advisor.create_object(task_name=>'${objectname}', object_type=>'${object_type}', attr1=>'${_attr1}', attr2=>'${_attr2}', attr3=>'${_attr3}', attr4=>NULL, attr5=>NULL, object_id => l_object_id); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Create segment advisor object?]]></Confirm>
            <Result>
               Segment advisor object created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SegmentAdvisorObject">
         <Action id="oracle-segmentadvisorobject-update" label="Update Object" reload="true" icon="edit">
            <Input label="Task Name" style="text" editable="false">
               <Default>${task_name}</Default>
            </Input>
            <Input label="Object Id" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Object Type" name="object_type" style="list">
               <Labels>|INDEX|INDEX PARTITION|INDEX SUBPARTITION|TABLE|TABLE
                  PARTITION|TABLE SUBPARTITION|TABLESPACE
               </Labels>
               <Values>|INDEX|INDEX PARTITION|INDEX SUBPARTITION|TABLE|TABLE
                  PARTITION|TABLE SUBPARTITION|TABLESPACE
               </Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select type from sys.dba_advisor_objects where task_name='${task_name}' and object_id='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input label="Attribute 1" name="attr1" style="text" tip="If Object Type is tablespace, enter tablespace name else enter schema name.">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select attr1 from sys.dba_advisor_objects where task_name='${task_name}' and object_id='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input label="Attribute 2" name="attr2" style="text" tip="If Object Type is not tablespace, enter the index or table name.">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select attr2 from sys.dba_advisor_objects where task_name='${task_name}' and object_id='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input label="Attribute 3" name="attr3" style="text" tip="If Object Type is not index, table, or tablespace then enter partition or subpartition name.">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select attr3 from sys.dba_advisor_objects where task_name='${task_name}' and object_id='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <SetVar name="_attr1" value='#attr1 != null ? #attr1.toUpperCase() : null'/>
            <SetVar name="_attr2" value='#attr2 != null ? #attr2.toUpperCase() : null'/>
            <SetVar name="_attr3" value='#attr3 != null ? #attr3.toUpperCase() : null'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.update_object(task_name=>'${task_name}', object_id=>'${objectname}', attr1=>'${_attr1}', attr2=>'${_attr2}', attr3=>'${_attr3}', attr4=>NULL, attr5=>NULL); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Update segment advisor object?]]></Confirm>
            <Result>
               Segment advisor object updated!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SegmentAdvisorParameters">
         <Action id="oracle-segmentadvisorparameters-set" label="Set Parameter" reload="true" icon="edit">
            <Input label="Task Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Mode" name="mode" style="list">
               <Labels>LIMITED|COMPREHENSIVE</Labels>
               <Values>LIMITED|COMPREHENSIVE</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select parameter_value from sys.dba_advisor_parameters where task_name='${objectname}' and parameter_name='MODE']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input label="Time Limit" name="time_limit" style="text">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select parameter_value from sys.dba_advisor_parameters where task_name='${objectname}' and parameter_name='TIME_LIMIT']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input label="Recommend All" name="recommend_all" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>True|False</Labels>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select parameter_value from sys.dba_advisor_parameters where task_name='${objectname}' and parameter_name='RECOMMEND_ALL']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_advisor.set_task_parameter(task_name=>'${objectname}', parameter=>'MODE', value=>'${mode}'); dbms_advisor.set_task_parameter(task_name=>'${objectname}', parameter=>'TIME_LIMIT', value=>'${time_limit}'); dbms_advisor.set_task_parameter(task_name=>'${objectname}', parameter=>'RECOMMEND_ALL', value=>'${recommend_all}'); end;]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Set segment advisor parameter?]]></Confirm>
            <Result>
               Segment advisor parameter set!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Schema">
         <Action id="oracle-schema-export" label="Export Schema"
                 icon="export" reload="false"
                 class="schemaExport"
                 doclink="/doclink/export-schema"/>

         <Action id="oracle-schema-stringsearch" label="String Search" reload="false" icon="find">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="type" label="Object Type" style="list" editable="false">
               <Values>'FUNCTION'|'PROCEDURE'|'PACKAGE'|'PACKAGE BODY'|'JAVA SOURCE'|'TRIGGER'|'TYPE','TYPE BODY'
               </Values>
               <Labels>FUNCTION|PROCEDURE|PACKAGE|PACKAGE BODY|JAVA SOURCE|TRIGGER|TYPE
               </Labels>
            </Input>
            <Input name="string" label="String" style="text"/>
            <Input name="source" label="Source" style="radio">
               <Values>all|user</Values>
               <Labels>ALL|USER</Labels>
            </Input>
            <Input name="case" label="Ignore Case" style="check">
               <Values>ignore</Values>
            </Input>
            <SetVar name="_owner" value='#source.equals("all") ? "owner, " : ""'/>
            <SetVar name="_case" value='#case.equals("ignore") ? "upper(text) like upper(\u0027%" + #string + "%\u0027)" : "text like \u0027%" + #string + "%\u0027"'/>
            <SetVar name="_type" value='#type.equals("ALL") ? "" : "and type in (" + #type + ")"'/>
            <Command>
               <SQL>
                  <![CDATA[select ${_owner}type, name, line from ${source}_source where ${_case} ${_type} order by name, line]]></SQL>
            </Command>
            <Confirm>
               Search ${type} for "${string}"?
            </Confirm>
            <Result>
               Search results!
            </Result>
         </Action>

      </ActionGroup>

      <ActionGroup type="Tables">
         <Action id="oracle-tables-create-table" label="Create Table"
                 icon="add" reload="true"
                 class="tableCreate"
                 classargs="create"
                 doclink="/doclink/create-table"/>
         <Action id="oracle-tables-table-import-table-data"
                 label="Import Table Data"
                 icon="import"
                 reload="true"
                 class="tableDataImport"
                 doclink="/doclink/import-table"/>
      </ActionGroup>

      <ActionGroup type="Table">
         <Action id="oracle-tables-alter-table" label="Alter Table"
                 icon="edit" reload="true"
                 class="tableAlter"
                 classargs="alter"
                 doclink="/doclink/alter-table"/>

         <Action id="oracle-table-rename" label="Rename Table" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Table Name" name="newTable" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[alter table "${schema}"."${objectname}" rename to ${QB}${newTable}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of ${schema}.${objectname} to ${newTable}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} renamed to ${newTable}!
            </Result>
         </Action>

         <Action id="oracle-table-clear" label="Empty Table">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Storage" name="storage" style="radio">
               <Values>|drop storage|reuse storage</Values>
               <Labels>Default|Drop|Reuse</Labels>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[truncate table "${schema}"."${objectname}" ${storage}]]></SQL>
            </Command>
            <Confirm>
               Really remove all rows in table ${schema}.${objectname}?
            </Confirm>
            <Result>
               All rows in table ${schema}.${objectname} has been removed!
            </Result>
         </Action>

         <Action id="oracle-table-drop" label="Drop Table" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Referential Integrity Constraints" name="cascade" style="check"
                   tip="Enable this to drop all referential integrity constraints that refer to primary and unique keys in the dropped table">
               <Values>cascade constraints</Values>
            </Input>

            <If test="#util.isDatabaseVersionGTE(10)">
               <Input label="Purge Space" name="purge" style="check"
                      tip="Enable this if you want to drop the table and release the space associated with it in a single step">
                  <Values>purge</Values>
               </Input>
            </If>
            <Else>
               <SetVar name="purge" value="''"/>
            </Else>

            <Command>
               <SQL>
                  <![CDATA[drop table "${schema}"."${objectname}" ${cascade} ${purge}]]></SQL>
            </Command>
            <Confirm>
               Really drop table ${schema}.${objectname}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} has been dropped!
            </Result>
         </Action>

         <Action id="oracle-table-copy" label="Copy Table" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Table Owner" name="newSchema" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="New Table Name" name="newTable" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[create table "${newSchema}".${QB}${newTable}${QE} as select * from "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Confirm copying ${schema}.${objectname} to
               ${newSchema}.${newTable}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} copied to ${newSchema}.${newTable}!
            </Result>
         </Action>

         <Action id="oracle-table-comment" label="Comment Table">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comments" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select comments from all_tab_comments where owner = '${schema}' and table_name = '${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on table "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Confirm>
               Apply new comment on ${schema}.${objectname}?
            </Confirm>
         </Action>

         <Action id="oracle-table-grant" label="Grant Privilege" reload="true" icon="key">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="grantee" label="Grantee" style="check-list">
               <Arg name="output" value="${value}"/>
               <Arg name="newline" value=", "/>
               <Values>
                  <Command idref="oracle.getUserAndRoleNames"/>
               </Values>
            </Input>
            <Input label="Grant" name="grant" style="check-list">
               <Arg name="output" value="${value}"/>
               <Arg name="newline" value=", "/>
               <Labels>select|delete|insert|update|alter</Labels>
               <Values>select|delete|insert|update|alter</Values>
            </Input>
            <Input label="With Grant" name="wgrant" style="radio">
               <Values>| with grant option</Values>
               <Labels>No|Yes</Labels>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${grant} on ${schema}.${objectname} to ${grantee}${wgrant}]]></SQL>
            </Command>
            <Confirm>
               Confirm grant ${grant} on ${schema}.${objectname}?
            </Confirm>
            <Result>
               Grant ${grant} on ${schema}.${objectname} was successful!
            </Result>
         </Action>

         <Action id="oracle-table-import-table-data" label="Import Table Data" icon="import"
                 class="tableDataImport"
                 doclink="/doclink/import-table"/>

         <Action id="oracle-table-export" label="Export Table" icon="export"
                 class="tableExport"
                 doclink="/doclink/export-table"/>

         <Separator/>

         <Action id="oracle-table-create-index" label="Create Index" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            
            <Input label="Index Schema" name="indexSchema" style="list" editable="false">
               <Default>${schema}</Default>
               <Values>
                   <Command idref="oracle.getSchemas"/>
               </Values>
            </Input>
            <Input label="Index Name" name="indexname" style="text"/>
            <Input label="Unique" name="unique" style="check">
               <Values>unique</Values>
            </Input>

            <Input label="Columns" style="separator"/>

            <Input name="columns" style="grid">
               <Arg name="output" value='"${columnname}"${_sortorder}'/>
               <Arg name="newline" value=", "/>

               <Input name="columnname" label="Column Name" style="list">
                  <Values column="4">
                     <Command idref="getColumnNamesFor">
                        <Input name="table_catalog" value="${catalog}"/>
                        <Input name="table_schema" value="${schema}"/>
                        <Input name="table_name" value="${objectname}"/>
                     </Command>
                  </Values>
                  <Default>${0}</Default>
               </Input>
               <Input name="sortorder" label="Sort Order" style="radio">
                  <Labels>ASC|DESC|Default</Labels>
                  <Values>ASC|DESC|</Values>
                  <Default>ASC</Default>
               </Input>
               <SetVar name="_sortorder" value='#sortorder.equals("") ? "" : " " + #sortorder'/>
            </Input>

            <SetVar name="_unique" value='#unique.equals("") ? "" : " " + #unique'/>
            <SetVar name="_columns" value='#columns.trim().equals("") ? "" : "(" + #columns + ")"'/>

            <Command>
               <SQL>
                  <![CDATA[create${_unique} index "${indexSchema}".${QB}${indexname}${QE} on "${schema}"."${objectname}" ${_columns}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Create index "${indexSchema}"."${indexname}"?]]>
            </Confirm>
            <Result>
               <![CDATA[Index "${indexname}" created!]]>
            </Result>
         </Action>

         <Action id="oracle-tabletrigger-create" label="Create Trigger" icon="add" reload="true"
                 doclink="/doclink/create-trigger">
            <Input label="Table Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Trigger Schema" name="triggerSchema" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger Name" name="triggerName" style="text"/>
            <Input label="Trigger Time" name="triggerTime" style="radio">
               <Values>BEFORE|AFTER|INSTEAD OF</Values>
               <Default>AFTER</Default>
            </Input>
            <Input label="Trigger Event" name="eventDelete" style="check" linebreak="false">
               <Values>DELETE</Values>
               <Labels>DELETE</Labels>
            </Input>
            <Input label="" name="eventInsert" style="check">
               <Values>INSERT</Values>
               <Labels>INSERT</Labels>
               <Default>INSERT</Default>
            </Input>
            <Input label="" name="eventUpdate" style="check" linebreak="true">
               <Values>UPDATE</Values>
               <Labels>UPDATE</Labels>
            </Input>
            <Input label="Trigger Type" name="triggerType" style="radio">
               <Values>STATEMENT|ROW</Values>
               <Default>STATEMENT</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default><![CDATA[
--
--  Insert your own trigger code here
--
    DBMS_OUTPUT.PUT_LINE('Sample output');]]>
               </Default>
            </Input>

            <SetVar name="_triggerEvent" value='#eventDelete'/>
            <SetVar name="_triggerEvent" value='#_triggerEvent.length() > 0 and #eventInsert.length() > 0 ?
                                                #_triggerEvent + " OR " + #eventInsert :
                                                #_triggerEvent + #eventInsert'/>
            <SetVar name="_triggerEvent" value='#_triggerEvent.length() > 0 and #eventUpdate.length() > 0 ?
                                                #_triggerEvent + " OR " + #eventUpdate :
                                                #_triggerEvent + #eventUpdate'/>

            <SetVar name="_triggerType" value='#triggerType.equals("ROW") ? "for each row" : ""'/>

            <Command exectype="asis">
               <SQL><![CDATA[
create trigger "${triggerSchema}".${QB}${triggerName}${QE}
  ${triggerTime} ${_triggerEvent}
  on "${schema}"."${objectname}"
  ${_triggerType}
begin
${source}
end;]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger <b>${schema}.${triggerName}</b> created.]]>
            </Result>
         </Action>

         <If test="#util.isDatabaseVersionGTE(8,1)">
            <Action id="oracle-table-analyze" label="Analyze Table">
               <Input label="Schema" style="text" editable="false">
                  <Default>${schema}</Default>
               </Input>
               <Input label="Table" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input name="estimate_percent" label="Estimate Percent" style="list" tip="Percentage of rows to estimate.">
                  <Labels>NULL
                     (Compute)|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99
                  </Labels>
                  <Values>
                     NULL|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99
                  </Values>
                  <Default>NULL</Default>
               </Input>
               <Input name="block_sample" label="Block Sample" style="radio" tip="Use random block sampling instead of random row sampling.  Not valid with Compute statistics.">
                  <Labels>True|False</Labels>
                  <Values>TRUE|FALSE</Values>
                  <Default>FALSE</Default>
               </Input>
               <Input label="" style="separator"/>
               <Input name="method_opt" label="Method Opt" style="list" tip="">
                  <Labels>ALL COLUMNS|ALL INDEXED COLUMNS|ALL HIDDEN COLUMNS
                  </Labels>
                  <Values>ALL COLUMNS|ALL INDEXED COLUMNS|ALL HIDDEN COLUMNS
                  </Values>
                  <Default>ALL COLUMNS</Default>
               </Input>
               <If test="#util.isDatabaseVersionLT(9,2)">
                  <Input name="size" label="Size" style="list" tip="">
                     <Labels>
                        1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254
                     </Labels>
                     <Values>
                        1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254
                     </Values>
                     <Default>1</Default>
                  </Input>
               </If>
               <Else>
                  <Input name="size" label="Size" style="list" tip="">
                     <Labels>
                        AUTO|REPEAT|SKEWONLY|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254
                     </Labels>
                     <Values>
                        AUTO|REPEAT|SKEWONLY|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254
                     </Values>
                     <Default>1</Default>
                  </Input>
               </Else>
               <Input label="" style="separator"/>
               <Input name="degree" label="Degree" style="number" linebreak="true"/>
               <If test="#util.isDatabaseVersionLT(10)">
                  <Input name="granularity" label="Granularity" style="list" tip="">
                     <Labels>ALL|DEFAULT|GLOBAL|PARTITION|SUPARTITION</Labels>
                     <Values>ALL|DEFAULT|GLOBAL|PARTITION|SUPARTITION</Values>
                     <Default>DEFAULT</Default>
                  </Input>
               </If>
               <Else>
                  <Input name="granularity" label="Granularity" style="list" tip="">
                     <Labels>ALL|AUTO|GLOBAL|GLOBAL AND
                        PARTITION|PARTITION|SUBPARTITION
                     </Labels>
                     <Values>ALL|AUTO|GLOBAL|GLOBAL AND
                        PARTITION|PARTITION|SUBPARTITION
                     </Values>
                     <Default>AUTO</Default>
                  </Input>
               </Else>
               <Input name="cascade" label="Cascade" style="radio" tip="Gather index stats also?">
                  <Labels>True|False</Labels>
                  <Values>TRUE|FALSE</Values>
                  <Default>FALSE</Default>
               </Input>
               <If test="#util.isDatabaseVersionGTE(9,2)">
                  <Input name="no_invalidate" label="No Invalidate" style="radio" tip="">
                     <Labels>True|False</Labels>
                     <Values>TRUE|FALSE</Values>
                     <Default>FALSE</Default>
                  </Input>
               </If>
               <Else>
                  <SetVar name="no_invalidate" value="''"/>
               </Else>
               <If test="#util.isDatabaseVersionGTE(10,2)">
                  <Input name="force" label="Force" style="radio" tip="">
                     <Labels>True|False</Labels>
                     <Values>TRUE|FALSE</Values>
                     <Default>FALSE</Default>
                  </Input>
               </If>
               <Else>
                  <SetVar name="force" value="''"/>
               </Else>
               <SetVar name="_block_sample" value='#estimate_percent.equals("NULL") ? "" : " block_sample=>" + #block_sample + ","'/>
               <SetVar name="_size" value='#size.equals("") ? "" : " SIZE " + #size'/>
               <SetVar name="_degree" value='#degree.equals("") ? "NULL" : #degree'/>
               <SetVar name="_no_invalidate" value='#no_invalidate.equals("") ? "" : #no_invalidate.equals("TRUE") ? ", no_invalidate=>TRUE" : ", no_invalidate=>FALSE"'/>
               <SetVar name="_force" value='#force.equals("") ? "" : #force.equals("TRUE") ? ", force=>TRUE" : ", force=>FALSE"'/>
               <Command exectype="asis">
                  <SQL>
                     <![CDATA[begin sys.dbms_stats.gather_table_stats(ownname=>'${schema}', tabname=>'${objectname}', estimate_percent=>${estimate_percent},${_block_sample} method_opt=>'FOR ${method_opt}${_size}', degree=>${_degree}, granularity=>'${granularity}', cascade=>${cascade}${_no_invalidate}${_force}); end;]]></SQL>
               </Command>
               <Confirm>
                  Analyze table ${schema}.${objectname}?
               </Confirm>
               <Result>Table analyzed.</Result>
            </Action>
         </If>

         <Separator/>

         <Action id="oracle-table-script" label="Script Table" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *,INSERT,UPDATE,DELETE,CREATE,DROP"
                 doclink="/doclink/script-object"/>
      </ActionGroup>

      <ActionGroup type="GlobalTempTables">
         <Action id="oracle-globaltemptables-create-table" label="Create Table"
                 icon="add" reload="true"
                 class="tableCreate"
                 classargs="create"
                 doclink="/doclink/create-table"/>
         
         <Action id="oracle-globaltemptables-import-table-data"
                 label="Import Table Data"
                 icon="import"
                 reload="true"
                 class="tableDataImport"
                 doclink="/doclink/import-table"/>
      </ActionGroup>
      
      <ActionGroup type="TempTable">
         <Action id="oracle-temptables-alter-table" label="Alter Table"
                 icon="edit" reload="true"
                 class="tableAlter"
                 classargs="alter"
                 doclink="/doclink/alter-table"/>

         <Action id="oracle-temptable-rename" label="Rename Table" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Table Name" name="newTable" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[alter table "${schema}"."${objectname}" rename to ${QB}${newTable}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of ${schema}.${objectname} to ${newTable}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} renamed to ${newTable}!
            </Result>
         </Action>

         <Action id="oracle-temptable-clear" label="Empty Table">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Storage" name="storage" style="radio">
               <Values>|drop storage</Values>
               <Labels>Default|Drop</Labels>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[truncate table "${schema}"."${objectname}" ${storage}]]></SQL>
            </Command>
            <Confirm>
               Really remove all rows in table ${schema}.${objectname}?
            </Confirm>
            <Result>
               All rows in table ${schema}.${objectname} has been removed!
            </Result>
         </Action>

         <Action id="oracle-temptable-drop" label="Drop Table" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Drop Referential Integrity Constraints" name="cascade" style="check"
                   tip="Enable this to drop all referential integrity constraints that refer to primary and unique keys in the dropped table">
               <Values>cascade constraints</Values>
            </Input>

            <If test="#util.isDatabaseVersionGTE(10)">
               <Input label="Purge Space" name="purge" style="check"
                      tip="Enable this if you want to drop the table and release the space associated with it in a single step">
                  <Values>purge</Values>
               </Input>
            </If>
            <Else>
               <SetVar name="purge" value="''"/>
            </Else>

            <Command>
               <SQL>
                  <![CDATA[drop table "${schema}"."${objectname}" ${cascade} ${purge}]]></SQL>
            </Command>
            <Confirm>
               Really drop table ${schema}.${objectname}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} has been dropped!
            </Result>
         </Action>

         <Action id="oracle-temptable-copy" label="Copy Table" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Table Owner" name="newSchema" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="New Table Name" name="newTable" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[create table "${newSchema}".${QB}${newTable}${QE} as select * from "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Confirm copying ${schema}.${objectname} to
               ${newSchema}.${newTable}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} copied to ${newSchema}.${newTable}!
            </Result>
         </Action>

         <Action id="oracle-temptable-comment" label="Comment Table">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comments" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select comments from all_tab_comments where owner = '${schema}' and table_name = '${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on table "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Confirm>
               Apply new comment on ${schema}.${objectname}?
            </Confirm>
         </Action>

         <Action id="oracle-temptable-grant" label="Grant Privilege" icon="key">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="grantee" label="Grantee" style="list">
               <Values>
                  <Command idref="oracle.getUserAndRoleNames"/>
               </Values>
            </Input>
            <Input label="Grant" name="grant" style="check-list">
               <Arg name="output" value="${value}"/>
               <Arg name="newline" value=", "/>
               <Labels>select|delete|insert|update|alter</Labels>
               <Values>select|delete|insert|update|alter</Values>
            </Input>
            <Input label="With Grant" name="wgrant" style="radio">
               <Values>| with grant option</Values>
               <Labels>No|Yes</Labels>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${grant} on ${schema}.${objectname} to ${grantee}${wgrant}]]></SQL>
            </Command>
            <Confirm>
               Confirm grant ${grant} on ${schema}.${objectname}?
            </Confirm>
            <Result>
               Grant ${grant} on ${schema}.${objectname} was successful!
            </Result>
         </Action>

         <Action id="oracle-temptable-import-table-data" label="Import Table Data" icon="import"
                 class="tableDataImport"
                 doclink="/doclink/import-table"/>

         <Action id="oracle-temptable-export" label="Export Table" icon="export"
                 class="tableExport"
                 doclink="/doclink/export-table"/>

         <Separator/>


         <Action id="oracle-temptable-script-builder" label="Script Table" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *,INSERT,UPDATE,DELETE,CREATE,DROP"
                 doclink="/doclink/script-object"/>
      </ActionGroup>
      
      <ActionGroup type="Column">
         <Action id="oracle-column-comment" label="Comment Column">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table/View" style="text" editable="false">
               <Default>${theParentName}</Default>
            </Input>
            <Input label="Column" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comments" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select comments from all_col_comments where owner = '${schema}' and table_name = '${theParentName}' and column_name = '${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on column "${schema}"."${theParentName}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Confirm>
               Apply new comment on ${schema}.${theParentName}.${objectname}?
            </Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="Views">
         <Action id="oracle-views-create" label="Create View" reload="true" icon="add">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View Name" name="viewName" style="text"/>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor"/>
            <Command>
               <SQL>
                  <![CDATA[create or replace view ${schema}.${QB}${viewName}${QE} as ${source}]]></SQL>
            </Command>
            <Confirm>
               Really create view ${schema}.${viewName}?
            </Confirm>
            <Result>
               View ${schema}.${viewName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="View">
         <Action id="oracle-view-drop" label="Drop View" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop view "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop view ${schema}.${objectname}?
            </Confirm>
            <Result>
               View ${schema}.${objectname} has been dropped!
            </Result>
         </Action>

         <Action id="oracle-view-grant" label="Grant Privilege" reload="true" icon="key">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="grantee" label="Grantee" style="check-list">
               <Arg name="output" value="${value}"/>
               <Arg name="newline" value=", "/>
               <Values>
                  <Command idref="oracle.getUserAndRoleNames"/>
               </Values>
            </Input>
            <Input label="Grant" name="grant" style="check-list">
               <Arg name="output" value="${value}"/>
               <Arg name="newline" value=", "/>
               <Labels>select|delete|insert|update</Labels>
               <Values>select|delete|insert|update</Values>
            </Input>
            <Input label="With Grant" name="wgrant" style="radio">
               <Values>| with grant option</Values>
               <Labels>No|Yes</Labels>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[grant ${grant} on ${schema}.${objectname} to ${grantee}${wgrant}]]></SQL>
            </Command>
            <Confirm>
               Confirm grant ${grant} on ${schema}.${objectname}?
            </Confirm>
            <Result>
               Grant ${grant} on ${schema}.${objectname} was successful!
            </Result>
         </Action>

         <Action id="oracle-view-rename" label="Rename View" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New View Name" name="newTable" style="text"/>
            <Command>
               <SQL><![CDATA[rename "${objectname}" to ${QB}${newTable}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of view ${objectname} to ${newTable}?
            </Confirm>
            <Result>
               View ${objectname} renamed to ${newTable}!
            </Result>
         </Action>

         <Action id="oracle-view-compile" label="Compile View" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter view "${schema}"."${objectname}" compile]]></SQL>
            </Command>
            <Confirm>
               Really compile view ${schema}.${objectname}?
            </Confirm>
            <Result>
               View ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-view-comment" label="Comment View">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comments" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select comments from all_tab_comments where owner = '${schema}' and table_name = '${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on table "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Confirm>
               Apply new comment on ${schema}.${objectname}?
            </Confirm>
         </Action>

         <Action id="oracle-view-export" label="Export View" icon="export"
                 class="viewExport"
                 doclink="/doclink/export-view"/>

         <Separator/>

         <Action id="oracle-viewtrigger-create" label="Create Trigger" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger Schema" name="triggerSchema" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            
            <Input label="Trigger" name="triggerName" style="text"/>
            <Input label="Trigger Time" name="triggerTime" style="radio" editable="false">
               <Values>INSTEAD OF</Values>
               <Default>INSTEAD OF</Default>
            </Input>
            <Input label="Trigger Event" name="eventDelete" style="check" linebreak="false">
               <Values>DELETE</Values>
               <Labels>DELETE</Labels>
            </Input>
            <Input label="" name="eventInsert" style="check">
               <Values>INSERT</Values>
               <Labels>INSERT</Labels>
               <Default>INSERT</Default>
            </Input>
            <Input label="" name="eventUpdate" style="check" linebreak="true">
               <Values>UPDATE</Values>
               <Labels>UPDATE</Labels>
            </Input>
            <Input label="Trigger Type" name="triggerType" style="radio">
               <Values>STATEMENT|ROW</Values>
               <Default>STATEMENT</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default><![CDATA[
--
--  Insert your own trigger code here
--
    DBMS_OUTPUT.PUT_LINE('Sample output');]]>
               </Default>
            </Input>

            <SetVar name="_triggerEvent" value='#eventDelete'/>
            <SetVar name="_triggerEvent" value='#_triggerEvent.length() > 0 and #eventInsert.length() > 0 ?
                                                #_triggerEvent + " OR " + #eventInsert :
                                                #_triggerEvent + #eventInsert'/>
            <SetVar name="_triggerEvent" value='#_triggerEvent.length() > 0 and #eventUpdate.length() > 0 ?
                                                #_triggerEvent + " OR " + #eventUpdate :
                                                #_triggerEvent + #eventUpdate'/>

            <SetVar name="_triggerType" value='#triggerType.equals("ROW") ? "for each row" : ""'/>

            <Command exectype="asis">
               <SQL><![CDATA[
create trigger  "${triggerSchema}".${QB}${triggerName}${QE}
  ${triggerTime} ${_triggerEvent}
  on "${schema}"."${objectname}"
  ${_triggerType}
begin
${source}
end;]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger <b>${schema}.${triggerName}</b> created.]]>
            </Result>
         </Action>

         <Separator/>

         <Action id="oracle-view-script" label="Script View" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *,INSERT,UPDATE,DELETE,CREATE,DROP"
                 doclink="/doclink/script-object"/>
      </ActionGroup>

      <ActionGroup type="Synonyms">
         <Action id="oracle-synonyms-create" label="Create Synonym" reload="true" icon="add">
            <Input label="Synonym Owner" name="synOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Synonym Name" name="synObject" style="text"/>
            <Input label="Target Object Owner" name="targetOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Target Object Name" name="targetObject" style="text"/>
            <Input label="Replace if Exist" name="orReplace" style="check">
               <Values>or replace</Values>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[create ${orReplace} synonym "${synOwner}".${QB}${synObject}${QE} for "${targetOwner}"."${targetObject}"]]>
               </SQL>
            </Command>
            <Result>
               Synonym ${synOwner}.${synObject} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Synonym">
         <Action id="oracle-synonym-drop" label="Drop Synonym" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Synonym" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop synonym "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop synonym ${schema}.${objectname}?
            </Confirm>
            <Result>
               Synonym ${schema}.${objectname} has been dropped!
            </Result>
         </Action>

         <Action id="oracle-synonym-rename" label="Rename Synonym" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Synonym" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Synonym Name" name="newTable" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[rename "${objectname}" to ${QB}${newTable}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of synonym ${objectname} to ${newTable}?
            </Confirm>
            <Result>
               Synonym ${objectname} renamed to ${newTable}!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Index">
         <Action id="oracle-index-drop" label="Drop Index" reload="true" icon="remove">
            <Input label="Owner" style="text" editable="false">
               <Default>${indexOwner}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop index "${indexOwner}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop index ${indexOwner}.${objectname}?
            </Confirm>
            <Result>
               Index ${indexOwner}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-index-rename" label="Rename Index" reload="true" icon="rename">
            <Input label="Owner" style="text" editable="false">
               <Default>${indexOwner}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Index Name" name="newTable" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[alter index "${indexOwner}"."${objectname}" rename to ${QB}${newTable}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of index ${indexOwner}.${objectname} to ${newTable}?
            </Confirm>
            <Result>
               Index ${objectname} renamed to ${newTable}!
            </Result>
         </Action>

         <Action id="oracle-index-rebuild" label="Rebuild Index">
            <Input label="Owner" style="text" editable="false">
               <Default>${indexOwner}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter index "${indexOwner}"."${objectname}" rebuild]]></SQL>
            </Command>
            <Confirm>
               Confirm rebuild of index ${indexOwner}.${objectname}?
            </Confirm>
            <Result>
               Index ${indexOwner}.${objectname} rebuilt!
            </Result>
         </Action>

         <Action id="oracle-index-compute" label="Compute Statistics for Index">
            <Input label="Owner" style="text" editable="false">
               <Default>${indexOwner}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[analyze index "${indexOwner}"."${objectname}" compute statistics]]></SQL>
            </Command>
            <Confirm>
               Confirm compute statistics of index ${indexOwner}.${objectname}?
            </Confirm>
            <Result>
               Compute statistics has been executed for index
               ${indexOwner}.${objectname}!
            </Result>
         </Action>

         <Separator/>

         <Action id="oracle-index-script" label="Script Index" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CREATE,DROP"
                 doclink="/doclink/script-object"/>
      </ActionGroup>

      <ActionGroup type="Sequences">
         <Action id="oracle-sequences-create" label="Create Sequence" reload="true" icon="add">
            <Input label="Sequence Owner" name="owner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence Name" name="sequenceName" style="text"/>
            <Input label="Start With" name="startWith" style="text">
               <Default>1</Default>
            </Input>
            <Input label="Increment By" name="increment" style="text">
               <Default>1</Default>
            </Input>
            <Input label="Cached Values" name="cache" style="text">
               <Default>20</Default>
            </Input>
            <Input label="Order" name="order" style="radio">
               <Values>order|noorder</Values>
               <Labels>Order|No Order</Labels>
               <Default>noorder</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[create sequence "${owner}".${QB}${sequenceName}${QE} start with ${startWith} increment by ${increment} nomaxvalue nominvalue cache ${cache} ${order}]]></SQL>
            </Command>
            <Result>
               Sequence ${schema}.${sequenceName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Sequence">
         <Action id="oracle-sequence-drop" label="Drop Sequence" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop sequence "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop sequence ${schema}.${objectname}?
            </Confirm>
            <Result>
               Sequence ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-sequence-rename" label="Rename Sequence" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Sequence Name" name="newSequence" style="text"/>
            <Command>
               <SQL><![CDATA[rename "${objectname}" to ${QB}${newSequence}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of sequence ${objectname} to ${newSequence}?
            </Confirm>
            <Result>
               Sequence ${objectname} renamed to ${newSequence}!
            </Result>
         </Action>
         
         <Separator/>

         <Action id="oracle-sequence-script" label="Script Sequence" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CREATE,DROP"
                 doclink="/doclink/script-object"/>
      </ActionGroup>

      <ActionGroup type="MaterializedView">
         <Action id="oracle-materializedview-drop" label="Drop Materialized View" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Materialized View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop materialized view "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop materialized view ${schema}.${objectname}?
            </Confirm>
            <Result>
               Materialized view ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-materializedview-refresh" label="Refresh Materialized View" reload="false">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Materialized View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Method" name="method" style="radio">
               <Labels>Default|Fast Refresh|Complete Refresh|Force Refresh
               </Labels>
               <Values>|f|c|?</Values>
            </Input>

            <SetVar name="_method" value="#method.equals('') ? '' : ',\'' + #method + '\''"/>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin DBMS_MVIEW.REFRESH('${schema}.${objectname}'${_method}); end;]]></SQL>
            </Command>
            <Confirm>
               Really refresh materialized view ${schema}.${objectname}?
            </Confirm>
            <Result>
               Materialized view ${schema}.${objectname} has been refreshed!
            </Result>
         </Action>

         <Action id="oracle-materializedview-comment" label="Comment Materialized View">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Materialized View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Comments" name="comment" style="wrapped-text-editor">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select comments from all_mview_comments where owner = '${schema}' and mview_name = '${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[comment on materialized view "${schema}"."${objectname}" is '${comment}']]></SQL>
            </Command>
            <Confirm>
               Apply new comment on ${schema}.${objectname}?
            </Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="Functions">
         <Action id="oracle-functions-create" label="Create Function" reload="true" icon="add"
                 doclink="/doclink/create-function">
            <Input label="Function Owner" name="functionOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Function Name" name="functionName" style="text"/>
            <Input label="Return Data Type" name="returns" style="text">
               <Default>VARCHAR2</Default>
            </Input>

            <Input label="Parameters" style="separator"/>
            <Input name="parameters" style="grid">
               <Arg name="output" value="${name} ${direction} ${type}${_default}"/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text"/>
               <Input name="direction" label="Direction" style="list">
                  <Values>IN|IN OUT|OUT</Values>
                  <Default>IN</Default>
               </Input>
               <Input name="type" label="Type" style="text">
                  <Default>VARCHAR2</Default>
               </Input>
               <Input name="default" label="Default" style="text"/>

               <SetVar name="_default" value='#default.equals("") ? "" : " default " + #default'/>
            </Input>
            <!--
                        <Input label="Source" style="separator"/>
                        <Input name="source" style="text-editor">
                           <Default>
                              <![CDATA[
            BEGIN
              DBMS_OUTPUT.PUT_LINE('Sample output');
              RETURN NULL;
            END;
                              ]]>
                           </Default>
                        </Input>
            -->
            <SetVar name="_parameters" value='#parameters.trim().equals("") ? "" : "(" + #parameters + ")"'/>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
CREATE FUNCTION "${functionOwner}".${QB}${functionName}${QE}
${_parameters}
RETURN ${returns}
AS
BEGIN
  DBMS_OUTPUT.PUT_LINE('Sample output');
  RETURN NULL;
END;
                  ]]>
               </SQL>
            </Command>
            <Confirm>
               Create function ${functionOwner}.${functionName}?
            </Confirm>
            <Result>
               Function ${functionOwner}.${functionName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Function">
         <Action id="oracle-function-drop" label="Drop Function" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Function" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop function "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop function ${schema}.${objectname}?
            </Confirm>
            <Result>
               Function ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-function-compile" label="Compile Function" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Function" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter function "${schema}"."${objectname}" compile]]></SQL>
            </Command>
            <Confirm>
               Compile function ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Function ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-function-export" label="Export Function" icon="export"
                 class="functionExport"
                 doclink="/doclink/export-code-object"/>

         <Separator/>

         <Action id="oracle-function-script" label="Script Function" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CALL,CREATE,DROP"
                 doclink="/doclink/script-object"/>
      </ActionGroup>

      <ActionGroup type="Procedures">
         <Action id="oracle-procedures-create" label="Create Procedure" reload="true" icon="add"
                 doclink="/doclink/create-procedure">
            <Input label="Procedure Owner" name="procedureOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Procedure Name" name="procedureName" style="text"/>

            <Input label="Parameters" style="separator"/>
            <Input name="parameters" style="grid">
               <Arg name="output" value="${name} ${direction} ${type}${_default}"/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text"/>
               <Input name="direction" label="Direction" style="list">
                  <Values>IN|IN OUT|OUT</Values>
                  <Default>IN</Default>
               </Input>
               <Input name="type" label="Type" style="text">
                  <Default>VARCHAR2</Default>
               </Input>
               <Input name="default" label="Default" style="text"/>

               <SetVar name="_default" value='#default.equals("") ? "" : " default " + #default'/>
            </Input>
            <!--
                        <Input label="Source" style="separator"/>
                        <Input name="source" style="text-editor">
                           <Default>
                              <![CDATA[
            BEGIN
              DBMS_OUTPUT.PUT_LINE('Sample output');
            END;
                              ]]>
                           </Default>
                        </Input>
            -->
            <SetVar name="_parameters" value='#parameters.trim().equals("") ? "" : "(" + #parameters + ")"'/>

            <Command exectype="asis">
               <SQL>
                  <![CDATA[
CREATE PROCEDURE "${procedureOwner}".${QB}${procedureName}${QE}
${_parameters}
AS
BEGIN
  DBMS_OUTPUT.PUT_LINE('Sample output');
END;
                  ]]>
               </SQL>
            </Command>
            <Confirm>
               Create procedure ${procedureOwner}.${procedureName}?
            </Confirm>
            <Result>
               Procedure ${procedureOwner}.${procedureName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Procedure">
         <Action id="oracle-procedure-drop" label="Drop Procedure" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Procedure" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop procedure "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop procedure ${schema}.${objectname}?
            </Confirm>
            <Result>
               Procedure ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-procedure-compile" label="Compile Procedure" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Procedure" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter procedure "${schema}"."${objectname}" compile]]></SQL>
            </Command>
            <Confirm>
               Compile procedure ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Procedure ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-procedure-export" label="Export Procedure" icon="export"
                 class="procedureExport"
                 doclink="/doclink/export-code-object"/>

         <Separator/>

         <Action id="oracle-procedure-script" label="Script Procedure" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CALL,CREATE,DROP"
                 doclink="/doclink/script-object"/>

      </ActionGroup>

      <ActionGroup type="Packages">
         <Action id="oracle-packages-create" label="Create Package" reload="true" icon="add"
                 doclink="/doclink/create-code-object">
            <Input label="Package Owner" name="packageOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Package Name" name="packageName" style="text"/>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor"/>

            <Command exectype="asis">
               <SQL><![CDATA[
CREATE PACKAGE "${packageOwner}".${QB}${packageName}${QE}
AS
${source}
END;]]></SQL>
            </Command>
            <Confirm>
               Create package ${packageOwner}.${packageName}?
            </Confirm>
            <Result>
               Package ${packageOwner}.${packageName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Package">
         <Action id="oracle-package-body-create" label="Create Package Body" reload="true" icon="add">
            <Input label="Package Owner" name="packageOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Package Body Name" name="packageName" style="text">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor"/>
            <Command exectype="asis">
               <SQL><![CDATA[
CREATE PACKAGE BODY "${packageOwner}".${QB}${packageName}${QE}
AS
${source}
END;]]></SQL>
            </Command>
            <Confirm>
               Create package body ${packageOwner}.${packageName}?
            </Confirm>
            <Result>
               Package body ${packageOwner}.${packageName} created!
            </Result>
         </Action>

         <Action id="oracle-package-drop" label="Drop Package and Package Body" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Package" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop package "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop package and body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Package and body ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-package-compile" label="Compile Package" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Package" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter package "${schema}"."${objectname}" compile specification]]></SQL>
            </Command>
            <Confirm>
               Compile package ${schema}.${objectname}?
            </Confirm>
            <Result>
               Package ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-package-compileboth" label="Compile Package and Body" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Package" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter package "${schema}"."${objectname}" compile package]]></SQL>
            </Command>
            <Confirm>
               Compile package and body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Package and body ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-package-export" label="Export Package" icon="export"
                 class="packageExport"
                 doclink="/doclink/export-code-object"/>

      </ActionGroup>

      <ActionGroup type="PackageBodies">
         <Action id="oracle-packagebodies-create" label="Create Package Body" reload="true" icon="add"
                 doclink="/doclink/create-code-object">
            <Input label="Package Owner" name="packageOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Package Body Name" name="packageName" style="text"/>
            <Command exectype="asis">
               <SQL><![CDATA[
CREATE PACKAGE BODY "${packageOwner}".${QB}${packageName}${QE}
AS
END;]]></SQL>
            </Command>
            <Confirm>
               Create package body ${packageOwner}.${packageName}?
            </Confirm>
            <Result>
               Package body ${packageOwner}.${packageName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="PackageBody">
         <Action id="oracle-packagebody-drop" label="Drop Package Body" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Package Body" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop package body "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop package body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Package body ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-packagebody-compile" label="Compile Package Body" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Package Body" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter package "${schema}"."${objectname}" compile body]]></SQL>
            </Command>
            <Confirm>
               Compile package body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Package body ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-packagebody-export" label="Export Package Body" icon="export"
                 class="packageBodyExport"
                 doclink="/doclink/export-code-object"/>

      </ActionGroup>

      <ActionGroup type="Trigger">
         <Action id="oracle-trigger-drop" label="Drop Trigger" reload="true" icon="remove">
            <Input label="Owner" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop trigger "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop trigger ${schema}.${objectname}?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-trigger-rename" label="Rename Trigger" reload="true" icon="rename">
            <Input label="Owner" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Trigger Name" name="newTrigger" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[alter trigger "${schema}"."${objectname}" rename to ${QB}${newTrigger}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of trigger ${schema}.${objectname} to
               ${newTrigger}?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} renamed to ${newTrigger}!
            </Result>
         </Action>

         <Action id="oracle-trigger-enable" label="Enable Trigger" reload="true" icon="enable">
            <Input label="Owner" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter trigger "${schema}"."${objectname}" enable]]></SQL>
            </Command>
            <Confirm>
               Enable trigger ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} has been enabled!
            </Result>
         </Action>

         <Action id="oracle-trigger-disable" label="Disable Trigger" reload="true" icon="disable">
            <Input label="Owner" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter trigger "${schema}"."${objectname}" disable]]></SQL>
            </Command>
            <Confirm>
               Disable trigger ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} has been disabled!
            </Result>
         </Action>

         <Action id="oracle-trigger-compile" label="Compile Trigger" reload="true" icon="compile">
            <Input label="Owner" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter trigger "${schema}"."${objectname}" compile]]></SQL>
            </Command>
            <Confirm>
               Compile trigger ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-trigger-export" label="Export Trigger" icon="export"
                 class="triggerExport"
                 doclink="/doclink/export-code-object"/>

      </ActionGroup>

      <!--
      Outcommented since there is no way to specify what users recycle bin to
      purge i.e if exploring the non default schema and choosing
      "Purge Recycle Bin" it would lead to the default schemas recycle bin to
      be purged.

      <ActionGroup type="RecycleBin">
         <Action id="oracle-recyclebin-purge" label="Purge Recycle Bin" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>

            <Command><SQL><![CDATA[purge recyclebin]]></SQL></Command>
            <Confirm><![CDATA[
            Really purge all tables in the recycle bin?
            ]]></Confirm>
            <Result>
               Recycle bin has been purged!
            </Result>
         </Action>
      </ActionGroup>
      -->

      <ActionGroup type="ObjectTypes">
         <Action id="oracle-type-create" label="Create Object Type" reload="true" icon="add"
                 doclink="/doclink/create-code-object">
            <Input label="Type Owner" name="typeOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Name" name="typeName" style="text"/>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor"/>

            <Command exectype="asis">
               <SQL><![CDATA[
CREATE TYPE "${typeOwner}".${QB}${typeName}${QE}
AS OBJECT (
${source}
)]]></SQL>
            </Command>
            <Confirm>
               Create object type ${typeOwner}.${typeName}?
            </Confirm>
            <Result>
               Object type ${typeOwner}.${typeName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ObjectType">
         <Action id="oracle-type-body-create" label="Create Object Type Body" reload="true" icon="add">
            <Input label="Type Owner" name="typeOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Body Name" name="typeName" style="text">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor"/>
            <Command exectype="asis">
               <SQL><![CDATA[
CREATE TYPE BODY "${typeOwner}".${QB}${typeName}${QE}
AS
${source}
END;]]></SQL>
            </Command>
            <Confirm>
               Create object type body ${typeOwner}.${typeName}?
            </Confirm>
            <Result>
               Object type body ${typeOwner}.${typeName} created!
            </Result>
         </Action>

         <Action id="oracle-type-drop" label="Drop Object Type and Type Body" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop type "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop object type and body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Object type and body ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-type-compile" label="Compile Object Type" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${objectname}" compile specification]]></SQL>
            </Command>
            <Confirm>
               Compile object type ${schema}.${objectname}?
            </Confirm>
            <Result>
               Object type ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-type-compileboth" label="Compile Object Type and Body" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${objectname}" compile]]></SQL>
            </Command>
            <Confirm>
               Compile object type and body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Object Type and body ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-type-export" label="Export Object Type" icon="export"
                 class="objectTypeExport"
                 doclink="/doclink/export-code-object"/>

      </ActionGroup>

      <ActionGroup type="ObjectTypeBodies">
         <Action id="oracle-typebodies-create" label="Create Object Type Body" reload="true" icon="add"
                 doclink="/doclink/create-code-object">
            <Input label="Type Owner" name="typeOwner" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select distinct username from sys.all_users order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Body Name" name="typeName" style="text"/>
            <Command exectype="asis">
               <SQL><![CDATA[
CREATE TYPE BODY "${typeOwner}".${QB}${typeName}${QE}
AS
END;]]></SQL>
            </Command>
            <Confirm>
               Create object type body ${typeOwner}.${typeName}?
            </Confirm>
            <Result>
               Object type body ${typeOwner}.$typeName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ObjectTypeBody">
         <Action id="oracle-typebody-drop" label="Drop Object Type Body" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Body" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[drop type body "${schema}"."${objectname}"]]></SQL>
            </Command>
            <Confirm>
               Really drop object type body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Object type body ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="oracle-typebody-compile" label="Compile Object Type Body" reload="true" icon="compile">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Type Body" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[alter type "${schema}"."${objectname}" compile body]]></SQL>
            </Command>
            <Confirm>
               Compile object type body ${schema}.${objectname}?
            </Confirm>
            <Result>
               Object type body ${schema}.${objectname} has been compiled!
            </Result>
         </Action>

         <Action id="oracle-typebody-export" label="Export Object Type Body" icon="export"
                 class="objectTypeBodyExport"
                 doclink="/doclink/export-code-object"/>

      </ActionGroup>

      <ActionGroup type="RecycleBinTable">
         <Action id="oracle-recyclebintable-flashback" label="Flashback to Before Drop" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Bin Object Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Object Type" style="text" editable="false">
               <Default>${oracle.getRecycleBin.TYPE}</Default>
            </Input>
            <Input label="Drop Time" style="text" editable="false">
               <Default>${oracle.getRecycleBin.DROPTIME}</Default>
            </Input>
            <Input label="Original Name" name="newName" style="text" editable="true">
               <Default>${oracle.getRecycleBin.ORIGINAL_NAME}</Default>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[flashback table "${objectname}" to before drop rename to ${QB}${newName}${QE}]]></SQL>
            </Command>
            <Confirm><![CDATA[
            Really flashback (restore) the table to ${newName}?
            ]]></Confirm>
            <Result>
               Table ${newName} has been restored!
            </Result>
         </Action>

         <Action id="oracle-recyclebintable-purge" label="Purge from Recycle Bin" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Bin Object Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Object Type" style="text" editable="false">
               <Default>${oracle.getRecycleBin.TYPE}</Default>
            </Input>
            <Input label="Drop Time" style="text" editable="false">
               <Default>${oracle.getRecycleBin.DROPTIME}</Default>
            </Input>
            <Input label="Original Name" style="text" editable="false">
               <Default>${oracle.getRecycleBin.ORIGINAL_NAME}</Default>
            </Input>

            <Command>
               <SQL><![CDATA[purge table "${objectname}"]]></SQL>
            </Command>
            <Confirm><![CDATA[
            Really purge the table from the recycle bin?
            ]]></Confirm>
            <Result>
               Table ${objectname} has been purged!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Jobs">
         <Action id="oracle-jobs-create" label="Create Job" icon="add" reload="true">
            <Input name="startdateday" label="Start Date" style="list" linebreak="false">
               <Labels>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31
               </Labels>
               <Values>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31
               </Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select to_char(sysdate,'DD') from dual]]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="startdatemonth" style="list" linebreak="false">
               <Labels>
                  January|February|March|April|May|June|July|August|September|October|November|December
               </Labels>
               <Values>01|02|03|04|05|06|07|08|09|10|11|12</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select to_char(sysdate,'MM') from dual]]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="startdateyear" style="list" linebreak="true">
               <Labels>
                  <Command>
                     <SQL>
                        <![CDATA[select to_char(sysdate,'YYYY') from dual union select to_char(sysdate + 365,'YYYY') from dual union select to_char(sysdate + 730,'YYYY') from dual]]></SQL>
                  </Command>
               </Labels>
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select to_char(sysdate,'YYYY') from dual union select to_char(sysdate + 365,'YYYY') from dual union select to_char(sysdate + 730,'YYYY') from dual]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input name="starthour" label="Start Time" style="list" linebreak="false">
               <Labels>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23
               </Labels>
               <Values>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23
               </Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select to_char(sysdate,'HH24') from dual]]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="startminute" style="list" linebreak="false">
               <Labels>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59
               </Labels>
               <Values>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59
               </Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select to_char(sysdate,'MI') from dual]]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="startsecond" style="list" linebreak="true">
               <Labels>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59
               </Labels>
               <Values>
                  01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59
               </Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select to_char(sysdate,'SS') from dual]]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input label="Interval" style="text" name="interval" editable="true">
            </Input>
            <Input label="What to execute" name="what" style="text-editor"/>
            <Input label="Parse PL/SQL" name="parse" style="radio">
               <Labels>Parse|No Parse</Labels>
               <Values>FALSE|TRUE</Values>
            </Input>
            <SetVar name="_what" value="#what.replaceAll('\'','\'\'')"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[declare JN number; begin dbms_job.submit(job => JN,what => '${_what}',next_date => to_date('${startdateday}/${startdatemonth}/${startdateyear} ${starthour}:${startminute}:${startsecond}', 'DD/MM/YYYY HH24:MI:SS'),interval => '${interval}',no_parse => ${parse}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Create database job?]]></Confirm>
            <Result>Database job created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Job">
         <Action id="oracle-job-run" label="Run Job" icon="execute" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin dbms_job.run(${objectname}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Run job ${objectname}?]]></Confirm>
            <Result>Job has been run.</Result>
         </Action>
         <Action id="oracle-job-disable" label="Disable Job" icon="lock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_job.broken(${objectname},TRUE); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Disable job ${objectname}?]]></Confirm>
            <Result>Job has been disabled.</Result>
         </Action>
         <Action id="oracle-job-enable" label="Enable Job" icon="unlock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_job.broken(${objectname},FALSE); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Enable job ${objectname}?]]></Confirm>
            <Result>Job has been enabled.</Result>
         </Action>
         <Action id="oracle-job-remove" label="Remove Job" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin dbms_job.remove(${objectname}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Remove job ${objectname}?]]></Confirm>
            <Result>Job has been removed.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerJobArguments">
         <Action id="oracle-schedulerjobarguments-set" label="Add Scheduler Job Argument" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="argument_position" label="Argument Position" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select concat(level, '') from dual connect by level <= (select (max(argument_position) + 1) from ${#cp.SystemTablePrefix}_scheduler_job_args where owner='${schema}' and job_name='"${objectname}"')]]></SQL>
                  </Command>
               </Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select (max(argument_position) + 1) from ${#cp.SystemTablePrefix}_scheduler_job_args where owner='${schema}' and job_name='"${objectname}"']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="argument_value" label="Argument Value" style="text" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_job_argument_value(job_name=>'${schema}."${objectname}"', argument_position=>'${argument_position}', argument_value=>'${argument_value}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Add argument to job ${objectname}?]]></Confirm>
            <Result>Argument has been added.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerJobArgument">
         <Action id="oracle-schedulerjobargument-edit" label="Edit Scheduler Job Argument" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="argument_value" label="Argument Value" style="text" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_job_argument_value(job_name=>'${schema}."${theJobName}"', argument_position=>'${objectname}', argument_value=>'${argument_value}'); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Modify argument ${objectname} of job ${theJobName}?]]></Confirm>
            <Result>Argument has been modified.</Result>
         </Action>
         <Action id="oracle-schedulerjobargument-remove" label="Remove Scheduler Job Argument" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.reset_job_argument_value(job_name=>'${schema}."${theJobName}"', argument_position=>'${objectname}'); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Remove argument ${objectname} of job ${theJobName}?]]></Confirm>
            <Result>Argument has been removed.</Result>
         </Action>
      </ActionGroup>


      <ActionGroup type="SchedulerProgramArguments">
         <Action id="oracle-schedulerprogramarguments-set" label="Add Scheduler Program Argument" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="argument_position" label="Argument Position" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select concat(level, '') from dual connect by level <= (select (max(argument_position) + 1) from ${#cp.SystemTablePrefix}_scheduler_program_args where owner='${schema}' and program_name='${objectname}')]]></SQL>
                  </Command>
               </Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select (max(argument_position) + 1) from ${#cp.SystemTablePrefix}_scheduler_program_args where owner='${schema}' and program_name='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="argument_name" label="Argument Name" style="text" editable="true"/>
            <Input name="argument_type" label="Argument Type" style="list" editable="false">
               <Labels>VARCHAR2|NUMBER</Labels>
               <Values>VARCHAR2|NUMBER</Values>
            </Input>
            <Input name="argument_value" label="Default Value" style="text" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.define_program_argument(program_name=>'${schema}.${objectname}', argument_position=>'${argument_position}', argument_name => '${argument_name}', argument_type=> '${argument_type}', default_value=>'${argument_value}'); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[add argument to program ${objectname}?]]></Confirm>
            <Result>Argument has been added.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerProgramArgument">
         <Action id="oracle-schedulerprogramargument-edit" label="Edit Scheduler Program Argument" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="argument_value" label="Argument Value" style="text" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.define_program_argument(program_name=>'${schema}.${theProgramName}', argument_position=>'${argpos}', argument_name => '${objectname}', argument_type=> '${argtyp}',  default_value=>'${argument_value}'); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Modify argument ${objectname} of program ${theProgramName}?]]></Confirm>
            <Result>Argument has been modified.</Result>
         </Action>
         <Action id="oracle-schedulerprogramargument-remove" label="Remove Scheduler Program Argument" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_program_argument(program_name=>'${schema}.${theProgramName}', argument_position=>'${argpos}'); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Remove argument ${objectname} of program ${theProgramName}?]]></Confirm>
            <Result>Argument has been removed.</Result>
         </Action>
      </ActionGroup>


      <ActionGroup type="SchedulerChains">
         <Action id="oracle-schedulerchains-create" label="Create Scheduler Chain" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Chain Name" style="text" name="chain_name" editable="true" tip="required"/>
            <Input label="Rule Set Name" style="text" name="rule_set_name" editable="true" tip="optional"/>
            <Input label="Evaluation Interval" style="text" name="evaluation_interval" editable="true" tip="optional"/>
            <Input label="Comments" style="wrapped-text-editor" name="comments" editable="true" tip="optional"/>
            <SetVar name="_rule_set_name" value='#rule_set_name.equals("") ? "NULL" : "\u0027" + #rule_set_name +"\u0027"'/>
            <SetVar name="_evaluation_interval" value='#evaluation_interval.equals("") ? "NULL" : "\u0027" + #evaluation_interval +"\u0027"'/>
            <SetVar name="_comments" value='#comments.equals("") ? "NULL" : "\u0027" + #comments +"\u0027"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.create_chain(chain_name=>'${schema}.${QB}${chain_name}${QE}', rule_set_name=>${_rule_set_name}, evaluation_interval=>${_evaluation_interval}, comments=>${_comments}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Create scheduler chain?]]></Confirm>
            <Result>Scheduler chain created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerChain">
         <Action id="oracle-schedulerchain-analyze" label="Analyze Scheduler Chain" icon="lock" reload="false">
            <Command>
               <SQL><![CDATA[
@set serveroutput on;
@delimiter %%;
declare
rules sys.scheduler$_rule_list;
steps sys.scheduler$_step_type_list;
zout sys.scheduler$_chain_link_list;
begin
dbms_scheduler.analyze_chain(
chain_name => '"${schema}"."${objectname}"'
,rules     =>rules
 ,steps     => steps
,step_pairs => zout);
end;
%%
@delimiter ;%%
@set serveroutput off;
]]></SQL>
            </Command>
            <Result>Scheduler chain has been analyzed.</Result>
         </Action>
         <Action id="oracle-schedulerchain-run" label="Run Scheduler Chain" icon="execute" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Chain Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Start Steps" name="start_steps" style="grid">
               <Arg name="output" value=" ${step_name}"/>
               <Arg name="newline" value=", "/>
               <Input label="Step Name" name="step_name" style="list">
                  <Values column="3">
                     <Command idref="oracle.getSchedulerChainSteps">
                        <Input name="owner" value="${schema}"/>
                        <Input name="chain_name" value="${objectname}"/>
                        <Input name="step_name" value="%"/>
                     </Command>
                  </Values>
               </Input>
            </Input>
            <Input label="Job Name" style="text" name="job_name" editable="true" tip="optional"/>
            <SetVar name="_job_name" value='#job_name.equals("") ? "NULL" : "\u0027" + #schema + "." + #job_name +"\u0027"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.run_chain(chain_name=>'"${schema}"."${objectname}"', start_steps=>'${start_steps}', job_name=>${_job_name}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Run scheduler chain?]]></Confirm>
            <Result>Scheduler chain has been run.</Result>
         </Action>
         <Action id="oracle-schedulerchain-enable" label="Enable Scheduler Chain" icon="unlock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Chain Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.enable('"${schema}"."${objectname}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Enable scheduler chain?]]></Confirm>
            <Result>Scheduler chain has been enabled.</Result>
         </Action>
         <Action id="oracle-schedulerchain-disable" label="Disable Scheduler Chain" icon="lock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Chain Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.disable(name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Disable scheduler chain?]]></Confirm>
            <Result>Scheduler chain has been disabled.</Result>
         </Action>
         <Action id="oracle-schedulerchain-drop" label="Drop Scheduler Chain" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_chain(chain_name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler chain?]]></Confirm>
            <Result>Scheduler chain has been dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerChainRules">
         <Action id="oracle-schedulerchain-definechainrule" label="Define Scheduler Chain Rule" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Chain Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Condition" style="text" name="condition" editable="true" tip="required"/>
            <Input label="Action" style="text" name="action" editable="true" tip="required"/>
            <Input label="Rule name" style="text" name="rule_name" editable="true" tip="optional"/>
            <Input label="Comments" style="wrapped-text-editor" name="comments" editable="true" tip="optional"/>
            <SetVar name="_rule_name" value='#rule_name.equals("") ? "NULL" : "\u0027" + #rule_name +"\u0027"'/>
            <SetVar name="_comments" value='#comments.equals("") ? "NULL" : "\u0027" + #comments +"\u0027"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.define_chain_rule(chain_name=>'"${schema}"."${objectname}"', condition=>'${condition}', action=>'${action}', rule_name=>${_rule_name}, comments=>${_comments}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Create scheduler chain rule?]]></Confirm>
            <Result>Scheduler chain rule created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerChainRule">
         <Action id="oracle-schedulerchainrule-drop" label="Drop Scheduler Chain Rule" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Rule Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_chain_rule(chain_name=>'"${schema}"."${chain_name}"', rule_name=>'${objectname}', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler chain rule?]]></Confirm>
            <Result>Scheduler chain rule has been dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerChainSteps">
         <Action id="oracle-schedulerchain-definechainstep" label="Define Scheduler Chain Step" icon="add" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Chain Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Step Name" style="text" name="step_name" editable="true" tip="required"/>
            <Input label="Program Name" name="program_name" style="list" editable="false" tip="required">
               <Values>
                  <Command>
                     <SQL><![CDATA[select owner||'.'||chain_name from ${#cp.SystemTablePrefix}_scheduler_chains
				--where owner='${schema}'
				union select owner||'.'||program_name from ${#cp.SystemTablePrefix}_scheduler_programs
				-- where owner='${schema}'
                        order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.define_chain_step(chain_name=>'"${schema}"."${objectname}"', step_name=>'${QB}${step_name}${QE}', program_name=>'"${program_name}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Create scheduler chain step?]]></Confirm>
            <Result>Scheduler chain step created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerChainStep">
         <Action id="oracle-schedulerchainstep-alter" label="Alter Scheduler Chain Step" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Chain Name" style="text" editable="false">
               <Default>${chain_name}</Default>
            </Input>
            <Input label="step Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="attribute" label="Attribute" style="list" tip="required">
               <Labels>PAUSE|RESTART_ON_RECOVERY|SKIP</Labels>
               <Values>PAUSE|RESTART_ON_RECOVERY|SKIP</Values>
            </Input>
            <Input name="value" label="Value" style="radio" tip="required">
               <Labels>True|False</Labels>
               <Values>true|false</Values>
               <Default>false</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.alter_chain(chain_name=>'"${schema}"."${chain_name}"', step_name=>'"${objectname}"', attribute=>'${attribute}', value=>${value}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Alter scheduler chain step?]]></Confirm>
            <Result>Scheduler chain step altered.</Result>
         </Action>
         <Action id="oracle-schedulerchainstep-drop" label="Drop Scheduler Chain Step" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Step Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_chain_step(chain_name=>'"${schema}"."${chain_name}"', step_name=>'"${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler chain step?]]></Confirm>
            <Result>Scheduler chain step has been dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerCredentials">
         <Action id="oracle-schedulercredentials-create" label="Create Scheduler Credential" icon="add" reload="true">
            <Input name="credential_name" label="Credential Name" style="text" editable="true"/>
            <Input name="user_name" label="User Name" style="text" editable="true" tip="the operating user that should run the job on the remote system"/>
            <Input name="password" label="Password" style="text" editable="true"/>
            <Input name="database_role" label="Role" style="list" tip="specify either SYSDBA,SYSOPER or NULL">
               <Labels>|sysdba|sysoper</Labels>
               <Values>|sysdba|sysoper</Values>
            </Input>
            <Input name="windows_domain" label="Windows Domain" style="text" editable="true"/>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.create_credential(credential_name=>'"${schema}".${QB}${credential_name}${QE}', username=>'${user_name}', password=>'${password}', database_role => '${database_role}', windows_domain=>'${windows_domain}', comments=>'${comments}'); end;]]></SQL>
            </Command>
            <Result>Credential created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerCredential">
         <Action id="oracle-schedulercredentials-drop" label="Drop Scheduler Credential" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_credential(credential_name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop credential ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler credential has been dropped.</Result>
         </Action>
         <Action id="oracle-schedulercredentials-modify" label="Modify Credential" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Credential Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="attribute" label="Attribute" style="list" editable="false">
               <Labels>|username|password|database_role|windows_domain
               </Labels>
               <Values>|username|password|database_role|windows_domain
               </Values>
            </Input>
            <Input name="value" label="Value" style="text" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_attribute(name=>'"${schema}"."${objectname}"', attribute=>'${attribute}',value=>'${value}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Modify credential ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler credential has modified.</Result>
         </Action>
         
         <Action id="oracle-schedulercredentials-comment" label="Comment Credential" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            
             <Input label="Credential Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true">
               <Default column="COMMENTS">
                 <Command idref="oracle.getSchedulerCredentials">
                     <Input name="owner" value="${schema}"/>
                     <Input name="credential_name" value="${objectname}"/>
                 </Command>
               </Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_attribute(name=>'"${schema}"."${objectname}"', attribute=>'comments',value=>'${comments}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Edit credential comments ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler credential comments has modified.</Result>
         </Action>
      </ActionGroup>
      
      <ActionGroup type="SchedulerJobs">
         <Action id="oracle-schedulerjobs-create" label="Create Scheduler Job" icon="add" reload="true">
            <Input name="job_name" label="Job Name" style="text" editable="true"/>
            <Input name="program_name" label="Program Name" style="list" tip="If a Program Name is entered, then Job Type, Job Action and Number of Arguments do not need to be entered.">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select ' ' from dual union all select '"' || owner||'"."'||program_name || '"' from ${#cp.SystemTablePrefix}_scheduler_programs]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input name="job_type" label="Job Type" style="list" editable="true">
               <Labels>|plsql_block|stored_procedure|executable|chain</Labels>
               <Values>|plsql_block|stored_procedure|executable|chain</Values>
            </Input>
            <Input name="job_action" label="Job Action" style="text-editor"/>
            <Input name="number_of_arguments" label="Number of Arguments" style="list">
               <Labels>
                  0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255
               </Labels>
               <Values>
                  0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255
               </Values>
               <Default>0</Default>
            </Input>
            <Input name="schedule_name" label="Schedule Name" style="list" tip="If a Schedule Name is entered, then Start Date, Repeat Interval and End Date do not need to be entered.">
               <Values>
                  <Command>
                     <SQL>
                        <If test="#util.isDatabaseVersionGTE(12)">         
                           <![CDATA[select ' ' from dual union all select '"' || owner||'"."'||schedule_name || '"' from ${#cp.SystemTablePrefix}_scheduler_schedules union all select '"' || owner || '"."' || window_name || '"' from all_scheduler_windows union all select  distinct('"SYS"."' || window_group_name || '"') from all_scheduler_wingroup_members]]>
                        </If>
                        <Else>
                           <![CDATA[select ' ' from dual union all select owner||'.'||schedule_name from ${#cp.SystemTablePrefix}_scheduler_schedules union all select window_name from ${#cp.SystemTablePrefix}_scheduler_windows union all select distinct(window_group_name) from ${#cp.SystemTablePrefix}_scheduler_wingroup_members]]>
                        </Else>
                     </SQL>
                  </Command>
               </Values>
            </Input>
            <Input name="start_date" label="Start Date" style="text" editable="true"/>
            <Input name="repeat_interval" label="Repeat Interval" style="text" editable="true"/>
            <Input name="end_date" label="End Date" style="text" editable="true"/>
            <Input name="job_class" label="Job Class" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select job_class_name from all_scheduler_job_classes]]></SQL>
                  </Command>
               </Values>
               <Default>DEFAULT_JOB_CLASS</Default>
            </Input>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true"/>
            <Input name="enabled" label="Enabled" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Input name="auto_drop" label="Auto Drop" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>True</Default>
            </Input>
            <If test="#util.isDatabaseVersionGTE(11)">
               <Input label="Remote destination" name="destination" style="list" editable="true">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select '' from dual union select destination from ${#cp.SystemTablePrefix}_scheduler_jobs order by 1]]></SQL>
                     </Command>
                  </Values>
               </Input>
               <Input label="Credential at destination" name="credential_name" style="list">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select ' ' from dual union select owner||'.'||credential_name from ${#cp.SystemTablePrefix}_scheduler_credentials order by 1]]></SQL>
                     </Command>
                  </Values>
               </Input>
            </If>
            <SetVar name="_job_action" value="#job_action.replaceAll('\'','\'\'')"/>
            <SetVar name="_start_date" value='#start_date.equals("") ? "NULL" : #start_date'/>
            <SetVar name="_repeat_interval" value='#repeat_interval.equals("") ? "NULL" : "\u0027" + #repeat_interval + "\u0027"'/>
            <SetVar name="_end_date" value='#end_date.equals("") ? "NULL" : #end_date'/>
            <SetVar name="_comments" value='#comments.equals("") ? "NULL" : "\u0027" + #comments + "\u0027"'/>
            <SetVar name="_fullJobName" value='"\"" + #schema + "\"" + "."+ #QB + #job_name + #QE'/>
            
            <SetVar name="_programschedule" value='#program_name neq " " and #schedule_name neq " " ? ", program_name=>\u0027" + #program_name + "\u0027, schedule_name=>\u0027" + #schedule_name + "\u0027" : #program_name.equals(" ") and #schedule_name neq " " ? ", job_type=>\u0027" + #job_type + "\u0027, job_action=>\u0027" + #_job_action + "\u0027, number_of_arguments=>" + #number_of_arguments + ", schedule_name=>\u0027" + #schedule_name + "\u0027" : #program_name neq " " and #schedule_name.equals(" ") ? ", program_name=>\u0027" + #program_name + "\u0027, start_date=>" + #_start_date + ", repeat_interval=>" + #_repeat_interval +", end_date=>" + #_end_date : ", job_type=>\u0027" + #job_type + "\u0027, job_action=>\u0027" + #_job_action + "\u0027, number_of_arguments=>" + #number_of_arguments + ", start_date=>" + #_start_date + ", repeat_interval=>" + #_repeat_interval +", end_date=>" + #_end_date'/>
            <SetVar name="_pn_jt_ja_noa_message" value='#program_name neq " " and (#job_type neq "" or #job_action neq "") ? "You have select a Program Name and enterered a Job Type/Job Action. The create will fail.\u003cbr\u003e" : ""'/>
            <SetVar name="_jt_noa_message" value='#job_type.equals("plsql_block") and #number_of_arguments > 0 ? "You have entered plsql_block for the Job Type and the Number of Arguments is greater than 0. The create will fail.\u003cbr\u003e" : ""'/>
            <SetVar name="_sn_sd_ri_ed_message" value='#schedule_name neq " " and (#start_date neq "" or #repeat_interval neq "" or #end_date neq "") ? "You have select a Schedule Name and enterered a Start Date/Repeat Interval/End Date. The create will fail.\u003cbr\u003e" : ""'/>
            <If test="#util.isDatabaseVersionGTE(11)">
               <SetVar name="_cred" value='#credential_name.equals(" ") ? "" : "dbms_scheduler.set_attribute(\u0027${_fullJobName}\u0027,\u0027credential_name\u0027, \u0027${credential_name}\u0027);"'/>
               <SetVar name="_dest" value='#destination.equals("") ? "" : "\ndbms_scheduler.set_attribute(\u0027${_fullJobName}\u0027,\u0027destination\u0027, \u0027${destination}\u0027);"'/>
               <SetVar name="_enabled" value='#enabled.equals("FALSE") ? "" : "\ndbms_scheduler.enable(\u0027${_fullJobName}\u0027);"'/>
               <Command exectype="asis">
                  <SQL><![CDATA[begin dbms_scheduler.create_job(job_name=>'"${schema}".${QB}${job_name}${QE}', job_class=>'${job_class}', comments=>${_comments}, auto_drop=>${auto_drop}${_programschedule});
${_cred}${_dest}${_enabled}
 end;]]></SQL>
               </Command>
            </If>
            <Else>
               <Command exectype="asis">
                  <SQL>
                     <![CDATA[begin dbms_scheduler.create_job(job_name=>'"${schema}".${QB}${job_name}${QE}', job_class=>'${job_class}', comments=>${_comments}, enabled=>${enabled}, auto_drop=>${auto_drop}${_programschedule}); end;]]></SQL>
               </Command>
            </Else>
            <Confirm>
               <![CDATA[${_pn_jt_ja_noa_message}${_jt_noa_message}${_sn_sd_ri_ed_message}Create scheduler job?]]></Confirm>
            <Result>Scheduler job created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerJob">
         <Action id="oracle-schedulerjob-enable" label="Enable Scheduler Job" icon="unlock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Job Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.enable('"${schema}"."${objectname}"'); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Enable scheduler job ${objectname}?]]></Confirm>
            <Result>Scheduler job has been enabled.</Result>
         </Action>
         <Action id="oracle-schedulerjob-disable" label="Disable Scheduler Job" icon="lock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Job Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.disable(name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Disable scheduler job ${objectname}?]]></Confirm>
            <Result>Scheduler job has been disabled.</Result>
         </Action>
         <Action id="oracle-schedulerjob-modify" label="Modify Scheduler Job" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
             <Input label="Job Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <If test="#util.isDatabaseVersionGTE(12)">
               <Input name="attribute" label="Attribute" style="list" editable="true">
                  <Labels>
                    |allow_runs_in_restricted_mode|auto_drop|credential_name|destination|enabled|end_date|follow_default_timezone|instance_id|instance_stickiness|job_action|job_class|job_priority|job_type|job_weight|logging_level|max_failures|max_run_duration|max_runs|number_of_arguments|program_name|repeat_interval|restartable|schedule_limit|schedule_name|start_date|stop_on_window_exit|store_output
                  </Labels>
                  <Values>
                     |allow_runs_in_restricted_mode|auto_drop|credential_name|destination|enabled|end_date|follow_default_timezone|instance_id|instance_stickiness|job_action|job_class|job_priority|job_type|job_weight|logging_level|max_failures|max_run_duration|max_runs|number_of_arguments|program_name|repeat_interval|restartable|schedule_limit|schedule_name|start_date|stop_on_window_exit|store_output
                  </Values>
               </Input>
            </If>
            <ElseIf test="#util.isDatabaseVersionGTE(11)">
                <Input name="attribute" label="Attribute" style="list" editable="true">
                  <Labels>
                     |auto_drop|credential_name|destination|enabled|end_date|instance_stickiness|job_action|job_class|job_priority|job_type|job_weight|logging_level|max_failures|max_run_duration|max_runs|number_of_arguments|program_name|repeat_interval|restartable|schedule_limit|schedule_name|start_date|stop_on_window_exit
                  </Labels>
                  <Values>
                     |auto_drop|credential_name|destination|enabled|end_date|instance_stickiness|job_action|job_class|job_priority|job_type|job_weight|logging_level|max_failures|max_run_duration|max_runs|number_of_arguments|program_name|repeat_interval|restartable|schedule_limit|schedule_name|start_date|stop_on_window_exit
                  </Values>
               </Input>
            </ElseIf>
            <Else>
               <Input name="attribute" label="Attribute" style="list" editable="true">
                  <Labels>
                     |auto_drop|enabled|end_date|instance_stickiness|job_action|job_class|job_priority|job_type|job_weight|logging_level|max_failures|max_run_duration|max_runs|number_of_arguments|program_name|repeat_interval|restartable|schedule_limit|schedule_name|start_date|stop_on_window_exit
                  </Labels>
                  <Values>
                     |auto_drop|enabled|end_date|instance_stickiness|job_action|job_class|job_priority|job_type|job_weight|logging_level|max_failures|max_run_duration|max_runs|number_of_arguments|program_name|repeat_interval|restartable|schedule_limit|schedule_name|start_date|stop_on_window_exit
                  </Values>
               </Input>
            </Else>
            <Input name="value" label="Value" style="text" editable="true">
            </Input>
            
            <SetVar name="_value" value='#value.toUpperCase().equals("TRUE") or #value.toUpperCase().equals("FALSE") ? #value : "\u0027" + #value + "\u0027"'/>
            <!-- If setting to NUll the procedure SET_ATTRIBUTE_NULL must be used -->

            <!-- _nameAndAttrDDL is  "name => '"sakila"."job1"', attribute => 'job_type'"  -->            
            <SetVar name="_nameAndAttrDDL" value='"name => " + "\u0027" + "\"" + #schema + "\"" + "." + "\"" + #objectname + "\"" + "\u0027" + ", attribute => " + "\u0027" + #attribute + "\u0027"'/>
            
            <SetVar name="_ddl" value="#value.equals(#sp.getProperty('dbvis.EditNullAs'))  ? 
            'set_attribute_null(' + #_nameAndAttrDDL + ')': 
            'set_attribute(' + #_nameAndAttrDDL + ', value => '  + #_value + ')'"/>
            
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.${_ddl}; end; ]]>
              </SQL>
            </Command>
            <Confirm>
               <![CDATA[Modify scheduler job ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler job has been modified.</Result>
         </Action>
         
         <Action id="oracle-schedulerjob-comment" label="Comment Scheduler Job" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
             <Input label="Job Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
           
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true">
            <Default column="COMMENTS">
                 <Command idref="oracle.getSchedulerJobs">
                     <Input name="owner" value="${schema}"/>
                     <Input name="job_name" value="${objectname}"/>
                 </Command>
            </Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_attribute(name => '"${schema}"."${objectname}"', attribute => 'comments', value => '${comments}'); end;]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Edit comments for scheduler job ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler job comments has been modified.</Result>
         </Action>
         
         <Action id="oracle-schedulerjob-run" label="Run Scheduler Job" icon="execute" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="in_current_session" label="Current Session" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.run_job(job_name => '"${schema}"."${objectname}"', use_current_session => ${in_current_session}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Run scheduler job ${objectname}?]]></Confirm>
            <Result>Scheduler job has been executed.</Result>
         </Action>
         <Action id="oracle-schedulerjob-alterrunningchain" label="Alter Running Chain" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Job Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Step Name" name="step_name" style="list" tip="required">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select a.step_name from ${#cp.SystemTablePrefix}_scheduler_running_chains a where a.owner='${schema}' and a.job_name='${objectname}' order by a.step_name]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input name="attribute" label="Attribute" style="list" tip="required">
               <Labels>PAUSE|RESTART_ON_RECOVERY|SKIP|STATE</Labels>
               <Values>PAUSE|RESTART_ON_RECOVERY|SKIP|STATE</Values>
            </Input>
            <Input name="value" label="Value" style="list" editable="true" tip="required">
               <Labels>TRUE|FALSE|NOT_STARTED|SUCCEEDED|FAILED error_code
               </Labels>
               <Values>TRUE|FALSE|NOT_STARTED|SUCCEEDED|FAILED error_code
               </Values>
            </Input>
            <SetVar name="_value" value='#value.equals("TRUE") or #value.equals("FALSE") ? #value : "\u0027" + #value +"\u0027"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.alter_running_chain(job_name=>'"${schema}"."${objectname}"', step_name=>'${step_name}', attribute=>'${attribute}', value=>${_value}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Alter running chain for job ${objectname}?]]></Confirm>
            <Result>Running chain has been altered.</Result>
         </Action>
         <Action id="oracle-schedulerjob-stop" label="Stop Scheduler Job" icon="stop" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.stop_job(job_name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Stop scheduler job ${objectname}?]]></Confirm>
            <Result>Scheduler job has been stopped.</Result>
         </Action>
         <Action id="oracle-schedulerjob-copy" label="Copy Scheduler Job" icon="copy" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Copy Job" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="new_job" label="New Job Name" style="text" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.copy_job(old_job=>'"${schema}"."${objectname}"', new_job=>'"${new_job}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Copy scheduler job ${objectname} to ${new_job}?]]></Confirm>
            <Result>Scheduler job has been copied.</Result>
         </Action>
         <Action id="oracle-schedulerjob-drop" label="Drop Scheduler Job" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Job" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_job(job_name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler job ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler job has been dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerJobClasses">
         <Action id="oracle-schedulerjobclasses-create" label="Create Scheduler Job Class" icon="add" reload="true">
            <Input name="job_class_name" label="Job Class Name" style="text" editable="true"/>
            <!--
                   <If test='#dm.getUserName() eq "SYSTEM" or #dm.getUserName() eq "SYS"'>
            -->
            <Input name="resource_consumer_group" label="Resource Consumer Group" style="list" tip="If you select a Resource Consumer Group, do not select a Service.">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select ' ' from dual union all select consumer_group from dba_rsrc_consumer_groups]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input name="service" label="Service" style="list" tip="If you select a Service, do not select a Resource Consumer Group.">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select ' ' from dual union all select name from dba_services]]></SQL>
                  </Command>
               </Values>
            </Input>
            <!--
                   </If>
                   <Else>
                   <Input name="resource_consumer_group" label="Resource Consumer Group" style="text" editable="true"/>
                   <Input name="service" label="Service" style="text" editable="true"/>
                   </Else>
            -->
            <Input name="logging_level" label="Logging Level" style="list" tip="">
               <Labels>full|off|runs</Labels>
               <Values>
                  DBMS_SCHEDULER.LOGGING_FULL|DBMS_SCHEDULER.LOGGING_OFF|DBMS_SCHEDULER.LOGGING_RUNS
               </Values>
               <Default>DBMS_SCHEDULER.LOGGING_RUNS</Default>
            </Input>
            <Input name="log_history" label="Log History" style="list" tip="">
               <Labels>
                  1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255|256|257|258|259|260|261|262|263|264|265|266|267|268|269|270|271|272|273|274|275|276|277|278|279|280|281|282|283|284|285|286|287|288|289|290|291|292|293|294|295|296|297|298|299|300|301|302|303|304|305|306|307|308|309|310|311|312|313|314|315|316|317|318|319|320|321|322|323|324|325|326|327|328|329|330|331|332|333|334|335|336|337|338|339|340|341|342|343|344|345|346|347|348|349|350|351|352|353|354|355|356|357|358|359|360|361|362|363|364|365|366|367|368|369|370|371|372|373|374|375|376|377|378|379|380|381|382|383|384|385|386|387|388|389|390|391|392|393|394|395|396|397|398|399|400|401|402|403|404|405|406|407|408|409|410|411|412|413|414|415|416|417|418|419|420|421|422|423|424|425|426|427|428|429|430|431|432|433|434|435|436|437|438|439|440|441|442|443|444|445|446|447|448|449|450|451|452|453|454|455|456|457|458|459|460|461|462|463|464|465|466|467|468|469|470|471|472|473|474|475|476|477|478|479|480|481|482|483|484|485|486|487|488|489|490|491|492|493|494|495|496|497|498|499|500|501|502|503|504|505|506|507|508|509|510|511|512|513|514|515|516|517|518|519|520|521|522|523|524|525|526|527|528|529|530|531|532|533|534|535|536|537|538|539|540|541|542|543|544|545|546|547|548|549|550|551|552|553|554|555|556|557|558|559|560|561|562|563|564|565|566|567|568|569|570|571|572|573|574|575|576|577|578|579|580|581|582|583|584|585|586|587|588|589|590|591|592|593|594|595|596|597|598|599|600|601|602|603|604|605|606|607|608|609|610|611|612|613|614|615|616|617|618|619|620|621|622|623|624|625|626|627|628|629|630|631|632|633|634|635|636|637|638|639|640|641|642|643|644|645|646|647|648|649|650|651|652|653|654|655|656|657|658|659|660|661|662|663|664|665|666|667|668|669|670|671|672|673|674|675|676|677|678|679|680|681|682|683|684|685|686|687|688|689|690|691|692|693|694|695|696|697|698|699|700|701|702|703|704|705|706|707|708|709|710|711|712|713|714|715|716|717|718|719|720|721|722|723|724|725|726|727|728|729|730|731|732|733|734|735|736|737|738|739|740|741|742|743|744|745|746|747|748|749|750|751|752|753|754|755|756|757|758|759|760|761|762|763|764|765|766|767|768|769|770|771|772|773|774|775|776|777|778|779|780|781|782|783|784|785|786|787|788|789|790|791|792|793|794|795|796|797|798|799|800|801|802|803|804|805|806|807|808|809|810|811|812|813|814|815|816|817|818|819|820|821|822|823|824|825|826|827|828|829|830|831|832|833|834|835|836|837|838|839|840|841|842|843|844|845|846|847|848|849|850|851|852|853|854|855|856|857|858|859|860|861|862|863|864|865|866|867|868|869|870|871|872|873|874|875|876|877|878|879|880|881|882|883|884|885|886|887|888|889|890|891|892|893|894|895|896|897|898|899|900|901|902|903|904|905|906|907|908|909|910|911|912|913|914|915|916|917|918|919|920|921|922|923|924|925|926|927|928|929|930|931|932|933|934|935|936|937|938|939|940|941|942|943|944|945|946|947|948|949|950|951|952|953|954|955|956|957|958|959|960|961|962|963|964|965|966|967|968|969|970|971|972|973|974|975|976|977|978|979|980|981|982|983|984|985|986|987|988|989|990|991|992|993|994|995|996|997|998|999
               </Labels>
               <Values>
                  1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255|256|257|258|259|260|261|262|263|264|265|266|267|268|269|270|271|272|273|274|275|276|277|278|279|280|281|282|283|284|285|286|287|288|289|290|291|292|293|294|295|296|297|298|299|300|301|302|303|304|305|306|307|308|309|310|311|312|313|314|315|316|317|318|319|320|321|322|323|324|325|326|327|328|329|330|331|332|333|334|335|336|337|338|339|340|341|342|343|344|345|346|347|348|349|350|351|352|353|354|355|356|357|358|359|360|361|362|363|364|365|366|367|368|369|370|371|372|373|374|375|376|377|378|379|380|381|382|383|384|385|386|387|388|389|390|391|392|393|394|395|396|397|398|399|400|401|402|403|404|405|406|407|408|409|410|411|412|413|414|415|416|417|418|419|420|421|422|423|424|425|426|427|428|429|430|431|432|433|434|435|436|437|438|439|440|441|442|443|444|445|446|447|448|449|450|451|452|453|454|455|456|457|458|459|460|461|462|463|464|465|466|467|468|469|470|471|472|473|474|475|476|477|478|479|480|481|482|483|484|485|486|487|488|489|490|491|492|493|494|495|496|497|498|499|500|501|502|503|504|505|506|507|508|509|510|511|512|513|514|515|516|517|518|519|520|521|522|523|524|525|526|527|528|529|530|531|532|533|534|535|536|537|538|539|540|541|542|543|544|545|546|547|548|549|550|551|552|553|554|555|556|557|558|559|560|561|562|563|564|565|566|567|568|569|570|571|572|573|574|575|576|577|578|579|580|581|582|583|584|585|586|587|588|589|590|591|592|593|594|595|596|597|598|599|600|601|602|603|604|605|606|607|608|609|610|611|612|613|614|615|616|617|618|619|620|621|622|623|624|625|626|627|628|629|630|631|632|633|634|635|636|637|638|639|640|641|642|643|644|645|646|647|648|649|650|651|652|653|654|655|656|657|658|659|660|661|662|663|664|665|666|667|668|669|670|671|672|673|674|675|676|677|678|679|680|681|682|683|684|685|686|687|688|689|690|691|692|693|694|695|696|697|698|699|700|701|702|703|704|705|706|707|708|709|710|711|712|713|714|715|716|717|718|719|720|721|722|723|724|725|726|727|728|729|730|731|732|733|734|735|736|737|738|739|740|741|742|743|744|745|746|747|748|749|750|751|752|753|754|755|756|757|758|759|760|761|762|763|764|765|766|767|768|769|770|771|772|773|774|775|776|777|778|779|780|781|782|783|784|785|786|787|788|789|790|791|792|793|794|795|796|797|798|799|800|801|802|803|804|805|806|807|808|809|810|811|812|813|814|815|816|817|818|819|820|821|822|823|824|825|826|827|828|829|830|831|832|833|834|835|836|837|838|839|840|841|842|843|844|845|846|847|848|849|850|851|852|853|854|855|856|857|858|859|860|861|862|863|864|865|866|867|868|869|870|871|872|873|874|875|876|877|878|879|880|881|882|883|884|885|886|887|888|889|890|891|892|893|894|895|896|897|898|899|900|901|902|903|904|905|906|907|908|909|910|911|912|913|914|915|916|917|918|919|920|921|922|923|924|925|926|927|928|929|930|931|932|933|934|935|936|937|938|939|940|941|942|943|944|945|946|947|948|949|950|951|952|953|954|955|956|957|958|959|960|961|962|963|964|965|966|967|968|969|970|971|972|973|974|975|976|977|978|979|980|981|982|983|984|985|986|987|988|989|990|991|992|993|994|995|996|997|998|999
               </Values>
               <Default>30</Default>
            </Input>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true"/>
            <SetVar name="_resource_consumer_group" value='#resource_consumer_group.equals(" ") or #resource_consumer_group.equals("") ? "NULL" : "\u0027" + #resource_consumer_group + "\u0027"'/>
            <SetVar name="_service" value='#service.equals(" ") or #service.equals("") ? "NULL" : "\u0027" + #service + "\u0027"'/>
            <SetVar name="_logging_level" value='#logging_level.equals("") ? "NULL" : #logging_level'/>
            <SetVar name="_comments" value='#comments.equals("") ? "NULL" : "\u0027" + #comments + "\u0027"'/>
            <SetVar name="_rsc_service_message" value='#resource_consumer_group neq " " and #service neq " " and #resource_consumer_group neq "" and #service neq "" ? "You have selected a Resource Consumer Group and a Service.  The create will fail.\u003cbr\u003e" : ""'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.create_job_class(job_class_name=>'${QB}${job_class_name}${QE}', resource_consumer_group=>${_resource_consumer_group}, service=>${_service}, logging_level=>${_logging_level}, log_history=>${log_history}, comments=>${_comments}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[${_rsc_service_message}Create scheduler job class?]]></Confirm>
            <Result>Scheduler job class created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerJobClass">
         <Action id="oracle-schedulerjobclass-drop" label="Drop Scheduler Job Class" icon="remove" reload="true">
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_job_class(job_class_name=>'"${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler job class ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler job class dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerPrograms">
         <Action id="oracle-schedulerprograms-create" label="Create Scheduler Program" icon="add" reload="true">
            <Input name="program_name" label="Program Name" style="text" editable="true"/>
            <Input name="program_type" label="Program Type" style="list">
               <Labels>|plsql_block|stored_procedure|executable</Labels>
               <Values>|plsql_block|stored_procedure|executable</Values>
            </Input>
            <Input name="program_action" label="Program Action" style="text-editor"/>
            <Input name="number_of_arguments" label="Number of Arguments" style="list">
               <Labels>
                  0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255
               </Labels>
               <Values>
                  0|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65|66|67|68|69|70|71|72|73|74|75|76|77|78|79|80|81|82|83|84|85|86|87|88|89|90|91|92|93|94|95|96|97|98|99|100|101|102|103|104|105|106|107|108|109|110|111|112|113|114|115|116|117|118|119|120|121|122|123|124|125|126|127|128|129|130|131|132|133|134|135|136|137|138|139|140|141|142|143|144|145|146|147|148|149|150|151|152|153|154|155|156|157|158|159|160|161|162|163|164|165|166|167|168|169|170|171|172|173|174|175|176|177|178|179|180|181|182|183|184|185|186|187|188|189|190|191|192|193|194|195|196|197|198|199|200|201|202|203|204|205|206|207|208|209|210|211|212|213|214|215|216|217|218|219|220|221|222|223|224|225|226|227|228|229|230|231|232|233|234|235|236|237|238|239|240|241|242|243|244|245|246|247|248|249|250|251|252|253|254|255
               </Values>
               <Default>0</Default>
            </Input>
            <Input name="enabled" label="Enabled" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true"/>
            <SetVar name="_program_action" value="#program_action.replaceAll('\'','\'\'')"/>
            <SetVar name="_comments" value='#comments.equals("") ? "NULL" : "\u0027" + #comments + "\u0027"'/>
            <SetVar name="_pt_noa_message" value='#program_type.equals("plsql_block") and #number_of_arguments > 0 ? "You have entered plsql_block for the Program Type and the Number of Arguments is greater than 0. The create will fail.\u003cbr\u003e" : ""'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.create_program(program_name=>'"${schema}".${QB}${program_name}${QE}', program_type=>'${program_type}', program_action=>'${program_action}', number_of_arguments=>${number_of_arguments}, enabled=>${enabled}, comments=>${_comments}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[${_pt_noa_message}Create scheduler program?]]></Confirm>
            <Result>Scheduler program created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerProgram">
         <Action id="oracle-schedulerprogram-enable" label="Enable Scheduler Program" icon="unlock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Program Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin dbms_scheduler.enable('"${schema}"."${objectname}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Enable scheduler program ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler program has been enabled.</Result>
         </Action>
         <Action id="oracle-schedulerprogram-disable" label="Disable Scheduler Program" icon="lock" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin dbms_scheduler.disable(name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Disable scheduler program ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler program has been disabled.</Result>
         </Action>
         <Action id="oracle-schedulerprogram-modify" label="Modify Scheduler Program" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Program Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>

            <If test="#util.isDatabaseVersionGTE(11)">
               <Input name="attribute" label="Attribute" style="list" editable="true">
                  <Values>
                     detached|number_of_arguments|program_action|program_type
                  </Values>
                  <Default>program_action</Default>
               </Input>
            </If>
            <Else>
               <Input name="attribute" label="Attribute" style="list" editable="true">
                  <Values>
                      number_of_arguments|program_action|program_type
                  </Values>
                  <Default>program_action</Default>
               </Input>
            </Else>
           
            <Input name="value" label="Value" style="text" editable="true">
            </Input>
              
            <SetVar name="_value" value="#attribute.equals('number_of_arguments') || #attribute.equals('detached')  ? #value : '\'' + #value + '\''"/>
        
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_attribute(name => '"${schema}"."${objectname}"', attribute => '${attribute}', value => ${_value}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Modify scheduler program ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler program has been modified.</Result>
         </Action>
         
         <Action id="oracle-schedulerprogram-comment" label="Comment Scheduler Program" icon="edit" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Program Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
           
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true">
             <Default column="COMMENTS">
                 <Command idref="oracle.getSchedulerPrograms">
                     <Input name="owner" value="${schema}"/>
                     <Input name="program_name" value="${objectname}"/>
                 </Command>
            </Default>
            </Input>
              
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_attribute(name => '"${schema}"."${objectname}"', attribute => 'comments', value => '${comments}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Edit comments for scheduler program ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler program comments has been modified.</Result>
         </Action>

         <Action id="oracle-schedulerprogram-drop" label="Drop Scheduler Program" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Program Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_program(program_name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler program ${schema}.${objectname}?]]></Confirm>
            <Result>Scheduler program has been dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerSchedules">
         <Action id="oracle-schedulerschedules-create" label="Create Scheduler Schedule" icon="add" reload="true">
            <Input name="schedule_name" label="Schedule Name" style="text" editable="true"/>
            <Input name="start_date" label="Start Date" style="text" editable="true"/>
            <Input name="repeat_interval" label="Repeat Interval" style="text" editable="true"/>
            <Input name="end_date" label="End Date" style="text" editable="true"/>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true"/>
            <SetVar name="_start_date" value='#start_date.equals("") ? "NULL" : #start_date'/>
            <SetVar name="_repeat_interval" value='#repeat_interval.equals("") ? "NULL" : "\u0027" + #repeat_interval + "\u0027"'/>
            <SetVar name="_end_date" value='#end_date.equals("") ? "NULL" : #end_date'/>
            <SetVar name="_comments" value='#comments.equals("") ? "NULL" : "\u0027" + #comments + "\u0027"'/>
            <SetVar name="_sd_ri_message" value='#start_date.equals("") and #repeat_interval.equals("") ? "You must enter a Start Date or a Repeat Interval. The create will fail.\u003cbr\u003e" : ""'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.create_schedule(schedule_name=>'"${schema}".${QB}${schedule_name}${QE}', start_date=>${_start_date}, repeat_interval=>${_repeat_interval}, end_date=>${_end_date}, comments=>${_comments}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[${_sd_ri_message}Create scheduler schedule?]]></Confirm>
            <Result>Scheduler schedule created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerSchedule">
         <Action id="oracle-schedulerschedule-evaluate" label="Evaluate Scheduler Schedule" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Schedule Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="startdate" label="Startdate" style="text" editable="true">
               <Default>sysdate</Default>
            </Input>
            <Input name="steps" label="Steps" style="text" editable="true">
               <Default>7</Default>
            </Input>
            <Command>
               <SQL><![CDATA[
@set serveroutput on;
@delimiter %%;
declare start_date     TIMESTAMP with time zone;
 return_date_after     TIMESTAMP with time zone;
 next_run_date         TIMESTAMP with time zone;
BEGIN
  start_date := ${startdate};
  return_date_after := start_date;
  FOR i IN 1..${steps}
  LOOP
    dbms_scheduler.evaluate_calendar_string('"${schema}"."${objectname}"',
        start_date, return_date_after, next_run_date);
    dbms_output.put_line (next_run_date);
    return_date_after := next_run_date;
   END LOOP;
   return;
END;
%%
@delimiter ;%%
@set serveroutput off;
]]></SQL>
            </Command>
            <Result>Scheduler schedule has been evaluated.</Result>
         </Action>
         <Action id="oracle-schedulerschedule-drop" label="Drop Scheduler Schedule" icon="remove" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Schedule Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_schedule(schedule_name=>'"${schema}"."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler schedule ${objectname}?]]></Confirm>
            <Result>Scheduler schedule has been dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerWindows">
         <Action id="oracle-schedulerwindows-create" label="Create Scheduler Window" icon="add" reload="true">
            <Input name="window_name" label="Window Name" style="text" editable="true"/>

            <Input name="resource_plan" label="Resource Plan" style="list" tip="">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select ' ' from dual union all select plan from DBA_RSRC_PLANS]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input name="schedule_name" label="Schedule Name" style="list" tip="If a Schedule Name is entered, then Start Date and End Date do not need to be entered.">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select ' ' from dual union all select schedule_name from ${#cp.SystemTablePrefix}_scheduler_schedules]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input name="start_date" label="Start Date" style="text" editable="true"/>
            <Input name="repeat_interval" label="Repeat Interval" style="text" editable="true"/>
            <Input name="end_date" label="End Date" style="text" editable="true"/>
            <Input name="duration" label="Duration" style="text" editable="true"/>
            <Input name="window_priority" label="Window Priority" style="list">
               <Labels>LOW|HIGH</Labels>
               <Values>LOW|HIGH</Values>
               <Default>LOW</Default>
            </Input>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true"/>
            <SetVar name="_resource_plan" value='#resource_plan.equals("") or #resource_plan.equals(" ") ? "NULL" : "\u0027" + #resource_plan + "\u0027"'/>
            <SetVar name="_start_date" value='#start_date.equals("") ? "NULL" : #start_date'/>
            <SetVar name="_repeat_interval" value='#repeat_interval.equals("") ? "NULL" : "\u0027" + #repeat_interval + "\u0027"'/>
            <SetVar name="_end_date" value='#end_date.equals("") ? "NULL" : #end_date'/>
            <SetVar name="_comments" value='#comments.equals("") ? "NULL" : "\u0027" + #comments + "\u0027"'/>
            <SetVar name="_windowschedule" value='#schedule_name neq " " ? ", schedule_name=>\u0027" +"SYS." + #schedule_name + "\u0027" : ", start_date=>" + #_start_date + ", repeat_interval=>" + #_repeat_interval + ", end_date=>" + #_end_date'/>
            <SetVar name="_sn_sd_ed_message" value='#schedule_name neq " " and (#start_date neq "" or #end_date neq "") ? "You have select a Schedule Name and enterered a Start Date/End Date. The create will fail.\u003cbr\u003e" : ""'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.create_window(window_name=>'${QB}${window_name}${QE}', resource_plan=>${_resource_plan}, duration=>${duration}, window_priority=>'${window_priority}', comments=>${_comments}${_windowschedule}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[${_sn_sd_ed_message}Create scheduler window?]]></Confirm>
            <Result>Scheduler window created.</Result>
         </Action>
         <Action id="oracle-schedulerwindows-purge" label="Purge Window logs" icon="remove" reload="true">
            <Input name="log_history" label="Log History (Days)" style="number">
               <Default>999</Default>
            </Input>
            <SetVar name="_size_message" value='#size > 999 ? "Size can only be between 0 and 999. The purge will fail.\u003cbr\u003e" : ""'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.purge_log(log_history=>${log_history}, which_log=>'window_log'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[${_size_message}Purge scheduler window logs?]]></Confirm>
            <Result>Scheduler window logs purged.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerWindow">
         <Action id="oracle-schedulerwindow-enable" label="Enable Scheduler Window" icon="unlock" reload="true">
            <Input label="Scheduler Window" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.enable('SYS."${objectname}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Enable scheduler window ${objectname}?]]></Confirm>
            <Result>Scheduler window has been enabled.</Result>
         </Action>
         <Action id="oracle-schedulerwindow-disable" label="Disable Scheduler Window" icon="lock" reload="true">
            <Input label="Scheduler Window" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.disable(name=>'SYS."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Disable scheduler window ${objectname}?]]></Confirm>
            <Result>Scheduler window has been disabled.</Result>
         </Action>
         <Action id="oracle-schedulerwindow-open" label="Open Scheduler Window" icon="OpenFolder" reload="true">
            <Input label="Scheduler Window" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>

            <Input name="duration" label="Duration Minutes" style="text" editable="true"/>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.open_window(window_name=>'SYS."${objectname}"', duration=>numtodsinterval(${duration},'minute'), force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Open scheduler window ${objectname}?]]></Confirm>
            <Result>Scheduler window has been opened.</Result>
         </Action>
         <Action id="oracle-schedulerwindow-close" label="Close Scheduler Window" icon="ClosedFolder" reload="true">
            <Input label="Scheduler Window" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.close_window(window_name=>'SYS."${objectname}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Close scheduler window ${objectname}?]]></Confirm>
            <Result>Scheduler window has been closed.</Result>
         </Action>
         <Action id="oracle-schedulerwindow-modify" label="Modify Scheduler Window" icon="edit" reload="true">
            <Input label="Scheduler Window" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="attribute" label="Attribute" style="list">
               <Labels>
                  |resource_plan|window_priority|duration|schedule_name|repeat_interval|start_date|end_date|enabled|schedule_type
               </Labels>
               <Values>
                  |resource_plan|window_priority|duration|schedule_name|repeat_interval|start_date|end_date|enabled|schedule_type
               </Values>
            </Input>
            <Input name="value" label="Value" style="text" editable="true">
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_attribute(name=>'SYS."${objectname}"',attribute=>'${attribute}', value => '${value}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Modify scheduler window ${objectname}?]]></Confirm>
            <Result>Scheduler window has been modified.</Result>
         </Action>
         
          <Action id="oracle-schedulerwindow-comment" label="Comment Scheduler Window" icon="edit" reload="false">
            <Input label="Scheduler Window" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
         
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true">
            <Default column="COMMENTS">
                 <Command idref="oracle.getSchedulerWindows">
                        <Input name="window_name" value="${objectname}"/>
                 </Command>
            </Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_attribute(name=>'SYS."${objectname}"',attribute=>'comments', value => '${comments}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Edit comments for  scheduler window ${objectname}?]]></Confirm>
            <Result>Scheduler window comments has been modified.</Result>
         </Action>
         
         <Action id="oracle-schedulerwindow-drop" label="Drop Scheduler Window" icon="remove" reload="true">
            <Input label="Scheduler Window" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_window(window_name=>'"${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler window ${objectname}?]]></Confirm>
            <Result>Scheduler window has been dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerWindowGroups">
         <Action id="oracle-schedulerwindowgroups-create" label="Create Scheduler Window Group" icon="add" reload="true">
            <Input name="group_name" label="Group Name" style="text" editable="true"/>
            <Input name="window_list" style="grid">
               <Arg name="output" value="${window_name}"/>
               <Arg name="newline" value=", "/>
               <Input name="window_name" label="Window Name" style="list">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select window_name from all_scheduler_windows where window_name not in (select window_name from all_scheduler_wingroup_members) order by window_name]]></SQL>
                     </Command>
                  </Values>
               </Input>
               <SetVar name="_default" value='#default.equals("") ? "" : " default " + #default'/>
            </Input>
            <Input name="comments" label="Comments" style="wrapped-text-editor" editable="true"/>
            <SetVar name="_window_list" value='#window_list.equals("") ? "NULL" : "\u0027" + #window_list + "\u0027"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.create_window_group(group_name=>'${QB}${group_name}${QE}', window_list=>${_window_list}, comments=>'${comments}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Create scheduler window group?]]></Confirm>
            <Result>Scheduler window group created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerWindowGroup">
         <Action id="oracle-schedulerwindowgroup-enable" label="Enable Scheduler Window Group" icon="unlock" reload="true">
           
            <Input label="Scheduler Window Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.enable('SYS."${objectname}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Enable scheduler window group ${objectname}?]]></Confirm>
            <Result>Scheduler window group has been enabled.</Result>
         </Action>
         <Action id="oracle-schedulerwindowgroup-disable" label="Disable Scheduler Window Group" icon="lock" reload="true">
            <Input label="Scheduler Window Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.disable(name=>'SYS."${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Disable scheduler window group ${objectname}?]]></Confirm>
            <Result>Scheduler window group has been disabled.</Result>
         </Action>
         <Action id="oracle-schedulerwindowgroup-addmember" label="Add Window Group Member" icon="add" reload="true">
            <Input label="Scheduler Window Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>

            <Input name="window_list" style="grid">
               <Arg name="output" value="${window_name}"/>
               <Arg name="newline" value=", "/>
               <Input name="window_name" label="Window Name" style="list">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select window_name from all_scheduler_windows where window_name not in (select window_name from all_scheduler_wingroup_members) order by window_name]]></SQL>
                     </Command>
                  </Values>
               </Input>
            </Input>
            <SetVar name="_window_list" value='#window_list.equals("") ? "NULL" : "\u0027" + #window_list + "\u0027"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.add_window_group_member(group_name=>'SYS."${objectname}"', window_list=>${_window_list}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Add scheduler window group member?]]></Confirm>
            <Result>Scheduler window group member added.</Result>
         </Action>
         <Action id="oracle-schedulerwindowgroup-drop" label="Drop Window Group" icon="remove" reload="true">
            <Input label="Window Group" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="force" label="Force" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.drop_window_group(group_name=>'"${objectname}"', force=>${force}); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Drop scheduler window group ${objectname}?]]></Confirm>
            <Result>Scheduler window group dropped.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SchedulerWindowGroupMember">
         <Action id="oracle-schedulerwindowgroupmember-remove" label="Remove Window Group Member" icon="remove" reload="true">
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.remove_window_group_member(group_name=>'"${theGroupName}"', window_list=>'"${objectname}"'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Remove scheduler window group member?]]></Confirm>
            <Result>Scheduler window group member removed.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourceManager">
         <Action id="oracle-rsrc-create-pending" label="Create Pending Area" icon="add" reload="true">
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_resource_manager.create_pending_area(); end;]]></SQL>
            </Command>
            <Result>Pending area created.</Result>
         </Action>
         <Action id="oracle-rsrc-validate-pending" label="Validate Pending Area" icon="warning" reload="true">
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_resource_manager.validate_pending_area(); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Validate pending area?]]></Confirm>
            <Result>Pending area validated.</Result>
         </Action>
         <Action id="oracle-rsrc-submit-pending" label="Submit Pending Area" icon="execute" reload="true">
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_resource_manager.submit_pending_area(); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Submit pending area?]]></Confirm>
            <Result>Pending area submitted to the database.</Result>
         </Action>
         <Action id="oracle-rsrc-clear-pending" label="Clear Pending Area" icon="remove" reload="true">
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_resource_manager.clear_pending_area(); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Remove changes in pending area?]]></Confirm>
            <Result>Pending area cleared.</Result>
         </Action>
         <Action id="oracle-rsrc-generate-monitor" label="Generate Monitor SQL" icon="add" reload="true" resultaction="mergeastext" resulttarget="editor">
            <Input name="colfilter" label="Column Filter" style="text" editable="true" tip="try to select only the needed columns">
               <Default>%CPU%</Default>
            </Input>
            <Command>
               <SQL><![CDATA[
@set serveroutput on;
@delimiter %%;
begin
dbms_output.put_line ('select sysdate');
for i in (select  ',(select '||ac.column_name||' from V$RSRC_CONSUMER_GROUP where name = '''||rs.name||''')'|| substr(replace(rs.name ||ac.column_name,'_'),1,30)  line
from all_tab_columns ac
, V$RSRC_CONSUMER_GROUP rs
where ac.table_name = 'V_$RSRC_CONSUMER_GROUP'
and ac.column_name not in ('ID','NAME')
and column_name like '${colfilter}'
order by rs.name, ac.column_name
)
loop
dbms_output.put_line (i.line);
end loop;
dbms_output.put_line ('from dual;');
end;
%%
@delimiter ;%%
@set serveroutput off;
]]></SQL>
            </Command>
            <Result>Monitoring SQL generated, put it in a bookmark to use in a
               monitor.
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourceConsumerMapping">
         <Action id="oracle-rsrc-add-mapping" label="Add Resource Group Mapping" icon="add" reload="true">
           <Input name="attribute" style="text" editable="true">
             <Default>${objectname}</Default>
           </Input>
           <Input name="value" style="text" editable="true"/>
           <Input name="group" label="Resource Consumer Group" style="list">
              <Values>
                 <Command>
                    <SQL>
                       <![CDATA[select distinct consumer_group from
                       DBA_RSRC_CONSUMER_GROUPS order by consumer_group]]></SQL>
                 </Command>
              </Values>
           </Input>
           <Command exectype="asis">
              <SQL><![CDATA[begin
                dbms_resource_manager.set_consumer_group_mapping(attribute => '${attribute}', value => '${value}', consumer_group => '${group}');
          end;]]></SQL>
           </Command>
            <Result>Mapping added.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourceConsumerMappingValue">
         <Action id="oracle-rsrcremove-mapping" label="Remove From Resource Group Mapping" icon="remove" reload="true">
            <Confirm><![CDATA[Remove this Mapping of ${objectname} for ${attribute} from ${groupname}?]]></Confirm>
            <Command exectype="asis">
              <SQL><![CDATA[begin
                dbms_resource_manager.set_consumer_group_mapping(attribute => '${attribute}', value => '${objectname}', consumer_group => NULL);
          end;]]></SQL>
           </Command>
            <Result>Mapping removed.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourceConsumerGroups">
         <Action id="oracle-rsrc-create-group" label="Create Resource Consumer Group" icon="add" reload="true">
            <Input name="group" label="Resource Consumer Group" style="text" editable="true" tip="just a name">
               <Default>my_group</Default>
            </Input>
            <If test="#util.isDatabaseVersionGT(10)">
               <Input name="mgmt_mth" label="CPU allocation method" style="list">
                  <Labels>Round-Robin|RUN-TO-COMPLETION</Labels>
                  <Values>Round-Robin|RUN-TO-COMPLETION</Values>
                  <Default>Round-Robin</Default>
               </Input>
               <Input name="category" label="Category" style="list" editable="true" tip="category">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select distinct name from DBA_RSRC_CATEGORIES order by name]]></SQL>
                     </Command>
                  </Values>
               </Input>
            </If>
            <Else>
               <Input name="cpu_mth" label="CPU allocation method" style="text">
                  <Default>Round-Robin</Default>
               </Input>
            </Else>
            <Input name="comment" label="Comments" style="wrapped-text-editor" editable="true" tip="just a description of the consumer group">
               <Default>my_group</Default>
            </Input>
            <If test="#util.isDatabaseVersionGT(10)">
               <Command exectype="asis">
                  <SQL><![CDATA[begin
              dbms_resource_manager.create_consumer_group(consumer_group => '${group}', comment => '${comment}',mgmt_mth => '${mgmt_mth}', category => '${category}');
              end;]]></SQL>
               </Command>
            </If>
            <Else>
               <Command exectype="asis">
                  <SQL><![CDATA[begin
              dbms_resource_manager.create_consumer_group(consumer_group => '${QB}${group}${QE}', comment => '${comment}',cpu_mth => '${cpu_mth}');
              end;]]></SQL>
               </Command>
            </Else>
            <Result>Group created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourceConsumerGroup">
         <Action id="oracle-rsrc-grant-group" label="Grant Resource Consumer Group to User" icon="Privileges" reload="true">
            <Input label="User" name="user" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select username from dba_users order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Grant Option" name="option" style="radio">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>FALSE</Default>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager_privs.grant_switch_consumer_group(consumer_group => '${objectname}', grantee_name =>'${user}', grant_option => ${option} );
            end;]]></SQL>
            </Command>
            <Result>Group ${objectname} granted to ${user}.</Result>
         </Action>
         <Action id="oracle-rsrc-default-group" label="Group default for User" icon="Key" reload="true">
            <Input label="User" name="user" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select grantee from dba_rsrc_consumer_group_privs where granted_group = '${objectname}' and initial_group = 'NO' order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.set_initial_consumer_group(consumer_group => '${objectname}', user =>'${user}');
            end;]]></SQL>
            </Command>
            <Result>Group ${objectname} is now default for ${user}.</Result>
         </Action>
         <Action id="oracle-rsrc-revoke-group" label="Revoke Resource Consumer Group from User" icon="Privileges" reload="true">
            <Input label="User" name="user" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select grantee from DBA_RSRC_CONSUMER_GROUP_PRIVS where granted_group = '${objectname}' order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager_privs.revoke_switch_consumer_group(consumer_group => '${objectname}', revokee_name =>'${user}');
            end;]]></SQL>
            </Command>
            <Result>Group ${objectname} revoked from ${user}.</Result>
         </Action>
         <Action id="oracle-rsrc-remove-group" label="Remove Resource Consumer Group" icon="remove" reload="true">
            <Confirm><![CDATA[Remove resource consumer group ${group}?]]></Confirm>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.delete_consumer_group(consumer_group => '${objectname}');
            end;]]></SQL>
            </Command>
            <Result>Group removed.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourcePlans">
         <Action id="oracle-rsrc-create-plan" label="Create Resource Plan" icon="add" reload="true">
            <Input name="plan" label="Resource Plan" style="text" editable="true" tip="just a name">
               <Default>my_plan</Default>
            </Input>
            <Input name="comment" label="Comments" style="wrapped-text-editor" editable="true" tip="just a description of the plan">
               <Default>my_comments</Default>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.create_plan(plan => '${QB}${plan}${QE}', comment => '${comment}');
            dbms_resource_manager.create_plan_directive( plan => '${QB}${plan}${QE}', group_or_subplan => 'OTHER_GROUPS', comment => 'required group');
            end;]]></SQL>
            </Command>
            <Result>Plan created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourcePlan">
         <Action id="oracle-rsrc-activate-plan" label="Activate Resource Plan" icon="execute" reload="true">
            <Input name="sid" label="Sid" style="text" editable="true" tip="ORACLE_SID in which to activate">
               <Default>*</Default>
            </Input>
            <Input name="allow" label="Allow scheduled switches" style="radio" tip="Allow a window change to change the plan">
               <Values>TRUE|FALSE</Values>
               <Labels>TRUE|FALSE</Labels>
               <Default>TRUE</Default>
            </Input>
            <Confirm><![CDATA[Activate resource manger plan ${plan}?]]></Confirm>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.switch_plan(plan_name => '${plan}', sid => '${sid}', allow_scheduler_plan_switches => ${allow});
            end;]]></SQL>
            </Command>
            <Result>Plan ${plan} activated.</Result>
         </Action>
         <Action id="oracle-rsrc-remove-plan" label="Remove Resource Plan" icon="remove" reload="true">
            <Confirm><![CDATA[Remove resource manger plan ${plan}?]]></Confirm>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.delete_plan(plan => '${plan}');
            end;]]></SQL>
            </Command>
            <Result>Plan removed.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourcePlanDirectives">
         <Action id="oracle-rsrc-add-plan-directive" label="Add Group to Plan" icon="add" reload="true">
            <Confirm><![CDATA[Add resource group or subplan to the plan ${plan}?]]></Confirm>
            <Input label="Resource Group or Subplan" name="resourcegroup" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select group_or_subplan from (select consumer_group group_or_subplan from DBA_RSRC_CONSUMER_GROUPS union select plan from dba_rsrc_plans) order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Comments" name="comment" style="wrapped-text-editor" editable="true"/>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.create_plan_directive(plan => '${plan}', group_or_subplan => '${resourcegroup}', comment => '${comment}');
            end;]]></SQL>
            </Command>
            <Result>Plan directive added.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="ResourcePlanDirective">
         <Action id="oracle-rsrc-update-plan-directive" label="Modify Resource Directive" icon="edit" reload="true">
            <SetVar name="_comments" value='#util.isNullOrWhitespace(#comments) ? "" : #comments'/>
            <SetVar name="_active_sess_pool_p1" value='#util.isNullOrWhitespace(#active_sess_pool_p1) ? "NULL" : #active_sess_pool_p1'/>
            <SetVar name="_queueing_p1" value='#util.isNullOrWhitespace(#queueing_p1) ? "NULL" : #queueing_p1'/>
            <SetVar name="_parallel_degree_limit_p1" value='#util.isNullOrWhitespace(#parallel_degree_limit_p1) ? "NULL" : #parallel_degree_limit_p1'/>
            <SetVar name="_switch_group" value='#util.isNullOrWhitespace(#switch_group) ? "NULL" : #switch_group'/>
            <SetVar name="_switch_time" value='#util.isNullOrWhitespace(#switch_time) ? "NULL" : #switch_time'/>
            <SetVar name="_switch_estimate" value='#util.isNullOrWhitespace(#switch_estimate) ? "NULL" : #switch_estimate'/>
            <SetVar name="_max_est_exec_time" value='#util.isNullOrWhitespace(#max_est_exec_time) ? "NULL" : #max_est_exec_time'/>
            <SetVar name="_undo_pool" value='#util.isNullOrWhitespace(#undo_pool) ? "NULL" : #undo_pool'/>
            <SetVar name="_max_idle_time" value='#util.isNullOrWhitespace(#max_idle_time) ? "NULL" : #max_idle_time'/>
            <SetVar name="_max_idle_blocker_time" value='#util.isNullOrWhitespace(#max_idle_blocker_time) ? "NULL" : #max_idle_blocker_time'/>
            <SetVar name="_switch_time_in_call" value='#util.isNullOrWhitespace(#switch_time_in_call) ? "NULL" : #switch_time_in_call'/>
            <Input label="Comments" name="comments" style="wrapped-text-editor" editable="true">
               <Default>${oracle.getResourcePlanDirectives.COMMENTS}</Default>
            </Input>
            <Input label="cpu_p1" name="cpu_p1" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P1}</Default>
            </Input>
            <Input label="cpu_p2" name="cpu_p2" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P2}</Default>
            </Input>
            <Input label="cpu_p3" name="cpu_p3" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P3}</Default>
            </Input>
            <Input label="cpu_p4" name="cpu_p4" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P4}</Default>
            </Input>
            <Input label="cpu_p5" name="cpu_p5" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P5}</Default>
            </Input>
            <Input label="cpu_p6" name="cpu_p6" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P6}</Default>
            </Input>
            <Input label="cpu_p7" name="cpu_p7" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P7}</Default>
            </Input>
            <Input label="cpu_p8" name="cpu_p8" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.CPU_P8}</Default>
            </Input>
            <Input label="active_sess_pool_p1" name="active_sess_pool_p1" style="text" editable="true">
               <Default>${oracle.getResourcePlanDirectives.ACTIVE_SESS_POOL_P1}
               </Default>
            </Input>
            <Input label="queueing_p1" name="queueing_p1" style="text" editable="true" tip="seconds">
               <Default>${oracle.getResourcePlanDirectives.QUEUEING_P1}
               </Default>
            </Input>
            <Input label="parallel_degree_limit_p1" name="parallel_degree_limit_p1" style="text" editable="true">
               <Default>
                  ${oracle.getResourcePlanDirectives.PARALLEL_DEGREE_LIMIT_P1}
               </Default>
            </Input>
            <Input label="switch_group" name="switch_group" style="list" editable="true">
               <Values>
                  <Command>
                     <SQL><![CDATA[select group_or_subplan from ( select * from (select consumer_group group_or_subplan, 2 sel from DBA_RSRC_CONSUMER_GROUPS
                                                                  union select plan ,2 from dba_rsrc_plans
                                                                  union select '''CANCEL_SQL''', 2 from dual
                                                                  union select '''KILL_SESSION''', 2 from dual
                                                                  union select '${oracle.getResourcePlanDirectives.SWITCH_GROUP}', 1 from dual
                                                                  ) order by sel,group_or_subplan
                                    )]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="switch_time" name="switch_time" style="text" editable="true" tip="seconds">
               <Default>${oracle.getResourcePlanDirectives.SWITCH_TIME}
               </Default>
            </Input>
            <Input label="switch_estimate" name="switch_estimate" style="radio" editable="true">
               <Values>TRUE|FALSE</Values>
               <Labels>true|false</Labels>
               <Default>${oracle.getResourcePlanDirectives.SWITCH_ESTIMATE}
               </Default>
            </Input>
            <Input label="max_est_exec_time" name="max_est_exec_time" style="text" editable="true" tip="seconds">
               <Default>${oracle.getResourcePlanDirectives.MAX_EST_EXEC_TIME}
               </Default>
            </Input>
            <Input label="undo_pool" name="undo_pool" style="text" editable="true" tip="KB">
               <Default>${oracle.getResourcePlanDirectives.UNDO_POOL}</Default>
            </Input>
            <Input label="max_idle_time" name="max_idle_time" style="text" editable="true" tip="seconds">
               <Default>${oracle.getResourcePlanDirectives.MAX_IDLE_TIME}
               </Default>
            </Input>
            <Input label="max_idle_blocker_time" name="max_idle_blocker_time" style="text" editable="true" tip="seconds">
               <Default>
                  ${oracle.getResourcePlanDirectives.MAX_IDLE_BLOCKER_TIME}
               </Default>
            </Input>
            <Input label="switch_time_in_call" name="switch_time_in_call" style="text" editable="true" tip="seconds">
               <Default>${oracle.getResourcePlanDirectives.SWITCH_TIME_IN_CALL}
               </Default>
            </Input>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.update_plan_directive(plan => '${plan}', group_or_subplan => '${objectname}', new_comment => '${_comments}'
            , new_cpu_p1 => '${cpu_p1}'
            , new_cpu_p2 => '${cpu_p2}'
            , new_cpu_p3 => '${cpu_p3}'
            , new_cpu_p4 => '${cpu_p4}'
            , new_cpu_p5 => '${cpu_p5}'
            , new_cpu_p6 => '${cpu_p6}'
            , new_cpu_p7 => '${cpu_p7}'
            , new_cpu_p8 => '${cpu_p8}'
            , new_active_sess_pool_p1 => ${_active_sess_pool_p1}
            , new_queueing_p1 => ${_queueing_p1}
            , new_parallel_degree_limit_p1 => ${_parallel_degree_limit_p1}
            , new_switch_group => ${_switch_group}
            , new_switch_time => ${_switch_time}
            , new_switch_estimate => ${_switch_estimate}
            , new_max_est_exec_time => ${_max_est_exec_time}
            , new_undo_pool => ${_undo_pool}
            , new_max_idle_time => ${_max_idle_time}
            , new_max_idle_blocker_time => ${_max_idle_blocker_time}
            , new_switch_time_in_call => ${_switch_time_in_call}
            );
            end;]]></SQL>
            </Command>
            <Result>Plan directive modified.</Result>
         </Action>
         <Action id="oracle-rsrc-remove-plan-directive" label="Remove Group from Plan" icon="remove" reload="true">
            <Confirm><![CDATA[Remove resource plan directive?]]></Confirm>
            <Command exectype="asis">
               <SQL><![CDATA[begin
            dbms_resource_manager.delete_plan_directive('${plan}', '${objectname}');
            end;]]></SQL>
            </Command>
            <Result>Plan directive removed.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Scheduler">
         <Action id="oracle-scheduler-enable" label="Enable Scheduler" icon="enable" reload="true">
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_scheduler_attribute(attribute=>'SCHEDULER_DISABLED', value=>'FALSE'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Enable scheduler?]]></Confirm>
            <Result>Scheduler enabled.</Result>
         </Action>
         <Action id="oracle-scheduler-disable" label="Disable Scheduler" icon="disable"
                 reload="true">
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_scheduler_attribute(attribute=>'SCHEDULER_DISABLED', value=>'TRUE'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Disable scheduler?]]></Confirm>
            <Result>Scheduler disabled.</Result>
         </Action>
         <Action id="oracle-scheduler-setattribute" label="Set Scheduler Attribute" icon="rename" reload="true">
            <Input name="attribute" label="Attribute" style="list">
               <Values>
                  |DEFAULT_TIMEZONE|EVENT_EXPIRY_TIME|LOG_HISTORY|MAX_JOB_SLAVE_PROCESSES|SCHEDULER_DISABLED
               </Values>
            </Input>
            <Input name="value" label="Value" style="text" editable="true"/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[begin dbms_scheduler.set_scheduler_attribute(attribute=>'${attribute}', value=>'${value}'); end;]]></SQL>
            </Command>
            <Confirm><![CDATA[Set scheduler attribute?]]></Confirm>
            <Result>Scheduler attribute set.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="DatabaseLinks">
         <Action id="oracle-databaselinks-create" label="Create Database Link" icon="add" reload="true">
            <Message type="info">
               <![CDATA[
               <html><b>Note:</b> a database link can only be created in your own schema.</html>
               ]]>
            </Message>
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Public Link" name="public" style="check">
               <Values>PUBLIC</Values>
            </Input>
            <Input label="Link Name" style="text" name="db_link" editable="true"/>
            <Input label="Remote Database" style="text" name="host" editable="true"/>
            <Input label="Remote Username" style="text" name="username" editable="true"/>
            <Input label="Remote Password" style="password" name="password" editable="true"/>
            <Command>
               <SQL>
                  <![CDATA[CREATE ${public} DATABASE LINK ${db_link} CONNECT TO ${username} IDENTIFIED BY "${password}" USING '${host}']]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Create ${public} database link ${db_link}?]]></Confirm>
            <Result>Database link has been created.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="DatabaseLink">
         <Action id="oracle-databaselink-drop" label="Drop Database Link" icon="remove" reload="true">
            <SetVar name="_public" value='#schema.equals("PUBLIC") ? "PUBLIC" : ""'/>
            <Command>
               <SQL>
                  <![CDATA[DROP ${_public} DATABASE LINK "${objectname}"]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Drop ${_public} database link ${objectname}?]]></Confirm>
            <Result>Database link dropped.</Result>
         </Action>
         <Action id="oracle-databaselink-test" label="Test Database Link" icon="testConnection" reload="false">
            <Command>
               <SQL>
                  <![CDATA[select 'Connection to ${objectname} successful!' "Test Results" from dual@${objectname}]]></SQL>
            </Command>
            <Confirm><![CDATA[Test database link ${objectname}?]]></Confirm>
            <Result>Database link tested.</Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="InvalidObjects">
         <Action id="oracle-invalidobjects-compile" label="Compile All"
                 icon="compile" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>

            <Command idref="oracle.compileInvalidObjects"/>
            <Confirm>
               <![CDATA[Compile invalid objects in schema ${schema}?]]></Confirm>
            <Result>Invalid objects has been compiled.</Result>
         </Action>
      </ActionGroup>

      <!-- =================================================================== -->
      <!-- DBA actions -->
      <!-- =================================================================== -->

      <ActionGroup type="Users">
         <Action id="oracle-users-create" label="Create User" reload="true" icon="add">
            <Input label="User Name" name="userid" style="text"/>
            <Input label="Password" name="password" style="password"/>
            <Input label="Default Tablespace" name="defaultTablespace" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select tablespace_name from user_tablespaces order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>USERS</Default>
            </Input>
            <Input label="Temporary Tablespace" name="tempTablespace" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select tablespace_name from user_tablespaces order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>TEMP</Default>
            </Input>
            <Input label="Grant CREATE SESSION" name="grant" style="check">
               <Values>grant create session to ${QB}${userid}${QE}</Values>
            </Input>

            <SetVar name="_pw" value='#password.equals("") ? "" : " identified by \"" + #password + "\""'/>
            <SetVar name="_defaultTablespace" value='#defaultTablespace.equals("") ? "" : " default tablespace " + #defaultTablespace'/>
            <SetVar name="_tempTablespace" value='#tempTablespace.equals("") ? "" : " temporary tablespace " + #tempTablespace'/>

            <Command>
               <SQL><![CDATA[create user ${QB}${userid}${QE}${_pw}${_defaultTablespace}${_tempTablespace};
${grant}]]></SQL>
            </Command>
            <Result>
               User ${userid} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="User">
         <Action id="oracle-user-clone" label="Script: Clone User" reload="false" icon="copy" resultaction="mergeasscript" resulttarget="editor">
            <Input label="User Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New User Name" name="cusername" style="text"/>
            <Input label="New Password" name="cpassword" style="password"/>
            <Command>
               <SQL><![CDATA[
SELECT txt
FROM (SELECT 0 colid,
             'create user ${QB}${cusername}${QE} identified by "${cpassword}" default tablespace '||default_tablespace||' temporary tablespace '||temporary_tablespace||' profile ' || profile||' '|| decode(account_status,'OPEN','account unlock','LOCKED','account lock','EXPIRED & LOCKED', 'password expire account lock','') ||';' txt
      FROM   sys.dba_users
      WHERE  username = '${objectname}'
    UNION
      SELECT 1 colid,
             'grant "'||granted_role||'" to ${QB}${cusername}${QE} '||decode(admin_option, 'YES', ' with admin option')||';' txt
      FROM   sys.dba_role_privs
      WHERE  grantee = '${objectname}'
    UNION
      SELECT 2 colid,
             'alter user ${QB}${cusername}${QE} default role all;' txt
      FROM   dual
    UNION
      SELECT 5 colid,
             'alter user ${QB}${cusername}${QE} quota '||decode(max_bytes, '-1','UNLIMITED',max_bytes)||' on '||tablespace_name||';' txt
      FROM   sys.dba_ts_quotas
      WHERE  username = '${objectname}'
    UNION
      SELECT 4 colid,
             'grant '||privilege||' to ${QB}${cusername}${QE} '||decode(admin_option, 'YES', 'with admin option')||';' txt
      FROM   sys.dba_sys_privs
      WHERE  grantee = '${objectname}'
    UNION
      SELECT 5 colid,
             'grant '||decode(privilege,'READ',privilege||' on directory '||table_name,'WRITE',privilege||' on directory '||table_name,privilege||' on '||owner||'."'||table_name||'"')|| ' to ${cusername};' txt
      FROM   dba_tab_privs
      WHERE  grantee = '${objectname}'
    UNION
      SELECT 6 colid,
             'grant '||privilege||' on "'||owner||'"."'||table_name||'" ('||column_name||') to ${QB}${cusername}${QE};' txt
      FROM   sys.dba_col_privs
    WHERE    grantee = '${objectname}'
    )
ORDER BY colid
              ]]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Create script to clone user ${objectname} as ${cusername}?]]></Confirm>
            <Result>
               Script for creating user ${cusername} created.
            </Result>
         </Action>

         <Action id="oracle-user-drop" label="Drop User" reload="true" icon="remove">
            <Input label="User Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Cascade Objects" name="cascade" style="check">
               <Values>cascade</Values>
            </Input>
            <Command>
               <SQL><![CDATA[drop user "${objectname}" ${cascade}]]></SQL>
            </Command>
            <Confirm><![CDATA[
            Really drop user ${objectname}?<br>
            (Enabling <b>Cascade Objects</b> also removes owned objects)
            ]]></Confirm>
            <Result>
               User ${objectname} dropped!
            </Result>
         </Action>

         <If test="#util.isDatabaseVersionGTE(8)">
            <Action id="oracle-user-grant-group" label="Grant Resource Group" icon="Key" reload="true">
               <Input label="User Name" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Resource Group" name="resource_group" style="list">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select consumer_group from DBA_RSRC_CONSUMER_GROUPS order by 1]]></SQL>
                     </Command>
                  </Values>
               </Input>
               <Input label="Grant Option" name="option" style="radio">
                  <Values>TRUE|FALSE</Values>
                  <Labels>TRUE|FALSE</Labels>
                  <Default>FALSE</Default>
               </Input>
               <Command exectype="asis">
                  <SQL>
                     <![CDATA[
begin
dbms_resource_manager_privs.grant_switch_consumer_group(consumer_group => '${resource_group}', grantee_name =>'"${objectname}"', grant_option => ${option} );
end;
                  ]]>
                  </SQL>
               </Command>
               <Result>
                  Group ${resource_group} granted to ${objectname}
               </Result>
            </Action>
            <Action id="oracle-user-set-default-group" label="Set Default Resource Group for User" icon="Privileges" reload="true">
               <Input label="User Name" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Resource Group" name="resource_group" style="list">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select granted_group from dba_rsrc_consumer_group_privs where grantee = '${objectname}' and initial_group = 'NO'
                          union select 'DEFAULT_CONSUMER_GROUP' from dual
                        ]]></SQL>
                     </Command>
                  </Values>
               </Input>
               <Command exectype="asis">
                  <SQL><![CDATA[begin
            dbms_resource_manager.set_initial_consumer_group(consumer_group => '${resource_group}', user =>'"${objectname}"');
            end;]]></SQL>
               </Command>
               <Result>Group ${resource_group} set to initial for ${objectname}.
               </Result>
            </Action>
            <Action id="oracle-user-revoke-group" label="Revoke Resource Consumer Group from User" icon="Privileges" reload="true">
               <Input label="User Name" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="Resource Group" name="resource_group" style="list">
                  <Values>
                     <Command>
                        <SQL>
                           <![CDATA[select granted_group from DBA_RSRC_CONSUMER_GROUP_PRIVS where grantee = '${objectname}' order by 1]]></SQL>
                     </Command>
                  </Values>
               </Input>
               <Command exectype="asis">
                  <SQL><![CDATA[begin
              dbms_resource_manager_privs.revoke_switch_consumer_group(consumer_group => '${resource_group}', revokee_name =>'"${objectname}"');
              end;]]></SQL>
               </Command>
               <Result>Group ${resource_group} revoked from ${objectname}.
               </Result>
            </Action>
         </If>

         <Action id="oracle-user-lock" label="Lock User" icon="Lock" reload="true">
            <Input label="User Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[alter user "${objectname}" account lock]]></SQL>
            </Command>
            <Confirm>Lock user ${objectname}?</Confirm>
            <Result>
               User ${objectname} locked!
            </Result>
         </Action>

         <Action id="oracle-user-unlock" label="Unlock User" icon="unlock" reload="true">
            <Input label="User Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[alter user "${objectname}" account unlock]]></SQL>
            </Command>
            <Confirm>Unlock user ${objectname}?</Confirm>
            <Result>
               User ${objectname} unlocked!
            </Result>
         </Action>

         <Action id="oracle-user-password" label="Change Password">
            <Input label="User Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Password" name="password" style="password"/>
            <Command>
               <SQL>
                  <![CDATA[alter user "${objectname}" identified by "${password}"]]></SQL>
            </Command>
            <Confirm>Change password for ${objectname}?</Confirm>
            <Result>
               Password changed for ${objectname}!
            </Result>
         </Action>

         <Action id="oracle-user-expire" label="Expire Password" reload="true">
            <Input label="User Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[alter user "${objectname}" password expire]]></SQL>
            </Command>
            <Confirm>Expire the password for user ${objectname}?</Confirm>
            <Result>
               Password expired for ${objectname}!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Roles">
         <Action id="oracle-roles-create" label="Create Role" reload="true" icon="add">
            <Input label="Role Name" name="roleid" style="text"/>
            <Input label="Password" name="password" style="password"/>

            <SetVar name="_pw" value='#password.equals("") ? "" : " identified by \"" + #password + "\""'/>

            <Command>
               <SQL><![CDATA[create role ${QB}${roleid}${QE}${_pw}]]></SQL>
            </Command>
            <Result>
               Role ${roleid} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Role">
         <Action id="oracle-role-drop" label="Drop Role" reload="true" icon="remove">
            <Input label="Role Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[drop role "${objectname}"]]></SQL>
            </Command>
            <Confirm><![CDATA[
            Really drop role ${objectname}?
            ]]></Confirm>
            <Result>
               Role ${objectname} dropped!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Session">
         <If test="#util.isDatabaseVersionLT(11)">
           <Action id="oracle-session-kill" label="Kill Session" reload="true" icon="remove">
               <Input label="Immediate" name="immediate" style="check">
                  <Values>true</Values>
                  <Default>false</Default>
               </Input>
               <SetVar name="_immediate" value='#immediate.equals("") ? "" : "IMMEDIATE"'/>
              <Command>
                 <SQL>
                    <![CDATA[alter system kill session '${oracle.getSessions.SID},${oracle.getSessions.SERIAL#}' ${_immediate}]]>
                 </SQL>
              </Command>
              <Confirm><![CDATA[
                 Do you really want to kill session for ${oracle.getSessions.UserName} 
                 (sid: ${oracle.getSessions.SID}, serial# ${oracle.getSessions.SERIAL#})?
              ]]></Confirm>
           </Action>
         </If>
         <Else>
          <Action id="oracle-session-kill-rac" label="Kill Session" reload="true" icon="remove">
             <Input label="Immediate" name="immediate" style="check">
                  <Values>true</Values>
                  <Default>false</Default>
               </Input>
               <SetVar name="_immediate" value='#immediate.equals("") ? "" : "IMMEDIATE"'/>
              <Command>
                 <SQL>
                    <![CDATA[alter system kill session '${oracle.getSessions.SID},${oracle.getSessions.SERIAL#},@${oracle.getSessions.INST_ID}' ${_immediate}]]>
                 </SQL>
              </Command>
              <Confirm><![CDATA[
                 Do you really want to kill session for ${oracle.getSessions.UserName}
                 (sid: ${oracle.getSessions.SID}, serial# ${oracle.getSessions.SERIAL#} inst_id ${oracle.getSessions.INST_ID})?
              ]]></Confirm>
           </Action>
         </Else>
         <If test="#util.isDatabaseVersionGTE(10,1)">
            <Action id="oracle-session-enabletrace" label="Enable Trace" reload="true" icon="enable">
               <Input label="Waits" name="waits" style="check">
                  <Values>true</Values>
                  <Default>true</Default>
               </Input>
               <Input label="Binds" name="binds" style="check">
                  <Values>true</Values>
               </Input>
               <SetVar name="_waits" value='#waits.equals("") ? "false" : #waits'/>
               <SetVar name="_binds" value='#binds.equals("") ? "false" : #binds'/>
               <Command exectype="asis">
                  <SQL>
                     <![CDATA[begin dbms_monitor.session_trace_enable(session_id => ${oracle.getSessions.SID}, serial_num => ${oracle.getSessions.SERIAL#}, waits => ${_waits}, binds => ${_binds}); end;]]></SQL>
               </Command>
               <Confirm>Enable trace?</Confirm>
               <Result>
                  Trace enabled!
               </Result>
            </Action>
            <Action id="oracle-session-disabletrace" label="Disable Trace" reload="true" icon="disable">
               <Command exectype="asis">
                  <SQL>
                     <![CDATA[begin dbms_monitor.session_trace_disable(session_id => ${oracle.getSessions.SID}, serial_num => ${oracle.getSessions.SERIAL#}); end;]]></SQL>
               </Command>
               <Confirm>Disable trace?</Confirm>
               <Result>
                  Trace disabled!
               </Result>
            </Action>
         </If>
      </ActionGroup>


      <ActionGroup type="SessionNonLocal">
         <If test="#util.isDatabaseVersionGTE(11)">
           <!-- Only include a kill action if have Oracle 11 or later.  @INST_ID is not supported for earlier versions -->
          <Action id="oracle-session-non-local-kill" label="Kill Session" reload="true" icon="remove">
               <Input label="Immediate" name="immediate" style="check">
                  <Values>true</Values>
                  <Default>false</Default>
               </Input>
               <SetVar name="_immediate" value='#immediate.equals("") ? "" : "IMMEDIATE"'/>
              <Command>
                 <SQL>
                    <![CDATA[alter system kill session '${oracle.getSessions.SID},${oracle.getSessions.SERIAL#},@${oracle.getSessions.INST_ID}' ${_immediate}]]>
                 </SQL>
              </Command>
              <Confirm><![CDATA[
                 Do you really want to kill session for ${oracle.getSessions.UserName}
                 (sid: ${oracle.getSessions.SID}, serial# ${oracle.getSessions.SERIAL#} inst_id ${oracle.getSessions.INST_ID})?
              ]]></Confirm>
           </Action>
         </If>
      </ActionGroup>

      <ActionGroup type="PermanentTablespaces">
         <Action id="oracle-permanenttablespace-create" label="Create Tablespace" reload="true" icon="add">
            <Input label="Tablespace Name" name="tablespace" style="text"/>
            <Input label="Data Files" style="separator"/>

            <Input name="datafiles" style="grid">
               <Arg name="output" value="'${filename}' size ${size}${unit} ${reuse}"/>
               <Arg name="newline" value=",\n"/>

               <Input name="filename" label="Filename" style="text">
                  <Default>[filename].dbf</Default>
               </Input>
               <Input name="size" label="Size" style="number">
                  <Default>10</Default>
               </Input>
               <Input name="unit" label="Unit" style="list">
                  <Labels>KB|MB|GB|TB|PB|EB</Labels>
                  <Values>K|M|G|T|P|E</Values>
                  <Default>M</Default>
               </Input>
               <Input name="reuse" label="Reuse" style="check">
                  <Values>reuse</Values>
               </Input>
            </Input>

            <Input label="Options" style="separator"/>

            <Input label="Status" name="status" style="radio">
               <Values>online|offline</Values>
               <Labels>Online|Offline</Labels>
            </Input>

            <Input label="Logging" name="logging" style="radio">
               <Arg name="direction" value="vertical"/>
               <Values>logging|nologging</Values>
               <Labels>Yes - Generates redo logs and is recoverable|No - Faster updates, no redo logs generated and not recoverable
               </Labels>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[create tablespace ${QB}${tablespace}${QE} ${logging} datafile ${datafiles} ${status}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Create tablespace ${tablespace}?]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="PermanentTablespace">
         <Action id="oracle-permanenttablespace-addfile" label="Add Datafile" reload="true" icon="add">
            <Input label="Tablespace Name" name="tablespace" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="filename" label="Filename" style="text">
               <Default>[filename].dbf</Default>
            </Input>
            <Input name="size" label="Size" style="number" linebreak="false">
               <Default>10</Default>
            </Input>
            <Input name="unit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <Input name="reuse" label="Reuse" style="check">
               <Values>reuse</Values>
            </Input>

            <Input label="Auto Extend" style="separator"/>

            <Input name="autoextend" label="Extend Datafile when full" style="check">
               <Values>autoextend on</Values>
            </Input>

            <Input name="increment" label="Increment" style="number" linebreak="false"/>
            <Input name="incrementunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
               <Values>unlimited|value</Values>
               <Labels>Unlimited|Value</Labels>
            </Input>
            <Input name="maxsizevalue" style="number" linebreak="false"/>
            <If test="#util.isDatabaseVersionGTE(10)">
               <Input name="maxsizeunit" style="list" linebreak="true">
                  <Labels>KB|MB|GB|TB|PB|EB</Labels>
                  <Values>K|M|G|T|P|E</Values>
                  <Default>M</Default>
               </Input>
            </If>
            <Else>
               <Input name="maxsizeunit" style="list" linebreak="true">
                  <Labels>KB|MB</Labels>
                  <Values>K|M</Values>
                  <Default>M</Default>
               </Input>
            </Else>

            <SetVar name="_autoextend" value='#autoextend.equals("") or #increment.equals("") ? "" : #autoextend + " next " + #increment + #incrementunit'/>
            <SetVar name="_maxsize" value='#autoextend.length() > 0 and #maxsize.equals("unlimited") ?
                                             " maxsize unlimited" :
                                             #autoextend.length() > 0 and #maxsizevalue.length() > 0 ?
                                                " maxsize " + #maxsizevalue + #maxsizeunit :
                                                ""'/>
            <SetVar name="_filename" value='#filename.equals("") ? "" : "\u0027" + #filename + "\u0027"'/>

            <Command>
               <SQL>
                  <![CDATA[alter tablespace "${objectname}" add datafile ${_filename} size ${size}${unit} ${reuse} ${_autoextend}${_maxsize}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Add data file to tablespace ${objectname}?]]></Confirm>
         </Action>

         <If test="#util.isDatabaseVersionGTE(10)">
            <Action id="oracle-permanenttablespace-rename" label="Rename Tablespace" reload="true" icon="rename">
               <Input label="Tablespace Name" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Input label="New Tablespace Name" name="newname" style="text" editable="true">
                  <Default>${objectname}</Default>
               </Input>

               <Command>
                  <SQL>
                     <![CDATA[alter tablespace "${objectname}" rename to ${QB}${newname}${QE}]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Really rename tablespace ${objectname} to ${newname}?]]></Confirm>
            </Action>
         </If>

         <Action id="oracle-permanenttablespace-remove" label="Remove Tablespace" reload="true" icon="remove">
            <Input label="Tablespace" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Including Content" name="content" style="check">
               <Values>including contents</Values>
            </Input>
            <Input label="Datafile(s)" name="datafiles" style="radio">
               <Values>keep datafiles|and datafiles</Values>
               <Labels>Keep Datafile(s)|Remove Datafile(s)</Labels>
            </Input>
            <Input label="Cascade Constraints" name="constraints" style="check">
               <Values>cascade constraints</Values>
            </Input>

            <SetVar name="_datafiles" value='#content.length() > 0 ? " " + #datafiles : ""'/>
            <SetVar name="_constraints" value='#content.length() > 0 ? " " + #constraints : ""'/>

            <Command>
               <SQL>
                  <![CDATA[drop tablespace "${objectname}" ${content}${_datafiles}${_constraints}]]></SQL>
            </Command>

            <Confirm>
               <![CDATA[Really remove tablespace ${objectname}?]]></Confirm>
            <Result><![CDATA[Tablespace ${objectname} removed!]]></Result>
         </Action>

         <ActionGroup label="Set Tablespace">
            <Action id="oracle-permanenttablespace-offline" label="Tablespace Offline" reload="true">
               <Input label="Tablespace Name" name="tablespace" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>

               <Input label="Status" name="status" style="radio">
                  <Values>normal|temporary|immediate|for recover</Values>
                  <Labels>Normal|Temporary|Immediate|For Recover|</Labels>
               </Input>

               <Command>
                  <SQL>
                     <![CDATA[alter tablespace "${tablespace}" offline ${status}]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Set tablespace ${tablespace} offline?]]></Confirm>
               <Result>
                  <![CDATA[Tablespace ${objectname} is now offline!]]></Result>
            </Action>

            <Action id="oracle-permanenttablespace-online" label="Tablespace Online" reload="true">
               <Input label="Tablespace Name" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>

               <Input label="Mode" name="mode" style="radio">
                  <Values>|alter tablespace "${objectname}" read write|alter
                     tablespace "${objectname}" read only
                  </Values>
                  <Labels>As-is|Read Write|Read Only</Labels>
               </Input>

               <Command>
                  <SQL>
                     <![CDATA[alter tablespace "${objectname}" online;${mode}]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Set tablespace ${objectname} online?]]></Confirm>
               <Result>
                  <![CDATA[Tablespace ${objectname} is now online!]]></Result>
            </Action>

            <Action id="oracle-permanenttablespace-readwrite" label="Tablespace Read/Write Mode" reload="true">
               <Input label="Tablespace Name" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>

               <Input label="Mode" name="mode" style="radio">
                  <Values>read write|read only</Values>
                  <Labels>Read Write|Read Only</Labels>
               </Input>

               <Command>
                  <SQL>
                     <![CDATA[alter tablespace "${objectname}" ${mode}]]></SQL>
               </Command>
               <Confirm>
                  <![CDATA[Set mode for ${objectname} to ${readonly}?]]></Confirm>
               <Result>
                  <![CDATA[Read/Write Mode for tablespace ${objectname} changed!]]></Result>
            </Action>
         </ActionGroup>
      </ActionGroup>

      <ActionGroup type="PermanentDataFile">
         <Action id="oracle-permanentdatafile-rename" label="Rename Datafile" reload="true" icon="rename">
            <Input label="Tablespace" style="text" editable="false">
               <Default>${tablespace}</Default>
            </Input>
            <Input label="Datafile" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Datafile Name" name="newname" style="text" editable="true">
               <Default>${objectname}</Default>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[alter tablespace "${tablespace}" rename datafile '${objectname}' to '${newname}']]></SQL>
            </Command>
            <Confirm>
               <![CDATA[Really rename datafile for tablespace ${tablespace}?]]></Confirm>
         </Action>

         <If test="#util.isDatabaseVersionGTE(10)">
            <Action id="oracle-permanentdatafile-drop" label="Remove Datafile" reload="true" icon="remove">
               <Input label="Tablespace" style="text" editable="false">
                  <Default>${tablespace}</Default>
               </Input>
               <Input label="Datafile" name="content" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter tablespace "${tablespace}" drop datafile '${objectname}']]></SQL>
               </Command>
               <Confirm><![CDATA[Really remove datafile?]]></Confirm>
               <Result><![CDATA[Datafile ${objectname} removed!]]></Result>
            </Action>
         </If>

         <Action id="oracle-permanentdatafile-resize" label="Resize Datafile" reload="true" icon="calculator">
            <Input label="Tablespace Name" style="text" editable="false">
               <Default>${tablespace}</Default>
            </Input>
            <Input name="filename" label="Filename" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="size" label="Size" style="number" linebreak="false">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select round(nvl(((bytes/1024)/1024),2)) from dba_data_files where file_name='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="unit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <Input label="Auto Extend" style="separator"/>
            <Input name="autoextend" label="Extend Datafile when full" style="check">
               <Values>autoextend on</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select decode(autoextensible,'YES','autoextend on','') from dba_data_files where file_name='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <!-- 9i and higher -->
             <If test="#util.isDatabaseVersionGTE(9)">
               <Input name="increment" label="Increment" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(round(nvl((((a.block_size * b.increment_by)/1024)/1024),2)),'0','',round(nvl((((a.block_size * b.increment_by)/1024)/1024),2))) from dba_tablespaces a, dba_data_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </If>
            <!-- 8i and lower -->
            <Else>
               <Input name="increment" label="Increment" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(round(nvl((((a.value * b.increment_by)/1024)/1024),2)),'0','',round(nvl((((a.value * b.increment_by)/1024)/1024),2))) from v$parameter a, dba_data_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </Else>
            <Input name="incrementunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <!-- 9i and higher -->
             <If test="#util.isDatabaseVersionGTE(9)">
               <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
                  <Values>unlimited|value</Values>
                  <Labels>Unlimited|Value</Labels>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.block_size * 4194304) - (a.block_size * 2)),'unlimited','value') from dba_tablespaces a, dba_data_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
               <Input name="maxsizevalue" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.block_size * 4194304) - (a.block_size * 2)),'','0','',round(nvl((((b.maxbytes/1024)/1024)),2))) from dba_tablespaces a, dba_data_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </If>
            <!-- 8i and lower -->
            <Else>
               <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
                  <Values>unlimited|value</Values>
                  <Labels>Unlimited|Value</Labels>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.value * 4194304) - (a.value * 2)),'unlimited','value') from v$parameter a, dba_data_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
               <Input name="maxsizevalue" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.value * 4194304) - (a.value * 2)),'','0','',round(nvl((((b.maxbytes/1024)/1024)),2))) from v$parameter a, dba_data_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </Else>
            <Input name="maxsizeunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <SetVar name="_autoextend" value='#autoextend neq "" and #increment neq "" and #maxsize.equals("unlimited") ? #autoextend + " next " + #increment + #incrementunit + " maxsize unlimited" : #autoextend neq "" and #increment neq "" and #maxsize.equals("value") and #maxsizevalue neq "" and #maxsizevalue > 0 ? #autoextend + " next " + #increment + #incrementunit +  " maxsize " + #maxsizevalue + #maxsizeunit : "autoextend off"'/>
            <Command>
               <SQL>
                  <![CDATA[alter database datafile '${objectname}' resize ${size}${unit}; alter database datafile '${objectname}' ${_autoextend}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Resize datafile ${objectname}?]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="TemporaryTablespace">
         <Action id="oracle-temporarytablespace-addfile" label="Add Datafile" reload="true" icon="add">
            <Input label="Tablespace Name" name="tablespace" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="filename" label="Filename" style="text">
               <Default>[filename].dbf</Default>
            </Input>
            <Input name="size" label="Size" style="number" linebreak="false">
               <Default>16</Default>
            </Input>
            <Input name="unit" style="list" linebreak="true">
                <Labels>KB|MB|GB|TB|PB|EB</Labels>
                <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <Input name="reuse" label="Reuse" style="check">
               <Values>reuse</Values>
            </Input>

            <Input label="Auto Extend" style="separator"/>

            <Input name="autoextend" label="Extend Datafile when full" style="check">
               <Values>autoextend on</Values>
            </Input>

            <Input name="increment" label="Increment" style="number" linebreak="false"/>
            <Input name="incrementunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
               <Values>unlimited|value</Values>
               <Labels>Unlimited|Value</Labels>
            </Input>
            <Input name="maxsizevalue" style="number" linebreak="false"/>
            <Input name="maxsizeunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <SetVar name="_autoextend" value='#autoextend.equals("") or #increment.equals("") ? "" : #autoextend + " next " + #increment + #incrementunit'/>
            <SetVar name="_maxsize" value='#autoextend.length() > 0 and #maxsize.equals("unlimited") ?
                                             " maxsize unlimited" :
                                             #autoextend.length() > 0 and #maxsizevalue.length() > 0 ?
                                                " maxsize " + #maxsizevalue + #maxsizeunit :
                                                ""'/>

            <Command>
               <SQL>
                  <![CDATA[alter tablespace "${objectname}" add tempfile '${filename}' size ${size}${unit} ${reuse} ${_autoextend}${_maxsize}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Add data file to tablespace ${objectname}?]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="TemporaryTempFile">
         <Action id="oracle-temporarytempfile-resize" label="Resize Tempfile" reload="true" icon="calculator">
            <Input label="Tablespace Name" style="text" editable="false">
               <Default>${tablespace}</Default>
            </Input>
            <Input name="tempfile" label="Tempfile" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="size" label="Size" style="number" linebreak="false">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select round(nvl(((bytes/1024)/1024),2)) from dba_temp_files where file_name='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="unit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <Input label="Auto Extend" style="separator"/>
            <Input name="autoextend" label="Extend Datafile when full" style="check">
               <Values>autoextend on</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select decode(autoextensible,'YES','autoextend on','') from dba_temp_files where file_name='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <!-- 9i and higher -->
             <If test="#util.isDatabaseVersionGTE(9)">
               <Input name="increment" label="Increment" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(round(nvl((((a.block_size * b.increment_by)/1024)/1024),2)),'0','',round(nvl((((a.block_size * b.increment_by)/1024)/1024),2))) from dba_tablespaces a, dba_temp_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </If>
            <!-- 8i and lower -->
            <Else>
               <Input name="increment" label="Increment" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(round(nvl((((a.value * b.increment_by)/1024)/1024),2)),'0','',round(nvl((((a.value * b.increment_by)/1024)/1024),2))) from v$parameter a, dba_temp_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </Else>
            <Input name="incrementunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <!-- 9i and higher -->
             <If test="#util.isDatabaseVersionGTE(9)">
               <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
                  <Values>unlimited|value</Values>
                  <Labels>Unlimited|Value</Labels>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.block_size * 4194304) - (a.block_size * 2)),'unlimited','value') from dba_tablespaces a, dba_temp_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
               <Input name="maxsizevalue" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.block_size * 4194304) - (a.block_size * 2)),'','0','',round(nvl((((b.maxbytes/1024)/1024)),2))) from dba_tablespaces a, dba_temp_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </If>
            <!-- 8i and lower -->
            <Else>
               <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
                  <Values>unlimited|value</Values>
                  <Labels>Unlimited|Value</Labels>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.value * 4194304) - (a.value * 2)),'unlimited','value') from v$parameter a, dba_temp_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
               <Input name="maxsizevalue" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.value * 4194304) - (a.value * 2)),'','0','',round(nvl((((b.maxbytes/1024)/1024)),2))) from v$parameter a, dba_temp_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </Else>
            <Input name="maxsizeunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <SetVar name="_autoextend" value='#autoextend neq "" and #increment neq "" and #maxsize.equals("unlimited") ? #autoextend + " next " + #increment + #incrementunit + " maxsize unlimited" : #autoextend neq "" and #increment neq "" and #maxsize.equals("value") and #maxsizevalue neq "" and #maxsizevalue > 0 ? #autoextend + " next " + #increment + #incrementunit +  " maxsize " + #maxsizevalue + #maxsizeunit : "autoextend off"'/>
            <Command>
               <SQL>
                  <![CDATA[alter database tempfile '${objectname}' resize ${size}${unit}; alter database tempfile '${objectname}' ${_autoextend}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Resize datafile ${objectname}?]]></Confirm>
         </Action>
          <If test="#util.isDatabaseVersionGTE(9)">
            <Action id="oracle-temporarydatafile-remove" label="Remove Tempfile" reload="true" icon="remove">
               <Input label="Tablespace" style="text" editable="false">
                  <Default>${tablespace}</Default>
               </Input>
               <Input label="Tempfile" name="content" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
                <Input name="includingdatafiles" label="Delete OS File?" style="check">
                   <Values> including datafiles</Values>
                </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter database tempfile '${objectname}' drop ${includingdatafiles}]]></SQL>
               </Command>
               <Confirm><![CDATA[Really remove tempfile?]]></Confirm>
               <Result><![CDATA[Temfile ${objectname} removed!]]></Result>
            </Action>
            <Action id="oracle-temporarydatafile-offline" label="Tempfile Offline" reload="true">
               <Input label="Tablespace" style="text" editable="false">
                  <Default>${tablespace}</Default>
               </Input>
               <Input label="Tempfile" name="content" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter database tempfile '${objectname}' offline]]></SQL>
               </Command>
               <Confirm><![CDATA[Really offline tempfile?]]></Confirm>
               <Result><![CDATA[Tempfile ${objectname} offline!]]></Result>
            </Action>
            <Action id="oracle-temporarydatafile-online" label="Tempfile Online" reload="true">
               <Input label="Tablespace" style="text" editable="false">
                  <Default>${tablespace}</Default>
               </Input>
               <Input label="Tempfile" name="content" style="text" editable="false">
                  <Default>${objectname}</Default>
               </Input>
               <Command>
                  <SQL>
                     <![CDATA[alter database tempfile '${objectname}' online]]></SQL>
               </Command>
               <Confirm><![CDATA[Really online tempfile?]]></Confirm>
               <Result><![CDATA[Tempfile ${objectname} online!]]></Result>
            </Action>
         </If>
      </ActionGroup>

      <ActionGroup type="UndoTablespace">
         <Action id="oracle-undotablespace-addfile" label="Add Datafile" reload="true" icon="add">
            <Input label="Tablespace Name" name="tablespace" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="filename" label="Filename" style="text">
               <Default>[filename].dbf</Default>
            </Input>
            <Input name="size" label="Size" style="number" linebreak="false">
               <Default>16</Default>
            </Input>
            <Input name="unit" style="list" linebreak="true">
                <Labels>KB|MB|GB|TB|PB|EB</Labels>
                <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <Input name="reuse" label="Reuse" style="check">
               <Values>reuse</Values>
            </Input>

            <Input label="Auto Extend" style="separator"/>

            <Input name="autoextend" label="Extend Datafile when full" style="check">
               <Values>autoextend on</Values>
            </Input>

            <Input name="increment" label="Increment" style="number" linebreak="false"/>
            <Input name="incrementunit" style="list" linebreak="true">
                <Labels>KB|MB|GB|TB|PB|EB</Labels>
                <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
               <Values>unlimited|value</Values>
               <Labels>Unlimited|Value</Labels>
            </Input>
            <Input name="maxsizevalue" style="number" linebreak="false"/>
            <Input name="maxsizeunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <SetVar name="_autoextend" value='#autoextend.equals("") or #increment.equals("") ? "" : #autoextend + " next " + #increment + #incrementunit'/>
            <SetVar name="_maxsize" value='#autoextend.length() > 0 and #maxsize.equals("unlimited") ?
                                             " maxsize unlimited" :
                                             #autoextend.length() > 0 and #maxsizevalue.length() > 0 ?
                                                " maxsize " + #maxsizevalue + #maxsizeunit :
                                                ""'/>

            <Command>
               <SQL>
                  <![CDATA[alter tablespace "${objectname}" add datafile '${filename}' size ${size}${unit} ${reuse} ${_autoextend}${_maxsize}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Add data file to tablespace ${objectname}?]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="UndoDataFile">
         <Action id="oracle-undodatafile-resize" label="Resize Datafile" reload="true" icon="calculator">
            <Input label="Tablespace Name" style="text" editable="false">
               <Default>${tablespace}</Default>
            </Input>
            <Input name="filename" label="Filename" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="size" label="Size" style="number" linebreak="false">
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select round(nvl(((bytes/1024)/1024),2)) from dba_data_files where file_name='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <Input name="unit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <Input label="Auto Extend" style="separator"/>
            <Input name="autoextend" label="Extend Datafile when full" style="check">
               <Values>autoextend on</Values>
               <Default>
                  <Command>
                     <SQL>
                        <![CDATA[select decode(autoextensible,'YES','autoextend on','') from dba_data_files where file_name='${objectname}']]></SQL>
                  </Command>
               </Default>
            </Input>
            <!-- 9i and higher -->
             <If test="#util.isDatabaseVersionGTE(9)">
               <Input name="increment" label="Increment" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(round(nvl((((a.block_size * b.increment_by)/1024)/1024),2)),'0','',round(nvl((((a.block_size * b.increment_by)/1024)/1024),2))) from dba_tablespaces a, dba_data_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </If>
            <!-- 8i and lower -->
            <Else>
               <Input name="increment" label="Increment" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(round(nvl((((a.value * b.increment_by)/1024)/1024),2)),'0','',round(nvl((((a.value * b.increment_by)/1024)/1024),2))) from v$parameter a, dba_data_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </Else>
            <Input name="incrementunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <!-- 9i and higher -->
             <If test="#util.isDatabaseVersionGTE(9)">
               <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
                  <Values>unlimited|value</Values>
                  <Labels>Unlimited|Value</Labels>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.block_size * 4194304) - (a.block_size * 2)),'unlimited','value') from dba_tablespaces a, dba_data_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
               <Input name="maxsizevalue" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.block_size * 4194304) - (a.block_size * 2)),'','0','',round(nvl((((b.maxbytes/1024)/1024)),2))) from dba_tablespaces a, dba_data_files b where a.tablespace_name=b.tablespace_name and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </If>
            <!-- 8i and lower -->
            <Else>
               <Input name="maxsize" label="Maximum Size" style="radio" linebreak="false">
                  <Values>unlimited|value</Values>
                  <Labels>Unlimited|Value</Labels>
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.value * 4194304) - (a.value * 2)),'unlimited','value') from v$parameter a, dba_data_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
               <Input name="maxsizevalue" style="number" linebreak="false">
                  <Default>
                     <Command>
                        <SQL>
                           <![CDATA[select decode(b.maxbytes,((a.value * 4194304) - (a.value * 2)),'','0','',round(nvl((((b.maxbytes/1024)/1024)),2))) from v$parameter a, dba_data_files b where a.name='db_block_size' and b.file_name='${objectname}']]></SQL>
                     </Command>
                  </Default>
               </Input>
            </Else>
            <Input name="maxsizeunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <SetVar name="_autoextend" value='#autoextend neq "" and #increment neq "" and #maxsize.equals("unlimited") ? #autoextend + " next " + #increment + #incrementunit + " maxsize unlimited" : #autoextend neq "" and #increment neq "" and #maxsize.equals("value") and #maxsizevalue neq "" and #maxsizevalue > 0 ? #autoextend + " next " + #increment + #incrementunit +  " maxsize " + #maxsizevalue + #maxsizeunit : "autoextend off"'/>
            <Command>
               <SQL>
                  <![CDATA[alter database datafile '${objectname}' resize ${size}${unit}; alter database datafile '${objectname}' ${_autoextend}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Resize datafile ${objectname}?]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="RollbackSegments">
         <Action id="oracle-rollbacksegments-create" label="Create Rollback Segment" reload="true" icon="add">
            <Input label="Tablespace Name" name="tablespace" style="list">
               <Values>
                  <Command>
                     <SQL>
                        <![CDATA[select tablespace_name from dba_tablespaces order by 1]]></SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Rollback Segment Name" name="rollbacksegment" style="text"/>

            <Input name="public" label="Public" style="check">
               <Values>public</Values>
            </Input>

            <Input name="online" label="Status" style="radio">
               <Labels>Online|Offline</Labels>
               <Values>
                  <![CDATA[alter rollback segment ${QB}${rollbacksegment}${QE} online|]]></Values>
            </Input>

            <Input label="Extents" style="separator"/>

            <Input name="initial" label="Initial Size" style="number" linebreak="false"/>
            <Input name="initialunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <Input name="next" label="Next Size" style="number" linebreak="false"/>
            <Input name="nextunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <Input name="optimal" label="Optimal Size" style="number" linebreak="false"/>
            <Input name="optimalunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>

            <Input name="min" label="Minimum Number" style="number"/>

            <Input name="max" label="Maximum Size" style="radio" linebreak="false">
               <Values>unlimited|value</Values>
               <Labels>Unlimited|Value</Labels>
            </Input>
            <Input name="maxvalue" style="number" linebreak="true"/>

            <SetVar name="_initial" value='#initial.equals("") ? "" : " initial " + #initial + #initialunit'/>
            <SetVar name="_next" value='#next.equals("") ? "" : " next " + #next + #nextunit'/>
            <SetVar name="_optimal" value='#optimal.equals("") ? " optimal null" : " optimal " + #optimal + #optimalunit'/>
            <SetVar name="_min" value='#min.equals("") ? "" : " minextents " + #min'/>
            <SetVar name="_max" value='#max.equals("unlimited") ? " maxextents unlimited" : #maxvalue.equals("") ? "" : " maxextents " + #maxvalue'/>

            <Command>
               <SQL>
                  <![CDATA[create ${public} rollback segment ${QB}${rollbacksegment}${QE} tablespace "${tablespace}" storage (${_initial}${_next}${_optimal}${_min}${_max} );
                  ${online}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Create tablespace ${tablespace}?]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="RedoLogs">
         <Action id="oracle-redologs-forcelogswitch" label="Force Log Switch" reload="true" icon="Privileges">
            <Command>
               <SQL>
                  <![CDATA[alter system switch logfile]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Really switch log file?]]></Confirm>
            <Result>
               Log switch completed!
            </Result>
         </Action>
         
          <Action id="oracle-redologs-create-redo-log-group" label="Create Redo Log Group" reload="true" icon="add">
            <Input name="standby" label="Standby" style="check">
               <Values>standby</Values>
            </Input>
            <Input label="Group" name="group" tip="optional group number" style="number">
               <Default></Default>
            </Input>
            
            <Input name="datafiles" style="grid">
               <Arg name="output" value="'${filename}'"/>
               <Arg name="newline" value=",\n"/>
               <Input name="filename" label="Filename" style="text">
                  <Default>[filename].dbf</Default>
               </Input>
            </Input>
            
            <SetVar name="_group" value='#group.length() > 0 ? " group " + #group : ""'/>
            
           
            <Input name="size" label="Size" style="number" linebreak="false">
               <Default>10</Default>
            </Input>
            <Input name="sizeunit" style="list" linebreak="true">
               <Labels>KB|MB|GB|TB|PB|EB</Labels>
               <Values>K|M|G|T|P|E</Values>
               <Default>M</Default>
            </Input>
            <SetVar name="_size" value='#size.equals("") ? " " : " size " + #size + #sizeunit'/>
            
             <!-- BLOCKSIZE from 11.2  -->
              <If test="#util.isDatabaseVersionGTE(11,2)">
                 <Input name="blocksize" label="Block Size" style="number" linebreak="false">
                    <Default></Default>
                 </Input>
                 <Input name="blocksizeunit" style="list" linebreak="true">
                   <Labels>KB|MB|GB|TB|PB|EB</Labels>
                   <Values>K|M|G|T|P|E</Values>
                   <Default>M</Default>
                 </Input>
                 <SetVar name="_blocksize" value='#blocksize.equals("") ? " " : " blocksize " + #blocksize + #blocksizeunit'/>
            </If>
            <Else>
                 <SetVar name="_blocksize" value=''/>            
            </Else>
            <Input name="reuse" label="Reuse" style="check">
               <Values>reuse</Values>
            </Input>
            
            <Command>
               <SQL>
                  <![CDATA[alter database add ${standby} logfile ${_group} ( ${datafiles} ) ${_size} ${_blocksize} ${reuse}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Really Create Redo Log Group?]]></Confirm>
            <Result>
               Log Group created!
            </Result>
         </Action>
      </ActionGroup>
      
      <ActionGroup type="RedoLog">
     
          <Action id="oracle-redologs-add-log-file-member" label="Add Log File Member" reload="true" icon="add">
            <Input label="Group" name="group" style="number" editable="false">
               <Default>${oracle.getRedoLogGroups.GROUP#}</Default>
            </Input>
           
            <Input name="file" label="File" style="text"/>
            <Input name="reuse" label="Reuse" style="check">
               <Values>reuse</Values>
            </Input>
          
            <Command>
               <SQL>
                  <![CDATA[alter database add logfile member '${file}' ${reuse} to group ${group}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Really Add Logfile Member?]]></Confirm>
            <Result>
               Logfile Member added!
            </Result>
         </Action>
      </ActionGroup>
      
      <ActionGroup type="RedoLogMember">
          <Action id="oracle-redologs-member-remove" label="Drop Log File Member" reload="true" icon="remove">
            <Input label="Member" name="file" style="text" editable="false">
               <Default>${oracle.getRedoLogMembers.MEMBER}</Default>
            </Input>
           
            <Command>
               <SQL>
                  <![CDATA[alter database drop logfile member '${file}']]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Really Remove Logfile Member?]]></Confirm>
            <Result>
               Logfile Member dropped!
            </Result>
         </Action>
      </ActionGroup>
      
      

      <ActionGroup type="Directories">
         <Action id="oracle-directories-create" label="Create Directory" reload="true" icon="add">
            <Input label="Directory Name" name="directoryname" style="text"/>
            <Input label="Directory Path" name="directorypath" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[create directory ${QB}${directoryname}${QE} as '${directorypath}']]>
               </SQL>
            </Command>
            <Confirm><![CDATA[Create directory '${directoryname}'?]]></Confirm>
         </Action>
      </ActionGroup>
      <ActionGroup type="Directory">
         <Action id="oracle-directory-drop" label="Drop Directory" reload="true" icon="remove">
            <Command>
               <SQL>
                  <![CDATA[drop directory "${objectname}"]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Do you really want to drop the directory ${objectname}?]]></Confirm>
         </Action>
         <Action id="oracle-directory-grant" label="Grant Privileges" reload="false" icon="Privileges">
            <Input label="Directory Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input name="grantee" label="Grantee" style="list">
               <Values>
                  <Command idref="oracle.getUserAndRoleNames"/>
               </Values>
            </Input>
            <Input name="read" label="Read" style="check">
               <Values>read</Values>
               <Default>read</Default>
            </Input>
            <Input name="write" label="Write" style="check">
               <Values>write</Values>
            </Input>
            <SetVar name="_privileges" value='#read neq "" and #write eq "" ? #read : #read eq "" and #write neq "" ? #write : #read neq "" and #write neq "" ? #read + ", " + #write : ""'/>
            <Command>
               <SQL>
                  <![CDATA[grant ${_privileges} on directory "${objectname}" to ${grantee}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Grant "${_privileges}" on ${objectname} to ${grantee}?]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="DirectoryPrivilege">
         <Action id="oracle-directoryprivilege-revoke" label="Revoke Privileges" reload="true" icon="Privileges">
            <Input label="Directory Name" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="User Name" style="text" editable="false">
               <Default>${grantee}</Default>
            </Input>
            <Input name="read" label="Read" style="check">
               <Values>read</Values>
               <Default>${dread}</Default>
            </Input>
            <Input name="write" label="Write" style="check">
               <Values>write</Values>
               <Default>${dwrite}</Default>
            </Input>
            <SetVar name="_privileges" value='#dread eq "read" and #dwrite neq "write" and #read eq "read" ? #read : #dread neq "read" and #dwrite eq "write" and #write eq "write" ? #write : #dread eq "read" and #dwrite eq "write" and #read eq "read" and #write neq "write" ? #read : #dread eq "read" and #dwrite eq "write" and #read neq "read" and #write eq "write" ? #write : #dread eq "read" and #dwrite eq "write" and #read eq "read" and #write eq "write" ? #read + ", " + #write : ""'/>
            <SetVar name="_sql" value='#_privileges neq "" ? "revoke " + #_privileges + " on directory " +"\"" + #objectname + "\"" + " from " + #grantee + ";" : "select " + "\u0027Nothing to revoke!\u0027 Response" + " from dual;"'/>
            <SetVar name="_confirm" value='#_privileges neq "" ? "Revoke \u0027" + #_privileges + "\u0027 from " + #grantee + "?" : "Nothing to revoke!"'/>
            <Command>
               <SQL>
                  <![CDATA[${_sql}]]>
               </SQL>
            </Command>
            <Confirm><![CDATA[${_confirm}]]></Confirm>
         </Action>
      </ActionGroup>

      <ActionGroup type="AllRecycleBinTable">
         <Action id="oracle-allrecyclebintable-flashback" label="Flashback to Before Drop" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.OWNER}</Default>
            </Input>
            <Input label="Bin Object Name" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.OBJECT_NAME}</Default>
            </Input>
            <Input label="Object Type" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.TYPE}</Default>
            </Input>
            <Input label="Drop Time" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.DROPTIME}</Default>
            </Input>
            <Input label="Original Name" name="newName" style="text" editable="true">
               <Default>${oracle.getAllRecycleBin.ORIGINAL_NAME}</Default>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[flashback table "${oracle.getAllRecycleBin.OWNER}"."${oracle.getAllRecycleBin.OBJECT_NAME}" to before drop rename to "${newName}"]]></SQL>
            </Command>
            <Confirm><![CDATA[
            Really flashback (restore) the table to ${oracle.getAllRecycleBin.OWNER].${newName}?
            ]]></Confirm>
            <Result>
               Table ${oracle.getAllRecycleBin.OWNER}.${newName} has been
               restored!
            </Result>
         </Action>

         <Action id="oracle-allrecyclebintable-purge" label="Purge from Recycle Bin" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.OWNER}</Default>
            </Input>
            <Input label="Bin Object Name" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.OBJECT_NAME}</Default>
            </Input>
            <Input label="Object Type" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.TYPE}</Default>
            </Input>
            <Input label="Drop Time" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.DROPTIME}</Default>
            </Input>
            <Input label="Original Name" style="text" editable="false">
               <Default>${oracle.getAllRecycleBin.ORIGINAL_NAME}</Default>
            </Input>

            <Command>
               <SQL>
                  <![CDATA[purge table "${oracle.getAllRecycleBin.OWNER}"."${oracle.getAllRecycleBin.OBJECT_NAME}"]]></SQL>
            </Command>
            <Confirm><![CDATA[
            Really purge the table from the recycle bin?
            ]]></Confirm>
            <Result>
               Table
               ${oracle.getAllRecycleBin.OWNER}.${oracle.getAllRecycleBin.OBJECT_NAME}
               has been purged!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="SGA">
         <Action id="oracle-sga-flush" label="Flush SGA" reload="true">
            <Command>
               <SQL>
                  <![CDATA[alter system flush shared_pool]]>
               </SQL>
            </Command>
            <Confirm>
               Really flush the SGA?
            </Confirm>
         </Action>
      </ActionGroup>

   </ObjectsActionDef>

   <!-- =================================================================== -->
   <!-- Definition of the database objects tree structure -->
   <!-- =================================================================== -->

   <ObjectsTreeDef extends="false">
      <GroupNode type="Schemas" label="Schemas">
         <DataNode type="Schema" label="${oracle.getSchemas.TABLE_SCHEM}">
            <SetVar name="schema" value="${oracle.getSchemas.TABLE_SCHEM}"/>
            <Command idref="oracle.getSchemas">
               <Filter index="TABLE_SCHEM" label="Name"/>
            </Command>

            <GroupNode type="Tables" label="Tables">
               <DataNode type="Table" label="${oracle.getTables.TABLE_NAME}" isLeaf="false">
                  <SetVar name="objectname" value="${oracle.getTables.TABLE_NAME}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="oracle.getTables">
                     <Input name="owner" value="${schema}"/>
                     <Input name="temporary" value="N"/>
                  </Command>

                  <!-- Need to keep the objectname for the current table in
                       a new variable so that the viewers will be able to pick up
                       the correct input to display -->
                  <SetVar name="theTableName" value="${objectname}"/>
                  <!-- and in a more generic variable for use by Column actions shared
                       shared by many object types -->
                  <SetVar name="theParentName" value="${objectname}"/>

                  <!-- oracle.getTriggers is used both to list all triggers in
                       the schema and triggers related to a specific table.
                       This variable is needed in order to either get all triggers
                       (even those not related to a table) or triggers that
                       really are associated with a table -->
                  <SetVar name="triggersCondition" value="table_owner = '${schema}' and table_name = '${theTableName}'"/>

                  <!-- oracle.getIndexes is used both to list all indexes in
                       the schema and indexes related to a specific table.
                       This variable is needed in order to either get all indexes
                       (even those not related to a table) or indexes that
                       really are associated with a table -->
                  <SetVar name="indexOwnerSQL" value="table_owner = '${schema}'"/>

                  <GroupNode type="Columns" label="Columns">
                     <DataNode type="Column" label="${getColumnDefinitions.COLUMN_NAME}"
                               label1="${getColumnDefinitions.TYPE_NAME}" isLeaf="true"
                               icon="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'PrimaryKey' : 
                                    #dataMap.get('getColumnDefinitions.IS_INVISIBLE') eq true ? 'InvisibleColumn' : 'Column'"
                               tip="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'This is a primary key column' : 
                                    #dataMap.get('getColumnDefinitions.IS_INVISIBLE') eq true ? 'This is an INVISIBLE column' : ''">
                        <SetVar name="objectname" value="${getColumnDefinitions.COLUMN_NAME}"/>
                        <Command idref="getColumnDefinitions">
                           <Input name="schema" value="${schema}"/>
                           <Input name="objectname" value="${theTableName}"/>
                           <Input name="tableType" value="Table"/>
                           <Filter index="TYPE_NAME" label="Type"/>
                        </Command>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="Constraints" label="Constraints">
                     <DataNode type="Constraint" label="${oracle.getTableConstraints.CONSTRAINT_NAME}"
                               label1="${oracle.getTableConstraints.CONSTRAINT_TYPE}"
                               isLeaf="false">
                        <SetVar name="objectname" value="${oracle.getTableConstraints.CONSTRAINT_NAME}"/>
                        <SetVar name="rowcount" value="false"/>
                        <SetVar name="constraintType" value="${oracle.getTableConstraints.DDL_TYPE}"/>
                        <Command idref="oracle.getTableConstraints">
                           <Input name="owner" value="${schema}"/>
                           <Input name="table" value="${objectname}"/>
                        </Command>

                        <DataNode type="Column" label="${oracle.getTableConstraintColumns.COLUMN_NAME}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getTableConstraintColumns.COLUMN_NAME}"/>
                           <SetVar name="rowcount" value="false"/>
                           <Command idref="oracle.getTableConstraintColumns">
                              <Input name="owner" value="${schema}"/>
                              <Input name="table" value="${theTableName}"/>
                              <Input name="constraint" value="${objectname}"/>
                           </Command>
                        </DataNode>
                     </DataNode>
                  </GroupNode>
                  <GroupNode type="RefConstraints" label="Referenced By Constraints">
                     <DataNode type="RefConstraint" label="${oracle.getTableReferencedBy.TABLE_NAME}"
                               label1="${oracle.getTableReferencedBy.CONSTRAINT_NAME}"
                               isLeaf="false">
                        <SetVar name="objectname" value="${oracle.getTableReferencedBy.CONSTRAINT_NAME}"/>
                        <SetVar name="refTableName" value="${oracle.getTableReferencedBy.TABLE_NAME}"/>
                        <SetVar name="refSchemaName" value="${oracle.getTableReferencedBy.OWNER}"/>
                        <SetVar name="constraintType" value="${oracle.getTableReferencedBy.DDL_TYPE}"/>
                        <SetVar name="rowcount" value="false"/>
                        <Command idref="oracle.getTableReferencedBy">
                           <Input name="owner" value="${schema}"/>
                           <Input name="table" value="${objectname}"/>
                        </Command>

                        <DataNode type="Column" label="${oracle.getTableConstraintColumns.COLUMN_NAME}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getTableConstraintColumns.COLUMN_NAME}"/>
                           <SetVar name="rowcount" value="false"/>
                           <Command idref="oracle.getTableConstraintColumns">
                              <Input name="owner" value="${refSchemaName}"/>
                              <Input name="table" value="${refTableName}"/>
                              <Input name="constraint" value="${objectname}"/>
                           </Command>
                        </DataNode>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="Indexes" label="Indexes">
                     <DataNode type="Index" label="${oracle.getIndexes.OWNER}.${oracle.getIndexes.INDEX_NAME}"
                               label1="${oracle.getIndexes.UNIQUENESS}"
                               isLeaf="false">
                        <SetVar name="objectname" value="${oracle.getIndexes.INDEX_NAME}"/>
                        <SetVar name="theIndexName" value="${oracle.getIndexes.INDEX_NAME}"/>
                        
                        <SetVar name="rowcount" value="false"/>
                        <SetVar name="indexOwner" value="${oracle.getIndexes.OWNER}"/>
                        <SetVar name="Schema" value="${oracle.getIndexes.OWNER}"/>
                        
                        
                        <Command idref="oracle.getIndexes">
                           <Input name="indexOwner" value="${indexOwnerSQL}"/>
                           <Input name="table" value="${theTableName}"/>
                        </Command>
                        <DataNode type="Column" label="${oracle.getIndexColumns.COLUMN_NAME}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getIndexColumns.COLUMN_NAME}"/>
                           <SetVar name="rowcount" value="false"/>
                           <Command idref="oracle.getIndexColumns">
                              <Input name="indexOwner" value="${indexOwner}"/>
                              <Input name="indexName" value="${objectname}"/>
                           </Command>
                        </DataNode>
                        <GroupNode type="IndexPartitions" label="Partitions">
                           <DataNode type="IndexPartition" label="${oracle.getIndexPartitions.PARTITION_NAME}" isLeaf="false">
                              <SetVar name="objectname" value="${oracle.getIndexPartitions.PARTITION_NAME}"/>
                              <Command idref="oracle.getIndexPartitions">
                                 <Input name="owner" value="${schema}"/>
                                 <Input name="name" value="${objectname}"/>
                              </Command>
                              <DataNode type="IndexSubPartition" label="${oracle.getIndexSubPartitions.SUBPARTITION_NAME}" isLeaf="true">
                                 <Command idref="oracle.getIndexSubPartitions">
                                    <Input name="owner" value="${schema}"/>
                                    <Input name="name" value="${theIndexName}"/>
                                    <Input name="part_name" value="${objectname}"/>
                                 </Command>
                              </DataNode>
                           </DataNode>
                        </GroupNode>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="Triggers" label="Triggers">
                     <DataNode type="Trigger" label="${oracle.getTriggers.OWNER}.${oracle.getTriggers.TRIGGER_NAME}"
                               label1="${oracle.getTriggers.LABEL}"
                               isLeaf="true"
                               warnstate="! #dataMap.get('oracle.getTriggers.STATUS').equals('ENABLED')"
                               tip="#dataMap.get('oracle.getTriggers.STATUS').equals('ENABLED') ? '' : 'Trigger is disabled'">
                        <SetVar name="objectname" value="${oracle.getTriggers.TRIGGER_NAME}"/>
                        <SetVar name="rowcount" value="false"/>
                        <SetVar name="schema" value="${oracle.getTriggers.OWNER}"/>
                        
                        <Command idref="oracle.getTriggers">
                           <Input name="condition" value="${triggersCondition}"/>
                        </Command>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="Partitions" label="Partitions">
                     <DataNode type="Partition" label="${oracle.getTablePartitions.PARTITION_NAME}" isLeaf="false">
                        <SetVar name="objectname" value="${oracle.getTablePartitions.PARTITION_NAME}"/>
                        <Command idref="oracle.getTablePartitions">
                           <Input name="owner" value="${schema}"/>
                           <Input name="table" value="${objectname}"/>
                        </Command>
                        <DataNode type="SubPartition" label="${oracle.getTableSubPartitions.SUBPARTITION_NAME}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getTableSubPartitions.SUBPARTITION_NAME}"/>
                           <Command idref="oracle.getTableSubPartitions">
                              <Input name="owner" value="${schema}"/>
                              <Input name="table" value="${theTableName}"/>
                              <Input name="part_name" value="${objectname}"/>
                           </Command>
                        </DataNode>
                     </DataNode>
                  </GroupNode>

               </DataNode>
            </GroupNode>

            <!-- Reset the temporary variable so that the following DataNodes
                 operates properly -->
            <SetVar name="theTableName" value="%"/>

            <!-- Reset the temporary variable so that the following DataNodes
                 operates properly -->
            <SetVar name="indexOwnerSQL" value="owner = '${schema}'"/>

            <GroupNode type="GlobalTempTables" label="Global Temp Tables">
               <SetVar name="type" value="GLOBAL TEMPORARY"/>

               <DataNode type="TempTable" label="${oracle.getTables.TABLE_NAME}">
                  <SetVar name="objectname" value="${oracle.getTables.TABLE_NAME}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="oracle.getTables">
                     <Input name="owner" value="${schema}"/>
                     <Input name="temporary" value="Y"/>
                  </Command>

                  <!-- Need to keep the objectname for the current table in
                       a new variable so that the viewers will be able to pick up
                       the correct input to display -->
                  <SetVar name="theTableName" value="${objectname}"/>
                  <!-- and in a more generic variable for use by Column actions shared
                       shared by many object types -->
                  <SetVar name="theParentName" value="${objectname}"/>

                  <!-- oracle.getTriggers is used both to list all triggers in
                       the schema and triggers related to a specific table.
                       This variable is needed in order to either get all triggers
                       (even those not related to a table) or triggers that
                       really are associated with a table -->
                  <SetVar name="triggersCondition" value="table_owner = '${schema}' and table_name = '${theTableName}'"/>
                  

                  <!-- oracle.getIndexes is used both to list all indexes in
                       the schema and indexes related to a specific table.
                       This variable is needed in order to either get all indexes
                       (even those not related to a table) or indexes that
                       really are associated with a table -->
                  <SetVar name="indexOwnerSQL" value="table_owner = '${schema}'"/>

                  <GroupNode type="Columns" label="Columns">
                     <DataNode type="Column" label="${getColumnDefinitions.COLUMN_NAME}"
                               label1="${getColumnDefinitions.TYPE_NAME}" isLeaf="true">
                        <SetVar name="objectname" value="${getColumnDefinitions.COLUMN_NAME}"/>
                        <Command idref="getColumnDefinitions">
                           <Input name="schema" value="${schema}"/>
                           <Input name="objectname" value="${theTableName}"/>
                           <Input name="tableType" value="Table"/>
                           <Filter index="TYPE_NAME" label="Type"/>
                        </Command>
                     </DataNode>
                  </GroupNode>
               </DataNode>
            </GroupNode>

            <GroupNode type="Views" label="Views">
               <DataNode type="View" label="${oracle.getViews.VIEW_NAME}" isLeaf="false">
                  <SetVar name="objectname" value="${oracle.getViews.VIEW_NAME}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="oracle.getViews">
                     <Input name="owner" value="${schema}"/>
                  </Command>

                  <!-- oracle.getTriggers is used both to list all triggers in
                       the schema and triggers related to a specific table.
                       This variable is needed in order to either get all triggers
                       (even those not related to a table) or triggers that
                       really are associated with a table -->
                  <SetVar name="triggersCondition" value="table_owner = '${schema}' and table_name = '${objectname}'"/>
                  
                  <!-- and in a more generic variable for use by Column actions shared
                       shared by many object types -->
                  <SetVar name="theParentName" value="${objectname}"/>

                  <GroupNode type="Columns" label="Columns">
                     <DataNode type="Column" label="${getColumnDefinitions.COLUMN_NAME}"
                               label1="${getColumnDefinitions.TYPE_NAME}" isLeaf="true">
                        <SetVar name="objectname" value="${getColumnDefinitions.COLUMN_NAME}"/>
                        <Command idref="getColumnDefinitions">
                           <Input name="schema" value="${schema}"/>
                           <Input name="objectname" value="${objectname}"/>
                           <Input name="tableType" value="View"/>
                           <Filter index="TYPE_NAME" label="Type"/>
                        </Command>
                     </DataNode>
                  </GroupNode>
                  <GroupNode type="Triggers" label="Triggers">
                     <DataNode type="Trigger" label="${oracle.getTriggers.OWNER}.${oracle.getTriggers.TRIGGER_NAME}"
                               label1="${oracle.getTriggers.LABEL}"
                               isLeaf="true"
                               warnstate="! #dataMap.get('oracle.getTriggers.STATUS').equals('ENABLED')"
                               tip="#dataMap.get('oracle.getTriggers.STATUS').equals('ENABLED') ? '' : 'Trigger is disabled'">
                        <SetVar name="objectname" value="${oracle.getTriggers.TRIGGER_NAME}"/>
                        <SetVar name="schema" value="${oracle.getTriggers.OWNER}"/>
                        
                        <SetVar name="rowcount" value="false"/>
                        <Command idref="oracle.getTriggers">
                           <Input name="condition" value="${triggersCondition}"/>
                        </Command>
                     </DataNode>
                  </GroupNode>
               </DataNode>
            </GroupNode>

            <GroupNode type="Synonyms" label="Synonyms">
               <DataNode type="Synonym" actiontype="Synonym" label="${oracle.getSynonyms.Synonym Name}"
                         label1="${oracle.getSynonyms.RefObjOwner}.${oracle.getSynonyms.RefObjName}">
                  <SetVar name="schema" value="${oracle.getSynonyms.Synonym Owner}"/>
                  <SetVar name="objectname" value="${oracle.getSynonyms.Synonym Name}"/>
                  <SetVar name="objecttype" value="${oracle.getSynonyms.Type}"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="oracle.getSynonyms">
                     <Input name="owner" value="${schema}"/>
                     <Input name="synonymname" value="%"/>
                     <Input name="objecttype" value="%"/>
                  </Command>

                  <DataNode type="${oracle.getSynonyms.Type}" label="${oracle.getSynonyms.RefObjOwner}.${oracle.getSynonyms.RefObjName}" isLeaf="true">
                     <SetVar name="schema" value="${oracle.getSynonyms.RefObjOwner}"/>
                     <SetVar name="objectname" value="${oracle.getSynonyms.RefObjName}"/>
                     <SetVar name="acceptInQB" value="true"/>
                     <Command idref="oracle.getSynonyms">
                        <Input name="owner" value="${schema}"/>
                        <Input name="synonymname" value="${objectname}"/>
                        <Input name="objecttype" value="${objecttype}"/>
                     </Command>
                  </DataNode>
               </DataNode>
            </GroupNode>

            <GroupNode type="Indexes" label="Indexes">
               <DataNode type="Index" label="${oracle.getIndexes.INDEX_NAME}"
                         label1="${oracle.getIndexes.TABLE_OWNER}.${oracle.getIndexes.TABLE_NAME}"
                         isLeaf="true"
                         errorstate="! #dataMap.get('oracle.getIndexes.STATUS').equals('VALID')"
                         tip="#dataMap.get('oracle.getIndexes.STATUS').equals('VALID') ? '' : 'Index is in an invalid state'">
                  <SetVar name="objectname" value="${oracle.getIndexes.INDEX_NAME}"/>
                  <SetVar name="indexOwner" value="${oracle.getIndexes.OWNER}"/>
                  <SetVar name="Schema" value="${oracle.getIndexes.OWNER}"/>
                  
                  <Command idref="oracle.getIndexes">
                     <Input name="indexOwner" value="${indexOwnerSQL}"/>
                     <Input name="table" value="%"/>
                     <Filter index="TABLE_OWNER" label="Table Owner"/>
                     <Filter index="TABLE_NAME" label="Table Name"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="Sequences" label="Sequences">
               <DataNode type="Sequence" label="${oracle.getSequences.SEQUENCE_NAME}" isLeaf="true">
                  <SetVar name="objectname" value="${oracle.getSequences.SEQUENCE_NAME}"/>
                  <Command idref="oracle.getSequences">
                     <Input name="owner" value="${schema}"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="MaterializedViews" label="Materialized Views">
               <DataNode type="MaterializedView" label="${oracle.getMaterializedViews.MVIEW_NAME}" isLeaf="false">
                  <SetVar name="objectname" value="${oracle.getMaterializedViews.MVIEW_NAME}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="oracle.getMaterializedViews">
                     <Input name="owner" value="${schema}"/>
                  </Command>

                  <!-- Need to keep the objectname for the current table in
                       a new variable so that the viewers will be able to pick up
                       the correct input to display -->
                  <SetVar name="theTableName" value="${objectname}"/>

                  <!-- oracle.getIndexes is used both to list all indexes in
                       the schema and indexes related to a specific table.
                       This variable is needed in order to either get all indexes
                       (even those not related to a table) or indexes that
                       really are associated with a table -->
                  <SetVar name="indexOwnerSQL" value="table_owner = '${schema}'"/>

                  <GroupNode type="Indexes" label="Indexes">
                     <DataNode type="Index" label="${oracle.getIndexes.INDEX_NAME}"
                               label1="${oracle.getIndexes.UNIQUENESS}"
                               isLeaf="false">
                        <SetVar name="objectname" value="${oracle.getIndexes.INDEX_NAME}"/>
                        <SetVar name="rowcount" value="false"/>
                        <SetVar name="indexOwner" value="${oracle.getIndexes.OWNER}"/>
                        <Command idref="oracle.getIndexes">
                           <Input name="indexOwner" value="${indexOwnerSQL}"/>
                           <Input name="table" value="${theTableName}"/>
                        </Command>
                        <DataNode type="Column" label="${oracle.getIndexColumns.COLUMN_NAME}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getIndexColumns.COLUMN_NAME}"/>
                           <SetVar name="rowcount" value="false"/>
                           <Command idref="oracle.getIndexColumns">
                              <Input name="indexOwner" value="${indexOwner}"/>
                              <Input name="indexName" value="${objectname}"/>
                           </Command>
                        </DataNode>
                     </DataNode>
                  </GroupNode>
               </DataNode>
            </GroupNode>

            <!--
                        <GroupNode type="Types" label="Types">
                           <DataNode type="Type" label="${oracle.getColumnTypes.TYPE_NAME}" isLeaf="true">
                              <Command idref="oracle.getColumnTypes"/>
                           </DataNode>
                        </GroupNode>
            -->
            <GroupNode type="Functions" label="Functions">
               <DataNode type="Function" label="${oracle.getObjectsByType.OBJECT_NAME}" isLeaf="true"
                         errorstate="! #dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID')"
                         tip="#dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID') ? '' : 'Function is in an invalid state'">
                  <SetVar name="objectname" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <Command idref="oracle.getObjectsByType">
                     <Input name="owner" value="${schema}"/>
                     <Input name="type" value="'FUNCTION'"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="Procedures" label="Procedures">
               <DataNode type="Procedure" label="${oracle.getObjectsByType.OBJECT_NAME}" isLeaf="true"
                         errorstate="! #dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID')"
                         tip="#dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID') ? '' : 'Procedure is in an invalid state'">
                  <SetVar name="objectname" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <Command idref="oracle.getObjectsByType">
                     <Input name="owner" value="${schema}"/>
                     <Input name="type" value="'PROCEDURE'"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="Packages" label="Packages">
               <DataNode type="Package" label="${oracle.getObjectsByType.OBJECT_NAME}" isLeaf="false"
                         errorstate="! #dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID')"
                         tip="#dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID') ? '' : 'Package is in an invalid state'">
                  <SetVar name="objectname" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <SetVar name="packagename" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <Command idref="oracle.getObjectsByType">
                     <Input name="owner" value="${schema}"/>
                     <Input name="type" value="'PACKAGE'"/>
                  </Command>
                  <DataNode type="PackageBody" label="${oracle.getObjectsByTypeAndName.OBJECT_NAME}" isLeaf="true"
                            errorstate="! #dataMap.get('oracle.getObjectsByTypeAndName.STATUS').equals('VALID')"
                            tip="#dataMap.get('oracle.getObjectsByTypeAndName.STATUS').equals('VALID') ? '' : 'Package body is in an invalid state'">
                     <SetVar name="objectname" value="${oracle.getObjectsByTypeAndName.OBJECT_NAME}"/>
                     <Command idref="oracle.getObjectsByTypeAndName">
                        <Input name="type" value="'PACKAGE BODY'"/>
                        <Input name="owner" value="${schema}"/>
                        <Input name="name" value="${packagename}"/>
                     </Command>
                  </DataNode>
               </DataNode>
            </GroupNode>

            <GroupNode type="PackageBodies" label="Package Bodies">
               <DataNode type="PackageBody" label="${oracle.getObjectsByType.OBJECT_NAME}" isLeaf="true"
                         errorstate="! #dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID')"
                         tip="#dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID') ? '' : 'Package body is in an invalid state'">
                  <SetVar name="objectname" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <Command idref="oracle.getObjectsByType">
                     <Input name="type" value="'PACKAGE BODY'"/>
                     <Input name="owner" value="${schema}"/>
                     <Input name="name" value="%"/>
                  </Command>
               </DataNode>
            </GroupNode>

             <If test="#util.isDatabaseVersionGTE(9) and #JAVASNM_EXISTS eq 1">
               <GroupNode type="JavaSources" label="Java Sources">
                  <DataNode type="JavaSource" label="${oracle.getJavaObjects.Name}" isLeaf="true"
                            errorstate="! #dataMap.get('oracle.getJavaObjects.Status').equals('VALID')"
                            tip="#dataMap.get('oracle.getJavaObjects.Status').equals('VALID') ? '' : 'Java source is in an invalid state'">
                     <SetVar name="objectname" value="${oracle.getJavaObjects.Name}"/>
                     <Command idref="oracle.getJavaObjects">
                        <Input name="type" value="JAVA SOURCE"/>
                        <Input name="owner" value="${schema}"/>
                     </Command>
                  </DataNode>
               </GroupNode>

               <GroupNode type="JavaClasses" label="Java Classes">
                  <DataNode type="JavaClass" label="${oracle.getJavaObjects.Name}" isLeaf="true"
                            errorstate="! #dataMap.get('oracle.getJavaObjects.Status').equals('VALID')"
                            tip="#dataMap.get('oracle.getJavaObjects.Status').equals('VALID') ? '' : 'Java class is in an invalid state'">
                     <SetVar name="objectname" value="${oracle.getJavaObjects.Name}"/>
                     <Command idref="oracle.getJavaObjects">
                        <Input name="type" value="JAVA CLASS"/>
                        <Input name="owner" value="${schema}"/>
                     </Command>
                  </DataNode>
               </GroupNode>
            </If>

            <!-- oracle.getTriggers is used both to list all triggers in
                 the schema and triggers related to a specific table.
                 This variable is needed in order to either get all triggers
                 (even those not related to a table) or triggers that
                 really are associated with a table -->
            <SetVar name="triggersCondition" value="(table_owner = '${schema}' or owner = '${schema}')"/>

            <GroupNode type="Triggers" label="Triggers">
               <DataNode type="Trigger" label="${oracle.getTriggers.OWNER}.${oracle.getTriggers.TRIGGER_NAME}"
                         label1="${oracle.getTriggers.LABEL}"
                         isLeaf="true"
                         warnstate="! #dataMap.get('oracle.getTriggers.STATUS').equals('ENABLED')"
                         tip="#dataMap.get('oracle.getTriggers.STATUS').equals('ENABLED') ? '' : 'Trigger is disabled'">
                  <SetVar name="objectname" value="${oracle.getTriggers.TRIGGER_NAME}"/>
                  <SetVar name="schema" value="${oracle.getTriggers.OWNER}"/>
                  
                  <Command idref="oracle.getTriggers">
                     <Input name="condition" value="${triggersCondition}"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="ObjectTypes" label="Object Types">
               <DataNode type="ObjectType" label="${oracle.getObjectsByType.OBJECT_NAME}" isLeaf="false"
                         errorstate="! #dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID')"
                         tip="#dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID') ? '' : 'Object type is in an invalid state'">
                  <SetVar name="objectname" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <SetVar name="typename" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <Command idref="oracle.getObjectsByType">
                     <Input name="owner" value="${schema}"/>
                     <Input name="type" value="'TYPE'"/>
                  </Command>
                  <DataNode type="ObjectTypeBody" label="${oracle.getObjectsByTypeAndName.OBJECT_NAME}" isLeaf="true"
                            errorstate="! #dataMap.get('oracle.getObjectsByTypeAndName.STATUS').equals('VALID')"
                            tip="#dataMap.get('oracle.getObjectsByTypeAndName.STATUS').equals('VALID') ? '' : 'Object type body is in an invalid state'">
                     <SetVar name="objectname" value="${oracle.getObjectsByTypeAndName.OBJECT_NAME}"/>
                     <Command idref="oracle.getObjectsByTypeAndName">
                        <Input name="type" value="'TYPE BODY'"/>
                        <Input name="owner" value="${schema}"/>
                        <Input name="name" value="${typename}"/>
                     </Command>
                  </DataNode>
               </DataNode>
            </GroupNode>

            <GroupNode type="ObjectTypeBodies" label="Object Type Bodies">
               <DataNode type="ObjectTypeBody" label="${oracle.getObjectsByType.OBJECT_NAME}" isLeaf="true"
                         errorstate="! #dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID')"
                         tip="#dataMap.get('oracle.getObjectsByType.STATUS').equals('VALID') ? '' : 'Object type body is in an invalid state'">
                  <SetVar name="objectname" value="${oracle.getObjectsByType.OBJECT_NAME}"/>
                  <Command idref="oracle.getObjectsByType">
                     <Input name="type" value="'TYPE BODY'"/>
                     <Input name="owner" value="${schema}"/>
                     <Input name="name" value="%"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <If test="#util.isDatabaseVersionGTE(10)">
               <GroupNode type="RecycleBin" label="Recycle Bin" isLeaf="false">
                  <DataNode type="RecycleBinTable" label="${oracle.getRecycleBin.ORIGINAL_NAME}"
                            label1="${oracle.getRecycleBin.DROPTIME}"
                            isLeaf="true">
                     <SetVar name="objectname" value="${oracle.getRecycleBin.OBJECT_NAME}"/>
                     <Command idref="oracle.getRecycleBin">
                        <Input name="schema" value="${schema}"/>
                        <Input name="login_schema" value="${dbvis-defaultCatalogOrSchema}"/>
                     </Command>

                  </DataNode>
               </GroupNode>
            </If>

            <GroupNode type="Jobs" label="Jobs" isLeaf="false">
               <DataNode type="Job" label="${oracle.getJobs.JOB}"
                         label1="${oracle.getJobs.WHAT}"
                         isLeaf="true">
                  <SetVar name="objectname" value="${oracle.getJobs.JOB}"/>
                  <Command idref="oracle.getJobs">
                     <Input name="owner" value="${schema}"/>
                     <Filter index="job_char" label="Job"/>
                     <Filter index="WHAT" label="What"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <If test="#util.isDatabaseVersionGTE(10,1)">
               <GroupNode type="Scheduler" label="Scheduler" isLeaf="false">
                  <GroupNode type="SchedulerChains" label="Chains" isLeaf="false">
                     <DataNode type="SchedulerChain" label="${oracle.getSchedulerChains.CHAIN_NAME}" isLeaf="false">
                        <SetVar name="objectname" value="${oracle.getSchedulerChains.CHAIN_NAME}"/>
                        <SetVar name="chain_name" value="${oracle.getSchedulerChains.CHAIN_NAME}"/>
                        <Command idref="oracle.getSchedulerChains">
                           <Input name="owner" value="${schema}"/>
                           <Input name="chain_name" value="%"/>
                        </Command>
                        <GroupNode type="SchedulerChainRules" label="Rules" isLeaf="false">
                           <DataNode type="SchedulerChainRule" label="${oracle.getSchedulerChainRules.RULE_NAME}" isLeaf="true">
                              <SetVar name="objectname" value="${oracle.getSchedulerChainRules.RULE_NAME}"/>
                              <Command idref="oracle.getSchedulerChainRules">
                                 <Input name="owner" value="${schema}"/>
                                 <Input name="chain_name" value="${objectname}"/>
                                 <Input name="rule_name" value="%"/>
                              </Command>
                           </DataNode>
                        </GroupNode>

                        <GroupNode type="SchedulerChainSteps" label="Steps" isLeaf="false">
                           <DataNode type="SchedulerChainStep" label="${oracle.getSchedulerChainSteps.STEP_NAME}" isLeaf="true">
                              <SetVar name="objectname" value="${oracle.getSchedulerChainSteps.STEP_NAME}"/>
                              <Command idref="oracle.getSchedulerChainSteps">
                                 <Input name="owner" value="${schema}"/>
                                 <Input name="chain_name" value="${objectname}"/>
                                 <Input name="step_name" value="%"/>
                              </Command>
                           </DataNode>
                        </GroupNode>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="SchedulerJobs" label="Jobs" isLeaf="false">
                     <DataNode type="SchedulerJob" label="${oracle.getSchedulerJobs.JOB_NAME}" isLeaf="false"
                               warnstate="#dataMap.get('oracle.getSchedulerJobs.ENABLED').equals('FALSE')"
                               tip="#dataMap.get('oracle.getSchedulerJobs.ENABLED').equals('FALSE') ? 'The scheduler job is disabled' : ''">
                        <SetVar name="objectname" value="${oracle.getSchedulerJobs.JOB_NAME}"/>
                        <SetVar name="theJobName" value="${oracle.getSchedulerJobs.JOB_NAME}"/>
                        <Command idref="oracle.getSchedulerJobs">
                           <Input name="owner" value="${schema}"/>
                           <Input name="job_name" value="%"/>
                        </Command>
                        <GroupNode type="SchedulerJobArguments" label="Job Arguments" isLeaf="false">
                           <DataNode type="SchedulerJobArgument" label="${oracle.getSchedulerJobArguments.ARGUMENT_POSITION}"
                                     label1="${oracle.getSchedulerJobArguments.ARGUMENT_NAME}"
                                     isLeaf="true">
                              <SetVar name="objectname" value="${oracle.getSchedulerJobArguments.ARGUMENT_POSITION}"/>
                              <Command idref="oracle.getSchedulerJobArguments">
                                 <Input name="owner" value="${schema}"/>
                                 <Input name="job_name" value="${theJobName}"/>
                                 <Input name="argument_position" value="%"/>
                              </Command>
                           </DataNode>
                        </GroupNode>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="SchedulerPrograms" label="Programs" isLeaf="false">
                     <DataNode type="SchedulerProgram" label="${oracle.getSchedulerPrograms.PROGRAM_NAME}" isLeaf="false"
                               warnstate="#dataMap.get('oracle.getSchedulerPrograms.ENABLED').equals('FALSE')"
                               tip="#dataMap.get('oracle.getSchedulerPrograms.ENABLED').equals('FALSE') ? 'Scheduler program is disabled' : ''">
                        <SetVar name="objectname" value="${oracle.getSchedulerPrograms.PROGRAM_NAME}"/>
                        <SetVar name="theProgramName" value="${oracle.getSchedulerPrograms.PROGRAM_NAME}"/>
                        <Command idref="oracle.getSchedulerPrograms">
                           <Input name="owner" value="${schema}"/>
                           <Input name="program_name" value="%"/>
                        </Command>
                        <GroupNode type="SchedulerProgramArguments" label="Program Arguments" isLeaf="false">
                           <DataNode type="SchedulerProgramArgument" label="${oracle.getSchedulerProgramArguments.ARGUMENT_POSITION}"
                                     label1="${oracle.getSchedulerProgramArguments.ARGUMENT_NAME}"
                                     isLeaf="true">
                              <SetVar name="objectname" value="${oracle.getSchedulerProgramArguments.ARGUMENT_NAME}"/>
                              <SetVar name="argpos" value="${oracle.getSchedulerProgramArguments.ARGUMENT_POSITION}"/>
                              <SetVar name="argtyp" value="${oracle.getSchedulerProgramArguments.ARGUMENT_TYPE}"/>
                              <Command idref="oracle.getSchedulerProgramArguments">
                                 <Input name="owner" value="${schema}"/>
                                 <Input name="program_name" value="${theProgramName}"/>
                                 <Input name="argument_name" value="%"/>
                              </Command>
                           </DataNode>
                        </GroupNode>
                     </DataNode>
                  </GroupNode>
                  <GroupNode type="SchedulerSchedules" label="Schedules" isLeaf="false">
                     <DataNode type="SchedulerSchedule" label="${oracle.getSchedulerSchedules.SCHEDULE_NAME}" isLeaf="true">
                        <SetVar name="objectname" value="${oracle.getSchedulerSchedules.SCHEDULE_NAME}"/>
                        <Command idref="oracle.getSchedulerSchedules">
                           <Input name="owner" value="${schema}"/>
                           <Input name="schedule_name" value="%"/>
                        </Command>
                     </DataNode>
                  </GroupNode>
                  <If test="#util.isDatabaseVersionGTE(11)">
                     <GroupNode type="SchedulerCredentials" label="Credentials" isLeaf="false">
                        <DataNode type="SchedulerCredential" label="${oracle.getSchedulerCredentials.CREDENTIAL_NAME}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getSchedulerCredentials.CREDENTIAL_NAME}"/>
                           <Command idref="oracle.getSchedulerCredentials">
                              <Input name="owner" value="${schema}"/>
                              <Input name="credential_name" value="%"/>
                           </Command>
                        </DataNode>
                     </GroupNode>
                  </If>
               </GroupNode>
            </If>

            <GroupNode type="DatabaseLinks" label="Database Links" isLeaf="false">
               <DataNode type="DatabaseLink" label="${oracle.getDatabaseLinks.DB_LINK}"
                         label1="${oracle.getDatabaseLinks.OWNER}"
                         isLeaf="true">
                  <SetVar name="schema" value="${oracle.getDatabaseLinks.OWNER}"/>
                  <SetVar name="objectname" value="${oracle.getDatabaseLinks.DB_LINK}"/>
                  <Command idref="oracle.getDatabaseLinks">
                     <Input name="owner" value="${schema}"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="InvalidObjects" label="Invalid Objects" isLeaf="false">
               <DataNode type="${oracle.getInvalidObjects.Type}" label="${oracle.getInvalidObjects.Object Name}"
                         label1="${oracle.getInvalidObjects.Object Owner}"
                         isLeaf="true">
                  <SetVar name="schema" value="${oracle.getInvalidObjects.Object Owner}"/>
                  <SetVar name="objectname" value="${oracle.getInvalidObjects.Object Name}"/>
                  <Command idref="oracle.getInvalidObjects">
                     <Input name="owner" value="${schema}"/>
                     <Filter index="Object Owner" label="Object Owner"/>
                  </Command>
               </DataNode>
            </GroupNode>
         </DataNode>
      </GroupNode>

      <GroupNode type="Properties" label="Session Properties" isLeaf="true"/>

      <!-- ================================================================= -->
      <!-- DBA Nodes -->
      <!-- ================================================================= -->

      <GroupNode type="DBA" label="DBA Views">
         <GroupNode type="Users" label="Users">
            <DataNode type="User" label="${oracle.getUsers.USERNAME}" isLeaf="true"
                      warnstate="#dataMap.get('oracle.getUsers.ACCOUNT_STATUS').matches('.*EXPIRED.*') or
                                 #dataMap.get('oracle.getUsers.ACCOUNT_STATUS').matches('.*LOCKED.*')"
                      tip="(#dataMap.get('oracle.getUsers.ACCOUNT_STATUS').matches('.*EXPIRED.*') or
                            #dataMap.get('oracle.getUsers.ACCOUNT_STATUS').matches('.*LOCKED.*')) ? 'User account is expired or locked' : ''">
               <SetVar name="objectname" value="${oracle.getUsers.USERNAME}"/>
               <Command idref="oracle.getUsers">
                  <Input name="user" value="%"/>
               </Command>
            </DataNode>
         </GroupNode>

         <GroupNode type="Roles" label="Roles">
            <DataNode type="Role" label="${oracle.getRoles.ROLE}" isLeaf="true">
               <SetVar name="objectname" value="${oracle.getRoles.ROLE}"/>
               <Command idref="oracle.getRoles"/>
            </DataNode>
         </GroupNode>

       <If test="#util.isDatabaseVersionLT(9)">
          <GroupNode type="Sessions" label="Sessions">
             <DataNode type="Session" label="${oracle.getSessions.SID},${oracle.getSessions.SERIAL#}"
                      label1="${oracle.getSessions.UserName}"
                      isLeaf="false">
               <SetVar name="objectname" value="${oracle.getSessions.SID},${oracle.getSessions.SERIAL#}"/>
               <Command idref="oracle.getSessions">
                  <Input name="INSTANCE_CONDITION" value=""/>
               </Command>
            </DataNode>
         </GroupNode>
       </If>
       <Else>
        <!-- In oracle 9 and later we are listing the instances and the  -->
           <GroupNode type="Sessions" label="Sessions">
              <!--  Local Sessions -->
              <GroupNode type="SessionsLocal" label="Local Sessions">
                 <DataNode type="Session" label="${oracle.getSessions.SID},${oracle.getSessions.SERIAL#}"
                           label1="${oracle.getSessions.UserName}"
                           isLeaf="true"
                           icon="#dataMap.get('oracle.getSessions.SQL_TRACE') eq 'DISABLED' ? 'Session' : 'SessionTraced'"
                           tip="#dataMap.get('oracle.getSessions.SQL_TRACE') eq 'DISABLED' ? '' : 'Session is currently being traced'">
                    <SetVar name="objectname" value="${oracle.getSessions.SID},${oracle.getSessions.SERIAL#}"/>
                    <Command idref="oracle.getSessions">
                       <Input name="INSTANCE_CONDITION" value="AND s.inst_id = ${OWN_INSTANCE_NUMBER}"/>
                    </Command>
                 </DataNode>
              </GroupNode>
              <GroupNode type="SessionsNonLocal" label="Remote Sessions">
                 <DataNode type="SessionNonLocal" label="${oracle.getSessions.SID},${oracle.getSessions.SERIAL#}"
                           label1="${oracle.getSessions.UserName}"
                           isLeaf="true"
                           icon="#dataMap.get('oracle.getSessions.SQL_TRACE') eq 'DISABLED' ? 'SessionNonLocal' : 'SessionTraced'"
                           tip="#dataMap.get('oracle.getSessions.SQL_TRACE') eq 'DISABLED' ? '' : 'Session is currently being traced'">
                    <SetVar name="objectname" value="${oracle.getSessions.SID},${oracle.getSessions.SERIAL#}"/>
                    <Command idref="oracle.getSessions">
                       <Input name="INSTANCE_CONDITION" value="AND s.inst_id != ${OWN_INSTANCE_NUMBER}"/>
                    </Command>
                 </DataNode>
              </GroupNode>
           </GroupNode>
       </Else>
         <If test="#util.isDatabaseVersionGTE(9)">
            <GroupNode type="Replication" label="Replication">
               <GroupNode type="DataGuard" label="DataGuard">
                  <GroupNode type="LogicalStandby" label="Logical Standby">
                  </GroupNode>
                  <GroupNode type="PhysicalStandby" label="Physical Standby">
                  </GroupNode>
               </GroupNode>
               <GroupNode type="Streams" label="Streams">
                  <GroupNode type="StreamsCapture" label="Capture">
                  </GroupNode>
                  <GroupNode type="StreamsApply" label="Apply">
                  </GroupNode>
               </GroupNode>
            </GroupNode>
         </If>

         <GroupNode type="Locks" label="Locks" isLeaf="true"/>

         <If test="#util.isDatabaseVersionGTE(10)">
            <GroupNode type="AllRecycleBin" label="Recycle Bin" isLeaf="false">
               <DataNode type="AllRecycleBinTable" label="${oracle.getAllRecycleBin.OWNER}.${oracle.getAllRecycleBin.ORIGINAL_NAME}"
                         label1="${oracle.getAllRecycleBin.DROPTIME}"
                         isLeaf="true">
                  <SetVar name="objectname" value="${oracle.getAllRecycleBin.OBJECT_NAME}"/>
                  <Command idref="oracle.getAllRecycleBin"/>
               </DataNode>
            </GroupNode>
         </If>

         <If test="#util.isDatabaseVersionGTE(8)">
            <GroupNode type="ResourceManager" label="Resource Manager" isLeaf="false">
               <GroupNode type="ResourceConsumerMappings" label="Resource Consumer Group Mapping" isLeaf="false">
                 <DataNode type="ResourceConsumerMapping" label="${oracle.getResourceConsumerMappings.ATTRIBUTE}"
                           label1="${oracle.getResourceConsumerMappings.PSTAT} ${oracle.getResourceConsumerMappings.PRIORITY}"
                           isLeaf="false">
                     <SetVar name="objectname" value="${oracle.getResourceConsumerMappings.ATTRIBUTE}"/>
                     <Command idref="oracle.getResourceConsumerMappings">
                        <Input name="objectname" value="%"/>
                     </Command>
                     <DataNode type="ResourceConsumerMappingValue" label="${oracle.getResourceConsumerMapping.VALUE}"
                               label1="${oracle.getResourceConsumerMapping.CONSUMER_GROUP}"
                               isLeaf="true">
                       <SetVar name="objectname" value="${oracle.getResourceConsumerMapping.VALUE}"/>
                       <SetVar name="attribute" value="${oracle.getResourceConsumerMapping.ATTRIBUTE}"/>
                       <SetVar name="groupname" value="${oracle.getResourceConsumerMapping.CONSUMER_GROUP}"/>
                       <Command idref="oracle.getResourceConsumerMapping">
                         <Input name="objectname" value="${oracle.getResourceConsumerMappings.ATTRIBUTE}"/>
                       </Command>
                     </DataNode>
                  </DataNode>
               </GroupNode>
               <GroupNode type="ResourceConsumerGroups" label="Resource Consumer Groups" isLeaf="false">
                  <DataNode type="ResourceConsumerGroup" label="${oracle.getResourceConsumerGroups.CONSUMER_GROUP}"
                            label1="${oracle.getResourceConsumerGroups.PSTAT}"
                            isLeaf="true">
                     <SetVar name="objectname" value="${oracle.getResourceConsumerGroups.CONSUMER_GROUP}"/>
                     <Command idref="oracle.getResourceConsumerGroups">
                        <Input name="consumer_group" value="%"/>
                     </Command>
                  </DataNode>
               </GroupNode>
               <GroupNode type="ResourcePlans" label="Resource Plans" isLeaf="false">
                  <DataNode type="ResourcePlan" label="${oracle.getResourcePlans.PLAN}"
                            label1="${oracle.getResourcePlans.PSTAT} ${oracle.getResourcePlans.ACTIVE}${oracle.getResourcePlans.TOP_PLAN}"
                            isLeaf="false">
                     <SetVar name="objectname" value="${oracle.getResourcePlans.PLAN}"/>
                     <SetVar name="plan" value="${oracle.getResourcePlans.PLAN}"/>
                     <SetVar name="planStatus" value="${oracle.getResourcePlans.STATUS}"/>
                     <Command idref="oracle.getResourcePlans">
                        <Input name="plan" value="%"/>
                     </Command>
                     <GroupNode type="ResourcePlanDirectives" label="Resource Plan Directives" isLeaf="false">
                        <DataNode type="ResourcePlanDirective" label="${oracle.getResourcePlanDirectives.GROUP_OR_SUBPLAN}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getResourcePlanDirectives.GROUP_OR_SUBPLAN}"/>
                           <Command idref="oracle.getResourcePlanDirectives">
                              <Input name="plan" value="${plan}"/>
                              <Input name="group_or_subplan" value="%"/>
                           </Command>
                        </DataNode>
                     </GroupNode>
                  </DataNode>
               </GroupNode>
            </GroupNode>
         </If>

         <GroupNode type="Storage" label="Storage" isLeaf="false">
            <If test="#util.isDatabaseVersionGTE(10)">
               <GroupNode type="ASM" label="ASM" isLeaf="false">
                  <GroupNode type="ASMDiskGroups" label="ASM Diskgroups" isLeaf="false">
                     <DataNode type="ASMDiskGroup" label="${oracle.getASMDiskGroups.NAME}" isLeaf="false">
                        <SetVar name="groupnumber" value="${oracle.getASMDiskGroups.GROUP_NUMBER}"/>
                        <SetVar name="groupname" value="${oracle.getASMDiskGroups.NAME}"/>
                        <DataNode type="ASMDisk" label="${oracle.getASMDisks.NAME}" isLeaf="true">
                           <SetVar name="diskname" value="${oracle.getASMDisks.NAME}"/>
                           <Command idref="oracle.getASMDisks">
                              <Input name="groupnumber" value="${groupnumber}"/>
                           </Command>
                        </DataNode>
                        <Command idref="oracle.getASMDiskGroups"/>
                     </DataNode>
                  </GroupNode>
                  <GroupNode type="ASMDisks" label="Available Disks" isLeaf="false">
                     <DataNode type="ASMDisk" label="${oracle.getASMDisks.PATH}" isLeaf="true">
                        <!-- NAME is mostly NULL so use PATH instead for label-->
                        <Command idref="oracle.getASMDisks">
                           <Input name="groupnumber" value="0"/>
                        </Command>
                     </DataNode>
                  </GroupNode>
               </GroupNode>
               <GroupNode type="SegmentAdvisor" label="Segment Advisor" isLeaf="false">
                  <GroupNode type="SegmentAdvisorTasks" label="Tasks" isLeaf="false">
                     <DataNode type="SegmentAdvisorTask" label="${oracle.getSegmentAdvisorTasks.TASK_NAME}" isLeaf="false">
                        <SetVar name="objectname" value="${oracle.getSegmentAdvisorTasks.TASK_NAME}"/>
                        <SetVar name="task_name" value="${oracle.getSegmentAdvisorTasks.TASK_NAME}"/>
                        <Command idref="oracle.getSegmentAdvisorTasks">
                           <Input name="task_name" value="%"/>
                        </Command>
                        <GroupNode type="SegmentAdvisorObjects" label="Objects" isLeaf="false">
                           <DataNode type="SegmentAdvisorObject" label="${oracle.getSegmentAdvisorObjects.OBJECT_ID}"
                                     label1="${oracle.getSegmentAdvisorObjects.TYPE}"
                                     isLeaf="true">
                              <SetVar name="objectname" value="${oracle.getSegmentAdvisorObjects.OBJECT_ID}"/>
                              <Command idref="oracle.getSegmentAdvisorObjects">
                                 <Input name="object_id" value="%"/>
                                 <Input name="task_name" value="${task_name}"/>
                              </Command>
                           </DataNode>
                        </GroupNode>
                        <GroupNode type="SegmentAdvisorParameters" label="Parameters" isLeaf="false">
                           <DataNode type="SegmentAdvisorParameter" label="${oracle.getSegmentAdvisorParameters.PARAMETER_NAME}" isLeaf="true">
                              <SetVar name="objectname" value="${oracle.getSegmentAdvisorParameters.PARAMETER_NAME}"/>
                              <Command idref="oracle.getSegmentAdvisorParameters">
                                 <Input name="parameter_name" value="%"/>
                                 <Input name="task_name" value="${task_name}"/>
                              </Command>
                           </DataNode>
                        </GroupNode>
                     </DataNode>
                  </GroupNode>
               </GroupNode>
            </If>
            <GroupNode type="Tablespaces" label="Tablespaces" isLeaf="false">
               <GroupNode type="PermanentTablespaces" label="Permanent" isLeaf="false">
                  <DataNode type="PermanentTablespace" label="${oracle.getTableSpaces.TABLESPACE_NAME}" isLeaf="false"
                            warnstate="! #dataMap.get('oracle.getTableSpaces.STATUS').equals('ONLINE')"
                            tip="#dataMap.get('oracle.getTableSpaces.STATUS').equals('ONLINE') ? '' : 'Tablespace is offline'">
                     <SetVar name="objectname" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                     <Command idref="oracle.getTableSpaces">
                        <Input name="tablespace" value="%"/>
                        <Input name="contents" value="PERMANENT"/>
                     </Command>
                     <!--The following is needed for DataFile actions-->
                     <SetVar name="tablespace" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                     <DataNode type="PermanentDataFile" label="${oracle.getDataFiles.Name}" isLeaf="true"
                               warnstate="#dataMap.get('oracle.getDataFiles.Status').equals('OFFLINE')"
                               tip="#dataMap.get('oracle.getDataFiles.Status').equals('OFFLINE') ? 'Tablespace is offline' : ''">
                        <SetVar name="objectname" value="${oracle.getDataFiles.Name}"/>
                        <Command idref="oracle.getDataFiles">
                           <Input name="tablespace" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                           <Input name="contents" value="PERMANENT"/>
                        </Command>
                     </DataNode>
                  </DataNode>
               </GroupNode>
               <If test="#util.isDatabaseVersionGTE(8,1)">
                  <GroupNode type="TemporaryTablespaces" label="Temporary" isLeaf="false">
                     <DataNode type="TemporaryTablespace" label="${oracle.getTableSpaces.TABLESPACE_NAME}" isLeaf="false"
                               warnstate="! #dataMap.get('oracle.getTableSpaces.STATUS').equals('ONLINE')"
                               tip="#dataMap.get('oracle.getTableSpaces.STATUS').equals('ONLINE') ? '' : 'Tablespace is offline'">
                        <SetVar name="objectname" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                        <Command idref="oracle.getTableSpaces">
                           <Input name="tablespace" value="%"/>
                           <Input name="contents" value="TEMPORARY"/>
                        </Command>
                        <!--The following is needed for TemporaryFile actions-->
                        <SetVar name="tablespace" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                        <DataNode type="TemporaryTempFile" label="${oracle.getTempFiles.Name}" isLeaf="true"
                                  warnstate="#dataMap.get('oracle.getTempFiles.Status').equals('OFFLINE')"
                                  tip="#dataMap.get('oracle.getTempFiles.Status').equals('OFFLINE') ? 'Tablespace is offline' : ''">
                           <SetVar name="objectname" value="${oracle.getTempFiles.Name}"/>
                           <Command idref="oracle.getTempFiles">
                              <Input name="tablespace" value="${tablespace}"/>
                           </Command>
                        </DataNode>
                     </DataNode>
                  </GroupNode>
               </If>
                <If test="#util.isDatabaseVersionGTE(9)">
                  <GroupNode type="UndoTablespaces" label="Undo" isLeaf="false">
                     <DataNode type="UndoTablespace" label="${oracle.getTableSpaces.TABLESPACE_NAME}" isLeaf="false"
                               warnstate="! #dataMap.get('oracle.getTableSpaces.STATUS').equals('ONLINE')"
                               tip="#dataMap.get('oracle.getTableSpaces.STATUS').equals('ONLINE') ? '' : 'Tablespace is offline'">
                        <SetVar name="objectname" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                        <Command idref="oracle.getTableSpaces">
                           <Input name="tablespace" value="%"/>
                           <Input name="contents" value="UNDO"/>
                        </Command>
                        <!--The following is needed for UndoFile actions-->
                        <SetVar name="tablespace" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                        <DataNode type="UndoDataFile" label="${oracle.getDataFiles.Name}" isLeaf="true"
                                  warnstate="#dataMap.get('oracle.getDataFiles.Status').equals('OFFLINE')"
                                  tip="#dataMap.get('oracle.getDataFiles.Status').equals('OFFLINE') ? 'Tablespace is offline' : ''">
                           <SetVar name="objectname" value="${oracle.getDataFiles.Name}"/>
                           <Command idref="oracle.getDataFiles">
                              <Input name="tablespace" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                              <Input name="contents" value="UNDO"/>
                           </Command>
                        </DataNode>
                     </DataNode>
                  </GroupNode>
               </If>
            </GroupNode>

            <GroupNode type="TablespaceFiles" label="Tablespace Files" isLeaf="false">
               <DataNode type="PermanentDataFile" label="${oracle.getDataFiles.Name}" isLeaf="false">
                  <SetVar name="objectname" value="${oracle.getDataFiles.Name}"/>
                  <!--The following is needed for DataFile actions-->
                  <SetVar name="tablespace" value="${oracle.getDataFiles.Tablespace}"/>
                  <Command idref="oracle.getDataFiles">
                     <Input name="tablespace" value="%"/>
                     <Input name="contents" value="PERMANENT"/>
                  </Command>
                  <DataNode type="PermanentTablespace" label="${oracle.getTableSpaces.TABLESPACE_NAME}" isLeaf="true">
                     <SetVar name="objectname" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                     <Command idref="oracle.getTableSpaces">
                        <Input name="tablespace" value="${oracle.getDataFiles.Tablespace}"/>
                        <Input name="contents" value="PERMANENT"/>
                     </Command>
                  </DataNode>
               </DataNode>
               <If test="#util.isDatabaseVersionGTE(8,1)">
                  <DataNode type="TemporaryTempFile" label="${oracle.getTempFiles.Name}" isLeaf="false">
                     <SetVar name="objectname" value="${oracle.getTempFiles.Name}"/>
                     <!--The following is needed for TempFile actions-->
                     <SetVar name="tablespace" value="${oracle.getTempFiles.Tablespace}"/>
                     <Command idref="oracle.getTempFiles">
                        <Input name="tablespace" value="%"/>
                     </Command>
                     <DataNode type="TemporaryTablespace" label="${oracle.getTableSpaces.TABLESPACE_NAME}" isLeaf="true">
                        <SetVar name="objectname" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                        <Command idref="oracle.getTableSpaces">
                           <Input name="tablespace" value="${tablespace}"/>
                           <Input name="contents" value="TEMPORARY"/>
                        </Command>
                     </DataNode>
                  </DataNode>
               </If>
                <If test="#util.isDatabaseVersionGTE(9)">
                  <DataNode type="UndoDataFile" label="${oracle.getDataFiles.Name}" isLeaf="false">
                     <SetVar name="objectname" value="${oracle.getDataFiles.Name}"/>
                     <!--The following is needed for UndoFile actions-->
                     <SetVar name="tablespace" value="${oracle.getDataFiles.Tablespace}"/>
                     <Command idref="oracle.getDataFiles">
                        <Input name="tablespace" value="%"/>
                        <Input name="contents" value="UNDO"/>
                     </Command>
                     <DataNode type="UndoTablespace" label="${oracle.getTableSpaces.TABLESPACE_NAME}" isLeaf="true">
                        <SetVar name="objectname" value="${oracle.getTableSpaces.TABLESPACE_NAME}"/>
                        <Command idref="oracle.getTableSpaces">
                           <Input name="tablespace" value="${oracle.getDataFiles.Tablespace}"/>
                           <Input name="contents" value="UNDO"/>
                        </Command>
                     </DataNode>
                  </DataNode>
               </If>
            </GroupNode>

            <GroupNode type="RollbackSegments" label="Rollback Segments" isLeaf="false">
               <DataNode type="RollbackSegment" label="${oracle.getRollbackSegments.Name}" isLeaf="true">
                  <SetVar name="objectname" value="${oracle.getRollbackSegments.Name}"/>
                  <Command idref="oracle.getRollbackSegments"/>
               </DataNode>
            </GroupNode>

            <GroupNode type="RedoLogs" label="Redo Logs" isLeaf="false">
               <DataNode type="RedoLog" label="Group-${oracle.getRedoLogGroups.GROUP#}" isLeaf="false">
                  <SetVar name="objectname" value="${oracle.getRedoLogGroups.GROUP#}"/>
                  <Command idref="oracle.getRedoLogGroups"/>
                  <DataNode type="RedoLogMember" label="${oracle.getRedoLogMembers.MEMBER}" isLeaf="true"
                            warnstate="null != #dataMap.get('oracle.getRedoLogMembers.Status') "
                            tip="null != #dataMap.get('oracle.getRedoLogMembers.Status') ? 'Redo log is not in a good state' : ''">
                        <SetVar name="objectname" value="${oracle.getRedoLogMembers.MEMBER}"/>
                        <Command idref="oracle.getRedoLogMembers">
                           <Input name="groupNumber" value="${oracle.getRedoLogGroups.GROUP#}"/>
                        </Command>
                  </DataNode>
               </DataNode>
            </GroupNode>

             <If test="#util.isDatabaseVersionGTE(9)">
               <GroupNode type="Directories" label="Directories">
                  <DataNode type="Directory" label="${oracle.getDirectories.DIRECTORY_NAME}"
                            label1="${oracle.getDirectories.OWNER}"
                            isLeaf="false">
                     <SetVar name="objectname" value="${oracle.getDirectories.DIRECTORY_NAME}"/>
                     <Command idref="oracle.getDirectories">
                        <Input name="directory" value="%"/>
                        <Filter index="OWNER" label="Owner"/>
                     </Command>
                     <DataNode type="DirectoryPrivilege" label="${oracle.getDirectoryPrivileges.GRANTEE}" isLeaf="true">
                        <SetVar name="grantee" value="${oracle.getDirectoryPrivileges.GRANTEE}"/>
                        <SetVar name="dread" value="${oracle.getDirectoryPrivileges.READ}"/>
                        <SetVar name="dwrite" value="${oracle.getDirectoryPrivileges.WRITE}"/>
                        <Command idref="oracle.getDirectoryPrivileges">
                           <Input name="directory" value="${objectname}"/>
                        </Command>
                     </DataNode>
                  </DataNode>
               </GroupNode>
            </If>

            <If test="#util.isDatabaseVersionGTE(11)">
               <GroupNode type="dNFS" label="dNFS" isLeaf="true"/>
            </If>
         </GroupNode>

         <If test="#util.isDatabaseVersionGTE(10,1)">
            <GroupNode type="Scheduler" label="Scheduler" isLeaf="false">
               <GroupNode type="SchedulerJobClasses" label="Job Classes" isLeaf="false">
                  <DataNode type="SchedulerJobClass" label="${oracle.getSchedulerJobClasses.JOB_CLASS_NAME}" isLeaf="true">
                     <SetVar name="objectname" value="${oracle.getSchedulerJobClasses.JOB_CLASS_NAME}"/>
                     <Command idref="oracle.getSchedulerJobClasses">
                        <Input name="job_class_name" value="%"/>
                     </Command>
                  </DataNode>
               </GroupNode>
               <GroupNode type="SchedulerWindows" label="Windows" isLeaf="false">
                  <DataNode type="SchedulerWindow" label="${oracle.getSchedulerWindows.WINDOW_NAME}" isLeaf="true">
                     <SetVar name="objectname" value="${oracle.getSchedulerWindows.WINDOW_NAME}"/>
                     <Command idref="oracle.getSchedulerWindows">
                        <Input name="window_name" value="%"/>
                     </Command>
                  </DataNode>
               </GroupNode>
               <GroupNode type="SchedulerWindowGroups" label="Window Groups" isLeaf="false">
                  <DataNode type="SchedulerWindowGroup" label="${oracle.getSchedulerWindowGroups.WINDOW_GROUP_NAME}" isLeaf="false">
                     <SetVar name="objectname" value="${oracle.getSchedulerWindowGroups.WINDOW_GROUP_NAME}"/>
                     <SetVar name="theGroupName" value="${oracle.getSchedulerWindowGroups.WINDOW_GROUP_NAME}"/>
                     <Command idref="oracle.getSchedulerWindowGroups">
                        <Input name="window_group_name" value="%"/>
                     </Command>
                     <GroupNode type="SchedulerWindowGroupMembers" label="Window Group Members" isLeaf="false">
                        <DataNode type="SchedulerWindowGroupMember" label="${oracle.getSchedulerWindowGroupMembers.WINDOW_NAME}" isLeaf="true">
                           <SetVar name="objectname" value="${oracle.getSchedulerWindowGroupMembers.WINDOW_NAME}"/>
                           <Command idref="oracle.getSchedulerWindowGroupMembers">
                              <Input name="window_group_name" value="${theGroupName}"/>
                              <Input name="window_name" value="%"/>
                           </Command>
                        </DataNode>
                     </GroupNode>
                  </DataNode>
               </GroupNode>
            </GroupNode>
         </If>

         <GroupNode type="Statistics" label="Statistics" isLeaf="false">
            <If test="#util.isDatabaseVersionGTE(10)">
               <GroupNode type="AWR" label="AWR" isLeaf="true"/>
            </If>
            <GroupNode type="InstanceInfo" label="Instance Info" isLeaf="true"/>
            <GroupNode type="InstanceSummary" label="Instance Summary" isLeaf="true"/>
            <GroupNode type="Latches" label="Latches" isLeaf="true"/>
            <GroupNode type="ObjectCount" label="Object Count" isLeaf="true"/>
            <!--<GroupNode type="SystemStatistics" label="System Statistics" isLeaf="true"/>-->
            <GroupNode type="Waits" label="Waits" isLeaf="true"/>
         </GroupNode>

         <GroupNode type="SGA" label="SGA" isLeaf="true"/>
      </GroupNode>

   </ObjectsTreeDef>

   <!-- =================================================================== -->
   <!-- Definition of the database objects views -->
   <!-- =================================================================== -->

   <ObjectsViewDef extends="true">

      <ObjectView type="Schemas">
         <DataView id="generic-schemas-schemas" drop-on-condition="always"/>

         <DataView id="oracle-schemas-schemas" icon="Schemas" label="Schemas" viewer="grid">
            <Command idref="oracle.getSchemas">
               <ProcessDataSet action="renamecolumn" index="TABLE_SCHEM" value="Schema"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Schema" drop-on-condition="always"/>

      <ObjectView type="Tables">
         <DataView id="generic-tables-tables" drop-on-condition="always"/>
         <DataView id="generic-tables-references" drop-on-condition="always"/>

         <DataView id="oracle-tables-tables" icon="Tables" label="Tables" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||OWNER}${object||TABLE_NAME}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||OWNER}${object||TABLE_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||OWNER}${object||TABLE_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP TABLE">
               <Input name="command" value="drop table ${schema||OWNER}${object||TABLE_NAME}"/>
            </Input>

            <Command idref="oracle.getTables">
               <Input name="owner" value="${schema}"/>
               <Input name="temporary" value="N"/>
            </Command>
         </DataView>
         <DataView id="oracle-tables-tablecomments" icon="Comment" label="Table Comments" viewer="grid">
            <Command idref="oracle.getTableComments">
               <Input name="owner" value="${schema}"/>
               <Input name="type" value="TABLE"/>
            </Command>
         </DataView>
         <DataView id="oracle-tables-references" icon="References" label="References" viewer="tables-refs"
                   doclink="/doclink/show-references">
            <Command idref="oracle.getTables">
               <Input name="owner" value="${schema}"/>
               <Input name="temporary" value="N"/>
               <ProcessDataSet action="renamecolumn" index="OWNER" value="TABLE_SCHEM"/>
               <ProcessDataSet action="renamecolumn" index="TABLE_NAME" value="TABLE_NAME"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Table">
         <DataView id="generic-table-info" drop-on-condition="always"/>
         <DataView id="generic-table-grants" drop-on-condition="always"/>
         <DataView id="generic-table-columns" drop-on-condition="always"/>
         <DataView id="generic-table-indexes" drop-on-condition="always"/>
         <!--Have to remove the generic-table-ddl here and use the specific -->
         <!--oracle-table-ddl below. The reason is that the oracle-table-ddl is -->
         <!--enclosed in a condition and cannot be properly evaluated -->
         <DataView id="generic-table-ddl" drop-on-condition="always"/>

         <DataView id="oracle-table-info" icon="Info" label="Info" viewer="form" order-before="0">
            <Command idref="oracle.getTable">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-table-columns" icon="Columns" label="Columns" viewer="grid" order-after="oracle-table-info">
            <Command idref="oracle.getColumns">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-table-grants" icon="Privileges" label="Grants" viewer="grid">
            <Input name="menuItem" value="Script: Revoke grant">
               <Input name="command" value="revoke ${object||PRIVILEGE||||nq} on ${object||OWNER}.${object||OBJECT_NAME} from ${object||GRANTEE}"/>
            </Input>
            <Command idref="oracle.getTablePrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-table-columnscomment" icon="Comment" label="Columns Comment" viewer="grid">
            <Command idref="oracle.getColumnsComment">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-table-indexes" icon="Index" label="Indexes" viewer="grid">
            <Command idref="oracle.getTableIndexes">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <!-- Show all constraints i.e Check, Primary Key, Foreign Key and Unique -->
         <DataView id="oracle-table-constraints" icon="Constraints" label="Constraints" viewer="grid">
            <Command idref="oracle.getTableConstraints">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-table-triggers" icon="Trigger" label="Triggers" viewer="grid">
            <Command idref="oracle.getTriggers">
               <Input name="condition" value="${triggersCondition}"/>
            </Command>
            <DataView id="oracle-table-triggers-source" icon="Source" label="Source" viewer="text">
               <Input name="dataColumn" value="text"/>
               <Input name="formatSQL" value="true"/>

               <Command idref="oracle.getTriggerSource">
                  <Input name="owner" value="${OWNER}"/>
                  <Input name="name" value="${TRIGGER_NAME}"/>
               </Command>
            </DataView>
            <DataView id="oracle-table-triggers-info" icon="Info" label="Info" viewer="node-form"/>
         </DataView>

         <DataView id="oracle-table-dependencies" icon="Info" label="Dependencies" viewer="grid">
            <Command idref="oracle.getTableDependencies">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <If test="#util.isDatabaseVersionGTE(8)">
            <DataView id="oracle-table-ddl" icon="Source" label="DDL" viewer="ddl">
               <Input name="formatSQL" value="true"/>
            </DataView>
         </If>

         <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-table-ddlwithstorage" icon="Source" label="DDL with Storage" viewer="text">
               <Command idref="oracle.getDDL">
                  <Input name="owner" value="${schema}"/>
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="TABLE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL with storage details used to create the object.
</html>
               ]]>
               </Message>
            </DataView>
         </If>

      </ObjectView>

      <ObjectView type="GlobalTempTables">
         <DataView id="oracle-globaltemptables-tables" icon="Tables" label="Tables" viewer="grid">
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||Schema}${object||Table Name}"/>
            </Input>

            <Command idref="oracle.getTables">
               <Input name="owner" value="${schema}"/>
               <Input name="temporary" value="Y"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="TempTable">
         <DataView id="oracle-temptable-info" icon="Info" label="Info" viewer="form">
            <Command idref="oracle.getTable">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-temptable-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="oracle.getColumns">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-temptable-data" icon="Data" label="Data" viewer="table-data" doclink="/doclink/table-data">
            <Message>
               <![CDATA[
<html>
Temp Table data is displayed only when <b>Use a Single Shared Physical Connection</b> is on.
Note also that the <b>ON COMMIT PRESERVE ROWS</b> setting for the table in combination with
the <b>Auto Commit</b> property in DbVisualizer will impact whether table data is displayed.
</html>
               ]]>
            </Message>
         </DataView>

         <DataView id="oracle-temptable-rowcount" icon="RowCount" label="Row Count" viewer="table-rowcount">
            <Message>
               <![CDATA[
<html>
The Row Count for a Temp Table is displayed only when <b>Use a Single Shared Physical Connection</b> is on.
Note also that the <b>ON COMMIT PRESERVE ROWS</b> setting for the table in combination with
the <b>Auto Commit</b> property in DbVisualizer will impact whether the row count is available.<br><br>
</html>
               ]]>
            </Message>
         </DataView>

         <DataView id="oracle-temptable-grants" icon="Privileges" label="Grants" viewer="grid">
            <Input name="menuItem" value="Script: Revoke grant">
               <Input name="command" value="revoke ${object||PRIVILEGE||||nq} on ${object||OWNER}.${object||OBJECT_NAME} from ${object||GRANTEE}"/>
            </Input>
            <Command idref="oracle.getTablePrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-temptable-columnscomment" icon="Comment" label="Columns Comment" viewer="grid">
            <Command idref="oracle.getColumnsComment">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-temptable-indexes" icon="Index" label="Indexes" viewer="grid">
            <Command idref="oracle.getTableIndexes">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <!-- Show all constraints i.e Check, Primary Key, Foreign Key and Unique -->
         <DataView id="oracle-temptable-constraints" icon="Constraints" label="Constraints" viewer="grid">
            <Command idref="oracle.getTableConstraints">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-temptable-dependencies" icon="Info" label="Dependencies" viewer="grid">
            <Command idref="oracle.getTableDependencies">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <If test="#util.isDatabaseVersionGTE(8)">
            <DataView id="oracle-temptable-ddl" icon="Source" label="DDL" viewer="ddl">
               <Input name="formatSQL" value="true"/>
            </DataView>
         </If>

          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-temptable-ddlwithstorage" icon="Source" label="DDL with Storage" viewer="text">
               <Command idref="oracle.getDDL">
                  <Input name="owner" value="${schema}"/>
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="TABLE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL with storage details used to create the object.
</html>
               ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Columns">
         <DataView id="generic-columns-columns" drop-on-condition="always"/>

         <DataView id="oracle-columns-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="oracle.getColumns">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Partitions">
         <DataView id="oracle-partitions-partitions" icon="Partitions" label="Partitions" viewer="grid">
            <Command idref="oracle.getTablePartitions">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Partition">
         <DataView id="oracle-partition-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-partition-sub-partitions" icon="SubPartitions" label="Sub-Partitions" viewer="form">
            <Command idref="oracle.getTableSubPartitions">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${theTableName}"/>
               <Input name="part_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>


      <ObjectView type="SubPartition">
         <DataView id="oracle-subpartition-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="Constraints">
         <DataView id="oracle-constraints-constraints" icon="Constraints" label="Constraints" viewer="grid">
            <Command idref="oracle.getTableConstraints">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Constraint">
         <DataView id="oracle-constraint-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-constraint-columns" icon="Columns" label="Columns" viewer="form">
            <Command idref="oracle.getTableConstraintColumns">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${theTableName}"/>
               <Input name="constraint" value="${objectname}"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-constraint-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL">
                  <Input name="owner" value="${schema}"/>
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="${constraintType}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="RefConstraints">
         <DataView id="oracle-refconstraints-constraints" icon="Constraints" label="Constraints" viewer="grid">
            <Command idref="oracle.getTableReferencedBy">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>
      <ObjectView type="RefConstraint">
         <DataView id="oracle-refconstraint-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-refconstraint-columns" icon="Columns" label="Columns" viewer="form">
            <Command idref="oracle.getTableConstraintColumns">
               <Input name="owner" value="${refSchemaName}"/>
               <Input name="table" value="${refTableName}"/>
               <Input name="constraint" value="${objectname}"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-refconstraint-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL">
                  <Input name="owner" value="${refSchemaName}"/>
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="${constraintType}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Views">
         <DataView id="oracle-views-views" icon="Views" label="Views" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||OWNER}${object||VIEW_NAME}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||OWNER}${object||VIEW_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||OWNER}${object||VIEW_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP VIEW">
               <Input name="command" value="drop view ${schema||OWNER}${object||VIEW_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: COMPILE VIEW">
               <Input name="command" value="alter view ${schema||OWNER}${object||VIEW_NAME} compile"/>
            </Input>
            <Command idref="oracle.getViews">
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
         <DataView id="oracle-views-viewcomments" icon="Comment" label="View Comments" viewer="grid">
            <Command idref="oracle.getViewComments">
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="View">
         <DataView id="oracle-view-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-view-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="oracle.getColumns">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-view-data" icon="Data" label="Data" viewer="table-data" doclink="/doclink/table-data"/>
         <DataView id="oracle-view-rowcount" icon="RowCount" label="Row Count" viewer="table-rowcount"/>
         <DataView id="oracle-view-columnscomment" icon="Comment" label="Columns Comment" viewer="grid">
            <Command idref="oracle.getColumnsComment">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-view-grants" icon="TablePrivileges" label="Grants" viewer="grid">
            <Command idref="getPrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-view-triggers" icon="Trigger" label="Triggers" viewer="form">
            <Command idref="oracle.getTriggers">
               <Input name="condition" value="${triggersCondition}"/>
            </Command>
         </DataView>
         <DataView id="oracle-view-ddl" icon="Source" label="DDL" viewer="ddl">
            <Input name="objectType" value="View"/>
            <Input name="formatSQL" value="true"/>
         </DataView>
      </ObjectView>

      <ObjectView type="MaterializedViews">
         <DataView id="oracle-materializedviews-materializedviews" icon="MaterializedViews" label="Materialized Views" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||OWNER}${object||MVIEW_NAME}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||OWNER}${object||MVIEW_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||OWNER}${object||MVIEW_NAME}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP MATERIALIZED VIEW">
               <Input name="command" value="drop materialized view ${schema||OWNER}${object||MVIEW_NAME}"/>
            </Input>

            <Command idref="oracle.getMaterializedViews">
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="MaterializedView">
         <DataView id="oracle-materializedview-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-materializedview-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="oracle.getColumns">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-materializedview-data" icon="Data" label="Data" viewer="table-data" doclink="/doclink/table-data"/>
         <DataView id="oracle-materializedview-rowcount" icon="RowCount" label="Row Count" viewer="table-rowcount"/>
         <DataView id="oracle-materializedview-indexes" icon="Index" label="Indexes" viewer="grid">
            <Command idref="oracle.getTableIndexes">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-materializedview-grants" icon="Privileges" label="Grants" viewer="grid">
            <Input name="menuItem" value="Script: Revoke grant">
               <Input name="command" value="revoke ${object||PRIVILEGE||||nq} on ${object||OWNER}.${object||OBJECT_NAME} from ${object||GRANTEE}"/>
            </Input>
            <Command idref="oracle.getTablePrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-materializedview-selectsql" icon="Source" label="Select SQL" viewer="text">
            <Input name="formatSQL" value="true"/>
            <Input name="dataColumn" value="query"/>
            <Command idref="oracle.getMaterializedViewSource">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>

          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-materializedview-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL">
                  <Input name="owner" value="${schema}"/>
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="MATERIALIZED_VIEW"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Sequences">
         <DataView id="oracle-sequences-sequences" icon="Sequences" label="Sequences" viewer="grid">
            <Command idref="oracle.getSequences">
               <Input name="owner" value="${schema}"/>
            </Command>
            <Input name="menuItem" value="Script: DROP SEQUENCE">
               <Input name="command" value="drop sequence ${schema||SEQUENCE_OWNER}${object||SEQUENCE_NAME}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="Sequence">
         <DataView id="oracle-sequence-info" icon="Info" label="Info" viewer="node-form"/>
         <If test="#util.isDatabaseVersionGTE(8)">
            <DataView id="oracle-sequence-ddl" icon="Source" label="DDL" viewer="ddl">
               <Input name="objectType" value="Sequence"/>
               <Input name="formatSQL" value="true"/>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Synonyms">
         <DataView id="oracle-synonyms-synonyms" icon="Synonyms" label="Synonyms" viewer="grid">
            <Command idref="oracle.getSynonyms">
               <Input name="owner" value="${schema}"/>
               <Input name="synonymname" value="%"/>
               <Input name="objecttype" value="%"/>
                <ProcessDataSet action="dropcolumn" index="RefObjOwner"/>
                <ProcessDataSet action="dropcolumn" index="RefObjName"/>
            </Command>

            <Message>
               <![CDATA[
<html>
These are the synonyms owned by this schema.
</html>
           ]]>
            </Message>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${object||Synonym Owner}.${object||Synonym Name}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP SYNONYM">
               <Input name="command" value="drop synonym ${object||Synonym Owner}.${object||Synonym Name}"/>
            </Input>
         </DataView>
         <DataView id="oracle-synonyms-synonymedobjects" icon="Synonyms" label="Synonymed Objects" viewer="grid">
            <Command idref="oracle.getSynonymedObjects">
               <Input name="owner" value="${schema}"/>
               <ProcessDataSet action="dropcolumn" index="RefObjOwner"/>
               <ProcessDataSet action="dropcolumn" index="RefObjName"/>
            </Command>
            <Message>
               <![CDATA[
<html>
These are the synonyms owned by other schemas that reference objects in this schema.
</html>
              ]]>
            </Message>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${object||Synonym Owner}.${object||Synonym Name}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP SYNONYM">
               <Input name="command" value="drop synonym ${object||Synonym Owner}.${object||Synonym Name}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="Synonym">
         <DataView id="oracle-synonym-info" icon="Info" label="Info" viewer="node-form"/>
         <If test="#util.isDatabaseVersionGTE(8)">
            <DataView id="oracle-synonym-ddl" icon="Source" label="DDL" viewer="ddl">
               <Input name="objectType" value="Synonym"/>
               <Input name="formatSQL" value="true"/>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Indexes">
         <DataView id="generic-indexes-indexes" drop-on-condition="always"/>

         <DataView id="oracle-indexes-indexes" icon="Indexes" label="Indexes" viewer="grid">
            <Command idref="oracle.getIndexes">
               <Input name="indexOwner" value="${indexOwnerSQL}"/>
               <Input name="table" value="${theTableName}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Index">
         <DataView id="oracle-index-columns" icon="Columns" label="Columns" viewer="form">
            <Command idref="oracle.getIndexColumns">
               <Input name="indexOwner" value="${indexOwner}"/>
               <Input name="indexName" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-index-ddl" icon="Source" label="DDL" viewer="ddl">
            <Input name="objectType" value="Index"/>
            <Input name="formatSQL" value="true"/>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-index-ddlwithstorage" icon="Source" label="DDL with Storage" viewer="text">
               <Command idref="oracle.getDDL">
                  <Input name="owner" value="${indexOwner}"/>
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="INDEX"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="IndexPartitions">
         <DataView id="oracle-indexpartitions-partitions" icon="Partitions" label="Partitions" viewer="grid">
            <Command idref="oracle.getIndexPartitions">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>
      <ObjectView type="IndexPartition">
         <DataView id="oracle-indexpartition-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-indexpartition-sub-partitions" icon="IndexSubPartitions" label="Sub-Partitions" viewer="form">
            <Command idref="oracle.getIndexSubPartitions">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${theIndexName}"/>
               <Input name="part_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>
      <ObjectView type="IndexSubPartition">
         <DataView id="oracle-indexsubpartition-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="Types">
         <DataView id="oracle-types-types" icon="Types" label="Types" viewer="grid">
            <Command idref="oracle.getColumnTypes">
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Type">
         <DataView id="oracle-type-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="Functions">
         <DataView id="oracle-functions-functions" icon="Functions" label="Functions" viewer="grid">
            <Command idref="oracle.getObjectsByType">
               <Input name="owner" value="${schema}"/>
               <Input name="type" value="&#x27;FUNCTION&#x27;"/>
            </Command>
            <Input name="menuItem" value="Script: DROP FUNCTION">
               <Input name="command" value="drop function ${object||OWNER}.${object||OBJECT_NAME}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="Function">
         <DataView classargs="FUNCTION" id="oracle-function-functioneditor" icon="SourceEditor" label="Function Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>
         <DataView id="oracle-function-grants" icon="Privileges" label="Grants" viewer="grid">
            <Input name="menuItem" value="Script: Revoke grant">
               <Input name="command" value="revoke ${object||PRIVILEGE||||nq} on ${object||OWNER}.${object||OBJECT_NAME} from ${object||GRANTEE}"/>
            </Input>
            <Command idref="oracle.getTablePrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Procedures">
         <DataView id="generic-procedures-procedures" drop-on-condition="always"/>

         <DataView id="oracle-procedures-procedures" icon="Procedures" label="Procedures" viewer="grid">
            <Command idref="oracle.getObjectsByType">
               <Input name="owner" value="${schema}"/>
               <Input name="type" value="&#x27;PROCEDURE&#x27;"/>
            </Command>
            <Input name="menuItem" value="Script: DROP PROCEDURE">
               <Input name="command" value="drop procedure ${object||OWNER}.${object||OBJECT_NAME}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="Procedure">
         <DataView id="generic-procedure-columns" drop-on-condition="always"/>

         <DataView id="oracle-procedure-procedureeditor" icon="SourceEditor" label="Procedure Editor" viewer="procedure-editor" classargs="PROCEDURE"
                   doclink="/doclink/edit-code-object"/>

         <DataView id="oracle-procedure-grants" icon="Privileges" label="Grants" viewer="grid">
            <Input name="menuItem" value="Script: Revoke grant">
               <Input name="command" value="revoke ${object||PRIVILEGE||||nq} on ${object||OWNER}.${object||OBJECT_NAME} from ${object||GRANTEE}"/>
            </Input>
            <Command idref="oracle.getTablePrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Triggers">
         <DataView id="oracle-triggers-triggers" icon="Triggers" label="Triggers" viewer="grid">
            <Command idref="oracle.getTriggers">
               <Input name="condition" value="${triggersCondition}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Trigger">
         <DataView classargs="TRIGGER" id="oracle-trigger-triggereditor" icon="SourceEditor" label="Trigger Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>

         <DataView id="oracle-trigger-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="Packages">
         <DataView id="oracle-packages-packages" icon="Packages" label="Packages" viewer="grid">
            <Command idref="oracle.getObjectsByType">
               <Input name="owner" value="${schema}"/>
               <Input name="type" value="&#x27;PACKAGE&#x27;"/>
            </Command>
            <Input name="menuItem" value="Script: DROP PACKAGE">
               <Input name="command" value="drop package ${object||OWNER}.${object||OBJECT_NAME}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="Package">
         <DataView classargs="PACKAGE" id="oracle-package-packagespecificationeditor" icon="SourceEditor" label="Package Specification Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>
         <DataView id="oracle-package-grants" icon="Privileges" label="Grants" viewer="grid">
            <Input name="menuItem" value="Script: Revoke grant">
               <Input name="command" value="revoke ${object||PRIVILEGE||||nq} on ${object||OWNER}.${object||OBJECT_NAME} from ${object||GRANTEE}"/>
            </Input>
            <Command idref="oracle.getTablePrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="PackageBodies">
         <DataView id="oracle-packagebodies-packagebodies" icon="PackageBodies" label="Package Bodies" viewer="grid">
            <Command idref="oracle.getObjectsByType">
               <Input name="owner" value="${schema}"/>
               <Input name="type" value="&#x27;PACKAGE BODY&#x27;"/>
            </Command>
            <Input name="menuItem" value="Script: DROP PACKAGE BODY">
               <Input name="command" value="drop package body ${object||OWNER}.${object||OBJECT_NAME}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="PackageBody">
         <DataView classargs="PACKAGE BODY" id="oracle-packagebody-packagebodyeditor" icon="SourceEditor" label="Package Body Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>

         <DataView id="oracle-packagebody-grants" icon="Privileges" label="Grants" viewer="grid">
            <Input name="menuItem" value="Script: Revoke grant">
               <Input name="command" value="revoke ${object||PRIVILEGE||||nq} on ${object||OWNER}.${object||OBJECT_NAME} from ${object||GRANTEE}"/>
            </Input>
            <Command idref="oracle.getTablePrivileges">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="JavaClasses">
         <DataView id="oracle-javaclasses-javaclasses" icon="JavaClasses" label="Java Classes" viewer="grid">
            <Command idref="oracle.getJavaObjects">
               <Input name="type" value="JAVA CLASS"/>
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="JavaClass">
         <DataView id="oracle-javaclass-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="JavaSources">
         <DataView id="oracle-javasources-javasources" icon="JavaSources" label="Java Sources" viewer="grid">
            <Command idref="oracle.getJavaObjects">
               <Input name="type" value="JAVA SOURCE"/>
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="JavaSource">
         <DataView id="oracle-javasource-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-javasource-source" icon="Source" label="Source" viewer="text">
            <Input name="dataColumn" value="text"/>
            <Command idref="oracle.getJavaSource">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ObjectTypes">
         <DataView id="oracle-objecttypes-objecttypes" icon="ObjectTypes" label="Object Types" viewer="grid">
            <Command idref="oracle.getObjectsByType">
               <Input name="owner" value="${schema}"/>
               <Input name="type" value="&#x27;TYPE&#x27;"/>
            </Command>
            <Input name="menuItem" value="Script: DROP TYPE">
               <Input name="command" value="drop type ${object||OWNER}.${object||OBJECT_NAME}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="ObjectType">
         <DataView classargs="TYPE" id="oracle-objecttype-objecttypeeditor" icon="SourceEditor" label="Object Type Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>

         <DataView id="oracle-objecttype-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-objecttype-attributes" icon="Interface" label="Attributes" viewer="form">
            <Command idref="oracle.getObjectTypeAttributes">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-objecttype-methods" icon="Methods" label="Methods" viewer="form">
            <Command idref="oracle.getObjectTypeMethods">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ObjectTypeBodies">
         <DataView id="oracle-objecttypebodies-objecttypebodies" icon="ObjectTypeBodies" label="Object Type Bodies" viewer="grid">
            <Command idref="oracle.getObjectsByType">
               <Input name="owner" value="${schema}"/>
               <Input name="type" value="&#x27;TYPE BODY&#x27;"/>
            </Command>
            <Input name="menuItem" value="Script: DROP TYPE BODY">
               <Input name="command" value="drop type body ${object||OWNER}.${object||OBJECT_NAME}"/>
            </Input>
         </DataView>
      </ObjectView>

      <ObjectView type="ObjectTypeBody">
         <DataView classargs="TYPE BODY" id="oracle-objecttypebody-objecttypeeditor" icon="SourceEditor" label="Object Type Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>

         <DataView id="oracle-objecttypebody-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-objecttypebody-attributes" icon="Interface" label="Attributes" viewer="form">
            <Command idref="oracle.getObjectTypeAttributes">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-objecttypebody-methods" icon="Methods" label="Methods" viewer="form">
            <Command idref="oracle.getObjectTypeMethods">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="InvalidObjects">
         <DataView id="oracle-invalidobjects-invalidobjects" icon="InvalidObjects" label="Invalid Objects" viewer="grid">
            <Command idref="oracle.getInvalidObjects">
               <Input name="owner" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
These are all objects marked as <b>INVALID</b> in the schema.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Properties">
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-properties-databaseproperties" icon="Properties" label="Database Properties" viewer="grid">
               <Command idref="oracle.getDatabaseProperties"/>
               <Message>
                  <![CDATA[
<html>
This view shows system-wide default values such as the default tablespace and default
temporary tablespace, global database name, time zone, and more
</html>
               ]]>
               </Message>
            </DataView>
            <DataView id="oracle-properties-databaseinitparameters" icon="Properties" label="Initialization Parameters" viewer="grid">
               <Command idref="oracle.getDatabaseInitParameters"/>
               <Message>
                  <![CDATA[
<html>
These are the database initialization parameters.
</html>
               ]]>
               </Message>
            </DataView>
            <DataView id="oracle-properties-sessionproperties" icon="Properties" label="Session NLS Parameters" viewer="grid">
               <Command idref="oracle.getSessionNLSProperties"/>
               <Message>
                  <![CDATA[
<html>
This view shows the NLS parameters for this session.
</html>
               ]]>
               </Message>
            </DataView>
         </If>
         <DataView id="oracle-properties-sessionroles" icon="Roles" label="Session Roles" viewer="grid">
            <Command idref="oracle.getSessionRoles"/>
            <Message>
               <![CDATA[
<html>
These are your granted roles for this session.
</html>
               ]]>
            </Message>
         </DataView>
         <DataView id="oracle-properties-sessionprivileges" icon="Privileges" label="Session Privileges" viewer="grid">
            <Command idref="oracle.getSessionPrivs"/>
            <Message>
               <![CDATA[
<html>
These are your granted privileges for this session.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="RecycleBin">
         <DataView id="oracle-recyclebin-recyclebin" icon="RecycleBin" label="Recycle Bin" viewer="grid">
            <Command idref="oracle.getRecycleBin">
               <Input name="schema" value="${schema}"/>
               <Input name="login_schema" value="${dbvis-defaultCatalogOrSchema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
These are the tables currently in the recycle bin for this schema. Right click on a bin
table in objects tree to restore or permanently purge it.<br>
<b>Note: The recycle bin is always empty if not looking at the bin for your
login schema (default).</b>
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="RecycleBinTable">
         <DataView id="oracle-recyclebintable-recyclebintable" icon="RecycleBinTable" label="Recycle Bin Table" viewer="node-form"/>
         <DataView id="oracle-recyclebintable-data" icon="Data" label="Data" viewer="table-data" doclink="/doclink/table-data"/>
      </ObjectView>

      <ObjectView type="AllRecycleBin">
         <DataView id="oracle-allrecyclebin-recyclebin" icon="AllRecycleBin" label="Recycle Bin" viewer="grid">
            <Command idref="oracle.getAllRecycleBin"/>
            <Message>
               <![CDATA[
<html>
This is the recycle bin for all schemas.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="AllRecycleBinTable">
         <DataView id="oracle-allrecyclebintable-recyclebintable" icon="AllRecycleBinTable" label="Recycle Bin Table" viewer="node-form"/>
         <DataView id="oracle-allrecyclebintable-data" icon="Data" label="Data" viewer="table-data" doclink="/doclink/table-data"/>
      </ObjectView>

      <ObjectView type="Jobs">
         <DataView id="oracle-jobs-jobs" icon="Jobs" label="Jobs" viewer="grid">
            <Command idref="oracle.getJobs">
               <Input name="owner" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
These are all jobs for your login schema.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="Job">
         <DataView id="oracle-job-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="Scheduler">
         <DataView id="oracle-scheduler-schedulerglobalattributes" icon="Info" label="Scheduler Global Attributes" viewer="grid">
            <Command idref="oracle.getSchedulerGlobalAttributes"/>
         </DataView>
         <DataView id="oracle-scheduler-schedulerjobsrunning" icon="Info" label="Scheduler Jobs Running" viewer="grid">
            <Command idref="oracle.getSchedulerJobsRunning">
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerChains">
         <DataView id="oracle-schedulerchains-schedulerchains" icon="Info" label="Scheduler Chains" viewer="grid">
            <Command idref="oracle.getSchedulerChains">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerchains-schedulerchainrules" icon="Info" label="Scheduler Chain Rules" viewer="grid">
            <Command idref="oracle.getSchedulerChainRules">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="%"/>
               <Input name="rule_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerchains-schedulerchainsteps" icon="Info" label="Scheduler Chain Steps" viewer="grid">
            <Command idref="oracle.getSchedulerChainSteps">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="%"/>
               <Input name="step_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerchains-schedulerchainsrunning" icon="Info" label="Scheduler Chains Running" viewer="grid">
            <Command idref="oracle.getSchedulerChainsRunning">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerChain">
         <DataView id="oracle-schedulerchain-schedulerchain" icon="Info" label="Scheduler Chain" viewer="form">
            <Command idref="oracle.getSchedulerChains">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerchain-schedulerchainrules" icon="Info" label="Scheduler Chain Rules" viewer="grid">
            <Command idref="oracle.getSchedulerChainRules">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="${objectname}"/>
               <Input name="rule_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerchain-schedulerchainsteps" icon="Info" label="Scheduler Chain Steps" viewer="grid">
            <Command idref="oracle.getSchedulerChainSteps">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="${objectname}"/>
               <Input name="step_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerChainRules">
         <DataView id="oracle-schedulerchainrules-schedulerchainrules" icon="Info" label="Scheduler Chain Rules" viewer="grid">
            <Command idref="oracle.getSchedulerChainRules">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="${chain_name}"/>
               <Input name="rule_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerChainRule">
         <DataView id="oracle-schedulerchainrule-schedulerchainrule" icon="Info" label="Scheduler Chain Rule" viewer="form">
            <Command idref="oracle.getSchedulerChainRules">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="${chain_name}"/>
               <Input name="rule_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerChainSteps">
         <DataView id="oracle-schedulerchainsteps-schedulerchainsteps" icon="Info" label="Scheduler Chain Steps" viewer="grid">
            <Command idref="oracle.getSchedulerChainSteps">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="${chain_name}"/>
               <Input name="step_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerChainStep">
         <DataView id="oracle-schedulerchainstep-schedulerchainstep" icon="Info" label="Scheduler Chain Step" viewer="form">
            <Command idref="oracle.getSchedulerChainSteps">
               <Input name="owner" value="${schema}"/>
               <Input name="chain_name" value="${chain_name}"/>
               <Input name="step_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>


      <ObjectView type="SchedulerJobs">
         <DataView id="oracle-schedulerjobs-schedulerjobs" icon="Info" label="Scheduler Jobs" viewer="grid">
            <Command idref="oracle.getSchedulerJobs">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerjobs-schedulerjobarguments" icon="Info" label="Scheduler Job Arguments" viewer="grid">
            <Command idref="oracle.getSchedulerJobArguments">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="%"/>
               <Input name="argument_position" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerjobs-schedulerjoblogs" icon="Info" label="Scheduler Job Logs" viewer="grid">
            <Command idref="oracle.getSchedulerJobLogs">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerjobs-schedulerjobrundetails" icon="Info" label="Scheduler Job Run Details" viewer="grid">
            <Command idref="oracle.getSchedulerJobRunDetails">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerjobs-schedulerjobsrunning" icon="Info" label="Scheduler Jobs Running" viewer="grid">
            <Command idref="oracle.getSchedulerJobsRunning">
               <Input name="owner" value="${schema}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerJob">
         <DataView id="oracle-schedulerjob-schedulerjob" icon="Info" label="Scheduler Job" viewer="form">
            <Command idref="oracle.getSchedulerJobs">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerjob-schedulerjoblogs" icon="Info" label="Scheduler Job Logs" viewer="grid">
            <Command idref="oracle.getSchedulerJobLogs">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerjob-schedulerjobrundetails" icon="Info" label="Scheduler Job Run Details" viewer="grid">
            <Command idref="oracle.getSchedulerJobRunDetails">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerJobArguments">
         <DataView id="oracle-schedulerjobarguments-schedulerjobarguments" icon="Info" label="Scheduler Job Arguments" viewer="grid">
            <Command idref="oracle.getSchedulerJobArguments">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="${theJobName}"/>
               <Input name="argument_position" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerJobArgument">
         <DataView id="oracle-schedulerjobargument-schedulerjobargument" icon="Info" label="Scheduler Job Argument" viewer="form">
            <Command idref="oracle.getSchedulerJobArguments">
               <Input name="owner" value="${schema}"/>
               <Input name="job_name" value="${theJobName}"/>
               <Input name="argument_position" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerPrograms">
         <DataView id="oracle-schedulerprograms-schedulerprograms" icon="Info" label="Scheduler Programs" viewer="grid">
            <Command idref="oracle.getSchedulerPrograms">
               <Input name="owner" value="${schema}"/>
               <Input name="program_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerprograms-schedulerprogramarguments" icon="Info" label="Scheduler Program Arguments" viewer="grid">
            <Command idref="oracle.getSchedulerProgramArguments">
               <Input name="owner" value="${schema}"/>
               <Input name="program_name" value="%"/>
               <Input name="argument_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerProgram">
         <DataView id="oracle-schedulerprogram-schedulerprogram" icon="Info" label="Scheduler Program" viewer="form">
            <Command idref="oracle.getSchedulerPrograms">
               <Input name="owner" value="${schema}"/>
               <Input name="program_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerProgramArguments">
         <DataView id="oracle-schedulerprogramarguments-schedulerprogramarguments" icon="Info" label="Scheduler Program Arguments" viewer="grid">
            <Command idref="oracle.getSchedulerProgramArguments">
               <Input name="owner" value="${schema}"/>
               <Input name="program_name" value="${theProgramName}"/>
               <Input name="argument_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerProgramArgument">
         <DataView id="oracle-schedulerprogramargument-schedulerprogramargument" icon="Info" label="Scheduler Program Argument" viewer="form">
            <Command idref="oracle.getSchedulerProgramArguments">
               <Input name="owner" value="${schema}"/>
               <Input name="program_name" value="${theProgramName}"/>
               <Input name="argument_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerSchedules">
         <DataView id="oracle-schedulerschedules-schedulerschedules" icon="Info" label="Scheduler Schedules" viewer="grid">
            <Command idref="oracle.getSchedulerSchedules">
               <Input name="owner" value="${schema}"/>
               <Input name="schedule_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerCredential">
         <DataView id="oracle-schedulercredential-schedulercredential" icon="Info" label="Scheduler Credential" viewer="form">
            <Command idref="oracle.getSchedulerCredentials">
               <Input name="owner" value="${schema}"/>
               <Input name="credential_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerCredentials">
         <DataView id="oracle-schedulercredentials-schedulercredentials" icon="Info" label="Scheduler Credentials" viewer="grid">
            <Command idref="oracle.getSchedulerCredentials">
               <Input name="owner" value="${schema}"/>
               <Input name="credential_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerSchedule">
         <DataView id="oracle-schedulerschedule-schedulerschedule" icon="Info" label="Scheduler Schedule" viewer="form">
            <Command idref="oracle.getSchedulerSchedules">
               <Input name="owner" value="${schema}"/>
               <Input name="schedule_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="DatabaseLinks">
         <DataView id="oracle-databaselinks-databaselinks" icon="DatabaseLinks" label="Database Links" viewer="grid">
            <Command idref="oracle.getDatabaseLinks">
               <Input name="owner" value="${schema}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
These are all database links for your login schema and PUBLIC.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="DatabaseLink">
         <DataView id="oracle-databaselink-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-databaselink-ddl" icon="Source" label="DDL" viewer="text">
            <Command idref="oracle.getDatabaseLinkDDL">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
              ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="dNFS">
         <DataView id="oracle-dnfs-servers" icon="Info" label="Servers" viewer="grid">
            <Command idref="oracle.getDNFSServers"/>
         </DataView>
         <DataView id="oracle-dnfs-files" icon="Info" label="Files" viewer="grid">
            <Command idref="oracle.getDNFSFiles"/>
         </DataView>
         <DataView id="oracle-dnfs-channels" icon="Info" label="Channels" viewer="grid">
            <Command idref="oracle.getDNFSChannels"/>
         </DataView>
         <DataView id="oracle-dnfs-stats" icon="Info" label="Stats" viewer="grid">
            <Command idref="oracle.getDNFSStats"/>
         </DataView>
      </ObjectView>

      <!-- DBA views -->

      <ObjectView type="Users">
         <DataView id="oracle-users-users" icon="Users" label="Users" viewer="grid">
            <Command idref="oracle.getUsers">
               <Input name="user" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="User">
         <DataView id="oracle-user-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-user-tablespacequota" icon="Quota" label="Tablespace Quota" viewer="grid">
            <Command idref="oracle.getTablespaceQuota">
               <Input name="user" value="${objectname}"/>
               <Input name="tablespace" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-user-systemprivileges" icon="Privileges" label="System Privileges" viewer="grid">
            <Command idref="oracle.getGranteePrivileges">
               <Input name="grantee" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-user-tableprivileges" icon="TablePrivileges" label="Table Privileges" viewer="grid">
            <Command idref="oracle.getGranteeTablePrivileges">
               <Input name="grantee" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-user-roles" icon="Roles" label="Roles" viewer="grid">
            <Command idref="oracle.getGranteeRoles">
               <Input name="grantee" value="${objectname}"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(7)">
            <DataView id="oracle-user-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL2">
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="USER"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
         <If test="#util.isDatabaseVersionGTE(8)">
            <DataView id="oracle-user-resourcegroups" icon="ResourceGroups" label="Resource Groups" viewer="grid">
               <Command idref="oracle.getResourceConsumerGroupPrivs">
                  <Input name="grantee" value="${objectname}"/>
                  <Input name="consumer_group" value="%"/>
               </Command>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Roles">
         <DataView id="oracle-roles-roles" icon="Roles" label="Roles" viewer="grid">
            <Command idref="oracle.getRoles"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Role">
         <DataView id="oracle-role-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="oracle-role-systemprivileges" icon="Privileges" label="System Privileges" viewer="grid">
            <Command idref="oracle.getGranteePrivileges">
               <Input name="grantee" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-role-tableprivileges" icon="TablePrivileges" label="Table Privileges" viewer="grid">
            <Command idref="oracle.getGranteeTablePrivileges">
               <Input name="grantee" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-role-roles" icon="Roles" label="Roles" viewer="grid">
            <Command idref="oracle.getGranteeRoles">
               <Input name="grantee" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-role-users" icon="Users" label="Users" viewer="grid">
            <Command idref="oracle.getRoleUsers">
               <Input name="role" value="${objectname}"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-role-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL2">
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="ROLE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Sessions">
         <DataView id="oracle-sessions-sessions" icon="Sessions" label="Sessions" viewer="grid">
            <Command idref="oracle.getSessions">
                  <Input name="INSTANCE_CONDITION" value=""/>
            </Command>
            <Input name="menuItem" value="Script: KILL SESSION">
               <If test="#util.isDatabaseVersionGTE(11)">
                  <!-- alter system kill session '130,620,@1'; -->
                  <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||SERIAL#||||nq},@${object||INST_ID||||nq}&#x27;"/>
               </If>
               <Else>
                 <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||SERIAL#||||nq}&#x27;"/>
               </Else>
            </Input>
         </DataView>
         <DataView id="oracle-sessions-activesessions" icon="Info" label="Active Sessions" viewer="grid">
            <Input name="columnWidth" value="300"/>
            <Command idref="oracle.getActiveSessions">
               <Input name="INSTANCE_CONDITION" value=""/>
            </Command>
            <DataView id="oracle-sessions-activesessions-sql" icon="Source" label="SQL" viewer="text">
               <Input name="formatSQL" value="true"/>
               <Command idref="oracle.getSGASQL">
                  <Input name="address" value="${Address}"/>
                  <Input name="hashvalue" value="${Hash Value}"/>
                  <Input name="INSTANCE_CONDITION" value=""/>
               </Command>
            </DataView>
            <DataView id="oracle-sessions-activesessions-info" icon="Info" label="Info" viewer="node-form"/>
         </DataView>
         <If test="#util.isDatabaseVersionGTE(10,1)">
            <DataView id="oracle-sessions-tracedsessions" icon="Info" label="Traced Sessions" viewer="grid">
               <Command idref="oracle.getTracedSessions">
                   <Input name="INSTANCE_CONDITION" value=""/>
               </Command>
               <Input name="menuItem" value="Script: DISABLE TRACE">
                  <Input name="command" value="begin dbms_monitor.session_trace_disable(session_id =&gt; ${object||SID||||nq}, serial_num =&gt; ${object||SERIAL#||||nq}); end"/>
               </Input>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="Session">
         <DataView id="oracle-session-session" icon="Session" label="Session" viewer="node-form"/>
         <DataView id="oracle-session-activesql" icon="Source" label="Active SQL" viewer="text">
            <Input name="formatSQL" value="true"/>
            <Command idref="oracle.getSGASQL">
               <Input name="address" value="${oracle.getSessions.Address}"/>
               <Input name="hashvalue" value="${oracle.getSessions.Hash Value}"/>
                <Input name="INSTANCE_CONDITION" value="AND INST_ID=${oracle.getSessions.INST_ID}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This is the active SQL for this session.
</html>
                 ]]>
            </Message>
         </DataView>
         <If test="#util.isDatabaseVersionGTE(10)">
            <DataView id="oracle-session-plandata" icon="Plan" label="Plan Data" viewer="text">
               <Input name="newline" value="\n"/>
               <Command idref="oracle.getSGASQLcursor">
                  <Input name="sqlid" value="${oracle.getSessions.SQLid}"/>
                  <Input name="childNumber" value="${oracle.getSessions.ChildNumber}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This is the active SQL with plan data for this session.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
         <DataView id="oracle-session-sessionwait" icon="Session" label="Session Wait" viewer="form">
            <Command idref="oracle.getSessionWait">
               <Input name="sid" value="${oracle.getSessions.SID}"/>
               <Input name="instanceId" value="${oracle.getSessions.INST_ID}"/>
            </Command>
         </DataView>
         <DataView id="oracle-session-sessionevents" icon="Session" label="Session Events" viewer="grid">
            <Command idref="oracle.getSessionEvents">
               <Input name="sid" value="${oracle.getSessions.SID}"/>
               <Input name="instanceId" value="${oracle.getSessions.INST_ID}"/>
            </Command>
         </DataView>
      </ObjectView>
      
       <ObjectView type="SessionsLocal">
         
         <DataView id="oracle-local-sessions" icon="Sessions" label="Sessions" viewer="grid">
            <Command idref="oracle.getSessions">
                <Input name="INSTANCE_CONDITION" value="AND s.inst_id = ${OWN_INSTANCE_NUMBER}"/>
            </Command>
            <Input name="menuItem" value="Script: KILL SESSION">
               <If test="#util.isDatabaseVersionGTE(11)">
                  <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||SERIAL#||||nq},@${object||INST_ID||||nq}&#x27;"/>
               </If>
               <Else>
                 <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||SERIAL#||||nq}&#x27;"/>
               </Else>
            </Input>
         </DataView>

         <DataView id="oracle-local-activesessions" icon="Info" label="Active Sessions" viewer="grid">
            <Input name="columnWidth" value="300"/>
            <Command idref="oracle.getActiveSessions">
               <Input name="INSTANCE_CONDITION" value="AND sess.inst_id = ${OWN_INSTANCE_NUMBER}"/>
            </Command>
            <DataView id="oracle-local-activesessions-sql" icon="Source" label="SQL" viewer="text">
               <Input name="formatSQL" value="true"/>
               <Command idref="oracle.getSGASQL">
                  <Input name="address" value="${Address}"/>
                  <Input name="hashvalue" value="${Hash Value}"/>
                  <Input name="INSTANCE_CONDITION" value="AND INST_ID=${Instance Id}"/>
               </Command>
            </DataView>
            <DataView id="oracle-local-activesessions-info" icon="Info" label="Info" viewer="node-form"/>
         </DataView>
         <If test="#util.isDatabaseVersionGTE(10,1)">
            <DataView id="oracle-local-tracedsessions" icon="Info" label="Traced Sessions" viewer="grid">
               <Command idref="oracle.getTracedSessions">
                  <Input name="INSTANCE_CONDITION" value="AND s.inst_id = ${OWN_INSTANCE_NUMBER}"/>
               </Command>
               <Input name="menuItem" value="Script: DISABLE TRACE">
                  <Input name="command" value="begin dbms_monitor.session_trace_disable(session_id =&gt; ${object||SID||||nq}, serial_num =&gt; ${object||SERIAL#||||nq}); end"/>
               </Input>
            </DataView>
         </If>
      </ObjectView>
      
      <ObjectView type="SessionsNonLocal">
         
         <DataView id="oracle-nonlocal-sessions" icon="Sessions" label="Sessions" viewer="grid">
            <Command idref="oracle.getSessions">
                <Input name="INSTANCE_CONDITION" value="AND s.inst_id != ${OWN_INSTANCE_NUMBER}"/>
            </Command>
            <If test="#util.isDatabaseVersionGTE(11)">
            <Input name="menuItem" value="Script: KILL SESSION">
               <!-- alter system kill session '130,620,@1'; -->
               <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||SERIAL#||||nq},@${object||INST_ID||||nq}&#x27;"/>
            </Input>
             </If>
         </DataView>

         <DataView id="oracle-nonlocal-activesessions" icon="Info" label="Active Sessions" viewer="grid">
            <Input name="columnWidth" value="300"/>
            <Command idref="oracle.getActiveSessions">
               <Input name="INSTANCE_CONDITION" value="AND sess.inst_id != ${OWN_INSTANCE_NUMBER}"/>
            </Command>
            <DataView id="oracle-nonlocal-activesessions-sql" icon="Source" label="SQL" viewer="text">
               <Input name="formatSQL" value="true"/>
               <Command idref="oracle.getSGASQL">
                  <Input name="address" value="${Address}"/>
                  <Input name="hashvalue" value="${Hash Value}"/>
                   <Input name="INSTANCE_CONDITION" value="AND INST_ID=${Instance Id}"/>
               </Command>
            </DataView>
            <DataView id="oracle-nonlocal-activesessions-info" icon="Info" label="Info" viewer="node-form"/>
         </DataView>
         <If test="#util.isDatabaseVersionGTE(10,1)">
            <DataView id="oracle-nonlocal-tracedsessions" icon="Info" label="Traced Sessions" viewer="grid">
               <Command idref="oracle.getTracedSessions">
                  <Input name="INSTANCE_CONDITION" value="AND s.inst_id != ${OWN_INSTANCE_NUMBER}"/>
               </Command>
               <Input name="menuItem" value="Script: DISABLE TRACE">
                  <Input name="command" value="begin dbms_monitor.session_trace_disable(session_id =&gt; ${object||SID||||nq}, serial_num =&gt; ${object||SERIAL#||||nq}); end"/>
               </Input>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="SessionNonLocal">
         <DataView id="oracle-session-non-local-session" icon="Session" label="Session" viewer="node-form"/>
         <DataView id="oracle-session-non-local-activesql" icon="Source" label="Active SQL" viewer="text">
            <Input name="formatSQL" value="true"/>
            <Command idref="oracle.getSGASQL">
               <Input name="address" value="${oracle.getSessions.Address}"/>
               <Input name="hashvalue" value="${oracle.getSessions.Hash Value}"/>
               <Input name="INSTANCE_CONDITION" value="AND INST_ID=${oracle.getSessions.INST_ID}"/>
            </Command>
            <Message>
               <![CDATA[
<html>
This is the active SQL for this session.
</html>
                 ]]>
            </Message>
         </DataView>
         <If test="#util.isDatabaseVersionGTE(10)">
            <DataView id="oracle-session-non-local-plandata" icon="Plan" label="Plan Data" viewer="text">
               <Input name="newline" value="\n"/>
               <Command idref="oracle.getSGASQLcursorRac">
                  <Input name="sqlid" value="${oracle.getSessions.SQLid}"/>
                  <Input name="childNumber" value="${oracle.getSessions.ChildNumber}"/>
                  <Input name="instanceId" value="${oracle.getSessions.INST_ID}"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This is the active SQL with plan data for this session.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
         <DataView id="oracle-session-non-local-sessionwait" icon="Session" label="Session Wait" viewer="form">
            <Command idref="oracle.getSessionWait">
               <Input name="sid" value="${oracle.getSessions.SID}"/>
               <Input name="instanceId" value="${oracle.getSessions.INST_ID}"/>
            </Command>
         </DataView>
         <DataView id="oracle-session-non-local-sessionevents" icon="Session" label="Session Events" viewer="grid">
            <Command idref="oracle.getSessionEvents">
               <Input name="sid" value="${oracle.getSessions.SID}"/>
               <Input name="instanceId" value="${oracle.getSessions.INST_ID}"/>
            </Command>
         </DataView>
      </ObjectView>
      

      <ObjectView type="DataGuard">
         <DataView id="oracle-dataguard-currentdb" icon="Info" label="Current db" viewer="form">
            <Command idref="oracle.getDbRol"/>
         </DataView>
         <If test="#util.isDatabaseVersionGTE(10)">
            <DataView id="oracle-dataguard-dgconfig" icon="Info" label="DG config" viewer="grid">
               <Command idref="oracle.getDGConfig"/>
            </DataView>
         </If>
         <DataView id="oracle-dataguard-archivedestinations" icon="Info" label="Archive Destinations" viewer="grid">
            <Command idref="oracle.getArchDests"/>
         </DataView>
         <DataView id="oracle-dataguard-archivedeststatus" icon="Info" label="Archive Dest Status" viewer="grid">
            <Command idref="oracle.getArchDestStat"/>
         </DataView>
         <DataView id="oracle-dataguard-dgstatus" icon="Info" label="DG Status" viewer="grid">
            <Command idref="oracle.getDGStatus"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Streams">
         <DataView id="oracle-streams-currentdb" icon="Info" label="Current db" viewer="form">
            <Command idref="oracle.getDbRol"/>
         </DataView>
         <DataView id="oracle-streams-archivedestinations" icon="Info" label="Archive Destinations" viewer="grid">
            <Command idref="oracle.getArchDests"/>
         </DataView>
         <DataView id="oracle-streams-archivedeststatus" icon="Info" label="Archive Dest Status" viewer="grid">
            <Command idref="oracle.getArchDestStat"/>
         </DataView>
      </ObjectView>

      <ObjectView type="StreamsCapture">
         <DataView id="oracle-streamscapture-capturestatus" icon="Info" label="Capture Status" viewer="grid">
            <Command idref="oracle.getCaptureStatus"/>
         </DataView>
         <DataView id="oracle-streamscapture-captureparameters" icon="Info" label="Capture Parameters" viewer="grid">
            <Command idref="oracle.getCapParameters"/>
         </DataView>
         <DataView id="oracle-streamscapture-registeredlogs" icon="Info" label="Registered Logs" viewer="grid">
            <Command idref="oracle.getRegisteredLogs"/>
         </DataView>
         <If test="#util.isDatabaseVersionGTE(10)">
            <DataView id="oracle-streamscapture-captureextraattr" icon="Info" label="Capture extra Attr" viewer="grid">
               <Command idref="oracle.getCapExtra"/>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="StreamsApply">
         <DataView id="oracle-streamsapply-applystatus" icon="Info" label="Apply Status" viewer="grid">
            <Command idref="oracle.getApplyStatus"/>
         </DataView>
         <DataView id="oracle-streamsapply-applylatency" icon="Info" label="Apply Latency" viewer="grid">
            <Command idref="oracle.getApplyLat"/>
         </DataView>
         <DataView id="oracle-streamsapply-capture-applylatency" icon="Info" label="Capture-Apply Latency" viewer="grid">
            <Command idref="oracle.getCapApplLat"/>
         </DataView>
         <DataView id="oracle-streamsapply-applyparameters" icon="Info" label="Apply Parameters" viewer="grid">
            <Command idref="oracle.getApplyParameters"/>
         </DataView>
      </ObjectView>

      <ObjectView type="LogicalStandby">
         <DataView id="oracle-logicalstandby-logicalstandbyevents" icon="Info" label="Logical Standby Events" viewer="grid">
            <Command idref="oracle.getLogStbyEvents"/>
         </DataView>
         <DataView id="oracle-logicalstandby-unsupportedobjects" icon="Info" label="Unsupported objects" viewer="grid">
            <Command idref="oracle.getLogNotSupported"/>
         </DataView>
         <DataView id="oracle-logicalstandby-archivegap" icon="Info" label="Archive Gap" viewer="grid">
            <Command idref="oracle.getArchiveGap"/>
         </DataView>
      </ObjectView>

      <ObjectView type="PhysicalStandby">
         <DataView id="oracle-physicalstandby-archivegap" icon="Info" label="Archive Gap" viewer="grid">
            <Command idref="oracle.getArchiveGap"/>
         </DataView>
         <DataView id="oracle-physicalstandby-managedstandbyprocs" icon="Info" label="Managed Standby Procs" viewer="grid">
            <Command idref="oracle.getMgtStbyProcs"/>
         </DataView>
         <DataView id="oracle-physicalstandby-standbylogfiles" icon="Info" label="Standby Log Files" viewer="grid">
            <Command idref="oracle.getStbyLogFiles"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Locks">
         <DataView id="oracle-locks-locks1" icon="Locks" label="Locks 1" viewer="grid">
            <Command idref="oracle.getLocks3">
               <Input name="menuItem" value="Script: KILL SESSION">
                  <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||Serial||||nq}&#x27;"/>
               </Input>
            </Command>
         </DataView>
         <DataView id="oracle-locks-locks2" icon="Locks" label="Locks 2" viewer="grid">
            <Command idref="oracle.getLocks2">
               <Input name="menuItem" value="Script: KILL SESSION">
                  <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||SERIAL#||||nq}&#x27;"/>
               </Input>
            </Command>
         </DataView>
         <DataView id="oracle-locks-blockinglocks" icon="Locks" label="Blocking Locks" viewer="grid">
            <Input name="menuItem" value="Script: KILL SESSION">
               <Input name="command" value="alter system kill session &#x27;${object||SID||||nq},${object||SERIAL#||||nq}&#x27;"/>
            </Input>
            <Command idref="oracle.getBlockingLocks"/>
         </DataView>
      </ObjectView>

      <ObjectView type="SegmentAdvisorTasks">
         <DataView id="oracle-segmentadvisortasks-segmentadvisortasks" icon="SegmentAdvisorTasks" label="Segment Advisor Tasks" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorTasks">
               <Input name="task_name" value="%"/>
            </Command>
            <Message>
               <![CDATA[<html>These are all of the tasks that have been created using DbVisualizer.<br><font color="red">Other tasks will not be displayed!</font></html>]]>
            </Message>
         </DataView>
         <DataView id="oracle-segmentadvisortasks-segmentadvisorlogs" icon="SegmentAdvisorLogs" label="Segment Advisor Logs" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorLog">
               <Input name="task_name" value="%"/>
            </Command>
            <Message>
               <![CDATA[<html>These are all of the task logs that have been created using DbVisualizer.<br><font color="red">Other task logs will not be displayed!</font></html>]]>
            </Message>
         </DataView>
         <DataView id="oracle-segmentadvisortasks-segmentadvisorfindings" icon="SegmentAdvisorFindings" label="Segment Advisor Findings" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorFindings">
               <Input name="task_name" value="%"/>
            </Command>
            <DataView id="oracle-segmentadvisortasks-segmentadvisorfindings-segmentadvisorobject" icon="SegmentAdvisorObject" label="Segment Advisor Object" viewer="form">
               <Command idref="oracle.getSegmentAdvisorObjects">
                  <Input name="object_id" value="${OBJECT_ID}"/>
                  <Input name="task_name" value="${TASK_NAME}"/>
               </Command>
            </DataView>
            <DataView id="oracle-segmentadvisortasks-segmentadvisorfindings-segmentadvisorrecommendations" icon="SegmentAdvisorRecommendation" label="Segment Advisor Recommendations" viewer="form">
               <Command idref="oracle.getSegmentAdvisorRecommendations">
                  <Input name="finding_id" value="${FINDING_ID}"/>
                  <Input name="task_name" value="${TASK_NAME}"/>
               </Command>
            </DataView>
            <Message>
               <![CDATA[<html>These are all of the task findings that have been created using DbVisualizer.<br><font color="red">Other task findings will not be displayed!</font></html>]]>
            </Message>
         </DataView>
         <DataView id="oracle-segmentadvisortasks-segmentadvisorrecommendations" icon="SegmentAdvisorRecommendations" label="Segment Advisor Recommendations" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorRecommendations">
               <Input name="finding_id" value="%"/>
               <Input name="task_name" value="%"/>
            </Command>
            <Message>
               <![CDATA[<html>These are all of the task recommendations that have been created using DbVisualizer.<br><font color="red">Other task recommendations will not be displayed!</font></html>]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="SegmentAdvisorTask">
         <DataView id="oracle-segmentadvisortask-segmentadvisortask" icon="SegmentAdvisorTask" label="Segment Advisor Task" viewer="form">
            <Command idref="oracle.getSegmentAdvisorTasks">
               <Input name="task_name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-segmentadvisortask-segmentadvisorlog" icon="SegmentAdvisorLog" label="Segment Advisor Log" viewer="form">
            <Command idref="oracle.getSegmentAdvisorLog">
               <Input name="task_name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-segmentadvisortask-segmentadvisorfindings" icon="SegmentAdvisorFinding" label="Segment Advisor Findings" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorFindings">
               <Input name="task_name" value="${objectname}"/>
            </Command>
            <DataView id="oracle-segmentadvisortask-segmentadvisorfindings-segmentadvisorobject" icon="SegmentAdvisorObject" label="Segment Advisor Object" viewer="form">
               <Command idref="oracle.getSegmentAdvisorObjects">
                  <Input name="object_id" value="${OBJECT_ID}"/>
                  <Input name="task_name" value="${TASK_NAME}"/>
               </Command>
            </DataView>
            <DataView id="oracle-segmentadvisortask-segmentadvisorfindings-segmentadvisorrecommendations" icon="SegmentAdvisorRecommendation" label="Segment Advisor Recommendations" viewer="form">
               <Command idref="oracle.getSegmentAdvisorRecommendations">
                  <Input name="finding_id" value="${FINDING_ID}"/>
                  <Input name="task_name" value="${TASK_NAME}"/>
               </Command>
            </DataView>
         </DataView>
         <DataView id="oracle-segmentadvisortask-segmentadvisorrecommendations" icon="SegmentAdvisorRecommendation" label="Segment Advisor Recommendations" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorRecommendations">
               <Input name="finding_id" value="%"/>
               <Input name="task_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SegmentAdvisorObjects">
         <DataView id="oracle-segmentadvisorobjects-segmentadvisorobjects" icon="SegmentAdvisorObjects" label="Segment Advisor Objects" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorObjects">
               <Input name="object_id" value="%"/>
               <Input name="task_name" value="${task_name}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SegmentAdvisorObject">
         <DataView id="oracle-segmentadvisorobject-segmentadvisorobject" icon="SegmentAdvisorObject" label="Segment Advisor Object" viewer="form">
            <Command idref="oracle.getSegmentAdvisorObjects">
               <Input name="object_id" value="${objectname}"/>
               <Input name="task_name" value="${task_name}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SegmentAdvisorParameters">
         <DataView id="oracle-segmentadvisorparameters-segmentadvisorparameters" icon="SegmentAdvisorParameters" label="Segment Advisor Parameters" viewer="grid">
            <Command idref="oracle.getSegmentAdvisorParameters">
               <Input name="parameter_name" value="%"/>
               <Input name="task_name" value="${task_name}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SegmentAdvisorParameter">
         <DataView id="oracle-segmentadvisorparameter-segmentadvisorparameter" icon="SegmentAdvisorParameter" label="Segment Advisor Parameter" viewer="form">
            <Command idref="oracle.getSegmentAdvisorParameters">
               <Input name="parameter_name" value="${objectname}"/>
               <Input name="task_name" value="${task_name}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourceManager">
         <DataView id="oracle-resourcemanager-resourceusage" icon="ResourceManager" label="Resource Usage" viewer="grid">
            <Command idref="oracle.getResourceUsage">
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourceConsumerMapping">
         <DataView id="oracle-resourceconsumermapping-resourceconsumergroupmapping" icon="ResourceConsumerMapping" label="Resource Consumer Group Mapping" viewer="grid">
            <Command idref="oracle.getResourceConsumerMapping">
               <Input name="attribute" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourceConsumerGroups">
         <DataView id="oracle-resourceconsumergroups-resourceconsumergroups" icon="ResourceConsumerGroups" label="Resource Consumer Groups" viewer="grid">
            <Command idref="oracle.getResourceConsumerGroups">
               <Input name="consumer_group" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourceConsumerGroup">
         <DataView id="oracle-resourceconsumergroup-resourceconsumergroup" icon="ResourceConsumerGroup" label="Resource Consumer Group" viewer="form">
            <Command idref="oracle.getResourceConsumerGroups">
               <Input name="consumer_group" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-resourceconsumergroup-resourceconsumergroupswitchprivs" icon="Info" label="Resource Consumer Group Switch Privs" viewer="grid">
            <Command idref="oracle.getResourceConsumerGroupPrivs">
               <Input name="consumer_group" value="${objectname}"/>
               <Input name="grantee" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourcePlans">
         <DataView id="oracle-resourceplans-resourceplans" icon="ResourcePlans" label="Resource Plans" viewer="grid">
            <Command idref="oracle.getResourcePlans">
               <Input name="plan" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourcePlan">
         <DataView id="oracle-resourceplan-resourceplan" icon="ResourcePlan" label="Resource Plan" viewer="form">
            <Command idref="oracle.getResourcePlans">
               <Input name="plan" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="oracle-resourceplan-resourceplandirectives" icon="ResourcePlanDirectives" label="Resource Plan Directives" viewer="grid">
            <Command idref="oracle.getResourcePlanDirectives">
               <Input name="plan" value="${plan}"/>
               <Input name="planStatus" value="${planStatus}"/>
               <Input name="group_or_subplan" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourcePlanDirectives">
         <DataView id="oracle-resourceplandirectives-resourceplandirectives" icon="ResourcePlanDirectives" label="Resource Plan Directives" viewer="grid">
            <Command idref="oracle.getResourcePlanDirectives">
               <Input name="plan" value="${plan}"/>
               <Input name="planStatus" value="${planStatus}"/>
               <Input name="group_or_subplan" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ResourcePlanDirective">
         <DataView id="oracle-resourceplandirective-resourceplandirective" icon="ResourcePlanDirective" label="Resource Plan Directive" viewer="form">
            <Command idref="oracle.getResourcePlanDirectives">
               <Input name="plan" value="${plan}"/>
               <Input name="planStatus" value="${planStatus}"/>
               <Input name="group_or_subplan" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Storage">
         <If test="#util.isDatabaseVersionGTE(10)">
            <DataView id="oracle-storage-asmdiskgroups" icon="ASMDiskGroups" label="ASM Diskgroups" viewer="grid">
               <Command idref="oracle.getASMDiskGroups"/>
            </DataView>
         </If>
         <DataView id="oracle-storage-tablespaces" icon="Tablespaces" label="Tablespaces" viewer="grid">
            <Command idref="oracle.getTableSpacesUsage">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-storage-datafiles" icon="Datafiles" label="Data Files" viewer="grid">
            <Command idref="oracle.getDataFiles">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-storage-tempfiles" icon="TemporaryTempfiles" label="Temp Files" viewer="grid">
            <Command idref="oracle.getTempFiles">
               <Input name="tablespace" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-storage-rollbacksegments" icon="RollbackSegments" label="Rollback Segments" viewer="grid">
            <Command idref="oracle.getRollbackSegments"/>
         </DataView>
         <DataView id="oracle-storage-redologs" icon="RedoLogs" label="All Redo Log Files" viewer="grid">
            <Command idref="oracle.getRedoLogs">
               <Input name="member" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-storage-directories" icon="Directories" label="Directories" viewer="grid">
            <Command idref="oracle.getDirectories">
               <Input name="directory" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ASM">
         <DataView id="oracle-asm-asmdiskgroups" icon="ASMDiskGroups" label="ASM Diskgroups" viewer="grid">
            <Message>
               <![CDATA[<html><font color="red">Actions only work if JDBC can connect as sysasm (use 11gr2 jdbc driver or pre 11gR2 ASM instance)</font></html>]]>
            </Message>
            <Command idref="oracle.getASMDiskGroups"/>
         </DataView>
         <DataView id="oracle-asm-asmclients" icon="Info" label="ASM Clients" viewer="grid">
            <Command idref="oracle.getASMClients"/>
         </DataView>
         <DataView id="oracle-asm-usedclient" icon="Info" label="Used Client" viewer="grid">
            <Command idref="oracle.getUsedClient"/>
         </DataView>
      </ObjectView>

      <ObjectView type="ASMDiskGroups">
         <DataView id="oracle-asmdiskgroups-usage" icon="ASMDiskGroups" label="Usage" viewer="grid">
            <Command idref="oracle.getASMDiskGroups"/>
            <Message>
               <![CDATA[<html><font color="red">Actions only work if JDBC can connect as sysasm (or pre 11g)</font></html>]]>
            </Message>
         </DataView>
         <DataView id="oracle-asmdiskgroups-details" icon="ASMDiskGroupsDetails" label="Details" viewer="grid">
            <Command idref="oracle.getASMDiskGroupsDetails"/>
         </DataView>
 
      </ObjectView>

      <ObjectView type="ASMDiskGroup">
         <DataView id="oracle-asmdiskgroup-asmdiskgroup" icon="ASMDiskGroup" label="ASM Diskgroup" viewer="grid">
            <Command idref="oracle.getASMDiskGroup">
               <Input name="groupname" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-asmdiskgroup-asmoperation" icon="ASMDiskGroupOperation" label="ASM Operation" viewer="grid">
            <Command idref="oracle.getASMDiskGroupOperations">
               <Input name="groupname" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-asmdiskgroup-fileinfo" icon="ASMDiskGroupsFiles" label="Files" viewer="grid">
            <Command idref="oracle.getASMDiskGroupFileInfo"/>
         </DataView>
      </ObjectView>

      <ObjectView type="ASMDisk">
         <DataView id="oracle-asmdisk-asmdisk" icon="ASMDisk" label="ASM Disk" viewer="node-form">
            <Command idref="oracle.getASMDisk">
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="ASMDisks">
         <DataView id="oracle-asmdisks-asmdisk" icon="ASMDisk" label="ASM Disk" viewer="grid">
            <Command idref="oracle.getASMDisks">
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Tablespaces">
         <DataView id="oracle-tablespaces-tablespaces" icon="Tablespaces" label="Tablespaces" viewer="grid">
            <Command idref="oracle.getTableSpacesUsage">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-tablespaces-datafileio" icon="Datafile" label="Datafile IO" viewer="grid">
            <Command idref="oracle.getDatafileIO">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-tablespaces-usagebyuser" icon="TablespaceUsers" label="Usage By User" viewer="grid">
            <Command idref="oracle.getTableSpacesUsageByUser">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-tablespaces-objects" icon="TablespaceObjects" label="Objects" viewer="grid">
            <Command idref="oracle.getTablespaceObjects">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="PermanentTablespaces">
         <DataView id="oracle-permanenttablespaces-tablespaces" icon="Tablespaces" label="Tablespaces" viewer="grid">
            <Command idref="oracle.getTableSpacesUsage">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="PERMANENT"/>
            </Command>
         </DataView>
         <DataView id="oracle-permanenttablespaces-datafileio" icon="Datafile" label="Datafile IO" viewer="grid">
            <Command idref="oracle.getDatafileIO">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="PERMANENT"/>
            </Command>
         </DataView>
         <DataView id="oracle-permanenttablespaces-usagebyuser" icon="TablespaceUsers" label="Usage By User" viewer="grid">
            <Command idref="oracle.getTableSpacesUsageByUser">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="PERMANENT"/>
            </Command>
         </DataView>
         <DataView id="oracle-permanenttablespaces-objects" icon="TablespaceObjects" label="Objects" viewer="grid">
            <Command idref="oracle.getTablespaceObjects">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="PERMANENT"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="PermanentTablespace">
         <DataView id="oracle-permanenttablespace-tablespace" icon="Tablespace" label="Tablespace" viewer="node-form"/>
         <DataView id="oracle-permanenttablespace-userquota" icon="Quota" label="User Quota" viewer="grid">
            <Command idref="oracle.getTablespaceQuota">
               <Input name="user" value="%"/>
               <Input name="tablespace" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-permanenttablespace-objects" icon="TablespaceObjects" label="Objects" viewer="grid">
            <Command idref="oracle.getTablespaceObjects">
               <Input name="tablespace" value="${objectname}"/>
               <Input name="contents" value="%"/>
            </Command>
            <Message>
               <![CDATA[
<html>
These are all the objects stored in the tablespace.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="oracle-permanenttablespace-usagebyuser" icon="TablespaceUsers" label="Usage By User" viewer="grid">
            <Command idref="oracle.getTableSpacesUsageByUser">
               <Input name="tablespace" value="${objectname}"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-permanenttablespace-datafiles" icon="TablespaceFiles" label="Datafiles" viewer="grid">
            <Command idref="oracle.getDataFiles">
               <Input name="tablespace" value="${objectname}"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-permanenttablespace-datafileio" icon="Datafile" label="Datafile IO" viewer="grid">
            <Command idref="oracle.getDatafileIO">
               <Input name="tablespace" value="${objectname}"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-permanenttablespace-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL2">
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="TABLESPACE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="TemporaryTablespaces">
         <DataView id="oracle-temporarytablespaces-tablespaces" icon="Tablespaces" label="Tablespaces" viewer="grid">
            <Command idref="oracle.getTableSpacesUsage">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="TEMPORARY"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="TemporaryTablespace">
         <DataView id="oracle-temporarytablespace-tablespace" icon="Tablespace" label="Tablespace" viewer="node-form"/>
         <DataView id="oracle-temporarytablespace-userquota" icon="Quota" label="User Quota" viewer="grid">
            <Command idref="oracle.getTablespaceQuota">
               <Input name="user" value="%"/>
               <Input name="tablespace" value="${objectname}"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-temporarytablespace-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL2">
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="TABLESPACE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="UndoTablespace">
         <DataView id="oracle-undotablespace-tablespace" icon="Tablespace" label="Tablespace" viewer="node-form"/>
         <DataView id="oracle-undotablespace-objects" icon="TablespaceObjects" label="Objects" viewer="grid">
            <Command idref="oracle.getTablespaceObjects">
               <Input name="tablespace" value="${objectname}"/>
               <Input name="contents" value="%"/>
            </Command>
            <Message>
               <![CDATA[
<html>
These are all the objects stored in the tablespace.
</html>
                 ]]>
            </Message>
         </DataView>
         <DataView id="oracle-undotablespace-usagebyuser" icon="TablespaceUsers" label="Usage By User" viewer="grid">
            <Command idref="oracle.getTableSpacesUsageByUser">
               <Input name="tablespace" value="${objectname}"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-undotablespace-datafileio" icon="Datafile" label="Datafile IO" viewer="grid">
            <Command idref="oracle.getDatafileIO">
               <Input name="tablespace" value="${objectname}"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-undotablespace-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL2">
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="TABLESPACE"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="UndoTablespaces">
         <DataView id="oracle-undotablespaces-tablespaces" icon="Tablespaces" label="Tablespaces" viewer="grid">
            <Command idref="oracle.getTableSpacesUsage">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="UNDO"/>
            </Command>
         </DataView>
         <DataView id="oracle-undotablespaces-datafileio" icon="Datafile" label="Datafile IO" viewer="grid">
            <Command idref="oracle.getDatafileIO">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="UNDO"/>
            </Command>
         </DataView>
         <DataView id="oracle-undotablespaces-usagebyuser" icon="TablespaceUsers" label="Usage By User" viewer="grid">
            <Command idref="oracle.getTableSpacesUsageByUser">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="UNDO"/>
            </Command>
         </DataView>
         <DataView id="oracle-undotablespaces-objects" icon="TablespaceObjects" label="Objects" viewer="grid">
            <Command idref="oracle.getTablespaceObjects">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="UNDO"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="TablespaceFiles">
         <DataView id="oracle-tablespacefiles-datafiles" icon="Datafiles" label="Data Files" viewer="grid">
            <Command idref="oracle.getDataFiles">
               <Input name="tablespace" value="%"/>
               <Input name="contents" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-tablespacefiles-tempfiles" icon="TemporaryTempfiles" label="Temp Files" viewer="grid">
            <Command idref="oracle.getTempFiles">
               <Input name="tablespace" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="PermanentDataFile">
         <DataView id="oracle-permanentdatafile-datafile" icon="Datafile" label="Data File" viewer="node-form"/>
         <DataView id="oracle-permanentdatafile-objects" icon="DatafileObjects" label="Objects" viewer="grid">
            <Command idref="oracle.getDatafileObjects">
               <Input name="datafile" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="TemporaryTempFile">
         <DataView id="oracle-temporarytempfile-tempfile" icon="Datafile" label="Temp File" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="UndoDataFile">
         <DataView id="oracle-undodatafile-datafile" icon="Datafile" label="Data File" viewer="node-form"/>
         <DataView id="oracle-undodatafile-objects" icon="DatafileObjects" label="Objects" viewer="grid">
            <Command idref="oracle.getDatafileObjects">
               <Input name="datafile" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="RollbackSegments">
         <DataView id="oracle-rollbacksegments-rollbacksegments" icon="RollbackSegments" label="Rollback Segments" viewer="grid">
            <Command idref="oracle.getRollbackSegments"/>
         </DataView>
      </ObjectView>

      <ObjectView type="RollbackSegment">
         <DataView id="oracle-rollbacksegment-rollbacksegment" icon="RollbackSegment" label="Rollback Segment" viewer="node-form"/>
          <If test="#util.isDatabaseVersionGTE(9)">
            <DataView id="oracle-rollbacksegment-ddl" icon="Source" label="DDL" viewer="text">
               <Command idref="oracle.getDDL2">
                  <Input name="name" value="${objectname}"/>
                  <Input name="type" value="ROLLBACK_SEGMENT"/>
               </Command>
               <Message>
                  <![CDATA[
<html>
This view shows the complete DDL used to create the object.
</html>
                 ]]>
               </Message>
            </DataView>
         </If>
      </ObjectView>

      <ObjectView type="RedoLogs">
         <DataView id="oracle-redologs-redologs" icon="Info" label="All Redo Log Files" viewer="grid">
            <Command idref="oracle.getRedoLogs">
               <Input name="member" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-redologs-redologactivity" icon="Info" label="Redo Log Activity" viewer="grid">
            <Command idref="oracle.getRedoLogActivity"/>
         </DataView>
      </ObjectView>

      <ObjectView type="RedoLog">
         <DataView id="oracle-redolog-redologs" icon="Info" label="Redo Log" viewer="node-form">
         </DataView>
      </ObjectView>
      
      <ObjectView type="RedoLogMember">
         <DataView id="oracle-redolog-redologs-member" icon="Info" label="Redo Log Member" viewer="node-form">
         </DataView>
      </ObjectView>
      

      <ObjectView type="Directories">
         <DataView id="oracle-directories-directories" icon="Directories" label="Directories" viewer="grid">
            <Command idref="oracle.getDirectories">
               <Input name="directory" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Directory">
         <DataView id="oracle-directory-directory" icon="Directory" label="Directory" viewer="form">
            <Command idref="oracle.getDirectories">
               <Input name="directory" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-directory-directoryprivileges" icon="Privileges" label="Directory Privileges" viewer="grid">
            <Command idref="oracle.getDirectoryPrivileges">
               <Input name="directory" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerJobClasses">
         <DataView id="oracle-schedulerjobclasses-schedulerjobclasses" icon="Info" label="Scheduler Job Classes" viewer="grid">
            <Command idref="oracle.getSchedulerJobClasses">
               <Input name="job_class_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerJobClass">
         <DataView id="oracle-schedulerjobclass-schedulerjobclass" icon="Info" label="Scheduler Job Class" viewer="form">
            <Command idref="oracle.getSchedulerJobClasses">
               <Input name="job_class_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerWindows">
         <DataView id="oracle-schedulerwindows-schedulerwindows" icon="Info" label="Scheduler Windows" viewer="grid">
            <Command idref="oracle.getSchedulerWindows">
               <Input name="window_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerwindows-schedulerwindowdetails" icon="Info" label="Scheduler Window Details" viewer="grid">
            <Command idref="oracle.getSchedulerWindowDetails">
               <Input name="window_name" value="%"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerwindows-schedulerwindowlog" icon="Info" label="Scheduler Window Log" viewer="grid">
            <Command idref="oracle.getSchedulerWindowLog">
               <Input name="window_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerWindow">
         <DataView id="oracle-schedulerwindow-schedulerwindow" icon="Info" label="Scheduler Window" viewer="form">
            <Command idref="oracle.getSchedulerWindows">
               <Input name="window_name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerwindow-schedulerwindowdetails" icon="Info" label="Scheduler Window Details" viewer="grid">
            <Command idref="oracle.getSchedulerWindowDetails">
               <Input name="window_name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="oracle-schedulerwindow-schedulerwindowlog" icon="Info" label="Scheduler Window Log" viewer="grid">
            <Command idref="oracle.getSchedulerWindowLog">
               <Input name="window_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerWindowGroups">
         <DataView id="oracle-schedulerwindowgroups-schedulerwindowgroups" icon="Info" label="Scheduler Window Groups" viewer="grid">
            <Command idref="oracle.getSchedulerWindowGroups">
               <Input name="window_group_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerWindowGroup">
         <DataView id="oracle-schedulerwindowgroup-schedulerwindowgroup" icon="Info" label="Scheduler Window Group" viewer="form">
            <Command idref="oracle.getSchedulerWindowGroups">
               <Input name="window_group_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerWindowGroupMembers">
         <DataView id="oracle-schedulerwindowgroupmembers-schedulerwindowgroupmembers" icon="Info" label="Scheduler Window Group Members" viewer="grid">
            <Command idref="oracle.getSchedulerWindowGroupMembers">
               <Input name="window_group_name" value="%"/>
               <Input name="window_name" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SchedulerWindowGroupMember">
         <DataView id="oracle-schedulerwindowgroupmember-schedulerwindow" icon="Info" label="Scheduler Window" viewer="form">
            <Command idref="oracle.getSchedulerWindows">
               <Input name="window_name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="InstanceInfo">
         <DataView id="oracle-instanceinfo-instanceinfo" icon="InstanceInfo" label="Instance Info" viewer="form">
            <Command idref="oracle.getInstanceInfo"/>
            <Message>
               <![CDATA[
<html>
General information about the instance.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="InstanceSummary">
         <DataView id="oracle-instancesummary-instancesummary" icon="InstanceSummary" label="Instance Summary" viewer="grid">
            <Command idref="oracle.getInstanceSummary"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Latches">
         <DataView id="oracle-latches-latches" icon="Latches" label="Latches" viewer="form">
            <Command idref="oracle.getLatches"/>
         </DataView>
      </ObjectView>

      <ObjectView type="ObjectCount">
         <DataView id="oracle-objectcount-objectcount" icon="ObjectCount" label="Object Count" viewer="grid">
            <Command idref="oracle.getObjectsCount1"/>
            <Message>
               <![CDATA[
<html>
Number of objects grouped by owner and object type.
</html>
               ]]>
            </Message>
         </DataView>
      </ObjectView>

      <ObjectView type="SystemStatistics">
         <DataView id="oracle-systemstatistics-systemstatistics" icon="SystemStatistics" label="SystemStatistics" viewer="grid">
            <Command idref="oracle.getSystemStatistics"/>
            <Message>
               <![CDATA[
<html>
System statistics from the <b>sys.aux_stats$</b> table.
</html>
               ]]>
            </Message>

         </DataView>
      </ObjectView>

      <ObjectView type="AWR">
         <DataView id="oracle-awr-awr" icon="AWR" label="AWR" viewer="grid">
            <Command idref="oracle.getAWRHist"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Waits">
         <DataView id="oracle-waits-waits" icon="Waits" label="Waits" viewer="grid">
            <Command idref="oracle.getWaits"/>
         </DataView>
      </ObjectView>

      <ObjectView type="SGA">
         <DataView id="oracle-sga-sga" icon="Info" label="SGA" viewer="grid">
            <Input name="columnWidth" value="300"/>
            <Command idref="oracle.getSGA"/>
            <DataView id="oracle-sga-sga-sql" icon="Source" label="SQL" viewer="text">
               <Input name="formatSQL" value="true"/>
               <Command idref="oracle.getSGASQL">
                  <Input name="address" value="${ADDRESS}"/>
                  <Input name="hashvalue" value="${HASH_VALUE}"/>
                 <Input name="INSTANCE_CONDITION" value="AND INST_ID=${INST_ID}"/>
               </Command>
            </DataView>
            <DataView id="oracle-sga-sga-info" icon="Info" label="Info" viewer="node-form"/>
         </DataView>
         <DataView id="oracle-sga-poorlyperformingsqls" icon="Info" label="Poorly Performing SQL's" viewer="grid">
            <Input name="columnWidth" value="300"/>
            <Command idref="oracle.getPoorSQLs"/>
            <DataView id="oracle-sga-poorlyperformingsqls-sql" icon="Source" label="SQL" viewer="text">
               <Input name="formatSQL" value="true"/>
               <Command idref="oracle.getSGASQL">
                  <Input name="address" value="${ADDRESS}"/>
                  <Input name="hashvalue" value="${HASH_VALUE}"/>
                  <Input name="INSTANCE_CONDITION" value="AND INST_ID=${INST_ID}"/>
               </Command>
            </DataView>
            <DataView id="oracle-sga-poorlyperformingsqls-info" icon="Info" label="Info" viewer="node-form"/>
         </DataView>
         <DataView id="oracle-sga-objectcache" icon="Info" label="Object Cache" viewer="grid">
            <Command idref="oracle.getObjectCache"/>
         </DataView>
      </ObjectView>

   </ObjectsViewDef>

</DatabaseProfile>
