Wednesday, 13 November 2013

OMW Error Codes OMW project won't transfer

Ever wanted to know what that pesky OMW transfer error message code meant, here is the list of errors and what they mean in some meaningful text.

Make sure that you select the project, then the logging exit in OMW.  Then choose the "Transfer" entry and drill down to the object error messages.

Remember, if you get 47 your data sources are not set up in the release / data source map (fix with GH9011 -> environments menu)


0     Transaction was successful 
1     General error 
2    Transaction not supported 
3    SAR integration has been disabled 
4     Object already present in project 
5     Object not present in project 
6     User already in project 
7     User is not in project 
8     Attempting to add invalid object to project 
9     Attempting an unauthorized action 
10     Status activity rule is inactive 
11     Transfer Activity Rule is inactive 
12     Project name is user ID 
13     Project already exists 
14     Bad handle 
15     Could not initialize user 
16     Memory errors occurred 
17     Object creation errors occurred 
18     Invalid SAR number entered 
19     Can not create default project 
20     User canceled 
21     Project is non-existent 
22     Can not rename project 
23     Invalid status change attempted 
24     Invalid string entered 
25     Invalid type entered 
26     A required field is blank 
27     Invalid user id entered 
28     TAM errors have occurred 
29     RDB errors have occurred 
30     Parameter specified does not exist 
31     Token is available 
32     Token is not available 
33     Transfer rolled back per previous call 
34     Transfer failed to commit to rollback 
35     Transfer success reference decremented 
36     Transfer success commit rollback 
37     JITI fialed 
38     Start form dynamic failed 
39     Entry point not found 
40     Not licensed to access object 
41     Deadlock has occurred 
42     Object is currently checked out 
43     Object has already been transferred 
44     Locked by vocab overrides 
45     Not authorized to install 
46     TSE not authorized 
47     Transfer not compatible 
48     Column prefix is invalid 
49     Copy errors 
50     Invalid action for project type     
51     Project is at an invalid status 
52     Invalid object ID, project ID is a duplicate 
53     Invalid object ID, project ID is too long 
54     Invalid object ID, contains invalid characters 
55     Errors occurred while cleaning up specs 
56     Object does not exist 
57     Unknown object Librarian or Version data source
58     Could not initialize processing option data 
59     User security is not authorized 
60     Notification system is disabled 
61     SAR creation error 
62     Save location specified is not found 
63     No object to restore from  
64     There is another object in save location 
65     BSFN library in use 
66     Project already exists for SAR number specifed 
67     Role already assigned 
68     Can't remove user from SAR 
69     Token is inherited 
70     Linked project is at an inconsistent status 
71     Object already exists in an open project 
72     Object has not been checked out 
73     SAR status change error 
74     Inheritance status change error 
75     No Transfer Activity Rules exist for object 
76     Log Failure 
77     Objects are checked out 
78     Specified object is not checked out to this machine 
79     Objects are in token queue 
80     Source file does not exist 
81     Bad Transfer Activity Rule 
82     Queued for deletion 
83     Object marked for deletion 
84     Object has not been modified 
85     Mandatory rule exists  
86     Transfer Limitation exists  
87     Transfer Exception exists  
88     Attempting to transfer Version before Template 
89     Path Code release and SAR release incompatible  
90     Web Only Version Successful 
91     Invalid operation performed on Web Only Version 
92     Token not available for Web Only Version 

Monday, 11 November 2013

More on unicode conversion and JD Edwards

All of the heavy lifting is done in a stop red procedure, no matter what platform you login with.  This also shows that JD Edwards has the ability to call a stored proc in the middleware (well, that is my assumption).

So this is pretty handy, you can work out the variables by reading the code and then you can just call this with all of the tips and tricks you want!  Forcing parallelism might be a good start!


