最小安裝的centos7.4下安裝oracle 12c

來源:互聯網
上載者:User

標籤:base   生效   acl   terminal   dex   data   mina   bin   技術分享   

下載 oracal 安裝包

進入https://www.oracle.com/index.html  依次選擇-->Menu -->Downloads and trials -->Database -->Oracle Database

勾選Accept License Agreement。

找到Oracle Database 12c Release 2,選擇下面的File 1  (3.2 GB)  See All下載(如果沒有帳號,就老老實實註冊下載)。

環境:

[email protected],分配資源:CPU:2顆,記憶體:4GB,硬碟空間:30GB

Oracle12C企業版64位

過程紀要:

  1. root身份安裝依賴包:  
    yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*.i686 elfutils-libelf-devel gcc gcc-c++ glibc*.i686 glibc glibc-devel glibc-devel*.i686 ksh libgcc*.i686 libgcc libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.i686 libaio libaio*.i686 libaio-devel libaio-devel*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686 libXp

     

  2.  建立使用者和組:

  3. groupadd oinstall  groupadd dba  groupadd oper  useradd -g oinstall -G dba,oper oracle  echo "123456" | passwd --stdin oracle #oracle使用者的登入密碼,後續登入要用,記著。

     

  4. 建立安裝目錄:

  5. mkdir -p /orcl/app/oracle/product/12.1.0/db_1  chown -R oracle:oinstall /orcl/app  chmod -R 775 /orcl/app

     

  6. 修改核心參數vi /etc/sysctl.conf,添加:

  7. fs.aio-max-nr = 1048576  fs.file-max = 6815744  kernel.shmall = 2097152  kernel.shmmax = 1200000000    kernel.shmmni = 4096  kernel.sem = 250 32000 100 128  net.ipv4.ip_local_port_range = 9000 65500  net.core.rmem_default = 262144  net.core.rmem_max = 4194304  net.core.wmem_default = 262144  net.core.wmem_max = 1048576  

     

  8. 一種說法:上面的kernel.shmmax = 1200000000可能會有問題,可以改成4098955264。我在安裝時有警告,但選擇忽略後,安裝能正常進行。
  9. 改好後,使之生效:sysctl -p

  10. 改檔案限制:vi /etc/security/limits.conf,添加:
  11. oracle soft nproc 2047  oracle hard nproc 16384  oracle soft nofile 1024  oracle hard nofile 65536  oracle soft stack 10240  

    以及vi /etc/pam.d/login,添加:

    session required pam_limits.so

    修改ulimit:vi /etc/profile,添加:

    if [ $USER = "oracle" ]; then  if [ $SHELL = "/bin/ksh" ]; then  ulimit -p 16384  ulimit -n 65536a  else  ulimit -u 16384 -n 65536  fi  fi  

    修改環境變數。vi ~oracle/.bash_profile,添加:

ORACLE_BASE=/orcl/app/oracle  ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1  ORACLE_SID=orcl  export ORACLE_BASE ORACLE_HOME ORACLE_SID  
#如果已經存在PATH,則只需將 在PATH後面跟上:$ORACLE_HOME 即可。PATH=$ORACLE_HOME/bin:$PATH export PATH

下載並安裝jdk rpm -ivh jdk-8u101-linux-x64.rpm。java -version 。

重啟 reboot。

因為我裝的是最小安裝,沒有圖形介面,所以這裡要裝x window 圖形介面。

    # yum check-update    # yum groupinstall "X Window System"
#yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts

重啟 reboot。

登陸系統後執行init 5 到圖形介面,開啟終端,執行以下命令

# su - oracle  $ cd /orcl/app/oracle  $ unzip linuxamd64_12102_database_se2_1of2.zip  $ unzip linuxamd64_12102_database_se2_2of2.zip  $ export LANG="en_US"  $ cd /orcl/app/oracle/database  $ ./runInstaller 

出現圖形介面,根據自己的需求往下安裝。

啟動oracle

#su - oracle #切換到 oracle 使用者且切換到它的環境$lsnrctl status #查看監聽及資料庫狀態$lsnrctl start #啟動監聽$startup #啟動服務

登陸並建立命名空間,使用者,表。

sqlplus / as sysdba #以 DBA 身份進入 sqlplus建立資料表空間create tablespace my_space datafile ‘/usr/local/yrm/oracle_data/my_space.dbf‘ size 50M autoextend on next 50m maxsize 2048m extent management local;建立暫存資料表空間create temporary tablespace my_space_temptempfile ‘/usr/local/yrm/oracle_data/my_space_temp.dbf‘size 32mautoextend on next 32m maxsize 1024mextent management local;建立使用者create user c##my_user_1 identified by 123456 default tablespace my_spacetemporary tablespace my_space_temp;授權grant connect,resource to c##my_user_1;grant dba to c##my_user_1;切換使用者conn my_user_1/123456 as sysdba;建立表create table test_1(name char(20),id int);插入資料insert into test_1 values(‘張三‘,1);insert into test_1 values(‘李四‘,2);

 

最小安裝的centos7.4下安裝oracle 12c

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.