CenOs7 install oracle graphic detail the process (02) CenOs7 install oracle graphic detail the process (02)

 

Original works, reproduced (in a prominent position) indicate the source in the article head: https: //www.cnblogs.com/sunshine5683/p/10011574.html 

8, limits the user to modify

vim /etc/security/limits.conf

oracle          soft    nproc  2047
oracle          hard    nproc  16384
oracle          soft    nofile  1024
oracle          hard    nofile  65536

 

9, modify user authentication options

vim /etc/pam.d/login

session required /lib64/security/pam_limits.so
session required pam_limits.so

 

10, modify user profiles

Copy the code
vim /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
Copy the code

11, modify the user

Copy the code
the /home/oracle/.bash_profile vim 

Export ORACLE_BASE = / usr / local / #oracle the Oracle database installation directory 
export ORACLE_HOME = $ ORACLE_BASE / product #oracle database path 
export ORACLE_SID = orcl #oracle # Start the database instance name 
export ORACLE_TERM = xterm #xterm window mode installation 
export PATH = $ ORACLE_HOME / bin: / usr / sbin: $ PATH # Add system environment variable 
export LD_LIBRARY_PATH = $ ORACLE_HOME / lib: / lib: / usr / lib # Add the system environment variable 
export LANG = C # prevent the installation process garbled 
Export AMERICAN_AMERICA.ZHS16GBK the NLS_LANG = 

# set the Oracle client character set, character set must be installed when consistent with Oracle,
Copy the code

12. Create a directory mkdir -p / usr / local / oracle / product

Copy the code
chown -R oracle:oinstall  /usr/local/oracle/
source /home/oracle/.bash_profile

Note: The default cloud machine can not be used ctrl + alt + f7 to switch to a graphical interface, and no gnom table, so in order to identify> 256color, the following operations

yum groupinstall "X Window System"

## yum groupinstall "GNOME Desktop" // I tried, the comment section may not install, you can try

yum install xdpyinfo xorg-x11-server-utils-7.7-14.el7 # tigervnc-server // NA can not install vnc service

##(root)vncserver && 密码=vncserveradmin && export DISPLAY=localhost:1

## xhost + // all IP can intervene

Copy the code

 

Whether 13, oracle user login, and test environment variable success

su - the Oracle 

env | grep ORA // check the environment variable is set to take effect

14, download oracle, and install

linux.x64_11gR2_database_1of2.zip

linux.x64_11gR2_database_2of2.zip

《《《《《

Reference herein connection: https: //www.linuxidc.com/Linux/2012-10/71707.htm

 Save the downloaded file to the u disk or other media, and then use the rz command uploads here to episode, talk about the uploading and downloading commands:

 01, first of all connectivity tools used here is SecureCRT.

 02, lrzsz is a tool with upload and download SecureCRT use, you can easily transfer files between your local PC and the remote server. lrzsz installation is very easy to get it from the installation disk or yum source on the Internet.

 03, the above phenomenon can be seen, probably not installing the package: Package sz, rz command what is needed is lrzsz. 

Try to download using sc

[root@server ~]# sz /etc/samba/smb.conf

-bash: sz: command not found

Check the following packages are installed?

[root@server]# rpm -qa |grip sz

-bash: grip: command not found

Installation package (automatically installed with yum :)

[root@server]# yum -y install lrzsz

 

The installation is complete!

Configuration upload and download directory:

Select a session (option) tag, right click, the pop-up menu, select the session option (session options), as shown below, set upload and download directory

download:

Enter the command sz /etc/samba/smb.conf, so put the specified file downloaded to the specified directory before.

[root@server ~]# sz /etc/samba/smb.conf

rz

zmodem trl+C ȡ

100%      11 KB  11 KB/s 00:00:01      0 Errors

Upload:

Enter rz, pop-up dialog box to select upload file, click OK.

[root@server ~]# rz

rz waiting to receive.

 zmodem trl+C ȡ

OK!

Configuration complete!

》》》》》

 

