顾美玲勾引管家|日韩黄色成人|国产精品theporn动漫|欧美日日日|国产精品探花在线

專業只做數據庫實訓和認證的品牌機構

微信公眾號新浪微博
免費咨詢電話:400-0909-964
當前位置: 網站首頁 > DBA實戰 > DBA課程 > CentOS 7靜默安裝Oracle 12C數據庫

CentOS 7靜默安裝Oracle 12C數據庫

文章來源: 更新時間:2020/3/19 16:16:32

在線老師點擊咨詢:

最新學訊:近期OCP認證正在報名中,因考試人員較多請盡快報名獲取最近考試時間,報名費用請聯系在線老師,甲骨文官方認證,報名從速!

我要咨詢

環境

System : CentOS 7.x

mydb://> uname -a

Linux mydb 3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

SELINUX: 關閉

FIREWALL:關閉

systemctl stop firewalld.service --關閉防火墻

systemctl disable firewalld.service -- 禁止防火墻開機啟動

systemctl status firewalld.service -- 查看防火墻狀態

操作步驟

A、環境準備

B、用戶組創建

C、修改系統內核參數

D、修改用戶配置

E、數據庫應用安裝

F、數據庫初始化


A、環境準備

1、選擇Oracle安裝包,直接去官網選擇自己需要的版本

2、使用root用戶登錄,進行系統基礎環境準備。

執行以下命令:

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

執行檢查命令:

rpm -q binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libXi libXtst make sysstat unixODBC unixODBC-devel


B、用戶組創建

1、創建 oinstall 和 dba 組

mydb:/root/> groupadd oinstall

mydb:/root/> groupadd dba

2、創建 oracle 用戶,設置密碼

mydb:/root/> useradd -g oinstall -G dba oracle

mydb:/root/> 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:

BAD PASSWORD: The password is shorter than 8 characters

Retype new password:

passwd: all authentication tokens updated successfully.

3、查看用戶 id oracle

mydb:/root/> id oracle

uid=1004(oracle) gid=1004(oinstall) groups=1004(oinstall),1005(dba)


C、修改系統內核參數

1、修改系統配置: vi /etc/sysctl.conf ,增加如下內容:

fs.aio-max-nr = 1048576

fs.file-max = 6815744

# shmall 是全部允許使用的共享內存大小,shmmax 是單個段允許使用的大小。

kernel.shmmax = 6465333657

kernel.shmall = 10523004

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

2、使配置生效: sysctl -p


D、修改用戶配置

1、修改用戶限制。

打開文件: vi /etc/security/limits.conf

在文件末尾添加如下6行內容:

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

oracle hard stack 10240

2、修改用戶登錄庫文件引用

打開系統文件: vi /etc/pam.d/login

在文件末尾添加如下2行內容:

session required /lib64/security/pam_limits.so

session required pam_limits.so

3、修改用戶登錄環境變量

打開系統文件: vi /etc/profile

在文件末尾添加如下內容:

