lunedì 17 dicembre 2012

Oracle Linux: install and configure VNC server

This post covers the topic of installing a VNC server under Oracle Linux so you can login remotely to the machine desktop interface.

To be honest I usually (almost never) install a desktop environment on machines running Oracle products, this is because it's more fast and immediate apply system changes using command line instead of using a GUI without considering the fact that a GUI burdens systems' resources.

Despite this fact I recognize that sometimes having a GUI isn't that bad because allow users, even ones not so familiar with command line, to use systems.
Anyway...here's how to install VNC server on Oracle Linux (mine was 5 update 4 with Gnome desktop)!

Install vnc-server. In my system this package was already installed but needed to be updated, so:

[root@oracle ~]$  yum install vnc-server

Edit configuration file:

[oracle@oracle ~]$ nano /home/oracle/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
startx &


Please note that I've uncommented some lines, commented other and added "starx&" command which starts Gnome.

If you have installed KDE instead of Gnome the command will be: "startxkde&"

Once it's configured the further step it's to enable it, so first you need to choose a password to let connections occurr:

[oracle@oracle ~]$ vncpasswd

Type your desired password then start server on selected port. In my case port is ":1"

[oracle@oracle ~]$ vncserver :1

Test if this is correctly working connecting using a VNC Viewer.

Please note that fireall (iptables) may interfere with these connections if not correctly set up.

If you wish to stop vncserver:

[oracle@oracle ~]$ vncserver -kill :1


That's all!!

venerdì 14 dicembre 2012

Oracle UCM: Alter session timeout



Recently I was asked to increase user session duration preventing timeout after a brief idle time.

By default Oracle set duration of every session of 3600 seconds, which means that users inactive by more than 1 hour will need to re-authenticate to continue use Oracle UCM 11g.
To increase (or decrease) session timeout time you need to login to Enterprise Manager which in my case has this URL:

http://10.0.0.4:7001/em

In main screen select your UCM server



click "Oracle WebLogic Server Administration Console"




Login to WebLogic, click Deployments, expand Oracle Universal Content Management - Content Server and click "/"


Click Configuration, Lock & Edit button, set desired timeout session (in my case 10 hours) then click Save and Release Configuration. If WebLogic ask you to save a deployment plan click OK and wait for deployment to occur.


Now verify that this value correctly reflects on your UCM instance. Login to UCM and verify that session timeout was changed accordly to your settings.

That's all!!

mercoledì 7 novembre 2012

Oracle Database: Schedule hot backups using RMAN

In this article I will schedule periodic hot backups of a running database instance using rman.

To perform hot backups using rman, first you need to check if your database is in ArchiveLog mode.

[oracle@db1 ~]$ sqlplus "/ as sysdba"

SQL> SELECT log_mode FROM v$database;

LOG_MODE
------------
NOARCHIVELOG


If not change it:

SQL> SHUTDOWN IMMEDIATE;

SQL> STARTUP MOUNT;

SQL> ALTER DATABASE ARCHIVELOG;

SQL> ALTER DATABASE OPEN;

SQL> SELECT log_mode FROM v$database;

LOG_MODE
------------
ARCHIVELOG


Once it's in ArchiveLog mode create the main rman script which will be called by crontab:

[oracle@db1 ~]$ vi /u01/rman_main

ORACLE_HOSTNAME=db1
export ORACLE_HOSTNAME
ORACLE_UNQNAME=orcl
export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_HOME
ORACLE_SID=orcl
export ORACLE_SID

/u01/app/oracle/product/11.2.0/db_1/bin/rman target=/ @/u01/rman_script


Where ORACLE_HOSTNAME is your machine hostname and ORACLE_UNQNAME and ORACLE_SID is the SID of the instance you need to backup.

[oracle@db1 ~]$ chmod a+x /u01/rman_main
Then we create the rman script itself:

[oracle@db1 ~]$ vi /u01/rman_script

run {
  allocate channel ch1 type disk format '/u01/backup%d_DB_%u_%s_%p';
  backup database;
  backup archivelog all;
  release channel ch1;
}



This will backup the database creating a file under "/u01/" directory.
In the above script %d, %u, %s, %p are substitution variables for generating unique file name, if you wish to know more about these variables have a look HERE.

You could manually run rman_main to take hot backups, but if you like to run scheduled backups we need to add this to crontab:

[root@db1 ~]# crontab -e -u oracle

I will schedule backup everyday at 18:10 (6.10 PM)

10 18 * * * /u01/rman_main


The first five fields are:

minute (0-59)
hour (0-23)
day of the month(1-31)
month of the year (1-12)
day of the week (0-6 with 0 = Sunday)

For more info on crontab have a look at crontab.org

NOTE: At first I was unable to edit this file, so after a brief search I had to set EDITOR variable according to my preferred file editor.

In my case:

[root@db1 ~]# export EDITOR=nano

[root@db1 ~]# crontab -e -u oracle


That's all!!

martedì 6 novembre 2012

