RHEL6.4安裝Oracle 12cR2

stonebox1122發表於2017-06-20

1、硬體環境確認

Oracle 12cR2的硬體環境需求參考:

[root@my ~]# free -g

total used free shared buffers cached

Mem: 3 0 2 0 0 0

-/+ buffers/cache: 0 3

Swap: 3 0 3

滿足要求。

 

2、作業系統確認。

Oracle 12cR2的作業系統支援矩陣參考:

[root@my ~]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 6.4 (Santiago)

 

[root@my ~]# uname -a

Linux my 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

滿足要求。

 

3、安裝依賴包

Oracle 12cR2在RHEL6上的依賴包參考:

如果是外網直接yum安裝,如果是內網,可以先配置區域網yum或者本地yum,參考:

http://blog.itpub.net/28536251/viewspace-1750096/

[root@my ~]# mount /dev/cdrom /media/

 

[root@my ~]# yum install binutils compat-libcap1 compat-libstdc++ compat-libstdc++-33 gcc gcc-c++ glibc libaio libaio-devel libgcc libstdc++ libstdc++-devel ksh make sysstat unixodbc

 

4、禁用防火牆和SELinux

[root@my ~]# /etc/init.d/iptables status

iptables: Firewall is not running.

 

[root@my ~]# getenforce

Disabled

 

5、確認主機名和IP對映

[root@my ~]# cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=my

 

[root@my ~]# cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.254.151 my

 

6、建立組、使用者和目錄

[root@my ~]# vim ora_user_dir.sh

#!/bin/bash

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba oracle

echo "123456" | passwd --stdin oracle

mkdir -p /u01/

chown -R oracle:oinstall /u01/

chmod -R 775 /u01/

 

[root@my ~]# sh ora_user_dir.sh

Changing password for user oracle.

passwd: all authentication tokens updated successfully.

 

7、配置環境變數

[root@my ~]# vim ora_env.txt

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1; export ORACLE_HOME

LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH

ORACLE_SID=stone; export ORACLE_SID

NLS_LANG=american_america.al32utf8;export NLS_LANG

PATH=$ORACLE_HOME/bin:$PATH; export PATH

 

[root@my ~]# cat ora_env.txt >> /home/oracle/.bash_profile

 

檢視確認:

[oracle@my ~]$ env | grep ORACLE

ORACLE_SID=stone

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1

 

8、解壓安裝

[oracle@my ~]$ unzip /mnt/hgfs/software/linuxx64_12201_database.zip

[oracle@my ~]$ export DISPLAY=192.168.254.1:0.0

[oracle@my ~]$ cd database/

[oracle@my database]$ ./runInstaller

clipboard

clipboard

clipboard

clipboard

clipboard

clipboard

clipboard

clipboard

clipboard

[root@my ~]# /tmp/CVU_12.2.0.1.0_oracle/runfixup.sh

All Fix-up operations were completed successfully.

clipboard

clipboard

clipboard

[root@my ~]# /u01/app/oraInventory/orainstRoot.sh

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

 

[root@my ~]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh

Performing root user operation.

The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /u01/app/oracle/product/12.2.0/dbhome_1

Enter 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 by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Do you want to setup Oracle Trace File Analyzer (TFA) now ? yes|[no] :

Oracle Trace File Analyzer (TFA - User Mode) is available at :

/u01/app/oracle/product/12.2.0/dbhome_1/suptools/tfa/release/tfa_home/bin/tfactl

OR

Oracle Trace File Analyzer (TFA - Daemon Mode) can be installed by running this script :

/u01/app/oracle/product/12.2.0/dbhome_1/suptools/tfa/release/tfa_home/install/roottfa.sh

clipboard

 

9、建立資料庫

[oracle@my database]$ dbca

clipboard

clipboard

clipboard

指定建立PDB的數量。

clipboard

clipboard

與11g相比,快速恢復區的預設值增大了。

clipboard

將監聽整合到了DBCA。

clipboard

clipboard

clipboard

與11g相比,預設的processes由150增大到300。

clipboard

clipboard

clipboard

clipboard

clipboard

clipboard

clipboard

clipboard

與11g相比,預設日誌大小由50M增大到了200M。

clipboard

clipboard

clipboard

clipboard

安裝完成後監聽已經啟動:

[oracle@my ~]$ lsnrctl status

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 16-JUN-2017 15:00:08

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=my)(PORT=1521)))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production

Start Date 16-JUN-2017 12:45:57

Uptime 0 days 2 hr. 14 min. 11 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/oracle/product/12.2.0/dbhome_1/network/admin/listener.ora

Listener Log File /u01/app/oracle/diag/tnslsnr/my/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=my)(PORT=1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=my)(PORT=5500))(Security=(my_wallet_directory=/u01/app/oracle/admin/stone/xdb_wallet))(Presentation=HTTP)(Session=RAW))

Services Summary...

Service "520dad70e8cb3b6be05397fea8c0af2e" has 1 instance(s).

Instance "stone", status READY, has 1 handler(s) for this service...

Service "520db06347a83b8ae05397fea8c07c98" has 1 instance(s).

Instance "stone", status READY, has 1 handler(s) for this service...

Service "stone" has 1 instance(s).

Instance "stone", status READY, has 1 handler(s) for this service...

Service "stoneXDB" has 1 instance(s).

Instance "stone", status READY, has 1 handler(s) for this service...

Service "stonepdb1" has 1 instance(s).

Instance "stone", status READY, has 1 handler(s) for this service...

Service "stonepdb2" has 1 instance(s).

Instance "stone", status READY, has 1 handler(s) for this service...

The command completed successfully

 

10、檢視確認

(1)檢視資料庫版本

SQL> select * from v$version;

BANNER CON_ID

-------------------------------------------------------------------------------- ----------

Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0

PL/SQL Release 12.2.0.1.0 - Production 0

CORE 12.2.0.1.0 Production 0

TNS for Linux: Version 12.2.0.1.0 - Production 0

NLSRTL Version 12.2.0.1.0 - Production 0

 

(2)檢視資料庫資訊

SQL> select dbid,name,OPEN_MODE,CDB,CON_ID,CON_DBID from v$database;

DBID NAME OPEN_MODE CDB CON_ID CON_DBID

---------- --------- -------------------- --- ---------- ----------

3057043705 STONE READ WRITE YES 0 3057043705

 

(3)檢視PDB資訊

SQL> select con_id,dbid,guid,name,open_mode from v$pdbs;

CON_ID DBID GUID NAME OPEN_MODE

---------- ---------- -------------------------------- --------------- ----------

2 2820366089 520D86F4A5F7335EE05397FEA8C04854 PDB$SEED READ ONLY

3 1077568213 520DAD70E8CB3B6BE05397FEA8C0AF2E STONEPDB1 READ WRITE

4 4252608347 520DB06347A83B8AE05397FEA8C07C98 STONEPDB2 READ WRITE

 

SQL> show con_name pdbs

CON_NAME

------------------------------

CDB$ROOT

CON_ID CON_NAME OPEN MODE RESTRICTED

---------- ------------------------------ ---------- ----------

2 PDB$SEED READ ONLY NO

3 STONEPDB1 READ WRITE NO

4 STONEPDB2 READ WRITE NO

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

相關文章