linux6.5安裝oracle資料庫12c

來源:互聯網
上載者:User

標籤:sha   serve   指令碼   mem   查看   star   code   iba   cal   

一、下載安裝檔案

官方:http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html

[[email protected] data]# ls
linuxamd64_12c_database_1of2.zip linuxamd64_12c_database_2of2.zip

二、安裝oracle database1、安裝依賴環境

yum install -y binutils compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXext libXtst libX11 libXau libXi make sysstat
yum install -y compat-libstdc++-33.x86_64 libaio-devel.x86_64
yum install -y xorg-x11-utils xorg-x11-server-utils unzip

2、系統設定和添加使用者

關閉selinux
setenforce 0
關閉防火牆
service iptables stop
chkconfig iptables off

修改核心參數

先備份
cp /etc/sysctl.conf{,.bak}
再修改
vim /etc/sysctl.conf

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

使其生效
sysctl -p

修改使用者限制

vim /etc/security/limits.conf

oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240oracle hard stack 10240

vim /etc/profile

if [ $USER = "oracle" ]; thenulimit -u 16384ulimit -n 65536fi
添加使用者並給相應檔案授權

su - oracle
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
echo ‘ycig1234‘ | passwd oracle --stdin
chown -R oracle.oinstall /data/

[[email protected] data]# ll /data/
total 2419500
-rw-r--r-- 1 oracle oinstall 1361028723 Jan 28 08:06 linuxamd64_12c_database_1of2.zip
-rw-r--r-- 1 oracle oinstall 1116527103 Jan 28 08:05 linuxamd64_12c_database_2of2.zip

修改環境變數

su - oracle
vi ~/.bash_profile

export ORACLE_BASE=/data/oracle/appexport ORACLE_HOME=$ORACLE_BASE/oracle/product/12.1.0/dbhome_1export ORACLE_SID=orclexport PATH=$PATH:$HOME/bin:$ORACLE_HOME/binexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/libexport ORACLE_CLIENT=$ORACLE_HOME

解壓檔案
cd /data
unzip linuxamd64_12c_database_1of2.zip
unzip linuxamd64_12c_database_2of2.zip

開始安裝

點開自己電腦上的xmanager Enterprise中的Xmanager - Passive
設定DISPLAY用於遠程視窗(192.168.3.90是我原生IP,請根據具體情況設定)
export DISPLAY=192.168.3.90:0.0
執行xhost+命令顯示如下資訊說明
[[email protected] database]$ xhost +
access control disabled, clients can connect from any host

安裝

./runInstaller
這裡會檢查環境是否滿足,請執行修改以滿足安裝環境
不設定郵箱,不更新


只建立資料庫(第一個是建立資料庫並設定,第二個是只建立資料庫,第三個是更新資料庫)

安裝單一實例資料庫(第一個單一實例資料庫,第二個oracle資料庫叢集,第三個RAC節點安裝)

選擇語言

選擇安裝版本(第一個企業版,第二個標準版,第三個標準版1)

選擇安裝路徑(和環境變數中設定一致即可,預設/u01下)

產品清單

設定group

清單

安裝過程

按照提示用root使用者運行這兩個指令碼

運行指令碼

安裝完成點解close

使用dbca建立資料庫

source ~/.bash_profile
dbca
建立一個資料庫

設定資料庫

clobal database name 全域資料庫名(ORACLE_SID)
storage type 儲存類型
database files location 資料庫檔案存放位置
fast recovery area 快速恢複區
datavase character set 資料庫字元集(一般為UTF-8或GBK)
admin** password 管理口令
確認口令

清單,點擊finish開始安裝

安裝完成

啟動資料庫

建立完成後會自動啟動
啟動、關閉oracle
sqlplus / as sysdba
啟動
startup
關閉
shutdown

使用netca建立監聽(產生listener.ora)

netca

listener configuration 設定監聽
naming methods configuration 設定命名規則
local net service name configuration 設定本網服務
directory usage configuration 設定使用目錄
選擇設定監聽
添加一個監聽

監聽名稱,最好和ORACLE_SID一樣,方便查看

協議(預設tcp)

監聽連接埠(預設1521)

不設定下一個,結束配置


啟動監聽
lsnrctl start
查看監聽狀態
lsnrctl start

關閉監聽
lsnrctl stop

建立資料庫使用者和資料表空間

sqlplus / as sysdba
建立資料表空間

create tablespace SDE datafile  ‘/data/oracle/app/oradata/ORCL/datafile/SDE1.dbf‘ size 1g autoextend on;alter tablespace SDE  add datafile ‘/data/oracle/app/oradata/ORCL/datafile/SDE2.dbf‘ size 1g autoextend on;

建立使用者

create user sde identified by sde default tablespace SDE;

授權dba許可權(如果需要許可權管理請自行設定)

grant dba to sde;

建立備份目錄

$ mkdir -pv /data/oracle/app/dump/create directory dpdata as ‘ /data/oracle/app/dump/‘; Grant read,write on directory dpdata to sde;
netca建立本網(產生tnsnames.ora)

netca
這裡選第三個

添加

服務名,可以隨便去,用ORACLE_SID方便使用

協議

串連主機和連接埠

串連測試

點擊修改串連資訊

輸入使用者密碼

測試成功

NEXT直到finish

串連資料庫

前提:資料庫已啟動,監聽已啟動
sqlplus sde/[email protected]

oracle多執行個體

建立第二個執行個體
export ORACLE_SID=torcl

dbca建立資料庫

dbca

netca建立監聽







建立使用者和資料表空間
create tablespace TSDE_TBS datafile  ‘/data/oracle/app/oradata/TORCL/datafile/TSED1.dbf‘ size 1g autoextend on;create user tsde identified by tsde default tablespace TSDE_TBS;grant dba to tsde;create directory dpdata as ‘ /data/oracle/app/dump/‘; Grant read,write on directory dpdata to tsde;
netca設定本網







使用pl/sql devlope串連測試


多執行個體報錯

ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file ****

處理:重啟oracle所在伺服器,然後重新啟動oracle就好了,貌似是因為目錄設定一樣,在第一個庫已啟動情況下建立第二個庫出現檔案鎖死。(如果理解沒有錯誤的話應該關閉所有的oracle資料庫然後重啟就可以了)

linux6.5安裝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.