You are on page 1of 20

InstalandoOracleDatabase11gRelease1en Linux5Centos5.

2(32and64bit)
PorJhonnyRamrezChiroque ElObjetivodeestemanuales aprenderlasbasesparalainstalacin delOracleDatabase11g Release1enunLinuxCentos5.2(orRHEL5). Contenido VistazoGeneral ParteI:InstalandoLinux ParteII:ConfigurandoLinuxparaOracle CrearDirectorios CreandoelOracleGroupsyCuentadeusuario ConfigurandoParmetrosdelKerneldeLinux ConfigurandolosShellLimitsparaelusuariooracle ParteIII:InstalandoOracle InstalandoelSoftware PartIV:Configurandoelautoarranque PartV:Configurandoelalmacenamiento Filesystems AutomaticStorageManagement Conclusin Apndice Overview TheguideprovidesawalkthroughofinstallinganOracleDatabase11gRelease1databaseon commodityhardwareforthepurposeofevaluation.IfyouarenewtoLinuxand/orOracle,this guide is for you. It starts with the basics and walks you through an installation of Oracle Database 11g Release 1 from the bare metal up. Both 32bit and 64bit architectures are covered.Unlessotherwiseindicated,theinstallationstepsarethesameforeither. Thisguidewilltaketheapproachofofferingtheeasiestpaths,withthefewestnumberofsteps foraccomplishingatask.Thisapproachoftenmeansmakingconfigurationchoicesthatwould be inappropriate for anything other than an evaluation. For that reason, this guide is not appropriateforbuildingproductionqualityenvironments,nordoesitreflectbestpractices. Thisguideisdividedintofourparts:PartIcoverstheinstallationoftheLinuxoperatingsystem, PartIIcoversconfiguringLinuxforOracle,PartIIIdiscussestheessentialsofinstallingtheOracle

Database, and Part IV covers creating additional filesystems and Automatic Storage Management(ASM).TheAppendixprovidesinformationtohelpyougetstartedusingyournew database including how to access the database interactively and how to stop and start the databaseandrelatedservices. PartI:InstallingEnterpriseLinux5 ThissectiondescribeshowtoinstallOracleEnterpriseLinux5(OEL5)onyourhardware(butthe same steps will apply for RHEL5). Please take a moment to make sure that your hardware meetsorexceedstheminimumhardwarerequirementsforOracleDatabase11gRelease1. Minimumhardwarerequirements: 32bit(x86) x86compatibleCPU 1GBRAM 10GBavailablediskspace(3.5GBfortheOraclesoftware+1.5GBforthedatabase+3GB forOEL5+2GBswap) 64bit(x86_64) x86_64compatibleCPU 1GBRAM 10.5GBavailablediskspace(4GBfortheOraclesoftware+1.5GBforthedatabase+3GB forOEL5+2GBswap) Note:BothLinuxandOraclemustbeinstalledforthesamearchitecture.32bitOraclewillonly runon32bitLinuxand64bitOraclewillonlyrunon64bitLinux. Now, let's walk through the process of installing the Linux operating system on a server. The instructionsassumeafreshinstallofLinux(asopposedtoanupgrade),thattheserverwillbe dedicatedtoOracle,andthatnootheroperatingsystemsordataareontheserver. Oracle Database 11g Release 1 is certified to run the base release of OEL5 without updates. FreecopiesofOEL5areavailablefordownload. 1. BoottheserverusingthefirstCDorDVD YoumayneedtochangeyourBIOSsettingstoallowbootingfromtheCD/DVD. 2. Thebootscreenappearswiththeboot:promptatthebottomofthescreen. SelectEntertocontinuewithagraphicalinstallontheconsole. Theinstallerscansyourhardware 3. OracleEnterpriseLinuxsplashscreen ClickonNext 4. LanguageSelection Acceptthedefault.

