Jumat, 25 November 2011

Export / Import Database DB2

Export from DB2 :
1) Launch the Control Center from the Windows start menu.
2) Locate your database in the Control Center, right click on it and select Backup from the context menu. This will launch the backup Wizard:
a) Step 1: Click on Next.
b) Step 2: Click on the Add button.
i) In the System name field, select local system
ii) Browse to a location where you want to save the data and click on the OK button
c) Click Finish
3) Do not change the filename of the backup data because it will be resused later when you restore it on your remote environment


Import to DB2 :
1) Transfer the backed up content from your local environment to your remote environment.
2) Launch the DB2 Control Center.
3) Create an empty database with the same name as the one your are about restore.
4) Right click on the newly created empty database and select Restore from the context menu.
5) When the restore wizard pops-up,
a) First click on Next.
b) Click on the add button:
i) In the System name field, select local system
ii) Browse to a location where your backup content is located and click on the OK button
iii) The specific date and time must be defined accurately and can be derived from the backup content's file name. For example, my backup file is calledSAMPLE.0.DB2.NODE0000.CATN0000.20110601102445.001. So the date and time can be derived from the text marked out in red. The date is 2011/June/01 and the time is at 10:24 AM at 45 seconds.
iv) Click finish when done.

Selasa, 15 November 2011

Building Liferay on Tomcat

Introduction:

WebSynergy or Sun GlassFish Web Space Server is built on top of Liferay. The first release of WebSynergy will be built on Liferay 5.2.0. This page describes how you can checkout the source and build the core from open soruce.

Step 1: Install Apache Tomcat

  • Download Apache Tomcat (6.0.18)
  • Unzip tomcat 6.0.18
  • cd apache-tomcat-6.0.18/bin
  • chmod +x *.sh
  • Create setenv.sh
    • JAVA_OPTS="-Xms128m -Xmx1024m -XX:MaxPermSize=512m"
  • Start tomcat
    • apache-tomcat-6.0.18/bin/catalina.sh start
  • Verify http://localhost:8080/
  • Stop tomcat
    • apache-tomcat-6.0.18/bin/catalina.sh stop

Step 2: Checkout Liferay source

Step 3: Prepare build environment

Create app.server..properties in trunk (or 5.2.x) directory, where user is the user name of user logged in to the OS.

app.server.parent.dir= app.server.tomcat.version=6.0 app.server.tomcat.dir=${app.server.parent.dir}/apache-tomcat-6.0.18 app.server.tomcat.classes.global.dir=${app.server.tomcat.dir}/lib app.server.tomcat.lib.endorsed.dir=${app.server.tomcat.dir}/lib/ext app.server.tomcat.lib.global.dir=${app.server.tomcat.dir}/lib/ext app.server.tomcat.lib.support.dir=${app.server.tomcat.dir}/lib/ext app.server.tomcat.support.dir=${app.server.tomcat.dir}/lib/ext 
Hint
You can customize the build environment further by overriding more properties from app.server.properties

Step 4: Build

  • cd trunk (or 5.2.x)
  • ant start
  • ant deploy

Step 5: Test

Step 6: Customize

  • Stop Tomcat
  • To use sample data, copy lportal.script
    • cp trunk/sql/lportal.script apache-tomcat-6.0.18/bin
  • Create apache-tomcat-6.0.18/webapps/ROOT/WEB-INF/classes/portal-ext.properties
    • schema.run.minimal=false
  • Start Tomcat
Tip
Always cd to the bin directory and then start Tomcat so the lportal.script is used by HSQL, otherewise it will create a fresh one which will not have any sample data.

If you do not want the url to be opened automatically in the browser, set this in portal-ext,

browser.launcher.url= 

If you have MySQL up and running, then create a database "lportal" and add following lines to portal-ext

jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false jdbc.default.username=root jdbc.default.password= 

There are tons of properties that can be overridden in portal-ext. Look at trunk/portal-impl/src/portal.properties for what you can override.


source : http://wikis.sun.com/display/websynergy/Building+Liferay+on+Tomcat


Ant View and go to Run As > External Tools Configuration > Environment and add a new Variable:

Name: ANT_OPTS
Value: -Xmx1024m -XX:MaxPermSize=256m

Since Eclipse is invoking Ant it needs the variable.