Context : Aims : We determine the gas-phase oxygen abundance for a sample of 695 galaxies and H ii regions with reliable detections of [ O iii ] 4363 , using the temperature-sensitive ( T _ { e } ) method , which is the most reliable and direct way of measuring metallicity . Our aims are to estimate the validity of empirical methods such as R _ { 23 } , R _ { 23 } - P , log ( [ N ii ] /H \alpha ) ( N2 ) , log [ ( [ O iii ] /H \beta ) / ( [ N ii ] /H \alpha ) ] ( O3N2 ) , and log ( [ S ii ] /H \alpha ) ( S2 ) , and re-derive ( or add ) the calibrations of R _ { 23 } , N2 , O3N2 and S2 indices for oxygen abundances on the basis of this large sample of galaxies with T _ { e } -based abundances . Methods : We select 531 star-forming galaxies from the Fourth Data Release of the Sloan Digital Sky Survey database ( SDSS-DR4 ) with strong emission lines , including [ O iii ] 4363 detected at a signal-to-noise larger than 5 \sigma , as well as 164 galaxies and H ii regions from literature with T _ { e } measurements . O/H abundances have been derived from a two-zone model for the temperature structure , assuming a relationship between high ionization and low ionization species . Results : We compare our ( O/H ) _ { T _ { e } } measurements of the SDSS sample with the abundances obtained by the MPA/JHU group using multiple strong emission lines and Bayesian techniques ( Tremonti et al . 2004 ) . For roughly half of the sample the Bayesian abundances are overestimated \sim 0.34 dex , possibly due to the treatment of nitrogen enrichment in the models they used . R _ { 23 } and R _ { 23 } - P methods systematically overestimate the O/H abundance by a factor of \sim 0.20 dex and \sim 0.06 dex , respectively . The N2 index , rather than the O3N2 index , provides more consistent O/H abundances with the T _ { e } -method , but with some scatter . The relations of N2 , O3N2 , S2 with log ( O/H ) are consistent with the photoionization model calculations of Kewley & Doptita ( 2002 ) , but R _ { 23 } does not match well . We derive analytical calibrations for O/H from R _ { 23 } , N2 , O3N2 and S2 indices on the basis of this large sample , as well including the excitation parameter P as an additional parameter in the N2 calibration . These empirical calibrations are free from the systematic problems inherent in abundance calibrations based on photoionizatoin models . Conclusions : We conclude that , the N2 , O3N2 and S2 indices are useful indicators to calibrate metallicities of galaxies with 12 + log ( O/H ) < 8.5 , and the R _ { 23 } index works well for the metal-poor galaxies with 12+log ( O/H ) < 7.9 . For the intermediate metallicity range ( 7.9 < 12 + log ( O/H ) < 8.4 ) , the R _ { 23 } and R _ { 23 } - P methods are unreliable to characterize the O/H abundances .