5. KeyboardConfiguration Acceptthedefault. 6. InstallorUpgrade SelectInstallandclickonNext 7. DiskPartitioningSetup Athoroughtreatmentofdiskpartitioningisbeyondthescopeofthisguide,which assumes that you are familiar with disk partitioning methods. WARNING:Improperlypartitioningadiskisoneofthesurestandfastestwaysto wipeouteverythingonyourharddisk.Ifyouareunsurehowtoproceed,stop andgethelp,oryouwillrisklosingdata!) Acceptthedefaultpartitionlayout.Notethatthedefaultlayoutissufficientforan evaluation,butwouldnotbeappropriateforotherpurposes.Thedefaultlayout may create a swap partition that is smaller than the Oracle guidelines recommend.Thisisalsosufficientforanevaluation. 8. NetworkConfiguration ItisusuallybesttoconfiguredatabaseserverswithastaticIPaddress.Todoso,click onEdit. Apopupwindowappears.UnchecktheConfigureusingDHCPbox,andentertheIP AddressandNetmaskfortheserver.BesurethatActivateonbootischecked, andclickonOK. IntheHostnamebox,selectmanuallyandenterthehostname. IntheMiscellaneousSettingsbox,entertheremainingnetworksettings. 9. TimeZoneSelection Choosethetimesettingsthatareappropriateforyourarea.Settingthesystemclock to UTC is usually a good practice for servers. To do so, select on System clock usesUTC. 10. SetRootPassword Enterapasswordforroot,andenteritagaintoconfirm. 11. PackageInstallation This guide will follow the Oracle recommended practice of using a "default RPMs" installation.AcceptthedefaultsoftwareselectionandclickonNext. AdditionalRPMsarerequiredtorunOracle Database11g Release 1. These willbe installedlater. 12. InstallingPackages Softwarewillbecopiedtotheharddiskandinstalled.Changedisksasprompted. 13. Aftersoftwareinstallationiscomplete

RemoveanybootCD/DVDmedia. ClickonNext. 14. Welcome ClickonForward 15. LicenseAgreement Read the license agreement. If you agree to the terms, select Yes, I agree to the LicenseAgreementandclickonForward. 16. FirewallConfiguration Forthepurposesofthiswalkthrough,nofirewallisconfigured.SelectDisabledand clickonForward. ClickonYeswhenthe"WarningNoFirewall"windowappears. 17. SELinux SelectDisabledfromthedropdownbarandclickonForward. 18. Kdump DonotenableKdump.AcceptthedefaultandclickonForward. 19. DateandTime SettheDateandTime. If you want to use an NTP server (recommended), select Enable Network Time ProtocolandenterthenameoftheNTPserver. 20. SystemUser Createanaccountforyourself. Do not create an account for oracle at this time. Creating the oracle account is coveredlaterinthissection. 21. SoundCard Configurethesoundcard,ifany,andclickonForward. 22. AdditionalCDs ClickonFinish. 23. Thesystemwillreboot 24. Agraphicalloginscreenappears. 25. Congratulations!YourOEL5softwareisnowinstalled. InstallingRequiredPackages AdditionalLinuxsoftwarepackagesmustbeinstalledbeforeinstallingtheOraclesoftware.The package requirements differ for 32bit and 64bit architectures, so this section contains separateinstructionsforeacharchitecture.

32bit(x86)Installations Required kernel version: 2.6.18 This kernel, or any of the kernels supplied in updates, works withOracleDatabase11gRelease1. Checkyourkernelversionbyrunningthefollowingcommand:
uname -r Ex: # uname -r 2.6.18-8.el5

Requiredpackageversions(orlater): compatlibstdc++333.2.361 elfutilslibelf0.1253.el5 elfutilslibelfdevel0.1253.el5 glibc2.512 glibcdevel2.512 glibccommon2.512 gcc4.1.152.el5 gccc++4.1.152.el5 kernelheaders libgcc4.1.152.el5 libaio0.3.1063.2 libaiodevel0.3.1063.2 libstdc++4.1.152.el5 libstdc++devel4.1.152.el5 unixODBC2.2.117.1 unixODBCdevel2.2.117.1 sysstat7.0.03.el5 binutils2.17.50.0.62.el5 make3.811.1 If you've performed a "default RPMs" install as suggested by Oracle, there are still some requiredpackagesthatmustbeinstalled: compatlibstdc++33 elfutilslibelfdevel glibcdevel2.5 gcc

