以下操作在root用户下进行
1、mini版centos7没有ifconfig指令,可以如下操作
[[email protected] ~]# yum upgrade [[email protected] ~]# yum install net-tools
2、安装Oracle必须要用可视化界面,打造centos7桌面如下
[[email protected] ~]# yum grouplist [[email protected] ~]# yum groupinstall "GNOME Desktop"
3、在本机系统(即linux物理系统)启动桌面,不可以在secureCRT界面启动;注意下面新加的oracle用户要成功启动桌面,需要重启系统
[[email protected] ~]# startx
4、检查Oracle所需包环境是否满足,也可以不检查直接安装必须包,如果已经有的了,系统就不会安装了
[[email protected] ~]# rpm -qa binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel
5、安装必须包
[[email protected] ~]# yum -y install kernel-headers* [[email protected] ~]# yum -y install gcc-c++* [[email protected] ~]# yum -y install numactl-devel* [[email protected] ~]# yum -y install glibc-headers* [[email protected] ~]# yum -y install glibc-common* [[email protected] ~]# yum -y install binutils* [[email protected] ~]# yum -y install unixODBC-devel* [[email protected] ~]# yum -y install libaio* [[email protected] ~]# yum -y install make* [[email protected] ~]# yum -y install elfutils-libelf* [[email protected] ~]# yum -y install elfutils-libelf-devel* [[email protected] ~]# yum -y install sysstat* [[email protected] ~]# yum -y install glibc-static* [[email protected] ~]# yum -y install glibc-devel* [[email protected] ~]# yum -y install glibc* [[email protected] ~]# yum -y install elfutils-libelf-devel-static* [[email protected] ~]# yum -y install libaio* [[email protected] ~]# yum -y install gcc* [[email protected] ~]# yum -y install libgcc* [[email protected] ~]# yum -y install libstdc++-static* [[email protected] ~]# yum -y install libaio-devel* [[email protected] ~]# yum -y install libstdc++* [[email protected] ~]# yum -y install libaio-devel* [[email protected] ~]# yum -y install unixODBC* [[email protected] ~]# yum -y install libstdc++-devel* [[email protected] ~]# yum -y install compat-libstdc++* [[email protected] ~]# yum -y install libgcc* [[email protected] ~]# yum -y install libgomp* 又查找补充的包
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
6、创建两个用户组
[[email protected] ~]# groupadd dba [[email protected] ~]# groupadd oinstall
7、添加一个oracle用户,并添加到dba和oinstall两个组内;然后再设置oracle用户密码(-m作用是创建用户登录目录)
[[email protected] ~]# useradd -m -g oinstall -G dba oracle [[email protected] ~]# passwd oracle
8、创建安装目录,并修改目录附属于oralce用户及oinstall用户组(-p作用是创建目录及其子目录,-R处理目录及其子目录)
[[email protected] ~]# mkdir -p /opt/oracle/product/11gR2 [[email protected] ~]# chown -R oracle:oinstall /opt/oracle [[email protected] ~]# mkdir /opt/oraInventory
[[email protected] ~]# chown -R oracle:oinstall /opt/oraInventory
9、添加环境变量,这时要切换到oralce用户下,并在主目录下编辑.bash_profile文件
[[email protected] ~]# su oracle - [[email protected] root]$ cd ~ [[email protected] ~]$ vim .bash_profile
环境变量文件如下
export ORACLE_HOME=$ORACLE_BASE/product/11gR2 # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/.local/bin:$HOME/bin export PATH export ORACLE_BASE=/opt/oracle export ORACLE_HOME=$ORACLE_BASE/product/11gR2 export ORACLE_SID=orcl export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export NLS_LANG="SIMPLIFIED CHINESE_CHINA.AL32UTF8" ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ".bash_profile" 24L, 451C written
10、使文件立即生效
[[email protected] ~]$ . .bash_profile
11、官网下载linux.x64_11gR2_database_1of2.zip和linux.x64_11gR2_database_2of2.zip两个文件上传至centos系统/tmp文件夹下
windows与linux互传文件软件,我用的是FlashFXP ,在快速连接中,选择的连接方式为SFTP over SSH
12、上传完成后,切换到/tmp目录下,unzip解压,如果没有unzip命令,切换回root用户,yum安装,此处已有
[[email protected] tmp]$ unzip linux.x64_11gR2_database_1of2.zip [[email protected] tmp]$ unzip linux.x64_11gR2_database_2of2.zip
13、进入物理系统,重启后,oralce用户登入,使用命令startx,启动桌面
[[email protected] ~]$ startx
14、进入桌面后,打开oracle解压后的database文件夹,找到runInstaller文件,在该文件夹空白处右键打开终端命令窗口,如下图
15、在终端内执行runInstaller命令,开始安装oralce数据库
[[email protected] database]$ ./runInstaller
16、安装时候选择server class项、advance、只安装软件(sofy only)
17、安装过程中会出现如下情况,将鼠标移至小竖线出,可以拉伸出弹出窗,或者右键close掉
18、先创建监听才能创建数据库
[[email protected] Desktop]$ netca
19、安装成功后创建数据库,依然在桌面操作,右键打开终端
[[email protected] Desktop]$ dbca
20、global database name那填orcl(与前面配置对应)
21、下面就是自定义配置,详情就百度吧
创建示例表(去除冗余数据,可以不创建,此处创建是因为做案例)
内存调优
修改字符集
一路next到finish
下面测试数据库
1、依然在终端,启动监听
lsnrctl start
2、进入SQLPlus,连接数据库
[[email protected] Desktop]$ sqlplus /nolog SQL> conn sys/密码@orcl as sysdba