Overview of key DBA features in Toad for DB2 zOS Part IV

Toad for DB2 z/OS is a very robust object compare feature. It could be used to compare schema-based objects, such as tables and indexes, as well as database objects, such as databases, storage groups, tablespaces, et cetera. And it could be used to compare objects within the same subsystem or across subsystems.
I'm going to select a group of tables, right-click and say, Compare Object. And this is going to bring up the Compare Object document. It'll allow me to specify my target subsystem. For this example, I'm going to keep it the same. But I could have chosen a different subsystem than the source. And I'm going to click Next.
And what Toad is doing-- I selected a group of tables-- Toad defines tables by obviously the table definition. But if there's any constraints on those tables and any indexes on those tables, those will come in automatically. As you can see, by expanding the list here we've brought in several indexes and constraints.
Now Toad also allows you to drag and drop objects into this compare control. So I'm just going to bring in a couple of additional objects. So I'm going to bring in a basketball player's table. And again, each time you drag an object in, Toad is going to see if there's any other automatic dependent objects that it needs to bring in, such as check constraints indexes, et cetera.
And I'm going to bring in the basketball team's table as well. As you can see that I originally started just with the set of football tables. Now I'm going to have football tables and basketball tables in the mix here. So you can see as I expand these things, you'll see my basketball, football, et cetera.
Now we have some options on the bottom here that can be used to bring in referenced objects. So since I started with tables, if I click this, it's going to bring in those tables' tablespaces if I want. And if there's any additional dependence, such as views, for example, of the tables that references those tables, if I click this, it would bring those in.
And we have various other options down here. We have advanced options, as well. If I click this button to bring up the advanced options, you'll see that we have options to ignore certain attributes. So for example, you might be using compression one way in your production environment and a different way in your staging and test environment. So we give the ability to ignore those attributes, as well as data capture. There are many differences, many attributes, that can be ignored.
And in the z/OS specific section, we have additional things like ignoring OBID, AUDIT differences, et cetera. I'm just going to leave those as a default and click Next. And this screen is the mapping screen where you can define your transformation. So for example, if you have different naming conventions in your production environment then your test environment, you could map those very easily just by selecting values in your target environment.
So if we actually go out and fetch these values for my targets, so it could very easily have mapped those. Once you've done the mappings, you could save those. And I've done that. So I'm going to load a saved mapping file that I created previously. And you could see in this mapping file I've mapped my source STAGE schema to a production, a PROD, schema in my target.
Say on my tablespace, on my source, it was called FB and my target is called FBP. Same with my database name. We have several different ways you can map like a simple different way. So if there's a table on the source called FOOTBALL_AGENTS, that table's name will be called or referenced to a FOOTBALL_AGENTS_PRO table on the target.
We also have a regular expression mapping where anywhere in a table name, if we find the phrase DIVISION, the string DIVISION, we're going to change that to CONFERENCE. And we also have wildcard mapping where you could actually use a percent sign where anything following basketball can be found and then substituted in using this $1 value. And we'll get to that in a little bit as we see the mapping.
So I'm going to click Next here. And what Toad is doing now, it's going out, grabbing information about the source objects, fetching information about the target objects, and then applying a comparison to identify the differences. And now in this Review Comparison Report panel, you can actually see the differences.
And from here, if you click on an object in the top control, that object will get highlighted on the bottom control. And these results here, these green arrows pointing to the right mean they're source-only. Those objects do not exist on the target.
These arrows pointing both ways, a red and a green, signify that the objects exist both on the source and the target. And we will actually do a synchronization of those changes. So for example, this table here has some differences, and they're highlighted on the bottom here. This table here has some difference, and they're highlighted on the bottom. This table here has some differences.
And you can use these buttons on the top here to filter out the above list. So for example, if I only wanted to see the objects with differences, I just only enable this button. And then you could view those changes. And we have a button here, it's called Unmap Source. You can see that we've actually mapped everything that we needed to here based on your mappings in the previous panel.
But if you wanted to see the native source as it is on the source today without any name mappings taking effect, you could click that button and will give you the native. So you can see that the schema is actually STAGE. Some things are a little bit different.