15, using the upload, then upload the current directory after the upload command using the directory which is in which directory

 Encounter many problems during file uploads, first spread to about 80% of the time got stuck, so every time, then found a lot, some say use rz -e, rz -d, etc., used rz -de upload, equally stuck, occasionally an error does not match the connection errors such as keys, use df -h to view space, the remaining space is enough, but unfortunately the last, use winscp tool successfully uploaded 

 

16, extract the installation:

 Into the directory where the file, unzip the file:

  #unzip  linux.x64_11gR2_database_1of2.zip

  #unzip linux.x64_11gR2_database_2of2.zip

Waiting for decompression complete ..............

 

 

17, extraction is completed, enter the installation. At this time, after the extraction is completed this will have a database directory folder, enter the directory

The installation command: List the part of the installation information, select y to begin the installation

It found that the installation fails, the failure information:

看上面英文,提示是因为当前用户oracle没有授权使用X Server.需要授权。如下解决办法:
以root登录,执行命令xhost  +  .
# su - root
#xhost + 
access control disabled,clients can connect from any host

表示成功,但是此处执行显示:

xhost +不能执行,可以输入命令export DISPLAY=:0执行一下

再执行xhost +

可以看到成功执行,此时切换到oracle,继续安装

#su - oracle
$./runInstall

如果空间充足,则至此可以调出oracle安装界面,正式安装(亲测)。

但是此处空间设置太小,当初考虑太少了

所以出现错误,提示空间不足

查看:可以看到根目录爆满,然后将/home/oracle目录下的两个oracle安装文件压缩包删除,腾出了部分空间,我次处是使用的vmware搭建的linux系统,最大空间分配太少,只有30G,所以爆满也是情理之中

18、清理完成后,可以看到有3G左右的空间了,接下来可以继续安装,运行一下下面命令,以将部分还没有安装的组件进行安装

Copy the code
yum install -y compat-libstdc*
 
yum install -y elfutils-libelf*
 
yum install -y gcc*
 
yum install -y glibc*
 
yum install -y ksh*
 
yum install -y libaio*
 
yum install -y libgcc*
 
yum install -y libstdc*
 
yum install -y make*
 
yum install -y sysstat*
 

yum install libXp* -y
 
yum install -y glibc-kernheaders
Copy the code

19、进行安装,可以看到熟悉的界面出来了

 

 20、去掉I wish to receive security updates via My Oracle Surrport选项,点击Next。

 

21、选择Install database software only,点击Next。

22、选择Single instance database installation,点击Next。

 

23、添加语言,在Available Languages中点选English、点击两个框中间的>,将选中的语言加入到右边的Selected Languages中,然后点击Next。

24、默认安装版本企业版-Enterprise Edition

 

25、确定数据软件的安装路径,自动读取前面/home/Oracle/.bash_profile 中配置的值。

26、选择安装日志目录,选择dba组,如下图所示:

 

 

27、此时弹出如下错误,即找不到目录

28、手动查找目录确实找不到,然后手动新建目录并授予权限,问题解决

# mkdir /usr/local/oraInventory

# chown oracle:oinstall oraInventory

 

29、下一步

30、下一步

31、可以看到此时报错,多次重新检查还是报错(多检查几次,如果错误相同,再查)

32、错误可能是因为系统版本问题,此时忽略掉

33、选择Ignore All,点击下一步

34、点击finish等待安装完成

35、又是报错,点击continue

36、继续安装,弹出如下:点击ok

37、可以看到安装完成

38、同时,在控制台输出如下信息

39、连接数据库

命令:su - oracle -c 'sqlplus / as sysdba'

40、启动数据库,又开始报错

41、继续

oracle安装好后不能直接登录,需要单独配置数据库,让sysdba有库可登入。另外还需配置监听端口1521,为了客户登入,一般默认开启

42、配置监听服务 和 数据库

----执行netmgr  (配置你创建的监听服务配置,监听你创建的数据库实例)

----命令netca  (主要用来配置监听和配置NET服务名,以便远程连接数据库。)

----执行 dbca (创建数据库、配置现有库选项、删除数据库、管理模板=configretion assistant)

继续错误接上

43、查询资料后使用命令:

oracle@root:~> export DISPLAY=127.0.0.1:1.0

 

注意:如果上述步骤不能够调出图形界面,则根据下面方法,如果调出,则忽略:

 

 

