版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
OraclellgR2数据库安装指南
文档作者:王锐
创建日期:
确认日期:
控制编码:
1.概述错误!未定义书签。
2.系统环境配置错误!未定义书签。
2.1.硬件环境检查及配置错误!未定义书签。
2.2.软件环境检查及配置错误!未定义书签。
3.安装Gridinfrastructure错误!未定义书签。
4.安装Database软件错误!未定义书签。
5.创建数据库实例错误!未定义书签。
6.验证数据库状态错误!未定义书签。
1.概述
本文档的目的是为了给出Oracle1lgR2数据库在ECSSSD上的安装配置示例。便于用户在阿里
云环境部署Oracle数据库支撑环境。本次安装所采用的系统平台OS:CentOS6.5,ORACLE数据库为
llgR2数据库。
2.系统环境配置
硬件:ECS高级配置,16核、64GB内存、20GB本地存储、4块SSD存储(100GB1块,200GB3
块)
软件:阿里云CentOS6.5,Oracle11gR2(grid+database+ASM,建议11gR2最新版本
)
2.1.硬件环境检查及配置
1.检查内存和SWAP
检查内存:最少2GB,实际上OS自身就需要1GB多,数据库本身需要2GB以上,所以实际内存至
少4GB以上。
#grepMemTotal/proc/meminfo
#grepSwapTotal/proc/meminfo
配置SWAP:ECS缺省SWAP没有配置。
AvailableRAMSwapSpaceRequired
Between1GBand2GB1.5timesthesizeoftheRAM
Between2GBand16GBEqualtothesizeoftheRAM
Morethan16GB16GB
由于ECS只提供20GB本地盘,所以建议挂载一块SATA磁盘作为软件安装和SWAP空间。建议磁盘
大小为25GB以上(SWAP16GB,Orac为5GB,Grid3.5GB)0可以参考:
ttfdisk-1
[root@iz23pbxddnmz〜]#fdisk-1
Disk/dev/xvda:21.5GB,21474836480bytes
255heads,63sectors/track,2610cylinders
Units=cylindersof16065*512=8225280bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Diskidentifier:0x00078f9c
Id
DeviceBootstartEndBlocks83system
/dev/xvdal*1261120970496Linux
Disk/dev/xvdb:214.7GB,214748364800bytes
255heads,63sectors/track,26108cylinders
Units=cylindersof16065*512=8225280bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Diskidentifier:0x00000000
Disk/dev/xvdc:214.7GB,214748364800bytes
255heads,63sectors/track,26108cylinders
units=cylindersof16065*512=8225280bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Diskidentifier:0x00000000
Disk/dev/xvdd:214.7GBV214748364800bytes
255heads,63sectors/track,26108cylinders
units=cylindersof16065*512=8225280bytes
sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Diskidentifier:0x00000000
Disk/dev/xvde:107.4GB,107374182400bytes
255heads,63sectors/track,13054cylinders
Units=cylindersof16065*512=8225280bytes
Sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Diskidentifier:0x00000000
Sfdisk/dev/xvde
[root@iz23pbxddnmz〜]#fdisk/dev/xvde
DevicecontainsneitheravalidDOSpartitiontabie,norsun,SGIorOSFdiskiabel
BuildinganewDOSdiskiabelwithdiskidentifier0x4c0436c3.
Changeswillremaininmemoryonly,unti1youdecidetowritethem.
Afterthat,ofcourse,thepreviouscontentwon*tberecoverable.
warning:invalidflagOxOOOOofpartitiontabie4willbecorrectedbyw(rite)
WARNING:DOS-compatiblemodeisdeprecated.It*sstronglyrecommendedto
switchoffthemode(command'c')andchangedisplayunitsto
sectors(commandru').
Command(mforhelp):n
commandaction
eextended
pprimaryparririon(1-4)
P
partitionnumber(1-4):1
Firstcyl1nder(1-13054,default1):
usingdefaultvalue1
Lastcylinder,+cylindersor+size{K,M,G1(1-13054,default13054):
Usingdefaulrvalue13054
command(mforhelp):wq
Thepartitiontabiehasbeenaltered!
Callingioctl()tore-readpartitiontable,
syncingdisks.
[root@iZ23pbxddnmz|
#fdisk-1
Disk/dev/xvde:107.4GB,107374182400bytes
255heads,63sectors/track,13054cylinders
Units=cylindersof16065*512=8225280bytes
sectorsize(logical/physical):512bytes/512bytes
I/Osize(minimum/optimal):512bytes/512bytes
Diskidentifier:Ox4cO436c3
Id
DeviceBoorstartEndBlocks83system
/dev/xvdel113054104856223+Linux
[root@iz23pbxddnmz〜]#I
#4/dev/xvdel
格式化为exl3或者ext4
[root@iZ23pbxddnmz〜]#mkfs.ext4/dev/xvdel
mke2fs1.41.12(17-May-2O1O)
Filesystemlabel=
ostype:Linux
Blocksize=4096(loq=2)
Fragmentsize=4096(log=2)
Stride=0blocks,Stripewidth=0blocks
6553600inodes,26214055blocks
1310702blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=4294967296
800blockgroups
32768blockspergroup,32768fragmentspergroup
8192inodespergroup
superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736,1605632,2654208,
4096000,7962624,11239424,20480000,23887872
writinginodetables:done
Creatingjournal(32768blocks):done
writingsuperblocksandfilesystemaccountinginformation:done
Thisfilesystemwillbeautomaticallycheckedevery32mountsor
180days,whichevercomesfirst,usetune2fs-cor-itooverride.
[root@iz23pbxddnmz〜]#I
使用"echo'/dev/xvdel/uOlext4defaults00'>>/etc/fstab”(不含引号)命
令写入新分区信息。
然后使用“cat/etc/fstab”命令查看,出现以下信息就表示写入成功。
#echo'/dev/xvdel/uOlext4defaults00'»/etc/fstab
;root@iz23pbxddnmz〜]#echo'/dev/xvdel/mntext4defaults00*»/etc/fstab
;root@iz23pbxddnmzcat/etc/fstab
#
#/etc/fstab
#CreatedbyanacondaonThuAug1421:16:422014
#
#Accessiblefilesystems,byreference,aremaintainedunder'/dev/disk'
#seemanpagesfstab(5),findfs(8),mount(8)and/orblkid(8)formoreinfo
#
UUID=94e4e384-0ace-437f-bc96-057dd64f42ee/ext4defaults,barrier=011
tmpfs/dev/shmtmpfsdefaults00
devpts/dev/ptsdevptsid=5,mode=62000
sysrs/syssysfs3efaults00
proc/procprocdefaults00
none/proc/xenxenfsdefaults00
/dev/xvdel/mntext4defaults00
[root@iZ23pbxddnmz〜]#I
创建磁盘挂载目录:
ttmkdir/uOl
挂载磁盘:
mount-a
I[root@iz23pbxddnmz/]#df-h1
FilesystemSizeusedAvailuse%Mountedon
/dev/xvdal20G19G274M99%/
tmpfs32G8.OK32G1%/dev/shm
/dev/xvdel99G188M94G1%/uOl
配置SWAP,和内存一样大--16GB
#grepMemTotal/proc/meminfo
#ddif=/dev/zeroof=/u01/swapbs=1024Mcount=16
#/sbin/mkswap/uOl/swap
#/sbin/swapon/uOl/swap
#vi/etc/fstab
/uOl/swapswapswapdefaults00
free-m
[root@iz23pbxddnmz〜]#free-m
totalusedfreesharedbufferscached
Mem:644113308531325039130491
-/+buffers/cache:220362208
swap:16383016383
2.设置共享内存
Oracle的SGA+PGA内存大小受限于linux的共享内存大小,最佳实践通常SGA+PGA设置为物理内
存的60-70%,所以根据物理内存的70%设定为64GB*0.7=45GB左右。
#df-h
cp/etc/fstab/etc/
vi/etc/fstab
mount-oremount/dev/shm
df-h
#
#/etc/fstab
CreatedbyanacondaonThuAug1421:16:422014
#
*Accessiblefilesystems,byreference,aremaintainedunder'/dev/disk,
Seemanpagesfstab(5),findfs(8),mount(8)and/orblkid(8)formoreinfo
UUlD=94e4e384-0ace-437f-bc96-057dd64f42ee/ext4defaults,barrier=O11
tmpfs/dev/shmtmpfsdefaults,size=45875M00
devpts/dev/ptsdevptsqid=5,mode=62000
sysfs/syssysfsdefaults00
proc/procprocdefaults00
none/proc/xenxenfsdefaults00
/dev/xvdel/uOlext4defaults00
一
u•---■一--r-ih--
rrotz23e#t
LOapbdhmou-oremount/dev/sh(n
也h
LrrOotz23pbde#
i1eu•1
Fsystzee1
/dev/xVd24G7Guse%Mountedon
tmpfs48oK45G13%
/de/d•1%/dev/shm
/VxV917G78G
rt.18%/uOl
Lroo@1z
3.设置临时文件夹空间
要求大于1GB,高配置ECS缺省满足条件
.•
[rtT
Fioos23pmzzedf-h
/d/ems2loGusedAvailuse%Mountedon
leal
tms45G9.8G8.8G53%/
zdev24G22G53%/dev/shm
99。
pf24G70G26%/uOl
ev
2.2.软件环境检查及配置
1.关闭防火墙
ECS缺省关闭可以忽略。
#sed-i〃s/SELINUX=enforcing/SELINUX=disabled/"/etc/seiinux/config
ttsetenforce0
2.安装依赖包
确定操作系统版本:
#uname-r
2.6.32-431.233.el6.x86_64
在LinuxX86_64操作系统上Oracle需要以下软件包:
binutils-2.20.51.0.2-5.11.el6(x86_64)
compat-libcapl-1.10-l(x86_64)
compat-1ibstdc++-33~3.2.6(x86_64)
compat-1ibstdc++-33-3.2.6.i686
gcc-4.4.6(x86_64)
gcc-c++-4.4.6(x86_64)
glibc-2.12-1.7.el6(i686)
glibc-2.12-1.7.el6(x86_64)
glibc-devel-2.12-1.7.el6(x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.6(i686)
libgcc-4.4.6(x86_64)
libstdc++-4.4.6(x86_64)
libstdc++-4.4.6.i686
libstdc++-devel-4.4.6(x86_64)
1ibstdc++-devel_4.4.6.i686
libaio-0.3.6(x86_64)
libaio-0.3.6.1686
libaio-devel-0.3.6(x86_64)
libaio-devel-0.3.6.1686
make-3.6
sysstat-9.0.6(x86_64)
如果使用IL2.0.2以上版本,只需要除gcc-32bit-4.3以外的64位包,32位包不需要。
#rpm-qbinutilscompat-libcaplcompat-libstdc++gccgcc-c++glibcglibc-devel
kshlibgcclibstdc++libstdc++-devellibaiolibaio-develmakesysstatunixODBC*
根据需要安装以下包:
#yuminstallcompat-libcapl*compat-libstdc++*glibc*libgcc*libstdc++*
libaio*elfutils-libelf*unixODBC*pdksh*ksh*glibc-devel.i686Iibstdc++.i686
Iibstdc++-devel.i686Iibaio.i686libaio-devel.i686
[root@iz23pbxddnmzhome]#rpm-qbinutilscompat-libcaplcompat-1ibstdc++gccgcc-c++glibcglibc-deve
1kshlibgcclibstdc++1ibstdc++-devellibaiolibaio-develmakesysstat
binutils-2.-5.36.el6.x86_64
compat-1ibcapl-1.10-1.x86_64
packagecompat-1ibstdc++isnotinstalled
gcc-4.4.7-11.el6.X86.64
gcc-c++-4.4.7-11.el6.x86__64
glibc-2.12-1.149.e!6.x86_64
glibc-2.12-l.149.el6.1686
glibc-devel-2.12-1.149.el6.x86_64
glibc-devel-2.12-1.149.el6.1686
ksh-20120801-21.e16.1.x86_64
libgcc-4.4.7-11.el6.x86_64
libgcc-4.4.7-11.el6.1686
libstdc++-4.4.7-11.el6.x86_64
1ibstdc++-4.4.7-11.el6.i686
1ibstdc++-devel-4.4.7-11.el6.x86_64
libstdc++-devel-4.4.7-11.el6.1686
libaio-0.3.107-10.el6.x86_64
libaio-0.3.107-10.el6.i686
11baio-devel-O.3.107-10.el6.x86_64
libaio-devel-O.3.107-10.el6.1686
make-3.81-20.el6.x86_64
sysstat-9.0.4-22.el6.x86_64
[root@iz23pbxddnmzhome]#|
3.禁止transparent_hugepage参数
ECS缺省关闭,可忽略
如需修改请添加以下内容到/etc/file:
transparent_hugepage=never
然后重启系统
4.创建用户及用户组
#groupaddoinstall
#groupadddba
#useradd-goinstall-Gdbaoracle
#passwdoracle
#idoracle
将oracle用户加入到sudo群组
#vi/etc/sudoers
找到rootALL=(ALL)ALL这行,并且在底下再加入oracleALL=(ALL)ALL
5.修改Oracle用户资源限制
目前ECS缺省值为:
$ulimit-Sn
65535
$ulimit-Hn
65535
$ulimit-Su
1024
$ulimit-Hu
515130
$ulimit-Ss
10240
$ulimit-Hs
unlimited
修改#vi/etc/security/
oraclesoftnofile1024
oraclehardnofile65536
oraclesoftnproc2047
#oraclehardnproc16384
oraclesoftstack10240
oraclehardstack32768
#如果使用ASM
gridsoftnofile1024
gridhardnofile65536
gridsoftnproc2047
gridhardnproc16384
gridsoftstack10240
gridhardstack32768
6.编辑/etc/pam.d/login
#vi/etc/pam.d/login
添加以下两行
sessionrequired/lib64/security/pam_
sessionrequiredpam_
7.配置系统内核参数
#vim/etc/
fs.aio-max-nr=
fs.file-max=
1=
x=#一半物理内存
i=4096
=25032000100128
4.ip_local_port_range=900065500
.rmem_default=262144
.rmem_max=
.wmem_default=262144
.wmem_max=
vm.hugetlb_shm_group=501
#oracle用户组dbaid为501,以彻底解决ORA-27125错误。
修改完成后执行使之生效
itsysctl-p
8.修改/etc/profile
#vi/etc/profile
将以下代码新增到profile档案中
if[$USER="oracle"];then
if[$SHELL="/bin/ksh"];then
ulimit-p16384
ulimit-n65536
else
ulimit-u16384-n65536
fi
umask022
fi
9.oracle用户环境变量配置
#suoracle
$vim.bash_profile
#添加下面内容
exportORACLE_BASE=/uOl/app/oracle
exportORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_l
exportORACLE_SID=orcl
exportPATH=$ORACLE_HOME/bin:$PATH
exportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
$source/home/oracle/.bash_profile
$env
10.创建安装目录并赋权
#mkdir-p/u01/app/orac1e
#chown-Roracle:oinstall/uOl
#chmod-R775/uOl
11.上传Oracle软件
3.安装Gridinfrastructure
1.1.安装ASMlib
1.2.创建grid用户
#groupaddasmadmin
#groupaddasmdba
#groupaddasmoper
#useradd-d/home/grid-goinstall-Gasmadmin,asmdba,asmoper,dbagrid
#passwdgrid
#idgrid
添力Uasmdba给Oracle用户
#usermod-goinstall-Gdba,asmdbaoracle
#idoracle
1.3.创建grid用户安装目录并赋权
#mkdir-p/uOl/app/grid
#mkdir-p/u01/app/ll.2.O/grid
#chown-Rgrid:oinstall/uOl
#chown-Roracle:oinstall/uO1/app/orac1e
1.4.安装ASMLib
#yuminstallkmod-oracleasm
#yuminstalloracleasmlib-2.0.6.x86_64.rpm
#yuminstalloracleasm-support-2.1.6.x86_64.rpm
linuxi72ipbxddnmZ?.6.32-431.?3.3.e16.x86_64*1SMPThuJul3117:2O:S1UTC2014x86_6dx86_64x86_64GNU,Linux
[root@iz23pbxddnmzoracle]#yuminstallkmod-oracleasm
Loadedplugins:refresh-packagekit,security
Repositorybaseislistedmorethanonceintheconfiguration
Repositoryupdatesislistedmorethanonceintheconfiguration
RepositoryextrasislistedmorethanonceinTheconfiguration
Repositorycentosplusislistedmorethanonceintheconfiguration
Repositorycontribislistedmorethanonceintheconfiguration
base
epel
epel/primary_db
extras
updates
SettingupinsxallProcess
ResolvingDependencies
-->Runningtransactioncheck
-->Packageknod-oracleastn.x86_640:2.0.8-4.el6_6willbeinstalled
-->ProcessingDependency:kernel(get_user_paqes_fast)=Oxa2046a95forpackage:knK)d-oracleasm-?.0.8-4.el6_6.x86_64
-->ProcessingDependency:kernel>-2.6.32-504.e16forpackage:kmod-oracleasm-2.0.8-4.el6_6.x86.64
-->Runningtransactioncheck
—>packagekernel.x86_640:2.6.32-504.3.3.el6willbeinstalled
一>ProcessingDependency:kernel-firmware>=2.6.32-504.3.3.el6forpackage:kernel-2.6.32-504.3.3.el6.x86_64
-->Runningtransactioncheck
—>Packagekernel-firmware.noarch0:2.6.32-431.23.3.el6wi11beupdated
—>Packagekernel-firnwrare.noarch0:2.6,32-504.3.3.el6willbeanupdate
-->FinishedDependencyResolution
DependenciesResolved
packageArchversionRepositorySize
installing:
kmod-oracleasmx86_642.0.8-4.el6_6updates
Installingfordependencies:
kernelx86_642.6.32-504.3.3.el6updates
updatingfordependencies:
kernel-firmwarenoarch2.6.32-504.3.3.el6updates
Transactionsunmary
install2Package(s)
Upgrade1package(s)
Totaldownloadsize:44M
ISthisok[y/N]:y
DownloadingPackages:
(1/3):kernel-2.6.32-504.3.3.el6.x86„64.rpm29MB00:02
(2/3J:kernel-firnwuare-2.6.32-504.3.3.el6.noarch.rpm14MB00:01
(3/3):knod-oracleasin-2.0.8-4.el6_6.x86_64.rpm35k800:00
Total9.4MB/S|44M8
Runningrpm_check,.debug
RunningTransactionTest
TransactionTestSucceeded
RunningTransaction
warning:RPMDBalteredoutsideofyum.
Updating:kernel-firmware-2.6.32-504.3.3.el6.noarch1/4
Installing:kernel-2.6.32-504.3.3.el6.x86_642/4
installIng:kmod-oracleasm-2.0.8-4.el6_6.x86_643/4
cleanup:kernel-firmware-2.6.32-431.23.3.el6.noarch4/4
unabletoconnecttodbus
verifying:kernel-firmware-2.6.32-504.3.3.e16.noarch1/4
verifying:kernel-2.6.32-504,3.3.el6.x86_642/4
verifying:kmod-oracleasm-2.0.8-4.el6_6.x86_643/4
verifying:kernel-f1rmware-2.6.32-431.23.3.el6.noarch4/4
Installed:
kmod-oracleasn.x86_640:2.0.8-4.el6_6
Dependencyinstalled:
kernel.x86_640:2.6.32-504.3.3.el6
Dependencyupdated:
kernel-firmware.noarch0:2.6.32-504.3.3.el6
complete!
[root0lz23pbxddnmzoracle]#I
设置ASM驱动
#/usr/sbin/oracleasmconfigure-i
#使用oracle/dba或者grid/asmdba作为参数
#/etc/init.d/oracleasmenable
[root@iz23pbxddnmzoracle]#/usr/sbin/oracleasmconfigure-i
ConfiguringtheOracleASMlibrarydriver.
Thiswillconfiguretheon-bootpropertiesoftheoracleASMlibrary
driver.Thefollowingquestionswilldeterminewhetherthedriveris
loadedonbootandwhatpermissionsitwillhave.Thecurrentvalues
willbeshowninbrackets('口').Hitting<ENTER>withouttypingan
answerwillkeepthatcurrentvalue.Ctr1-cwillabort.
Defaultusertoownthedriverinterface[]:grid
Defaultgrouptoownthedriverinterface[]:asmadmin
StartoracleASMlibrarydriveronboot(y/n)[n]:y
scanforOracleASMdisksonboot(y/n)[y]:y
writingoracleASMlibrarydriverconfiguration:done
[root@iZ23pbxddnmzoraclej#|
2.准备ASM使用存储
#fdisk/dev/xvdb
#/usr/sbin/orac1easmcreatediskDATA1/dev/xvdbl
Writingdiskheader:done
Instantiatingdisk:done
#/usr/sbin/oracleasmcreatediskDATA2/dev/xvdcl
Writingdiskheader:done
Instantiatingdisk:done
#/usr/sbin/orac1easmcreatediskDATA3/dev/xvddl
Writingdiskheader:done
Instantiatingdisk:done
#/etc/init.d/oracleasmena
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年二手车交易合同参考文本
- 2024年人工智能研发与技术转让协议
- 2024年东莞市股权转让合同(有限合伙人适用)
- 2024年工程人员派遣合同
- 2024年工程技术服务合同
- 2024年场地使用权出租合同
- 2024年国际贸易合同中的知识产权保护
- 2024年小型餐馆工人合同
- 2024年广告发布合同:广告公司与人媒体间的广告内容与投放协议
- 2024年大数据分析服务合同标的及服务内容规定
- 广东省深圳市2023-2024学年高一上学期生物期中试卷(含答案)
- 第七章 立体几何与空间向量综合测试卷(新高考专用)(学生版) 2025年高考数学一轮复习专练(新高考专用)
- 大学美育(同济大学版)学习通超星期末考试答案章节答案2024年
- 2024年2024年离婚协议书模板
- 中国急性缺血性卒中诊治指南(2023版)
- 过敏性休克完整版本
- 08D800-8民用建筑电气设计与施工防雷与接地
- 科学的体育锻炼课件(图文)
- 应急第一响应人理论考试试卷(含答案)
- DZ∕T 0213-2020 矿产地质勘查规范 石灰岩、水泥配料类(正式版)
- 2024年湖北省工业建筑集团有限公司招聘笔试参考题库含答案解析
评论
0/150
提交评论