if [ $USER = "oracle" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

fi

退出編輯狀態,使修改的文件生效:source /etc/profile

4、創建安裝目錄,配置安裝目錄權限。

mkdir -p /usr/app/

chown -R oracle:oinstall /usr/app/

chmod -R 775 /usr/app/

5、配置 Oracle 用戶環境變量

切換用戶: su – oracle

編輯環境變量: vi .bash_profile

新增配置如下:

export ORACLE_BASE=/usr/app/oracle

export ORACLE_SID=orcl

export PS1=`uname -n`':$PWD/> '

生效配置文件: source .bash_profile


E、數據庫應用安裝

1、使用 oracle 用戶,創建數據庫安裝配置文件夾 etc 。

mydb://> su - oracle

mydb:/home/oracle/> mkdir etc

2、上傳安裝文件到 oracle 用戶目錄下,并解壓文件。

執行命令:

mydb:/home/oracle/> unzip linuxamd64_12102_database_1of2.zip

mydb:/home/oracle/> unzip linuxamd64_12102_database_2of2.zip

解壓完成會在用戶目錄下出現一個 database 文件夾

3、復制 Oracle配置文件到 etc 目錄下,并修改配置文件權限

mydb:/home/oracle/> cp ./database/response/* ./etc/

mydb:/home/oracle/> chmod 700 ./etc/*.rsp

4、修改靜默安裝配置文件 db_install.rsp

vi ./etc/db_install.rsp

# 修改文件配置

#-------------------------------------------------------------------------------

# Specify the installation option.

# It can be one of the following:

# - INSTALL_DB_SWONLY

# - INSTALL_DB_AND_CONFIG

# - UPGRADE_DB

#-------------------------------------------------------------------------------

oracle.install.option=INSTALL_DB_SWONLY

#-------------------------------------------------------------------------------

# Specify the Unix group to be set for the inventory directory.

#-------------------------------------------------------------------------------

UNIX_GROUP_NAME=oinstall

#-------------------------------------------------------------------------------

# Specify the location which holds the inventory files.

# This is an optional parameter if installing on

# Windows based Operating System.

#-------------------------------------------------------------------------------

INVENTORY_LOCATION=/usr/app/oracle/oraInventory

# Specify value as the following to select all the languages.

# Example : SELECTED_LANGUAGES=all_langs

#-------------------------------------------------------------------------------

SELECTED_LANGUAGES=en,zh_CN

#-------------------------------------------------------------------------------

# Specify the complete path of the Oracle Home.

#-------------------------------------------------------------------------------

ORACLE_HOME=/usr/app/oracle/product/12/db_1

#-------------------------------------------------------------------------------

# Specify the complete path of the Oracle Base.

#-------------------------------------------------------------------------------

ORACLE_BASE=/usr/app/oracle

#-------------------------------------------------------------------------------

# Specify the installation edition of the component.

#

# The value should contain only one of these choices.

# - EE : Enterprise Edition

#-------------------------------------------------------------------------------

oracle.install.db.InstallEdition=EE

#------------------------------------------------------------------------------

# The DBA_GROUP is the OS group which is to be granted OSDBA privileges.

#-------------------------------------------------------------------------------

oracle.install.db.DBA_GROUP=dba

#------------------------------------------------------------------------------

# The OPER_GROUP is the OS group which is to be granted OSOPER privileges.

# The value to be specified for OSOPER group is optional.

#------------------------------------------------------------------------------

oracle.install.db.OPER_GROUP=oinstall

#------------------------------------------------------------------------------

# The BACKUPDBA_GROUP is the OS group which is to be granted OSBACKUPDBA privileges.

#------------------------------------------------------------------------------

oracle.install.db.BACKUPDBA_GROUP=oinstall

#------------------------------------------------------------------------------

# The DGDBA_GROUP is the OS group which is to be granted OSDGDBA privileges.

#------------------------------------------------------------------------------

oracle.install.db.DGDBA_GROUP=oinstall

#------------------------------------------------------------------------------

# The KMDBA_GROUP is the OS group which is to be granted OSKMDBA privileges.

#------------------------------------------------------------------------------

oracle.install.db.KMDBA_GROUP=oinstall

#-------------------------------------------------------------------------------

# Specify the type of database to create.

# It can be one of the following:

# - GENERAL_PURPOSE

# - DATA_WAREHOUSE

# GENERAL_PURPOSE: A starter database designed for general purpose use or transaction-heavy applications.

# DATA_WAREHOUSE : A starter database optimized for data warehousing applications.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

#-------------------------------------------------------------------------------

# Specify the Starter Database Global Database Name.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.globalDBName=orcl

#-------------------------------------------------------------------------------

# Specify the Starter Database SID.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.SID=orcl

#-------------------------------------------------------------------------------

# Specify the Starter Database character set.

#

# One of the following

# AL32UTF8, WE8ISO8859P15, WE8MSWIN1252, EE8ISO8859P2,

# EE8MSWIN1250, NE8ISO8859P10, NEE8ISO8859P4, BLT8MSWIN1257,

# BLT8ISO8859P13, CL8ISO8859P5, CL8MSWIN1251, AR8ISO8859P6,

# AR8MSWIN1256, EL8ISO8859P7, EL8MSWIN1253, IW8ISO8859P8,

# IW8MSWIN1255, JA16EUC, JA16EUCTILDE, JA16SJIS, JA16SJISTILDE,

# KO16MSWIN949, ZHS16GBK, TH8TISASCII, ZHT32EUC, ZHT16MSWIN950,

# ZHT16HKSCS, WE8ISO8859P9, TR8MSWIN1254, VN8MSWIN1258

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.characterSet=AL32UTF8

#------------------------------------------------------------------------------

# This variable should be set to true if Automatic Memory Management

# in Database is desired.

# If Automatic Memory Management is not desired, and memory allocation

# is to be done manually, then set it to false.

#------------------------------------------------------------------------------

oracle.install.db.config.starterdb.memoryOption=true

#------------------------------------------------------------------------------

# This variable holds the password that is to be used for all schemas in the

# starter database.

#-------------------------------------------------------------------------------

oracle.install.db.config.starterdb.password.ALL=oracle

#------------------------------------------------------------------------------

# Specify whether to enable the user to set the password for

# My Oracle Support credentials. The value can be either true or false.

# If left blank it will be assumed to be false.

#

# Example : SECURITY_UPDATES_VIA_MYORACLESUPPORT=true

#------------------------------------------------------------------------------

SECURITY_UPDATES_VIA_MYORACLESUPPORT=true

#------------------------------------------------------------------------------

# Specify whether user doesn't want to configure Security Updates.

# The value for this variable should be true if you don't want to configure

# Security Updates, false otherwise.

#

# The value can be either true or false. If left blank it will be assumed

# to be false.

#

# Example : DECLINE_SECURITY_UPDATES=false

#------------------------------------------------------------------------------

DECLINE_SECURITY_UPDATES=true

5、開始安裝,執行 db_install.rsp

mydb:/home/oracle/> ./database/runInstaller -silent -responseFile /home/oracle/etc/db_install.rsp

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB. Actual 43690 MB Passed

Checking swap space: must be greater than 150 MB. Actual 511 MB Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-08-01_03-16-16PM. Please wait ...

You can find the log of this install session at:

/usr/app/oracle/oraInventory/logs/installActions2019-08-01_03-20-39PM.log

The installation of Oracle Database 12c was successful.

Please check '/usr/app/oracle/oraInventory/logs/silentInstall2019-08-01_03-20-39PM.log' for more details.

As a root user, execute the following script(s):

1. /usr/app/oracle/oraInventory/orainstRoot.sh

2. /usr/app/oracle/product/12/db_1/root.sh

Successfully Setup Software.

等待結果,這樣安裝就成功完成了。

6、切換 root 用戶,修改數據庫配置

mydb://> /usr/app/oracle/oraInventory/orainstRoot.sh

Changing permissions of /usr/app/oracle/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of /usr/app/oracle/oraInventory to oinstall.

The execution of the script is complete.

mydb://> /usr/app/oracle/product/12/db_1/root.sh

Check /usr/app/oracle/product/12/db_1/install/root_mydb_2020-01-01_19-00-31.log for the output of root script


F、數據庫初始化

1、使用 oracle 用戶登錄,修改用戶環境變量

export ORACLE_BASE=/usr/app/oracle

export ORACLE_SID=orcl

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

export ORACLE_HOME=/usr/app/oracle/product/12/db_1

export PATH=$PATH:$ORACLE_HOME/bin

export LANG="zh_CN.UTF-8"

export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8"

export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'

使環境變量生效,執行命令:source .bash_profile

2、配置監聽程序

mydb:/home/oracle/> netca /silent /responsefile /home/oracle/etc/netca.rsp

3、啟動監聽

mydb:/home/oracle/> lsnrctl start

LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 01-8月 -2019 15:47:15

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

4、靜默建庫文件修改,打開 dbca.rsp 文件。

vi ./etc/dbca.rsp

#-----------------------------------------------------------------------------

# Name : SID

# Datatype : String

# Description : System identifier (SID) of the database

# Valid values : Check Oracle12c Administrator's Guide

# Default value : specified in GDBNAME

# Mandatory : No

#-----------------------------------------------------------------------------

SID = "orcl"

#-----------------------------------------------------------------------------

# Name : CHARACTERSET

# Datatype : String

# Description : Character set of the database

# Valid values : Check Oracle12c National Language Support Guide

# Default value : "US7ASCII"

# Mandatory : NO

#-----------------------------------------------------------------------------

CHARACTERSET = "AL32UTF8"

#-----------------------------------------------------------------------------

# Name : LISTENERS

# Datatype : String

# Description : Specifies list of listeners to register the database with.

# By default the database is configured for all the listeners specified in the

# $ORACLE_HOME/network/admin/listener.ora

# Valid values : The list should be comma separated like "listener1,listener2".

# Mandatory : NO

#-----------------------------------------------------------------------------

LISTENERS = "LISTENERS"

5、執行靜默建庫

mydb:/home/oracle/> dbca -silent -createDatabase -responseFile /home/oracle/etc/dbca.rsp

輸入 SYS 用戶口令:

輸入 SYSTEM 用戶口令:

復制數據庫文件

1% 已完成

3% 已完成

11% 已完成

18% 已完成

26% 已完成

37% 已完成

正在創建并啟動 Oracle 實例

40% 已完成

45% 已完成

50% 已完成

55% 已完成

56% 已完成

60% 已完成

62% 已完成

正在進行數據庫創建

66% 已完成

70% 已完成

73% 已完成

85% 已完成

96% 已完成

100% 已完成

有關詳細信息, 請參閱日志文件 "/usr/app/oracle/cfgtoollogs/dbca/orcl/orcl.log"。

建庫完成了。

6、創建數據庫應用用戶并授權。

mydb:/home/oracle/> sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on 星期四 8月 1 16:45:33 2019

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

連接到:

Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> create user user1 identified by passwd1;

用戶已創建。

SQL> grant connect,resource,dba to user1;

授權成功。

本文地址:http://www.mudan321.com/dba/kecheng/24085539422.html 轉載請注明!


PostgreSQL入門到精通 100+ 個學習資料

Oracle培訓機構

金牌講師<>

冉乃綱-老師CUUG金牌講師
冉老師 CUUG金牌講師 Oracle及RedHat高級講師、Unix/Linux 資深專家...[詳細了解老師]

免費咨詢上課流程 客服在線中

陳衛星-老師CUUG金牌講師
陳老師 CUUG金牌講師 精通Oracle管理、備份恢復、性能優化 11年Ora...[詳細了解老師]

免費咨詢上課流程 客服在線中

選學校如何選擇適合自己的學校

CUUG -CHINA UNIX USER GROUP,是國際UNIX組織UNIFORUM的中國代表,是國內悠久的專業UNIX培訓機構,被譽為中國UNIX 的搖籃。多年來,以提高教學質量為本,強調素質教育,積極引進、消化國外的新技術,有效的結合中國....[詳情]

一站式服務(從入學到就業一幫到底)

入學

學習

就業

實操

食宿
地址:北京市海淀區田村山南路35號院17號樓
課程咨詢: 400-0909-964
企業服務:137 1818 8639(陳經理)
部分信息來源于網絡,如有錯誤請聯系指正!
版權所有@北京神腦資訊技術有限公司 (CUUG,中國UNIX用戶協會) Copyright 2016 ALL Rights Reserved 京ICP備11008061號-1