Wednesday, 16 December 2015

Demantra User Refresh


Refresh Demantra USER :

 

  1. Export the source data.
     
    expdp schemas=DEMANTRA directory=DM_DIR dumpfile=demantra.dmp logfile=demantra.log compression=all
     
  2. Drop the demantra user in the destination.
  3. Import the demantra schema .

impdp directory=DM_DIR dumpfile=demantra.dmp logfile=imp_demantra.log schemas=DEMANTRA PARALLEL=5

  1. Change the demantra password to same as old one.
  2. Run gather stats.
  3.  
    exec dbms_stats.gather_schema_stats(ownname => 'DEMANTRA' , estimate_percent =>dbms_stats.auto_sample_size, cascade =>tr
    ue,degree =>6);
     
  4. Update the Adminurl in the sys_parames table from BM.
     C:\Program Files (x86)\Oracle Demantra Spectrum1224\Demand Planner\DeskTop\modular
     Pass the dm user and passowrd.
     Under parameters à system parametersàchange AppServerURL and save.
     
     
     
     
  5. Run sys_grants.sql
    C:\Program Files (x86)\Oracle Demantra Spectrum1224\Demand Planner\Database Objects\Oracle Server\admin\sys_grants.sql
     
    Sqlplus  sys@tnsname as sysdba
    Sql> @sys_grants.sql DEMANTRA /sys/acls/demantra.xml  /sys/acls/demantra.xml
     
  6. Recreate the war file
    C:\Program Files (x86)\Oracle Demantra Spectrum1224\Collaborator\DEMTST\create_war.bat
     
    File create under  location :
    C:\Program Files (x86)\Oracle Demantra Spectrum1224\Collaborator
     
  7. Copy new war file to the applciation server
     
  8. Restart the Demantra applciation.
     

NOTE : If the windows server is new  one and already not install demantra on  it then you need to install the demantra all versions according to the demantra.version_details_history table. Please refer NOTEID : 1354934.1

Install Demantra on a new machine - with a new standard / dummy db schema that will be droped next point/ - matching the exact version in version_details_history - last release

-- apply any patches as in main instance

 Drop dummy schema and import the actual schema.

 

ISSUE 1 :

 

 

After refresh the schema dm user password  not working for the  Business moduler  but working the collaborator workbench password ,then do below sterps.

 

  1. From collaborator change the db password  right side screen ,Administrationà Change password  and change the DM passowrd .
  2. Run sys_grants.sql
  3.  And connect to BM and check.
  4. IF want same as old password do step1 again.

Change the password after refresh the DEMANTRA SCHMA :


 

 



 

 

Tuesday, 15 December 2015

ERRORS During 12.2.4 Upgrade

Error 1:




If WF_DEFERRED_R Invalid then upgrade patch 12.2.4 failed with below Error :


R12: "ORA-04063: rule set "APPLSYS.WF_DEFERRED_R" has errors" Error When Attempting to Apply Patch 6435000


select object_name, object_type, status from dba_objects where object_name='WF_DEFERRED_R' ;




FIX :  NoteID :553673.1


set serverout on
declare
lagent sys.aq$_agent;
subscriber_exist exception;
pragma EXCEPTION_INIT(subscriber_exist, -24034);
begin
lagent := sys.aq$_agent('WF_DEFERRED',null,0);
dbms_aqadm.add_subscriber(
queue_name =>'APPLSYS.WF_DEFERRED',
subscriber=>lagent,
rule=>'1=1');
exception
when subscriber_exist then
-- just add the rule if subscriber exists
dbms_aqadm.alter_subscriber(queue_name =>'APPLSYS.WF_DEFERRED',
subscriber=>lagent,
rule=>'1=1');
end;





ERROR 2:




