Friday, October 13, 2017

Integration FDMEE with ERP Fusion


Recently, I was asking to integrate FDMEE with ERP Fusion using the WSDL,

using the FusionCloudAdapter.sh and FusionCloudAdapter.py.

The ODI Log throws the following exception:


2017-10-11 13:20:36,490 ERROR [AIF]: Error in initializeFsGLCloudSource.
2017-10-11 13:20:36,491 FATAL [AIF]: Error in initializeFsGLCloudSource
Traceback (most recent call last):
  File "<string>", line 451, in initializeFsGLCloudSource
  File "<string>", line 475, in executeFusionService
  File "<string>", line 557, in executeJythonScript
  File "/u01/hyp/hyperion/EPMSystem11R1/products/FinancialDataQuality/bin/FusionCloud/FusionCloudAdapter.py", line 138, in <module>
    fusionCloudAdapter.extractCubeInformation()
  File "/u01/hyp/hyperion/EPMSystem11R1/products/FinancialDataQuality/bin/FusionCloud/FusionCloudAdapter.py", line 16, in extractCubeInformation
    self.fusionCloudHelper("extractCubeInformation")
  File "/u01/hyp/hyperion/EPMSystem11R1/products/FinancialDataQuality/bin/FusionCloud/FusionCloudAdapter.py", line 112, in fusionCloudHelper
    raise RuntimeError
RuntimeError

Reviewing OS Level and Application Level I realize that the file was asking about other permissions to be executable.

Solution:

chmod +x -Rf  * in the folder there the py  adapter  and the sh file es located.

Test the wsdl service located in cloud. -> Success.

Charms !


Thursday, June 8, 2017

Move Centos 7 Virtual Machine on Hyper-v to Oracle IaaS

A few months ago I had a requirement which was move an virtual machine with CentOS 7.2.1511 virtualized it at Hyper-v 10.0.14393.0 to Oracle IaaS.

In first place everything was well but when  I uploaded the image.tar.gz in Oracle IaaS Console was showing the next error:

