|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
甚至一个有经验的Windows管理者也可以轻松部署并开始学习它,而你不需投入一分钱来了解这个数据库。oracle
1,Uncompressandunpackdownloadedfiles
Onestepprocedure(useslessdiskspaceandisfaster):
zcatlnx_920_disk1.cpio.gz|cpio-idmv
zcatlnx_920_disk2.cpio.gz|cpio-idmv
zcatlnx_920_disk3.cpio.gz|cpio-idmv
Twostepprocedure:
#Uncompress
gunziplnx_920_disk1.cpio.gzlnx_920_disk2.cpio.gzlnx_920_disk3.cpio.gzLinux9i_Disk3.cpio.gz
#Unpackthedownloadedfiles:
cpio-idmv<lnx_920_disk1.cpio
cpio-idmv<lnx_920_disk2.cpio
cpio-idmv<lnx_920_disk3.cpio
Nowyoushouldhave3directoriescontaininginstallationfiles:
Disk1
Disk2
Disk3
2,Swapspace
InordertoperformatypicalOracle9iinstallationandtocreateasimpleprototypedatabase,Oraclesaysthatyouneedaminimumof512MBofRAMfortheOracle9i(9.0.1)Server,andtheamountofdiskspace(swapspace)shouldbeequaltotwicetheamountofRAMoratleast400MB,whicheverisgreater.
Checkyourmemorybyexecuting:
grepMemTotal/proc/meminfo
Checkswapspacebyexecuting:
cat/proc/swapsorswaponCs
Youcanalsoaddtemporaryswapspacebycreatingatemporaryswapfileinsteadofusingarawdevice.Hereistheprocedure:
Asroot:
ddif=/dev/zeroof=tmpswapbs=1kcount=900000
chmod600tmpswap
mkswaptmpswap
swapontmpswap
Todisablethetemporaryswapspaceexecutethefollowingcommands:
Asroot:
swapofftmpswap
rmtmpswap
3,SharedMemory
Iincreasedtheshmmaxsettingforthekernelbyexecutingthefollowingcommand:
Asroot:
#cat/proc/sys/kernel/shmmax
33554432
#echo`expr1024*1024*1024`>/proc/sys/kernel/shmmax
ItisrecommendedtoincreasetheshmmaxsettingpermanentlyforOracle.Soifyouwanttoincreasethemaximumsharedmemorysizepermanently,addthefollowinglinetothe/etc/sysctl.conffile:
kernel.shmmax=1073741824
4,/tmpSpace
TheOracleUniversalInstallerrequiresupto400MBoffreespaceinthe/tmpdirectory.Ifyoudonothaveenoughspaceinthe/tmpdirectory,youcantemporarilycreateatmpdirectoryinanotherfilesystem.Hereishowyoucandothis:
Asroot:
mkdir/<AnotherFilesystem>/tmp
chownroot.root/<AnotherFilesystem>/tmp
chmod1777/<AnotherFilesystem>/tmp
exportTEMP=/<AnotherFilesystem>/tmp#usedbyOracle
exportTMPDIR=/<AnotherFilesystem>/tmp#usedbyLinuxprogramslikethelinker"ld"
WhenyouaredonewithyourOracleinstallation,shutdownOracleandremovethetemporarydirectory:
rmdir/<AnotherFilesystem>/tmp
unsetTEMP
unsetTMPDIR
5,OracleDiskSpace
Youwillneedabout2.5GBforthedatabasesoftware.Ifyouperformatypicaldatabaseinstallationandnotacustomizeddatabaseinstallation,thenyouwillneedabout3.5GBofdiskspace.
6,"binutils"Issue(ifyoufondfollowingerror)
Q:"Errorinvokingtargetinstallofmakefile/opt/oracle/product/9.0.1/plsql/lib/ins_plsql.mk"
A:Thisobviatestheneedtochangebinutils
downloadthefollowingbinutilRPMversionanddowngradebinutilontheOracleserver:
ftp://ftp.redhat.com/pub/redhat/linux/7.0/en/os/i386/RedHat/RPMS/binutils-2.10.0.18-1.i386.rpm
Asroot:
rpm-Uvh--force--nodepsbinutils-2.10.0.18-1.i386.rpm
WhenyouaredonewiththeOracleinstallation,youupgradeyourbinutilRPMbacktotheversionyouhadbeforeyoudowngraded:
E.g.onaRedHat7.2server:
rpm-Uvh--force--nodepsbinutils-2.11.90.0.8-9.i386.rpm
7,DevelopmentPackages(RPMs)
YouwillneedthefollowingRPMdevelopmentpackagesfortheOracleinstallertocompiletheOraclemodulesetc.:
gcc
cpp
glibc-devel
compat-libstdc++
kernel-headers(onRH7.1,7.2,2.1AS)
glibc-kernheaders(onRH7.3,8.0)
binutils
Otherwiseyoullgetanerrormessagelike:
Errorininvokingtargetntcontab.oofmakefile/opt/oracle/product/9.2.0/network/lib/ins_net_client.mk
Tofindoutifyouhavethesedevelopmentpackagesinstalled,executethefollowingcommand:
#rpm-qgcccppglibc-develkernel-headersbinutils
8,JDK
IsuccessfullyinstalledOracle9iR2withoutinstallingJDKonthesystem.OraclecomesnowwithitsownJava.ThismeansthatyoudonthavetofollowthesestepswhichwererequiredforolderOracleversions:
DownloadJDK1.3.1orBlackdown1.1.8_v3:(IusuallyusedBlackdown)
http://www.blackdown.org
http://java.sun.com
AccordingtoJDKdocumentation,installJDKunder/usr/local.
ThencreateasymboliclinktotheJDKunder/usr/local/java:
Asroot:
bzip2-dcjdk118_v3-glibc-2.1.3.tar.bz2|tarxf--C/usr/local
ln-s/usr/local/jdk118_v3/usr/local/java
9,CreateOracleUserAccounts
Asroot:
groupadddba
groupaddoinstall
useradd-goinstall-Gdbaoracle
passwdoracle
Oinstallisnotneededwhenthesamepeoplewillbemaintainingthesoftwareandthedatabase.Inthissituation,itwillcreatemoreworkandaddanextralayerofcomplexitytothemaintenanceoftheinstallation.
Recommendation:ifyoudontneedtheoinstallgroupforaddedsecurity,
justinstallusingthedbagroup.
10,CreateOracleDirectories
Inthisexample,makesurethatthe/optfilesystemislargeenough.If/optisnotonaseparatefilesystem,thenmakesuretherootfilesystem"/"hasenoughspace.
Asroot:
mkdir/opt/oracle
mkdir/opt/oracle/product
mkdir/opt/oracle/product/9.2.0
chown-Roracle.oinstall/opt/oracle
mkdir/var/opt/oracle
chownoracle.dba/var/opt/oracle
chmod755/var/opt/oracle
11,SetOracleEnvironments
SetthefollowingOracleenvironmentvariablesbeforeyoustartrunInstaller.
Astheoracleuserexecutethefollowingcommands:
#OracleEnvironment
exportORACLE_BASE=/opt/oracle
exportORACLE_HOME=/opt/oracle/product/9.2.0
exportORACLE_SID=test
exportORACLE_TERM=xterm
#exportTNS_ADMIN=Setifsqlnet.ora,tnsnames.ora,etc.arenotin$ORACLE_HOME/network/admin
exportNLS_LANG=AMERICAN#exportNLS_LANG=AMERICAN_AMERICA.ZHS16GBK;(ifyouuseChinese)
exportORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
exportLD_LIBRARY_PATH
#Setshellsearchpaths
exportPATH=$PATH:$ORACLE_HOME/bin
#IsuccessfullyinstalledOracle9iR2WITHOUTsettingthefollowingCLASSPATHenvironmentvariable:
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
CLASSPATH=$CLASSPATH:$ORACLE_HOME/network/jlib
exportCLASSPATH
exportTMPDIR=/tmp
Youcanputtheseenvironmentsettingsattheendofthe~oracle/.bash_profilefileifyouusebash.
12,StartrunInstaller
Oraclenolongersupportsacharactermodeinstaller.Therefore,inordertoexecuterunInstallerdirectlyfromaconsoleofamachineyouareloggedinto(inthisexamplethenodenamewhereOracleisrunningiscalled"oracleserver"),youneedtosettheDISPLAYenvironmentvariable.
FromtheconsoleofyourOracleserver"oracleserver"youareloggedinto,executethefollowingcommandasuser"oracle":
oracleserver:oracle$exportDISPLAY=yourlocalIP:0.0
13,RunningOracleInstallation
ThisishowIansweredthequestionsintherunInstaller:
Whatwouldyoulikeasthebasedirectory(InventoryLocation):
/opt/oracle/oraInventory
UNIXGroupName(permissionforupdatingOraclesoftware):
oinstall
Youcouldalsouse"dba"whichIdonotrecommendforsecurityreasons.(refertostep9)
FullpathnameforOracleHome:
/opt/oracle/product/9.2.0
OracleHomeName:
OUIHome
14,YoumightgetthefollowinginstallationproblemswhenyouinstallOracle9i(9.2.0):
lFirstcheckalwaystheerrorlogsin/tmp/OraInstallfor9.2.0,e.g/tmp/OraInstall2002-07-04_09-50-19PM,andin/tmp/OraInstallfor9.0.1.Whenyougetmakeproblemscheckalso$ORACLE_HOME/install/make.log.
lQ:"Errorininvokingtargetinstallofmakefile/opt/oracle/product/9.2.0/ctx/lib/ins_ctx.mk"
A:Edit$ORACLE_HOME/ctx/lib/env_ctx.mkandgoto"INSO_LINK=",adda"$(LDLIBFLAG)dl"tothelineandsaveit.
Hereisthefulllinewiththeadded"$(LDLIBFLAG)dl"flag:
INSO_LINK=-L$(CTXLIB)$(LDLIBFLAG)m$(LDLIBFLAG)dl$(LDLIBFLAG)sc_ca$(LDLIBFLAG)sc_fa$(LDLIBFLAG)sc_ex$(LDLIBFLAG)sc_da$(LDLIBFLAG)sc_ut$(LDLIBFLAG)sc_ch$(LDLIBFLAG)sc_fi$(LLIBCTXHX)$(LDLIBFLAG)c-Wl,-rpath,$(CTXHOME)lib$(CORELIBS)$(COMPEOBJS)
lQ:"Errorinvokingtargetinstallofmakefile/opt/oracle/product/9.0.1/plsql/lib/ins_plsql.mk"
"Errorinvokingtargetinstallofmakefile/opt/oracle/product/9.0.1/precomp/lib/ins-precomp.mk"
"Errorinvokingtargetinstallofmakefile/opt/oracle/product/9.0.1/precomp/lib/ins-net-client"
"Errorinvokingtargetinstallofmakefile/opt/oracle/product/9.0.1/precomp/lib/ins-oemagent"
A:Editthefile$ORACLE_HOME/bin/genclntshandchangethefollowingline(peoplehavesentmeemailspointingoutthatthisalsoworksforMandrake8.1andMandrake8.2):
LD_SELF_CONTAINED="-zdefs"
toread:
LD_SELF_CONTAINED=""
Thenrunthescript$ORACLE_HOME/bin/genclntshastheuser"oracle"andnotastheuser"root".AlsomakesureyouhavealltheOracleenvironmentsset!
$su-oracle
$$ORACLE_HOME/bin/genclntsh
Created/opt/oracle/product/9.0.1/lib/libclntst9.a
$
lQ:CantfindinitfileforDatabase"SID".
A:IsawthiserroronlyinconnectionwithOracle9iR2(9.2.0)whenIttriedtostartthedatabasewithdbstart.
IcopiedtheinitfileformySID"test"from/opt/oracle/admin/test/pfileto$ORACLE_HOME/dbstogetdbstartanddbshutworking:
cp/opt/oracle/admin/test/pfile/inittest.ora.642002224936$ORACLE_HOME/dbs/inittest.ora
lQ:"Errorinsettingpermissionsoffile/directory/opt/oracle/jre/1.1.8/bin/i686/native_threads/.extract_args"
A:Whiletheerrordialogisopen,manuallyfindandcopythe.extract_argsfilefromyourinstalledjretowhererunInstallercomplainsitismissing.
lQ:"jrewasnotfoundin/tmp/OraInstall/jre/bin/i586/green_threads/jre"
A:YouareprobablyrunningrunInstallerona586machine,oryourAMDCPUgetsrecognizedas586(e.g.AMDK6-III-400).Youcancheckyourmachine(hardware)typebyexecutinguname-m.
Torectifythisproblem,createalinkforlibandbinfromi586toi686andmakethei686directoriesreadonly:
E.g.
ln-s/tmp/OraInstall/jre/bin/i686/tmp/OraInstall/jre/bin/i586
ln-s/tmp/OraInstall/jre/lib/i686/tmp/OraInstall/jre/lib/i586
chmodu-w/tmp/OraInstall/jre/bin/i686/tmp/OraInstall/jre/lib/i686
NowrestartrunInstaller.
Ifyouarenotrunningona586orAMDmachine,trytolinkjretojavaandseeifthissolvesyourproblem.
lDonotcdto/mnt/cdromtorun./runInstaller!
Ifyoudoso,theinstallationwillfailbecauseyouwontbeabletochangetheCDs.
lIfyouforgottosettheDISPLAYenvironmentvariable(e.g.exportDISPLAY=oracleserver:0.0),orifyouforgottogivetheremoteconsole-yourOracleServer-authoritytodisplayXinformationonyourdesktopPC(e.g.xhost+oracleserver),youwillgetthefollowingerror:
Xlib:connectionto":0.0"refusedbyserver
Xlib:ClientisnotauthorizedtoconnecttoServer
Inthiscase,IalwayshadtokillrunInstallerwhichwasstillrunninginthebackground!Ifyoudontdothis,runInstallerwillnotcompletelycomeupanymoreandyouwillnotseeanyerrormessagesthatrunInstallerishavingproblems.
Youmightalsowanttocleanup/tmp/OraInstall(9.0.1):
rm-rf/tmp/OraInstall
lWhenrunInstallerstartstoconfigurethetools("ConfigurationTools"),the"OracleNetConfigurationAssistant"willsometimeshang.SimplystoptheAssistantandrestartit,orcontinuetheinstallation.Whentherestoftheinstallationisfinished,doa"Retry"for"OracleNetConfigurationAssistant".Thisalwaysworkedforme.
lWhenthesystemstopstorespondduringtheOracleinstallation,inparticularduringthedatabasecreation,thenitisprobablybecauseyoudonthaveenoughRAMorenoughswapspace.Inoticedthatthewholesystemwillnotrespond(or"hang")forseveralminuteswhenIdidnothaveenoughswapspace.Ifthishappens,simplywaituntilthesystemstartstorespondagain.
lTheOracleinstallationalsorunsmakeetc.Inaproductionenvironmentyoumightnothavecompilersandotherdevelopmentpackagesinstalled.Thereforemakesureyouhavetemporarilythefollowingpackagesinstalled:gcc,cpp,egcs,egcs-c++,glibc-devel,kernel-headers.(ImnotsurethoughifallofthesepackageshavetobeonthesystemduringtheOracleinstallation.)
lIfforanyreasontheOracleinstallationdidntfinishsuccessfully,youmightwanttocleanupthefollowingfilesanddirectoriesbeforeyourestartoveragain:
rm-rf/etc/oraInst.loc/etc/oratab/tmp/OraInstall
/tmp/<OtherOracleOwnedFiles>
$ORACLE_BASE/*
15,StartupandShutdownofOracle9iDatabase
sqlplus:
svrmgrlisnotsupportedanymore.Youcannowdoeverythingwithsqlplus.
E.g.,tostartupthedatabase,executethefollowingcommands:
dba$sqlplus/nolog
SQL>connect/assysdba
SQL>startup
TheslashconnectsyoutotheschemaownedbySYS.SointhisexamplewearesayingthatwewanttoconnecttotheschemaownedbySYSwiththeprivilegeSYSDBA.SYSDBAgivesyouthefollowingprivileges:
sysoperprivilegesWITHADMINOPTION
createdatabase
recoverdatabaseuntil
$ORACLE_HOME/bin/dbstartand$ORACLE_HOME/bin/dbshut:
Youcanalsouse$ORACLE_HOME/bin/dbstarttostartupthedatabase,and$ORACLE_HOME/bin/dbshuttoshutdownthedatabase.Youcanplace$ORACLE_HOME/bin/dbstartintothe/etc/rc.d/rc.localbootscripttoautomaticallybringupthedatabaseatsystemboottime.Toget$ORACLE_HOME/bin/dbstartand$ORACLE_HOME/bin/dbshutworking,youneedtochangethethirdfieldforyourOracleSIDin/etc/oratabfrom"N"to"Y".
E.g.fortheOracleSID"test"Ichangedthelinein/etc/oratabfrom
test:/opt/oracle/product/9.2.0:N
toread
test:/opt/oracle/product/9.2.0:Y
For9.2.0,IalsohadtocopytheinitfileformySID"test"from/opt/oracle/admin/test/pfileto$ORACLE_HOME/dbstogetdbstartanddbshutworking:
cp/opt/oracle/admin/test/pfile/inittest.ora.642002224936$ORACLE_HOME/dbs/inittest.ora
Butfirstcheckifyourinitfilealreadyexistsin$ORACLE_HOME/dbs.
对于IT经理来说,令他们喜欢的MySQL的简单性还有另一方面。MySQL可以运行的更快速。某些人或许会说MySQL缺少了一些人们想要的功能。 |
|