adwork018.log:ORA-04043: object PO_ASL_API_ERROR_REC does not exist
adwork019.log:ORA-20001: Could not apply Crossedition Trigger
adwork019.log:"APPS"."PA_COST_DISTRIBUTION_LINES_F1": ORA-06502: PL/SQL: numeric or value
adwork019.log:ORA-06512: at "APPS.AD_ZD", line 29
adwork019.log:ORA-06512: at "APPS.AD_ZD_TABLE", line 21
adwork019.log:ORA-06512: at "APPS.AD_ZD_TABLE", line 1703
adwork019.log:ORA-06512: at line 1
adwork020.log:ORA-20001: Could not apply Crossedition Trigger
adwork020.log:"APPS"."PA_COST_DISTRIBUTION_LINES_F1": ORA-06502: PL/SQL: numeric or value
adwork020.log:ORA-06512: at "APPS.AD_ZD", line 29
adwork020.log:ORA-06512: at "APPS.AD_ZD_TABLE", line 21
adwork020.log:ORA-06512: at "APPS.AD_ZD_TABLE", line 1703
adwork020.log:ORA-06512: at line 1



FIX : Need to Run @bug14296972_apply.sql Available in the $ORACLE_HOME/admin/scripts


SQL>  desc sys.DBMS_PARALLEL_EXECUTE_TASK$
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 TASK_OWNER#                               NOT NULL NUMBER
 TASK_NAME                                 NOT NULL VARCHAR2(128)
 CHUNK_TYPE                                NOT NULL NUMBER
 STATUS                                    NOT NULL NUMBER
 TABLE_OWNER                                        VARCHAR2(30)
 TABLE_NAME                                         VARCHAR2(30)
 NUMBER_COLUMN                                      VARCHAR2(30)
 CMT                                                VARCHAR2(4000)
 JOB_PREFIX                                         VARCHAR2(30)
 STOP_FLAG                                          NUMBER
 SQL_STMT                                           CLOB
 LANGUAGE_FLAG                                      NUMBER
 EDITION                                            VARCHAR2(32) APPLY_CROSSEDITION_TRIGGER                         VARCHAR2(32)
 FIRE_APPLY_TRIGGER                                 VARCHAR2(10)
 PARALLEL_LEVEL                                     NUMBER
 JOB_CLASS                                          VARCHAR2(30)





Edition  size should be varchar2(32) length previously it was 30




ERROR 3 :  Prepare phase will fail  with below error


adop is not able to detect any valid application tier nodes in
          ADOP_VALID_NODES table.




Fix : Error due to invalid entry in the    ADOP_VALID_NODES  after AD/TXK patches


Node            Status
 ----------------------------------------------
 nodename    multiple entries for PATCH context file found
ERROR:
Nodes with context files in the FND_OAM_CONTEXT_FILES table on both run and patch file systems: NONE
Nodes without context files in the FND_OAM_CONTEXT_FILES table on either/or run and patch file systems:
Corrective Action:
- If the run file system context file for a node is missing, run AutoConfig on the run file system of that node to sync with the value with the database.
- If the patch file system context file of a node is missing, run AutoConfig on the patch file system of that node with the -syncctx option as follows to sync with the
value with the database.
On UNIX:
 sh <AD_TOP>/bin/adconfig.sh contextfile=<CONTEXT_FILE> -syncctx
On Windows:
 <AD_TOP>\bin\adconfig.cmd contextfile=<CONTEXT_FILE> -syncctx
Exiting validations as further tests will break.




1. Connect to SQL*PLUS as "APPLSYS" user.

2. Backup the FND_OAM_CONTEXT_FILES table.

SQL> CREATE TABLE fnd_oam_context_files_bak AS SELECT * FROM fnd_oam_context_files;

3. Truncate the FND_OAM_CONTEXT_FILES table.
SQL> TRUNCATE TABLE fnd_oam_context_files;
Take complete Application down.
cd $ADMIN_SCRIPTS_HOME
sh adstpall.sh apps/apps




4. Run Autoconfig on database and all nodes at RUN using:
Run Autoconfig on db tier.
sh  $ORACLE_HOME/appsutil/scripts/.../adautocfg.sh
Run Autoconfig on apps tier.
cd $ADMIN_SCRIPTS_HOME
sh adautocfg.sh


5 - Executed on the RUN file system to upload the PATCH context file:
copy command line by line and run on appstier.
replace PATCH_CONTEXT_FILE with full path.
$ADJVAPRG oracle.apps.ad.autoconfig.oam.CtxSynchronizer \
action=upload \
contextfile=<PATCH_CONTEXT_FILE>\
logfile=/tmp/patchctxupload.log


6. Re run failed Prepare session