Previous  Next          Contents  Index  Navigation  Glossary  Library

Snapshot

The Snapshot takes a copy, or "snapshot," of all the information used by the planning processes so that the planning processes can operate on a picture of the data frozen at a point in time, and report against that snapshot at any future time.

Snapshot Tasks

The work performed by the Snapshot can be broken down into individual tasks. Some tasks involve copying information into the MRP tables, such as inventory quantities, master schedule data, discrete jobs, purchase orders, and repetitive schedules. Other tasks involve deleting information from tables. For example, the information in the MRP discrete job table needs to be deleted before MRP can reload the latest information. Many of the tasks are independent of one another--you can load inventory information at the same time you load discrete job information. The Snapshot launches workers to run these tasks concurrently.

When the Snapshot runs, it populates the Snapshot Task table with all the tasks that need to be executed.

Each task has a start date and a completion date. The values of those columns indicate the status of the tasks. A task with a null start date and null completion date has not been executed yet. A task with a value for the start date but no value for the completion date is currently being processed. A task with values for the start date and for the completion date has been processed. The Snapshot looks at these columns to determine which task should be processed next.

Some tasks may be dependent upon other tasks. For example, you must delete from the MRP discrete job table before you reinsert values for the latest picture of the discrete jobs; or, you must load information on current repetitive schedules before you can calculate information on current aggregate repetitive schedules. The Snapshot ensures that independent tasks are processed before the tasks that depend upon them are processed.

Read Consistency

Certain tasks require a database lock to guarantee a consistent read. For example, discrete job information and inventory quantities require a lock on the inventory transactions table to guarantee a consistent read. Consider the situation where you have a subinventory with a quantity of 100 units, and a discrete job for 25 units. Between the time the Snapshot reads the inventory information and the time the Snapshot reads the discrete job information, 10 units are completed from the job. The Snapshot needs to guarantee that it populates the MRP tables with inventory of 100 and discrete job quantity of 25, or inventory for 110 and discrete job quantity of 15. Because each task may be processed by independent processes, the Snapshot cannot guarantee that both tasks are executed at the same time. Therefore, by locking the inventory transactions table, the Snapshot guarantees a consistent read.

Each task has an attribute which indicates whether the Snapshot needs to have acquired the table lock before the task can be completed. Once the locks have been acquired by the Snapshot, those tasks that require a lock are given highest priority, so that the time the tables are locked is minimized. Once all tasks requiring locks have been completed, the Snapshot releases the locks.

Suggestion: Sometimes it is not necessary to guarantee read consistency. For example, if you are running the planning processes for simulation purposes to estimate medium-term and long-term trends in your material requirements, it may not be necessary to guarantee read consistency. Therefore, you may want to run the planning processes with Snapshot Lock Tables turned off, so that you do not need to restrict or limit other users from performing transactions.

Memory-based Planning Engine

One of the advantages of the Memory-based Planning Engine is its ability to get a consistent image of all planning data without locking users out of the system. The planning engine accomplishes this with the Oracle Server feature called "set transaction read-only." With this option, you do not need to lock tables for the duration of the planning run. To ensure total consistency, you need only synchronize the times when the Snapshot Workers and the Memory-based Snapshot execute the set transaction feature.

You can achieve two degrees of read consistency under the Memory-based Planning Engine. Set the Snapshot Lock Tables field to Yes to force the Snapshot Workers and the Memory-based Snapshot to execute the set transaction feature simultaneously. Locking tables gives you the highest degree of data consistency, but you cannot perform any transactions while this lock is on. If you set the Snapshot Lock Tables field to No, the Snapshot Workers and the Memory-based Snapshot may execute the set transaction feature at different times. There is a remote possibility of some inconsistencies with this method.

Lock File

Oracle Master Scheduling/MRP and Supply Chain Planning generally uses the database for inter-process communication. This technique cannot be used when the process trying to send a message also needs to hold table locks. This is the case when the Snapshot has acquired the table locks and needs to communicate this fact to the Snapshot Workers.

The Snapshot launches the Snapshot Workers. The Snapshot Workers begin processing tasks that do not require a database lock. Once the Snapshot has acquired the table locks, it needs to communicate that fact to the Snapshot Workers. However, the Snapshot cannot update a column in a database table to communicate this information. In order for the Snapshot Workers to be able to read this information, the Snapshot would have to issue a commit. This would free the database locks.

The Snapshot creates an operating system file called the lock file to communicate the fact that it was able to acquire the table locks. The Snapshot Workers periodically check to see if the lock file has been created. Once they detect the existence of the lock file, the Snapshot Workers begin processing those tasks that require locks to guarantee read consistency.

Snapshot Configuration

You can configure the Snapshot to determine how many Snapshot Workers to launch when you define the MRP: Snapshot Workers profile option. See: Profile Options.

The above diagram illustrates the Snapshot Process logic under the Standard Planning Engine. Below is a detailed explanation of the logic.

The above diagram illustrates the Snapshot Worker Process logic. Below is a detailed explanation of the logic.

See Also

Launching the Planning Process


         Previous  Next          Contents  Index  Navigation  Glossary  Library