Occidental Petroleum Corp. has agreed to acquire Texas shale driller CrownRock LP in a cash-and-stock deal valued at about $12.0 billion, including the assumption of $1.2 billion in debt, as consolidation heats up in North America’s most-prolific oil basin.