5 total views, 1 views today

1) What is Primavera P6 background jobs

 

Primavera P6 EPPM has below two background jobs that run in the background and clean up the unwanted records from table present in ADMUSER schemas. The two jobs are: 

 

 

1.1) SYMON (System Monitor)

By default, SYMON runs every-one minute, and it takes few seconds to complete the job. SYMON takes care of the following two tasks. These are PL/SQL scripts. We can execute these tasks manually by simply Login info ADMUSER schema and execute the corresponding procedure. 

 

Procedure Name (Task) Description
OBSPROJ_PROCESS_QUEUE Queue OBSPROS updates into PRMQUEUE table
USESSION_CLEANUP_EXPIRED Delete the expired USESSION table

 

Note: Oracle document suggest don’t change the default scheduler time, that is a 1-minute interval.

 

1.2) DAMON (Data Monitor)

By default, DAMON runs on every SATURDAY, and it takes a long time to complete the job. DAMON clean up the following tables, and we can run each task manually by executing the corresponding PL/SQL script Under ADMUSER

 

Procedure Name (Task) Description
BGPLOG_CLEANUP Deleted BGPLOG table 
REFRDEL_CLEANUP Delete the REFRDEL table
CLEANUP_PRMQUEUE Removes completed EPS and project security tasks.
USESSION_CLEAR_LOGICAL_DELETES Removes all records of deleted session.
CLEANUP_LOGICAL_DELETES Delete records from tables that have been deleted by user action. The P6 applications mark records as deleted, they don’t delete them.
PRMAUDIT_CLEANUP Removes old database audit records
CLEANUP_USESSAUD Removes old audit records for user sessions.
USER_DEFINED_BACKGROUND We can Extend the DAMON functionality by adding code into this procedure
CLEANUP_OLD_DATA P6 version specific cleanup that doesn’t do anything.

 

Note: We can customize the interval for DAMON depends on our requirement. For example, we can set DAMON to Run on every day or  Run once on every two weeks or Run on a specific day

 

 

 

2) How Primavera P6 schedules the Background jobs

 

Background jobs are run by RDBMS – job scheduler. On Oracle database, P6 EPPM uses DBMS_SCHEDULER. On Microsoft SQL SERVER, P6 EPPM uses SQL Agent service.Every thing is automatic, we don’t need this jobs manually. 

 

2.1) How to Run Background Job manually in Oracle database

 

Sometimes the jobs may get struck and stop cleaning records or we update the Background job SETTINGS table. In those situations, we need to retrun the background jobs manually. 

 

In Oracle Database, P6 has a dedicated schema for background Jobs. The schema is called BGJOBUSER (BackGroundJobUser), Let see how we can run the background job in Oracle database manually. 

 

1. Login as BGJOBUSER

 

2. Run the following SQL ‘exec initialize_background_procs’

 

As you see in the below image, I executed the background job under BGJOBUSER. Also, you see the DAMON & SYMON jobs under Scheduler >> Jobs 

 

080517_1830_WhatisPrima1 What is Primavera P6 background jobs

 

 

3) How to customize Background Job

 

 

The behaviour of background job can be controlled in ADMUSER.SETTINGS table. Let see what the SETTING table contains for BG jobs. As you see the result of the below query, the INTERVAL tells interval of SYMON & DAMON. The HeartBeatTime tells last run time of each job. If the last run time is older than a week for DAMON, then we can tell the job DAMON is not running. We need to troubleshoot and fix it. Also, Each procedure  (Step 1.1.  & 1.2 ) executed by SYMON and DAMON clean many tables ex: REFRDEL. We can further customize how to clean this table. For Example, we can tell DAMON to delete last 100 days records of  REFRDEL table on every Friday. So pay more attention to the SETTINGS table, the default settings are always good so Don’t change it unless it required. 

 

080517_1830_WhatisPrima2 What is Primavera P6 background jobs

 

The below are the units Used in the Setting table:

 

Interval = d, h, m, s (Day, Hour, Month, Second) Example: 30d, 20h, 3m, 5s

Boolean = 0 means false. 1 means true

Numeric = Any numeric value

 

P6 EPPM provides two functions to READ and WRITE record into the SETTINGS table. 

 

3.1) To Read record from Settings table

 

Use the below four procedures in ADMUSER account to determine the current value of the specific settings

 

  • SETTINGS_READ_STRING(ret_val,namespace,settings_name,default)
  • SETTINGS_READ_DATE(ret_val,namespace,settings_name,default)
  • SETTINGS_READ_NUMBER(ret_val,namespace,settings_name,default)
  • SETTINGS_READ_BOOL(ret_val,namespace,settings_name,default)

 

Example:-

 

The below function Read the interval of Damon job: 

 

 

Output: FREQ=DAILY;BYHOUR=1

 

3.2) Writing Settings table

 

Use the SETTINGS_WRITE_STRING procedure to insert a record in SETTINGS table :

 

  • SETTINGS_WRITE_STRING(new value,namespace,settings_name); )

 

Example:-

 

The following function inserts USESSION  ExpiredSessionTimeout setting to 12 hours 

 

 

Output:

 

080517_1830_WhatisPrima3 What is Primavera P6 background jobs

 

4) Monitor the Background jobs

 

We can track the execution of Background process by monitoring the BGPLOG table. We can also monitor the background jobs by monitor the HEARTBEATTIME of DAMON & SYMON as  mentioned in STEP 3. 

 

To Check the DAMON running well. Run the following query and check the LOG_TIME has later date as expected

 

 

Output: 

 

080517_1830_WhatisPrima4 What is Primavera P6 background jobs

 

 

Similarly, Check the SYMON by running the following query 

 

080517_1830_WhatisPrima5 What is Primavera P6 background jobs

 

5) Primavera P6 Background job – Optimal Performance 

 

The default settings are optimal for most of the environments. If you want to optimize it further then consider the following settings

 

Note: Click on the following link  for supported Background Job – Settings  table properties 

 

  • For Refrdel 

REFRDEL is one of the table cleaned by Background job. Here we are telling DAMON to Keep last 8 days record, Delete 100 days record start from day -9 and step inteval to be 15 days 

We are telling to DAON

 

 

  • For UsessAud

SImilar to USESSAUD table 

 

 

 

 

 

 That’s  about primavera p6 background jobs. Please feel free to enter your comments 

govindan What is Primavera P6 background jobs
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
govindan What is Primavera P6 background jobs
Connect me
By | 2017-10-13T15:08:17+00:00 August 5th, 2017|Categories: P6|Tags: , , |0 Comments
Like us on Facebook.
Connect!