【本文谢绝转载原文来自http://990487026.blog.51cto.com】
系统属性:
CentOS 6.8_X64,基于桌面,附加开发工具包安装.
上传Oracle11g安装文件到:/usr/local/oracle/
[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]#
准备oracle的安装目标目录[重要]
[root@oracle11oracle]#mkdir�p/opt/oracle
[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
检查安装ORACLE依赖的RPM软件包
[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
设置linux内核参数
[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
重新启动系统,开始安装过程
[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 开始加载图形安装程序.......................
高清大图:
在这里,会自动找到我为oracle分配的安装路径
提示找不到依赖库,其实我们都全部安装了,
# rpm -q 包名,是可以查出来我已经安装了的
漫长的等待...................
安装完成:
oracle安装的位置:/opt/oracle/
oracle11g的位置:/opt/oracle/app/product/11.2.0/dbhome_1/
设置ORACLE环境变量
[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
查看pro*C/C++编译器情况:
[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~]$
监听服务启动/关闭
[oracle@oracle11~]$lsnrctlstart/stop
[oracle@oracle11root]$sqlplus/nolog sql>conn/assysdba sql>startup开启 sql>shutdownimmediate关闭 sql>connscott切换到scott用户 sql>connscott/password切换到scott用户
如果数据库服务启动时报错
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
sqlplus操作,增删改查:
[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
ed命令的使用
sql> ed
Wrote file afiedt.buf
20
写好按q
[root@oracle11 ~]# vim /home/oracle/afiedt.buf
原文链接:https://www.f2er.com/centos/380990.html