DISCLAIMER: I am not a licensed plumber. I am not responsible if you injure yourself, cause damage to your property, or violate your local plumbing code.
Step 1: The Problem(s)
The mouth of the terra cotta (or clay) drain pipe is about 7" in diameter. The holes to mount a typical flange line up with the lip of the clay pipe and it wouldn't hold the flange.
Step 2: Break Out the Terra Cotta
You can see that I laid ceramic tile in the interim, so I was careful not to chip that.
Also, I covered the lower portion of the drain pipe with duct tape so none of the clay fragments went into the sanitary sewer.
Take your time and chip out a little at a time.
Step 3: Top Part of Drain Pipe Removed
Step 4: Cut ABS Pipe to Length
Step 5: Pipe Cut and Fit
Step 6: Dry Fit Flange
Step 7: Cement It In
Step 8: Lay Final Tile
Before laying the tile, I used a tile bit to drill holes where the flange would be screwed in. You can see where I cracked the edge of the tile when drilling. :-( No matter. It will be hidden under the toilet bowl!
Again, note the grungy towel stuffed into the hole the keep sewer gases from coming into the house.
Step 9: Install the Flange
Using the Tapcon drill bit, I drilled four holes down into the concrete to line up with the holes on the flange. I vacuumed out the holes to get rid of the resulting concrete dust.
I applied ABS cement to the inside of the cemented ABS piece and to the outside of the flange. Then I slid the flange into place and screwed in the Tapcons. I used the kind with the tapered wood screw type head so that once all the way in, they seated nicely in the recessed holes in the flange and held it tight.
Step 10: RESULTS!