您好,登錄后才能下訂單哦!
官方文檔:http://docs.oracle.com/cd/E11882_01/install.112/e24326/toc.htm#BHCCADGD
需要的安裝包:
binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.i686
compat-libstdc++-33-3.2.3-71.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
unixODBC-2.3.1-6.el7.x86_64 or later
unixODBC-2.3.1-6.el7.i686 or later
unixODBC-devel-2.3.1-6.el7.x86_64 or later
unixODBC-devel-2.3.1-6.el7.i686 or later
yum 進行安裝:
yum -y install binutils compat-libcap1 compat-libstdc++-33 compat-libstdc++-33*i686 compat-libstdc++-33*.devel compat-libstdc++-33 compat-libstdc++-33*.devel gcc gcc-c++ glibc glibc*.i686 glibc-devel glibc-devel*.i686 ksh libaio libaio*.i686 libaio-devel libaio-devel*.devel libgcc libgcc*.i686 libstdc++ libstdc++*.i686 libstdc++-devel libstdc++-devel*.devel libXi libXi*.i686 libXtst libXtst*.i686 make sysstat unixODBC unixODBC*.i686 unixODBC-devel unixODBC-devel*.i686
創建oinstall和dba組
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
創建oracle用戶
/usr/sbin/useradd -g oinstall -G dba oracle
設置oracle用戶密碼
passwd oracle
驗證創建是否正確
[root@node1001 ~]# id oracle
uid=1000(oracle) gid=1000(oinstall) 組=1000(oinstall),1001(dba)
配置內核參數
[root@docker ~]# vim /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
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
參數的值不能小于上面的配置,這是oracle官方建議的最小值,生產環境建議調整這些參數,以優化系統性能。
修改后使之生效
/sbin/sysctl -p
修改用戶限制
vim /etc/security/limits.conf
#在末尾添加
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
創建安裝目錄
mkdir -p /u01/app/
chown -R oracle:oinstall /u01/app/
chmod -R 775 /u01/app/
配置環境變量
su - oracle
vim .bash_profile
#在文件尾追加:
#oracle數據庫安裝目錄
export ORACLE_BASE=/u01/app
#oracle數據庫路徑
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/dbhome_1
#oracle啟動數據庫實例名
export ORACLE_SID=orcl
#添加系統環境變量
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH
#添加系統環境變量
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
使bash_profile生效:
source .bash_profile
解壓oracle 數據庫安裝包
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
修改靜默安裝配置文件 /home/oracle 為oracle安裝文件目錄
vim /home/oracle/database/response/db_install.rsp
配置內容為:
oracle.install.option=INSTALL_DB_SWONLY // 安裝類型
ORACLE_HOSTNAME=node1001// 主機名稱(hostname查詢)
UNIX_GROUP_NAME=oinstall // 安裝組
INVENTORY_LOCATION=/u01/app/oraInventory //INVENTORY目錄(不填就是默認值)
SELECTED_LANGUAGES=en,zh_CN,zh_TW // 選擇語言
ORACLE_HOME=/u01/app/product/11.2.0.4/dbhome_1 //oracle_home
ORACLE_BASE=/u01/app //oracle_base
oracle.install.db.InstallEdition=EE // oracle版本
oracle.install.db.isCustomInstall=false //自定義安裝,否,使用默認組件
oracle.install.db.DBA_GROUP=dba / / dba用戶組
oracle.install.db.OPER_GROUP=oinstall // oper用戶組
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE //數據庫類型
oracle.install.db.config.starterdb.globalDBName=orcl //globalDBName
oracle.install.db.config.starterdb.SID=orcl //SID
oracle.install.db.config.starterdb.memoryLimit=81920 //自動管理內存的內存(M)
oracle.install.db.config.starterdb.password.ALL=oracle //設定所有數據庫用戶使用同一個密碼
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false //(手動寫了false)
DECLINE_SECURITY_UPDATES=true //設置安全更新(貌似是有bug,這個一定要選true,否則會無限提醒郵件地址有問題,終止安裝。PS:不管地址對不對)
開始靜默安裝
[oracle@node1001 database]$ ./runInstaller -silent -responseFile /home/oracle/database/response/db_install.rsp
查看安裝目錄
tail -f /u01/app/oraInventory/logs/installActions2016-08-31_06-56-29PM.log
出現類似如下提示表示安裝完成:
------------------------------------------------------------------------
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run
/u01/app/oraInventory/orainstRoot.sh
/u01/app/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
4. Return to this window and hit "Enter" key to continue
Successfully Setup Software.
切換到root用戶執行sh腳本
su - root
/u01/app/oraInventory/orainstRoot.sh
/u01/app/product/11.2.0.4/dbhome_1/root.sh
切換到oracle用戶,配置監聽程序
su - oracle
netca /silent /responsefile /home/oracle/database/response/netca.rsp
手動編輯監聽文件
vim $ORACLE_HOME/network/admin/listener.ora
監聽文件內容
# listener.ora Network Configuration File:
/u01/app/product/11.2.0.4/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
#LISTENER =
# (DESCRIPTION_LIST =
# (DESCRIPTION =
# (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
# (ADDRESS = (PROTOCOL = TCP)(HOST = node1003)(PORT = 1521))
# )
# )
#ADR_BASE_LISTENER = /u01/app
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /u01/app/product/11.2.0.4/dbhome_1)
(SID_NAME = orcl)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.64.4)(PORT = 1521))
)
啟動監聽程序
lsnrctl start
編輯數據庫控制文件,根據實際情況編輯
vim $ORACLE_HOME/dbs/initorcl.ora
*.audit_file_dest='/u01/app/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0.4'
*.control_files='/u01/app/oradata/orcl/ora_control1'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest_size=2G
*.db_recovery_file_dest='/u01/app/fast_recovery_area'
*.diagnostic_dest='/u01/app'
*.memory_target=8G
*.open_cursors=150
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
啟動數據庫,準備創建數據庫
sqlplus / as sysdba
startup mount;
=======手動創建數據庫語句如下:=============================================
根據實際情況執行調整
create database orcl
maxlogfiles 5
maxlogmembers 5
maxdatafiles 100
maxinstances 1
logfile
group 1 ('/u01/app/oradata/orcl/redo1.log') size 200m,
group 2 ('/u01/app/oradata/orcl/redo2.log') size 200m,
group 3 ('/u01/app/oradata/orcl/redo3.log') size 200m
datafile
'/u01/app/oradata/orcl/system.dbf' size 200m reuse
sysaux datafile '/u01/app/oradata/orcl/sysaux.dbf' size 300m
default tablespace users
datafile '/u01/app/oradata/orcl/userdata.dbf' size 300m
undo tablespace undotbs1
datafile '/u01/app/oradata/orcl/undo1.dbf' size 300m
default temporary tablespace temp1
tempfile '/u01/app/oradata/orcl/temp01.dbf'
size 100m reuse
character set al32utf8
手動創建完數據庫后,sqlplus 下先后執行相關腳本文件
@$ORACLE_HOME/rdbms/admin/catalog.sql
@$ORACLE_HOME/rdbms/admin/catproc.sql
執行完成之后,數據庫創建完成,查看數據庫狀態
select status from v$instance;
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。