gccc++ libaiodevel libstdc++devel unixODBC unixODBCdevel sysstat To install theremainingpackages,mount theOracleEnterpriseLinuxmediaandmove tothe directorycontainingtheRPMs. Somerequiredpackagesaredependentuponotherpackages,sothedependantpackagesmust be installed as well. Login as root and run the following commands to install the remaining requiredpackagesandtheirdependentpackages.(Warning:packagesoftenmovefromdiskto diskacrossdifferentreleases.) MountCDCENTOS5.2
cd cd_mount_point/RPMS rpm -ivh elfutils-libelf-devel* glibc-devel-2* glibc-headers-2* gcc-4* libgomp-4* gccc++-4* libstdc++-devel-4* Ex: # rpm -ivh elfutils-libelf-devel* glibc-devel-2* glibc-headers-2* gcc-4* libgomp-4* gcc-c++-4* libstdc++-devel-4* warning: compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:libgomp ########################################### [ 25%] 2:glibc-headers ########################################### [ 33%] 3:glibc-devel ########################################### [ 42%] 4:gcc ########################################### [ 50%] 5:gcc-c++ ########################################### [ 58%] 6:elfutils-libelf-devel-s########################################### [ 92%] 7:elfutils-libelf-devel ########################################### [100%] 8:libstdc++-devel-4 ########################################### [100%]

rpm -ivh compat-libstdc++-33* libaio-devel* sysstat* unixODBC* Ex: # rpm -ivh compat-libstdc++-33* libaio-devel* sysstat* unixODBC* warning: sysstat-7.0.0-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:unixODBC ########################################### [ 8%] 2:libaio-devel ########################################### [ 75%] 3:compat-libstdc++-33 ########################################### [ 83%] 4:sysstat ########################################### [100%]

Toverifythattherequiredpackageshavebeeninstalledonyoursystem,runthefollowing command:
rpm -q compat-libstdc++-33 elfutils-libelf-devel glibc-devel-2.5 gcc gcc-c++ libaiodevel libstdc++-devel \ unixODBC unixODBC-devel sysstat binutils elfutils-libelf glibc glibc-common libaio libgcc libstdc++ make

Ex: # rpm -q compat-libstdc++-33 elfutils-libelf-devel glibc-devel-2.5 gcc gcc-c++ libaiodevel libstdc++-devel \ > unixODBC unixODBC-devel sysstat binutils elfutils-libelf glibc glibc-common libaio libgcc libstdc++ make compat-libstdc++-33-3.2.3-61 elfutils-libelf-devel-0.125-3.el5 glibc-devel-2.5-12 gcc-4.1.1-52.el5 gcc-c++-4.1.1-52.el5 libaio-devel-0.3.106-3.2 libstdc++-devel-4.1.1-52.el5 unixODBC-2.2.11-7.1 unixODBC-devel-2.2.11-7.1 sysstat-7.0.0-3.el5 binutils-2.17.50.0.6-2.el5 elfutils-libelf-0.125-3.el5 glibc-2.5-12 glibc-common-2.5-12 libaio-0.3.106-3.2 libgcc-4.1.1-52.el5 libstdc++-4.1.1-52.el5 make-3.81-1.1

64bit(x86_64)Installations Required kernel version: 2.6.18 This kernel, or any of the kernels supplied in updates, works withOracleDatabase11gRelease1. Checkyourkernelversionbyrunningthefollowingcommand:
uname -rm Ex: # uname -rm 2.6.18-8.el5 x86_64

Requiredpackageversions(orlater): binutils2.17.50.0.6 compatlibstdc++333.2.3 compatlibstdc++333.2.3(32bit) elfutilslibelf0.125 elfutilslibelfdevel0.125 gcc4.1.1 gccc++4.1.1 glibc2.512 glibc2.512(32bit) glibccommon2.5 glibcdevel2.5 glibcdevel2.512(32bit)

libaio0.3.106 libaio0.3.106(32bit) libaiodevel0.3.106 libgcc4.1.1 libgcc4.1.1(32bit) libstdc++4.1.1 libstdc++4.1.1(32bit) libstdc++devel4.1.1 make3.81 sysstat7.0.0 Note that there are a number of packages where both the 64bit and 32bit RPMs must be installed.Fortunately,bothareprovidedonthe64bitLinuxinstallationmedia. If you've performed a "default RPMs" install as suggested by Oracle, there are still some requiredpackagesthatmustbeinstalled: compatlibstdc++333.2.3 compatlibstdc++333.2.3(32bit) elfutilslibelfdevel0.125 gcc4.1.1 gccc++4.1.1 glibcdevel2.5 glibcdevel2.512(32bit) libaiodevel0.3.106 libstdc++devel4.1.1 sysstat7.0.0 To install theremainingpackages,mount theOracleEnterpriseLinuxmediaandmove tothe directorycontainingtheRPMs. Somerequiredpackagesaredependentuponotherpackages,sothedependantpackagesmust be installed as well. Login as root and run the following commands to install the remaining requiredpackagesandtheirdependentpackages: MountDVDCentos5.2
mount -t iso9660 -r /dev/cdrom /media cd /media/Server rpm -ivh elfutils-libelf-devel*.x86_64.rpm glibc-devel-2* gcc-4*.x86_64.rpm gcc-c++4*.x86_64.rpm libstdc++-devel-4*.x86_64.rpm glibc-headers*.x86_64.rpm libgomp*.x86_64.rpm Ex: # rpm -ivh elfutils-libelf-devel*.x86_64.rpm glibc-devel-2* gcc-4*.x86_64.rpm gcc-c++-