CREATE OR REPLACE PROCEDURE "JDEDBA"."OWTBLCONV" (szUseridIn    in  varchar2,
                                      szPasswdIn    in  varchar2,
                                      szCatalogIn   in  varchar2,
                                      szOwnerIn     in  varchar2,
                                      szTableNameIn in  varchar2,
                                      nFlag         in  integer,
                                      szPathIn      in  varchar2
                                      /* OLEDB has problems with out varchar fields. Temporarily comment this out,
                                      szReturnDesc out varchar2*/)
       authid current_user
is
  OW_SP_SUCCESS   constant integer := 0;
  OW_SP_ERROR     constant integer := -20101;
  TAB_NOT_EXIST   constant integer := -942;

  szOwner         varchar2(30);
  szTableName     varchar2(30);

  type ColCurTyp is ref cursor;
  tab_col_info    ColCurTyp;

  col_name        varchar2(30);
  col_type        varchar2(106);
  col_length      number;
  char_length     number;
  data_precision  number;

  sql_stmt        varchar2(10000):= null;
  insert_sql_stmt varchar2(4000) := null;
  select_sql_stmt varchar2(4000) := null;
  old_tab_name    varchar2(30)   := UPPER(szTableNameIn) || '_NONUNI';
  notFirstTime       boolean     := false;
  nCharCols          integer     := 0;

  tablespace      varchar2(30);
  initextent      number;
  nextextent      number;
  pctincrease     number;

  retcode         integer;
  errMsg          varchar2(512);
  szReturnDesc    varchar2(512);

