Sempra Energy said it will buy Oncor for $9.45 billion in cash after Energy Future Holdings Corp, which indirectly owns Oncor,