First, let's talk about what they have in common: they are essentially exclusive locks on resources that are caused by concurrency (if the database has only one session, it's not locked).
Then focus on the different points:
First of all, their purpose is different, enqueue (that is, lock,oracle official documents mixed with these two nouns, in the waiting event, you can see a lot of enqueue, in fact, lock) is to solve the business level of data contention, and latch is to resolve the contention of memory resources.
Second, they run in a different way, enqueue in a queuing way, first-come first-served, and latch competition is almost disorderly, in a random way, first to not necessarily first, have to rely on the Rob, and it also a time slice rotation way, will not always occupy, immediately not run out, time film one to also.
Third, the duration of the session is different, enqueue may hold longer depending on the business situation, while the latch is usually very short. Four, the cause is not the same, enqueue too much is usually a business design problem, and latch too much, is generally a database-level problem (such as not using binding variables, table or index hot block, etc.).
See more Highlights: http://www.bianceng.cn/database/Oracle/