Mudah Instalasi Oracle-XE 11g di CentOS

7 September 2016

Berikut catatan kecil saya saat melakukan instalasi Oracle 11g-XE di Linux CentOS 7.

Paket yang harus diinstall terlebih dahulu sebelum proses instalasi:

  1. tuned-profiles-oracle
  2. kmod-oracleasm
  3. bc
  4. gcc
  5. glibc
  6. make
  7. binutils
  8. libaio
  9. libaio-devel
  10. libstdc++
  11. libstdc++-devel
  12. libgcc
  13. compat-libstdc++
  14. ksh
  15. libXext
  16. libXtst
  17. libX11
  18. libXau
  19. libxcb
  20. libXi
  21. sysstat
  22. unixODBC
  23. unixODBC-devel
  24. zlib-devel
  25. elfutils-libelf-devel

Lakukan setting /etc/hostname sebagai berikut:

[root@centos]# cat /etc/hostname
 centos.joe

Lakukan setting /etc/hosts sebagai berikut:

[root@centos]# cat /etc/hosts
127.0.0.1       localhost localhost.localdomain localhost4 localhost4.localdomain4
::1             localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.101  centos.joe centos
192.168.84.20   centos.joe centos

Mulai proses instalasi:

A. Created a new user ‘oracle’ under the group dba:

[root@centos ~]# usermod -a -G dba oracle
[root@centos ~]# grep dba /etc/group
dba:x:1000:oracle,root

B. Download paket installer “oracle-xe-11.2.0-1.0.x86_64.rpm.zip”, simpan di direktori “/tmp”.

C. Extract file tersebut

[root@centos tmp]# unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip

Akan terbentuk direktori “Disk1” sebagai hasil extract file installer.

D. Masuk ke direktori hasil extract tersebut di atas, dan jalankan instalasi dengan rpm

[root@centos tmp]# cd Disk1
[root@centos Disk1]# rpm -iv oracle-xe-11.2.0-1.0.x86_64.rpm
Preparing packages...
 /var/tmp/rpm-tmp.OA9b17: line 257: [: 18446744073692774399: integer expression expected
 /var/tmp/rpm-tmp.OA9b17: line 271: [: 18446744073692774399: integer expression expected
 oracle-xe-11.2.0-1.0.x86_64
 Executing post-install steps...
You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

[root@centos Disk1]# /etc/init.d/oracle-xe configure
Oracle Database 11g Express Edition Configuration
 ------------------------------------------------------------
 This will configure on-boot properties of Oracle Database 11g 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]: 8080
Specify a port that will be used for the database listener [1521]: 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: _  (isikan password Anda)
 Confirm the password: _  (isikan password Anda, untuk konfirmasi)
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]: y
Starting Oracle Net Listener...Done
 Configuring database...Done
 Starting Oracle Database 11g Express Edition instance...Done
 Installation completed successfully.

E. Pengaturan service

  • Aktifkan service
[root@centos ~]# systemctl start oracle-xe.service
[root@centos ~]# /sbin/chkconfig oracle-xe on
  • Start dan Stop service
[root@centos ~]# service oracle-xe start
[root@centos ~]# service oracle-xe stop
  • Enable service
[root@centos ~]# service oracle-xe start
[root@centos ~]# service oracle-xe enable

F. Konfigurasi environment

Konfigurasi dapat diletakan di file .bash_profile atau .bashrc (dalam direktori home user).
Konfigurasi dapat pula diletakkan dalam sebuah file pada direktori “/etc/profile.d/” misal dengan nama “envora.sh”, agar berlaku untuk semua user.

[root@centos ~]# cd /etc/profile.d/
[root@centos profile.d]# touch envora.sh
[root@centos profile.d]# vim envora.sh
[root@centos profile.d]# cd
[root@centos ~]# cat /etc/profile.d/envora.sh
# Konfigurasi untuk Oracle
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/xe
export ORACLE_SID=XE
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export LISTENER=$ORACLE_HOME/bin/lsnrctl
export PATH=$PATH:$ORACLE_HOME/bin
[root@centos ~]# reboot
[root@centos ~]# chown -R oracle:dba /var/tmp/.oracle
[root@centos ~]# chmod -R 755 /var/tmp/.oracle
[root@centos ~]# chown -R oracle:dba /tmp/.oracle
[root@centos ~]# chmod -R 755 /tmp/.oracle

