700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Linux 7中安装达梦数据库DM7

Linux 7中安装达梦数据库DM7

时间:2023-03-08 13:47:43

相关推荐

Linux 7中安装达梦数据库DM7

一安装前准备工作

1.1检查Linux(Unix)系统信息

用户在安装DM前,需要检查当前操作系统的相关信息,确认DM安装程序与当前操作系统匹配,以保证DM能够正确安装和运行。用户可以使用以下命令检查操作系统基本信息。如下图所示:

#获取系统位数

[root@cs1~]#getconfLONG_BIT64

#查询操作系统release信息

[root@cs1~]#cat/etc/oracle-releaseOracleLinuxServerrelease7.1

#查询系统信息

[root@cs1~]#cat/etc/issueOracleLinuxServerrelease7.1Kernel\ronan\m

#查询系统名称

[root@cs1~]#uname-3.8.13-55.1.6.el7uek.x86_64#2SMPWedFeb1114:18:22PSTx86_64x86_64x86_64GNU/Linux

1.2创建安装用户

为了减少对操作系统的影响,用户不应该以root系统用户来安装和运行DM。用户可以在安装之前为DM创建一个专用的系统用户。

1. 创建安装用户组dinstall。

[root@cs1soft]#groupadddinstall

2. 创建安装用户dmdba。

[root@cs1soft]#useradd-gdinstall-m-d/home/dmdba-s/bin/bashdmdba

3. 初始化用户密码。

[root@cs1soft]#passwddmdbaChangingpasswordforuserdmdba.Newpassword:Retypenewpassword:passwd:allauthenticationtokensupdatedsuccessfully.。

注意:创建安装系统用户完成后,安装手册之后的操作默认使用安装系统用户进行操作。

1.3 Linux(Unix)下检查操作系统限制

在Linux(Unix)系统中,因为ulimit命令的存在,会对程序使用操作系统资源进行限制。为了使DM能够正常运行,建议用户检查当前安装用户的ulimit参数。

运行ulimit -a进行查询。如下图所示:

[root@cs1~]#ulimit-acorefilesize(blocks,-c)0datasegsize(kbytes,-d)unlimitedschedulingpriority(-e)0filesize(blocks,-f)unlimitedpendingsignals(-i)61672maxlockedmemory(kbytes,-l)64maxmemorysize(kbytes,-m)unlimitedopenfiles(-n)1024pipesize(512bytes,-p)8POSIXmessagequeues(bytes,-q)819200real-timepriority(-r)0stacksize(kbytes,-s)8192cputime(seconds,-t)unlimitedmaxuserprocesses(-u)61672virtualmemory(kbytes,-v)unlimitedfilelocks(-x)unlimited

参数使用限制:

1.data seg size

data seg size (kbytes, -d) 建议用户设置为1048576(即1GB)以上或unlimited(无限制),此参数过小将导致数据库启动失败。

2. file size

file size(blocks, -f) 建议用户设置为unlimited(无限制),此参数过小将导致数据库安装或初始化失败。

3. open files

open files(-n)建议用户设置为65536以上或unlimited(无限制)。

4.virtual memory

virtual memory (kbytes, -v) 建议用户设置为1048576(即1GB)以上或unlimited(无限制),此参数过小将导致数据库启动失败。

如果用户需要为当前安装用户更改ulimit的资源限制,请修改文件/etc/security/limits.conf。

