Oil and gas production from carbonate rocks