37
Installing and Configuring Oracle Database 10g on the Linux Platform by Roger Schrag Database Specialists, Inc. About Database Specialists, Inc. Database Specialists, Inc. provides remote DBA services and onsite database support for your mission critical Oracle systems. Since 1995, we have been providing Oracle database consulting in Solaris, HP-UX, Linux, AIX, and Windows environments. We are DBAs, speakers, educators, and authors. Our team is continually recognized by Oracle, at national conferences and by leading trade publications. Learn more about our remote DBA , database tuning , and consulting services. Or, call us at 415-344-0500 or 888-648-0500. Introduction This paper will walk you through the steps of installing Oracle Database 10g release 2 (Oracle version 10.2.0) in a Linux environment. About 90% of the material presented here applies to other platforms as well. Everything you read in this paper is hands on, roll-up-your-sleeves-and-get-busy material for Oracle users who want to get an Oracle database up and running quickly without reading hundreds of pages of documentation and “readme” files. These steps are meant to get you up and running as fast as possible, while leveraging best practices in order to set up a scalable, robust database environment that offers high performance. In order to keep the steps reasonably simple this paper does not cover Real Application Clusters (RAC), nor does it cover Oracle Internet Directory (OID), Automatic Storage Management (ASM), or Grid Control. In this paper we will install the 10.2.0.2 release of Oracle Database 10g. This is the base distribution of Oracle Database 10g release 2 (10.2.0.1) with the 10.2.0.2 patch set applied on top. Be sure to check Oracle Support’s Metalink at http://metalink.oracle.com to see if a newer patch set has been released since this paper was published. You will need a valid

Installing and Configuring Oracle Database 10g on the Linux Platform

Embed Size (px)

DESCRIPTION

nnn

Citation preview

