Let $R$ be a Noetherian ring and $b\in R$ a nonzerodivisor. Krull's Principal Ideal Theorem implies that every minimal prime ideal over the ideal $(b)$ has codimension $1$. However, could it be possible that one of the associated ideals of $(b)$ is embedded, i.e. having codimension $>1$? If yes, could you give an example? Will all the associated prime ideals be of the same codimension if we assume that $R$ is the coordinate ring of an algebraic variety (affine ring over an algebraically closed field)?
I ask this question for the following reason. Let $K$ be the total quotient ring of $R$. Pick $f=a/b\in K$, then the poles of $f$ is Zariski closed in $X=\mathrm{Spec}(R)$, defined by the ideal $I=\{r\in R\mid rf \in R\}= \mathrm{Ann}((a,b)/(b))$. In general we expect this to be a subset of codimension $1$. But if one of the associated prime $Q$ is embedded. By definition, $Q$ is the annihilator of an element $\bar{a}$ in $R/(b)$. If we pick $f=a/b$ for this particular $a$, then the $f$ has a pole along $V(Q)$, and regular everywhere else, and that goes against the "common" expectation.
So far the only thing that I could find is the "Unmixedness theorem" which implies that if the ring $R$ is Cohen-Macaulay, then there will be no embedded associated primes. But I am having trouble to get an affirmative proof or a counter-example in the general case.
Thank you.
Edit: I just realized that at this generality, the problem doesn't make much sense. For example, if we take the variety which is the union of the $xy$-plane and the $z$-axis. Then $R=k[x,y,z]/(xz,yz)$, and $x-z$ is a nonzero divisor in this ring. But the function $f=x/(x-z)$ is regular at all points but the origin. Indeed, it take value $0$ at all the nonzero points on the $z$-axis, and value $1$ on the nonzero points of the plane. The ideal $I$ defined above is the maximal ideal $(x,y,z)$, which has codimension 2.
So I'd like to restrict to case where $R$ is a domain.