Business software maker Oracle Corporation has agreed to buy BEA Systems Incorporated for about $7.85 billion, a compromise price that ends a months-long dispute over the value of the software company. In October, Oracle suggested $17 a share, valuing the San Jose company at about $6.7 billion, but BEA"s board demanded a price of $21 per share. Now, Oracle has agreed to pay $19.375 per share for BEA, which makes "middleware," the computer coding that helps business applications interact more smoothly with databases. Oracle put the total price of the deal at $8.5 billion and said it expects BEA to add 1 cent to 2 cents per share to adjusted earnings in the first year after the deal closes, which will require stockholder and regulatory approval.