Oracle Database: Start EM console for multiple instances on the same server

Today I had to manually start Enterprise Manager console for an instance running on a server which has already other instances running.

The command to start EM Console is:

emctl start dbconsole

full path of the command is:

/u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole


This start EM for instance referred in ORACLE_SID variable.

In case of multiple instances running on same server you can start EM console by assigning ORACLE_SID variable according to the EM you need to start.

For example if we need to start EM console for "TEST1" instance we set ORACLE_SID:

[oracle@orcl ~]# ORACLE_SID=TEST1

[oracle@orcl ~]# emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
https://orcl:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ........................ started.
---------------------------------Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/orcl_TEST1/sysman/log


Same thing if we need to start EM for "TEST2" instance:


[oracle@orcl ~]# ORACLE_SID=TEST2

[oracle@orcl ~]# emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation.  All rights reserved.
https://orcl:5500/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control ........................ started.
---------------------------------Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/orcl_TEST2/sysman/log



Thats'all!!

giovedì 18 ottobre 2012

OBIEE: How to import data from Excel on Windows x64

I experienced some troubles importing data from Excel into OBIEE repository installed on a 64bit Windows machine.

This is not Oracle related, instead it's a Microsoft issue concerning ODBC data sources, this is beacause Win 2008 R2 doesen't comes with the capability of transfer Office data files to other sources (like databases).


Back on my old Windows 2003 adding data from Excel files was an "out-of-the-box" feature, just go to ODBC Data Sources and add your Excel file. 

If you install a 64bit Windows (in my case Windows 2008 Server R2) you will have two different ODBC Data Sources:

- the first is the default one and can be accessed under "Start"-> "Administrative Tools" -> "Data sources ODBC"
- the second is the corresponding 32bit version and is located at: "C:\Windows\System32\odbcad32.exe"

OBIEE uses as default the first one and, unlike Win2003, Excel datasource import is not an "out-of-the-box" feature.

After some searches I found out that it's enough install a Microsoft component that can be downloaded here:

Microsoft Access Database Engine 2010 Redistributable

After this is installed just go to ODBC Data Sources and add your Excel file: "System DNS" -> "Add"


Choose "Microsoft Excel Driver":

 

Choose a name for your data source, select Excel file from which data will be imported and then continue:

 

Next step is to open BI Administration Tool, open repository then go to "File"-> "Import Metadata" and choose the previously created Excel datasource.
 

Check all items then proceed:



You will see all sheets and all columns of your Excel file, select the ones you need  and then import them.

You have just imported data from an Excel file and now this data can be used and linked to other data using BI Administration Tool and subsequntly using OBIEE.

That's all!!

martedì 16 ottobre 2012

OBIEE: Data is not being updated on dashboards


Hello!!
It's a bit since last update and today I would like to share something discovered about OBIEE.

I stepped into this problem some days ago while creating OBIEE reports. These reports are based on data from an Oracle database that is being updated by another software.

In detail the problem was: despite the data in database is being updated, these changes are not reflected on OBIEE dashboards, which still present old data.

After a brief search I discovered that OBIEE uses an internal server cache. When dashboard is created OBIEE performs the query against datasource to retrieve and store data. Every subsequent access to these dashboards returns cached data preventing dashboard to redo the query on db at every connection.

To bypass OBIEE server cache and perform the query on db every time you just need to insert a parameter on "Advanced" tab while creating a dashboard.

Click "Advanced" tab, then CHECH "Bypass Oracle BI Presentation Services Cache"
Under "Prefix" insert:

SET VARIABLE DISABLE_CACHE_HIT=1;
Then click "Apply SQL" button.







That's all!!

giovedì 6 settembre 2012

Oracle VM: VM Server status not recognized by VM Manager

Hello, it was a bit since my last post here. Meanwhile I had some weeks of vacation but ...when I came back here's an issue waiting for me: Oracle VM, production environment, guest VMs correctly working but VM Manager completely unable to discover server status (servers reported in stopped status with error) despite servers are running fine.

VM Manager was totally unusable, server discovery processes stucked, I had to manually abort these processes from VM Manager. After aborting these discovery processes VM Manager changed server statuses from "stopped with error" to "starting". If I performed a manually rediscovery of servers I got this error:

https://?uname?:?pwd?@10.0.0.8:8899/api/2 discover_hardware, Status: org.apache.xmlrpc.XmlRpcException: agent.utils.filelock.LockError:Lock file /var/run/ovs-agent/discover_hardware.lock failed: timeout occured.

Logged in to server via SSH and under /var/run/ovs-agent I got:

discover_hardware.lock
monitor.lock

So it became pretty clear this was an issue with ovs-agent which is the agent who performs communication between VM Server and VM Manager.

Please note that if you can afford to stop or move your VMs a server reboot could solve all this without messing with PIDs and services.

If you, like me, don't have such luck you need to deal with PIDs and services.

ovs-agent service is run by a script located at /etc/init.d/ovs-agent and it is registered as a service that can be invoked with:

service ovs-agent [stop | start | restart | status]

So I checked ovs-agent status:

[root@orclvmsrv1 ~]# service ovs-agent status
OVSHA (PID: 6763) is running...
OVSNotificationServer (PID: 6725) is running...
OVSStat (PID: 6767) is running...
OVSAgentServer (PID: 6771) is running...
OVSLogServer (PID: 6709) is running...
OVSMonitor (PID: 6759) is running...
OVSRemaster (PID: 6747) is running...

and all services were reported as running fine even if they actually are not.

My next step was to open a SR with Oracle, which involved sending a lot of logs, from  both VM Server and VM Manager, to support engineers.

One of the requested logs was VM Server "lsof" which is the list of the current open files and a support engineer made me focus on this:

[root@orclvmsrv1 ~]# lsof | grep discover_hardware.lock
python 31309 root 6u REG 104,2 0 31704 /var/run/ovs-agent/discover_hardware.lock

which basically is the PID of the (python) process currently holding "discover_hardware".

This gave me the hint of killing processes involved with ovs-agent services.

So I got all PIDs involved:

[root@orclvmsrv1 ~]# service ovs-agent status
OVSHA (PID: 6763) is running...
OVSNotificationServer (PID: 6725) is running...
OVSStat (PID: 6767) is running...
OVSAgentServer (PID: 6771) is running...
OVSLogServer (PID: 6709) is running...
OVSMonitor (PID: 6759) is running...
OVSRemaster (PID: 6747) is running...

and then killed them:

[root@orclvmsrv1 ~]# kill 6763
[root@orclvmsrv1 ~]# kill 6725
[root@orclvmsrv1 ~]# kill 6767
[root@orclvmsrv1 ~]# kill 6771
[root@orclvmsrv1 ~]# kill 6709
[root@orclvmsrv1 ~]# kill 6759
[root@orclvmsrv1 ~]# kill 6747

and killed the process wich generated file lock seen above.

[root@orclvmsrv1 ~]# kill 31309

Checked status again:

[root@orclvmsrv1 ~]# service ovs-agent status
Procss OVSHA with PID 6763 doesn't exist.

Deleted .pid, .sock, .lock files under /var/run/ovs-agent

[root@orclvmsrv1 ~]# cd /var/run/ovs-agent
[root@orclvmsrv1 ~]# rm *.pid
[root@orclvmsrv1 ~]# rm *.sock
[root@orclvmsrv1 ~]# rm *.lock

Then started ovs-agent again and everything went back to work as usual:

[root@orclvmsrv1 ~]# service ovs-agent start
Starting ovs-agent services:                     [  OK  ]

So, I'm still not able to understand why this happend and what caused this issue with ovs-agent but this was the method I followed to solve this problem.

One last note I would to add is that dealing with ovs-agent DO NOT affect guest VMs running on servers, they will be running fine even if ovs-agent is stopped, restarted, or whatsoever.

Suggestion: if you have more available servers in the pool, live migrate all guest VMs from affected server(s) to working ones and reboot affected servers.

That's all!!

mercoledì 8 agosto 2012

OBIEE: nQSError 43126 Invalid Username/Password

Today I experienced this trouble with OBIEE: users can't login to BI Presentation Services.

System returned the following error: An invalid User Name or Password was entered.

Although I was perfectly capable of accessing WebLogic Server console and Enterprise Manager console OBIEE didn't let me in.

After a brief investigation in logs located at:

BI_HOME/diagnostics/logs/OracleBIPresentationServicesComponent/coreapplication_obips1

I spotted this error:

WSM-06102 Policy Reference The policy reference URI "oracle/wss_username_token_service_policy" is not valid.

which is an error given by a deplyed component which has gone bad.

This can be verified accessing WebLogic Server Deployment console, wsm-pm component is in error state:



To solve this it's sufficient to re-deploy this component

Click Lock & Edit -> select component wsm-pm -> Update



Click Next -> Finish



Then Activate Changes and verify that wsm-pm can service all requests and is in running state.



Once this is completed you should be able to login to OBIEE presentation Services again!

lunedì 6 agosto 2012

Oracle VM: Some useful tips using XM command

This post states some obvious commands, which are well known by majority of sys admins using XEN hypervisors.
Anyway I whish to share these commands since I think they are pretty useful, infact I had to deal with command line when my VM Manager had troubles.

Let's start saying that XM commands are performed connecting to physical Oracle VM servers and should be used carefully since they are pretty powerful and could potentially destroy your VM environment just with a click.

A good practice is to deal with XM CLI only if VM Manager is unusable, since it's preferrable to execute tasks by VM Manager itself rather than by physical server, especially in an environment with more than one physical server because XM CLI commands could potentially lead to inconsistencies between physical servers.

Another thing to note before using XM CLI is that as stated by server itself: making manual modifications in the management domain might cause inconsistencies between Oracle VM Manager and the server.

XM provide a lot of functionalities and you can check them all by just typing:

[root@orclvmsrv1 ~]# xm

Oracle VM identifies guest VMs by assigning them an unique ID, despite the name you gave to VM during creation, so when you perform an action using XM CLI you need to refer to VMs using that ID instead of the VM name you gave.

I suggest when you create a new VM using VM Manager to take note of "VM Name - assigned ID" because it could be useful for future references.
If you didn't do that don't be worried, there's a solution anyway, you can see what's the VM name on vm.cfg file:

[root@orclvmsrv1 ~]# cd /OVS/Repositories/0004fb0000030000fc2ad4059c973859
[root@orclvmsrv1 0004fb0000030000fc2ad4059c973859]# ls
Assemblies  ISOs  lost+found  Templates  VirtualDisks  VirtualMachines

As you can see above:

0004fb0000030000fc2ad4059c973859 is the REPOSITORY ID, every repository contains the following folders: Assemblies  ISOs  lost+found  Templates  VirtualDisks  VirtualMachines

VM configuration files are placed in VirtualMachines folder.In this case I've 3 VMs in this Repository and these are VM's ID.

[root@orclvmsrv1 0004fb0000030000fc2ad4059c973859]# ls VirtualMachines/
0004fb00000600003ace83d53d5313b0  0004fb0000060000e0f49015b41ead02 0004fb00000600005d4bfe48c8fe0cf9

To check what's the name of a certain VM just have a look at vm.cfg file contained in every of the folders above.

[root@orclvmsrv1 VirtualMachines]# cat 0004fb0000060000e0f49015b41ead02/vm.cfg | grep OVM_simple_name

and search for OVM_simple_name attribute which tells you what's the name you assigned to that VM.

OVM_simple_name = 'VMM'

Now that you know how to identify VMs by theyr ID it's time to do some basic stuff:

1)List all running VMs:

[root@orclvmsrv1 ~]# xm list

Name                                        ID   Mem VCPUs      State   Time(s)
0004fb00000600003ace83d53d5313b0             1  4096     4     -b----   9343.5
0004fb0000060000e0f49015b41ead02             8  4096     4     -b----    832.9
Domain-0                                     0   726    12     r-----  14059.0

As you can see I've two running VMs in my domain.

2)Stop a running VM:

[root@orclvmsrv1 ~]# xm shutdown 0004fb00000600003ace83d53d5313b0

I gracefully stopped a guest VM

3)Kill a running VM:

Same thing as above, but instead of "shutdown" use "destroy"

[root@orclvmsrv1 ~]# xm destroy 0004fb00000600003ace83d53d5313b0

4) Start a (non running) VM:

If you have a VM that is not currently in running state and you wish to start it:

[root@orclvmsrv1 VirtualMachines]# xm create 0004fb00000600005d4bfe48c8fe0cf9/vm.cfg

Please note that in this case I was in VirtualMachines folder.You could need to use full path to vm.cfg file.


5) Live migrate running VM to another Oracle VM server in the same Pool:

This can be done in two ways, specifying destination server IP address or, as I suggest, just typing destination server name.This is useful if you have a lot of servers in your infrastructure, and remembering server names it's usually easier than IP addresses.

You need to add your servers names to host file:

[root@orclvmsrv1 ~]# vi /etc/hosts

Add all your servers:

10.0.0.103              orclvmserver2
10.0.0.104              orclvmserver3
10.0.0.105              orclvmserver4

Save file, then you can migrate your VM to orclvmserver2:

[root@orclvmsrv1 ~]# xm migrate -l 0004fb00000600005d4bfe48c8fe0cf9 orclvmserver2

In a future post I will explain the use of another great CLI: Oracle VM Manager 3 CLI
which was introduced since VM Manager 3.1.1 build 365 and performs almost any task of VM manager but via CLI instead of web interface.

That's all!!

venerdì 3 agosto 2012

Oracle VM: Upgrade VM Manager to 3.1.1-399

A new patch for VM Manager is released by a few hours on MOS.

This patch as stated on changelog fixes the following issues:

14338549 - Fixes the issue where the log files do not have sufficient information to determine why TCPS fails to be enabled.
14318605 - Ensures that the upgrade process should not continue in case when the Oracle VM Manager cannot be stopped.
14256453 - Fixes the issue in server rediscovery due to the yum repository URL reset.
14222824 - Fixes the issue where iSCSI initiators were no longer associated with the ZFS Storage Appliance Access Groups after a restart of the Oracle VM Manager.


Login to My Oracle Support and download patch ID 14227416

Login to your VM Manager machine and

[root@vmm ~]# unzip p14227416_30_Linux-x86-64.zip
[root@vmm ~]# mount -o loop,ro ovmm-3.1.1-upgrade-b399.iso /mnt/cdrom/
[root@vmm ~]# cd /mnt/cdrom/
[root@vmm cdrom]# ./runUpgrader.sh


Stating OVM Manager upgrade on Thu Aug  2 10:06:59 CEST 2012