4*.x86_64.rpm libstdc++-devel-4*.x86_64.rpm glibc-headers*.x86_64.rpm libgomp*.x86_64.rpm warning: elfutils-libelf-devel-0.125-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:glibc-headers ########################################### [ 11%] 2:glibc-devel ########################################### [ 22%] 3:libgomp ########################################### [ 33%] 4:gcc ########################################### [ 44%] 5:libstdc++-devel ########################################### [ 56%] 6:gcc-c++ ########################################### [ 67%] 7:glibc-devel ########################################### [ 78%] 8:elfutils-libelf-devel-s########################################### [ 89%] 9:elfutils-libelf-devel ########################################### [100%]

rpm -ivh compat-libstdc++-33* libaio-devel*.x86_64.rpm Ex: # rpm -ivh compat-libstdc++-33* libaio-devel*.x86_64.rpm warning: compat-libstdc++-33-3.2.3-61.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:libaio-devel ########################################### [ 33%] 2:compat-libstdc++-33 ########################################### [ 67%] 3:compat-libstdc++-33 ########################################### [100%]

rpm -ivh sysstat* Ex: # rpm -ivh sysstat* warning: sysstat-7.0.0-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159 Preparing... ########################################### [100%] 1:sysstat ########################################### [100%]

Toverifythattherequiredpackageshavebeeninstalledonyoursystem,runthefollowing command:
rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils \ compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc \ glibc-common glibc-devel-2.5 libaio libaio-devel libgcc libstdc++ libstdc++-devel \ make sysstat Ex: # rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" binutils \ > compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc \ > glibc-common glibc-devel-2.5 libaio libaio-devel libgcc libstdc++ libstdc++-devel \ > make sysstat binutils-2.17.50.0.6-2.el5 (x86_64) compat-libstdc++-33-3.2.3-61 (i386) compat-libstdc++-33-3.2.3-61 (x86_64) elfutils-libelf-0.125-3.el5 (x86_64) elfutils-libelf-devel-0.125-3.el5 (x86_64) gcc-4.1.1-52.el5 (x86_64) gcc-c++-4.1.1-52.el5 (x86_64) glibc-2.5-12 (i686) glibc-2.5-12 (x86_64) glibc-common-2.5-12 (x86_64) glibc-devel-2.5-12 (x86_64) glibc-devel-2.5-12 (i386) libaio-0.3.106-3.2 (x86_64) libaio-0.3.106-3.2 (i386)

libaio-devel-0.3.106-3.2 (x86_64) libgcc-4.1.1-52.el5 (x86_64) libgcc-4.1.1-52.el5 (i386) libstdc++-4.1.1-52.el5 (x86_64) libstdc++-4.1.1-52.el5 (i386) libstdc++-devel-4.1.1-52.el5 (x86_64) make-3.81-1.1 (x86_64) sysstat-7.0.0-3.el5 (x86_64)

PartII:ConfiguringLinuxforOracle NowthattheLinuxsoftwareisinstalled,youneedtoconfigureitforOracle.Thissectionwalks throughthestepsrequiredtoconfigureLinuxforOracleDatabase11gRelease1. CreatetheOracleGroupsandUserAccount Next, create the Linux groups and user account that will be used to install and maintain the OracleDatabase11gRelease1software.Theuseraccountwillbecalledoracle,andthegroups willbeoinstallanddba.Executethefollowingcommandsasroot:
/usr/sbin/groupadd oinstall /usr/sbin/groupadd dba /usr/sbin/useradd -m -g oinstall -G dba oracle id oracle Ex: # /usr/sbin/groupadd oinstall # /usr/sbin/groupadd dba # /usr/sbin/useradd -m -g oinstall -G dba oracle # id oracle uid=501(oracle) gid=502(oinstall) groups=502(oinstall),503(dba)

