操作系統(tǒng): CentOS Linux release 7.3.1611 (Core)
常熟網(wǎng)站制作公司哪家好,找成都創(chuàng)新互聯(lián)公司!從網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、APP開發(fā)、響應(yīng)式網(wǎng)站設(shè)計(jì)等網(wǎng)站項(xiàng)目制作,到程序開發(fā),運(yùn)營維護(hù)。成都創(chuàng)新互聯(lián)公司公司2013年成立到現(xiàn)在10年的時(shí)間,我們擁有了豐富的建站經(jīng)驗(yàn)和運(yùn)維經(jīng)驗(yàn),來保證我們的工作的順利進(jìn)行。專注于網(wǎng)站建設(shè)就選成都創(chuàng)新互聯(lián)公司。
oracle版本:linux.x64_11gR2
linux.x64_11gR2_database_1of2.zip
linux.x64_11gR2_database_2of2.zip
A) 創(chuàng)建用戶和組
groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle
B) 創(chuàng)建數(shù)據(jù)庫安裝目錄
mkdir -p /opt/oracle ##$ORACLE_BASE
mkdir -p /opt/oracle/product/112010/db_1 ##$ORACLE_HOME
mkdir /opt/oracle/oradata ##存放數(shù)據(jù)庫目錄
mkdir /opt/oracle/inventory
mkdir /opt/oracle/flash_recovery_area
chown -R oracle:oinstall /opt/oracle
chmod -R 775 /opt/oracle
C) 將oracle使用者加入到sudo群組中
vi /etc/sudoers
輸入上面的命令后,打開sudoers文件進(jìn)行編輯,找到
root ALL=(ALL) ALL
這行,并且在底下再加入以下命令:
oracle ALL=(ALL) ALL
1、關(guān)閉selinux
vi /etc/selinux/config
修改: SELINUX=disabled
2、關(guān)閉防火墻
systemctl stop firewalld.service #停止服務(wù)|firewall
systemctl disable firewalld.service #禁止firewall開機(jī)啟動(dòng)
3、修改/etc/hosts文件
vi /etc/hosts
10.143.200.188 DATAFS
4、修改內(nèi)核參數(shù)
vi /etc/sysctl.conf
修改以下內(nèi)容
kernel.shmall = 2097152
kernel.shmmax = 1073741824
添加以下內(nèi)容
fs.aio-max-nr = 1048576
fs.file-max = 6815744
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
#sysctl -p
5、修改用戶限制文件
#vi /etc/security/limits.conf
行末添加以下內(nèi)容
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
6、關(guān)聯(lián)設(shè)置
vi /etc/pam.d/login
行末添加以下內(nèi)容:
session required /lib64/security/pam_limits.so
session required pam_limits.so
7、修改/etc/profile
#vi /etc/profile
添加以下內(nèi)容:
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
8、Oralce用戶修改用戶環(huán)境變量
#vi /home/oracle/.bash_profile
在最底下加入以下內(nèi)容
#For Oracle
export ORACLE_BASE=/opt/oracle;
export ORACLE_HOME=/opt/oracle/product/112010/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export LC_ALL="en_US"
export LANG="en_US"
export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
source /home/oracle/.bash_profile
查看命令:# env
安裝依賴包比較多,最好服務(wù)器能夠訪問外網(wǎng),這樣就簡(jiǎn)單多了,如果真的無法訪問外網(wǎng)只能下載對(duì)應(yīng)的rpm包安裝了.
yum -y install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devel pdksh ksh libaio.i686 glibc.i686 compat-libstdc++-33.i686 libaio-devel.i686 libgcc.i686 libstdc++.i686 unixODBC.i686 unixODBC-devel.i686
rpm包安裝:#rpm -ivh * --force --nodeps
1、安裝包解壓命令(使用oracle用戶解壓 )
$unzip linux.x64_11gR2_database_1of2.zip
$unzip linux.x64_11gR2_database_2of2.zip
修改目錄所屬用戶
chown -R oracle:oinstall database
解壓完成后會(huì)生成database目錄,解壓后的文件中database/response下有有db_install.rsp、dbca.rsp和netca.rsp三個(gè)應(yīng)答文件,分別數(shù)據(jù)庫安裝文件、建立數(shù)據(jù)庫實(shí)例和監(jiān)聽配置安裝文件,在下面的步驟中會(huì)用到這3個(gè)文件.
2、編輯數(shù)據(jù)庫安裝文件db_install.rsp
vi db_install.rsp
20 oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
29 oracle.install.option=INSTALL_DB_SWONLY #安裝類型
37 ORACLE_HOSTNAME=DATAFS #主機(jī)名稱
42 UNIX_GROUP_NAME=oinstall #安裝組
47 INVENTORY_LOCATION=/opt/oracle/inventory #INVENTORY目錄
78 SELECTED_LANGUAGES=en,zh_CN #選擇語言
83 ORACLE_HOME=/opt/oracle/product/112010/db_1 #oracle_home
88 ORACLE_BASE=/opt/oracle #oracle_base
99 oracle.install.db.InstallEdition=EE ##oracle版本
108 oracle.install.db.isCustomInstall=true
142 oracle.install.db.DBA_GROUP=dba #dba用戶組
147 oracle.install.db.OPER_GROUP=dba #oper用戶組
160 oracle.install.db.config.starterdb.type=GENERAL_PURPOSE #數(shù)據(jù)庫類型
165 oracle.install.db.config.starterdb.globalDBName=orcl #globalDBName
170 oracle.install.db.config.starterdb.SID=orcl #SID
200 oracle.install.db.config.starterdb.memoryLimit=800 #自動(dòng)管理內(nèi)存的最小內(nèi)存(M)
233 oracle.install.db.config.starterdb.password.ALL=oracle #設(shè)定所有數(shù)據(jù)庫用戶使用同一個(gè)密碼
385 DECLINE_SECURITY_UPDATES=true #設(shè)置安全更新
3、安裝數(shù)據(jù)庫軟件(使用oracle用戶)
#su - oracle
進(jìn)入剛才的database目錄
./runInstaller -silent -responseFile /ghca/database/response/db_install.rsp -ignorePrereq
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB. Actual 13773 MB Passed
Checking swap space: must be greater than 150 MB. Actual 2047 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-09-20_09-16-02PM. Please wait ...
接下來就是等待(有點(diǎn)長(zhǎng),不要著急!!!),快的話10分鐘左右,慢一點(diǎn)可能需要30分鐘左右,要看服務(wù)器配置。
安裝過程中,如果提示[WARNING]不必理會(huì),此時(shí)安裝程序仍在后臺(tái)進(jìn)行,如果出現(xiàn)[FATAL],則安裝程序已經(jīng)停止了。
可以在以下位置找到本次安裝會(huì)話的日志。
安裝失敗會(huì)打印一下信息
[FATAL] [INS-32076] English cannot be removed from the selected languages list.
CAUSE: An attempt was made to remove English from the selected languages list.
ACTION: Select English as one of the selected product languages.
A log of this session is currently saved as: /tmp/OraInstall2018-09-20_09-16-02PM/installActions2018-09-20_09-16-02PM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.
查看log日志信息:
cat /tmp/OraInstall2018-09-20_09-16-02PM/installActions2018-09-20_09-16-02PM.log. Oracle
正常安裝日志信息:
[oracle@DATAFS database]$ [WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.
You can find the log of this install session at:
/opt/oracle/inventory/logs/installActions2018-09-20_09-47-28PM.log
tail -f /opt/oracle/inventory/logs/installActions2018-09-20_09-47-28PM.log
安裝成功的日志如下:
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root scripts to run
/opt/oracle/inventory/orainstRoot.sh
/opt/oracle/product/112010/db_1/root.sh
To execute the configuration scripts:
4、 安裝后操作,按照要求執(zhí)行腳本
打開新的終端,以root身份登錄,執(zhí)行腳本:
#/opt/oracle/inventory/orainstRoot.sh
#/opt/oracle/product/112010/db_1/root.sh
[root@DATAFS db_1]# /opt/oracle/inventory/orainstRoot.sh
Changing permissions of /opt/oracle/inventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /opt/oracle/inventory to oinstall.
The execution of the script is complete.
[root@DATAFS db_1]# /opt/oracle/product/112010/db_1/root.sh
Check /opt/oracle/product/112010/db_1/install/root_DATAFS_2018-09-20_22-36-50.log for the output of root script
完成后,返回原來的終端按下回車鍵,等待程序安裝完成.
執(zhí)行命令 : netca /silent /responseFile /ghca/database/response/netca.rsp ###----此處必須寫絕對(duì)路徑
[oracle@DATAFS response]$ netca /silent /responseFile /ghca/database/response/netca.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = /ghca/database/response/netca.rsp
Done parsing command line arguments.
Oracle Net Services Configuration:
Configuring Listener:LISTENER
Listener configuration complete.
Oracle Net Listener Startup:
Running Listener Control:
/opt/oracle/product/112010/db_1/bin/lsnrctl start LISTENER
Listener Control complete.
Listener started successfully.
Profile configuration complete.
Oracle Net Services configuration successful. The exit code is 0
查看端口是否占用:
[root@DATAFS ~]# ss -tnl|grep 1521
LISTEN 0 128 :::1521 :::*
[root@DATAFS ~]#
查看監(jiān)聽狀態(tài):
[oracle@DATAFS response]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 21-SEP-2018 12:22:08
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DATAFS)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 21-SEP-2018 12:20:29
Uptime 0 days 0 hr. 1 min. 41 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/112010/db_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/DATAFS/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DATAFS)(PORT=1521)))
The listener supports no services
The command completed successfully
1 修改/ghca/database/response/dbca.rsp響應(yīng)文件中的重要參數(shù)
本次安裝過程中設(shè)置了下列參數(shù):(注意下面參數(shù)視情況而定,不要照抄,原文件都有說明的)
RESPONSEFILE_VERSION ="11.2.0" #不能更改
OPERATION_TYPE ="createDatabase"
GDBNAME ="orcl" #數(shù)據(jù)庫的名字
SID ="ORCL" ##對(duì)應(yīng)的實(shí)例名字
TEMPLATENAME ="General_Purpose.dbc" ##建庫用的模板文件
SYSPASSWORD ="oracle" ##SYS管理員密碼
SYSTEMPASSWORD ="oracle" ##SYSTEM管理員密碼
SYSMANPASSWORD= "oracle"
DBSNMPPASSWORD= "oracle"
DATAFILEDESTINATION =/opt/oracle/oradata ##數(shù)據(jù)文件存放目錄
RECOVERYAREADESTINATION=/opt/oracle/flash_recovery_area ##恢復(fù)數(shù)據(jù)存放目錄
CHARACTERSET ="ZHS16GBK" ##字符集,重要!!!建庫后一般不能更改,所以建庫前要確定清楚。
TOTALMEMORY ="1638" #1638MB,物理內(nèi)存2G*80%。
2、 開始安裝數(shù)據(jù)庫實(shí)例
dbca -silent -responseFile /ghca/database/response/response/dbca.rsp
[oracle@DATAFS response]$ dbca -silent -responseFile /ghca/database/response/dbca.rsp
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/opt/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.
到此數(shù)據(jù)庫實(shí)例安裝就完成了.
配置監(jiān)聽時(shí),沒有使用netca.rsp相應(yīng)的文件的絕對(duì)路徑
[oracle@DATAFS response]$ netca /silent /responseFile netca.rsp
Parsing command line arguments:
Parameter "silent" = true
Parameter "responsefile" = ./netca.rsp
Oracle Net Configuration Assistant could not find the Response File at the given location.
Oracle Net Services configuration failed. The exit code is 1
登錄數(shù)據(jù)庫sqlplus / as sysdba
啟動(dòng):SQL> startup
停止:SQL> shutdown immediate;
1、管理員用戶創(chuàng)建表空間保存數(shù)據(jù)
create tablespace IDR_TS datafile '/opt/oracle/oradata/orcl/IDR_TS01.dbf' size 1024m;
2、創(chuàng)建用戶數(shù)據(jù)操作用戶
create user operator identified by "123456"
default tablespace operator
temporary tablespace TEMP
profile DEFAULT
quota unlimited on IDR_TS;
以下權(quán)限是可選的,根據(jù)自己需要給用戶賦權(quán)
grant connect to operator;
grant dba to operator;
grant javasyspriv to operator;
-- Grant/Revoke system privileges
grant create any sequence to operator;
grant create any table to operator;
grant create any view to operator;
grant unlimited tablespace to operator;
-- Grant/Revoke role privileges
grant connect to operator;
grant dba to operator;
grant exp_full_database to operator;
grant imp_full_database to operator;
grant javasyspriv to operator;
grant resource to operator;
-- Grant/Revoke system privileges
grant create any sequence to operator;
grant alter any table to operator;
grant alter any trigger to operator;
grant alter session to operator;
grant alter system to operator;
grant alter tablespace to operator;
grant alter user to operator;
grant analyze any to operator;
grant create any procedure to operator;
grant create any synonym to operator;
grant create any table to operator;
grant create any trigger to operator;
grant create cluster to operator;
grant create database link to operator;
grant create procedure to operator;
grant create public synonym to operator;
grant create role to operator;
grant create sequence to operator;
grant create session to operator;
grant create synonym to operator;
grant create table to operator;
grant create any view to operator;
grant delete any table to operator;
grant drop any index to operator;
grant drop any synonym to operator;
grant drop any table to operator;
grant drop any trigger to operator;
grant drop public synonym to operator;
grant execute any procedure to operator;
grant insert any table to operator;
grant lock any table to operator;
grant select any table to operator;
grant unlimited tablespace to operator;
grant update any table to operator;
到此就可以使用operator登錄進(jìn)行數(shù)據(jù)操作了.數(shù)據(jù)庫完整的安裝就結(jié)束了.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< installation is complete >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
文章標(biāo)題:CentOS7靜默安裝數(shù)據(jù)庫oralce11gR2
網(wǎng)頁網(wǎng)址:http://jinyejixie.com/article24/gpgcce.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供、網(wǎng)站建設(shè)、面包屑導(dǎo)航、網(wǎng)站制作、網(wǎng)頁設(shè)計(jì)公司、網(wǎng)站設(shè)計(jì)公司
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)