这个之前写过
https://blog.csdn.net/yangyuCISCO/article/details/84309516
有的电脑给40G硬盘内存不够用,就比如我,所以我给的50-60G。看个人电脑。
[root@localhost ~]# dhclient
[root@localhost ~]# vim /etc/ssh/sshd_config
#UseDNS yes
UseDNS no 关闭域名解析
[root@localhost ~]# systemctl restart sshd
[root@localhost ~]# vim /etc/yum.repos.d/base.repo
[base]
name=base
baseurl=file:///mnt
enable=1
gpgcheck=0
[root@localhost ~]# mount /dev/sr0 /mnt
mount: /dev/sr0 is write-protected, mounting read-only
[root@localhost ~]#yum install -y compat-libcap1 glibc-devel ksh libaio-devel libstdc+±devel gcc gcc-c++ unixODBC
[root@localhost ~]# groupadd oinstall
[root@localhost ~]# groupadd dba
[root@localhost ~]# useradd -g oinstall -G dba oracle
[root@localhost ~]# echo oracle | passwd --stdin oracle
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
[root@localhost ~]# id oracle
uid=1001(oracle) gid=1001(oinstall) groups=1001(oinstall),1002(dba)
[root@localhost ~]# vim /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
[root@localhost ~]# sysctl -p
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
[root@localhost ~]# vim /etc/security/limits.conf
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft stack 10240
oracle hard stack 10240
[root@localhost ~]# mkdir -p /u01/app
[root@localhost ~]# chown -R oracle:oinstall /u01/app
[root@localhost ~]# chmod -R 775 /u01/app
[root@localhost ~]# ll /u01/app -d
drwxrwxr-x. 2 oracle oinstall 6 Jun 25 21:43 /u01/app
[root@localhost ~]# rz
[root@localhost ~]# mv linuxx64_12201_database.zip /home/oracle/
[root@localhost ~]# cd /home/oracle
[root@localhost ~]# unzip ORACLE12C.zip 注:这个压缩包的名字,是你电脑上自己的那个名字,不一定是这个。
[root@localhost ~]# chmod 777 database/ -R
[root@localhost ~]# chown oracle:oinstall database/ -R
[root@localhost ~]xhost + 注:这个命令在虚拟机里面敲
access control disabled, clients can connect from any host
登出root用户,使用Oracle用户登录。
[oracle@localhost Desktop]$ cd
[oracle@localhost ~]$ cd /home/oracle
[oracle@localhost ~]$ ll
total 3372756
drwxrwxrwx. 7 oracle oinstall 4096 Jan 26 2017 database
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Desktop
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Documents
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Downloads
-rw-r–r--. 1 root root 3453696911 Jun 22 00:28 linuxx64_12201_database.zip
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Music
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Pictures
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Public
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Templates
drwxr-xr-x. 2 oracle oinstall 6 Jun 25 22:00 Videos
[oracle@localhost ~]$ cd database
[oracle@localhost database]$ ll
total 24
drwxrwxrwx. 4 oracle oinstall 4096 Jan 26 2017 install
drwxrwxrwx. 2 oracle oinstall 58 Jan 26 2017 response
drwxrwxrwx. 2 oracle oinstall 34 Jan 26 2017 rpm
-rwxrwxrwx. 1 oracle oinstall 8771 Jan 26 2017 runInstaller
drwxrwxrwx. 2 oracle oinstall 28 Jan 26 2017 sshsetup
drwxrwxrwx. 14 oracle oinstall 4096 Jan 26 2017 stage
-rwxrwxrwx. 1 oracle oinstall 500 Feb 6 2013 welcome.html
[oracle@localhost database]$ ./runInstaller
接下来会出现
取消设置邮箱-》next,剩下的都是next,我就不一一写了。
安install,等待安装,接下来会弹出两个脚本,需要在 root用户下运行。
需要你确定的 直接回车。
然后在脚本的对话框下点击OK。这个安装很慢,耐心点!要注意的是,如果./runInstaller完后需要你continue,yes还是no的,就是压缩包解压出了问题,删除了重新解压。
我说的是这,下面的是正常反应。
[oracle@localhost database]$ ./runInstaller
Starting Oracle Universal Installer…
Checking Temp space: must be greater than 500 MB. Actual 35981 MB Passed
Checking swap space: must be greater than 150 MB. Actual 3967 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-06-25_10-01-34PM. Please wait …
close就好了。
[oracle@localhost ~]$ . oraenv
中间有个空格
ORACLE_SID = [oracle] ? orcl
The Oracle base has been set to /u01/app/oracle
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Tue Jun 25 22:35:46 2019
Copyright © 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
SQL>
出现这个就是正常的。