在開始安裝前先要檢查下相應的依賴包,這裏要注意的是若是是在X64的系統上安裝記得須要安裝i686即X64系統上的X86的包,這點很重要,若是漏了Oracle是沒法正常的安裝的,這裏pdksh沒有安裝沒有關係,在這裏已經安裝了ksh就能夠了html
[root@localhost ~]# yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh ksh libaio.i686 glibc.i686 compat-libstdc++-33.i686 libaio-devel.i686 libgcc.i686 libstdc++.i686 unixODBC.i686 unixODBC-devel.i686
-------------------------------------------------------------------------------java
[humf@localhost ~]$ su root #切換到root Password: [root@localhost sonny]# groupadd oinstall #建立用戶組oinstall [root@localhost sonny]# groupadd dba #建立用戶組dba [root@localhost sonny]# useradd -g oinstall -g dba -m oracle #建立oracle用戶,並加入到oinstall和dba用戶組 [root@localhost sonny]# passwd oracle #設置用戶oracle的登錄密碼,不設置密碼,在CentOS的圖形登錄界面無法登錄 Changing password for user oracle. New password: # 密碼 BAD PASSWORD: The password is shorter than 8 characters Retype new password: # 確認密碼 passwd: all authentication tokens updated successfully. [root@localhost sonny]# id oracle # 查看新建的oracle用戶 uid=1001(oracle) gid=1002(dba) groups=1002(dba) [root@localhost sonny]#
oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536
session required /lib/security/pam_limits.so session required pam_limits.so
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.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
linux:~ # sysctl -p net.ipv4.icmp_echo_ignore_broadcasts = 1 net.ipv4.conf.all.rp_filter = 1 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.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 4194304 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576
if [ $USER = "oracle" ]; then if [ $SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else ulimit -u 16384 -n 65536 fi fi
mkdir /home/oracle/app mkdir /home/oracle/app/oracle mkdir /home/oracle/app/oradata mkdir /home/oracle/app/oracle/product
chown -R oracle:oinstall /home/oracle/app
export ORACLE_BASE=/home/oracle/app export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1 export ORACLE_SID=orcl export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
[humf@localhost /]$ su root Password: [root@localhost /]# systemctl status firewalld.service #查看防火牆狀態,運行中 ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2016-04-07 18:54:29 PDT; 2h 20min ago Main PID: 802 (firewalld) CGroup: /system.slice/firewalld.service └─802 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid Apr 07 18:54:25 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon... Apr 07 18:54:29 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon. [root@localhost /]# systemctl stop firewalld.service #關閉防火牆 [root@localhost /]# systemctl status firewalld.service #再次查看防火牆狀態,發現已關閉 ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: inactive (dead) since Thu 2016-04-07 21:15:34 PDT; 9s ago Main PID: 802 (code=exited, status=0/SUCCESS) Apr 07 18:54:25 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon... Apr 07 18:54:29 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon. Apr 07 21:15:33 localhost systemd[1]: Stopping firewalld - dynamic firewall daemon... Apr 07 21:15:34 localhost systemd[1]: Stopped firewalld - dynamic firewall daemon. [root@localhost /]# systemctl disable firewalld.service #禁止使用防火牆(重啓也是禁止的) Removed symlink /etc/systemd/system/dbus-org.Fedoraproject.FirewallD1.service. Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service. [root@localhost /]#
[root@localhost /]# vi /etc/selinux/config [root@localhost /]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled #此處修改成disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@localhost /]#
# yum -y groups install "GNOME Desktop" # startx2.1.2 配置源
# yum install epel* -y2.1.3 安裝xrdp
# yum --enablerepo=epel -y install xrdp2.1.4 啓動xrdp並設置開機啓動
# systemctl start xrdp # systemctl enable xrdp
unzip linux.x64_11gR2_database_1of2.zip unzip linux.x64_11gR2_database_2of2.zip
cd database
裝到這一步,能夠看到,能夠查看到有不少的rpm包沒有,這裏能夠經過yum安裝
我這邊的是操做系統:Oracle Linux 7 centos
The following packages (or later versions) must be installed:
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
gcc-4.8.2-3.el7.x86_64
gcc-c++-4.8.2-3.el7.x86_64
glibc-2.17-36.el7.i686
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.i686
glibc-devel-2.17-36.el7.x86_64
ksh
libaio-0.3.109-9.el7.i686
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.i686
libaio-devel-0.3.109-9.el7.x86_64
libgcc-4.8.2-3.el7.i686
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.i686
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.i686
libstdc++-devel-4.8.2-3.el7.x86_64
libXi-1.7.2-1.el7.i686
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.i686
libXtst-1.2.2-1.el7.x86_64
make-3.82-19.el7.x86_64
sysstat-10.1.5-1.el7.x86_64
一個一個的安裝,命令也很簡單,反正文檔要求高版本也能夠:python
[humf@localhost data]$ su root Password: [root@localhost data]# yum install binutils
[Oracle@localhost ~]$ netca Oracle Net Services Configuration: # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0x00007f69a69fcb9d, pid=8033, tid=140092892297024 # # Java VM: Java HotSpot(TM) 64-Bit Server VM (1.5.0_17-b03 mixed mode) # Problematic frame: # C [libclntsh.so.11.1+0x62ab9d] snlinGetAddrInfo+0x1b1 # # An error report file with more information is saved as hs_err_pid8033.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # /data/oracle/product/11.2.0/db_1/bin/netca: line 178: 8033 Aborted (core dumped) $JRE $JRE_OPTIONS -classpath $CLASSPATH oracle.net.ca.NetCA $* [oracle@localhost ~]$
racle]# cat /etc/sysconfig/network # Created by anaconda [root@localhost oracle]# vi /etc/sysconfig/network #增長HOSTNAME [root@localhost oracle]# cat /etc/sysconfig/network # Created by anaconda HOSTNAME=odb-sonny [root@localhost oracle]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [root@localhost oracle]# vi /etc/hosts #增長HOSTNAME [root@localhost oracle]# cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 odb-sonny ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 [root@localhost oracle]# hostname odb-sonny #執行 [root@localhost oracle]#
通過漫長的等待,當看到此界面,說明oracle建庫完成
這樣oracle服務器安裝配置基本就完成了
注意:
一、Linux oracle數據庫listener.ora存放路徑linux
cd /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
cd /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
su - oracle(2)啓動監聽器
lsnrctl start(3)中止監聽器
lsnrctl stop四、啓動測試oracle:
[oracle@oracle ~]$ sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on Fri Jul 27 02:12:12 2012 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL> quit
sudo service iptables stop(2)編輯iptables, 開放1521端口:
sudo vi /etc/sysconfig/iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 1521 -j ACCEPT :wq重啓防火牆
sudo service iptables restart保存配置,以便linux重啓後依然有效
sudo service iptables save查看防火牆規則:
sudo iptables -L –n
select name from v$datafile(4)建立用戶表空間:
CREATE TABLESPACE NOTIFYDB DATAFILE '/home/oracle/app/oradata/orcl/scsdb.dbf' SIZE 200M AUTOEXTEND ON EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;(5)建立用戶,指定密碼和上邊建立的用戶表空間
CREATE USER scs IDENTIFIED BY scs DEFAULT TABLESPACE NOTIFYDB;(6)賦予權限
grant connect,resource to scs; grant unlimited tablespace to scs; grant create database link to scs; grant select any sequence,create materialized view to scs;--通過以上操做,咱們就可使用scs/scs登陸指定的實例,建立咱們本身的表了