"The O2 sensors on an OBD-II car are scheduled to be replaced every 100,000 miles.
Pelicanparts has these for about $108 apiece. They are plug and play. Yes, you can buy "generic" and solder them in, but if they don't work, well, you'll get frustrated fast. For the amount saved in labor, it is worth it to spend a little more on quality parts.
a 22 mm box end wrench can take these out, although they do sell a special tool which is nice.
There are several O2 sensor error messages, and not all of them mean "replace O2 sensor". Most mean something else. There is no "bad oxy sensor" code per se.
OBD II error codes only reveal symptoms, not causes. Even BMW mechanics, though, fall for the "read code and replace named part" error.
These are some of the following messages and possible causes,
1. O2 sensor out of range (or adaptive range limit met): Usually an air leak and the easiest and most common place is the intake elbow after the MAF sensor. A $30 part and ten minutes to replace. This is NOT an O2 sensor problem, usually.
2. Catalytic Converter Efficiency Below Threshold: This appears to be a primary oxygen sensor failure. Not really a failure per se, but merely the sensor wearing out and giving inaccurate readings (going out of calibration). Replacing the primary sensor seems to fix this, although it could also be the catalytic converter being worn out, or the secondary sensor giving an improper reading. Again, the code gives the symptom. The mechanic (you) still has to determine the cause.
3. Heater wire: Open circuit or improper resistance on heater wire. Usually a broken connection to the sensor, a bad sensor, or a disconnected sensor (This is a handy code, as if you get confused as to which sensor plug goes where during installation, just disconnect one and read the code - this error will tell you which sensor you just disconnected).
Use a Peake code reader to get more detailed code readings. The P-code readers used by the auto stores give only vague generic message codes."