venerdì 25 gennaio 2013

VMware Data Recovery: limit concurrent backup tasks

Today I would like to discuss about a poor backup performance issue occurred using VMware Data Recovery.
This issue occurred in a production environment which utilizes iSCSI storage for VMs datastores and a small sized NAS for backup.

Daily backup of VMs (circa 1TB of total raw data) took several days to be completed causing overlapping of backup jobs: backups of the current day were running on some VMs while other's VMs backup processes of day before were still running.

Here is a simple schema of my environment: as you can see there are separate networks for iSCSI traffic and "general purpouse" network traffic consumed by VMs.




VMware Data Recovery performs backups by creating snapshots of VMs. These snapshots reside on iSCSI storage datastores and are mounted as hard drives on VMware Data Recovery appliance which performs data deduplication before storing data to backup destination (NAS storage). Once backup are completed Data Recovery unmounts virtual hard drives and consolidates VMs snapshots.

If you have a look at running backups performed by VMware Data Recovery you will find how by default the number of concurrent backup tasks performed is 8. I suppose this number is not casual but it's somehow derived from the max cost algorithm which rule all VMware hosts.

This algorithm basically assigns a cost to every operation performed by hosts and storage in a VMware environment.
The total cost of operations cannot excede the max value of cost each host can withstand.
This value limits the number of concurrent backup tasks that can be running in an ESXi host on which VMware Data Recovery appliance is running.


Returning to my problem...as you might expect this issue was related to the poor performance of the NAS in managing concurrent data writes by 8 backup streams simultaneously.


To adjust the number of concurrent backup jobs it's really simple.

Login to your VMware Data Recovery appliance.

Default username: root
Default password: vmw@re

Stop datarecovery service

service datarecovery stopGo to /var/vmware/datarecovery/ and create a file called datarecovery.ini

Open this file and paste this content:

[Options]
MaxBackupRestoreTasks=1



In this way we are overriding default values of VMware Data Recovery for the maximum number of concurrent backup/restore jobs. By default this value is 8, minimum for value is (obviously) 1.

Finally restart datarecovery service:

service datarecovery start

Performing only one backup at a time eliminated the concurrent access to the NAS speeding up enormously backup process that in this way are performed sequentially, when a VM backup job finishes the next VM backup job starts.


For more informations on VMware Data Recovery options have a look at this WMware KB.

giovedì 24 gennaio 2013

Oracle Database: Schedule backups using exp

Despite I recommend taking backups using RMAN (Oracle Database: Schedule hot backups using RMAN) sometimes taking backups using EXP utility could be useful.

The main advantage of using EXP utility instead of RMAN is that the former (EXP) allows to take easy backups of specific tables and doesn't require the database to be in ARCHIVELOG mode to run.

Conversely RMAN it's faster than EXP because it doesen't require to examine every data block of the backup source, allow parallelized backups/restores, has a catalog for tracking backups, etc.

Set up EXP backups it's really simple, let's create a script which will be added to our crontab to perform EXP backups daily at 8PM.

I created a file called backup under /home/oracle with this content:

export DATE=$(date +"%m_%d_%y_%H:%M")

/u01/app/oracle/product/11.2.0/db_1/bin/exp username/password@instance_name file=/home/oracle/backup/backup_$DATE.dmp log=/home/oracle/backup/backup_$DATE.log statistics=none


First line creates a variable called DATE which is set as the current system date in month,day,year,hour,minute format.

Second line performs the backup calling EXP utility and passing following parameters:

username/password@instance_name tells EXP what to backup

file=/home/oracle/backup/backup_$DATE.dmp tells EXP where to save backup

log=/home/oracle/backup/backup_$DATE.log tells EXP where to save backup log

statistics=none tells EXP not to save statistics related to objects we are exporting

To schedule EXP backup using crontab:

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

I will schedule backup everyday at 20:00 (8.00 PM)

00 20 * * * /home/oracle/backup

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)

And the last parameter is absolute path to my backup script.

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

NOTE: If you are unable to edit crontab file set EDITOR variable according to your preferred file editor.

In my case:

[root@db1 ~]# export EDITOR=nano

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


That's all!!

mercoledì 23 gennaio 2013

JDeveloper: Deploy your project to an external WebLogic Server

JDeveloper by default uses it's internal WebLogic Server to deploy your projects.
When your project is completed presumably you will deploy your application to a production WebLogic Server.