[ [32m  OK  [0m] Started Show Plymouth Boot Screen.
[ [32m  OK  [0m] Reached target Paths.
[ [32m  OK  [0m] Reached target Basic System.
%G[    2.263078] tsc: Refined TSC clocksource calibration: 2992.789 MHz
[    2.473407] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input3
[  124.435211] dracut-initqueue[258]: Warning: dracut-initqueue timeout - starting timeout scripts

[  124.947098] dracut-initqueue[258]: Warning: dracut-initqueue timeout - starting timeout scripts


For to continue I describe my configuration:

Tools to use.
Hyper-v Hypervisor
Qemu-img utility

The Machine virtualized it in Hyper-v had vhdx format.

How to prepare the machine?

  • In "fstab file" verify that doesn´t exist external discs. comment or delete.
  • Edit the "ifcfg-eth0 file":
# vi /etc/sysconfig/network
BOOTPROTO="dhcp"
ONBOOT=yes
TYPE="Ethernet"
USERCTL="yes"
PEERDNS="yes"
IPV6INIT="no"
PERSISTENT_DHCLIENT="1"
  • service network restart
  • Edit the "network file":
# vi /etc/sysconfig/network
NETWORKING=yes
NOZEROCONF=yes

  • Edit the "grub file"
# vi /etc/default/grub
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap console=tty0 console=ttyS0,115200"
  • Activate the changes.
# grub2-mkconfig -o /boot/grub2/grub.cfg

How to converter the Virtual Machine to raw format?

Now. For to avoid the error:
[  124.947098] dracut-initqueue[258]: Warning: dracut-initqueue timeout - starting timeout scripts .
.
.
is very, very important add "dracut drivers" before to converter the image.




  • In the Virtual Machine CentOS 7 virtualized it Hyper-v, open a terminal an execute the next command:
# dracut --add-drivers "xen-blkfront xen-netfront" -force
  • Shutdown the machine.



  • Execute the next command for to convert the vhdx file to raw format.
qemu-img convert -f vhdx C:\Users\PC\Documents\Machines\centos1\Virtual" "Hard" "Disks\centos1.vhdx -O raw C:\Users\PC\Documents\Machines\centos1\Virtual" "Hard" "Disks\centos1.img
  • Now is necesary package the image created in tar format because is the format that Oracle IaaS accepted.
# tar -czvf centos1.raw.tar.gz centos1.img

Ready! Now upload the tar file to Oracle IaaS and you create an virtual Machine with the procedure mentioned here.

If you need to use private keys for authenticate execute the next commands before convert the vhdx file to raw format as mentioned here.
# yum install acpid
# systemctl enable acpid
# yum install cloud-init
# yum install cloud-utils-growpart

I hope will be useful for someone.
Regards!

Tuesday, April 11, 2017

Change ODI Supervisor Account



Sometimes, you have several boxes and environments, and make a lot of configurations and we don't really keep tracking of all actions done until certain point of time. When you need that password you realize that you don't have it.

In ODI there's a user SUPERVISOR, who controls the master configuration of the tool.

If you want to change it please do the following:

1.- Log in with the master repo user

2.- Execute the following statement:

update snp_user set pass='aYyH5kyea2TN2.YuxopAMy'  
where wuser_name = 'SUPERVISOR'

Where pass is the new encoded password, encoded with the ODI utility encode.sh

Location:
/product/111/odi_111/odi_111/oracledi/agent/bin/encoded.sh newpassword

sh encode.sh newPassword
aYyH5kyea2TN2.YuxopAMy

and once again!,  easy no?




Monday, April 10, 2017

Get the Admin account password in Weblogic Systems


Recently I had the entrust to get the admin account password of weblogic, so after a little bit searching in oracle documentation and web I used the following code:

The steps:

1.- Build script get_password.py

from weblogic.security.internal import *
from weblogic.security.internal.encryption import *
encryptionService = SerializedSystemIni.getEncryptionService(".")
clearOrEncryptService = ClearOrEncryptedService(encryptionService)

# Take encrypt password from user
pwd = raw_input("Paste encrypted password ({AES}fk9EK...): ")

# Delete unnecessary escape characters
preppwd = pwd.replace("\\", "")

# Display password
print "Decrypted string is: " + clearOrEncryptService.decrypt(preppwd)

2.- Set the environmental variables

sh $DOMAIN_HOME/bin/setDomainEnv.sh | source $DOMAIN_HOME/bin/setDomainEnv.sh

3.- Get the username and password

grep username $DOMAIN_HOME/servers/AdminServer/security/boot.properties | sed -e "s/^username=\(.*\)/\1/"
|
grep password $DOMAIN_HOME/servers/AdminServer/security/boot.properties | sed -e "s/^password=\(.*\)/\1/"

4.- cd $DOMAIN_HOME/security

java weblogic.WLST get_password.py


bash-3.2$ java weblogic.WLST get_password.py

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Paste encrypted password ({AES}fk9EK...): (OR USERNAME)

Decrypted string is: admin


Voilá!

Resources:
https://blogs.oracle.com

Update:

If your environment doesn't recognize your wlst command do the following:

 sh /$ENV/fmw/product/111/soa_111/common/bin/wlst.sh get_password.py

You must be located in $DOMAIN_HOME/security.


Friday, March 31, 2017

Release Sequence Lock Mediator - SOA 11g




SOA 11g, Oracle Mediator Resequencer which guarantees to maintain the desired message sequence in a reliable and robust manner.

You can implement the resequencer in Mediator by just selecting from the drop down box like below.


Now, coming to the topic. How to release the lock if there is any, 
  1. Normally these mediator would have been implemented with fault policies such as Manual Recovery. In that case go to EM console, navigate to Faults and Rejected Messages and enable "Show only recoverable faults". Click on "Recovery" icon and retry the instance.
  2. If suppose there isn't any Error handling techniques, search for the faulted instances and abort it.
  3. If nothing works, directly login to the Database with SOAINFRA schema. And use the below queries to  unlock the sequence.

Select *  from mediator_group_status where status!=0;
Update mediator_group_status set status=0 where status!=0;

Select *  from SCFS2O_SOAINFRA.mediator_group_status where status!=0;

Update SCFS2O_SOAINFRA.mediator_group_status set status=0 where status != 0;

Credits:

http://prabhasoablog.blogspot.mx/2016/02/how-to-release-sequence-lock-in-mediator.html

Tuesday, March 7, 2017

APEX 5.0 images not showing in different environment - Solution



Hi guys!

A few days ago, I migrated an APEX 5.0.4 application. In it I have used static files (used .png files to make some banners).
I wanted to test deployment to different environment - the same APEX version, exported the application using Export Utility (preserved app ID), imported in the other environment using Import ... and everything went smooth. Static files were imported also. But when I run the application they are not showing up.

I’ve searched in the net and I’ve found the next link:
https://chefdba.com/2016/03/23/validate-your-ords-installation/

Solutions.
1.      Using the .war file
Navigate to the location where you have the war file you used to install or upgrade the ORDS. You you should execute:
java -jar ords.war validate apex_database

Write user sys and password of your database.

2.      Manual Method.
You can extract the scripts from the war file. Navigate to validate/core from scripts directory and you you should execute as sysdba:
SQL> @ords_manual_validate.sql /u01/ords/log

NOTE: In case than you don’t have ords.war file, too can execute apex.war which located in Apex installation folder. 
you should execute:
java -jar apex.war validate apex_database

Write user sys and password of your database.

The images should now be displayed.

Regards!

Thursday, February 16, 2017

Send E-mail FDMEE + Jython

Customer asked me to send e-mail with atachment to multiples receivers

The code I wrote:

#------------------------------------------------------------------------------
# Oracle Send Mail with Atachment
#-------------------------------------------------------------------------------
import smtplib
import mimetypes
import email
import email.mime.application
import java.lang as lang
import decimal


fdmAPI.logInfo("Custom Script: Inicia envio de Correo HFDM")

strMsg = email.mime.Multipart.MIMEMultipart()
strOutPath = fdmContext['OUTBOXDIR']+"/reports/"
strInMailPath = fdmContext['INBOXDIR']+"/BMB_LOC_EMAIL/"
strEmailInfo = strInMailPath+"RemitDest.txt"
fdmAPI.logInfo("strOutPath: " + strOutPath)
fdmAPI.logInfo("strInMailPath: " + strInMailPath)
fdmAPI.logInfo("strEmailInfo: " + strEmailInfo)
flag="true"


try:
allItems=[]
recipient=[]
allRecipients=[]
filemail = open(strEmailInfo, 'rb')
for row in filemail.readlines():
items = row.split(':')
for item in items:
fdmAPI.logInfo("ITEMS:"+item)
allItems.append(item)
strSender = allItems[1]
fdmAPI.logInfo("strSender: "+strSender)
recipientStr= allItems[3]
fdmAPI.logInfo("recipientStr: "+recipientStr)
recipients = recipientStr.split('|')
for recipient in recipients:
fdmAPI.logInfo("recipient:"+recipient)
allRecipients.append(recipient)

except Exception, e:
print "Error: unable to open mail file: " + str(e)
recipient=[]
recipient=allRecipients
strSubject = "FDMEE Mensaje de Prueba"
strReceivers = recipient if type(recipient) is list else [recipient]
strMsg['Subject'] =  strSubject
strMsg['From'] = strSender
strMsg['To'] = ", ".join(strReceivers)
fdmAPI.logInfo("strMsgTo: " + strMsg['To'])

loadid_s = str(fdmContext['LOADID'])
strFileName = loadid_s + ".pdf"
strRelativeFilePath = strOutPath + strFileName
strTxt = "Se ha generado el reporte <b>"+strFileName+"</b> de Financial Dara Management Enterprise Edition <br> para mas detalle consulte <a href='https://WORKSPACE_URL/workspace/index.jsp'>FDMEE</a><br><img src='http://www.oracle.com/us/assets/oraclelogo.jpg'>"

body = email.mime.Text.MIMEText(strTxt,'html')
strMsg.attach(body)

fp=open(strRelativeFilePath,'rb')
att = email.mime.application.MIMEApplication(fp.read(),_subtype="pdf")
fp.close()

att.add_header('Content-Disposition','attachment',filename=strFileName)
strMsg.attach(att)


try:
smtpServer = smtplib.SMTP('ORACLE_SMTPSERVER:25')
smtpServer.starttls()
smtpServer.sendmail(strSender, strReceivers, strMsg.as_string())
print "Successfully sent email"
smtpServer.quit()

except Exception, e:
print "Error: unable to send email: " + str(e)



Easy no?