您好,登錄后才能下訂單哦!
首發:http://www.arppinging.com/wordpress/?p=90
chmod -R 755 /tmp/database/
創建oracle用戶,并將oracle用戶加入oinstall和dba組,后面安裝的時候需要用到
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# 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@localhost ~]#
創建數據庫安裝目錄u01
[root@localhost ~]# mkdir /home/u01
為數據庫安裝目錄做一個軟鏈接
[root@localhost ~]# ln -s /home/u01/ /u01
[root@localhost ~]# mkdir -p /u01/app/oracle
修改/u01目錄的屬主和屬組信息
[root@localhost ~]# chown -R oracle:oinstall /u01/
修改u01的權限為755
[root@localhost ~]# chmod -R 755 /u01/
[root@localhost ~]# vim /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.4/db_1
export ORACLE_SID=test
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$ORACLE_HOME/jdk/bin:$PATH
export LANG="en_US.UTF-8"
export NLS_LANG=american_AMERICA.UTF8
export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS"
驗證一下有沒有問題,沒有輸出,則代表沒有問題
[root@localhost oracle]# source .bash_profile
[root@localhost oracle]#
1.掛載光驅
[root@localhost ~]# mount /dev/cdrom /mnt/
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]#
2.修改yum文件
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
rhel-source.repo
[root@localhost yum.repos.d]# cp rhel-source.repo rhel-source.repo.bak
[root@localhost yum.repos.d]# vim rhel-source.repo
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///mnt/
enabled=1
gpgcheck=0
3.清除yum源,并重新生成
[root@localhost yum.repos.d]# yum claenall
[root@localhost yum.repos.d]# yum makecache
4.使用yum 安裝軟件
[root@localhost yum.repos.d]# yum install binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers pdksh cvuqdisk libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel make numactl-devel sysstat unixODBC unixODBC-devel -y
1.打開圖形化桌面的終端
[oracle@localhost ~]$ cd /tmp/database/
[oracle@localhost database]$ ./runInstaller
2.去掉選項卡中的勾
3.選擇YES
4.選擇第二個,安裝數據庫軟件
5.選擇安裝單節點
6.選擇安裝語言,默認就好(貌似沒有中文)
7.選擇默認的企業版
8.默認路徑,路徑準備階段已經創建,不是按照上面創建目錄的這里需要修改
9.目錄和組,默認即可
10.用戶組,默認即可
11.安裝前檢查,選中Ignore All即可下一步
12.點擊finish即可開始安裝
13.安裝中可能出現提示,直接點擊ok即可
14.安裝完成點擊close關閉窗口
[oracle@localhost database]$ dbca
1.選擇下一步
2.選擇創建數據庫
3.選擇數據庫模板,默認即可
4.設置SID,這個SID需要跟oracle用戶的.bash_profile中的SID相同,上面我們設置的是test
5.取消最上面的勾,下一步
6.為oracle數據庫的兩個用戶設置密碼,下面的選項是兩個用戶的密碼都使用...,當然,也可以一個用戶設置一個密碼。
7.下面的選項都選擇下一步即可
8.點擊完成
9.點擊ok
10.點擊exit完成安裝
[oracle@localhost /]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 02-OCT-2018 11:51:04
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.4/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 02-OCT-2018 11:51:05
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
The listener supports no services
The command completed successfully
[oracle@localhost /]$
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Tue Oct 2 11:53:31 2018
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
開啟數據庫,出現以下信息則說明數據庫已經啟動了
SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL>
順便查詢一張表,又數據輸出則代表沒有問題。
SQL> select * from user_tables;
1.下載rlwrap軟件
[root@localhost /]# wget http://mirrors.aliyun.com/epel/6/x86_64/Packages/r/rlwrap-0.42-1.el6.x86_64.rpm
2.安裝
[root@localhost /]# rpm -ivh rlwrap-0.42-1.el6.x86_64.rpm
warning: rlwrap-0.42-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing... ########################################### [100%]
1:rlwrap ########################################### [100%]
[root@localhost /]#
3.修改配置文件
[oracle@localhost ~]$ vi .bash_profile
alias sqlplus='rlwrap sqlplus'
alias rman='rlwrap rman'
4.重新登陸或者切換一下即可
完。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。