Archive

Posts Tagged ‘Oracle’

Install ORACLE on AIX 6.1

July 24, 2016 Leave a comment

Oracle 11g Installation procedure on AIX system v.6.1 environment, on IBM P-series machine is summarized from best practice at one of our  client. This procedure, will be followed by Websphere Application Server Installation procedure and configuration on the same environment and machine.

The steps of Oracle Installation 11g on AIX System is briefly described as follow :

1. Please check software pre-requisite on AIX system :

  • bos.adt.base
  • bos.adt.lib
  • bos.adt.libm
  • bos.perf.libprefstat
  • bos.perf.perfstat
  • bos.perf.proctools
  • xlC.aix50.rte 8.0.0.8 or later
  • xlC.rte 8.0.0 or later

2. Run command below to verify the pre-requisite :

  • lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat bos.perf.libperfstat bos.perf.proctoolschecking

3. Change value of max number of processes allowed  :

  • Run “smit chgsys”
  • Set “Maximum number of PROCESSES allowed per user” > 2048
  • Verify value of “ARG/ENV list size in 4K byte blocks” >= 128smith

4. Create user and groups for oracle installation, using the following command:

  • mkgroup oinstall
  • mkgroup dba
  • mkgroup oper
  • useradd -g oinstall -G dba, oper -m oracle
  • passwd oracle #Set password for oracle useruseroracle

5.  Create oracle home directory and set ownership and privileges

  • mkdir -p /database/oracle/app
  • chown -R oracle:oinstall /database/oracle/app
  • chmod -R 755 /database/oracle/apphomeoracle

6. Change display setting on AIX

  • vi /home/oracle/.profile
  • add line : “DISPLAY=:1.0; export DISPLAY

7. Set ORACLE_HOME

  • vi /home/oracle/.profile
  • add the following lines :
  • ORACLE_BASE  = /opt.app/oracle
  • ORACLE_SID = orcl
  • export ORACLE_BASE
  • export ORACLE_SID
  • ORACLE_HOME = $ORACLE_BASE/product/11.1.0/db1
  • PATH = $ORACLE_HOME/bin:$PATH
  • export ORACLE_HOME
  • export PATHpathoracle

8. Switch user to oracle and run installer as usual with options -ignorePrereq

runinstaller

 

install

 

and follow installation procedure till finish …

 

Bogor, Sunday 24 July 2016

 

A. Ahmad Kusumah

 

 

 

 

 

Oracle Datafile Recovery (ORA-01172)

February 19, 2013 Leave a comment

Today, i Face a problem on oracle db server. the symptoms are :

  1. Try to login, but exception thrown,  said ‘ORA-01033: ORACLE initialization or shutdown in progress’
  2. Try to check listener status, result : Listener is running but nothing weird
  3. Try to open database manualy using command : ‘alter dabase open’, exception raised, ‘ORA-01172 : recovery of thread 1 stuck at block 747 of file 3’

To resolve this problem , the steps are :

  1. Connect as sysdba
  2. invoke following command : ‘select name, status, enabled from v$datafile where file#=3‘. The id come from file id raised in ORA-01172. The Result :  Id
  3. The result shows datafile need to be recovered
  4. To recover the datafile, invoke the following command ‘recover datafile 3’ , The id come from file id above. -
  5. Then invoke command to open database.

Voilaa .. now i can login to my oracle box without problem.

#NB : Don’t forget to backup database regularly, using hot backup or cold backup.

 

Jakarta WEBS Tower

Tuesday, 19 Februari 2012

 

A. Ahmad Kusumah

 

 

 

Categories: Database Tags: ,

Password life time on oracle

July 17, 2012 1 comment

Alter Profile

By default, user created in oracle has password expiration on 180 days. It means, when the time reached, the user will be forced to change their current password. This mechanism from security view is has advantages, it makes user aware to always maintain their current profile and data.

But, in other hand, sometimes an application need user with no expiration date of password such as ERP, Procurement etc. In order to facilitate this needs, there’s 2 ways to do so :

  1. Create stand alone profile with unlimited expiration date and assign to user
  2. Update user current profile, set limit of password expiration to unlimited

This time we’ll show the second method, update user current profile.

The steps are :

1. check current user profile using command :

select profile from dba_users where username='<username>’;

2. Change limit of password expiration policy o unlimited

alter profile <profile_name> limit password_life_time UNLIMITED;

3. Check profile after to make sure policy has been updated

select resource_name,limit from dba_profiles where profile='<profile_name>’;

Now,all users with this profile has no expiration date policy for their password …

Lampung, 17 July 2012

Aah Ahmad Kusumah

(IT Professional Consultant and Developer)

Clean Up Oracle archive log using cron

July 1, 2012 Leave a comment

Cron List