Setthepasswordontheoracleaccount:
passwd oracle Ex: # passwd oracle Changing password for user oracle. New password: Retype new password: passwd: all authentication tokens updated successfully.

CreateDirectories NowcreatedirectoriestostoretheOracleDatabase11gRelease1softwareandthedatabase files.ThisguideadherestotheOptimalFlexibleArchitecture(OFA)forthenamingconventions usedincreatingthedirectorystructure.FormoreinformationonOFAstandards,seeAppendix DoftheOracleDatabaseInstallationGuide11gRelease1(11.1)forLinux. Thefollowingassumesthatthedirectoriesarebeingcreatedintherootfilesystem.Thisisdone for the sake of simplicity and is not recommended as a general practice. These directories wouldnormallybecreatedasseparatefilesystems. Issuethefollowingcommandsasroot:
mkdir -p /o01/app/oracle chown -R oracle:oinstall /o01/app chmod -R 775 /o01/app

ConfiguringtheLinuxKernelParameters OracleDatabase11gRelease1requiresthekernelparametersettingsshownbelow.Thevalues given are minimums, so if your system uses a larger value, don't change it. Linux allows modificationofmostkernelparameterswhilethesystemisupandrunning,sothere'snoneed torebootthesystemaftermakingkernelparameterchanges.
kernel.shmall = 2097152 kernel.shmmax = 536870912 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default=4194304 net.core.wmem_default=262144 net.core.rmem_max=4194304 net.core.wmem_max=262144

Note that OEL 5 already has values defined for kernel.shmall and kernel.shmmax. Use the defaultvaluesiftheyarethesameorlargerthantherequiredvalues. Ifyou'refollowingalongandhavejustinstalledLinux,thekernelparameterswillallbeattheir defaultvaluesandyoucanjustcutandpastethefollowingcommandswhileloggedinasroot.
cat >> /etc/sysctl.conf <<EOF kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default=4194304 net.core.wmem_default=262144 net.core.rmem_max=4194304 net.core.wmem_max=262144 EOF /sbin/sysctl -p Ex: # cat >> /etc/sysctl.conf <<EOF net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default=262144 > kernel.shmmni = 4096 > kernel.sem = 250 32000 100 128 > fs.file-max = 65536 > net.ipv4.ip_local_port_range = 1024 65000 > net.core.rmem_default=4194304 > net.core.wmem_default=262144 > net.core.rmem_max=4194304 > net.core.wmem_max=262144 > EOF # /sbin/sysctl -p net.ipv4.ip_forward = 0 net.ipv4.conf.default.rp_filter = 1 net.ipv4.conf.default.accept_source_route = 0 kernel.sysrq = 0 kernel.core_uses_pid = 1 net.ipv4.tcp_syncookies = 1 kernel.msgmnb = 65536 kernel.msgmax = 65536 kernel.shmmax = 4294967295 kernel.shmall = 268435456 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128

fs.file-max = 65536 net.ipv4.ip_local_port_range = 1024 65000 net.core.rmem_default = 4194304 net.core.wmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_max = 262144

Runthefollowingcommandsasroottoverifyyoursettings:
/sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl /sbin/sysctl -a -a -a -a -a -a -a -a | | | | | | | | grep grep grep grep grep grep grep grep shm sem file-max ip_local_port_range rmem_default rmem_max wmem_default wmem_max

Ex: # /sbin/sysctl -a | grep shm kernel.shmmni = 4096 kernel.shmall = 268435456 kernel.shmmax = 4294967295 kernel.shm-use-bigpages = 0 # /sbin/sysctl -a | grep sem kernel.sem = 250 32000 100 128 # /sbin/sysctl -a | grep file-max fs.file-max = 65536 # /sbin/sysctl -a | grep ip_local_port_range net.ipv4.ip_local_port_range = 1024 65000 # /sbin/sysctl -a | grep rmem_default net.core.rmem_default = 4194304 # /sbin/sysctl -a | grep rmem_max net.core.rmem_max = 4194304 # /sbin/sysctl -a | grep wmem_default net.core.wmem_default = 262144 # /sbin/sysctl -a | grep wmem_max net.core.wmem_max = 262144

