Atmospheric temperature is a key parameter to characterize the state of the atmosphere. Owing to the independence of the aerosol effect for profiling the temperture, the pure rotational Raman lidar has become one of valid tools. To achieve all-time and high-precision active remote sensing, strong background noise needs to be filtered out, and the inhibition rate outside the band of more than 70 dB is needed for Mie-Rayleigh scattering in a rotational Raman temperature measurement lidar. In this paper, a multiple cascaded light path based on sampled fiber Bragg grating (SFBG) and fiber Bragg grating (FBG) in visible spectrum is presented to obtain characteristic spectrum. All-fiber spectroscopic system with high inhibition rate for Raman thermometry is set up based on the above light path. The core device consists of single mode fibers (460-HP) to ensure the compatibility with optical fiber. The main factors affecting the inhibition rate outside the band of sampled fiber Bragg grating, including refractive index modulation depth, total length of grating, sampling period and duty, are optimally designed by using mode coupling theory and tranmission matrix model. Then the optimized parameters of spectroscope are obtained. The results show that the inhibition rate outside the band is proportional to the refractive index modulation depth and duty, when the total length of grating is a constant. However, a larger sidelobe jamming will be caused by overlarge refractive index modulation depth. The less amount and widened full width half maximun of reflectivity peak appear following overlarge duty. In the Raman spectroscopic system of this paper, the inhibition rates outside the bands of SFBG and FBG are 30 dB and 20 dB, respectively. The inhibition rate of more than 70 dB is realized for Mie-Rayleigh scattering, after passing through two FBGs and one SFBG. The simulated optimum parameters of SFBGs are the effective index of the guide mode of 1.465, the saturation index variation of 0.00005, the SFBG length of 20 mm, the sampled period of 0.4 mm, and the Bragg wavelengths of 528.51 nm and 530.76 nm. By using the American standard model and atmospheric scattering signal model, the all-time signal-to-noise ratio (SNR) and inhibition rate of Mie-Rayleigh scattering and solar background light are simulated and analyzed. The results show that the intensities of solar background light and Mie-Rayleigh scattering signal are weaker than Raman scattering signals at 40 dB and 50 dB, respectively. The detection height in daytime and night can reach up to 1.6 km and 2.6 km under the condition of SNR of more than 100, respectively. Owing to these advantages such as miniaturization, anti-interference and high stability, this spectroscope provides a viable solution for filter systems of ground-based and spaceborne lidars.