44、然后在主机console中运行 dbca(在crt中运行还是报错,set DISPLAY environment variable)

 

 45、开始创建数据库

46、下一步

47、下一步

48、选择第二项,下一步,设置全局数据库名

49、下一步

50、下一步,接着报错

51.1 根据错误提示解决

51.2、下一步

51.3 下一步

51.4 下一步

51.5 下一步

51.6 下一步

51.7 下一步

51.8 下一步

51.9 完成

 

52、继续数据库安装下一步,可以看到顺利通过

53、同意使用一个密码,输入密码,点击下一步

54、此处提示是否确认,直接点击yes

55、数据库文件安装的位置,选择 oracle/data_ora 下

55.1 新建 /home/oracle/data_ora目录,并授权

55.2 选择该目录

56、下一步,选择备份快速恢复的目录

57、下一步

58 下一步,设置字符集,下一步

59 显示概要信息,下一步

60、选择generate databasecreation scripts  点击完成

 

 61、显示概要信息

62、点击ok

63、弹出如下信息,点击ok

64、弹出如下报错信息

64、创建该目录并授权

# mkdir /etc/oratab

#chown -R oracle.oinstall /etc/oratab

65、然后点击ok,开始安装

66、等待安装完成,整整等了我一个半小时后,貌似又报错了,卡死在下面界面

67、点击ok,等一会

68、点击exit退出

然后在linux自带的console中连接,可以看到连接成功,在crt控制台同样可以看到连接成功

67、测试数据库,新建表,插入数据,查询数据

 

 至此,centos7上搭建oracle数据库已全部结束,在这用时两天的测试中,查询很多资料,也学到很多,所以对每一步的细节都做了详细的记录,希望能够在下次需要的时候快速解决问题,同时也希望能够帮到其他初学者

 

也欢迎各位的批评指正和宝贵意见,如果有可以改进的地方或者更好的脚本,希望能在评论区贴出来,大家共同参考学习,共同进步!

 

原创作品,转载请在文章头部(显眼位置)注明出处:https://www.cnblogs.com/sunshine5683/p/10011574.html 

 

原创作品,转载请在文章头部(显眼位置)注明出处:https://www.cnblogs.com/sunshine5683/p/10011574.html 

8、修改用户限制

vim /etc/security/limits.conf

oracle          soft    nproc  2047
oracle          hard    nproc  16384
oracle          soft    nofile  1024
oracle          hard    nofile  65536

 

9、修改用户验证选项

vim /etc/pam.d/login

session required /lib64/security/pam_limits.so
session required pam_limits.so

 

10、修改用户配置文件

Copy the code
vim /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
Copy the code

11、修改用户

Copy the code
vim  /home/oracle/.bash_profile

export ORACLE_BASE=/usr/local/oracle     #oracle数据库安装目录
export ORACLE_HOME=$ORACLE_BASE/product    #oracle数据库路径
export ORACLE_SID=orcl #oracle      #启动数据库实例名
export ORACLE_TERM=xterm       #xterm窗口模式安装
export PATH=$ORACLE_HOME/bin:/usr/sbin:$PATH    #添加系统环境变量
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib    #添加系统环境变量
export LANG=C    #防止安装过程出现乱码
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

#设置Oracle客户端字符集,必须与Oracle安装时设置的字符集保持一致,
Copy the code

12、创建目录mkdir -p /usr/local/oracle/product

Copy the code
chown -R oracle:oinstall  /usr/local/oracle/
source /home/oracle/.bash_profile

注:云机器默认无法用ctrl+alt+f7切换至图形界面,而且无gnom桌面,所以为了识别>256color,进行以下操作

yum groupinstall "X Window System"

##yum groupinstall "GNOME Desktop" //我试了下,注释部分不安装也可,你也可以试试

yum install xdpyinfo xorg-x11-server-utils-7.7-14.el7 #tigervnc-server //不适用vnc可以不安装服务

##(root)vncserver && 密码=vncserveradmin && export DISPLAY=localhost:1

##xhost + //让所有IP可以介入

Copy the code

 

13、oracle用户登录,并测试环境变量是否成功

su - oracle

env | grep ORA   //检查环境变量是否设置生效

