We assume a hypothetical defined benefit (DB) pension plan that reflects the characteristics of the occupational pension in South Korea and propose a surplus optimization strategy using a regime-switching model. Using conditional surplus at risk, we construct an optimized portfolio that limits extreme tail risks. Furthermore, we identify the surplus risk and return conditional on global macroeconomic status using a hidden Markov model. The main results are that (i) the DB pension portfolio should move from principal-protected products to diverse capital market products, and (ii) the DB pension portfolio using the regime-switching model outperforms an unconditional static portfolio.