Clarify & DovetailSchema 101<br />a webinar<br />presented by garysherman<br />May 17, 2011<br />
Me<br />dovetailsoftware.com/blog/gsherman<br />
Topics<br />Schema Concepts<br />Viewing your Schema<br />Editing Your Schema<br />Tools<br />Schema Customization<br />Ti...
Schema concepts<br />
Data Model<br />A data model explicitly determines the structure of data or structured data.<br />http://en.wikipedia.org/...
In Clarify, we use the term Data Model or Schema to refer to the definition of our database structure.<br />
Database Structures<br />Tables (Objects)<br />Fields (Columns)<br />Relations<br />Indexes<br />Views<br />	View Fields<b...
Metadata<br />“data about data”<br />OR<br />“data about the containers of data”<br />http://en.wikipedia.org/wiki/Metadat...
Database Metadata<br />Each relational database system has its own mechanisms for storing metadata. <br />Examples of rela...
ADP (ADaPter) Layer<br />Metadata defining the Clarify schema<br />Set of tables in the Clarify database which contain “da...
ADP Data Used by<br />Clarify applications<br />Clarify Client<br />UI Editor<br />CB Toolkit<br />cbbatch<br />…<br />Cla...
ADP Data Used by<br />Dovetail SDK<br />Dovetail Applications<br />	Agent<br />	Mobile<br />	Rulemanager<br />	Seeker<br /...
Database structures and ADP data must remain in sync!<br />This is why we need schema editing tools.We’ll get into tools i...
Database Structures<br />
Tables<br />A Table<br />	is an entity encompassing a single concept<br />Has many fields (columns)<br />	which are the at...
Table Indexes<br />A Table<br />Can have one or more indexes<br />	which improve database performance<br />	or defines uni...
Table - IDs<br />A Table<br />	Has a unique id number<br />
Table - Rows<br />Each row in a table<br />	Has a unique key (objid). Unique within table.<br />	May also have a GUID.<br />
Views<br />A View<br />	is an “virtual table” composed of the result set of a query<br />Has many view fields (view column...
Theory is nice, but…<br />In theory, the complexity and actual implementation of the schema is abstracted away from you. <...
Viewing your schema<br />
Viewing your schema<br />Database vendor tools (not so great)<br />Clarify Data Dictionary Guide<br />Clarify Data Models ...
ERDs<br />Entity-Relationship Diagrams can be useful.<br />
Some ERDs are OK…<br />
…some will hurt your eyes<br />
Dovetail BOLT<br />A better way.<br />Web application for real-time viewing of your schema.<br />Never out of date<br />In...
Let’s take a quick look at BOLT<br />
“I gotta get me some of that BOLT goodness”<br />Download for free: http://bit.ly/getBOLT<br />
EDITING your schema<br />
Why do I need a schema tool?<br />Recall from earlier:<br />	Database structures and ADP data must remain in sync!<br />So...
When adding a new column to  table:<br />Physical ChangeAdd column to table<br />Metadata ChangeAdd data to ADP<br />
Schema Editing Tools<br />Clarify DD Editor (Data Dictionary Editor)<br />Clarify ddcomp (Data Dictionary Compiler)<br />A...
Clarify DD Editor (DDE)<br />User Interface – which some people like<br />Big differences depending on Clarify version<br />
Clarify DD Editor (DDE)<br />Older versions<br />	add a new column or view column using UI<br />	else, edit schema file, a...
Clarify DD Editor (DDE)<br />Not very good at telling you specifics if something is wrong<br />Invalid syntax in schema fi...
Clarify ddcomp<br />ddcomp is a command line application<br />Have to use a schema file<br />Better at reporting syntax er...
ddcomp vs. DD Editor<br />My recommendation: <br />	use ddcomp rather than DD Editor<br />
Amdocs Schema Manager<br />Introduced in Amdocs 6 (Clarify 13)<br />Command line, Java application<br />Replaces ddcomp<br...
Dovetail SchemaEditor<br />Command line, .NET application<br />Works with any Clarify version<br />Schema files are XML<br...
Dovetail SchemaEditor<br />Faster<br />“I have used both the Dovetail SchemaEditor and Amdocs SchemaManager to add one new...
Dovetail SchemaEditor<br />Faster<br />
Dovetail SchemaEditor<br />Faster<br />Actual customer stats (Micros Systems)<br />
Dovetail SchemaEditor<br />Faster<br />Actual customer stats<br />
Dovetail SchemaEditor<br />Why is it Faster?<br />It doesn’t do unnecessary work.<br />
Add a new column to table_case<br />OMG!<br />
Dovetail SchemaEditor<br />Schema Files<br />Data Dictionary – complete schema<br />SchemaScript – just the changes you wa...
SchemaScript<br /><schemaScriptxmlns="http://www.dovetailsoftware.com/2006/10/SchemaScript.xsd"><br />  <addColumnname="x_...
Customizing Your Schema<br />SchemaScript in Action<br />
Let customize with Dovetail SchemaEditor and SchemaScript<br />
Tips<br />
A few big ones<br />Give yourself a restore point!<br />Preview changes before apply!<br />Dev, then test, then production...
Table/View IDs<br />The valid range for new table and view ids is 430-571 and 2000-4999. <br />This prevents any conflicts...
Custom Fields<br />Use of x_ prefix<br />My $0.02:<br />Use x_prefix for custom fields on baseline tables<br />I don’t use...
Generating a Clarify Schema File<br />Can’t generate a schema file using ddcomp<br />Can use DD Editor(but you’ve probably...
Mark your custom schema as User Defined<br />Clarify ddcomp (.SCH):<br />USER_DEFINED<br />Amdocs SchemaManager (XML):<br ...
Schema Files<br />Use source code control for your schema files!<br />
SchemaEditor Reports<br />Check in your scripts & reports<br />Great for auditing & compliance<br />SchemaDifferenceReport...
Indexes<br />Performance Indexes should be part of dbtune.sql – not the schema<br />
Custom Tables<br />All objects are required to have an OBJID field, with GEN_FIELD_ID=3.<br />
Additional Tips – Clarify schema files<br />Customer Fields must appear after all Clarify Fields for that object.<br />Do ...
Additional Tips – Clarify schema files<br />Customer Relations must appear after all Clarify Relations for that object.<br...
</tips><br />
presentation<br />demonstration<br />postlude<br />q & a<br />drink beer<br />
Postlude<br />More Info on Dovetail SchemaEditor<br />http://dovetal.es/dtSchema <br />More Info (and free download) for D...
Interested in Schema 201?<br />I’m considering doing a Schema 201 webinar<br /><ul><li>SQL Views
Database Flags
Upcoming SlideShare
Loading in …5
×

Schema webinar

2,216 views

Published on

Schema 101 Webinar

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,216
On SlideShare
0
From Embeds
0
Number of Embeds
221
Actions
Shares
0
Downloads
22
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • I am the VP of productsWorking in Clarify for 15 years2 years as a customer, 4 years at Clarify as a Principal Consultant, 9 years here at DovetailI love sharing my knowledge of all things ClarifyMy blog at dovetailsoftware.comI actively participate in the Clarify forum on IT Toolbox
  • For the Clarify schema, we’re really talking about the 2nd: “data about the containers of data”
  • Clarify used to refer to tables as Objects. Fine in 1990. Not so good when we got into OO development.
  • Case_creation_time = non-unique, performance indexcase_index = id_number (case object).name_index = first_name:last_name:phone (contact object).Typically only unique indexes which affect application behavior are stored in ADP. Not perf indexes.
  • It is used internally by the Clarify meta data.It is also used by some database objects to describe which object is being referenced (prop_name).Clarify uses object numbers in the range 0 - 429, and 5000 - 9999.The range of legal numbers for customer-defined objects is 430 - 511, and 2000 - 4999.POMS orders table access in transactions using the object number in order to prevent deadlocks. Always access the condition object first.
  • GUID – are present in newer Amdocs versions, such as 7.5GUID = Globally unique identifierGUIDS arent actually globally unique in Amdocs. Blurg.
  • Views can provide advantages over tables:Views can represent a subset of the data contained in a tableViews can join and simplify multiple tables into a single virtual tableViews can act as aggregated tables, where the database engine aggregates data (sum, average etc.) and presents the calculated results as part of the dataViews can hide the complexity of data; for example a view could appear as Sales2000 or Sales2001, transparently partitioning the actual underlying tableViews take very little space to store; the database contains only the definition of a view, not a copy of all the data it presentsDepending on the SQL engine used, views can provide extra securityViews can limit the degree of exposure of a table or tables to the outer worldhttp://en.wikipedia.org/wiki/Database_view
  • Why? Reporting, interfaces, debugging
  • Db admin tool – shows you the physical, but not the ADP infoData Dictionary Guide is out of dateSchema file is difficult to navigate Report – may or may not be currentDovetail XML file – good for computers – not for humansBOLT is the clear winner here. And it’s free!
  • ADP ERD
  • Account manager ERD
  • There’s other minor stuff:Drop/create/grant csp_get_{table} stored procedureMay need to initialize the column
  • Still have to use a schema file for many changes (add a join, add a table, add a relation)
  • Command line = good for automationI’ve seen some versions where db errors bubble up as “(null) (null)”
  • differences in actual processing and results between DDE and ddcomp
  • Command line = good for automationMore efficient than ddcomp
  • Command line = good for automationschemaEditor files are all written as valid XML. This means that industry standard tools and editors can be used for editing these files. Dovetail provides XSD (XML Schema Definition) files, which allows schema files to be validated for proper syntax before any database connection is even made. In addition, XSD files can be used with XML editors to provide intellisense, making editing schema files easy for developers. All of this results in improved developer productivity.
  • Let me give you a couple specific examples
  • Only necessary changes to the database are applied, and changes are made using native syntax that is optimal for the database platform in use. As an example of this, when adding a column using other tools, a temp table is often created, all of the data is moved to this temp table, the original table is dropped, then re-created with the new column, the data is copied back into the new table, and then the temp table is dropped. All of this is highly inefficient and can require substantial storage for all of the moving around of the data. SchemaEditor simply performs an “alter table” command, which adds a new column in-place, without moving data. This results in quicker changes, less downtime, and fewer concerns about running out of space in your database.Index PreservationA common issue with other schema-editing tools is their unanticipated side effects. For example, it’s common that database indexes are mysteriously dropped when making schema changes. In most cases, this isn’t known or discovered until users report poor performance from the application, and forces developers to investigate. All of this results in wasted time and productivity. Dovetail SchemaEditor preserves existing indexes, eliminating this wasteful scenario.
  • I’ll show an example using schemascript
  • SchemaScript is a capability only found in Dovetail SchemaEditor. SchemaScript is a simple, imperative way of specifying the changes to be made to the database schema. A complete Clarify schema file, because of its size and complexity, can quickly become unwieldy and cumbersome to work with. SchemaScript simplifies the process of schema changes by allowing a user to specify only the changes to be made, as opposed to the complete schema.The simple, intuitive style of SchemaScript improves developer productivity and reduces the time to craft schema edits.
  • Break to demo here
  • Restore point: DB backup, point-in-time recovery, flashback recovery, etc. Your DBA should be able to offer guidance as to the easiest/quickest way to get you back to that point.
  • This becomes important for Clarify upgrades.Fields, Relations, TablesIt also is useful to “extract” custom schema. Reverse SchemaScript.
  • Generic Field IDs are something we’ll cover in Schema 201Discuss: just last week, ran into a customer’s schema that had a custom table w/out an objid column. Not good.
  • Lets checkpoint where we are
  • Thanks!
  • Schema webinar

    1. 1. Clarify & DovetailSchema 101<br />a webinar<br />presented by garysherman<br />May 17, 2011<br />
    2. 2. Me<br />dovetailsoftware.com/blog/gsherman<br />
    3. 3. Topics<br />Schema Concepts<br />Viewing your Schema<br />Editing Your Schema<br />Tools<br />Schema Customization<br />Tips<br />Q&A<br />
    4. 4. Schema concepts<br />
    5. 5. Data Model<br />A data model explicitly determines the structure of data or structured data.<br />http://en.wikipedia.org/wiki/Data_model<br />
    6. 6. In Clarify, we use the term Data Model or Schema to refer to the definition of our database structure.<br />
    7. 7. Database Structures<br />Tables (Objects)<br />Fields (Columns)<br />Relations<br />Indexes<br />Views<br /> View Fields<br /> Joins<br />
    8. 8. Metadata<br />“data about data”<br />OR<br />“data about the containers of data”<br />http://en.wikipedia.org/wiki/Metadata#Database_management<br />
    9. 9. Database Metadata<br />Each relational database system has its own mechanisms for storing metadata. <br />Examples of relational-database metadata include:<br />Tables of all tables in a database, their names, sizes and number of rows in each table.<br />Tables of columns in each database, what tables they are used in, and the type of data stored in each column.<br />http://en.wikipedia.org/wiki/Metadata#Database_management<br />
    10. 10. ADP (ADaPter) Layer<br />Metadata defining the Clarify schema<br />Set of tables in the Clarify database which contain “data about the containers of data”<br />These table names all start with adp_<br />
    11. 11. ADP Data Used by<br />Clarify applications<br />Clarify Client<br />UI Editor<br />CB Toolkit<br />cbbatch<br />…<br />Clarify / Amdocs APIs<br />C APIs<br />ClearBasic<br />CBOs (Clarify Business Objects)<br />
    12. 12. ADP Data Used by<br />Dovetail SDK<br />Dovetail Applications<br /> Agent<br /> Mobile<br /> Rulemanager<br /> Seeker<br /> …<br />
    13. 13. Database structures and ADP data must remain in sync!<br />This is why we need schema editing tools.We’ll get into tools in just a bit.<br />
    14. 14. Database Structures<br />
    15. 15. Tables<br />A Table<br /> is an entity encompassing a single concept<br />Has many fields (columns)<br /> which are the attributes of the entity<br />Can have one or more relations<br /> which link entities together<br />
    16. 16. Table Indexes<br />A Table<br />Can have one or more indexes<br /> which improve database performance<br /> or defines uniqueness<br />Note: Not all indexes are stored in the ADP tables. <br />
    17. 17. Table - IDs<br />A Table<br /> Has a unique id number<br />
    18. 18. Table - Rows<br />Each row in a table<br /> Has a unique key (objid). Unique within table.<br /> May also have a GUID.<br />
    19. 19. Views<br />A View<br /> is an “virtual table” composed of the result set of a query<br />Has many view fields (view columns)<br /> which contain data from the table used in the query<br />Can have one or more joins<br /> which combines rows from two tables<br />
    20. 20. Theory is nice, but…<br />In theory, the complexity and actual implementation of the schema is abstracted away from you. <br />But, in reality – you’re gonna want to understand how it all works.<br />
    21. 21. Viewing your schema<br />
    22. 22. Viewing your schema<br />Database vendor tools (not so great)<br />Clarify Data Dictionary Guide<br />Clarify Data Models Doc (ERDs)<br />Clarify schema file (.sch or .xml)<br />Report that generates a Data Dictionary Guide<br />Dovetail schema file (xml)<br />Dovetail BOLT<br />
    23. 23. ERDs<br />Entity-Relationship Diagrams can be useful.<br />
    24. 24. Some ERDs are OK…<br />
    25. 25. …some will hurt your eyes<br />
    26. 26. Dovetail BOLT<br />A better way.<br />Web application for real-time viewing of your schema.<br />Never out of date<br />Includes your customizations<br />
    27. 27. Let’s take a quick look at BOLT<br />
    28. 28. “I gotta get me some of that BOLT goodness”<br />Download for free: http://bit.ly/getBOLT<br />
    29. 29. EDITING your schema<br />
    30. 30. Why do I need a schema tool?<br />Recall from earlier:<br /> Database structures and ADP data must remain in sync!<br />So we need a tool that will do the right thing, and keep both in sync.<br />
    31. 31. When adding a new column to table:<br />Physical ChangeAdd column to table<br />Metadata ChangeAdd data to ADP<br />
    32. 32. Schema Editing Tools<br />Clarify DD Editor (Data Dictionary Editor)<br />Clarify ddcomp (Data Dictionary Compiler)<br />Amdocs Schema Manager<br />Dovetail SchemaEditor<br />
    33. 33. Clarify DD Editor (DDE)<br />User Interface – which some people like<br />Big differences depending on Clarify version<br />
    34. 34. Clarify DD Editor (DDE)<br />Older versions<br /> add a new column or view column using UI<br /> else, edit schema file, apply using DDE<br />Later versions<br /> really just a UI wrapper for ddcomp<br />
    35. 35. Clarify DD Editor (DDE)<br />Not very good at telling you specifics if something is wrong<br />Invalid syntax in schema file<br />Validation step failed during database validation<br />Error occurred when applying changes<br />
    36. 36. Clarify ddcomp<br />ddcomp is a command line application<br />Have to use a schema file<br />Better at reporting syntax errors<br />Better at reporting database errors (sometimes)<br />
    37. 37. ddcomp vs. DD Editor<br />My recommendation: <br /> use ddcomp rather than DD Editor<br />
    38. 38. Amdocs Schema Manager<br />Introduced in Amdocs 6 (Clarify 13)<br />Command line, Java application<br />Replaces ddcomp<br />Requires CBO (Clarify Business Objects)<br />Schema files are XML<br />
    39. 39. Dovetail SchemaEditor<br />Command line, .NET application<br />Works with any Clarify version<br />Schema files are XML<br />Intellisense & Validation for your schema files<br />User_Defined is the default<br />
    40. 40. Dovetail SchemaEditor<br />Faster<br />“I have used both the Dovetail SchemaEditor and Amdocs SchemaManager to add one new field to the schema.<br />Using our test database, Dovetail SchemaEditor took 5 minutes to complete, and Amdocs SchemaManager took 50 minutes.” <br /> - KS, Micros Systems<br />
    41. 41. Dovetail SchemaEditor<br />Faster<br />
    42. 42. Dovetail SchemaEditor<br />Faster<br />Actual customer stats (Micros Systems)<br />
    43. 43. Dovetail SchemaEditor<br />Faster<br />Actual customer stats<br />
    44. 44. Dovetail SchemaEditor<br />Why is it Faster?<br />It doesn’t do unnecessary work.<br />
    45. 45. Add a new column to table_case<br />OMG!<br />
    46. 46. Dovetail SchemaEditor<br />Schema Files<br />Data Dictionary – complete schema<br />SchemaScript – just the changes you want to make<br />
    47. 47. SchemaScript<br /><schemaScriptxmlns="http://www.dovetailsoftware.com/2006/10/SchemaScript.xsd"><br /> <addColumnname="x_test" table="case" dataType="Integer" /><br /></schemaScript><br />This is a completeschemascript file<br />
    48. 48. Customizing Your Schema<br />SchemaScript in Action<br />
    49. 49. Let customize with Dovetail SchemaEditor and SchemaScript<br />
    50. 50. Tips<br />
    51. 51. A few big ones<br />Give yourself a restore point!<br />Preview changes before apply!<br />Dev, then test, then production!<br />
    52. 52. Table/View IDs<br />The valid range for new table and view ids is 430-571 and 2000-4999. <br />This prevents any conflicts with existing or future Clarify defined id numbers.<br />How do I know which ones are in use?BOLT will tell you: http://localhost/bolt/schema_id_info.asp<br />
    53. 53. Custom Fields<br />Use of x_ prefix<br />My $0.02:<br />Use x_prefix for custom fields on baseline tables<br />I don’t use x_ when adding custom view columns<br />I don’t use x_ for custom table names, but I do tend to use a customer/company prefix<br />
    54. 54. Generating a Clarify Schema File<br />Can’t generate a schema file using ddcomp<br />Can use DD Editor(but you’ve probably already figured out I don’t like DD Editor)<br />Use dataex<br />dataex –gen_sc MySchema.sch<br />
    55. 55. Mark your custom schema as User Defined<br />Clarify ddcomp (.SCH):<br />USER_DEFINED<br />Amdocs SchemaManager (XML):<br />baseline = "false"<br />Dovetail SchmaEditor (XML):<br />isUserDefined = "true"<br />This is the default<br />
    56. 56. Schema Files<br />Use source code control for your schema files!<br />
    57. 57. SchemaEditor Reports<br />Check in your scripts & reports<br />Great for auditing & compliance<br />SchemaDifferenceReport.txt:<br />Dovetail SchemaEditor Difference Report<br />----------------------------------------------------------------<br />Date: 2011-03-29 17:40:51<br />Action: Apply<br />User: fcsgary<br />Database Name: dovetail<br />Input File: TestChanges.SchemaScript.xml<br />----------------------------------------------------------------<br />Changed schema<br /> Changed table "case"<br /> Added column "x_test" with type "Integer"<br />
    58. 58. Indexes<br />Performance Indexes should be part of dbtune.sql – not the schema<br />
    59. 59. Custom Tables<br />All objects are required to have an OBJID field, with GEN_FIELD_ID=3.<br />
    60. 60. Additional Tips – Clarify schema files<br />Customer Fields must appear after all Clarify Fields for that object.<br />Do NOT swap around ordering of existing fields and relations in an object.<br />Define custom tables and views at the end of the schema file.<br />
    61. 61. Additional Tips – Clarify schema files<br />Customer Relations must appear after all Clarify Relations for that object.<br />All relations must have corresponding inverse relation on the target object.<br />All inverse relations on a target object must be defined with the appropriate inverse cardinality. <br />
    62. 62. </tips><br />
    63. 63. presentation<br />demonstration<br />postlude<br />q & a<br />drink beer<br />
    64. 64. Postlude<br />More Info on Dovetail SchemaEditor<br />http://dovetal.es/dtSchema <br />More Info (and free download) for Dovetail BOLT<br />http://dovetal.es/dtBolt<br />Feel free to contact me:<br />gary@dovetailsoftware.com<br /> dovetailsoftware.com/blog/gsherman<br /> 512-610-5466<br /> @gsherman<br />These slides <br /> will be available on my blog at dovetailsoftware.com<br />
    65. 65. Interested in Schema 201?<br />I’m considering doing a Schema 201 webinar<br /><ul><li>SQL Views
    66. 66. Database Flags
    67. 67. Generic Field IDs
    68. 68. Change Fields
    69. 69. Pseudo Relations
    70. 70. Exclusive Relations
    71. 71. MTM tables
    72. 72. ADP in more detail
    73. 73. And more</li></ul>Interested? Please let me know.<br />
    74. 74. Questions, Comments, Queries?<br />Use the Q&A widget within WebEx<br />
    75. 75. </WEBINAR><br />

    ×