begin
  if (szOwnerIn = null) or (szTableNameIn = null) then
     szReturnDesc := 'Error - Either table owner or name is null';
    RAISE_APPLICATION_ERROR(OW_SP_ERROR, szReturnDesc);
  end if;

  szReturnDesc := 'Success';
  szOwner      := UPPER(szOwnerIn);
  szTableName  := UPPER(szTableNameIn);

  begin
    SELECT TABLESPACE_NAME, INITIAL_EXTENT, NEXT_EXTENT, PCT_INCREASE INTO tablespace, initextent, nextextent, pctincrease FROM SYS.ALL_TABLES WHERE OWNER = UPPER(szOwnerIn) AND TABLE_NAME = UPPER(szTableNameIn);
  exception
    when no_data_found then
      dbms_output.put_line('Error: Table ' || szOwner || '.' || szTableName || ' does not exist');
      szReturnDesc := 'Error - Table ' || szOwner || '.' || szTableName || ' does not exist';
      RAISE_APPLICATION_ERROR(OW_SP_ERROR, szReturnDesc);
    when others then
      szReturnDesc := 'Error - ' || sqlerrm;
      RAISE_APPLICATION_ERROR(OW_SP_ERROR, szReturnDesc);
  end;

  SELECT COUNT(*) INTO nCharCols FROM SYS.ALL_TAB_COLUMNS WHERE OWNER = UPPER(szOwnerIn) AND TABLE_NAME = UPPER(szTableNameIn) AND DATA_TYPE IN ('CHAR', 'VARCHAR2', 'CLOB', 'LONG');
  if nCharCols = 0 then
   
    szReturnDesc := 'Success - No conversion needed for table ' || szOwner || '.' || szTableName;
    return;
  end if;

  sql_stmt := 'ALTER SESSION SET NLS_NCHAR_CONV_EXCP=TRUE';
  execute immediate sql_stmt;

  begin
    sql_stmt := 'DROP TABLE ' || szOwner || '.' || old_tab_name;
    execute immediate sql_stmt;
  exception
    when others then

      if (sqlcode != TAB_NOT_EXIST) then
        szReturnDesc := 'Error - ' || sqlerrm;
        RAISE_APPLICATION_ERROR(OW_SP_ERROR, szReturnDesc);
      end if;
  end;

  sql_stmt := 'ALTER TABLE ' || szOwner || '.' || szTableName || ' RENAME TO ' || old_tab_name;

  execute immediate sql_stmt;

  sql_stmt := 'SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH, DATA_PRECISION, CHAR_LENGTH FROM SYS.ALL_TAB_COLUMNS WHERE OWNER = :1 AND TABLE_NAME = :2 ORDER BY COLUMN_ID';

  open tab_col_info for sql_stmt using szOwner, old_tab_name;

  sql_stmt := 'CREATE TABLE ' || szOwner || '.' || szTableName || '(';

  insert_sql_stmt := 'INSERT INTO ' || szOwner || '.' || szTableName || '(';
  select_sql_stmt := ' SELECT ';
   
  loop
    fetch tab_col_info into col_name, col_type, col_length, data_precision, char_length;
    exit when tab_col_info%notfound;

    if (notFirstTime = true) then
      sql_stmt := sql_stmt || ', ';
      insert_sql_stmt := insert_sql_stmt || ', ';
      select_sql_stmt := select_sql_stmt || ', ';
    end if;

    case col_type
      when 'CHAR' then col_type := 'NCHAR';
      when 'VARCHAR2' then col_type := 'NVARCHAR2';
      when 'CLOB' then col_type := 'NCLOB';
      else
        null;
    end case;

    if (col_type = 'LONG') then
      sql_stmt := sql_stmt || col_name || ' ' || 'NCLOB';
    else
      sql_stmt := sql_stmt || col_name || ' ' || col_type;
    end if;
    insert_sql_stmt := insert_sql_stmt || col_name;

    if (col_type = 'NCHAR') or (col_type = 'NVARCHAR2') then
      sql_stmt := sql_stmt || '(' || char_length || ')';
      select_sql_stmt := select_sql_stmt || 'TO_NCHAR(' || col_name || ')';
    elsif (col_type = 'NCLOB') then
     
      select_sql_stmt := select_sql_stmt || 'TO_NCLOB(' || col_name || ')';
    elsif (data_precision is not null) and (col_type = 'NUMBER') then
      sql_stmt := sql_stmt || '(' || data_precision || ')';
      select_sql_stmt := select_sql_stmt || col_name;
    elsif (col_type = 'LONG') then
      select_sql_stmt := select_sql_stmt || 'TO_LOB(' || col_name || ')';
    else
      select_sql_stmt := select_sql_stmt || col_name;
    end if;

    notFirstTime := true;
  end loop;

  close tab_col_info;

  sql_stmt := sql_stmt || ')';
  if tablespace is not null then
    sql_stmt := sql_stmt || ' TABLESPACE ' || tablespace;
  end if;
  sql_stmt := sql_stmt || ' STORAGE (';
  if initextent >= 1000 then
    sql_stmt := sql_stmt || 'INITIAL ' || initextent;
  end if;
  if nextextent >= 1000 then
    sql_stmt := sql_stmt || ' NEXT ' || nextextent;
  end if;
  if pctincrease >= 0 then
    sql_stmt := sql_stmt || ' PCTINCREASE ' || pctincrease || ')';
  else
    sql_stmt := sql_stmt || ' PCTINCREASE 0)';
  end if;

  insert_sql_stmt := insert_sql_stmt || ')';

  execute immediate sql_stmt;

  sql_stmt := 'GRANT ALL ON ' || szOwner || '.' || szTableName || ' TO PUBLIC';
  execute immediate sql_stmt;

  sql_stmt := 'ALTER TABLE ' || szOwner || '.' || szTableName || ' NOLOGGING';
  execute immediate sql_stmt;
  sql_stmt := 'ALTER TABLE ' || szOwner || '.' || old_tab_name || ' NOLOGGING';
  execute immediate sql_stmt;

  select_sql_stmt := select_sql_stmt || ' FROM ' || szOwner || '.' || old_tab_name;

  execute immediate insert_sql_stmt || select_sql_stmt;

  retcode := jde_unicode_create_index(szOwner, old_tab_name, szOwner, szTableName, errMsg);
  if retcode = OW_SP_ERROR then
   
    szReturnDesc := errMsg;
    return;
  end if;
  if errMsg is not null then
    szReturnDesc := szReturnDesc || ' - ' || errMsg;
  end if;

  commit;

  sql_stmt := 'ALTER TABLE ' || szOwner || '.' || szTableName || ' LOGGING';
  execute immediate sql_stmt;

 
  sql_stmt := 'DROP TABLE ' || szOwner || '.' || old_tab_name;
  execute immediate sql_stmt;

  return;
