I don't know what difficulty you are trying to do it on, but the higher the difficulty the better the start you are going to need to pull off a CS Oracle. I doubt you are playing on deity, but to do it on that level you need something ridiculous like triple gems. On Immortal you might be able to pull it off with double gems/gold. It kind of depends on how lucky/unlucky you are with the AI pursuing the Oracle.
As Lennier said, you need to tech the prerequisite techs for CS which are Math and Code of Laws. There is an alternative path through Monarchy > Feudalism instead of Code of Laws, but that's way more expensive and generally less useful. You need Math regardless. Once you have all of the prerequisite techs, complete the Oracle and select CS. You want to have it timed out so that the Oracle and your last tech complete on the same turn.