Although the use of 'O' is now archaic, restricted largely to poems and hymns, there is a distinct difference between 'O, My God' and 'Oh, My God!'. The former is a direct invocation to God whilst the latter is an exclamation of surprise followed by the expression, 'My God!'.