oracle 12c release 2 安裝
0.需要新增如下檔案幾內容
備註: /etc/oraInst.loc的內容為
inventory_loc=/home/oracle/oraInventory
inst_group=oinstall
1. 下載 Oracle 12c 的壓縮包,只有一個 zip 檔案
2. 新增使用者組以及建立目錄:
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
mkdir /u01; mkdir /u02; mkdir /u03;
mkdir -p /u01/app/oracle/product/12.2.0.1/db_1
chown -R oracle:oinstall /u01
chown -R oracle:oinstall /u02
chown -R oracle:oinstall /u03
3. 修改 /etc/hosts 檔案
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.6.128 dbserver
4. 修改 /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
使引數生效
sysctl -p
5. 配置 /etc/security/limits.d/oracle-rdbms-server-12cR2-preinstall.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 134217728
oracle soft memlock 134217728
6. 修改 /etc/pam.d/login
session required pam_limits.so
7. 安裝 oracle 需要的缺少的 包
yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install make -y
yum install nfs-utils -y
yum install net-tools -y
yum install smartmontools -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y
yum install gcc -y
yum install gcc-c++ -y
yum install libXext -y
yum install libXext.i686 -y
yum install zlib-devel -y
yum install zlib-devel.i686 -y
yum install e2fsprogs -y
yum install e2fsprogs-libs -y
yum install libs -y
yum install libxcb.i686 -y
yum install libxcb -y
8. 修改 /etc/selinux/config
SELINUX=permissive
修改完後儲存執行如下
# setenforce Permissive
9. 關閉防火牆
# systemctl stop firewalld
# systemctl disable firewalld
10. 新增環境變數
#touch /etc/profile.d/setora.sh
該檔案新增如下內容:
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
#export oracle.install.db.config.starterdb.globalDBName=oracle.sunyard
export ORACLE_HOSTNAME=dbserver
export GLOBAL_NAME=odb
export ORACLE_UNQNAME=hgs
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0.1/db_1
export ORACLE_SID=hgs
export PATH=/usr/sbin:/usr/local/bin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
11. 將 linuxx64_12201_database.zip 上傳伺服器,並解壓,解壓後目錄為
以靜默方式安裝需要配置 responseFile
配置目錄下的 database/response/db_install.rsp ,關鍵修改一下配置,否則安裝時會報錯,按照自己著真實配置
INVENTORY_LOCATION=/home/oracle/oraInventory
ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/db_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.OSDBA_GROUP=oinstall
oracle.install.db.OSOPER_GROUP=oinstall
oracle.install.db.OSBACKUPDBA_GROUP=oinstall
oracle.install.db.OSDGDBA_GROUP=oinstall
oracle.install.db.OSKMDBA_GROUP=oinstall
oracle.install.db.OSRACDBA_GROUP=oinstall
oracle.install.db.config.starterdb.globalDBName=orcle12c
oracle.install.db.config.starterdb.SID=hgs
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryLimit=1024
oracle.install.db.config.starterdb.password.SYS=HGShgs912122_
oracle.install.db.config.starterdb.password.SYSTEM=HGShgs912122_
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u02
儲存檔案
12. 安裝
圖中標識的就是要執行的檔案
可以 ./runInstaller --help 檢視幫助
執行如下安裝
./runInstaller -silent -responseFile /u03/database/response/db_install.rsp -showProgress
會有進度提示
13. 建立資料庫
cd $ORACLE_HOME/dbs
cp init.ora inithgs.ora
chown oracle:oinstall inithgs.ora
將 inithgs.ora 修改如下 記憶體大小根據真實情況調整
*.audit_file_dest='/u01/app/oracle/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.2.0'
*.control_files='/u01/app/oracle/controls/ora_control1','/u01/app/oracle/controls/ora_control2'
*.db_block_size=8192
*.db_domain=''
*.db_name='hgs'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=2G
*.diagnostic_dest='<ORACLE_BASE>'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.memory_target=3G
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
#*.undo_tablespace='UNDOTBS1'
切換到 oracle 使用者
su - oracle
sqlplus / as sysdba
startup nomount
CREATE DATABASE hgs
USER SYS IDENTIFIED BY sys_password
USER SYSTEM IDENTIFIED BY system_password
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/hgs/redo01.log') SIZE 1000M,
GROUP 2 ('/u01/app/oracle/oradata/hgs/redo02.log') SIZE 1000M,
GROUP 3 ('/u01/app/oracle/oradata/hgs/redo03.log') SIZE 1000M
MAXLOGFILES 16
MAXLOGMEMBERS 2
MAXLOGHISTORY 1
MAXDATAFILES 100
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
EXTENT MANAGEMENT LOCAL
DATAFILE '/u01/app/oracle/oradata/hgs/system01.dbf' SIZE 1024M REUSE
SYSAUX DATAFILE '/u01/app/oracle/oradata/hgs/sysaux01.dbf' SIZE 1024M REUSE
DEFAULT TABLESPACE users
DATAFILE '/u01/app/oracle/oradata/hgs/users01.dbf'
SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
DEFAULT TEMPORARY TABLESPACE tempts1
TEMPFILE '/u01/app/oracle/oradata/hgs/temp01.dbf'
SIZE 500M REUSE
UNDO TABLESPACE undotbs
DATAFILE '/u01/app/oracle/oradata/hgs/undotbs01.dbf'
SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
建立完成後需要執行幾個 sql 指令碼
sys使用者
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
system 使用者
@?/sqlplus/admin/pupbld.sql
至此,安裝 oracle 以及建立資料庫完畢
最後的建立資料庫可參考 oracle 官網
最後本文有參考其他的部落格,沒有新增連結請見諒!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31506529/viewspace-2158460/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Fedora core 4安裝Oracle9i release 2Oracle
- Oracle 12C安裝Oracle
- oracle 12c Release 2 版本廢棄 Non-CDB ArchitectureOracle
- Oracle Database 12c Release 2 (12.2) RAC On Oracle Linux 7 Using VMwareOracleDatabaseLinux
- oracle 12c 靜默安裝Oracle
- Centos 7.4 安裝Oracle 12cCentOSOracle
- Ubuntu下安裝oracle 12cUbuntuOracle
- 在Centos 6.5上安裝Oracle Database 11g Release 2 (11.2.0.4.0) RACCentOSOracleDatabase
- 安裝 epel-release
- Oracle 12c資料庫安裝Oracle資料庫
- Oracle Linux 7上安裝Oracle 12cOracleLinux
- Oracle 11g Release 2 RAC叢集系統——安裝後置任務Oracle
- 在Oracle Linux 6.6上安裝Oracle 12cOracleLinux
- 在RedHat 7.0下Oracle 8I release 2 (version 8.1.6)的安裝例項(轉)RedhatOracle
- RedHat6.5 安裝Oracle 12c RACRedhatOracle
- Oracle 12c 安裝記錄(-)準備Oracle
- 在RedHat Advanced Server4.0 update1上安裝Oracle 10g Release 2RedhatServerOracle 10g
- Oracle Enterprise Linux下安裝Oracle 12cOracleLinux
- 12c安裝
- Oracle 12c OEM Cloud Control AGENT 安裝OracleCloud
- Oracle 12c OEM Cloud Control OMS安裝OracleCloud
- Oracle 12C 單例項安裝文件( 官方文件)Oracle單例
- 2 Oracle Data Guard 安裝Oracle
- CentOS release 6.5 yum安裝報錯CentOS
- 12c em安裝
- 準備安裝Oracle Enterprise Manager 10g Grid Control Release 2 (10.2.0.2.0)Oracle
- 【11gR2】Enterprise Linux Release 5 Update 4安裝64位Oracle 11gR2(文字版)LinuxOracle
- 【11gR2】Enterprise Linux Release 5 Update 4安裝64位Oracle 11gR2(圖文版)LinuxOracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(一)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(二)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(三)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(四)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(五)Oracle
- Oracle 12c GI/RAC Step-by-Step安裝指南(六)Oracle
- Fedora Core 4 Release 安裝手記(轉)
- oracle 12c r2 rac 安裝時CLSRSC-400錯誤解決辦法Oracle
- oracle 11g release 2 12g 不支援裸裝置的宣告Oracle
- Linux系統oracle 12c VMware Tools 的安裝教程LinuxOracle