exception
  when others then
    dbms_output.put_line('Error: ' || sqlerrm);
    szReturnDesc := 'Error - ' || sqlerrm;
    RAISE_APPLICATION_ERROR(OW_SP_ERROR, szReturnDesc);
end owtblconv;

Simple UDC sync when upgrading. Merge F0005 and F0004

For a multitude of reasons I have issues when doing upgrades and ensuring all of the UDC's from PS910 have been merged into my custom ones.  Generally I run a script to identify and then insert any UDC's from PS910 into my upgraded environment.  Please see the following SQL that will add any F0004 or F0005 records from PS if they are not in your target schemas:

In my example DVFINCTL has just been upgraded and is missing some records.

insert into DVFINCTL.F0004
select * from ps910ctl.f0004 t1
where not exists
(select 1 from DVFINCTL.f0004 t2
where t1.dtsy = t2.dtsy
and t1.dtrt = t2.dtrt);
commit ;

insert into DVFINCTL.F0005
select * from ps910ctl.f0005 t1
where not exists
(select 1 from DVFINCTL.f0005 t2
where t1.drsy = t2.drsy
and t1.drrt = t2.drrt
and t1.drky = t2.drky);
commit;

Another method I use for this is with IMP and EXP and oracle.  You could exp the contents of PS to a file and then import with ROWS_ONLY over the top of your other environment.  Oh oracle, you give me so many ways to skin my cat!


Saturday, 9 November 2013

P93091 unicode conversion in JD Edwards

P93091 is pretty much all you need to know.

The top button builds a list of all "Non unicode" data sources in the system.  This list is based on the "System" datasource in your ini file, therefore if you run it from the deployment server, it'll use the planner F98611.  This might not be what you want.  This run R930811, I run it locally.  It actually won't run in DEP / planner - so I recommend using a normal fat client.

The second button allows you to work with the results of the first.  Despite the confusing interface, you need to double click a row (till the green tick appears) and then tick the "build information" tick box too.  Once this is done and you select OK the job starts processing. R930912 runs and will hopefully build your list of tables to convert.  The list is called UniDataConv.xml in your install dir in a dir called script.  Note that this report works off sys tables / all_objects and not OL to list the tables, as you'll see tables mentioned that are not in OL.

If there are ANY errors in the data source that you specify, none of the tables will be written to the uniDataConv file, so you need to make sure that it's pretty clean.

Wow, it's hard to cut and paste the XML and see the actual characters...

I'll upload the file somewhere  https://drive.google.com/file/d/0B30UFGvbR-EjNEt3d001MXRmZWM/edit?usp=sharing













F964001


F96401


F96402


F9640S


F96411


F96450


F9649


F96491


F96492


F9660


F980011


F980014


F980021


F9801NEW


F9801OLD


F98231D


F98231H


F98301


F983061


F98610


F9880


F9890


F98TC002


F98TC01


F98TC03


F98TCDTL


F98TCHDR


F99102D


F99RDDS


FF31112T


FF31113T


FF3112ST


FF3113ST








Business Data - TEST








You then need to run UnicodeDataConv.exe  from your bin32 dir on the fatty that has the file in the script dir.

Thursday, 24 October 2013

When deciding on a port for a JAS instance, consider this

I generally use something like 81 - DV, 82 - PY, 83 - UA etc.  or put a 9081, 9082 etc.

It starts to get a little more complicated with BSSV and SSL, but not too much.  Leave at least 1 port between your instances if you are using SSL.

