12.1 Repository Table StructureThe toolkit repository contains two sets of tables. The first is a set of tables containing information we copy from the Oracle data dictionary on a regular basis. We don't copy the entire dictionary, by any means, but we do copy the most interesting and changeable data. The second set of tables is our own group of specialized tables containing information that allows us to track SQL and generate explain plans. 12.1.1 Tables from the Oracle Data DictionaryTable 12-1 lists the repository tables that mirror the contents of certain Oracle data dictionary tables, and summarizes the types of database objects stored in those tables. The names of the tables are derived from the names of the corresponding data dictionary tables. For example, our PDBA_INDEXES table pulls data from the Oracle's DBA_INDEXES data dictionary view. In the later section, Section 12.4, we'll show how we use the data in these tables to analyze changes to database objects. The repository itself is compatible with the data dictionary provided in Oracle Versions 8.0 and later.
12.1.2 Specialized Repository TablesIn addition to the tables described in the previous section that mirror the Oracle data dictionary tables, the repository contains another set of more specialized tables. The purpose of these tables is to track the SQL found in the V$SQLTEXT data dictionary table and generate execution plans from that SQL. In these tables we'll store Oracle SQL and EXPLAIN PLAN information so we can perform comparisons on it at a later date. We'll describe the scripts that perform these comparisons in the later section, Section 12.5. Use of the data in these tables will help to answer a common complaint from users — that their SQL, which worked perfectly last week, has slowed down significantly. This isn't necessarily a figment of our users' imaginations! It's often obvious to all, including the troubleshooting DBA, that something has changed in the database since last week. It just isn't always clear what has changed:
All of these things can have a major impact on SQL execution and overall database performance. Having read Stephen Hawking's Universe in a Nutshell (Bantam Press, 2001), we know that travelling backwards in time is impossible (unless you're Mr. Spock), so the last two questions in the list are usually quite difficult to answer. We've often thought, though, that if we could answer them, it would be very interesting. At last, such a thing is possible. All we need is the SXP (Sql eXplain Plan) repository tables, which track the objects listed in Table 12-2.
|