Oracle VM Manager 3.1.1.399 upgrade utility
Upgrade logfile : /tmp/upgrade-2012-08-02-06.log


It is highly recommended to do a full database repository backup prior to upgrading Oracle VM Manager ...

Press any key to continue ...


Oracle VM Manager is running ...

Verifying installation status ...
Read Oracle VM Manager config file ...
Skipping database upgrade for the same product version (3.1.1 to 3.1.1)
Found Oracle VM Manager install files ...
Found Oracle VM Manager upgrader ...
Found Oracle WebLogic Server ...
Found Java ...
Using the following information :
  Database Host          : 10.0.0.74
  Database SID           : ORCL
  Database LSNR          : 1521
  Oracle VM Schema       : ovs
  Oracle VM Manager UUID : 0004fb0000010000aef89d7d546a0d5e
  Current Build ID       : 3.1.1.365
  Upgrade from version   : 3.1.1
  Upgrade to version     : 3.1.1
Using /tmp/workdir.OjEwPb3mDR for backup and export location.
Using /tmp/patchdir.bJf4OKPoG for patching.
Undeploying previous version of Oracle VM Manager application ...
Undeploying Oracle VM Manager help ...
Undeploying Oracle VM Manager console ...
Undeploying Oracle VM Manager core ...
Waiting for Oracle VM Manager core to fully undeploy...
Waiting...
Finished undeploying previous version ...
Upgrading Oracle VM Manager ...
Backing up old files to /tmp/ovm-manager-3-backup-2012-08-02-121118...
Removing old files ...
Unpacking Oracle VM Manager 3.1.1.399
Refresh system-jazn-data.xml file ...
Redeploying Oracle VM Manager core container ...
Redeploying Oracle VM Manager console ...
Redeploying Oracle VM Manager help ...
Unpacking Oracle VM Manager OVM CLI Tool
Completed upgrade to 3.1.1.399 ...
Writing updated config in /u01/app/oracle/ovm-manager-3/.config
Restart WebLogic ...
Stopping Oracle VM Manager                                 [  OK  ]
Starting Oracle VM Managernohup: ignoring input and redirecting stderr to stdout
                                                           [  OK  ]

OVM Manager upgrade finished on Thu Aug  2 10:13:55 CEST 2012


Once installation is completed login to your VM Manager and everything should be back as normal and if you go to Help -> About you will see:

Oracle VM Manager
Version: 3.1.1.399
Build: 20120716_399

giovedì 2 agosto 2012

Oracle VM: Timeout starting OVMM service

I encountered this problem a while ago during a VM Manager restart: OVMM service didn't started anymore going in timeout.
As a general suggestion when this happens first thing to do is to have a look at VM Manager logs, located at:

/u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/logs/AdminServer.log

if file is too long to read you could just give a try grepping only errors

cat /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/servers/AdminServer/logs/AdminServer.log | grep ERROR

In this case however OVMM Timeout was caused by an issue in /etc/init.d/ovmm file and in detail by this line:

nohup su - oracle -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null

As you can see by default ovmm start script starts WebLogic server as oracle user, instead of root user, the one used to perform VM Manager installation.
I just fixed it by simply swapping oracle user with root user, this happened despite before VM Manager installation I launched "createOracle.sh" script which performs oracle user creation and permissions assignment.

So, to solve this issue simply replace:

nohup su - oracle -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null

with:

nohup su - root -c "$USER_MEM_ARGS DOMAIN_PRODUCTION_MODE=true JAVA_OPTIONS=\"-Djava.awt.headless=true -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:8453,server=y,suspend=n -da:org.apache.myfaces.trinidad\" /u01/app/oracle/ovm-manager-3/machine1/base_adf_domain/startWebLogic.sh &" > /dev/null


Then start ovmm service again:

service ovmm start

That's all!!

martedì 31 luglio 2012

Oracle UCM: Dashboard

Dashboard is an Oracle WebCenter Content feature that allow to display useful data in simple portlets that are displayed to users. Dashboards can be set as WebCenter Content users homepage, this means that when a user access UCM after login page instead of the generic search form will be redirected to these dashboards.

Dashboards are fully customizable by admins and by users and they are basically folio templates containing one or more items. Any of these item composing a Dashboard is an idoc page which performs some action like search for specific content, displays active workflows, etc.

To enable Dashboard you need to enable ContentFolios component. To enable it login to UCM, go to Administration -> Admin Server -> advanced component manager -> CHECK all Category Filters -> under Disabled Components select ContentFolios and click Enable button.

Restart UCM service, then go to Administration -> Configure Record Settings -> under Records Management Install Settings select Standalone and under Installation Levels choose at least Minimal. Minimal enables some new features, including Dashboards. If you have more specific needs you should consider a deeper level. Clicking to "info" icon near each level gives you infos about features enabled by each installation level.



After selection you will need to restart UCM service.



After service restart when logged in you will be prompted by following screen



Under Define Defaults click every item and choose default metadata that will be associated to every Audit Entries.



