How does Oracle GUID work?

Posted on Thursday, January 15, 2009


I was having a discussion with my colleague this morning about the guarantee that Oracle GUID would be unique on multiple horizontal stacks that we are deploying our application to.

My understanding is that for generating Pseudo random numbers you need to have some seed to start with, I was wondering what seed does GUID use to ensure that it is mathematically unique. Following is the answer that I discovered on the net.

“A Globally Unique Identifier or GUID is a pseudo-random number used in software applications. Each generated GUID is “mathematically guaranteed” to be unique. This is based on the simple principal that the total number of unique keys (2^64) is so large that the possibility of the same number being generated twice is virtually zero.

SYS_GUID generates and returns a globally unique identifier (RAW value) made up of 16 bytes.

On most platforms the generated identifier consists of a

  • host identifier,
  • a process or thread identifier of the process or thread invoking the function,
  • and a non-repeating value (sequence of bytes) for that process or thread.