Showing posts with label Primavera. Show all posts
Showing posts with label Primavera. Show all posts

Thursday, February 20, 2014

Primavera filter error

Today an old issue raised it head… When creating a filter on the a specific field caused an error is displayed to the User.

clip_image002

This issue addressed with a Primavera HotFix file that was released from Oracle for P6 SP 3.

Copy the file: PM.EXE hotfix file which you can download from the support site, over the existing PM.EXE file on the client PC. This can usually be located in the “C:\Program Files (x86)\Oracle\Primavera P6\Project Management” folder.

Sunday, November 17, 2013

Next key violation in Primavera

If you get this error message after copying and pasting a record in Primavera, the next key value may be out of sequence. This may be due to an import issue.

Run this script to find the key errors.
PRINT '====================================================================='
PRINT 'create a script for key errors and show the max key values and next key values'
PRINT '====================================================================='
GO
DECLARE @S NVARCHAR(MAX) = ''
;WITH
key_table_list
AS
(
select key_name, key_seq_num, table_name = LEFT(key_name, CHARINDEX('_',key_name, 0)-1), column_name = RIGHT(key_name, LEN(key_name) - CHARINDEX('_',key_name, 0)) FROM NEXTKEY
)
,
single_script
AS
(
SELECT
    [RowNumber]= ROW_NUMBER() OVER(ORDER BY tl.table_name)
, script = 'SELECT table_name =''' + tl.table_name + ''', max_key_seq_num = MAX(' + tl.column_name + '), key_seq_num = '
+ CAST(tl.key_seq_num AS VARCHAR) + ', KeyError = CASE WHEN MAX(' + tl.column_name + ') > ' + CAST(tl.key_seq_num AS VARCHAR)
+ ' THEN ''EXEC dbo.getnextkeys N''''' + tl.column_name + ''''', '' + CAST(MAX(' + tl.column_name + ') - ' + CAST(tl.key_seq_num AS VARCHAR) + ' + 1 AS VARCHAR) + '', @NewKeyStart OUTPUT'' ELSE NULL END FROM ' + tl.table_name
FROM
    key_table_list tl
INNER JOIN sys.objects ob ON ob.name = tl.table_name
WHERE ob.type = 'U'
)
SELECT @S = @S + CASE WHEN [RowNumber] != 1 THEN ' UNION ' ELSE '' END + script
FROM
single_script
EXEC ('SELECT * FROM (' + @S+ ') AS se WHERE KeyError IS NOT NULL')
GO
table_name
max_key_seq_num
key_seq_num
KeyError
spidmap
539
100
EXEC dbo.getnextkeys N'spid', 440, @NewKeyStart OUTPUT
wbrscat
3
1
EXEC dbo.getnextkeys N'wbrs_cat_id', 3, @NewKeyStart OUTPUT
The 'key_seq_num' should be + 1 greater than the 'max_key_seq_num'. Use the script from 'KeyError' to update the tables as below.
PRINT '====================================================================='
PRINT 'update next key to number of missing increments '
PRINT '====================================================================='
GO
SET XACT_ABORT ON
BEGIN TRANSACTION
DECLARE @NewKeyStart AS INT
EXEC dbo.getnextkeys N'spid', 440, @NewKeyStart OUTPUT
EXEC dbo.getnextkeys N'wbrs_cat_id', 3, @NewKeyStart OUTPUT
ROLLBACK TRANSACTION
--COMMIT TRANSACTION

Friday, June 22, 2012

Killing User Sessions in P6

The first step is to find out the user_id of the user that we wish to remove. You can do this by running something like the following, but substituting the string in the LIKE expression to find the user in question:

SELECT *

FROM users

WHERE LOWER(user_name) LIKE LOWER('%PSN9954%');



Having got the user_id we disable their session. A few versions ago this involved removing rows from a number of tables, but with the introduction of the background jobs life has become far easier. All we need to do is mark the record from the USESSION table by setting the delete_session_id to zero and giving the delete_date column a value, which I take from the system date. The example code below assumes the user_id is 123.



UPDATE usession

SET delete_session_id=0, delete_date=GETDATE()

WHERE user_id = 999;



So long as background jobs are running properly, and they should be, they will delete the user session record within a minute at most.



In order to give users the option to override their own sessions the following can be added to their PM.ini file:



[Database]



DeleteCurrentUserSessions=TRUE 



Note in P6 8.0 this is now available in the user interface of the Web Application.



For  more details see this article.



http://usingp6.com/administrator/2011/10/14/end-p6-user-session.html

Wednesday, February 22, 2012

Error CVRJC-0348-8 on Primavera

Posts

A User reported an error on Primavera today and I found the fix on the Oracel support Knowledgebase #Bug 9796699: EVENT CODE: 'CVRJC-0348-8' WHEN ACCESSING PROJECT USERS DIALOG SCREEN.

Run the following on the database..

DECLARE @RC int
DECLARE @pret_val int
DECLARE @pret_msg varchar(4000)
EXECUTE @RC = [PMDB_KTT_Corrupt].[dbo].[usession_clear_logical_deletes] @pret_val OUTPUT ,@pret_msg OUTPUT

GO

delete from PROJSHAR where load_status = 'O' and session_id not in (select session_id from usession) or session_id in (select session_id from usession where delete_session_id is not null);

GO

Everything works fine after that....