Here is a handy list of default oracle ports that you can also avoid:
Component or ServiceDefault Port NumberAllotted Port Range
Oracle Business Activity Monitoring90019000-9080
Oracle Directory Integration Platform70057005-9000
Oracle Directory Services Manager70057005-9000
Oracle Forms Services Managed Server90019001-9100
Oracle HTTP Server non-SSL Listen Port77777777-7877
Oracle HTTP Server SSL Listen Port44434443-4543
Oracle Imaging and Process Management1600016000
Oracle Identity Federation Server Managed Server74997499-9000
Oracle Internet Directory (non-SSL)30603061 to 3070,
13060 to 13070
Oracle Internet Directory (SSL)31313132 to 3141,
13131 to 13141
Oracle Management Agent (used by Fusion Middleware Control)51625162-6162
Oracle Notification Server Local Port61006100 - 6199
Oracle Notification Server Remote Port62006200 - 6299
Oracle Notification Server Request Port60036003 - 6099
Oracle Portal Managed Server90019001-9100
Oracle Reports Managed Server90019001-9100
Oracle Virtual Directory (non-SSL)65016501-6510
Oracle Virtual Directory (SSL)75017501-7510
Oracle Web Cache Administration Port77867781-7790
Oracle Web Cache Invalidation Port77887781-7790
Oracle Web Cache Listen Port77857781-7790
Oracle Web Cache SSL Listen Port77897781-7790
Oracle Web Cache Statistics Port77877781-7790
Oracle WebCenter Discussions Server88908881-8890
Oracle WebCenter Portlets88898881-8890
Oracle WebCenter Spaces88888881-8890
Oracle WebCenter Wiki and Blog Server88908881-8890
Oracle WebLogic Server Listen Port for Administration Server70017001-9000
Oracle WebLogic Server Listen Port for Managed Server80018000 - 8080
Oracle WebLogic Server Node Manager Port55565556
Oracle WebLogic Server SSL Listen Port for Administration Server70027002-9000

Monday, 14 October 2013

JD Edwards scheduled jobs table demystification

A fairly quick post.  Ever wanted to list the JD Edwards scheduled jobs, when they start, recurrence type, etc etc...  It's not as easy as you think.  There are lots of things going on in that F91300 that need to be decrypted.

Here is something that helped me:

Dump them all into excel, that is a good start.

The following can be used to decipher the recurrence type: (SJSCHRCRTYP)

01
Custom Recurrence
11
Daily - Mode 1
12
Daily - Mode 2
21
Weekly - Mode 1
31
Monthly - Mode 1
32
Monthly - Mode 2
41
Period - Mode 1
42
Period - Mode 2
51
Yearly - Mode 1
52
Yearly - Mode 2


Here are some excel formlas to help you convert the EPOCH (of course bespoke JDE version, which is in minutes) to standard date and time.

time scheduled (UTC)
JDE Vers x 60
start time (UTC)
With DST start time
17964814
1077888840
1:34:00 PM
11:34:00 PM
17964817
1077889020
1:37:00 PM
11:37:00 PM
17964933
1077895980
3:33:00 PM
1:33:00 AM
17964934
1077896040
3:34:00 PM
1:34:00 AM
17964935
1077896100
3:35:00 PM
1:35:00 AM
17964813
+I7*60
=+(J7/86400)+25569
=+K7+TIME(10,,)


The formulas are in the last row.

