CentOS安装Oracle11g   Linux 搭建Pro*C/C++开发环境

前端之家收集整理的这篇文章主要介绍了CentOS安装Oracle11g   Linux 搭建Pro*C/C++开发环境前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


@H_403_2@

本文谢绝转载原文来自http://990487026.blog.51cto.com@H_403_2@


@H_403_2@

系统属性:@H_403_2@

CentOS 6.8_X64,基于桌面,附加开发工具包安装.@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@

上传Oracle11g安装文件到:/usr/local/oracle/@H_403_2@

wKioL1fC8YSQpqTfAAGTuuIbDNw885.png

@H_403_2@


@H_403_2@

[root@oracle11home]#mkdir-pv/usr/local/oracle
mkdir:createddirectory`/usr/local/oracle'
[root@oracle11oracle]#ll/usr/local/oracle/
total2985244
-rw-r--r--.1rootroot1239269270Aug2820:23linux.x64_11gR2_database_1of2.zip
-rw-r--r--.1rootroot1111416131Aug2820:24linux.x64_11gR2_database_2of2.zip
[root@oracle11oracle]#


@H_403_2@

准备oracle的安装目标目录[重要]@H_403_2@

[root@oracle11oracle]#mkdir�p/opt/oracle


@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@

创建oracle相关用户用户@H_403_2@

[root@oracle11oracle]#groupadddba
[root@oracle11oracle]#groupaddoinstall
[root@oracle11oracle]#useradd-goinstall-Gdbaoracle
[root@oracle11oracle]#passwdoracle
Changingpasswordforuseroracle.
Newpassword:oracle
Retypenewpassword:oracle
passwd:allauthenticationtokensupdatedsuccessfully.
[root@oracle11oracle]#chown-Roracle:oinstall/opt/oracle
[root@oracle11oracle]#ll/opt/oracle-d
drwxr-xr-x.2oracleoinstall4096Aug2820:27/opt/oracle


@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@

检查安装ORACLE依赖的RPM软件包@H_403_2@

[root@oracle11oracle]#mkdir/mnt/cdrom
[root@oracle11oracle]#mount/dev/cdrom/mnt/cdrom/
[root@oracle11Packages]#cd/mnt/cdrom/Packages
[root@oracle11Packages]#rpm-ivhkernel-headers-2.6.18-164.el5.i386.rpm
[root@oracle11Packages]#rpm-ivhglibc-headers-2.5-42.i386.rpm
[root@oracle11Packages]#rpm-ivhglibc-devel-2.5-42.i386.rpm
[root@oracle11Packages]#rpm-ivhlibgomp-4.4.0-6.el5.i386.rpm|
[root@oracle11Packages]#rpm-ivhsysstat-7.0.2-3.el5.i386.rpm
[root@oracle11Packages]#rpm-ivhlibaio-devel-0.3.106-3.2.i386.rpm
[root@oracle11Packages]#rpm-ivhlibstdc++-devel-4.1.2-46.el5.i386.rpm
[root@oracle11Packages]#rpm-ivhunixODBC-2.2.11-7.1.i386.rpm
[root@oracle11Packages]#rpm-ivhunixODBC-devel-2.2.11-7.1.i386.rpm
[root@oracle11Packages]#rpm-ivhgcc-4.1.2-46.el5.i386.rpm
[root@oracle11Packages]#rpm-ivhgcc-c++-4.1.2-46.el5.i386.rpm
[root@oracle11Packages]#rpm-ivhelfutils-libelf-devel-0.137-3.el5.i386.rpm
[root@oracle11Packages]#rpm-ivhelfutils-libelf-devel-static-0.137-3.el5.i386.rpm|
如果找不到elfutils-libelf-devel-static,yuminstallelfutils-libelf-devel-static
如果找不到libgomp,yuminstalllibgomp


@H_403_2@


@H_403_2@


@H_403_2@

设置linux内核参数@H_403_2@

[root@oracle11Packages]#vim/etc/sysctl.conf在最后面添加
#kernel.shmall=4294967296
#kernel.shmall=2097152
kernel.shmmax=2147483648
kernel.shmmni=4096
kernel.sem=25032000100128
net.core.rmem_default=4194304
net.core.rmem_max=4194304
net.core.wmem_default=262144
fs.file-max=6815744
net.ipv4.ip_local_port_range=900065500
net.core.wmem_max=1048576
fs.aio-max-nr=1048576

[root@oracle11Packages]#vim/etc/security/limits.conf在最后面添加
oraclesoftnproc2047
oraclehardnproc16384
oraclesoftnofile1024
oraclehardnofile65536

[root@oracle11Packages]#vim/etc/profile在最后面添加
if[$USER="oracle"];then
if[$SHELL="/bin/bash"];then
ulimit-p16384
ulimit-n65536
else
ulimit-u16384-n65536
fi
fi


@H_403_2@


@H_403_2@

重新启动系统,开始安装过程@H_403_2@

[root@oracle11~]#reboot
[root@oracle11~]#chown-Roracle:/usr/local/oracle/
[root@oracle11~]#suoracle
[oracle@oracle11oracle]$cd/usr/local/oracle/
[oracle@oracle11oracle]$unziplinux.x64_11gR2_database_1of2.zip
[oracle@oracle11oracle]$unziplinux.x64_11gR2_database_2of2.zip
[oracle@oracle11oracle]$cddatabase/
[oracle@oracle11database]$./runInstaller
开始加载图形安装程序.......................


@H_403_2@


@H_403_2@

高清大图:@H_403_2@


@H_403_2@

wKioL1fC8P6D9rJiAACKFVI4eZQ312.png

@H_403_2@

wKiom1fC8P7hHC-tAAAnzd3qk8Q903.png

@H_403_2@

wKioL1fC8P7zv9VkAACLEVxTF24644.png

@H_403_2@

wKiom1fC8P-z671kAACNn8Ubz64165.png

@H_403_2@

wKioL1fC8P-g4qmEAACIhfVmNyc957.png

@H_403_2@

wKiom1fC8QCzh9GoAACPMdpUThI474.png

@H_403_2@


@H_403_2@


@H_403_2@

wKioL1fC8QDRbFsHAACybZ_ghUc952.png

@H_403_2@


@H_403_2@

在这里,会自动找到我为oracle分配的安装路径@H_403_2@


@H_403_2@

wKiom1fC8QHRtyCpAACXHoBLUaw547.png

@H_403_2@

wKiom1fC8QGzOPBRAACHFqpHv3s607.png

@H_403_2@


@H_403_2@

提示找不到依赖库,其实我们都全部安装了,@H_403_2@

# rpm -q 包名,是可以查出来我已经安装了的@H_403_2@

wKiom1fC8tShi9EkAAEFNVuZGHg701.png

@H_403_2@


@H_403_2@


@H_403_2@

wKioL1fC8QKT0o0lAACltvDKE9Y097.png

@H_403_2@


@H_403_2@


@H_403_2@

漫长的等待...................@H_403_2@


@H_403_2@

wKiom1fC8QPRBq3qAADwpv55Abo044.png

@H_403_2@

wKioL1fC8QOSSQnGAAFC4PuOaBQ327.png

@H_403_2@

wKiom1fC8QSCSOfkAACk8c2OqWw243.png

@H_403_2@

wKioL1fC8QSR92T3AACj87F1avA787.png

@H_403_2@

wKiom1fC8QXz3FdjAADTuASHDyM297.png

@H_403_2@

wKiom1fC8QaDZs0EAAEc4D9nS3s154.png

@H_403_2@

wKioL1fC8QaShQfNAAFNtJZ9fGo897.png

@H_403_2@

wKiom1fC8QfTsGsOAACG4BCLTwg511.png

@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@

安装完成:@H_403_2@

oracle安装的位置:/opt/oracle/@H_403_2@

oracle11g的位置:/opt/oracle/app/product/11.2.0/dbhome_1/@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@

设置ORACLE环境变量@H_403_2@

[oracle@oracle11~]$cat/home/oracle/.bashrc
添加:
exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/oracle/app/product/11.2.0/dbhome_1/lib/
PATH=$PATH:/opt/oracle/app/product/11.2.0/dbhome_1/bin/
exportORACLE_HOME=/opt/oracle/app/product/11.2.0/dbhome_1/
exportORACLE_SID=orcl
exportORACLE_BASE=/home/oracle/oracle


@H_403_2@

查看pro*C/C++编译器情况:@H_403_2@

[oracle@oracle11~]$proc

Pro*C/C++:Release11.2.0.1.0-ProductiononSunAug2823:31:482016

Copyright(c)1982,2009,Oracleand/oritsaffiliates.Allrightsreserved.

Systemdefaultoptionvaluestakenfrom:/opt/oracle/app/product/11.2.0/dbhome_1/precomp/admin/pcscfg.cfg

OptionNameCurrentValueDescription
-------------------------------------------------------------------------------
auto_connectnoAllowautomaticconnectiontoops$account
char_mapcharzMappingofcharacterarraysandstrings
close_on_commitnoCloseallcursorsonCOMMIT
cmax100CMAXValueforconnectionpool
cmin2CMINValueforconnectionpool
cincr1CINCRValueforconnectionpool
ctimeout0CTIMEOUTValueforconnectionpool
cnowait0CNOWAITValueforconnectionpool
common_parsernoParseusingCommonsqlFrontEnd
codekr_cThetypeofcodetobegenerated
comp_charsetmulti_byteThecharactersettypetheCcompilersupports
configdefaultOverridesystemconfigurationfilewithanother
cpoolnoSupportconnectionpooling
cpp_suffix*none*OverridethedefaultC++filenamesuffix
db2_arraynoSupportDB2arrayinsert/selectSyntax
dbmsnativev6/v7/v8compatibilitymode
def_sqlcodenoGenerate'#definesqlCODEsqlca.sqlcode'macro
define__x86_64__Defineapreprocessorsymbol
*none*
durationtransactionSetpindurationforobjectsinthecache
dynamicoracleSpecifyOracleorANSIDynamicsqlSemantics
errorsyesWhethererrormessagesaresenttotheterminal
errtype*none*Nameofthelistfileforintypefileerrors
eventsnoSupportpublish-subscribeeventnotifications
fipsnoneFIPSflaggingofANSInoncompliantusage
header*none*SpecifyfileextensionforPrecompiledHeaders
hold_cursornoControlholdingofcursorsinthecursorcache
implicit_svptnoImplicitsavepointpriortobufferedinsert
iname*none*Thenameoftheinputfile
include*none*Directorypathsforincludedfiles
intype*none*Thenameoftheinputfilefortypeinformation
linesnoAdd#linedirectivestothegeneratedcode
lname*none*Overridedefaultlistfilename
ltypeshortTheamountofdatageneratedinthelistfile
maxliteral1024Maximumlengthofageneratedstringliteral
maxopencursors10Maximumnumberofcachedopencursors
max_row_insert0Maximumnumberofrowstobufferoninsert
modeoracleCodeconformancetoOracleorANSIrules
native_typesnoSupportfornativefloat/double
nls_char*none*SpecifyNationalLanguagecharactervariables
nls_localnoControlhowNLScharactersemanticsaredone
objectsyesSupportobjecttypes
oname*none*Thenameoftheoutputfile
oracanoControltheuSEOftheORACA
outlinenoCategoryinwhichOutlinesarecreated
[yes/no/<categoryname>]
outlnprefix*none*Outlinenameprefix
pagelen80Thepagelengthofthelistfile
parsefullControlwhichnon-sqlcodeisparsed
prefetch1Numberofrowspre-fetchedatcursorOPENtime
release_cursornoControlreleaSEOfcursorsfromcursorcache
runoutlinenoIfyes,createOutlinesintheDatabase
select_erroryesControlflaggingofselecterrors
sqlcheckSyntaxAmountofcompile-timesqlchecking
stmt_cache0Sizeofstatementcache
sys_include/usr/lib64/gcc/Directorywheresystemheaderfilesarefound
/usr/lib64/gcc/x86_64-suse-linux/4.1.0/include
/usr/lib/gcc/x86_64-redhat-linux/4.1.1/include
/usr/lib/gcc-lib/x86_64-redhat-linux/3.2.3/include
/usr/include
$ORACLE_HOME/precomp/public
threadsnoIndicatesamulti-threadedapplication
type_codeoracleUSEOracleorANSItypecodesforDynamicsql
unsafe_nullnoAllowaNULLfetchwithoutindicatorvariable
userid*none*Ausername/password[@dbname]connectstring
utf16_charsetnchar_charsetThecharactersetformusedbyUTF16variables
varcharnoAllowtheuSEOfimplicitvarcharstructures
versionrecentWhichversionofanobjectistobereturned
PCC-F-02135,CMD-LINE:Useraskedforhelp
[oracle@oracle11~]$


@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@

监听服务启动/关闭@H_403_2@

[oracle@oracle11~]$lsnrctlstart/stop


@H_403_2@

数据库服务的启动/关闭@H_403_2@

[oracle@oracle11root]$sqlplus/nolog
sql>conn/assysdba
sql>startup开启
sql>shutdownimmediate关闭
sql>connscott切换到scott用户
sql>connscott/password切换到scott用户


@H_403_2@

如果数据库服务启动时报错@H_403_2@

sql>startup
ORA-00845:MEMORY_TARGETnotsupportedonthissystem

[临时解决办法]
[root@oracle11~]#mount-oremount,size=4G/dev/shm

[永久解决方法]
[root@oracle11~]#vim/etc/fstab
tmpfs/dev/shmtmpfsdefaults,size=4096M00
[root@oracle11~]#reboot


@H_403_2@


@H_403_2@

sqlplus操作,增删改查:@H_403_2@

[oracle@oracle11~]$sqlplus
Enteruser-name:scott
Enterpassword:tiger
Changingpasswordforscott
Newpassword:haha
Retypenewpassword:haha
sql>select*fromtab;

TNAME			TABTYPE	CLUSTERID
-----------------------------------------------
BONUS			TABLE
DEPT			TABLE
EMP			TABLE
SALGRADE		TABLE


@H_403_2@


@H_403_2@


@H_403_2@


@H_403_2@

ed命令的使用@H_403_2@


@H_403_2@

sql> ed@H_403_2@

Wrote file afiedt.buf@H_403_2@

20@H_403_2@

写好按q@H_403_2@


@H_403_2@

[root@oracle11 ~]# vim /home/oracle/afiedt.buf@H_403_2@ 原文链接:https://www.f2er.com/centos/380990.html

猜你在找的CentOS相关文章