Oracle has capability for creating hot backup using archive log mechanism. This feature act like recovery data system for restoring database content to specified time if the original database has force majeur which make data corrupted.

But, this mechanism will suck up the free space of hard disk and typically if we don’t maintain the following problem maybe occured :

1. The Space allocated for archive run out which make all transaction will be suspended

2. Hard disk space will be run out

Usually we can delete completed archive log using RMAN command, but this sometimes takes time.

Below is automation script for deleting completed archive log using cron.

1. create script (named cleanarchive.sh)

#!/bin/bash
export ORACLE_BASE=/database/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_OWNR=oracle
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin

su – oracle -c rman target / << __EOF__
DELETE NOPROMPT ARCHIVELOG ALL COMPLETED BEFORE ‘SYSDATE -7’;
EXIT
__EOF__

2. create new job on cron sequence (will be executed everyday at 22:55)

crontab -e

55 22 * * * /bin/sh /database/oracle/crontab/cleanarchive.sh >/database/oracle/crontab/arch.log 2>&1

3. Restart cron service

Voila …, now the completed archive log will be checked and cleaned up every day, and we just left the archive less then 7 day till the day executed.

 

Tanjung Karang, Lampung

July, 1st 2012

 

Aah Ahmad Kusumah

WAS 7 and Struts 2, Oracle, Hibernate

March 3, 2011 Leave a comment

Last month, i began to develope JEE application using Struts2 framework, Spring plugins, Hibernate , oracle and Websphere Application sever v.7.  Actually, it is not new development, just migration from DB2 and Apache tomcat environment to Oracle and WAS environment.

This application, let’s called X application, is initially developed under Windows Server , JEE 5, Apache tomcat and IBM DB2 database System. It has been running at a government company as known as BUMN for a year and run smoothly.

When the migration is began, i switch the DB2 system to oracle and the Application server to WAS, without major changes on sources of application, but Connection configuration only. Then, i build and deploy it to development server (IBM P Series and AIX 6 environment).

First error i found is this :

at java.lang.Class.getDeclaredFieldsImpl(Native Method)
 at java.lang.Class.getDeclaredFields(Class.java:543)
 at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:89)
 at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
 at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:67)
 at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
 at java.util.concurrent.FutureTask.run(FutureTask.java:149)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
 at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.<init>(ContainerImpl.java:348)
 at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:305)
 at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:301)
 at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
 at java.util.concurrent.FutureTask.run(FutureTask.java:149)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
 at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
 at com.opensymphony.xwork2.inject.ContainerImpl.getConstructor(ContainerImpl.java:594)
 at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:491)
 at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
 at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
 at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
 at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
 at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
 at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
 at com.opensymphony.xwork2.inject.ContainerImpl$ParameterInjector.inject(ContainerImpl.java:462)
 at com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.java:477)
 at com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:34)
 at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
 at com.opensymphony.xwork2.inject.ContainerImpl$2.call(ContainerImpl.java:104)
 at com.opensymphony.xwork2.inject.ContainerImpl$2.call(ContainerImpl.java:101)
 at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
 at com.opensymphony.xwork2.inject.ContainerImpl.injectStatics(ContainerImpl.java:101)
 at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:493)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:184)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:374)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:418)
 at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
 at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
 at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:140)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:509)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:423)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:282)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:340)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:812)
 at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:917)
 at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.invokeFilters(DefaultExtensionProcessor.java:924)
 at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:651)
 at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3610)
 at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:274)
 at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:926)
 at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1557)
 at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:173)
 at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
 at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
 at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
 at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
 at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
 at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
 at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
 at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:202)
 at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:766)
 at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:896)
 at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)
Caused by: java.lang.ClassNotFoundException: org.apache.velocity.app.VelocityEngine
 at java.net.URLClassLoader.findClass(URLClassLoader.java:419)
 at com.ibm.ws.bootstrap.ExtClassLoader.findClass(ExtClassLoader.java:150)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:643)
 at com.ibm.ws.bootstrap.ExtClassLoader.loadClass(ExtClassLoader.java:90)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
 at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:62)
 at com.ibm.ws.classloader.ProtectionClassLoader.loadClass(ProtectionClassLoader.java:58)
 at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:466)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
 at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:466)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:609)
 ... 66 more

the stack trace indicate there is missing class related to velocity engine. I don’t know why this happened, because currently on the application i don’t use velocity implementation at all.

to resolve this error, i add velocity and velocity tools library to build path and rebuild the application, but it doesn’t work, the server still throw the same error. I explore the installation folder of WAS and found library folder contains ext folder inside, i assume this folder is for external library needed by the server to run the installed application. I copy the library to this folder, and restart the server, and finally the application is up and running.

the library i added to the WAS is attached below :

 

 

 

 

 

Categories: Programming Tags: , , ,