We address an opportunistic subchannel scheduling problem in relay-based OFDMA cellular networks. In most previous works on relay-based cellular networks, immediate relaying at relay stations (RSs) was assumed, without allowing the opportunistic scheduling at RSs. Hence, each RS should transmit the received data from the base station (BS) to the corresponding mobile stations (MSs) immediately within a single time-slot and the effective data rate of the two-hop transmission (BS-RS and RS-MS links) is limited by the achievable data rate of the link with worse channel state among two links, resulting in wastes of radio resources. However, if the opportunistic scheduling is allowed at each RS, the time-varying channel state of each link can be fully exploited, and thus more efficient radio resource allocation is possible. Hence, in this paper, we consider an opportunistic subchannel scheduling at both BS and RSs. We formulate a stochastic optimization problem that aims at maximizing the average sum-rate of the relay-based network where the time-varying wireless channel is modeled as a stochastic process. By solving the problem, we develop an optimal opportunistic subchannel scheduling algorithm for both BS and RSs. Numerical results show that we can significantly improve system performance by allowing the opportunistic scheduling at RSs.