[root@cs1~]#su-dmdbaLastlogin:MonJul2321:22:56CSTonpts/1su:cannotopensession:Permissiondenied[root@cs1~]#ulimit-acorefilesize(blocks,-c)0datasegsize(kbytes,-d)unlimitedschedulingpriority(-e)0filesize(blocks,-f)unlimitedpendingsignals(-i)61672maxlockedmemory(kbytes,-l)64maxmemorysize(kbytes,-m)unlimitedopenfiles(-n)1024pipesize(512bytes,-p)8POSIXmessagequeues(bytes,-q)819200real-timepriority(-r)0stacksize(kbytes,-s)8192cputime(seconds,-t)unlimitedmaxuserprocesses(-u)61672virtualmemory(kbytes,-v)unlimitedfilelocks(-x)unlimited[root@cs1~]#vi/etc/security/limits.confdmdbasoftdataunlimiteddmdbaharddataunlimiteddmdbasoftfsizeunlimiteddmdbahardfsizeunlimiteddmdbasoftnofile65536dmdbahardnofile65536[root@cs1~]#su-dmdbaLastlogin:MonJul2321:23:10CSTonpts/1[dmdba@cs1~]$ulimit-acorefilesize(blocks,-c)0datasegsize(kbytes,-d)unlimitedschedulingpriority(-e)0filesize(blocks,-f)unlimitedpendingsignals(-i)61672maxlockedmemory(kbytes,-l)64maxmemorysize(kbytes,-m)unlimitedopenfiles(-n)65536pipesize(512bytes,-p)8POSIXmessagequeues(bytes,-q)819200real-timepriority(-r)0stacksize(kbytes,-s)8192cputime(seconds,-t)unlimitedmaxuserprocesses(-u)4096virtualmemory(kbytes,-v)unlimitedfilelocks(-x)unlimited

可以通过命令unlimit进行设置

[dmdba@cs1~]$ulimit-acorefilesize(blocks,-c)0datasegsize(kbytes,-d)unlimitedschedulingpriority(-e)0filesize(blocks,-f)unlimitedpendingsignals(-i)61672maxlockedmemory(kbytes,-l)64maxmemorysize(kbytes,-m)unlimitedopenfiles(-n)65536pipesize(512bytes,-p)8POSIXmessagequeues(bytes,-q)819200real-timepriority(-r)0stacksize(kbytes,-s)8192cputime(seconds,-t)unlimitedmaxuserprocesses(-u)4096virtualmemory(kbytes,-v)unlimitedfilelocks(-x)unlimited[dmdba@cs1~]$ulimit-cunlimited[dmdba@cs1~]$ulimit-acorefilesize(blocks,-c)unlimiteddatasegsize(kbytes,-d)unlimitedschedulingpriority(-e)0filesize(blocks,-f)unlimitedpendingsignals(-i)61672maxlockedmemory(kbytes,-l)64maxmemorysize(kbytes,-m)unlimitedopenfiles(-n)65536pipesize(512bytes,-p)8POSIXmessagequeues(bytes,-q)819200real-timepriority(-r)0stacksize(kbytes,-s)8192cputime(seconds,-t)unlimitedmaxuserprocesses(-u)4096virtualmemory(kbytes,-v)unlimitedfilelocks(-x)unlimited

1.4检查系统内存与存储空间

1.检查内存

为了保证DM的正确安装和运行,要尽量保证操作系统至少1GB的可用内存(RAM)。如果可用内存过少,可能导致DM安装或启动失败。用户可以使用以下命令检查操作内存:

#获取内存总大小

[root@cs1~]#grepMemTotal/proc/meminfoMemTotal:7914692kB

#获取交换分区大小

[root@cs1~]#grepSwapTotal/proc/meminfoSwapTotal:8257532kB

#获取内存使用详情

[root@cs1~]#freetotalusedfreesharedbuff/cacheavailableMem:79146922736024837368274445643413002162354Swap:825753211328527124680

2.检查存储空间

1) DM完全安装需要1GB的存储空间,用户需要提前规划好安装目录,预留足够的存储空间。用户在DM安装前也应该为数据库实例预留足够的存储空间,规划好数据路径和备份路径。用户可使用以下命令检查存储空间:

#查询目录/mount_point/dir_name可用空间

[root@cs1~]#df-h/FilesystemSizeUsedAvailUse%Mountedon/dev/mapper/ol-root72G47G26G65%/