Do the same for Screenings Reports



Then CHECK all items and click Submit button to proceed.



Click Records -> Dashboards then you can go to User Dashaboard, Admin Dashboard or Create a new Dashboard.



By enabling Dashboards some new filea have been uloaded to your Content Server, if you perform a search you will find some new files and two Folios with following ID:
        
ADMIN_TASKPANELS
USER_TASKPANELS

which are admin and users Dashboards respectively. By editing these folios you will see all items composing a Dashboard. Here you can add new items or deleting existing ones. By clicking the green arrow you can search for all panels in Content Server.



Some have been previsouly created but you can add custom ones too. Custom panels are created using IDOC Scripts but I will return on this with more details in a further post ASAP.

Once Dashboard modifications are complete remember to save changes.

That's all!!

lunedì 30 luglio 2012

Oracle UCM: Performing basic tasks using HCST and IDOC scripts


In this post I will create a simple HCST page containing some IDOC scripts that allow to perform some basic actions like searching for specific content among WebCenter Content and change metadata values on link click.

If you are new to IDOC I suggest you to have a look at documentation:

Idoc Script Reference Guide

Another really precious resource for IDOC, HCST, HCSP, and UCM in general is Brian Huff's book "The Definitive Guide to Stellent Content Server Development".

We will create a HCST (Hypertext Content Server Template) page that will contain both HTML and IDOC Scripts.

The following code will perform a search of all documents in UCM with:

Security Group: Public
Document Type: Document
Custom Metadata: Pending

Likely you will change these according to your UCM configuration.

Copy/paste the following code to "test.hcst"

<html>
<head>
<title>Simple HCST Page</title>
</head>

<body>

<$QueryText="dSecurityGroup <matches> `Public` <AND> dDocType <matches> `Document` <AND> xCustom_Metadata <matches> `Pending`"$>
<$executeService("GET_SEARCH_RESULTS")$>

<table>
<tr>
<td>View Content</td><td>Content ID</td><td>Check-in Date</td><td>Custom Metadata</td><td>APPROVE</td><td>REJECT</td>
</tr>
<$loop SearchResults$>
<tr>
<td><a href="<$SearchResults.URL$>">VIEW CONTENT</a></td>
<td><$SearchResults.dDocTitle$></td>
<td><$SearchResults.dInDate$></td>
<td><$SearchResults.xStatus_Offerta$></td>
<td><a href="<$HttpCgiPath$>?IdcService=UPDATE_DOCINFO_BYFORM&coreContentOnly=1&dID=<$SearchResults.dID$>&dDocName=<$SearchResults.dDocName$>&dRevLabel=<$SearchResults.dRevLabel$>&dSecurityGroup=<$SearchResults.dSecurityGroup$>&dDocAccount=<$SearchResults.dDocAccount$>&xCustom_Metadata=Approved&IsSoap=1">CLICK HERE TO SET CUSTOM METADATA TO APPROVED</a></td>
<td><a href="<$HttpCgiPath$>?IdcService=UPDATE_DOCINFO_BYFORM&coreContentOnly=1&dID=<$SearchResults.dID$>&dDocName=<$SearchResults.dDocName$>&dRevLabel=<$SearchResults.dRevLabel$>&dSecurityGroup=<$SearchResults.dSecurityGroup$>&dDocAccount=<$SearchResults.dDocAccount$>&xCustom_Metadata=Rejected&IsSoap=1">CLICK HERE TO SET CUSTOM METADATA TO REJECTED</a></td>
</tr>
<$endloop$>
</table>

</body>
</html>


Login to UCM and check-in test.hcst file. If you will publish hcst pages in a production environment I suggest to use Web Mapped Folders in order to have a more friendly URL.

Open page in a browser and you will see something like this.

giovedì 26 luglio 2012

Oracle UCM: Web Mapped Folders

Web Mapped Folders is a great feature of Oracle UCM that allow to access WebCenter Content folders and documents contained on them using an URL.

This feature is really useful when using Site Studio features because this allows your contents to be accessed in a friendly url like this:

http://YOUR_WEBCENTER_CONTENT_SERVER_IP_ADDRESS:16200/cs/Web/WEB_PAGE.HTML

instead of default content mapping that have a web location with an URL like this:

http://YOUR_WEBCENTER_CONTENT_SERVER_IP_ADDRESS:16200/cs/groups/public/documents/web/mdaw/mdaw/~edisp/WEB_PAGE.HTML

To enable Web Mapped Folders you need to enable "Folders_g" component. In case you have not activated it you can enable it login to Oracle UCM -> Administration -> Admin Server -> Component Manager -> click "advanced component manager" link -> on "Category Filters" CHECK all 3 items.

In "Disabled Components" list look for "Folders_g" and click Enable button, then perform a restart of UCM service.

When Folders_g is enabled go to Administration -> expand Folders Configuration -> click Web Url Mapped Folders.
Choose the folder you wish to map with a URL and it's URL Mapping then click Add button.