In this post I explain how to create a deployment profile and deploy your project to an external WebLogic Server. I use the previously created SSXA webpage sample as reference but the procedure is the same for other applications like ADF ones.

First step is optional. I will change the default web context root name to a more easy one. By default JDev assigns web context root names like "You_App_Name-Project_Name-webapp" that will be used as root folder for project, this meas that the resulting url could be not so simple to remember.





To change this name right click your Project in Application Navigator -> Project Properties -> Java EE Application and modify values as you like.



So, let's start deploying our app.

Right click your app -> Deploy -> New Deployment Profile



Select Deployment Profile -> WAR File



Choose a name for your application and click OK twice on settings screens to use default settings.

Go to Application -> Deploy -> New Deployment Profile



Under Deployment Profile select EAR File



Under Application Assembly check your app then click OK




Click OK again to following screen to use default deployment settings.

Finally go to Application -> Deploy -> YOUR_DEPLOYMENT_NAME




Here you can choose between two deployment options:

1)Deploy to EAR file to be manually deployed to an external WebLogic Server

2)Configure an external WebLogic Server to allow JDeveloper to perform all tasks for you.

Option 2 is for sure the faster one just select Deploy to an Application Server and you will be prompted to configure an external WebLogic for deployments.



In this post though I will follow option 1 performing a manual deploy.

Select Deploy to EAR



Your EAR packaged application will be created somewhere on your hard drive, if you open Deployment tab in the bottom screen of JDev you will see a log containing where the file has been saved.

In my case my saving location is

C:\JDeveloper\mywork\Test_SSXA\deploy\application.ear

Login to your WebLogic Server that probably will have an URL similar to this:

http://weblogicserver_ip_address:7001/console

Click Deployments -> Lock & Edit -> Install


Click upload your file

In Deployment Archive select your EAR file then click Next



Click Next -> Next, then select the target you are deploying the application to: select AdminServer and click Next, choose a different name, if you like to, for your app then click Next -> Finish

Click Activate Changes



Return to Deployment page, select your application, click Start -> Service all requests




At this point your application will start servicing requests.

Go to:


http://weblogicserver_ip_address:7001/You_App_Name-Project_Name-webapp/appName/index.html

In my case:

http://10.0.0.4:7001/testSSXA/DemoSSXA/index.html


That's all!!

martedì 22 gennaio 2013

Oracle UCM: Site Studio for eXternal Applications (Part 3)


Today another post about creating a sample webpage using Site Studio for eXternal Applications.

As explained in Oracle UCM: Site Studio for eXternal Applications (Part 1) SSXA differs from Site Studio because it allows webpages to be delivered by WebLogic Server while content is still served by UCM (WebCenter Content).

SSXA allow us to create richer JSP/JSPX web pages using JDeveloper IDE instead of the simplicistic Site Studio Designer.

In this post I will walk you through the creation of a simple webpage, the same webpage created in yesterday's post with Site Studio Designer. In this way you can compare which approach (Site Studio or SSXA) best suits you.

Let's start opening JDeveloper, File -> New



Choose project name and select Site Studio Technology components


Right click Connections -> New Connection -> Site Studio



Insert UCM server details and login informations, test connection and if you are able to perform login click OK. Right click on connection and select Add to Project


Double click wcm-config.xml and create a new site


It could be useful to verify that Site Studio is correctly configured in UCM. Login to your UCM instance, go to site studio administration and verifyif  default metadata assigned to the content are correct.


Edit weblogic.xml and in Security tab insert a new role called WCMContributor mapped to weblogic user. In this way we tell WebLogic that weblogic user can enter contribution mode.


Create a new region template, right click on WebContent -> Templates -> region and select New.


Choose new JSP page and name it rt_wysiwyg, check Create as XML Document (.jspx). Select rt_wysiwyg as Site File ID and choose the region definition


Now  we need to select from the elements available in the region refinition that is associated with the region template. Right click on a new line just before the ending of jsp page, select Site Studio -> insert Element


Create a new placeholder definition


Select region definition and region template associated with this placeholder definition


Now go to Web Content ->  WEB-INF -> sites -> your_site_name.xml. Insert your placeholder definition under Default Placeholder Definition and insert WCM_Designer under Designer Mode Role



Under Web Content -> Templates  right click on pages to create new JSP page.


