Tuesday, December 9, 2014

Mount SAN Storage to Linux Server

Following are the steps to permanently mount a SAN storage Disk on to a Linux Server.

Your system administrator will configure the Storage disk space and map it to the server, where you should use the below steps to mount it permanently on the server,

1. To list the disks that were mapped from SAN storage to the server use the below fdisk list command. Note that due to multipath rpm module not configured on the server it is showing four disks /dev/sda, /dev/sdb, /dev/sdc, /dev/sdd which is actually the one disk from the SAN device but showing four due to multipath fiber channels.

As general steps,
firstly Create the Physical Volume (PVCREATE)
then Volume Group (VGCREATE)
then Logical Volume (LVCREATE) 
then format the Logical Volume using ext3 file system (MKFS) 
and finally permanently mount the Logical Volume.

[root@edolraclin1 ~]# fdisk -l

Disk /dev/cciss/c0d0: 299.9 GB, 299966445568 bytes
255 heads, 32 sectors/track, 71798 cylinders
Units = cylinders of 8160 * 512 = 4177920 bytes

           Device Boot      Start         End      Blocks   Id  System
/dev/cciss/c0d0p1   *           1          25      101984   83  Linux
/dev/cciss/c0d0p2              26       16473    67107840   82  Linux swap / Solaris
/dev/cciss/c0d0p3           16474       71798   225726000   8e  Linux LVM

Disk /dev/dm-0: 107.3 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 123.7 GB, 123748745216 bytes
255 heads, 63 sectors/track, 15044 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-1 doesn't contain a valid partition table

Disk /dev/sda: 858.9 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda doesn't contain a valid partition table

Disk /dev/sdb: 858.9 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 858.9 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 858.9 GB, 858993459200 bytes
255 heads, 63 sectors/track, 104433 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

2. Using PVCREATE command, Create the physical volume from the mounted SAN storage disk