In this case I added a folder named "Web" and I choosed to leave the default mapping as "Web", this means this folder will be accessible at the following URL:

http://YOUR_WEBCENTER_CONTENT_SERVER_IP_ADDRESS:16200/cs/Web/

mercoledì 25 luglio 2012

Oracle VM: Using OVM Utils

OVM Utils are a set of utilities created by Wim Coekaerts (for further informations please read Wim's blog) and released on MOS that allow users to perform using Command Line Interface almost every task that can be performed using VM Manager web interface.

Installation is really simple, just download from http://support.oracle.com

Patch 13602094: ORACLE VM 3.0 UTILS RELEASE 0.4

It's a 2.9MB zip that will be installed on the same machine where Oracle VM Manager resides.

Once downloaded extract p13602094_30_Linux-x86-64.zip to

/u01/app/oracle/ovm-manager-3/


[root@vmm ovm-manager-3]# unzip p13602094_30_Linux-x86-64.zip

[root@vmm ovm-manager-3]# unzip ovm_utils_0.5.2.zip

[root@vmm ovm-manager-3]# cd ovm_utils


OVM Utils are 6 different executables:

ovm_managercontrol: Performs actions at VM Manager level such as configuring yum repos and create cpu compatibility group. This features is intresting since using this tool allows you to group to a single server pool server with different CPU family group.
Actions allowed are: yuminfo, yumsetup, addkeystore, keystoreinfo, createcpugroup, removecpugroup, addservertocpugroup, removeserverfromcpugroup, listcpugroups, getsessiontimeout,setsessiontimeout

ovm_poolcontrol: Performs actions at Pool level. Actions allowed are: status, info, events, refresh, list, addserver, removeserver

ovm_repocontrol: Performs actions at Repository level. Actions allowed are: list, status, info, refresh, fixup, create

ovm_servercontrol: Performs actions at Server level. Actions allowed are: start, stop, restart, kill, mainton, maintoff, status, info, lock, upgrade, events, refresh, discover, list, listnfsexports, createnfsexport, deletenfsexport

ovm_vmcontrol: Performs actions at Virtual Machine level. Actions allowed are: start, stop, suspend, resume, status, restart, kill, info, lock, list, migrate, events, vcpuset, vcpuget, gettags, settags, fixcfg, delete

ovm_vmdisks: Query the Virtual Disks associated with a Virtual Machine.

ovm_vmmessage: Allows the user to send a message to a Virtual Machine in the form of a key/value pair or send a query to see if a message with a key was set inside the Virtual Machine.


These utilities have to be called passing some parameters:

./ovm_UTILITYNAME -u ADMIN_USERNAME -p ADMIN_PASSWORD -h VMMANAGER_HOSTNAME -c COMMAND_TO_SEND [-OPTIONAL_PARAMETERS]


For example here are some commands:

1)Perform a server rediscovery. My server IP Address is 10.0.0.102

./ovm_servercontrol -u admin -p password -h localhost -c discover -s 10.0.0.102 -P server_password

2)List all VMs in the Pool

./ovm_vmcontrol -u admin -p password -h localhost -c list

This command produced, in my case, the following output:

VM name : 'Win7'
     uuid   : '0004fb00000600003ace83d53d5313b0'
     server : 'orclvmsrv1'
     pool   : 'CHP'
     status : 'Stopped'

VM name : 'EnterpriseManager'
     uuid   : '0004fb00000600005d4bfe48c8fe0cf9'
     server : 'orclvmsrv1'
     pool   : 'CHP'
     status : 'Running'

VM name : 'VMM'
     uuid   : '0004fb0000060000e0f49015b41ead02'
     server : 'orclvmsrv1'
     pool   : 'CHP'
     status : 'Running'


3)Stop a running VM

./ovm_vmcontrol -u admin -p password -h localhost -c stop -v EnterpriseManager


If you need more informations about OVM Utils you can just read the manual located at

/u01/app/oracle/ovm-manager-3/ovm_utils/man/man8

That's all!!

martedì 24 luglio 2012

Oracle Middleware: How to autostart Middleware services with NodeManager

This post explains how to configure NodeManager in order to perform services autostart in case of failure or manually via WebLogic Server web interface.

In order to configure NodeManager we need to create a configuration file, so login to your Oracle Middleware/WebLogic machine:

[oracle@orcl /]$ cd /home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager

[oracle@orcl nodemanager]$ nano nodemanager.properties

Copy/paste the following configuration, changing "ListenAddress" and "ListenPort" according to your server configuration.