2) DM安装程序在安装时将产生临时文件,临时文件需要1GB的存储空间,临时文件目录默认为/tmp。用户可以使用以下命令检查存储空间。如下图所示:

[root@cs1~]#df-h/tmpFilesystemSizeUsedAvailUse%Mountedon/dev/mapper/ol-root72G47G26G65%/

如果/tmp目录不能保证1GB的存储空间,用户可以扩展/tmp目录存储空间或者通过设置环境变量DM_INSTALL_TMPDIR指定安装程序的临时目录。具体命令如下所示:

#以BASH为例:

mkdir-p/mount_point/dir_nameDM_INSTALL_TMPDIR=/mount_point/dir_nameexportDM_INSTALL_TMPDIR

二.安装DM

用户应登录或切换到安装系统用户,进行以下安装步骤的操作(注:不建议使用root系统用户进行安装)。将DM上传到/soft目录中,然后解压软件包

[root@cs1soft]#unzipDM_linux64.zipArchive:DM_linux64.zipinflating:dm7_setup_neokylin6_64_0209.iso[root@cs1soft]#ls-lrt-rw-r--r--1rootroot493170688Mar1911:24dm7_setup_neokylin6_64_0209.iso-rw-r--r--1rootroot488814959Jul:04DM_linux64.zip

创建目录/soft/dm_soft用来存储挂载iso文件后来显示软件包中的文件

[root@cs1soft]#mkdirdm_soft[root@cs1soft]#mount-tiso9660-oloopdm7_setup_neokylin6_64_0209.iso/soft/dm_soft[root@cs1dm_soft]#ls-lrttotal481250-r-xr-xr-x1rootroot2207674Feb915:00DM_Install_zh.pdf-r-xr-xr-x1rootroot2266249Feb915:00DM_Install_en.pdf-r-xr-xr-x1rootroot959Feb915:01release_zh.txt-r-xr-xr-x1rootroot854Feb915:01release_en.txt-r-xr-xr-x1rootroot488322747Feb916:17DMInstall.bin

在/soft/dm_soft目录下存在DMInstall.bin文件, DMInstall.bin文件就是DM的安装程序。在运行安装程序前,需要赋予DMInstall.bin文件执行权限。具体命令如下所示:

[root@cs1dm_soft]#chmod755DMInstall.bin

2.1图形界面安装

[root@cs1Desktop]#xhost+accesscontroldisabled,clientscanconnectfromanyhost[root@cs1Desktop]#su-dmdbaLastlogin:MonJul2321:47:18CSTonpts/0[dmdba@cs1~]$exportDISPLAY=:1[dmdba@cs1dm_soft]$./DMInstall.bin

当安装进度完成时将会弹出对话框,提示使用root系统用户执行相关命令。用户可根据对话框的说明完成相关操作,之后可关闭此对话框,点击“完成”按钮结束安装

[root@cs1/]#./dm_home/dmdba/dmdbms/script/root/root_installer.shMove/dm_home/dmdba/dmdbms/bin/dm_svc.confto/etcModifythefiles'modeofDMServerCreatetheDmAPServiceserviceln-s'/usr/lib/systemd/system/DmAPService.service''/etc/systemd/system/multi-user.target.wants/DmAPService.service'Finishedtocreatetheservice(DmAPService)StarttheDmAPServiceservice

2.2初始化数据库

[root@cs1/]#mv/dm_home/dmdba/dmdbms/bin/DmServicejydm.service/usr/lib/systemd/system/DmServicejydm.service[root@cs1/]#systemctlenableDmServicejydm.serviceln-s'/usr/lib/systemd/system/DmServicejydm.service''/etc/systemd/system/multi-user.target.wants/DmServicejydm.service'[root@cs1/]#systemctlstartDmServicejydm.service

使用客户端工具来登录数据库来验证安装是否成功

到此,在Oracle Linux 7中安装达梦7就完成,对熟悉Oracle的朋友来说学习达梦数据库还是很容易上手的。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。