Settingshelllimitsfortheoracleuser Oracle recommends setting limits on the number of processes and open files each Linux accountmayuse.Tomakethesechanges,cutandpastethefollowingcommandsasroot:
cat >> oracle oracle oracle oracle EOF /etc/security/limits.conf <<EOF soft nproc 2047 hard nproc 16384 soft nofile 1024 hard nofile 65536

cat >> /etc/pam.d/login <<EOF session required /lib/security/pam_limits.so session required pam_limits.so EOF

Changethedefaultprofileforbashandkshaswellasthedefaultloginscriptforcshell.
cat >> /etc/profile <<EOF if [ \$USER = "oracle" ]; then if [ \$SHELL = "/bin/ksh" ]; then ulimit -p 16384 ulimit -n 65536 else

ulimit -u 16384 -n 65536 fi umask 022 fi EOF cat >> /etc/csh.login <<EOF if ( \$USER == "oracle" ) then limit maxproc 16384 limit descriptors 65536 umask 022 endif EOF

Disablesecurelinuxbyeditingthe/etc/selinux/configfile,makingsuretheSELINUXflagisset asfollows:
SELINUX=disabled

Alternatively,thisalterationcanbedoneusingtheGUItool(Applications>SystemSettings> SecurityLevel).ClickontheSELinuxtabanddisablethefeature.IfSELinuxisdisabledafter installation,theserverwillneedarebootforthechangetotakeeffect. PartIII:InstallingOracle OracleDatabase11gRelease1canbedownloadedfromOTN.Oracleoffersadevelopmentand testinglicensefreeofcharge.However,nosupportisprovidedandthelicensedoesnotpermit productionuse.AfulldescriptionofthelicenseagreementisavailableonOTN. The easiest way to make the Oracle Database 11g Release 1 distribution media available on yourserveristodownloadthemdirectlytotheserver. Usethegraphicallogintologinasoracle. CreateadirectorytocontaintheOracleDatabase11gRelease1distribution:
mkdir11gR1_db

To download Oracle Database 11g Release 1 from OTN, point your browser to the Oracle DatabaseDownloadPage.ReadtheOTNLicenseagreement.Ifyouagreewiththerestrictions andthelicenseagreement,clickonAcceptLicenseAgreement. ClickontheLinuxx86link(32bit)orLinuxx8664link(64bit)andsavethefileinthedirectory youcreatedforthispurpose(11gR1_db)ifyouhavenotalreadyloggedintoOTN,youmaybe promptedtodosoatthispoint. Unzipandextractthefile.
cd11gR1_db For32bit unziplinux_11gR1_database.zip For64bit unziplinux.x64_11gR1_database.zip

InstalltheSoftwareandCreateaDatabase

Loginusingtheoracleaccount. ChangedirectorytothedirectorycontainingtheOracleDatabase11gRelease1software.
Ex: $cd$HOME/11gR1_db/database

StarttheOracleUniversalInstaller.
$./runInstaller

1. SelectInstallationMethod SelectBasicInstallation OracleBaseLocation:/o01/app/oracle OracleHomeLocation:/o01/app/oracle/product/11.1.0/db_1 InstallationType:EnterpriseEdition(3.3GB) UNIXDBAGroup:dba MakesureCreateStarterDatabaseischecked GlobalDatabaseName:demo1 EntertheDatabasePasswordandConfirmPassword ClickonNext 2. SpecifyInventoryDirectoryandCredentials InventoryDirectory:/u01/app/oraInventory OperatingSystemgroupname:oinstall ClickonNext 3. ProductspecificPrerequisiteChecks Ifyou'vebeenfollowingthesteps inthisguide,allthechecksshouldpasswithout difficulty. You may receive a warning related to swap file size if the default partitionlayoutwasusedduringOEL5installation.Thismaybesafelyignored.If oneormorechecksfail,correcttheproblembeforeproceeding. ClickonNext 4. OracleConfigurationManagerRegistration LeavethisdisabledforthedemoandclickonNext 5. Summary Asummaryoftheproductsbeinginstalledispresented. ClickonInstall. 6. Install Installationprogressisdisplayed 7. ConfigurationAssistants