14、下载oracle,并安装

linux.x64_11gR2_database_1of2.zip

linux.x64_11gR2_database_2of2.zip

《《《《《

此处参考连接:https://www.linuxidc.com/Linux/2012-10/71707.htm

 将下载好的文件保存到u盘或者其他介质上,然后使用rz命令上传,此处来个插曲,说说上传下载命令:

 01、首先这里连接使用的工具是SecureCRT。

 02、lrzsz是一个搭配SecureCRT使用的上传下载工具,能方便的在本地PC机和远程服务器之间传输文件。 lrzsz的安装很方便,以从系统安装盘或者是互联网上的 yum源中得到它。

 03、上述现象可知,很可能没有安装相应的软件包:sz 、rz  命令所需要的软件包是lrzsz 。 

使用sc试试能够下载

[root@server ~]# sz /etc/samba/smb.conf

-bash: sz: command not found

下面检查软件包是否安装?

[root@server]# rpm -qa |grip sz

-bash: grip: command not found

安装软件包(使用yum自动安装:)

[root@server]# yum -y install lrzsz

 

安装完成!

配置上传下载目录:

选择某个session(选项) 标签,点鼠标右键,弹出菜单,选择session option(会话选项),如下图,设置上传和下载目录

下载:

输入命令sz /etc/samba/smb.conf,这样就把指定的文件下载到之前指定目录。

[root@server ~]# sz /etc/samba/smb.conf

rz

zmodem trl+C ȡ

100%      11 KB  11 KB/s 00:00:01      0 Errors

上传:

输入rz,会弹出对话框来选择上传文件,点确定即可。

[root@server ~]# rz

rz waiting to receive.

 zmodem trl+C ȡ

OK!

配置完成!

》》》》》

 

15、使用上述方式上传,那么上传后的目录为当前在哪个目录下使用上传命令就是哪个目录

 在文件上传的过程中遇到很多问题,首先是传到80%左右的时候就卡住了,每次都是如此,然后搜了很多,有些说使用rz -e,rz -d等,使用了rz -de上传,同样卡死,偶尔还是报错连接秘钥不符等错误,使用df -h 查看空间,剩余空间足够,最后无奈,使用winscp工具成功上传 

 

16、解压安装:

 进入到文件所在目录下,解压文件:

  #unzip  linux.x64_11gR2_database_1of2.zip

  #unzip linux.x64_11gR2_database_2of2.zip

等待解压完成..............

 

 

17、解压完成,进入安装。此时解压完成后再此目录下会有个database文件夹,进入该目录

执行安装命令:列出部分安装信息,选择y开始安装

发现安装失败,失败信息为:

看上面英文,提示是因为当前用户oracle没有授权使用X Server.需要授权。如下解决办法:
以root登录,执行命令xhost  +  .
# su - root
#xhost + 
access control disabled,clients can connect from any host

表示成功,但是此处执行显示:

xhost +不能执行,可以输入命令export DISPLAY=:0执行一下

再执行xhost +

可以看到成功执行,此时切换到oracle,继续安装

#su - oracle
$./runInstall

如果空间充足,则至此可以调出oracle安装界面,正式安装(亲测)。

但是此处空间设置太小,当初考虑太少了

所以出现错误,提示空间不足

查看:可以看到根目录爆满,然后将/home/oracle目录下的两个oracle安装文件压缩包删除,腾出了部分空间,我次处是使用的vmware搭建的linux系统,最大空间分配太少,只有30G,所以爆满也是情理之中

18、清理完成后,可以看到有3G左右的空间了,接下来可以继续安装,运行一下下面命令,以将部分还没有安装的组件进行安装

Copy the code
yum install -y compat-libstdc*
 
yum install -y elfutils-libelf*
 
yum install -y gcc*
 
yum install -y glibc*
 
yum install -y ksh*
 
yum install -y libaio*
 
yum install -y libgcc*
 
yum install -y libstdc*
 
yum install -y make*
 
yum install -y sysstat*
 

yum install libXp* -y
 
yum install -y glibc-kernheaders
Copy the code

19、进行安装,可以看到熟悉的界面出来了

 

 20、去掉I wish to receive security updates via My Oracle Surrport选项,点击Next。

 

