This paper proposes a novel policy-iteration-based adaptive optimal scheme for uncertain continuous-time linear systems with excitation signals. The proposed method can solve the related linear quadratic optimal control problem in online fashion exactly and safely. In order to maintain persistence excitation condition, the controller injects the small excitation signals to the system. For this linear system with excitation signals, the policy iteration (PI) technique is investigated to adaptively find the optimal control law in the presence of both internal uncertainties and known excitation signals. For the proposed PI technique, the stability of the closed-loop system and convergence to the optimal solution are mathematically proven. Numerical simulations are carried out to verify the effectiveness of the proposed method.