This paper presents a random forest-based machine learning algorithm to automatically detect satellite oscillator anomaly by using dual- or triple-frequency GPS carrier phase measurements. The algorithm can distinguish satellite oscillator anomaly from other GPS carrier phase disturbances including ionospheric scintillation and the receiver oscillator anomaly. Carrier phase power spectral density and carrier phase ratios between carriers are extracted from measurements and applied as input features to the random forest algorithm. The method is trained using data collected at 7 GNSS monitoring stations located at Alaska, Ascension Island, Greenland, Hong Kong, Peru, Puerto Rico, and Singapore. The overall detection accuracies of 98.4% and 99.0% are achieved for dual- and triple-frequency signals, respectively. The method outperforms other machine learning algorithms. The preliminary detection results demonstrate that the proposed method can be employed on a global satellite oscillator anomaly monitoring system.