oracle單例項12.2.0.1安裝

張衝andy發表於2017-05-05

說明:本文描述oracle linux 6.8 安裝 oracle 12.2.0.1

0. 檢視作業系統版本

[root@12c01 ~]# cat /etc/os-release 
NAME="Oracle Linux Server" 
VERSION="6.8"

1. 修改使用者的SHELL的限制,vi /etc/security/limits.conf 檔案,檔案末尾新增修改如下
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240

2. 修改linux核心,修改 /etc/sysctl.conf 檔案
vi /etc/sysctl.conf 檔案並新增如下內容:
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 4294967295
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
或者kernel.shmall和kernel.shmmax的預設值已經超過上述值,使用預設值即可。
修改生效
[root@12c01 ~]# /sbin/sysctl -p


3. 建立使用者
/usr/sbin/groupadd -g 54321 oinstall
/usr/sbin/groupadd -g 54322 dba
/usr/sbin/groupadd -g 54323 oper
/usr/sbin/groupadd -g 54324 backupdba
/usr/sbin/groupadd -g 54325 dgdba
/usr/sbin/groupadd -g 54326 kmdba
/usr/sbin/groupadd -g 54327 asmdba
/usr/sbin/groupadd -g 54328 asmoper
/usr/sbin/groupadd -g 54329 asmadmin
/usr/sbin/groupadd -g 54330 racdba
/usr/sbin/useradd -u 54321 -g oinstall -G dba,asmdba,oper oracle
/usr/sbin/useradd -u 54322 -g oinstall -G asmdba,asmadmin grid

4. 確認使用者:
[root@12c01 ~]# id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54327(asmdba)
[root@12c01 ~]# id grid
uid=54322(grid) gid=54321(oinstall) groups=54321(oinstall),54327(asmdba),54329(asmadmin)

5. 修改密碼:讓你輸入密碼,密碼任意輸入2次,但必須保持一致,回車確認
[root@12c01 ~]# passwd oracle
Changing password for user oracle.
New password: 
BAD PASSWORD: it is based on a dictionary word
BAD PASSWORD: is too simple
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@12c01 ~]# passwd grid
Changing password for user grid.
New password: 
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password: 
passwd: all authentication tokens updated successfully.

6. 建立目錄結構:
mkdir -p /home/oracle/app/oracle/product/12.2.0/dbhome_1 
mkdir -p /home/oracle/app/oradata
chown -R oracle:oinstall /home/oracle/

7. 設定oracle使用者的環境變數:
#vi .bash_profile
--將如下程式碼新增到.bash_profile檔案中: 
# Oracle Settings 
umask 022
export TMP=/tmp; 
export TMPDIR=$TMP; 
export ORACLE_BASE=/home/oracle/app/oracle;
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1;
export ORACLE_SID=andycdb; 
export ORACLE_TERM=xterm; 
export PATH=/usr/sbin:$PATH; 
export PATH=$ORACLE_HOME/bin:$PATH; 
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; 
export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;

8.檢查 /etc/hosts 檔案確認是否新增主機名和域名全稱
[root@12c01 ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.100.25.16 12c01

9. 將Oracle安裝包(以64位為例)複製到linux的home目錄下,開啟終端命令列介面,執行unzip命令解壓oracle安裝檔案。
輸入命令:
[oracle@12c01 ~]$ ll
total 3372760
drwxr-xr-x. 4 oracle oinstall 4096 May 6 03:31 app
-rw-r--r--. 1 oracle oinstall 3453696911 May 6 03:38 linuxx64_12201_database.zip
[oracle@12c01 ~]$ du -h linuxx64_12201_database.zip 
3.3G linuxx64_12201_database.zip
[oracle@12c01 ~]$ unzip linuxx64_12201_database.zip

PRVF-0002 : could not retrieve local node name

解壓完成後 cd 進入其解壓後的目錄database
輸入命令:
cd database
執行安裝
輸入命令:
./runInstaller

缺包,自行補包。

 

root執行完點選ok,12c軟體安裝結束。

dbca 建庫。

[oracle@12c01 database]$ dbca

[oracle@12c01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Sat May 6 06:48:50 2017

Copyright (c) 1982, 2016, Oracle. All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> select name,cdb from v$database;

NAME CDB
--------- ---
ANDYCDB YES

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB01 READ WRITE NO

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31383567/viewspace-2138561/,如需轉載,請註明出處,否則將追究法律責任。

相關文章