CentOS安裝oracle12C

來源:互聯網
上載者:User

標籤:

安裝虛擬系統CentOS6.5,分配給至少1G的記憶體,其他條件適當高些,具體參考官方文檔

一、安裝資料庫:

1、安裝依賴軟體包

yum install binutils -yyum install compat-libcap -yyum install compat-libstdc++-33 -yyum install compat-libstdc++-33.i686 -yyum install gcc -yyum install gcc-c++ -yyum install glibc -yyum install glibc.i686 -yyum install glibc-devel -yyum install glibc-devel.i686 -yyum install ksh -yyum install libgcc -yyum install libgcc.i686 -yyum install libstdc++ -yyum install libstdc++.i686 -yyum install libstdc++-devel -yyum install libstdc++-devel.i686 -yyum install libaio -yyum install libaio.i686 -yyum install libaio-devel -yyum install libaio-devel.i686 -yyum install libXext -yyum install libXext.i686 -yyum install libXtst -yyum install libXtst.i686 -yyum install libX11 -yyum install libX11.i686 -yyum install libXau -yyum install libXau.i686 -yyum install libxcb -yyum install libxcb.i686 -yyum install libXi -yyum install libXi.i686 -yyum install make -yyum install sysstat -yyum install unixODBC -yyum install unixODBC-devel -yyum install zlib-devel -y
View Code2、建立使用者和組[[email protected] ~]# clear
[[email protected] ~]# groupadd dba
[[email protected] ~]# groupadd oinstall
[[email protected] ~]# useradd -g oinstall -G dba oracle
[[email protected] ~]# passwd oracle
3、建立oracle軟體安裝目錄:
[[email protected] ~]# mkdir -p /u01/app/oracle
[[email protected] ~]# chown -R oracle:oinstall /u01
[[email protected] ~]# chmod -R 775 /u01/4、編輯/etc/sysctl.conf檔案用root使用者修改此檔案,在末尾添加:
kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 4194304net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586fs.aio-max-nr = 1048576fs.file-max = 6815744
View Code
使用下面的命令讓核心參數更改生效,這樣就無需重啟電腦:
[[email protected] ~]# sysctl -p
5、[[email protected] ~]# vim /etc/security/limits.conf 
root使用者修改,在末尾添加:
oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536
View Code
6、[[email protected] ~]# vim /etc/pam.d/login 
在檔案末尾添加:
session    required     /lib/security/pam_limits.sosession    required     pam_limits.so
View Code
7、用root修改[[email protected] ~]# vim /etc/profile
if [ $USER = "oracle" ];thenif [ $SHELL = "/bin/ksh" ];thenulimit -p 16384ulimit -n 65536elseulimit -u 16384 -n 65536fifi
View Code
8、編輯/etc/hosts
[[email protected] ~]# hostname
vn
[[email protected] ~]# ifconfig eth0|grep "inet addr"
          inet addr:192.168.121.178  Bcast:192.168.121.255  Mask:255.255.255.0