The combination of the recurrence type, the start time and the table below (showing you weekday / day of month runtime options will help.

Monthly will have a value for the day of the month in SJSCHDAY
Weekly look for the columns that are populated (SJTUESDAY etc)

Here are the table columns

SJSCHJBTYP                              NCHAR(2)                                                                                                                                                                                      
SJSCHJBNM                      NOT NULL NCHAR(30)                                                                                                                                                                                     
SJSCHRPTNM                              NCHAR(10)                                                                                                                                                                                     
SJSCHVER                                NCHAR(10)                                                                                                                                                                                     
SJPROCNAME                              NCHAR(10)                                                                                                                                                                                     
SJSCHSTTIME                             NUMBER                                                                                                                                                                                        
SJSCHENTIME                             NUMBER                                                                                                                                                                                        
SJNUMJOBOCC                             NUMBER                                                                                                                                                                                        
SJCURRUNCNT                             NUMBER                                                                                                                                                                                        
SJMAXRESUB                              NUMBER(15)                                                                                                                                                                                    
SJSCHJBSTAT                             NCHAR(2)                                                                                                                                                                                      
SJSCHENHV                               NCHAR(10)                                                                                                                                                                                     
SJSCHJOBSVR                             NCHAR(30)                                                                                                                                                                                     
SJSCHUSER                               NCHAR(10)                                                                                                                                                                                     
SJSCHPSWD                               NCHAR(10)                                                                                                                                                                                     
SJSCHROLE                               NCHAR(15)                                                                                                                                                                                     
SJJDELOG                                NCHAR(1)                                                                                                                                                                                      
SJTRACING                               NCHAR(1)                                                                                                                                                                                      
SJUBELOGLVL                             NCHAR(1)                                                                                                                                                                                      
SJSCHPI                                 NCHAR(1)                                                                                                                                                                                      
SJPNTR                                  NCHAR(30)                                                                                                                                                                                     
SJJOBQUE                                NCHAR(10)                                                                                                                                                                                     
SJRESBONERR                             NCHAR(2)                                                                                                                                                                                      
SJRESBTIME                              NUMBER                                                                                                                                                                                        
SJINPRTMOTPY                            NCHAR(2)                                                                                                                                                                                      
SJINPRMAX                               NUMBER                                                                                                                                                                                        
SJINPRTMOUT                             NUMBER                                                                                                                                                                                        
SJJOBEXPIRE                             NUMBER                                                                                                                                                                                        
SJSCHRCRTYP                             NCHAR(2)                                                                                                                                                                                      
SJCO                                    NCHAR(5)                                                                                                                                                                                      
SJSCHNUMMNS                             NUMBER                                                                                                                                                                                        
SJSCHNUMHRS                             NUMBER                                                                                                                                                                                        
SJSCHNUMDY                              NUMBER                                                                                                                                                                                        
SJSCHNUMWKS                             NUMBER                                                                                                                                                                                        
SJSCHNUMMN                              NUMBER                                                                                                                                                                                        
SJSCHDAY                                NCHAR(1)                                                                                                                                                                                      
SJWEEKDAY                               NCHAR(1)                                                                                                                                                                                      
SJWEEKEND                               NCHAR(1)                                                                                                                                                                                      
SJMONDAY                                NCHAR(1)                                                                                                                                                                                      
SJTUESDAY                               NCHAR(1)                                                                                                                                                                                      
SJWEDNESDAY                             NCHAR(1)                                                                                                                                                                                      
SJTHURSDAY                              NCHAR(1)                                                                                                                                                                                      
SJFRIDAY                                NCHAR(1)                                                                                                                                                                                      
SJSATURDAY                              NCHAR(1)                                                                                                                                                                                      
SJSUNDAY                                NCHAR(1)                                                                                                                                                                                      
SJTIMEZONES                             NCHAR(2)                                                                                                                                                                                      
SJDAYLIGHTSV                            NCHAR(1)                                                                                                                                                                                      
SJDSAVNAME                              NCHAR(10)                                                                                                                                                                                     
SJSCHCTCD01                             NCHAR(6)                                                                                                                                                                                      
SJSCHCTCD02                             NCHAR(6)                                                                                                                                                                                      
SJSCHCTCD03                             NCHAR(6)                                                                                                                                                                                      
SJSCHCTCD04                             NCHAR(6)                                                                                                                                                                                      
SJSCHCTCD05                             NCHAR(6)                                                                                                                                                                                      
SJSCHFU1                                NUMBER                                                                                                                                                                                        
SJSCHFU2                                NUMBER                                                                                                                                                                                        
SJSCHFU3                                NCHAR(30)                                                                                                                                                                                     
SJSCHFU4                                NCHAR(30)                                                                                                                                                                                     
SJUSER                                  NCHAR(10)                                                                                                                                                                                     
SJPID                                   NCHAR(10)                                                                                                                                                                                     
SJJOBN                                  NCHAR(10)                                                                                                                                                                                     
SJUPMJ                                  NUMBER(6)                                                                                                                                                                                     
SJUPMT                                  NUMBER                                                                                                                                                                                        
SJSCHPWD                                BLOB()