home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / datatl25.zip / DCTDSGN.Z / EWSQDOPD.QRY < prev    next >
Text File  |  1997-09-12  |  2KB  |  75 lines

  1. #NAME#
  2. DA_OraclePhysicalDesignContents
  3. #DESCRIPTION#
  4. The PhysicalDesignContents relationship query returns the names of all Oracle tables, views, indexes, tablespaces and databases which are contained in the specified Oracle physical design.  The query is sorted on the lastUpdate timestamp so you can find the objects which have changed most recently.
  5.  
  6. View type:  DAQOraclePhysicalDesign
  7.  
  8. Modifications:
  9. The query uses a SQL UNION clause to provide a more compact and readable table. In order to change the search criteria, you must change it for each subselect statement in the UNION.  Change the search criteria of the Physical Design name using the = (equals), IN or LIKE elements in the SQL WHERE clause.  
  10.  
  11. In order to provide unique  names, the PhysicalDesign name has the format <>RelationalDesignName:PhysicalDesignName<variation:revision>
  12. To locate a Physical Design name used in multiple Relational Designs, use the LIKE clause with % after the first two angle brackets and before the colon.
  13. #MODIFIED#
  14.  
  15. #VERSION#
  16.  
  17. #SQL STATEMENT#
  18. --DA_OraclePhysicalDesignContents
  19. SELECT
  20.   d.oraclePhysicalDesign,
  21.   t.oracleTable as objectName,
  22.   'Table' as partType,
  23.   p.lastUpdate,
  24.   p.addDate
  25. FROM 
  26.   DAQOraclePhysicalDesign d,
  27.   (d.oracleTable) t,
  28.   PartView p
  29. WHERE
  30.   d.oraclePhysicalDesign LIKE '<>%:%' AND
  31.   t.oracleTable=p.baseName
  32. UNION
  33. SELECT
  34.   d.oraclePhysicalDesign,
  35.   ts.oracleTablespace as objectName,
  36.   'Tablespace' as partType,
  37.   p.lastUpdate,
  38.   p.addDate
  39. FROM 
  40.   DAQOraclePhysicalDesign d,
  41.   (d.oracleTablespace) ts,
  42.   PartView p
  43. WHERE
  44.   d.oraclePhysicalDesign LIKE '<>%:%' AND
  45.   ts.oracleTablespace=p.baseName
  46. UNION
  47. SELECT
  48.   d.oraclePhysicalDesign,
  49.   v.oracleView as objectName,
  50.   'View' as partType,
  51.   p.lastUpdate,
  52.   p.addDate
  53. FROM 
  54.   DAQOraclePhysicalDesign d,
  55.   (d.oracleView) v,
  56.   PartView p
  57. WHERE
  58.   d.oraclePhysicalDesign LIKE '<>%:%' AND
  59.   v.oracleView=p.baseName
  60. UNION
  61. SELECT
  62.   d.oraclePhysicalDesign,
  63.   i.oracleIndex as objectName,
  64.   'Index' as partType,
  65.   p.lastUpdate,
  66.   p.addDate
  67. FROM 
  68.   DAQOraclePhysicalDesign d,
  69.   (d.oracleIndex) i,
  70.   PartView p
  71. WHERE
  72.   d.oraclePhysicalDesign LIKE '<>%:%' AND
  73.   i.oracleIndex=p.baseName
  74. ORDER BY 4 DESC;
  75.