21、选择Install database software only,点击Next。

22、选择Single instance database installation,点击Next。

 

23、添加语言,在Available Languages中点选English、点击两个框中间的>,将选中的语言加入到右边的Selected Languages中,然后点击Next。

24、默认安装版本企业版-Enterprise Edition

 

25、确定数据软件的安装路径,自动读取前面/home/Oracle/.bash_profile 中配置的值。

26、选择安装日志目录,选择dba组,如下图所示:

 

 

27、此时弹出如下错误,即找不到目录

28、手动查找目录确实找不到,然后手动新建目录并授予权限,问题解决

# mkdir /usr/local/oraInventory

# chown oracle:oinstall oraInventory

 

29、下一步

30、下一步

31、可以看到此时报错,多次重新检查还是报错(多检查几次,如果错误相同,再查)

32、错误可能是因为系统版本问题,此时忽略掉

33、选择Ignore All,点击下一步

34、点击finish等待安装完成

35、又是报错,点击continue

36、继续安装,弹出如下:点击ok

37、可以看到安装完成

38、同时,在控制台输出如下信息

39、连接数据库

命令:su - oracle -c 'sqlplus / as sysdba'

40、启动数据库,又开始报错

41、继续

oracle安装好后不能直接登录,需要单独配置数据库,让sysdba有库可登入。另外还需配置监听端口1521,为了客户登入,一般默认开启

42、配置监听服务 和 数据库

----执行netmgr  (配置你创建的监听服务配置,监听你创建的数据库实例)

----命令netca  (主要用来配置监听和配置NET服务名,以便远程连接数据库。)

----执行 dbca (创建数据库、配置现有库选项、删除数据库、管理模板=configretion assistant)

继续错误接上

43、查询资料后使用命令:

oracle@root:~> export DISPLAY=127.0.0.1:1.0

 

注意:如果上述步骤不能够调出图形界面,则根据下面方法,如果调出,则忽略:

 

 

44、然后在主机console中运行 dbca(在crt中运行还是报错,set DISPLAY environment variable)

 

 45、开始创建数据库

46、下一步

47、下一步

48、选择第二项,下一步,设置全局数据库名

49、下一步

50、下一步,接着报错

51.1 根据错误提示解决

51.2、下一步

51.3 下一步

51.4 下一步

51.5 下一步

51.6 下一步

51.7 下一步

51.8 下一步

51.9 完成

 

52、继续数据库安装下一步,可以看到顺利通过

53、同意使用一个密码,输入密码,点击下一步

54、此处提示是否确认,直接点击yes

55、数据库文件安装的位置,选择 oracle/data_ora 下

55.1 新建 /home/oracle/data_ora目录,并授权

55.2 选择该目录

56、下一步,选择备份快速恢复的目录

57、下一步

58 下一步,设置字符集,下一步

59 显示概要信息,下一步

60、选择generate databasecreation scripts  点击完成

 

 61、显示概要信息

62、点击ok

63、弹出如下信息,点击ok

64、弹出如下报错信息

64、创建该目录并授权

# mkdir /etc/oratab

#chown -R oracle.oinstall /etc/oratab

65、然后点击ok,开始安装

66、等待安装完成,整整等了我一个半小时后,貌似又报错了,卡死在下面界面

67、点击ok,等一会

68、点击exit退出

然后在linux自带的console中连接,可以看到连接成功,在crt控制台同样可以看到连接成功

67、测试数据库,新建表,插入数据,查询数据

 

 至此,centos7上搭建oracle数据库已全部结束,在这用时两天的测试中,查询很多资料,也学到很多,所以对每一步的细节都做了详细的记录,希望能够在下次需要的时候快速解决问题,同时也希望能够帮到其他初学者

 

也欢迎各位的批评指正和宝贵意见,如果有可以改进的地方或者更好的脚本,希望能在评论区贴出来,大家共同参考学习,共同进步!

 

Original works, reproduced (in a prominent position) indicate the source in the article head: https: //www.cnblogs.com/sunshine5683/p/10011574.html 

Guess you like

Origin www.cnblogs.com/isme-zjh/p/11449137.html
Recommended