DomainsFile=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains
LogLimit=0
PropertiesVersion=10.3
DomainsDirRemoteSharingEnabled=false
javaHome=/home/oracle/Oracle/Middleware/jrockit_160_24_D1.1.2-4
AuthenticationEnabled=false
NodeManagerHome=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager
JavaHome=/home/oracle/Oracle/Middleware/jrockit_160_24_D1.1.2-4/jre
LogLevel=INFO
DomainsFileEnabled=true
StartScriptName=startWebLogic.sh
ListenAddress=10.0.0.84
NativeVersionEnabled=true
ListenPort=5556
LogToStderr=true
SecureListener=false
LogCount=1
DomainRegistrationEnabled=false
StopScriptEnabled=false
QuitEnabled=false
LogAppend=true
StateCheckInterval=500
CrashRecoveryEnabled=true
StartScriptEnabled=true
LogFile=/home/oracle/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.log
LogFormatter=weblogic.nodemanager.server.LogFormatter
ListenBacklog=50

Once this is done you can start Nodemanager:

[oracle@orcl nodemanager]$ /home/oracle/Oracle/Middleware/wlserver_10.3/server/bin/startNodeManager.sh

Now we need to configure WebLogic in order to make him communicate with NodeManager:

http://YOUR_MIDDLEWARE_SERVER_IP:7001/console

Click Machines -> Lock & Edit button -> New



Select a Name for Machine, set Unix and click Next button



Set "Type PLAIN" as we will not use SSL, "Listen Address" the IP address of your WLS machine and "Listen Port" the one configured in nodemanager.properties. Click Finish button then Activate Changes.



Click on the Machine you just created, in my case "Machine-0" then Configuration tab, Servers tab, Add button



Select an existing server to associate with NodeManager, click Finish button and then Activate Changes button.



Move to Servers tab, Control tab, select server and you will be able to control it from there.



In case of service failure it will be automatically restarted as long as Nodemanager and WebLogic Server are running.

I suggest you to add an autostart script for WebLogic and NodeManager in order to make them start automatically on boot.

lunedì 23 luglio 2012

Oracle Middleware: Authentication against Active Directory


I've to admit that user login based on Active Directory credentials for me was a painful process. It took me some weeks to figure out how this works since every tutorial I step into was giving me different interpretations. I had to implement user login based on Active Directory for Oracle UCM so I googled for some guides: some say you need to implement AD authentication both on WebLogic server and on Oracle UCM creating an AD Provider. After trial and error I figured out that the correct method is to enable AD just on WebLogic Server, no Provider or whatsoever is needed on Middleware side.

Please note that since WebLogic server is the webserver on which most (if not all) Oracle Middleware runs Active Directory authentication explained in this post works not just for Oracle UCM but for, I suppose, every other Oracle Middleware. I've successfully applied this to Oracle Business Intelligence too.

So, let's start configuring WebLogic Server. Login to your WLS console that usually is located at:

http://YOUR_MIDDLEWARE_SERVER_IP:7001/console

Go to Security Realms -> myrealm -> Providers -> click on Lock & Edit to enable WLS configuration modifications -> click New



Choose a name for AD provider and in the dropdown menu choose "ActiveDirectoryAuthenticator"



Once provider has been created it's time to edit according to your AD settings.
First click on DefaultAuthenticator and be sure that Control Flag is set to SUFFICIENT



Then click on your newly created ActiveDirectory provider and set Control Flag to SUFFICIENT.



Login to your AD server, you need some informations before continue:



As you can see in the figure above I've all AD users in a folder called Users.Right click on this folder, properties and here you can see the User Base DN.

Return to WebLogic Server and on ProviderSpecific tab set:

HOST: YOUR_ACTIVE_DIRECTORY_SERVER_IP
PORT: AD_PORT
PRINCIPAL: CN=administrator,CN=Users,DC=yourdomain,DC=yourdc
CREDENTIAL: administrator password



USER BASE DN: CN=Users,DC=yourdomain,DC=yourdc
ALL USERS FILTER: (objectclass=user)
User Name Attribute: sAMAccountName
User Object Class: user
Use Retrieved User Name as Principal: CHECK




GROUP BASE DN: CN=Users,DC=yourdomain,DC=yourdc
ALL GROUPS FILTER: (objectclass=group)
Group From Name Filter: (&(cn=%g)(objectclass=group))
Group Search Scope: subtree
Group Membership Searching: unlimited
Max Group Membership Search Level: 0
Ignore Duplicate Membership: UNCHECK
Use Token Groups For Group Membership Lookup: UNCHECK



Static Group Name Attribute: cn
Static Group Object Class: group
Static Member DN Attribute: member
Static Group DNs from Member DN Filter: (&(member=%M)(objectclass=group))



Connection Pool Size: 6
Connect Timeout: 0
Parallel Connect Delay: 0
Results Time Limit: 0
Keep Alive Enabled: UNCHECK
Follow Referrals: CHECK
Bind Anonymously On Referrals: UNCHECK
Propagate Cause For Login Exception: CHECK
Cache Enabled: CHECK
Cache Size: 32
Cache TTL: 60
GUID Attribute: objectguid



Then press Save -> Release Configuration button and perform a WLS restart.

If everything went fine on WLS restart you should be able to login to your Middleware using AD credentials. If at this point you still can't login using AD please verify that your USER BASE DN and GROUP BASE DN are set correctly according to your AD settings.

That's all!!