For plenty of existing maintenance policies in literature, it is always assumed that the spare unit for replacement is available at any time if needed, while this perquisite may be unrealistic or even impossible. In this paper, we investigate an ordering and replacement modeling framework for a deteriorating repairable system with two failure types, involving a repairable failure (Type I failure) and a nonrepairable failure (Type II failure). A regular order and an expedited order are both incorporated into the spare unit ordering policy while a preventive replacement and a corrective replacement are both considered into the replacement policy, of which the ordering and replacement policy is scheduled in regard to the number of repairable failures. The expected profit per unit of time over an infinite time span is maximized to seek the optimal solutions in terms of the renewal reward theorem with a recursive algorithm procedure. An illustrative example is designed to validate the applicability and effectiveness of the developed ordering and replacement policy. In addition, the sensitivity of the optimal ordering‐replacement policy is studied and the effect of some key characteristics on the optimal decisions is discussed.