Pastikan path oracle telah tersetup dengan benar:

[root@centos ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/u01/app/oracle/product/11.2.0/xe/bin:/root/bin

G. Masuk ke oracle

[root@centos ~]# sqlplus
SQL*Plus: Release 11.2.0.2.0 Production on Wed Sep 7 11:19:40 2016
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter user-name: SYSTEM
Enter password: _  (password yang telah dibuat saat instalasi)
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> _
SQL> exit (keluar dari PL/SQL)

H. Setting password for user (“oracle” )

[root@centos ~]# passwd oracle
 Changing password for user oracle.
 New password: _
 Retype new password: _
 passwd: all authentication tokens updated successfully.

I. Setting network

[root@centos ~]# cd /u01/app/oracle/product/11.2.0/xe/network/admin
[root@centos admin]# cat listener.ora 
 # listener.ora Network Configuration File:
 SID_LIST_LISTENER =
 (SID_LIST =
   (SID_DESC =
     (SID_NAME = PLSExtProc)
     (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
     (PROGRAM = extproc)
   )
  )
 LISTENER =
 (DESCRIPTION_LIST =
   (DESCRIPTION =
     (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
     (ADDRESS = (PROTOCOL = TCP)(HOST = centos.joe)(PORT = 1521))
   )
 )
 DEFAULT_SERVICE_LISTENER = (XE)
[root@centos admin]# cat tnsnames.ora 
 # tnsnames.ora Network Configuration File:
 XE =
 (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = centos.joe)(PORT = 1521))
   (CONNECT_DATA =
     (SERVER = DEDICATED)
     (SERVICE_NAME = XE)
   )
 )
 EXTPROC_CONNECTION_DATA =
 (DESCRIPTION =
   (ADDRESS_LIST =
   (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
   )
 (CONNECT_DATA =
   (SID = PLSExtProc)
     (PRESENTATION = RO)
   )
 )

J. Cek apakah listener berjalan normal

[root@centos ~]# lsnrctl status
 LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 13-SEP-2016 11:25:54
 Copyright (c) 1991, 2011, Oracle. All rights reserved.
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
 STATUS of the LISTENER
 ------------------------
 Alias LISTENER
 Version TNSLSNR for Linux: Version 11.2.0.2.0 - Production
 Start Date 13-SEP-2016 11:18:42
 Uptime 0 days 0 hr. 7 min. 12 sec
 Trace Level off
 Security ON: Local OS Authentication
 SNMP OFF
 Default Service XE
 Listener Parameter File /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
 Listener Log File /u01/app/oracle/diag/tnslsnr/centos/listener/alert/log.xml
 Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centos.joe)(PORT=1521)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centos.joe)(PORT=8080))(Presentation=HTTP)(Session=RAW))
 Services Summary...
 Service "PLSExtProc" has 1 instance(s).
 Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
 Service "XE" has 1 instance(s).
 Instance "XE", status READY, has 1 handler(s) for this service...
 Service "XEXDB" has 1 instance(s).
 Instance "XE", status READY, has 1 handler(s) for this service...
 The command completed successfully

K. Logging In to Application Express Administration Services

1. In a Web browser, go to the Oracle Application Express Administration Services application.
   http://hostname:port/apex/apex_admin
2. On the Login page:
   a. Username - Enter admin
   b. Password - Enter the SYS or SYSTEM database account password you created during the installation process.
   c. Click Login.
3. If prompted, change your password and click Apply Changes.
4. Enter you new login credentials and click Login.

L. Sukses! Alhamdulillah!

Semoga bermanfaat!

 

Tidak ada Komentar

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

This site uses Akismet to reduce spam. Learn how your comment data is processed.