There have been several linguistic analyses of the use of ‘oh’ in English. See, for example, the work of Deborah Marjorie James (University of Michigan, US) in The Syntax and Semantics of Some English Interjections,
James’s work is referenced in a 2007 study which attempted to shed some light on the usage of the interjection oh in English and its translation into Catalan with relation to dubbed sitcoms.
“ […] according to James, oh1 indicates that one has become aware of something in general, of something one should do, or even of a strong emotion, either with an added element of pleasure or not. When it indicates pleasure, ah is also used as an alternative to this oh. On the other hand, oh2 is used to indicate awareness in all the three previous contexts, transmitting casualness or a decision process at the same time.”
See: ‘The translation of oh in a corpus of dubbed sitcoms‘ , by Anna Matamala (Universitat Autònoma de Barcelona, Spain), in the Catalan Journal of Linguistics, 6, 2007, 117-136.