[[email protected] ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.121.178  vn #添加此行
9、用oracle使用者身份編輯/home/oracle/.bash_profile 
[[email protected] ~]# su - oracle
[[email protected] ~]$ vim /home/oracle/.bash_profile 
在末尾添加以下內容:
export TMP=/tmp;export TMPDIR=$TMP;export ORACLE_TERM=xtermexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1export ORACLE_SID=orclexport PATH=$ORACLE_HOME/bin:$PATH
View Code
使用下面的命令讓設定生效:
[[email protected] ~]$ source /home/oracle/.bash_profil
10、上傳檔案到/home/oracle,並用oracle使用者解壓縮
檔案許可權中oracle為所有者:
[[email protected] oracle]# ls /home/oracle/ -l-rwxrw-rw-. 1 root   root     1361028723 6月   2 08:10 linuxamd64_12c_database_1of2.zip-rwxrw-rw-. 1 root   root     1116527103 6月   2 08:09 linuxamd64_12c_database_2of2.zip[[email protected] oracle]# chown oracle /home/oracle linuxamd64_12c_database_1of2.zip [[email protected] oracle]# chown oracle /home/oracle linuxamd64_12c_database_2of2.zip [[email protected] oracle]# ls /home/oracle/ -l-rwxrw-rw-. 1 oracle root     1361028723 6月   2 08:10 linuxamd64_12c_database_1of2.zip-rwxrw-rw-. 1 oracle root     1116527103 6月   2 08:09 linuxamd64_12c_database_2of2.zip
View Code
切換成oracle使用者解壓:
[[email protected] oracle]# su - oracle
[[email protected] ~]$ unzip linuxamd64_12c_database_1of2.zip 
[[email protected] ~]$ unzip linuxamd64_12c_database_2of2.zip
11、以oracle使用者登入圖形介面進行安裝11、以oracle使用者登入圖形介面進行安裝[[email protected] ~]$ cd database/
[[email protected] database]$ ./runInstaller 
正在啟動 Oracle Universal Installer...

檢查臨時空間: 必須大於 500 MB。   實際為 39610 MB    通過
檢查交換空間: 必須大於 150 MB。   實際為 3999 MB    通過
檢查監視器: 監視器配置至少必須顯示 256 種顏色。    實際為 16777216    通過
準備從以下地址啟動 Oracle Universal Installer /tmp/OraInstall2015-06-08_08-52-17PM. 請稍候... 不使用電子郵件:不使用更新: 忽略,單擊“是”選擇建立和設定資料庫:選擇伺服器類型:選擇單一實例資料庫安裝:選擇進階安裝,這樣有更多的可選項:選擇預設語言,這裡選擇英語和中文:選擇企業版:指定安裝位置,這裡軟體會自動讀取,.profile裡的設定,直接單擊下一步:選擇一般用途/事物處理: 資料庫標識符,選擇預設:選擇啟用自動記憶體管理,UTF-8字元集,建立具有樣本方案的資料庫:   選擇檔案系統:不註冊:不啟用恢複(根據自己需要選擇哈):口令(可以單獨設定,也可以統一設定):對許可權的管理,根據需要設定,這裡為方面統一設定為dba:儲存回應檔:大概77%時,會出現彈框 執行兩個指令碼如下:
[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh 更改許可權/u01/app/oraInventory.添加組的讀取和寫入許可權。刪除全域的讀取, 寫入和執行許可權。更改組名/u01/app/oraInventory 到 oinstall.指令碼的執行已完成。[[email protected] ~]# /u01/app/oracle/product/12.1.0/db_1/root.sh Performing root user operation for Oracle 12c The following environment variables are set as:    ORACLE_OWNER= oracle    ORACLE_HOME=  /u01/app/oracle/product/12.1.0/db_1Enter the full pathname of the local bin directory: [/usr/local/bin]:    這裡直接斷行符號即可   Copying dbhome to /usr/local/bin ...   Copying oraenv to /usr/local/bin ...   Copying coraenv to /usr/local/bin ...Creating /etc/oratab file...Entries will be added to the /etc/oratab file as needed byDatabase Configuration Assistant when a database is createdFinished running generic part of root script.Now product-specific root actions will be performed.
View Code大概91%時出現設定資料庫:進行口令管理:   安裝完成: 二、管理監聽器和資料庫啟動關閉管理監聽器1、查看監聽器狀態[[email protected] ~]$ lsnrctl status2、啟動監聽器[[email protected] ~]$ lsnrctl start[[email protected] ~]$ tnsping orcl3、關閉監聽器[[email protected] ~]$ lsnrctl start啟動和關閉oracle1、啟動資料庫
[[email protected] ~]$ sqlplus "sys /as sysdba"SQL> startup SQL> SELECT status from v$instance;
2、關閉資料庫
SQL> shutdown immediate;Database closed.Database dismounted.ORACLE instance shut down.
三、oracle用戶端工具(1)、SQL*plus(2)、ORACLE EM Express(在網頁上輸入網址:https://IP地址:5500/em,然後在出現的警告中添加信任,(如果用實體機的瀏覽器,需要在虛擬系統中開啟防火牆的5500、1521連接埠):(3)、Oracle SQL Developer  












 

CentOS安裝oracle12C

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.