Lower back cramps that come on only while you're straining to pass stool, even without constipation, are usually from the pressure of pushing affecting your uterus and nearby ligaments, not a sign of a pregnancy problem. At 9 weeks this is a common and usually harmless pattern.
Next Steps
Avoid straining, eat enough fibre and drink plenty of water to keep stools soft, and stand up slowly afterward instead of pushing hard.
Health Tips
See your obstetrician the same day if the cramping continues after you're done, spreads to your lower abdomen, or you notice any bleeding.