Thursday, December 9, 2010
INSTALASI ORACLE 11g R2 di UBUNTU 10.04.1
Instalasi Ubuntu 10.04.1
Instal software yang dibutuhkan untuk Oracle 10.04.1
$ sudo apt-get install build-essential libaio1 libaio-dev libmotif3 libtool expat alien ksh pdksh unixODBC unixODBC-dev sysstat elfutils libelf-dev binutils lesstif2 lsb-cxx lsb-rpm
Ubuntu terinstall libstdc++6 dan oracle 11gR2 membutuhkan libstdc++5, jika anda tidak meng-install libstdc++5 akan muncul error/masalah. Untuk menghindari hal itu terjadi lakukan langkah sebagai berikut :
$ wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_amd64.deb
$ dpkg-deb -x libstdc++5_3.3.6-17ubuntu1_amd64.deb ia64-libs
$ sudo cp ia64-libs/usr/lib/libstdc++.so.5.0.7 /usr/lib64/
$ cd /usr/lib64/
$ sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
$ wget http://security.ubuntu.com/ubuntu/pool/universe/i/ia32-libs/ia32-libs_2.7ubuntu6.1_amd64.deb
$ dpkg-deb -x ia32-libs_2.7ubuntu6.1_amd64.deb ia32-libs
$ sudo cp ia32-libs/usr/lib32/libstdc++.so.5.0.7 /usr/lib32/
$ cd /usr/lib32
$ sudo ln -s libstdc++.so.5.0.7 libstdc++.so.5
Buat user dan grup
Buat grup oinstall dan dba
$ sudo su -
# addgroup oinstall
# addgroup dba
Buat user dengan uid dibawah 1000
# useradd -g oinstall -G dba -p password -d /home/oracle -s /bin/bash oracle -u 999
# mkdir /home/oracle
# chown -R oracle:dba /home/oracle
Buat ubuntu agar seperti layout redhat
# ln -s /usr/bin/awk /bin/awk
# ln -s /usr/bin/rpm /bin/rpm
# ln -s /usr/bin/basename /bin/basename
# mkdir /etc/rc.d
# for i in 0 1 2 3 4 5 6 S ; do ln -s /etc/rc$i.d /etc/rc.d/rc$i.d ; done
# mkdir -p /u01/app/oracle
# chown -R oracle:dba /u01
Update parameter sysctl dengan menambah text dibawah ini ke bagian bawah /etc/sysctl.conf
fs.file-max = 6815744
fs.aio-max-nr = 1048576
kernel.shmall = 2097152
kernel.shmmax = 2147483648
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 1048576
net.core.wmem_max = 1048576
net.ipv4.ip_local_port_range = 9000 65535
Rubah limit pemilik software oracle dengan menambahkan baris berikut ini ke /etc/security/limits.conf :
oracle soft nproc 2047
oracle hard nproc 16383
oracle soft nofile 1023
oracle hard nofile 65535
kemudian aktifkan perubahan pada /etc/sysctl.conf dengan perintah :
# sysctl -p
akan terlihat hasil perubahan pada layar.
Extract dan Instal Oracle
Sebelum melakukan instalasi lakukan perintah :
# xhost +
kemudian login menggunakan user oracle :
# su – oracle
oracle yang digunakan pada praktek ini adalah versi 64bit, maka lakukan extract oracle ke direktory database sebagai berikut :
$ su – oracle
$ unzip linux.x64_11gR2_database_1of2.zip
$ unzip linux.x64_11gR2_database_2of2.zip
cek hasil extract :
$ ls -lh
total 2.2G
drwxr-xr-x 8 seiler seiler 4.0K 2009-08-20 14:34 database
-rw-r--r-- 1 seiler seiler 1.2G 2010-03-09 11:33 linux.x64_11gR2_database_1of2.zip
-rw-r--r-- 1 seiler seiler 1.1G 2010-03-09 12:38 linux.x64_11gR2_database_2of2.zip
Sekarang lakukan instalasi dengan menjalankan ./runInstaller :
$ cd database
$ ./runInstaller
Proses berikutnya ikuti pentunjuk instalasi OUI (Oracle Universal Installer). OUI akan memberitahukan paket yang tidak ditemukan, karena OUI melakukan pemeriksaan pada RPM, kita bisa lanjutkan instalasi dengan mengabaikan dan melanjutkan proses instalasi hingga selesai.
Setelah instalasi selesai, lakukan seting pada environmen pada /etc/profile sebagai berikut :
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$PATH
export EDITOR=/usr/bin/vi
Kemudian lakukan test hasil instalasi dengan :
$ sqlplus /nolog
SQL*Plus: Release 11.2.0.1.0 Production on Thu Jun 10 23:46:42 2010
Copyright (c) 1982, 2009, Oracle. All rights reserved.
SQL> quit
$ /u01/app/oracle/product/11.2.0/dbhome_1/OPatch/opatch lsinventory
Invoking OPatch 11.1.0.6.6
Oracle Interim Patch Installer version 11.1.0.6.6
Copyright (c) 2009, Oracle Corporation. All rights reserved.
dbhome_1
Central Inventory : /u01/app/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.1.0.6.6
OUI version : 11.2.0.1.0
OUI location : /u01/app/oracle/product/11.2.0/dbhome_1/oui
Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2010-06-10_23-46-53PM.log
Patch history file: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2010-06-10_23-46-53PM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (1):
Oracle Database 11g 11.2.0.1.0
There are 1 products installed in this Oracle Home.
There are no Interim patches installed in this Oracle Home.
--------------------------------------------------------------------------------
OPatch succeeded.
Startup ORACLE secara otomatis pada system boot
Edit /etc/oratab seperti dibawah ini:
orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y
kemudian buat file /etc/init.d/oracledb :
$ sudo pico /etc/init.d/oracle
yang isinya sebagai berikut :
#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export ORA_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORA_OWNR=oracle
# if the executables do not exist -- display error
if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage display
case "$1" in
start)
# Oracle listener and instance startup
echo -n "Starting Oracle: "
su - $ORA_OWNR -c "$ORA_HOME/bin/dbstart $ORA_HOME"
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
#Optional : for Enterprise Manager software only
su - $ORA_OWNR -c "$ORA_HOME/bin/emctl start dbconsole"
touch /var/lock/oracledb
echo "OK"
;;
stop)
# Oracle listener and instance shutdown
echo -n "Shutdown Oracle: "
#Optional : for Enterprise Manager software only
su - $ORA_OWNR -c "$ORA_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNR -c "$ORA_HOME/bin/dbshut $ORA_HOME"
rm -f /var/lock/oracle
echo "OK"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 start|stop|restart|reload"
exit 1
esac
exit 0
#end of /etc/init.d/oracledb
Untuk membuatnya berjalan ketika start gunakan perintah :
$ sudo update-rc.d oracledb defaults
Proses instalasi selesai
Wednesday, September 29, 2010
BELAJAR GAMBAR VECTOR PAKE INKSCAPE
dah lama ngga buka-buka si ajaib linux karena kerjaan lagi banyak pake punya Bill Gate.
Celingak-celinguk di ubuntu 10.4 aha... ada inkscape, gimp dan blender.
Where we start ?
Dengan alasan pekerjaan masih pake MS punya jadilah cari portingan dari ketiganya... contact mbah google..... a couple minute then.... got info :
Inkscape Draw freely dari http://www.inkscape.org
Gimp - for windows dari http://www.gimp.org
Blender - The Blender Windows dari http://www.blender.org
download dan install
Terus mulai dari mana nih...?
Putusan jatuh ke Inkscape karena lagi butuh gambar vector buat nambah shape di OpenOffice dan Dia (Opensource untuk Office suite dan Diagram Editor buat Flowchart, Mapping Diagram dan UML).
Cia yo ayo belajar.... minta bantu mbah google ... got it....
Video Tutorial untuk Inkscape dapet dari http://screencasters.heathenx.org/
Dan ternyata ada mirror di Indonesia, bisa download cepet donk hehe
Buaya yang baik hati kasih : http://buaya.klas.or.id/mirror/tutorial-inkscape/
Di screencasters.heathenx.org juga ada tutorial untuk gimp dan blender, but may be later.. saya focus dulu satu persatu biar ngga semrawut.
Buat yang mau ikutan belajar silahken ke TKP
Kalo belum cukup silahken dateng juga ke :
http://www.inkscape.org/doc/
http://www.trazoi.net/tutorials/inkscape/oots/
Saturday, July 24, 2010
Upload from csv via sql command
set hea off
set pagesize 0
spool c:\whatever.csv
select a.a||','||a.b||','||a.c
from a
where a.a="whatever";
spool off
Saturday, May 15, 2010
Turn off Wireless and bluetooth on startup
find out some clue from uncle google, tada ...
I get the solution :
1st . Check wireless and bluetooth devices:
$rfkill list
in my case
0 for wireless
1 for bluetooh
2nd. Setup startup application
From menu System > Preference > Startup Application
this is my setup :
name : Disable Wireless on startup
command : rfkill block 0
then save..
add for bluetooth
name : Disable Bluetooth on startup
command : rfkill block 1
restart the laptop....
yes the wireless, bluetooth led not luminate anymore.
Thursday, February 25, 2010
HIRENS BOOT CD 10.2 sudah datang
Nah tools paling populer untuk para pengoprek komputer, hirens boot CD ini ngga bakalan bisa ditolak.
Lihat koleksinya :
- Partition Tools
- Backup Tools
- Pass. & Registry Tools
- Recovery Tools
- Testing Tools
- Harddisk Tools
- System Info Tools
- File Managers
- MBR Tools
- BIOS/CMOS Tools
- MultiMedia Tools
- FileSystems Tools
- AntiSpyware
- Browsers
- Cleaners
- Optimizers
- Process Tools
- Startup Tools
- Tweakers
Coba keganasannya dengan download langsung di :
http://www.hirensbootcd.net/
Selamat menikmati
Wednesday, February 24, 2010
3DES DECRYPT WEBLOGIC 8.1 Version
http://gustlik.wordpress.com/2008/08/06/decryption-of-configuration-passwords-in-weblogic/
Uji coba pada weblogic 8.1 ->> success
1. Tambahkan pada classpath %WLHOME%/server/lib/weblogic.jar
2. Buat weblogicdecryptor.java berisi :
import java.util.*;
import java.io.*;
import javax.xml.parsers.*;
import javax.xml.xpath.*;
import org.w3c.dom.*;
import weblogic.security.internal.*; // requires weblogic.jar in the
class path
import weblogic.security.internal.encryption.*;
public class weblogicdecryptor {
private static final String PREFIX = "{3DES}";
private static final String XPATH_EXPRESSION
= "//node()[starts-with(text(), '" + PREFIX + "')] |
//@*[starts-with(., '" + PREFIX + "')]";
private static ClearOrEncryptedService ces;
public static void main(String[] args) throws Exception {
if (args.length < 2) {
throw new Exception("Usage: [domainDir] [configFile]");
}
ces = new
ClearOrEncryptedService(SerializedSystemIni.getEncryptionService(new
File(args[0]).getAbsolutePath()));
File file = new File(args[1]);
if (file.getName().endsWith(".xml")) {
processXml(file);
}
else if (file.getName().endsWith(".properties")){
processProperties(file);
}
}
private static void processXml(File file) throws Exception {
Document doc =
DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(file);
XPathExpression expr =
XPathFactory.newInstance().newXPath().compile(XPATH_EXPRESSION);
NodeList nodes = (NodeList)expr.evaluate(doc,
XPathConstants.NODESET);
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
print(node.getNodeName(), node.getTextContent());
}
}
private static void processProperties(File file) throws Exception {
Properties properties = new Properties();
properties.load(new FileInputStream(file));
for (Map.Entry p : properties.entrySet()) {
if (p.getValue().toString().startsWith(PREFIX)) {
print(p.getKey(), p.getValue());
}
}
}
private static void print(Object attributeName, Object encrypted) {
System.out.println("Node name: " + attributeName);
System.out.println("Encrypted: " + encrypted);
System.out.println("Decrypted: " +
ces.decrypt((String)encrypted) + "\n");
}
}
3. Compile dengan : javac weblogicdecryptor.java
4. Tools sudah siap di gunakan cara penggunaan :
javac weblogicdecrytor [domainpath] [fileToDecrypt]
Selamat menikmati
Friday, February 5, 2010
ORACLE : UPDATE TABLE FROM OTHER TABLE WHICH HAS SAME FIELD
Pengantar
Kadang ada situasi dimana kita ingin memperbaharui record pada sebuah table, dimana terdapat kesamaan di table lain. Dengan menggunakan update sederhana mengakibatkan tabel target yang tidak sama dengan table sumber menjadi berisi NULL.
Berikut salah satu penggunaan "where exists" dapat menghindari hal tersebut.
Kebutuhan
Oracle database 9i atau lebih tinggi
Deskripsi permasalahan
Permasalahan di atas di gambarkan sebagai berikut.
Source Table:
DEPT
Figure 1
Destination Table:
EMP
Figure 2
Kita akan lakukan update field NAMA pada table EMP untuk ID yang sama dengan ID di table DEPT.
ID NAME
----------
1 E
2 F
3 G
5 X
Solusi sangat mudah di awalnya sangat mudah, tapi hasilnya bermasalas seperti dibawah ini.
Listing 1
update EMP a set a.name =(select name from DEPT b where a.id=b.id ); Figure 3
Kita tidak pernah menginginkan null pada ID= 5.
Query pada Linsting 1 hanya meng-update NAME dengan ID sama, dan juga mengubah NAME dengan ID yang tidak sama sehingga isinya menjadi NULL,
dimana hal ini tidak diharapkan.
SOLUSI
Listing 2
update EMP a set a.name =(select b.name from DEPT b where a.id = b.id ) where exists(select 1 from DEPT b where a.id = b.id); Figure 4
Penjelasan
Query pada listing 2 memecahkan permasalahan dengan hanya mengupdate NAME dengan ID yang sesuai, dan membiarkan ID yang tidak sama.
Saturday, January 16, 2010
RESET SUSE root password
1. At the GRUB boot menu select the linux option and press 'e' .
2. Choose your kernal and press 'e' once more.
3. Here in the Edit mode add the following to the end of the line leaving a space.
| single |
| 1 |
5. This will make you the "root" user without asking for a password. Once the system has booted, you can change the root password using the password command in the prompt:
| passwd |
SUSE Linux 10.1 Method
1. At the GRUB boot menu select the linux option and press 'e' .
2. Nothng happend!! Ok you cann't edit it from here in this release. But instead SUSE provides a method to Enter you boot code. Select the SUSE entry in the startup GRUB screen. Look for Boot Options in the bottom of the window. You can just type in the boot options here..
3. So in Boot Options enter the following.
| init=/bin/sh |
4. Press ENTER to boot.
5. Once the system has booted, you can change the root password using the password command in the console:
| passwd |
| reboot |
Friday, January 15, 2010
AUTOMATIC STARTUP ORACLE 11g R2 PADA RHEL 5.2
saat listrik dari P*N nyala
dan RHEL start, oracle ngga mau jalan..
Tanya bah google then a litle trial and error, here is the solution.
Login sebagai root dan buka /etc/oratab
$ nano /etc/oratab
ganti
ORCL:/u01/app/oracle/product/11.2.0/db112:N
menjadi
ORCL:/u01/app/oracle/product/11.2.0/db112:Y
Simpan.
Kemudian buat perubahan pada $ORACLE_HOME/bin/dbstart sebagai berikut
ORACLE_HOME_LISTNER=/???
/??? apapun isinya
dengan
ORACLE_HOME_LISTNER=$ORACLE_HOME
Simpan.
Selanjutnya buat script startup oracle
#nano /etc/init.d/dbora
isinya :
#!/bin/bash
#
# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
#
# chkconfig: 35 80 30
# description: Oracle Database startup script
# Source function library.
. /etc/rc.d/init.d/functions
ORACLE_OWNER="oracle"
ORACLE_HOME=":/u01/app/oracle/product/11.2.0/db112"
case "$1" in
start)
echo -n $"Starting Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "OK"
;;
stop)
echo -n $"Stopping Oracle DB:"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "OK"
;;
*)
echo $"Usage: $0 {start|stop}"
esac
#=========================== End of script ==============================
Simpan dan kemudian
# chmod 750 /etc/init.d/dbora
# /sbin/chkconfig --add dbora --level 0356