Saturday, November 25, 2017

How to define a PATH for Oracle Reports Server 11G

Hello guys,

Today I am going to help you to define the Reports PATH for Oracle Reports Server 10G and 11G. Sometimes you can set up a report, but then you can get the message:

REP-52005: The specified key for the report does not exist in the keymap file



That means that the cgicmd.dat file does not have the mapping for your report. So, you need to add it like this:

E.g.:

Online Report (Thiago) Reports
THIAGO_REPORT: report=THIAGO_REPORT.rdf userid=tleoncio/***@thg destype=cache desformat=pdf %P

; Online Overtime
OP_REP: report=OP.rdf userid=tleoncio/***@thg destype=cache desformat=pdf %P

Then if you do the mapping properly, you can probably start getting these other errors:


REP-110: Unable to open file 'THIAGO_REPORT.RDF' 
REP-1070: Error while opening or saving a document. 
REP-0110: Unable to open file 'THIAGO_REPORT.RDF'



This is because now you need to define the reports path that is mapped into your cgicmd.dat file. So, you have to options:

1-It is going to your reports.sh file and add the path that your Oracle report is and save it.
2- The second option is more elegant, where you define it based on the reports server EM below.

Go to EM:
1-Open the following URL for Enterprise Manager console of 11G Forms and Reports.
HTTP://<ip-address:7002>/em

2-From the left panel, click on Report server name, e.g., rep_ag1.

3-Expand the Reports from the top and expand Administration and click on Advanced configuration.

4-Edit the value of the Report Source Directory and Reports Temp Directory.
Report Source Directory= Path to the directory where the reports are placed.
Report Temp Directory=Path to the directory where you want to create the temporary files of reports at runtime.

5-Expand the Reports from the top expand Administration and click on Basic configuration.

6-On the next window, there is an Environment Configuration Box. Give Environment name in the Add a new Environment Field, & click on Add Environment button.
Give the REPORTS_PATH variable in the name field and give the path in the value And then click on the apply button.


7- Note: If you choose this option, don't give the path in reports.sh file, as the path is defined during this process.

8-After make changes restart the report server.






9- Test the reports, please. It now should work just fine.

Have fun and happy coding.

Thiago Leoncio.

OIM-Sandbox Errors and Fixes

Hello everyone, today I am going to share some errors in OIM I have had, and how I was able to fix them:

===================
OIM ERROR #1:----
===================
[ART][ERROR]: Importing a sandbox I got this issue.
oracle.mds.exception.MDSRuntimeException: MDS-01161: Reference "/__MACOSX/sandbox_thiago/._oracle" has an invalid character ".".

FIX: Inside of my structure there is a .DS_Store file created that needs to be deleted.

drwxr-xr-x@ 3 tleoncio  staff    96 Aug 26 11:04 site
drwxr-xr-x@ 3 tleoncio  staff    96 Aug 26 11:04 ..
-rw-r--r--@ 1 tleoncio  staff  6148 Aug 26 11:07 .DS_Store
drwxr-xr-x@ 4 tleoncio  staff   128 Aug 26 11:07 .



===================
OIM ERROR #2:----
===================
the sandbox was failling with the import I made.

[2016-08-26T18:54:47.185-04:00] [oim_server1] [ERROR] [] [oracle.adfinternal.view.faces.renderkit.rich.GridCellRenderer] [tid: [ACTIVE].ExecuteThread:
'12' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: da406a06cc043240:521ad640:1742c4fbcc3:-8000-0000000000004ae6,0]
 [APP: oracle.iam.console.identity.self-service.ear#V2.0] [DSID: 0000NGgpOZtDoYILUqs1yc1VHflP00000I] Error: gridCell required panelGridLayout and/or
 gridRow ancestors not found for gridCell clientId="pt1:_d_reg:region0:1:e9118813506".


FIX: 
1-Removed the grid cell from the page self-service-compliance.jsff  this: 

<af:gridCell xmlns:af="http://xmlns.oracle.com/adf/faces/rich" id="e9118813506" halign="center">

2-then it is now this:
  
<?xml version='1.0' encoding='UTF-8'?>
<mds:customization version="11.1.1.66.73" xmlns:mds="http://xmlns.oracle.com/mds" motype_local_name="root" motype_nsuri="http://java.sun.com/JSP/Page">
  <mds:insert parent="gc4" position="last">
      <oim:DashboardBox xmlns:oim="/componentLib1" instructionText="Reports per Organization - Opera" titleText="Test Page" image="/images/Dashboard/myAccess.png" hoverImage="/images/Dashboard/identityAudit_s2.png" iconClickable="true" id="e726836058"
     iconClickAction="#{backingBeanScope.dashboardNavigationBean.launchTaskFlow}">

        <af:clientAttribute xmlns:af="http://xmlns.oracle.com/adf/faces/rich" name="taskFlowId" value="/WEB-INF/oracle/iam/ui/custom/test-flow.xml"/>
        <af:clientAttribute xmlns:af="http://xmlns.oracle.com/adf/faces/rich" name="title" value="Test Page"/>

     </oim:DashboardBox>
   </mds:insert>
   <mds:replace node="gc3"/>
   <mds:replace node="gc1"/>
</mds:customization>
  

===================
OIM ERROR #3:----
===================
 Reason for this error: 
  THIS WAS BECAUSE THE LIB FILE THAT HAS TO BE ADDED ON WEB-INF\LIB ON THE WAR FILE WAS NOT PROPERLY ADDED 
  
  [oracle.iam.ui.custom-dev-starter-pack.war WEB-INF/lib/adflibOIMTF1.jar]
[2016-08-26T19:11:31.523-04:00] [oim_server1] [ERROR] [] [oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider] [tid: [ACTIVE].ExecuteThread: '8' for queue:
'weblogic.kernel.Default (self-tuning)'] [userId: xelsysadm] [ecid: da406a06cc043240:521ad640:1742c4fbcc3:-8000-0000000000004e60,0] [APP: oracle.iam.console.identity.self-service.ear#V2.0]
[DSID: 0000NGgpOZtDoYILUqs1yc1VHflP00000I] [[
oracle.adf.controller.ControllerException: ADFC-02001: The ADF Controller cannot find '/WEB-INF/oracle/iam/ui/custom/test-flow.xml'.
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getMetadataObjects(MdsMetadataResourceProvider.java:512)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.loadUnmutableMetadataResources(MdsMetadataResourceProvider.java:402)
  ....
  at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: oracle.adf.controller.ControllerException: ADFC-02001: The ADF Controller cannot find '/WEB-INF/oracle/iam/ui/custom/test-flow.xml'.
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getMetadataObjects(MdsMetadataResourceProvider.java:512)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.loadUnmutableMetadataResources(MdsMetadataResourceProvider.java:402)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getResources(MdsMetadataResourceProvider.java:202)
at oracle.adfinternal.controller.metadata.provider.mds.MdsMetadataResourceProvider.getResources(MdsMetadataResourceProvider.java:180)
at oracle.adfinternal.controller.metadata.MetadataServiceImpl.getTaskFlowDefinition(MetadataServiceImpl.java:203)
at oracle.adfinternal.controller.activity.TaskFlowCallActivityLogic.findTaskFlowDefinition(TaskFlowCallActivityLogic.java:1084)
at oracle.adfinternal.controller.activity.TaskFlowCallActivityLogic.invokeTaskFlow(TaskFlowCallActivityLogic.java:240)
at oracle.adfinternal.controller.engine.ControlFlowEngine.invokeTaskFlow(ControlFlowEngine.java:221)
... 79 more
Caused by: oracle.mds.core.MetadataNotFoundException: MDS-00013: no metadata found for metadata object "/WEB-INF/oracle/iam/ui/custom/test-flow.xml"
MDS-00201: PDocument not found in MetadataStore : [store-type=DefaultMetadataStore app-name=oracle.iam.console.identity.self-service.ear(V2.0) lookup-order=ServletContext,Classpath]
at oracle.mds.core.MetadataObject.getBaseMO(MetadataObject.java:1598)


FIX: 
  
1-Added the jar file in the war using zip command below
  
zip -r oracle.iam.ui.custom-dev-starter-pack.war WEB-INF/lib/adflibOIMTF1.jar

tleoncio@tleoncio-mac sandbox % zip -r oracle.iam.ui.custom-dev-starter-pack.war WEB-INF/lib/adflibOIMTF1.jar
  adding: WEB-INF/lib/adflibOIMTF1.jar (deflated 73%)

2-then copy the war file to the OIM server :
  
  scp oracle.iam.ui.custom-dev-starter-pack.war oracle@tleoncio-server:/u01/app/oracle/middleware/Oracle_OIM1/server/apps/oracle.iam.ui.custom-dev-starter-pack.war

3-Then I bounce OIM.

  
I hope this helps,
Thiago Leoncio.

Saturday, November 4, 2017

Insufficient access rights to perform the operation error in Azure AD Connect

Hello team,

If you're getting Insufficient access rights to operate your Azure AD Connect synchronization logs, do the following:


STEP 1 - Make sure you have the latest version of Azure AD Connect installed: https://www.microsoft.com/en-us/download/details.aspx?id=47594

STEP 2 - If you're syncing passwords, make sure that your sync service account has Replicate Directory Changes and Replicate Directory Changes All permissions in your on-premises Active Directory

STEP 3 - Make sure that your sync service account has to write permissions on your sourceAnchor attribute (which is most likely set to ms-ds-consistencyGuid). You can do that either using the user interface, or PowerShell, which is easier:

$accountName = "DOMAINNAME\USERNAME" #[this is the account that will be used by Azure AD Connect Sync to manage objects in the directory.



$ForestDN = "DC=DOMAINNAME,DC=SOMETHING"



$cmd = "dsacls '$ForestDN' /I:S /G '`"$accountName`":WP;ms-ds-consistencyGuid;user'"



Invoke-Expression $cmd

STEP 4 - Make sure that inheritance is turned on for the AD objects that get errors in the synchronization logs. To do that

4.1-Open Active Directory Users and Computers

4.2-Enable the Advanced features in the View settings and,

4.3-Open up the user object that can't sync.

4.4-Go to the security tab and then into advanced.

4.5-Check to make sure the box is checked to inherit permissions. But before you do that make sure that the enabling inheritance will not bring down some grants that you do not want to be there.

Have fun,
Thiago Leoncio

How to Create and use Snapshots in Kubernetes

Objective


Today I am going to show how to create snapshots in Kubernetes. This is really helpful in case you want to manage or mitigate the risk of losing your PODs.



From UI:





From the command line: 

  

Creating periodic snapshots 

When you create a StorageClass, you can specify a snapshot schedule on the volume as specified below. This allows snapshotting the persistent data of the running pod using the volume. 




Above spec will take snapshots of the portworx-repl-1-snap-internal PVC every 190 minutes.

Creating a snapshot on demand 


You can also trigger a new snapshot on a running POD by creating a PersistentVolumeClaim as specified in the following spec:








Note the format of the “name” field. The format is name.<new_snap_name>-source.<old_volume_name>. Above example references the parent (source) persistent volume claim pvc013 and creates a snapshot by the name snap013. 

Listing snapshots


To list snapshots taken by Portworx, use the /opt/pwx/bin/pxctl volume snapshot list command.

 For example: 

# /opt/pwx/bin/pxctl volume snapshot list 

ID                                   NAME   SIZE  HA   SHARED   IO_PRIORITY SCALE    STATUS 
1056733319296008813 snap013 1 GiB  2      no               LOW                 1               up - detached  

You can use the ID or NAME of the snapshots when using them to restore a volume. 


Restoring a pod from a snapshot 


To restore a pod to use the created snapshot, use the pvc name.snap013-source.pvc013 in the pod spec. 

Managing snapshots through pxctl 

You can provide the SAN capabilities, using portworx and then create a snapshot of a volume, let's say using an MYSQL DB.

First, create a database and a demo table in your MYSQL container. 


# mysql --user=tleoncio --password=password
MySQL [(none)]> create database pxThiagoLeoncio;
Query OK, 1 row affected (0.00 sec)
MySQL [(none)]> use pxThiagoLeoncio;
Database changed
MySQL [pxdemo]> create table  K8SThiagoLeoncioSample (counter int unsigned);
Query OK, 0 rows affected (0.04 sec)
MySQL [pxdemo]> quit;
Bye

Now create a snapshot of this database using pxctl. 


First, use pxctl volume list to see what volume you want to snapshot 
# /opt/pwx/bin/pxctl v l
ID     NAME          SIZE HA SHARED ENCRYPTED IO_PRIORITY SCALE STATUS
381983511213673988 pvc-e7e66f98-0915-11e7-94ca-7cd30ac1a138 20 GiB 2 no  no   LOW   0  up - attached on 147.75.105.196

Then use pxctl to snapshot your volume 

opt/pwx/bin/pxctl snap create 381983511213673988 --name snap-013
Volume successfully snapped: 835956864616765999
Also, you can use pxctl to see your snapshot created
# /opt/pwx/bin/pxctl snap list
ID     NAME SIZE HA SHARED ENCRYPTED IO_PRIORITY SCALE STATUS
835956864616765999 snap-01 20 GiB 2 no  no   LOW   0  up - detached

Then we create a mysql Pod to mount the snapshot discussed in this article:
kubectl create -f portworx-mysql-snap-pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: test-portworx-snapped-volume-pod
spec:
  containers:
  - image: mysql:5.6
    name: mysql-snap13
    env:
      # Use secret in real usage
    - name: MYSQL_ROOT_PASSWORD
      value: password
    ports:
    - containerPort: 3306
      name: mysql
    volumeMounts:
    - name: snap-013
      mountPath: /var/lib/mysql
  volumes:
  - name: snap-013
    # This Portworx volume must already exist.
    portworxVolume:
      volumeID: "vol1"


Inspect that the database shows the cloned tables in the new MYSQL instance. 

# mysql --user=tleoncio --password=password
mysql> show databases;
+--------------------+
| Database           |
+--------------------+ 
| mysql              |
| performance_schema |
| pxThiagoLeoncio    |
+--------------------+
3 rows in set (0.00 sec)

mysql> use pxThiagoLeoncio;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+-----------------------+
| Tables_in_pxdemo      |
+-----------------------+
| K8SThiagoLeoncioSample|
+-----------------------+
1 row in set (0.00 sec)

I hope this helps and happy coding,
Thiago Leoncio.