[root@edolraclin1 ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/cciss/c0d0p3
  VG Name               VolGroup00
  PV Size               215.27 GB / not usable 19.55 MB
  Allocatable           yes (but full)
  PE Size (KByte)       32768
  Total PE              6888
  Free PE               0
  Allocated PE          6888
  PV UUID               eBQiHf-sgd6-itbc-QJvu-pTMY-WhE9-mqtU2V

[root@edolraclin1 ~]# pvcreate /dev/sda
  Physical volume "/dev/sda" successfully created

3. Using VGCREATE, create the Volume Group,

[root@edolraclin1 ~]# vgcreate VG_DB01 /dev/sdd
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdb not /dev/sda
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdc not /dev/sdb
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdd not /dev/sdc
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sda not /dev/sdd
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdb not /dev/sda
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdc not /dev/sdb
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdd not /dev/sdc
  Volume group "VG_DB01" successfully created

On another server2, I used the below to rename the Vol_DB01 group name to VG_DB01. This step is not required on this server1
[root@edolraclin2 ~]# vgrename Vol_DB01 VG_DB01 

[root@edolraclin1 ~]# vgdisplay
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdb not /dev/sda
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdc not /dev/sdb
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdd not /dev/sdc
  --- Volume group ---
  VG Name               VG_DB01
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
 Act PV                1
  VG Size               800.00 GB
  PE Size               4.00 MB
  Total PE              204799
  Alloc PE / Size       0 / 0
  Free  PE / Size       204799 / 800.00 GB
  VG UUID               JuS0EN-aJgI-4dyH-ytgz-ePn0-hJLD-NOzTy1

  --- Volume group ---
  VG Name               VolGroup00
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  3
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               215.25 GB
  PE Size               32.00 MB
  Total PE              6888
  Alloc PE / Size       6888 / 215.25 GB
  Free  PE / Size       0 / 0
  VG UUID               8GB3cq-T6kK-bnZm-zsfG-dggD-GF9a-PlTqIm

4. Using LVCREATE command, Now create the 800GB logical volume /dev/VG_DB01/LVol_DB01 for the Volume group VG_DB01

[root@edolraclin1 ~]# lvcreate -L 800G -n /dev/VG_DB01/LVol_DB01 VG_DB01
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdb not /dev/sda
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdc not /dev/sdb
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdd not /dev/sdc
  Volume group "VG_DB01" has insufficient free space (204799 extents): 204800 required.

Above didn't got created since I used 800G but when used 799G it worked,

[root@edolraclin1 ~]# lvcreate -L 799G -n /dev/VG_DB01/LVol_DB01 VG_DB01
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdb not /dev/sda
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdc not /dev/sdb
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdd not /dev/sdc
  Logical volume "LVol_DB01" created

[root@edolraclin1 ~]# lvdisplay
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdb not /dev/sda
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdc not /dev/sdb
  Found duplicate PV gN5jnth8YSccwW5U42pzlpLYTQTAeRJe: using /dev/sdd not /dev/sdc
  --- Logical volume ---
  LV Name                /dev/VG_DB01/LVol_DB01
  VG Name                VG_DB01
  LV UUID                lnktqC-AjHx-xwNq-tvky-EOte-SP8A-R9lfxf
  LV Write Access        read/write
 LV Status              available
  # open                 0
  LV Size                799.00 GB
  Current LE             204544
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol00
  VG Name                VolGroup00
  LV UUID                o3iXhS-NWXg-42ca-OmOB-jV3u-x3Ai-NRml0g
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                100.00 GB
  Current LE             3200
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Name                /dev/VolGroup00/LogVol01
  VG Name                VolGroup00
  LV UUID                RaY7SC-Gdzq-eB2k-nmyT-PQcN-ybxn-23LSDV
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                115.25 GB
  Current LE             3688
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

5. Now format the logical volume with ext3 file type,

[root@edolraclin1 ~]# mkfs -t ext3 /dev/VG_DB01/LVol_DB01
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
104726528 inodes, 209453056 blocks
10472652 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
6392 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information:

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

6. Now mount the logical volume permanently on the server as /u02,

[root@edolraclin1 ~]# cd /
[root@edolraclin1 ~]# mkdir u02
[root@edolraclin1 ~]# vi /etc/fstab

/dev/VG_DB01/LVol_DB01  /u02                    ext3    defaults        1 2

[root@edolraclin1 ~]# mount -a

[root@oiamsrv1 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00  97G  8.2G   84G   9% /
/dev/mapper/VolGroup00-LogVol01  112G   64G   43G  60% /u01
/dev/mapper/VG_DB01-LVol_DB01     787G  197M  747G   1% /u02
/dev/cciss/c0d0p1      97M   31M   62M  34% /boot
tmpfs                  16G     0   16G   0% /dev/shm

You can also use the below GUI tool to configure the LVM.
[root@oiamsrv1 ~]# system-config-lvm

This way you can mount the new SAN storage disk of 800GB on the server.

For any queries please don't hesitate to email me: samiora@gmail.com

Thursday, November 27, 2014

Optimal and Needed UNDO Size

From oracle 9i, rollback segments are re-named as undo logs, traditionally it were stored in rollback segments until a commit or rollback segments were issued.

Automatic undo management allows the DBA how long information should be retained after commit. The larger your undo tablespace the more you can hold for long running DML operation (Preventing snapshot to old error on long running queries).

You can choose to allocate a specific size for the UNDO tablespace and then set the optimal UNDO_RETENTION according to UNDO size. This is specially useful when you disk space is limited and you do not want to allocate more space than required UNDO size.

The formula to calculate the Optimal undo retention is,

OPTIMAL UNDO RETENTION = ACTUAL UNDO SIZE /(DB_BLOCK_SIZE *       UNDO_BLOCK_PER_SEC)

Get the values for the above formula using the below queries and subsitute to get the optimal undo retention value,

Find Actual Undo Size:

SELECT SUM(a.bytes) "UNDO_SIZE"
  FROM v$datafile a, v$tablespace b, dba_tablespaces c
 WHERE c.contents = 'UNDO' AND c.status = 'ONLINE'
   AND b.name = c.tablespace_name AND a.ts# = b.ts#;


UNDO_SIZE
----------
7948206080

Find Undo Blocks per Second:

SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
      "UNDO_BLOCK_PER_SEC"
  FROM v$undostat;


UNDO_BLOCK_PER_SEC
------------------
6.47

Find Undo Block Size:

SELECT TO_NUMBER(value) "DB_BLOCK_SIZE [KByte]"
 FROM v$parameter
WHERE name = 'db_block_size';


DB_BLOCK_SIZE [Byte]
--------------------
8192

Therefore,
OPTIMAL UNDO RETENTION = 7948206080 /(8192 * 6.47)=149959.8145 [sec]

Using the below query you can find all those information collectively:

Script to find required Optimal Undo Retention:

SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
       SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
       ROUND((d.undo_size / (to_number(f.value) *
       g.undo_block_per_sec))) "OPTIMAL UNDO RETENTION [Sec]"
  FROM (
       SELECT SUM(a.bytes) undo_size
          FROM v$datafile a, v$tablespace b, dba_tablespaces c
         WHERE c.contents = 'UNDO' AND c.status = 'ONLINE'
           AND b.name = c.tablespace_name AND a.ts# = b.ts#
       ) d,
       v$parameter e, v$parameter f,
       (
       SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
              undo_block_per_sec
         FROM v$undostat
       ) g
WHERE e.name = 'undo_retention' AND f.name = 'db_block_size';


ACTUAL UNDO SIZE [MByte]   UNDO RETENTION [Sec] OPTIMAL UNDO RETENTION [Sec]
----------------------    ---------------- -----------------------------
  7580  10800   149960

Script to Calculate Needed Undo size for database:
In Oracle, UNDO size can be controlled with the undo_retention parameter and the size of the UNDO tablespace, thus the setting for these are determined by the level of DML activity in the database:
1. If you are using heavy DML operation make sure there is enough sized rollback segments.
2. If you expect heavy DML load then must have multiple undo tablespace.
3. Try to limit the number of simultaneous users per UNDO to four.
4. For large batch transactions create special large extent rollback segments in a separate tablespace from the other rollback segments,
only bring them online when needed and use SET TRANSACTION command to assign them to specific transactions.
5. Try to avoid running large batch transactions simultaneously with OLTP or smaller transactions.

UNDO_SIZE = UNDO_RETENTION * DB_BLOCK_SIZE * UNDO_BLOCK_PER_SEC

  SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
       SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
       (TO_NUMBER(e.value) * TO_NUMBER(f.value) *
       g.undo_block_per_sec) / (1024*1024)
      "NEEDED UNDO SIZE [MByte]"
  FROM (
       SELECT SUM(a.bytes) undo_size
         FROM v$datafile a, v$tablespace b, dba_tablespaces c
        WHERE c.contents = 'UNDO' AND c.status = 'ONLINE'
          AND b.name = c.tablespace_name AND a.ts# = b.ts#
       ) d,
      v$parameter e, v$parameter f,
       (
       SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
         undo_block_per_sec
         FROM v$undostat
       ) g
 WHERE e.name = 'undo_retention' AND f.name = 'db_block_size';


ACTUAL UNDO SIZE [MByte]    UNDO RETENTION [Sec] NEEDED UNDO SIZE [MByte]
-----------------------     ----------------         -----------------------
  7580  10800    545.90  

For any queries you can email me on, samiora@gmail.com

Tuesday, October 28, 2014

Start OID OAM SSO components integrated with EBS

Below are the sequence of steps to Start all the OID, Weblogic, OAM, SSO components that are integrated with Oracle EBS environment that is enabled with SSO Single Sign On.

Based on the components (OID DB, WLS, OAM, EBS Access Gate, etc) to be started, below envionment variables should be set accordingly.
[fmwuser@myserver ~]$ more oid_java.env
export JAVA_HOME=/u09/oracle/mw/jrockit-jdk1.6.0_45-R28.2.7-4.1.0
export PATH=$JAVA_HOME/bin:$PATH

[fmwuser@myserver ~]$ more ohs.env
export ORACLE_HOME=/u09/oracle/mwohs/ohs
export ORACLE_INSTANCE=$ORACLE_HOME/instances/instance1
export PATH=$ORACLE_INSTANCE/bin:$PATH

[fmwuser@myserver ~]$ more oid.env
export MW_HOME=/u09/oracle/mw
export WL_HOME=$MW_HOME/wlserver_10.3
export ORACLE_HOME=$MW_HOME/idm
export DOMAIN_HOME=$MW_HOME/user_projects/domains/IDMDomain
export JAVA_HOME=$MW_HOME/jrockit-jdk1.6.0_45-R28.2.7-4.1.0
export ORACLE_INSTANCE=$MW_HOME/asinst_1
export PATH=$ORACLE_HOME/bin:$ORACLE_INSTANCE/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/ldap/bin:$PATH:.

[fmwuser@myserver ~]$ more oam.env
export MW_HOME=/u09/oracle/mwoam
export WL_HOME=$MW_HOME/wlserver_10.3
export ORACLE_HOME=$MW_HOME/iam
export DOMAIN_HOME=$MW_HOME/user_projects/domains/IAMDomain
export JAVA_HOME=$MW_HOME/jrockit-jdk1.6.0_45-R28.2.7-4.1.0
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$JAVA_HOME/bin:$PATH:/u09/oracle/mwoam/modules/org.apache.ant_1.7.1/bin:.

1. start OID database and listener

[fmwuser@myserver ~]$ su - oracle
Password:
[oracle@myserver ~]$ echo $ORACLE_HOME
/u09/oracle/db/11.2.0
[oracle@myserver ~]$ echo $ORACLE_SID
iamdb
[oracle@myserver ~]$ lsnrctl start
[oracle@myserver ~]$ sqlplus / as sysdba
SQL> STARTUP;

2. Start node manager for IDMDomain

export JAVA_OPTIONS=-DDomainRegistrationEnabled=true
export MW_HOME=/u09/oracle/mw
cd /u09/oracle/mw/wlserver_10.3/server/bin/
nohup ./startNodeManager.sh &

3. START NODE MANAGER FOR IAMDomain
export JAVA_OPTIONS=-DDomainRegistrationEnabled=true
export MW_HOME=/u09/oracle/mwoam
cd /u09/oracle/mwoam/wlserver_10.3/server/bin/
nohup ./startNodeManager.sh &

4. START IDMDomain ADMIN SERVER
Note: boot.properties file is located here /u09/oracle/mw/user_projects/domains/IDMDomain/servers/AdminServer/security/boot.properties
. oid.env

cd /u09/oracle/mw/user_projects/domains/IDMDomain/bin/
nohup ./startWebLogic.sh &

URL to Verify:
http://myserver.mydomain:7031/console

5. START IAMDomain ADMIN SERVER
. oam.env
cd /u09/oracle/mwoam/user_projects/domains/IAMDomain/bin/
nohup ./startWebLogic.sh &

URL to Verify
http://myserver.mydomain:7021/console

6. START OID
su - fmwidm
. oid.env
cd $ORACLE_INSTANCE/bin
cd /u09/oracle/mw/asinst_1/bin
./opmnctl startall
./opmnctl status -l

Processes in Instance: asinst_1
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
ias-component                    | process-type       |     pid | status   |        uid |  memused |    uptime | ports
---------------------------------+--------------------+---------+----------+------------+----------+-----------+------
oid1                             | oidldapd          |    6715 | Alive    | 2002744560 |   842172 |   0:00:34 | N/A
oid1                             | oidldapd          |    6688 | Alive    | 2002744559 |   354132 |   0:00:35 | N/A
oid1                             | oidmon           |    6643 | Alive    | 2002744558 |   297820 |   0:00:37 | LDAPS:3091,LDAP:3090
EMAGENT                 | EMAGENT    |    6642 | Alive    | 2002744557 |    63900 |   0:00:37 | N/A


7. START IDMDomain MANAGED SERVERS (wls_ods1)

. oid.env
cd /u09/oracle/mw/user_projects/domains/IDMDomain/bin/
nohup ./startManagedWebLogic.sh wls_ods1 &

URL to Verify:
http://myserver.mydomain:7031/console

Troubleshoot: If the above command doesn't start the managed server then it can be started from the console itself.

Enter username to boot WebLogic server:Error: Failed to get value from Standard Input
Enter password to boot WebLogic server:
<May 12, 2014 3:14:17 PM GST> <Warning> <DeploymentService> <BEA-290014> <Invalid user name or password.>
<May 12, 2014 3:14:18 PM GST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 10.3.6.0  Tue Nov 15 08:52:36 PST 2011 1441050 >
<May 12, 2014 3:14:19 PM GST> <Error> <Configuration Management> <BEA-150035> <An attempt was made to download the configuration for the server wls_ods1 by the user  with an invalid password.>
<May 12, 2014 3:14:19 PM GST> <Error> <Configuration Management> <BEA-150021> <The admin server failed to authenticate the identity of the user  starting the managed server. The reason for the error is . 


If you get above error then started wls_ods1 from console.
http://myserver.mydomain:7031/console

8. START IAMDomain MANAGED SERVERS (oam_server1 & eag_server1)
. oam.env
cd $DOMAIN_HOME/bin
cd /u09/oracle/mwoam/user_projects/domains/IAMDomain/bin
nohup ./startManagedWebLogic.sh oam_server1 &
nohup ./startManagedWebLogic.sh eag_server1 &

9. START ORACLE HTTP SERVER OHS
. ohs.env
cd $ORACLE_INSTANCE/bin
./opmnctl startall
./opmnctl status -l

NOTE: Now if you access the EBS login page it will be redirected to the OAM Login page where Active Directory username/password should be entered to login to the EBS application. And ofcourse this login will work only if the EBS environment is integrated with OAM using the steps mentioned in my previous article "Steps to integrate Oracle EBS R12 with OAM 11g SSO": http://samiora.blogspot.ae/2014/02/steps-to-integrate-oracle-ebs-r12-with.html


For any questions and clarifications, please email me on samiora@gmail.com

Sunday, September 28, 2014

Weblogic Monitoring Dashboard WLDF

Weblogic Administration Console Monitoring Dashboard is used to Monitor Weblogic Runtime Performance for various resources. Below is the screenshot of WLDF Console Extension dashboard.
Click on the below picture to expand and see how the Weblogic monitoring dashboard looks like,


There are two ways to access the WL monitoring dashboard,

1. URL to access monitoring dashboard is - http://servername:portnumber/console/dashboard
Example - http://fmwwlsrv1:7031/console/dashboard , where weblogic admin server is running on fmwwlsrv1 server on port 7031

OR

2. You can also access the monitoring console by following the below path,

Access admin console (http://edolraclin1:7031/console) > click on your domain (IDMDomain)> click on 'Home' tab > click on "Monitoring Dashboard" under chart and graphs option on right hand side > Select 'JVM Runtime Heap' option on left hand side to monitor heap usages > select the graph type you want from right hand corner option > click on run button to monitor.

By default it will monitor heap usages in every 30 minutes of interval and will plot the graph. In the above screenshot, orange bar showing total heap allocated and blue showing total used one.
To stop monitoring click on red button at left upper corner. Similarly you can choose other options to monitor.

Troubleshooting:
If you do not see the monitoring dashboard option then follow below steps to install it on your domain

1. Go to $WL_HOME\server\lib\console-ext directory and check if you have 'diagnostics-console-extension.jar' file
2. Copy diagnostics-console-extension.jar file to your DOMAIN-DIR/console-ext directory eg: /u03/oracle/mwoam/user_projects/domains/IAMDomain/console-ext
3. Restart Admin Server and then you will be able to use the console dashboard

For any queries on Weblogic Server Administration please don't hesitate to email me 'samiora@gmail.com'.

Sunday, August 31, 2014

Deregister SSO / OID from Oracle Applications

If Your Oracle Applications 11i/R12 instance is currently integrated with Oracle Single Sign-On (SSO) & Oracle Internet Directory (OID) and you would like to remove integration (so that apps 11i/R12 instead of redirection to SSO, authentication happens at FND_USER).

Following are the Broad level steps to deregister apps (11i/R12) from SSO,

1. Deregister Oracle Apps (11i/R12) from OID and SSO using
txkrun.pl -script=SetSSOReg -deregister=Yes

2. Remove any reference regarding SSO / OID from Oracle Apps (11i/R12)
txkrun.pl -script=SetSSOReg –removereferences=Yes

3. Change Profile Option at “Site level”
“Application SSO Type” (APPS_SSO) -> Change it to “SSWA”
“Application SSO Login Type” -> Change it to “Local”

4. Restart Services on Middle Tier
./adstpall.sh apps/apps_password
./adstrtal.sh apps/apps_password

5. Finally Reset password of all users whose ENCRYPTED_USER_PASSWORD is set to EXTERNAL

Identify users
SQL> select user_name , ENCRYPTED_USER_PASSWORD from fnd_user where ENCRYPTED_USER_PASSWORD=’EXTERNAL’;

FNDCPASS apps/apps 0 Y system/manager USER VISION WELCOME

If you want only few users to login locally(default login method still SSO) then

1. Change Profile Option at User level
“Application SSO Type” (APPS_SSO) -> Change it to “SSWA”
“Application SSO Login Type” -> Change it to “Local”

2. Reset password of specific users (If ENCRYPTED_USER_PASSWORD is set to EXTERNAL)

SQL> select user_name , ENCRYPTED_USER_PASSWORD from fnd_user where ENCRYPTED_USER_PASSWORD=’EXTERNAL’ and user_name like ‘&enter_User_Name’;

FNDCPASS apps/apps 0 Y system/manager USER VISION WELCOME

3.Finally login using AppsLocalLogin URL
http(s)://hostname.domainname:port/OA_HTML/AppsLocalLogin.jsp

Friday, July 4, 2014

WebLogic Scripting Tool (WLST) made easy

The WebLogic Scripting Tool (WLST) is a command-line scripting environment that you can use to create, manage, and monitor WebLogic Server domains.
It is based on the Java scripting interpreter, Jython. It's implemented in Jython i.e., Python running in JVM.
In addition to supporting standard Jython features such as local variables, conditional variables, and flow control statements, WLST provides a set of scripting functions (commands) that are specific to WebLogic Server.

WLST script is running JMX against Weblogic Server.

WLST is efficient and versatile, it can,
I. replace Configuration wizard,
ii. replace template builder,
iii. if you are doing command line deployment using weblogic.Deployer then it can also be done with wlst, and
iv. wlst can also replace the whole Admin console.

WLST is running in offline mode i.e. when you use wlst it is not connected to Admin server. To be online mode we should connect to the admin server using the wlst 'connect()' command.

start WLST
Run the script $MW_HOME/wlserver_12.1/common/bin/wlst.sh
or
export WL_HOME=/u01/mw/wlserver_12.1
export CLASSPATH=weblogic.jar
java weblogic.WLST <script.py>

If you have script.py then use it other wise you can just connect to the wlst and use it interactively.

offline mode
By default the wlst takes you to offline mode prompt,

wls:/offline>

online mode
To connect to the Admin server use the below connect command with username/password,
wls:/offline> connect('weblogic','weblogic1')

The above connect will connect to the default t3://localhost:7001 and takes you to the below online prompt,
wls:/dev12/serverConfig>
 
If you don't want the username password credentials in connect() then use 'storeUserConfig()' which will create a key file with encrypted username/password in it, and it will be used to connect to the admin server next time when you just provide connect().
wls:/dev12/serverConfig> storeUserConfig()
 
Below are few commands that you can use,
ls() - To retrieve all the attributes, all the operations and all the child mbeans.
ls('c') - To retrieve all the child mbeans.
ls('a') - To retrieve all the attributes.
ls('o') - To retrieve all the operations.
 
wls:/dev12/serverConfig> cd('Servers')
wls:/dev12/serverConfig/Servers> ls()
dr--  AdminServer
dr--  oam_server1

Above commands are using Python syntax so if you want to make it more easier just use 'easeSyntax()'
wls:/dev12/serverConfig/Servers> easeSyntax()

easeSyntax() - Allows you to just type commands without ( ), example: ls, 'ls c', 'ls a', 'ls o', cd Servers, etc
But it works for most of the commands with about one attribute/parameter.

lock & edit mode
For 'lock and edit' mode use edit() and startEdit() commands,
wls:/dev12/serverConfig/Servers> cd oam_server1
wls:/dev12/serverConfig/Servers/oam_server1> edit()
wls:/dev12/edit> cd /Servers/oam_server1
wls:/dev12/edit/Servers/oam_server1> ls('a')
-rw- AdministrationPort 7001
-rw- HttpEnabled   true

Note the -rw- read write mode for the attributes. Now to edit the attribute use the startEdit() command,
wls:/dev12/edit/Servers/oam_server1> startEdit()
wls:/dev12/edit/Servers/oam_server1 !> cd SSL
wls:/dev12/edit/Servers/oam_server1/SSL !> cd oam_server1
wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1 !> ls a
-rw- ListenPort   7005
-rw- LoginTimeoutMillis  25000
-rw- Name oam_server1

Now let us change ListenPort from 7005 to 7777 using set() command, while to get a value of any attribute use the get() command, and save(), activate() to save and activate the changes.
wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1 !> set('ListenPort','7777')
wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1 !> get ListenPort
7777

save settings
wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1 !> save()
wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1 !> activate()wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1>

To go back from edit to serverConfig mode use the serverConfig() command,
wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1> serverConfig()

wls:/dev12/serverConfig>  

check current managed object - cmo
To check the 'current managed object - cmo' use the below command,
wls:/dev12/edit/Servers/oam_server1/SSL/oam_server1 !> print cmo
[MBeanServerInvocationHandler]com.bea:Name=oam_server1,Type=SSL,ManagedServer=oam_server1





find
The find command is useful, for us to know on which level is so an so MBean attribute,
wls:/dev12/serverConfig> find('ListenPort')


 
help
To display information about WLST commands and variables, enter the 'help' command.
If you specify the help command without arguments, WLST summarizes the command categories. To display information about a particular command, variable, or command category, specify its name as an argument to the help command.

To list a summary of all online or offline commands from the command line using the following commands, respectively:

help('online')  
help('offline')
help('all')
help('browse')
help('common')
help('contorl')
help('deployment')
help('diagnostics')
help('editing')
help('information')
help('lifecycle')
help('nodemanager')
help('storeadmin')
help('trees')
help('variables')
The help command will support a query; for example,
help('get*')
It displays the syntax and usage information for all commands that begin with get.

For example, to display information about the disconnect command, enter the following command:
wls:/mydomain/serverConfig> help('disconnect')
The command returns the following:
Description:
Disconnect from a weblogic server instance.
Syntax:
disconnect()
Example:
wls:/mydomain/serverConfig> disconnect()

wlst quick reference
ls() - ls('a') shows attributes, 'c' child MBeans, 'o' operations
cd() - navigation

serverConfig() - change to config MBeans
serverRuntime() - change to server runtime
domainRuntime() - change to domain runtime
custom() - change to custom tree
jndi() - change to JNDI tree

edit() - change to writable edit tree
startEdit() -  start an edit session, then use set('attribute','value')
save() - persist changes
activate() - activate changes
undo() - undo changes

configToScript() - export domain configuration to WLST script
find() - find attributes
easeSyntax() - swith off python syntax(do not use for scripting!)

Useful Pointer:
On weblogic console page, there is a 'Record' link, that can record all the changes that we are doing in 'Lock and Edit' mode and it saves the complete steps to a file in wlst commands format. This is a good way of getting the MBean hierarchy automatically by just recording it.

a. login to weblogic console http://servername.domainname:7001/console
b. Click 'Lock & Edit' button
c. Click on 'Record' link
d. Now do any changes on the console and it gets recorded into a .PY extention file in $DOMAIN_HOME/dev12 directory

From below link, you can download the 'Oracle® Fusion Middleware WebLogic Scripting Tool Command Reference 11g Release 1 (10.3.6)' 
http://docs.oracle.com/cd/E23943_01/web.1111/e13813.pdf

For any further queries or help please don't hesitate to contact me on samiora@gmail.com