The Oracle Net, Oracle Database, and iSQL*Plus configuration assistants will run automatically TakenoteoftheinformationpresentedintheDatabaseConfigurationAssistantpop upwindowandclickonOK. 8. ExecuteConfigurationScripts At the end of the installation, a pop up window will appear indicating scripts that needtoberunasroot.Loginasrootandruntheindicatedscripts. ClickonOKwhenfinished. 9. EndofInstallation MakenoteoftheURLspresentedinthesummary,andclickonExitwhenready. 10. Congratulations!YournewOracleDatabase11gRelease1databaseisupandreadyfor use. Afterinstallationcomplets,thefollowingcommandsarenecessarytoenableOracletoload itssharedobjectsandtosometextrelocationwithit:
chcon chcon chcon chcon -t -t -t -t textrel_shlib_t textrel_shlib_t textrel_shlib_t textrel_shlib_t /o01/app/oracle/db_1/lib/libnnz11.so /o01/app/oracle/db_1/lib/libclntsh.so.11 /o01/app/oracle/db_1/lib/libnque11.so /o01/app/oracle/db_1/lib/libsqlplus.so

otherwiseyoullsomeerrorslike
/o01/app/oracle/db_1/bin/ocrconfig.bin: error while loading shared libraries: /o01/app/oracle/db_1/lib/libnnz11.so: cannot restore segment prot after reloc: Permission denied

PartIV:Configurandoelautoarranque Postinstalacion Laguiadeinstalaciondeoracledescribeunalargalistadeprocedimientosarealizardespuesde lainstalacion.Algunossonnecesarios,otrosquizanoseannecesariosentodosloscaos.Echa unvistazoalaguiadeinstalacionparaverestosprocedimientos.Yoaqudescribirelospasos quesonutiliesparalainstalacionminimaqueyousequeparecesuficienteparalasoperaciones basicasdelabasededatos. 5.1Editandoelarchivooratab Hayunpasoenparticularqueesimportante,deformaquepuedasarrancarypararlabasede datos desde la linea de comandos en cualquier momento, y tambien permitir que la base de datosselanceenelarranque.Vealdirectorio/etcyeditaelarchivooratab.Enlalinea:
ORCL:/o01/app/oracle/:N

PonelultimovaloraYyestedeberiaversecomo:
ORCL:/o01/app/oracle/:Y

Ahoraguardaelachvoyvuelvealdirectoriohomedeloracle Scriptparaqueseinicieoracleautomaticamenteenelarranquedelamaquina. Generalmenteesunabuenaideaautomatizareliniciodelabasededatosenelarranquedela maquina.Enestecasonecesitarasunscript,quepuedeserincluidoenlosnivelesdeejecucion.


#!/bin/bash # # Run-level Startup script for the Oracle Instance and Listener # # chkconfig: 345 91 19 # description: Startup/Shutdown Oracle listener and instance

ORA_HOME="/o01/app/oracle/db_1" ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ] then echo "Oracle startup: cannot start" exit 1 fi

# depending on parameter -- startup, shutdown, restart # of the instance and listener or usage display

case "$1" in start) # Oracle listener and instance startup echo -n "Starting Oracle: " su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start" su - $ORA_OWNR -c $ORA_HOME/bin/dbstart su - $ORA_OWNR -c $ORA_HOME/bin/emctl start dbconsole touch /var/lock/subsys/oracle echo "OK" ;; stop) # Oracle listener and instance shutdown echo -n "Shutdown Oracle: " su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"

su - $ORA_OWNR -c $ORA_HOME/bin/dbshut su - $ORA_OWNR -c $ORA_HOME/bin/emctl stop dbconsole rm -f /var/lock/subsys/oracle echo "OK" ;; reload|restart) $0 stop $0 start ;; *) echo "Usage: $0 start|stop|restart|reload" exit 1 esac exit 0

Copiaypegaestescriptdeacuerdocontuconfiguracion.Unavezquehascopiadoypegadoel archvomueveloaldirectorio/etc/rc.d/init.dycambialeeldueoylosatributosparaquetenga los mismos que los otros archivos del directorio. Para hacerlo tendras que haberte logueado comoroot.Anuestroficheroyolehellamadoarrancaoracle. Laquintalineadeestescriptdice:
# chkconfig: 345 91 19

