In this paper, we consider the controllability and minimum energy control problem of the switched oscillatory system. Firstly, we present the solution of the system by constructing some new nested matrix functions and establish the Gramian‐type and Kalman‐type criteria for the controllability of the system. Secondly, we derive another controllability criterion based on controllable subspace of the system. Thirdly, the optimal control to minimize the quadratic performance index of the system is presented. Lastly, the theories that we establish are applied to the controllability problem of the second‐order multiagent systems under consensus protocol and switching topologies.