Installing and Configuring Oracle Database 10g on theLinux Platform by Roger Schrag Database Specialists, Inc. About Database Specialists, Inc. Database Specialists, Inc. provides remote DBA services and onsite database support for your mission critical Oracle systems. Since 1995, we ave been providin! Oracle database consultin! in Solaris, "#$%&, 'inu(, AI&, and )indows environments. )e are DBAs, spea*ers, educators, and autors. Our team is continually reco!ni+ed by Oracle, at national conferences and by leadin! trade publications. 'earn more about our remote DBA, database tunin!, and consultin! services. Or, call us at ,15$-,,$.5.. or ///$0,/$.5... Introduction This paper will walk you through the steps of installing Oracle Database 10g release 2 (Oracle version 10.2.0) in a Linu environ!ent. "bout #0$ of the !aterial presente% here applies to other platfor!s as well. &verything you rea% in this paper is han%s on' roll(up(your(sleeves(an%(get(busy !aterial for Oracle users who want to get an Oracle %atabase up an% running )uickly without rea%ing hun%re%s of pages of %ocu!entation an% *rea%!e+ files. These steps are !eant to get you up an% running as fast as possible' while leveraging best practices in or%er to set up a scalable' robust %atabase environ!ent that offers high perfor!ance. ,n or%er to keep the steps reasonably si!ple this paper %oes not cover -eal "pplication .lusters (-".)' nor %oes it cover Oracle ,nternet Directory (O,D)' "uto!atic /torage 0anage!ent ("/0)' or 1ri% .ontrol. ,n this paper we will install the 10.2.0.2 release of Oracle Database 10g. This is the base %istribution of Oracle Database 10g release 2 (10.2.0.1) with the 10.2.0.2 patch set applie% on top. 2e sure to check Oracle /upport3s 0etalink at http455!etalink.oracle.co! to see if a newer patch set has been release% since this paper was publishe%. 6ou will nee% a vali% .usto!er /ervice ,%entifier (./,) nu!ber in or%er to access the 0etalink website. 7e ran our Oracle installations on Dell servers e)uippe% with ,ntel 8eon an% 9entiu! processorsrunning -e% :at &nterprise Linu &/ release ;' up%ate 2. Oracle Database 10g is supporte% on other processor architectures an% Linu %istributions as well. e+ %uring the package group selection phase of the Linu installation' followe%by choosing the *&verything+ option. 1#. /de!/null2@. grep kernel:shm $82#. echo ";grep sem $8 5 tr limits:sog. "%% the following lines in the 5etc5profile file (or the 5etc5profile.local file on /C/& syste!s) if the oracle user uses the 2ash' Gorn or 2ourne shell4 h: if G $H-), 9 "oracle" IJ theni: if G $-3)00 9 "/bin/ksh" IJ thenK: ulimit -p B6ED?k: ulimit -n 6CCE6l: elsem: ulimit -u B6ED? -n 6CCE6n: fifio. ,f the oracle user uses the . shell' then a%% the following lines in the 5etc5csh.login file (or the 5etc5csh.login.local file on /C/& syste!s)4 p: if 1 $H-), 99 "oracle" 4 thenq: limit ma#proc B6ED?r: limit descriptors 6CCE6endif;0. .reate !ount points for the Oracle software an% the Oracle %atabase. &ach !ount point shoul% correspon% to a separate physical %evice or set of %evices. 6ou3ll nee% at least one !ount point. Typically you use one !ount point for the Oracle software an% one or !ore !ount points for each %atabase. One co!!on convention is to call the !ount points 5u01'5u02' an% so on. 2ecause !ount points are typically owne% by root an% the Oracle installer will run as the oracle user an% not as root' you shoul% create so!e sub%irectories now to avoi% per!ission proble!s later. .reate an app5oracle sub%irectory below the software !ount point' an% ora%ata sub%irectories below the !ount points to be use% for %atabase files. (6ou can put software an% a %atabase on the sa!e !ount point if you wish.) 0ake these sub%irectories owne% by the oracle user an% oinstall group' an% give the! DDB per!issions. 6ou can use co!!an%s like4 ;1. $ mkdir /u@B/app /u@B/app/oracle /u@B/oradata;2. $ cho7n oracleLoinstall /u@B/app /u@B/app/oracle /u@B/oradata$ chmod AAC /u@B/app /u@B/app/oracle /u@B/oradata;=. ,f you %ownloa%e% the Oracle software Oracle Technology M'-)9/u@B/app/oracle?. =D. = )nsure that /,'20)>3/() and 6&->'N(.& are not set:@. unset /,'20)>3/()#. unset 6&->'N(.&10. =11. = .f "our /tmp director" has less than ?@@ (b freeO then edit12. = and uncomment the follo7ing three lines:1=. = 6(P9/mount>point>7ith>?@@>mb>free1;. = 6(PN.,9/same>mount>point1B. = e#port 6(P 6(PN.,1?. =1D. = 6he documentation does not mention ho7 P'63 should be set:1@. = 6he follo7ing P'63 setting 7orked for usLe#port P'639/usr/local/binL/binL/usr/binL/usr/QBB,6/bin1#. Log out an% log back in as the oracle user fro! an 8 win%ow so that the environ!ent is set correctly. ,f you will be perfor!ing the installation fro! a 9. or other workstation instea% of using the %atabase server3s console %irectly' you !ay wish to forwar% 8 win%ow traffic over an //: connection. This offers increase% security (in the case of a public network) an% convenience. ,f you will be perfor!ing the installation fro! a 7in%ows 9.' you can use 9uTT6 to forwar% your 8 win%ow traffic by selecting the *&nable 811 forwar%ing+ checkbo in 9uTT63s //: Tunnels configuration screen. "s an alternative to 8' you !ay wish instea% to start a F3/()/installK. $ chmod u+# changePerm:sh$ :/changePerm:sh7hen running the change9er!.sh script' you will be aske% if you wish to continue. 9ress *y+ an% &nter.k. The libclntsh.so.10.1 library apparently is !issing fro! the list of files to be a%Kuste% by this patch' so a%Kust its per!issions !anually as follows4 $ chmod ACC $/,'20)>3/()/lib/libclntsh:so:B@:B2B. "t this point we are rea%y to patch the Oracle software installation with the latest !aintenance release available. Log onto Oracle Oracle /upport3s 0etalink (http455!etalink.oracle.co!) an% %ownloa% the latest patch set for Linu @? or whichever processor architecture your %atabase server uses. "s of this writing' release 10.2.0.2 (patch nu!ber ;B;D@1D) is the latest for Linu @?.2?. Cse a co!!an% like the following to unpack the patch set4 $ unSip p?C?ADBA>B@2@2>0.&HQ:Sip2D. /et the O-".L&H:O0& environ!ent variable to point to your Oracle ho!e with a co!!an% like4 $ e#port /,'20)>3/()9/u@B/app/oracle/product/B@:2:@/db>B2@. Double check that you are logge% in as oracle an% not root' an% that your D,/9L"6 environ!ent variable is still set correctly. Then change to the %irectory where you unpacke% the patch set an% start the Oracle Cniversal ,nstaller with these co!!an%s4 2#. $ cd /NiskB$ :/run.nstallerOnce again' we3ll walk through the installer pro!pts one at a ti!e4 a. The 7elco!e win%ow appears. .lick 3/();/,'20)>M'-)9;dirname $/,'20)>M'-);case "$/,'20)>M'-)" inT/product4 /,'20)>M'-)9;dirname $/,'20)>M'-); JJT4 JJesacNM'9$/,'20)>M'-)/admin= -ubstitute the locale and character set "ou plan to use for "our= database in the line belo7: -ome common choices areL= &0->0'&F9american>america:U)D.-/DDC9PB 10inu# and Hni# default4= &0->0'&F9american>america:'0E2H6VD 1Hnicode E:B4= &0->0'&F9american>america:H6VD 1Hnicode E:@4= &0->0'&F9american>america:U)D(-U.&B2C2 1Uindo7s4&0->0'&F9american>america:U)D.-/DDC9PBe#port /,'20)>M'-) NM' &0->0'&F= )nd customiSations=1. ,n the sa!e %irectory you3ll also fin% a shell script calle% coraenv that can be calle% fro! .cshrc. ,f you use . shell' you will want to back up an% e%it coraenv with si!ilar changes to the oraenv script.=2. The root.sh script copie% oraenv an% coraenv fro! OO-".L&H:O0&5bin to the 5usr5local5bin %irectory. 6ou Kust up%ate% these scripts in OO-".L&H:O0&5bin. .opy the up%ate% versions to the 5usr5local5bin %irectory.Create a Database These steps create an Oracle %atabase. &verybo%y will have %ifferent nee%s for their %atabase' but the steps here will yiel% a functional %atabase that you can further tailor to your specific nee%s. ,n this section we will use the Database .onfiguration "ssistant to create a %atabase' a%Kust the %atabase in or%er to better co!ply with in%ustry(proven best practices' an% configure Oracle 3/()9/u@B/app/oracle/product/B@:2:@/db>B=. .hoose a na!e for your Oracle instance' up to eight characters long. The instance na!e is easy to change at any ti!e. :owever' you will want to keep the instance na!e the sa!eas the %atabase na!e in or%er to avoi% confusion. .hanging the %atabase na!e later is possible' but not the easiest thing to %o. /o pick a na!e for the instance that you like. /et the O-".L&H/,D variable accor%ingly with a co!!an% like4 $ e#port /,'20)>-.N9de!B@ee;. Launch the Database .onfiguration "ssistant with the following co!!an%s4 B. $ cd $/,'20)>3/()/bin$ :/dbca7e3ll walk through the pro!pts one at a ti!e4 a. The 7elco!e win%ow appears. .lick 2/&&)26 / '- -R-NM'12. -W0> -3H6N/U& .(()N.'6)1=. -W0> -6',6HP (/H&61;. -W0> 3/-6 m! -i /u@B/oradata/de!B@ee/users@B:dbf /u@2/oradata/de!B@ee/users@B:dbf1B. -W0> '06), N'6'M'-) ,)&'() V.0)1?. 2 '06), N'6'M'-) N'6'V.0) '06), N'6'M'-) N'6'V.0) 2/&&)26 / '- -R-NM'-W0> 2,)'6) PV.0)9 -3H6N/U& .(()N.'6)=?. 0ake a backup copy of the pfile you create% in the previous step an% e%it the pfile to change para!eters as you wish' base% on your nee%s an% your server3s capabilities. 6ou can always change para!eters again in the future' so you are not locking yourself into anything right now. :ere is the pfile that we en%e% up with4 =D. T:audit>file>dest9dump>dest9read>count9B6;?. T:db>name9queue>processes9B@;@. T:open>cursors9E@@;#. T:os>authent>prefi#9aggregate>target92?mB1. T:processes9C@B2. T:remote>login>pass7ordfile9target92?@mB;. T:undo>management90.-6>0.-6)&), 9@#. 1-.N>0.-6 9#0. 1-.N>N)-2 9#1. 1F0/M'0>NM&'() 9 de!B@ee:dbspecialists:com4#2. 1/,'20)>3/() 9 /u@B/app/oracle/product/B@:2:@/db>B4#=. 1-.N>&'() 9 de!B@ee4#;. 44The per!issions on the listener.ora file shoul% be ?;0.#B. /tart the Oracle N'6' 9112. 1-),+.2)>&'() 9 de!B@ee:dbspecialists:com411=. 4411;. 6ou can verify that Oracle es correctly when they log in.D. &%it the 5etc5oratab file to verify that the entry for your %atabase is correct. Lines starting with a poun% sign are consi%ere% co!!ents an% are ignore%. &ach non(co!!ent line contains the na!e of one Oracle instance' its Oracle ho!e' an% a 6 or BLR12. To !ake the %atabase an% listeners start up auto!atically when the server reboots an% shut %own auto!atically when the server shuts %own' you3ll nee% to create a %bora file in 5etc5init.% an% either user the chkconfig co!!an% or !anually link %bora to 5etc5rc=.% an% 5etc5rc0.%. 6ou3ll nee% to %o this as the root user. Lirst create a file calle% %bora in 5etc5init.% as follows4 BE: =B?: = chkconfigL EC 99 B@BC: = descriptionL -tart and stop the /racle databaseO listenerO )(Oand i-W0PlusB6: =BA: /,'>3/()9/u@B/app/oracle/product/B@:2:@/db>BBD: /,'>/U&),9oracleB9: if G Z -f $/,'>3/()/bin/dbstart I2@: then2B: echo "/racle startupL cannot start"22: e#it2E: fi2?: case "$B" in2C:3/()/bin/dbstart $/,'>3/()"2A: su - $/,'>/U&), -c "$/,'>3/()/bin/emctl start dbconsole"2D: su - $/,'>/U&), -c "$/,'>3/()/bin/isqlplusctl start"29: touch /!ar/lock/subs"s/dboraE@: JJEB:3/()/bin/isqlplusctl stop"EE: su - $/,'>/U&), -c "$/,'>3/()/bin/emctl stop dbconsole"E?: su - $/,'>/U&), -c "$/,'>3/()/bin/dbshut $/,'>3/()"EC: rm -f /!ar/lock/subs"s/dboraE6: JJesac/et the per!issions on the %bora file to D004 $ chmod A@@ /etc/init:d/dbora"fter creating the %bora file' you nee% to link it to 5etc5rc=.% an% 5etc5rc0.% for startup an% shut%own. 6ou !ay %o this !anually as follows4 $ ln -s /etc/init:d/dbora /etc/rcE:d/-99dbora$ ln -s /etc/init:d/dbora /etc/rcC:d/-99dbora$ ln -s /etc/init:d/dbora /etc/rc@:d/8B@dbora$ ln -s /etc/init:d/dbora /etc/rcB:d/8B@dbora$ ln -s /etc/init:d/dbora /etc/rc2:d/8B@dbora$ ln -s /etc/init:d/dbora /etc/rc?:d/8B@dbora$ ln -s /etc/init:d/dbora /etc/rc6:d/8B@dbora"lternatively' you !ay use the chkconfig co!!an% to create the links as follows4 $ cd /etc/init:d$ /sbin/chkconfig --add dboraConclusion This paper walks you through the intricate %etails of getting Oracle Database 10g release 2 up an% running on a %atabase server running Linu. ,t !ay look co!plicate%' but that3s only because this paper goes %own to a nitty(gritty level of %etail. 9lease keep in !in%' though' that the re)uire!ents are %ifferent for every Oracle i!ple!entation.7e are etre!ely confi%ent that if you follow these steps to install Oracle Database 10g release 2(Oracle version 10.2.0) on a server with -e% :at &nterprise Linu an% an @? har%ware platfor!' the process will go very s!oothly for you. Things shoul% go nearly as s!oothly if you use another Linu %istribution certifie% by Oracle or another har%ware platfor! such as @?(?;. :owever' no single %ocu!ent can a%%ress every specific har%ware configuration an% every set ofbusiness nee%s. 9lease use this paper as a starting point to get Oracle up an% running in your shop. To get the best perfor!ance an% scalability' each syste! nee%s to be consi%ere% in%ivi%ually. bout the uthor -oger /chrag has been an Oracle D2" an% application architect for over fifteen years. :e starte%out at Oracle .orporation on the Oracle Linancials %evelop!ent tea! an% !ove% into the roles of pro%uction D2" an% %atabase architect at various co!panies in the /an Lrancisco 2ay "rea. -oger is a fre)uent speaker at Oracle Open 7orl% an% the ,OC1 LiveS conferences. :e is also Director of .onference 9rogra!!ing for the