Name it pt_main, once page template is created go to Web Content ->  WEB-INF -> sites -> your_site_name.xml right click Home, Select Primary Page Template and choose the template just created.



Return to your page template, go to Source view and paste this code:

<?xml version='1.0' encoding='windows-1252'?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1">
  <jsp:output omit-xml-declaration="true" doctype-root-element="HTML"
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"/>
  <jsp:directive.page contentType="text/html;charset=windows-1252"/>
  <html>
    <head>
      <meta http-equiv="Content-Type"
            content="text/html; charset=windows-1252"/>
      <title>Site Studio for eXternal Applications Sample Page</title>
    </head>
    <body>
    <h1>Hello Contributor!!Leave me a message...</h1>
    </body>
  </html>
</jsp:root>


Insert an empty line under <h1>Hello Contributor!!Leave me a message...</h1> and in Component Palette on right of JDeveloper choose Site Studio and select Placeholder. Assign a name to placeholder and click OK.


Now it's time to run our webpage. Let's right click on startyour_site_name.jspx and select Run


WebLogic server will start on your machine and if everything went fine your dfault browser wil automatically start presenting you the webpage just created.

To enter contribution mode press CTRL+SHIFT+F5 and login using:

username:weblogic
password:weblogic1

Click on placeholder and select add content to add a new contributor data file to our webpage. You will be prompted to checkin a new xml data file which will be used by default by contributors.


Once data file is created you can edit it, click on placeholder and edit data file as you like, then once finished click save.


This is the end of part 3. I hope this example could help you decide which approach utilize when implementing a website which relies on content stored in UCM.
In a future post I will explain how to insert new features to webpages like dynamic document conversion: a feature that enables to insert and convert Office documents (like .doc or .xls) directly in viewable webpages.

That's all!!

lunedì 21 gennaio 2013

Oracle UCM: Site Studio (Part 2)


In this post I explain how to create a simple web page using Site Studio. As we will see in a future post Site Studio for eXternal Applications will allow us to create the same webpage with less work and complications.

First you need to install Site Studio Designer.

Site Studio Designer can be downloaded from Oracle website under Downloads -> Middleware -> Webcenter Content -> Individual Component Downloads or it can be downloaded in Oracle UCM under Administration -> Site Studio Administration -> General Component Information



Open Site Studio Designer, go to File -> Site -> Connection Manager



Insert UCM server details, and create a new site:


Right click on Home and select home page



Create new hcsp page and assign informations.



This is our main page which will be displayed in our browser...so let's customize it adding a welcome message...click on Source tab and paste this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><!--$include ss_layout_head_info-->
 
  <title>Site Studio Sample Page</title>
  <script id="ssInfo" type="text/xml" warning="DO NOT MODIFY!">
    <ssinfo >
  </ssinfo>
  </script>
</head>

<body>
<h1>Hello Contributor!!Leave me a message...</h1>
</body>

</html>



Under site assets select Element Definitions -> New -> Wysiwyg Element Definition



Assign info.
Now create a Region Definition, a file which contains info on all elements contained in a certain region of a page.

Double click on Region Definition. We need to add some elements to this region definition, choose a name and a label for it



Create a Region Template, a file which is associated to a certain region definition and describes region definition's appearance.



Right click on page and insert element




Choose the element created before, insert it and save the page.

Create a placeholder definition. A placeholder definition is the element which will be inserted in our webpage and unifies all items created before. Simply it tells to the webpage what kind of content display, where display content, and how display content.



Double click placeholder definition and insert which region definition use and which region template, then save it.



Next step is to define a name mapping for placeholder definition so it can be linked to our webpage. In Site Studio Designer go to Tools -> Define Placeholder Definition Mappings. Choose a name for it and use our previsouly created placeholder definition for both Definition ID primary and secondary.



Let's add this placeholder in our webpage. Open homepage and right click under our welcome message, then add placeholder.



Save page.
Right click homepage and click Assign Content


Click on assign content:




Finally right click on homepage and select View in Browser. Website will appear in your browser. Now let's test contribution feature which allow any contributor to login to UCM and modify page content.
To enter contribution mode in your browser press SHIFT + CTRL + F5 you will be prompted for login, then click on Edit Content


Once edited page content save it and return to "normal" mode by pressing SHIFT + CTRL + F5. If everythings works fine if you logout from contribution mode and reload website again you should see your modifications!!



Thats'all!!!