The mission of this paper is dealing with an optimal control and dynamics problems for an SVIR epidemic model. First, we define a threshold value R 0 which determines the dynamical behavior of system (1). When R-0 < 1, all solutions of system (1) converge to the disease-free equilibrium point ((sic)S, (sic)V, 0, 0), while for R-0 > 1, all solutions converge to the endemic equilibrium point ((sic)S, (sic)V, (sic)I, (sic)R), and it is globally asymptotically stable. Subsequently, we characterize an optimal control problem (3)-(7) with two control strategies (non-constant vaccination convergence rate and medication). The existence and uniqueness of solutions of system (13) are demonstrated via the Banach fixed point theorem. With the method of extracting a minimizing sequence, we get the existence of the optimal pair. Furthermore, by proving the differentiability of the control-to-state mapping, we derive the first-order necessary optimality condition and point out that the optimal is a Bang-Bang control in a special case. Finally, we perform a numerical experiment in MATLAB to illustrate the practical application of the theoretical results obtained in this contribution.