2. Given that the surface area of a rectangular prism is $\frac{45}{2}$, and the total length of its edges is 24. Then the maximum value of the angle formed between the body diagonal of the rectangular prism and its edge is ( ).
(A) $\arccos \frac{1}{3}$
(B) $\arccos \frac{\sqrt{2}}{3}$
(C) $\arccos \frac{\sqrt{3}}{9}$
(D) $\arccos \frac{\sqrt{6}}{9}$
2. D.

Let the lengths of the edges passing through the same vertex be $a$, $b$, and $c$ ($a \geqslant b \geqslant c$). Then
$$
\begin{array}{l}
\left\{\begin{array}{l}
2(a b+b c+c a)=\frac{45}{2}, \\
4(a+b+c)=24
\end{array}\right. \\
\Rightarrow\left\{\begin{array}{l}
a+b=6-c, \\
a b-c^{2}+6 c=\frac{45}{4} .
\end{array}\right.
\end{array}
$$

Thus, $a$ and $b$ are the roots of the equation
$$
x^{2}-(6-c) x+c^{2}-6 c+\frac{45}{4}=0
$$

Therefore, $\Delta=(6-c)^{2}-4\left(c^{2}-6 c+\frac{45}{4}\right) \geqslant 0$
$$
\Rightarrow 1 \leqslant c \leqslant 3 \text {. }
$$

Since $c \leqslant \frac{1}{3}(a+b+c)=2$, then
$$
1 \leqslant c \leqslant 2 \text {. }
$$

And $a^{2}+b^{2}+c^{2}$
$$
=(a+b+c)^{2}-2(a b+b c+c a)=\frac{27}{2} \text {, }
$$

Thus, $\cos \theta=\frac{c}{\sqrt{a^{2}+b^{2}+c^{2}}}=\frac{\sqrt{6}}{9} c \geqslant \frac{\sqrt{6}}{9}$.
Therefore, $\theta \leqslant \arccos \frac{\sqrt{6}}{9}$.