Well, I suppose we could argue 9mm semi-auto carbine over .38 lever carbine, which wouldn't be as far off as shotguns...
But since we are in the handgun forum, I don't suspect the OP wanted "shotguns."
As Glenn said, long guns are good for barricades; for exploring the house, they are more of a challenge. Easier to grab; harder to coordinate with a light (unless weapon mounted, which requires different training); harder to coordinate with switching lights, opening doors, etc.
Note that with training, it's not so hard to turn an attempted grab at a long gun into a takedown of the BG (long gun = leverage against you if you don't know what you are doing, but leverage in your favor if you do). Most people I know have no idea how to do that. If you really want to carry a long gun around, I suggest you find somebody who can teach you long gun retention, in addition to other tactics.
As a general rule, I don't recommend hunting the things that go bump in the night, in the house; but there are people who have fairly compelling reasons, generally other people in other parts of the house, why they can't just barricade all that easily.
I do think, if one decides to investigate, the choice of 9mm or .38 is much less important than the choice to get training in the use of lighting (and darkness), how to open doors and pie the room, weapon retention, etc. I also think the choice to set up proper locks, lighting, and security is a more important choice than 9mm or .38. Ditto the choice to get one or more yappy dogs, intimidating dogs, or a mix of both.
But 9mm or .38? Really just depends on what platform works best for you.