Difference between revisions of "Instalasi Oracle"
Onnowpurbo (talk | contribs) (New page: # apt-get install libaio libaio1 # cp oracle-xe_10.2.0.1-1.0_i386.deb /usr/local/src # cd /usr/local/src # dpkg -i oracle-xe_10.2.0.1-1.0_i386.deb Note: Need Big SWAP # /etc/init...) |
Onnowpurbo (talk | contribs) |
||
(38 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | Sumber: http://sysadminnotebook.blogspot.co.id/2012/10/installing-oracle-11g-r2-express.html | |
+ | Beberapa software accounting yang besar, seperti Compiere dan Adempiere masih bergantung pada database besar seperti Oracle. Walaupun Adempiere dapat juga digunakan tanpa Oracle. Kita pada hari ini agak beruntung karena Oracle mengeluarkan versi yang gratis untuk digunakan, yang di kenal sebagai “Oracle Express Edition”. | ||
− | + | Instalasi Oracle Experss Edition tidak sukar, bahkan sangat mudah sekali. | |
− | |||
− | |||
+ | ==Download & Siapkan Aplikasi Pendukung== | ||
− | + | * Pastikan | |
− | + | ** Swap > 2Gbyte | |
− | + | ** Harddisk > 30 Gbyte | |
− | |||
− | |||
− | |||
− | |||
− | access to | + | * Download Oracle Express Edition dari situs Oracle pada URL |
− | http://127.0.0.1:8080/apex | + | |
+ | http://www.oracle.com/technetwork/database/express-edition/downloads/index.html | ||
+ | |||
+ | * Install beberapa library pendukung. Pada Ubuntu dapat dilakukan menggunakan perintah, | ||
+ | |||
+ | sudo apt update | ||
+ | sudo apt -y install alien libaio1 unixodbc dpkg-dev debhelper build-essential unzip | ||
+ | |||
+ | ==Buat Script== | ||
+ | |||
+ | * edit chkconfig | ||
+ | |||
+ | sudo vi /sbin/chkconfig | ||
+ | |||
+ | #!/bin/bash | ||
+ | # Oracle 11gR2 XE installer chkconfig hack for Ubuntu | ||
+ | file=/etc/init.d/oracle-xe | ||
+ | if [[ ! `tail -n1 $file | grep INIT` ]]; then | ||
+ | echo >> $file | ||
+ | echo '### BEGIN INIT INFO' >> $file | ||
+ | echo '# Provides: OracleXE' >> $file | ||
+ | echo '# Required-Start: $remote_fs $syslog' >> $file | ||
+ | echo '# Required-Stop: $remote_fs $syslog' >> $file | ||
+ | echo '# Default-Start: 2 3 4 5' >> $file | ||
+ | echo '# Default-Stop: 0 1 6' >> $file | ||
+ | echo '# Short-Description: Oracle 11g Express Edition' >> $file | ||
+ | echo '### END INIT INFO' >> $file | ||
+ | fi | ||
+ | update-rc.d oracle-xe defaults 80 01 | ||
+ | #EOF | ||
+ | |||
+ | |||
+ | chmod 755 /sbin/chkconfig | ||
+ | |||
+ | |||
+ | Catat hasil perintah di bawah | ||
+ | |||
+ | free -m | ||
+ | |||
+ | total used free shared buff/cache available | ||
+ | Mem: 2000 36 1861 3 102 1926 | ||
+ | Swap: 2046 0 2046 | ||
+ | |||
+ | |||
+ | sudo sysctl -q fs.file-max | ||
+ | fs.file-max = 200437 | ||
+ | fs.file-max = 6815744 | ||
+ | |||
+ | cat /proc/meminfo | grep MemTotal | ||
+ | MemTotal: 2048524 kB | ||
+ | MemTotal: 2048524 kB | ||
+ | |||
+ | grep -n ".*" /proc/sys/kernel/shmm* | ||
+ | |||
+ | /proc/sys/kernel/shmmax:1:18446744073692774399 | ||
+ | /proc/sys/kernel/shmmni:1:4096 | ||
+ | |||
+ | /proc/sys/kernel/shmmax:1:536870912 | ||
+ | /proc/sys/kernel/shmmni:1:4096 | ||
+ | |||
+ | Edit sysctl dan sesuaikan parameter-nya dengan hasil catatan | ||
+ | |||
+ | sudo vi /etc/sysctl.d/60-oracle.conf | ||
+ | |||
+ | |||
+ | # Oracle 11g XE kernel parameters | ||
+ | fs.file-max=6815744 | ||
+ | net.ipv4.ip_local_port_range=9000 65000 | ||
+ | kernel.sem=250 32000 100 128 | ||
+ | kernel.shmmax=536870912 | ||
+ | |||
+ | ==Restart Kernel Parameter== | ||
+ | |||
+ | sudo service procps start | ||
+ | |||
+ | cek | ||
+ | |||
+ | sudo sysctl -q fs.file-max | ||
+ | |||
+ | fs.file-max pastikan di > 2Gb, jika kurang maka kita perlu memperbesar. | ||
+ | Silahkan membaca-baca [[Ubuntu: Memperbesar SWAP | cara memperbesar swap]] | ||
+ | |||
+ | Cek swap dengan | ||
+ | |||
+ | free -m | ||
+ | |||
+ | Reboot | ||
+ | |||
+ | shutdown -r now | ||
+ | |||
+ | ==Tweak== | ||
+ | |||
+ | sudo ln -s /usr/bin/awk /bin/awk | ||
+ | sudo mkdir -p /var/lock/subsys | ||
+ | sudo touch /var/lock/subsys/listener | ||
+ | |||
+ | ===Perbaiki /dev/shm=== | ||
+ | |||
+ | Untuk menghindari MEMORY TARGET error: | ||
+ | |||
+ | sudo umount /dev/shm | ||
+ | sudo umount /dev/shm | ||
+ | sudo umount /dev/shm | ||
+ | sudo rm -rf /dev/shm | ||
+ | sudo rm -Rf /dev/shm | ||
+ | sudo mkdir /dev/shm | ||
+ | sudo mkdir -p /dev/shm | ||
+ | sudo mount -t tmpfs shmfs -o size=2048m /dev/shm | ||
+ | |||
+ | Alasan mengapa hal di atas perlu di lakukan karena di Ubuntu /dev/shm hanyalah sebuah link ke /run/shm, | ||
+ | Sementara Oracle meminta /dev/shm mount point yang terpisah. | ||
+ | |||
+ | Membuatnya menjadi permanen | ||
+ | |||
+ | sudo vi /etc/rc2.d/S01shm_load | ||
+ | |||
+ | #!/bin/sh | ||
+ | case "$1" in | ||
+ | start) mkdir /var/lock/subsys 2>/dev/null | ||
+ | touch /var/lock/subsys/listener | ||
+ | rm /dev/shm 2>/dev/null | ||
+ | mkdir /dev/shm 2>/dev/null | ||
+ | mount -t tmpfs shmfs -o size=2048m /dev/shm ;; | ||
+ | *) echo error | ||
+ | exit 1 ;; | ||
+ | esac | ||
+ | |||
+ | chmod 755 /etc/rc2.d/S01shm_load | ||
+ | shutdown -r now | ||
+ | |||
+ | ==Install Oracle Express Edition== | ||
+ | |||
+ | Setup environment | ||
+ | |||
+ | vi ./bashrc | ||
+ | |||
+ | export ORACLE_HOME="/u01/app/oracle/product/11.2.0/xe" | ||
+ | export ORACLE_SID="XE" | ||
+ | export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` | ||
+ | export ORACLE_BASE="/u01/app/oracle" | ||
+ | export LD_LIBRARY_PATH="$ORACLE_HOME/lib:$LD_LIBRARY_PATH" | ||
+ | export PATH="$ORACLE_HOME/bin:$PATH:." | ||
+ | |||
+ | Konversikan oracle xe menjadi .deb | ||
+ | |||
+ | unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip | ||
+ | cd Disk1/ | ||
+ | sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm | ||
+ | |||
+ | Pastikan file .deb di generate. Selanjutnya kita bisa menginstalasi Oracle XE menggunakan perintah | ||
+ | |||
+ | sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb | ||
+ | |||
+ | Cek createdb | ||
+ | |||
+ | cd /u01/app/oracle/product/11.2.0/xe/bin | ||
+ | ./createdb.sh | ||
+ | |||
+ | ==Konfigurasi Awal Oracle Express Edition== | ||
+ | |||
+ | Konfigurasi Oracle Express Edition menggunakan perintah, | ||
+ | |||
+ | /etc/init.d/oracle-xe configure | ||
+ | |||
+ | Sebagian besar nilai default yang di tawarkan pada saat konfigurasi sebetulnya tidak perlu di ubah, kita cukup menekan tombol <Enter> sampai selesai konfigurasi. Mohon di ingat baik—baik password SYS atau SYSTEM yang kita set, jangan sampai lupa. Pada saat proses konfigurasi maka pada layar akan tampak tampilan berikut, | ||
+ | |||
+ | root@ubuntu:/usr/local/src# /etc/init.d/oracle-xe configure | ||
+ | |||
+ | Oracle Database 10g Express Edition Configuration | ||
+ | ------------------------------------------------- | ||
+ | This will configure on-boot properties of Oracle Database 10g Express | ||
+ | Edition. The following questions will determine whether the database should | ||
+ | be starting upon system boot, the ports it will use, and the passwords that | ||
+ | will be used for database accounts. Press <Enter> to accept the defaults. | ||
+ | Ctrl-C will abort. | ||
+ | |||
+ | Specify the HTTP port that will be used for Oracle Application Express [8080]: | ||
+ | |||
+ | Specify a port that will be used for the database listener [1521]: | ||
+ | |||
+ | Specify a password to be used for database accounts. Note that the same | ||
+ | password will be used for SYS and SYSTEM. Oracle recommends the use of | ||
+ | different passwords for each database account. This can be done after | ||
+ | initial configuration: | ||
+ | Confirm the password: | ||
+ | |||
+ | Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y | ||
+ | |||
+ | Starting Oracle Net Listener...Done | ||
+ | Configuring Database...Done | ||
+ | Starting Oracle Database 10g Express Edition Instance...Done | ||
+ | Installation Completed Successfully. | ||
+ | To access the Database Home Page go to "http://127.0.0.1:8080/apex" | ||
+ | |||
+ | root@ubuntu:/usr/local/src# | ||
+ | |||
+ | * Setelah selesai di konfigurasi, kita dapat me-restart Oracle menggunakan perintah, | ||
+ | |||
+ | # /etc/init.d/oracle-xe restart | ||
+ | Shutting down Oracle Database 10g Express Edition Instance. | ||
+ | Stopping Oracle Net Listener. | ||
+ | |||
+ | Starting Oracle Net Listener. | ||
+ | Starting Oracle Database 10g Express Edition Instance. | ||
+ | |||
+ | |||
+ | Selanjutnya, konfigurasi Oracle Database dapat dilakukan dengan mengakses alamat / URL http://127.0.0.1:8080/apex | ||
+ | |||
+ | |||
+ | ===Error=== | ||
+ | |||
+ | Jika ada error | ||
+ | |||
+ | Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details | ||
+ | |||
+ | |||
+ | Cek | ||
+ | |||
+ | cat /proc/meminfo | grep MemTotal | ||
+ | MemTotal: 2048524 kB | ||
+ | |||
+ | grep -n ".*" /proc/sys/kernel/shmm* | ||
+ | /proc/sys/kernel/shmmax:1:536870912 | ||
+ | /proc/sys/kernel/shmmni:1:4096 | ||
+ | |||
+ | ==Referensi== | ||
+ | |||
+ | * http://sysadminnotebook.blogspot.co.id/2012/10/installing-oracle-11g-r2-express.html | ||
+ | * https://community.oracle.com/message/9720583#9720583 | ||
+ | * http://www.techienote.com/2011/09/oracle-database-11g-r2-on-ubuntu-11-04.html | ||
+ | |||
+ | |||
+ | ==Pranala Menarik== | ||
+ | |||
+ | * [[Linux Howto]] | ||
+ | * [[Tip Membangun Server Sendiri]] |
Latest revision as of 17:38, 20 January 2018
Sumber: http://sysadminnotebook.blogspot.co.id/2012/10/installing-oracle-11g-r2-express.html
Beberapa software accounting yang besar, seperti Compiere dan Adempiere masih bergantung pada database besar seperti Oracle. Walaupun Adempiere dapat juga digunakan tanpa Oracle. Kita pada hari ini agak beruntung karena Oracle mengeluarkan versi yang gratis untuk digunakan, yang di kenal sebagai “Oracle Express Edition”.
Instalasi Oracle Experss Edition tidak sukar, bahkan sangat mudah sekali.
Download & Siapkan Aplikasi Pendukung
- Pastikan
- Swap > 2Gbyte
- Harddisk > 30 Gbyte
- Download Oracle Express Edition dari situs Oracle pada URL
http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
- Install beberapa library pendukung. Pada Ubuntu dapat dilakukan menggunakan perintah,
sudo apt update sudo apt -y install alien libaio1 unixodbc dpkg-dev debhelper build-essential unzip
Buat Script
- edit chkconfig
sudo vi /sbin/chkconfig
#!/bin/bash # Oracle 11gR2 XE installer chkconfig hack for Ubuntu file=/etc/init.d/oracle-xe if grep INIT` ; then echo >> $file echo '### BEGIN INIT INFO' >> $file echo '# Provides: OracleXE' >> $file echo '# Required-Start: $remote_fs $syslog' >> $file echo '# Required-Stop: $remote_fs $syslog' >> $file echo '# Default-Start: 2 3 4 5' >> $file echo '# Default-Stop: 0 1 6' >> $file echo '# Short-Description: Oracle 11g Express Edition' >> $file echo '### END INIT INFO' >> $file fi update-rc.d oracle-xe defaults 80 01 #EOF
chmod 755 /sbin/chkconfig
Catat hasil perintah di bawah
free -m
total used free shared buff/cache available Mem: 2000 36 1861 3 102 1926 Swap: 2046 0 2046
sudo sysctl -q fs.file-max fs.file-max = 200437 fs.file-max = 6815744
cat /proc/meminfo | grep MemTotal MemTotal: 2048524 kB MemTotal: 2048524 kB
grep -n ".*" /proc/sys/kernel/shmm*
/proc/sys/kernel/shmmax:1:18446744073692774399 /proc/sys/kernel/shmmni:1:4096
/proc/sys/kernel/shmmax:1:536870912 /proc/sys/kernel/shmmni:1:4096
Edit sysctl dan sesuaikan parameter-nya dengan hasil catatan
sudo vi /etc/sysctl.d/60-oracle.conf
# Oracle 11g XE kernel parameters fs.file-max=6815744 net.ipv4.ip_local_port_range=9000 65000 kernel.sem=250 32000 100 128 kernel.shmmax=536870912
Restart Kernel Parameter
sudo service procps start
cek
sudo sysctl -q fs.file-max
fs.file-max pastikan di > 2Gb, jika kurang maka kita perlu memperbesar. Silahkan membaca-baca cara memperbesar swap
Cek swap dengan
free -m
Reboot
shutdown -r now
Tweak
sudo ln -s /usr/bin/awk /bin/awk sudo mkdir -p /var/lock/subsys sudo touch /var/lock/subsys/listener
Perbaiki /dev/shm
Untuk menghindari MEMORY TARGET error:
sudo umount /dev/shm sudo umount /dev/shm sudo umount /dev/shm sudo rm -rf /dev/shm sudo rm -Rf /dev/shm sudo mkdir /dev/shm sudo mkdir -p /dev/shm sudo mount -t tmpfs shmfs -o size=2048m /dev/shm
Alasan mengapa hal di atas perlu di lakukan karena di Ubuntu /dev/shm hanyalah sebuah link ke /run/shm, Sementara Oracle meminta /dev/shm mount point yang terpisah.
Membuatnya menjadi permanen
sudo vi /etc/rc2.d/S01shm_load
#!/bin/sh case "$1" in start) mkdir /var/lock/subsys 2>/dev/null touch /var/lock/subsys/listener rm /dev/shm 2>/dev/null mkdir /dev/shm 2>/dev/null mount -t tmpfs shmfs -o size=2048m /dev/shm ;; *) echo error exit 1 ;; esac
chmod 755 /etc/rc2.d/S01shm_load shutdown -r now
Install Oracle Express Edition
Setup environment
vi ./bashrc
export ORACLE_HOME="/u01/app/oracle/product/11.2.0/xe" export ORACLE_SID="XE" export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` export ORACLE_BASE="/u01/app/oracle" export LD_LIBRARY_PATH="$ORACLE_HOME/lib:$LD_LIBRARY_PATH" export PATH="$ORACLE_HOME/bin:$PATH:."
Konversikan oracle xe menjadi .deb
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip cd Disk1/ sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
Pastikan file .deb di generate. Selanjutnya kita bisa menginstalasi Oracle XE menggunakan perintah
sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
Cek createdb
cd /u01/app/oracle/product/11.2.0/xe/bin ./createdb.sh
Konfigurasi Awal Oracle Express Edition
Konfigurasi Oracle Express Edition menggunakan perintah,
/etc/init.d/oracle-xe configure
Sebagian besar nilai default yang di tawarkan pada saat konfigurasi sebetulnya tidak perlu di ubah, kita cukup menekan tombol <Enter> sampai selesai konfigurasi. Mohon di ingat baik—baik password SYS atau SYSTEM yang kita set, jangan sampai lupa. Pada saat proses konfigurasi maka pada layar akan tampak tampilan berikut,
root@ubuntu:/usr/local/src# /etc/init.d/oracle-xe configure
Oracle Database 10g Express Edition Configuration ------------------------------------------------- This will configure on-boot properties of Oracle Database 10g Express Edition. The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts. Press <Enter> to accept the defaults. Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:
Specify a password to be used for database accounts. Note that the same password will be used for SYS and SYSTEM. Oracle recommends the use of different passwords for each database account. This can be done after initial configuration: Confirm the password:
Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y
Starting Oracle Net Listener...Done Configuring Database...Done Starting Oracle Database 10g Express Edition Instance...Done Installation Completed Successfully. To access the Database Home Page go to "http://127.0.0.1:8080/apex"
root@ubuntu:/usr/local/src#
- Setelah selesai di konfigurasi, kita dapat me-restart Oracle menggunakan perintah,
# /etc/init.d/oracle-xe restart Shutting down Oracle Database 10g Express Edition Instance. Stopping Oracle Net Listener.
Starting Oracle Net Listener. Starting Oracle Database 10g Express Edition Instance.
Selanjutnya, konfigurasi Oracle Database dapat dilakukan dengan mengakses alamat / URL http://127.0.0.1:8080/apex
Error
Jika ada error
Database Configuration failed. Look into /u01/app/oracle/product/11.2.0/xe/config/log for details
Cek
cat /proc/meminfo | grep MemTotal MemTotal: 2048524 kB
grep -n ".*" /proc/sys/kernel/shmm* /proc/sys/kernel/shmmax:1:536870912 /proc/sys/kernel/shmmni:1:4096
Referensi
- http://sysadminnotebook.blogspot.co.id/2012/10/installing-oracle-11g-r2-express.html
- https://community.oracle.com/message/9720583#9720583
- http://www.techienote.com/2011/09/oracle-database-11g-r2-on-ubuntu-11-04.html