Yesusadaporelcomandochkconfigcuandoconfiguralosscriptsenlosnivelesdeejecucion.El valor 345 lista los niveles de ejecucion en los que permitimos a Oracle ejecutarse, asi que si quieresqueOracleseejecutesoloenlosnives3y5cambiaestevaloa35.Elsiguientevalor (91)describeelnumerodeordenenelprocesodeinicio,estoes,sihay100procesosdeinicios, el arranque de oracle sera el91 en ejecutarse. El siguintenumero es el numero de apagado, significandoquesihay100procesosqueapagar,elprocesodeoracleserael19.Estosnumeros seusanparaconfigurarlaposicionrelativadeoracleenlosprocesosdearranqueyapagado. Los que he puesto aqu son un ejemplo, tu puedes cambiarlos, pero ten en cuenta que loas instancias de oracle no pueden iniciarse si no hay ciertos procesos del sistema corriendo previamente.Ahoraejecutaelsiguientecomando.
chkconfig --add arrancaoracle

Esto aadira los links correspondientes en los directorios de nivel de ejecutcion tal y como estanlistadosenelprincipiodelscript.

Paracomprobarquefuncionatendrasquereiniciarelsistema,perorecuerdaqueantesdeque funcionelaautomatizaciontienenqueestarconfiguradoslosparametrosdelkernel.Dehecho deberiasincluirlosparametrosdelkerneltuneupinelarranquetambien.(nosotroslohicimos conelrc.local) ComprobandotuconfiguracionconSQL*Plus Si has instalado la tipica base de datos, deberia haber un usuario creado llamado scott, el passwordestiger.Simplementeejecutaelcomando
sqlplus scott/tiger

quedeberiaejecutarelinterpretedeSQL*Plusyloguearteccomelusuarioscott.Deberiasver unapantalladebienvenida. Conclusion Now that your database is up and running, you can begin exploring the many new features offered in Oracle Database 11g Release 1. A great place to start is with Oracle Enterprise Manager.Ifyou'reunsurewheretobegin,theOracleDatabaseConcepts11gRelease1andthe 2DayDBAguidewillhelpfamiliarizeyouwithyournewdatabase.OTNalsohasanumberof guidesdesignedtohelpyougetthemostoutofOracleDatabase11gRelease1. Appendix AccessingtheDatabasewithSQL*Plus LogintoLinuxasoracle.Settheenvironment. SettheOracleenvironmentvariables:
$ . oraenv ORACLE_SID = [demo1] ? demo1 The Oracle base for ORACLE_HOME=/o01/app/oracle/db_1 is /o01/app/oracle

RunSQL*Plus:
$sqlplus SQL*Plus:Release11.1.0.6.0ProductiononSunNov423:56:472007 Copyright(c)1982,2007,Oracle.Allrightsreserved. Enterusername:/assysdba Connectedto: OracleDatabase11gEnterpriseEditionRelease11.1.0.6.0Production WiththePartitioning,OLAP,DataMiningandRealApplicationTestingoptions SQL>

UsingOracleEnterpriseManager11gDatabaseControl InaWebbrowser,connecttotheURLprovidedduringtheinstallation. Ex:


https://ds1.orademo.org:1158/em (You may have to use the IP address instead of the host

nameifyourdatabaseserverisntinyourDNS.)
User Name: SYSTEM Password: <The password you chose during installation> Connect As: Normal

Clickon<Login>

WelcometoOracleEnterpriseManager11gDatabaseControl. StartingandStoppingOracleEnterpriseManagerDatabaseControl:
$ emctl start dbconsole $ emctl stop dbconsole

StartingandStoppingtheListener: Thelisteneracceptsconnectionrequestsfromclientsandcreatesconnectionstothedatabase oncethecredentialshavebeenauthenticated.BeforeyoucanuseOEM,thelistenermustbe up.


$ lsnrctl start $ lsnrctl stop

StartingandStoppingtheDatabase: TheeasiestwaytostartandstopthedatabaseisfromtheOEMConsole.Todothatfromthe commandline,useSQL*Pluswhileloggedinasoracle,asfollows:

Startup:
$ sqlplus SQL*Plus: Release 11.1.0.6.0 - Production on Mon Nov 5 00:00:31 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Enter user-name: / as sysdba Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> startup ORACLE instance started. Total System Global Area 849530880 bytes Fixed Size 1303216 bytes Variable Size 377490768 bytes Database Buffers 465567744 bytes Redo Buffers 5169152 bytes Database mounted. Database opened. SQL> exit

Shutdown:
$ sqlplus SQL*Plus: Release 11.1.0.6.0 - Production on Mon Nov 5 00:00:31 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. Enter user-name: / as sysdba Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> exit