Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 8.1.6 on SunOS 5.6
BASIC NON-OPTIMAL ORACLE 8.1.6 GUI INSTALLATION ON SOLARIS:
Overview: you will get oracle up and running ( non-optimally ) enough to do a simple queries on a small demo database
This install script was tested with 8.1.6 but should work with 8.1.5 and 8.1.7 and 9i
HARDWARE YOU NEED:
BASIC SKILLS YOU NEED:
GET ORACLE SOFTWARE:
OPTION A) You have the oracle 8.1.6 CDROM in your hot little hands
-or-
OPTION B) You downloaded the gzip file (called 816solaris.cpio.gz ) from technet.oracle.com ( or from someone you know and trust ) careful - its a 509 MB whopper !
-or-
OPTION C) Ask someone who cares ( like a DBA ) if there is an oracle webserver staging area on the network where oracle 8.1.6 solaris binaries are loaded
START INSTALL DIRECTIONS
Use /usr/bin/vi or dtpad or whatever editor you like
# vi /etc/system
set shmsys:shminfo_shmmax=0xffffffff set semsys:seminfo_semmap=512 set semsys:seminfo_semmni=512 set semsys:seminfo_semmns=512 set semsys:seminfo_semmnu=512 set semsys:seminfo_semmsl=128 set semsys:seminfo_semume=128
These values are good enough for a medium sized oracle instance - they can/should be made larger for really large oracle installs with lots of users and lots of data that require lots of cache and concurrency and hence lots of shared memory and semaphores.
search for 'shmsys' or 'semsys'
and a wealth of knowledge will abound on this topic
2) REBOOT SYSTEM: # reboot
3) CREATE A 'dba' GROUP ENTRY
Add an oracle dba group to the /etc/group file as the root user; here we've used 101 as an example - any legal gid will suffice (and if you want to use # admintool to do this go for it).
# groupadd -g 101
4) CREATE AN 'oracle' LOGIN AND USERID(UID) IN /etc/passwd
Add an oracle user id to the /etc/passwd file as the root user (all one line..)(again if you want to use # admintool do it)
# useradd -u 1004 -g 101 -d /export/home/oracle -s /bin/csh -c "Oracle 8i acct"
-m oracle
Now put a passwd on the new oracle account you just created
# passwd oracle
Notes/Variations:
-u --> uid = 1004 - any legal uid works ( 1000 <= uid < 60000 are legal )
-g --> gid = 101 - you *must* use the gid you defined for the 'dba' group
-d --> home directory - use any place you have 2 GB
(for this install i used /export/home/oracle )
-s --> default shell - ( i used /bin/csh but ksh and sh will work fine too;
the use of an included/supported shell is advised )
-c --> comment/GECOS field- this appears as From: when you send mail as oracle
-m -- > make the homedir - if its already there before you start install
then you can bag this option
'oracle' is the account name and it *must* be 'oracle'
oracle% vi .cshrc
# @(#)cshrc 1.11
#
setenv MANPATH /usr/share/man:/usr/dt/man:/usr/openwin/man:/usr/local/man setenv ORACLE_HOME /export/home/oracle/product/8.1.6 setenv ORACLE_BASE /export/home/oracle
# # NOTE: those of you using X Windows set DISPLAY appropriately # # for eg. if you were on system foobar across the network # then setenv DISPLAY foobar:0.0 # below we assume that you are local (aka :0.0 ) #
# # # this SID thing is really the System IDentifier # for your database - each oracle instance has a different SID #
set history=32
endif
6) TAKE ON YOUR ENVIRONMENT:
oracle% source .cshrc
oracle%
Now all those changes you made to .cshrc take effect and become part of your environment.
7) ENSURE YOU CAN DISPLAY X11 APPS PROPERLY: If you su - oracle in a window to do the install then **please** make sure - that you can start X tools on your desktop; for eg. if you run:
oracle% /usr/openwin/bin/xterm
and you see an "Xlib error: ...." then go into a window of the native desktop user ( ie. who you actually logged in as which might be 'root' or even some other user..) and then say:
# /usr/openwin/bin/xhost +
this command must run until it comes back with no error
many folks get burned by this - its X Windows security
and whoever truly logs in on the CDE desktop 1st then effectively
'owns' the CDE desktop (really the framebuffer that CDE runs on)
which means only that user can start
X11 GUI tools and display them unless you permit others ( or everyone )
via the 'xhost' command to have access to your desktop
to start X11 tools
8) THE ORACLE INSTALLATION Oracle 8.1.x(8i) can be installed from:
OPTION A) CDROM or ANY DISK BASED FILESYSTEM ( UFS,VxFS, NFS etc. ) OPTION B) The 816solaris.cpio.gz DOWNLOAD FILE OPTION C) A LOCAL OR REMOTE WEBSERVER WITH THE ORACLE STAGING ENVIRONMENT LOADED ( reachable via http - need web server name and port number and a java capable browser )
Basic concepts:
So you've been warned :)
On production you should separate binaries from data files and also separate different datafiles from one another (hopefully on many different disks). You should also use RAW database files because they are faster especially for high update/high writing applications. This quick/dirty install doesn't touch on the finer points of doing a production install.
So for the sake of this install how-to
we dropped everything into the same filesystem
to keep these install instructions quick and dirty.
Where appropriate we talk about RAW files so you can understand what to change to 'go RAW'
So then you need about 2 GB in a single filesystem (UFS or VxFS) where you can lay binaries and datafiles down then install,build,run and query oracle (again non-optimally)
# /etc/init.d/volmgt stop
# eject cdrom
<put in oracle CDROM and close CD door>
# cd /
# mount -rF hsfs /dev/dsk/c0t6d0s0 /cdrom
(if command above doesn't work then since you're macho
figure out if /dev/dsk/c0t5d0s0 will work .. if that doesn't fly
then figure out what you're CDROM device is )
-or-
Simply eject current CDROM and pop in the oracle CDROM and let vold mount it automagically for you
# su - oracle
oracle% cd /cdrom
< cd down into the directory that contains the 'runInstaller' program >
Go to step 10
oracle% mkdir /export/home/oracle/DIST
Download the 816oracle.cpio.gz file into the DIST subdirectory: (here's how big it is)
-rw-r--r-- 1 oracle dba 509097532 Apr 1 09:57 816solaris.cpio.gz
of course ORacle 8.1.5 and 8.1.7 and 9i will be different sizes as will different "Release Versions" of 8.1.6. The above is just to give you an idea of how big the gzip is in case you need to jockey it around.
Go to Step 9 now
(the runInstaller Java Program will come down as an applet to your browser)
if all works then you should just skip to step 11
9) UNPACK GZIP FILE ( IF YOU DOWNLOADED THE 816solaris.cpio.gz FILE )
oracle% cd oracle% cd DIST oracle% gunzip 816solaris.cpio.gz; cat 816solaris.cpio | cpio -icd oracle% ls 8.1.6 816solaris.cpio.gz 816solaris.cpiooracle%
oracle% cd 8.1.6 oracle% cd Disk1 oracle% ./runInstaller & oracle%
GUI screen #1 is a "Welcome"
click "Next"
GUI screen #2 is "File Locations"
This should all be correct so click "Next" (your preset env. variables took care of this) Note: The JAR file location specifies all products that are available on the CDROM that can be installed
GUI screen #3 is "Unix Group Name" - Enter 'dba' (no quotes) - Click "Next"
A popup window will tell you to run a script called: /tmp/OraInstall/orainstRoot.sh as the root user do so this way(exactly): oracle% cd /tmp/OraInstall oracle% su <enter root passwd> root# ./orainstRoot.sh Creating Oracle Inventory pointer file (/var/opt/oracle/oraInst.loc) Changing groupname of /export/home/oracle/oraInventory to dba. root# Then the popup will offer a "Retry" option - you should pick this option to continue
GUI screen #4 is "Available Products"
On this screen select choice: "Oracle 8i Enterprise Edition 8.1.6.0.0" then click "Next" Notes: Had we been installing an Oracle client( PC or Sun ) you'd have picked "Client". The "Client" option gives you enough binaries to get an Oracle SQL prompt into the server from over the network. If you were installing a System Management Station like Sun Management Center or other similar package ( BMC ) that has an "Oracle Agent" you might have picked: "Mgmt Infrastructure" which allows one to get perf/mgmt data from Oracle
GUI screen #5 is "Installation Types"
You should pick "Typical" which will plop down 999MB of files ( binaries and database files)
GUI screen #6 is "Database Identification"
For "Global Database Name" pick the name of your machine.domainname ( eg. my machine is called 'u5' and I am in the 'East' Domain ) so I say u5.east. (I used u5 for this example but if you're on a network then try to use your FQDN - which is your fully-qualified-domain-name) This is how oracle db's find one another on the network For SID use "TEST" (which should already be filled in) You can actually put whatever you want here 8 chars begins with letter ( no funny chars meta chars etc. ) This is how you 'name' your Oracle database its Oracle's System Identifier ( SID ).
GUI screen #7 is "Database File Location"
Directory for Database files: /export/home/oracle This is where the binaries and database files go: (again this is non-optimal). You can put them wherever you want as long as you have ~2GB of space and the 'oracle' user can write files/dirs there. The install will create an 'oradata' subdir and then stick all database DATA files ( not binaries ) underneath there. This is where the actual *.dbf files go ( aka the actual database data are kept in Oracle binary files ) You should not cp,mv,vi or mess with these files else you will hose your database. Oracle tracks the exact location of where these files live in the filesystem (and also for a RAW device/volume also)
GUI Screen #8 is "Summary - Oracle 8i Enterprise Edition 8.1.6.0.0
Scroll through this list and you can see all the software you have - there's a ton of stuff there if you actually have the "Enterprise Edition" ask for a "Typical" installation Click "Install" this will take a while .... 30-40 mins It logs all your installation to: /export/home/oracle/oraInventory/logs/installActions.log if you want to have a look at that file A popup appears and says that a "configuration script" must be run as root before you click ok - you must do this(exactly): oracle% cd /export/home/oracle/product/8.1.6 oracle% su <enter root passwd> # ./root.sh Running Oracle8 root.sh script... The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /export/home/oracle/product/8.1.6 ORACLE_SID= TEST Enter the full pathname of the local bin directory: [/usr/local/bin]: <hit enter> (If you want to use /opt/bin that's fine too as long as whatever you pick is in your path ) Creating /var/opt/oracle/oratab file... Entry will be added to the /var/opt/oracle/oratab file by Database Configuration Assistant when a database is created Finished running generic part of root.sh script. Now product-specific root actions will be performed. IMPORTANT NOTE: Please delete any log and trace files previously created by the Oracle Enterprise Manager Intelligent Agent. These files may be found in the directories you use for storing other Net8 log and trace files. If such files exist, the OEM IA may not restart. *Note: the path you select above could be either /usr/local/bin or /opt/bin or wherever is in your and all your users path's /usr/local/bin/coraenv and oraenv are shell scripts that will allow users to source a common file for Oracle environment information changes that you miss in your .cshrc or .profile. The other use is for the DBA who will be running more than one Oracle database on a single Unix system and will need to switch back and forth between each Oracle DBs(SIDs) to administer each. The /var/opt/oracle/oratab file will contain an entry for each oracle database that will run on this machine and whether or not to start it when the system boots or manually.
GUI Screen #9 is "Configuration Tools"
Now another popup has come up that is actually building the database and starting the oracle listener - notice the steps carefully because this is where all the magic actually happens Here's a printout from the Details of the Oracle Database Configuration Assistant: Listener Control complete. Listener started successfully. Listener configuration complete. Default local naming complete Net8 configuration successful. The exit code is 0 The datafiles will be copied from the CD to /export/home/oracle/oradata/u5. The Oracle database will be created for you. The (global) database name will be u5.East The system identifier for the database will be TEST. The password for the SYS account will be 'change_on_install' and the <passwd for> SYSTEM account will be 'manager'.
GUI Screen #10 is "End of Installation"
SUCCESS ! YOU ARE DONE and YOU HAVE AN ORACLE DATABASE!!!
Click "Exit"
YOUR BINARIES LIVE UNDER /export/home/oracle/product/8.1.6
Here they are:
u5{oracle}239% pwd
/export/home/oracle/product/8.1.6
u5{oracle}240% ls
JRE install.platform ocommon rdbms analyzer jar odg relnotes assistants javavm oracore root.sh bin jdbc orb slax classes jlib ord sqlj ctx ldap otrace sqlplus dbs lib owm svrmgr hs md plsql sysman install network precomp ysu5{oracle}241%
YOUR DATA FILES LIVE UNDER /export/home/oracle/oradata/u5
u5{oracle}230% pwd
/export/home/oracle/oradata/u5
u5{oracle}231% ls -al
total 818212
drwxrwxr-x 2 oracle dba 512 Apr 3 21:03 . drwxrwxr-x 3 oracle dba 512 Apr 3 20:59 ..
-rw-rw---- 1 oracle dba 843776 Apr 5 00:15 control01.ctl
-rw-rw---- 1 oracle dba 843776 Apr 5 00:15 control02.ctl
-rw-rw---- 1 oracle dba 843776 Apr 5 00:15 control03.ctl
-rw-rw-r-- 1 oracle dba 20979712 Apr 3 21:05 drsys01.dbf
-rw-rw-r-- 1 oracle dba 20979712 Apr 3 21:05 indx01.dbf
-rw-rw-r-- 1 oracle dba 73408512 Apr 4 21:41 rbs01.dbf
-rw-rw---- 1 oracle dba 512512 Apr 4 21:10 redo01.log
-rw-rw---- 1 oracle dba 512512 Apr 3 21:05 redo02.log
-rw-rw---- 1 oracle dba 512512 Apr 3 21:05 redo03.log
-rw-rw-r-- 1 oracle dba 246685696 Apr 3 21:42 system01.dbf
-rw-rw-r-- 1 oracle dba 20979712 Apr 3 21:05 temp01.dbf
-rw-rw-r-- 1 oracle dba 10493952 Apr 3 21:05 tools01.dbf
-rw-rw-r-- 1 oracle dba 20979712 Apr 3 21:05 users01.dbf
u5{oracle}232% EXPLANANTION OF DATAFILES: The Oracle Database Files are: control??.ctl - control files This is how oracle knows what files are part of the database and where they are kept. The control files are all sync'd to be the same ( they are written together at same time ) The Oracle control files notes where the config and initialization files are kept. Control files are each very small and all the same size they are usually spread out on different disks for reliability. rbs01.dbf - rollback segment(s) These maintain a user's read-consistent view of the database. Here's a brief example of what that means for a user. In oracle if I have a long running query and another user quickly updates data that I originally queried on before I get to actually querying/processing that data the RBS will be written to with the original data I had queried on to maintain a point in time read consistent view of the database for my query when it occurred. In production there are usually many of these because there are lots of users that may query/update the same data fields. redo??.log - redo logs Where transacted data (what data was updated) gets written *synchronously* to these files They are written in circular fashion; log to redo01 first then when it fills checkpoint(write out all dirty blocks) and log switch to redo02 etc. There are usually many of these because if you archive your redo log files ( called ARCHIVELOG MODE ) then after redo log #1 fills and a log switch takes place the ARCH daemon comes in an sequentially reads the old redo log #1 file and then ARCHIVES it ( writes it ) to another location on the filesystem (or even to another node (this is Standby MODE ) !! ) system01.dbf - the system tablespace ( ONLY ONE ) Where all oracle 'kernel' type information is kept. Its the controller portion of the database that controls all tablesapce allocation,users,roles etc. (its almost like /etc is to unix ) as you add/change datafiles the system.dbf knows/controls what you can do ( permissions ) , it provides template and the DDL data definition language support (it has the internal know how to do CREATE TABLE etc..) temp01.dbf - temporary tablespace When Oracle can't sort in memory it writes to file(s) to serve as slow memory to allow a query to run. If you know some SQL then this is where join processing is done and also where 'sort by' and 'order by' queries run. On a Datawarehouse type system this file can be many files and it can be quite large and heavily written to and read from. This is used systemwide by default but each user can have their own TEMP tables also. tools01.dbf - database tools are kept here user01.dbf - user data This is where the actual real live user data goes. This is just a sample name and ISV's can use whatever name they want as long as it isn't an internal name ( like those used above ). If you setup an online business then this is where all you customer name,address,credit card etc will land (there can be several of these files and there can be many names too!) SAP and Oracle Financials may have thousands of these files!! drsys01.dbf - context option This is used only if you plan on using Oracle interMedia Search functionality ( this used to be Oracle Context Option ) its key if your DB is also a search engine (or providing data to/for a search engine) indx01.dbf - index file Index files provide a faster way to look up data than scanning through gobs and gobs of data. This is likened to using an index in a book. Index hits are a good thing and reduce io load to help you scale better.
SQL BASICS:
Now what ? Well let's run a SQL query on the supplied demo database:
oracle% sqlplus scott/tiger (scott is the login ; tiger is the passwd)
SQL*Plus: Release 8.1.6.0.0 - Production on Mon Apr 3 21:28:40 2000
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
SQL> select * from emp;
<data rockets by :) :) >
lets put our query out to a file!
SQL> spool query1
SQL> select * from emp;
<data again rockets by! bummer !>
<but its going out to query1.lst also - so - stop spooling to file
and exit out and have a look at query1.lst >
SQL> spool off
SQL> quit
Disconnected from Oracle8i Enterprise Edition Release 8.1.6.0.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
u5{oracle}188% more query1.lst
SQL> select * from emp;
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-DEC-80 800 20 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- --------- ---------- ----------
DEPTNO
----------
7566 JONES MANAGER 7839 02-APR-81 2975 20 .
ok what the heck lets create a table as user 'system' ( the root user equivalent in oracle ) and put some data into it:
oracle% sqlplus system/manager
.
.
SQL> create table foobar ( name VARCHAR2(20) NULL,
addr VARCHAR2(80) NULL ); SQL> SQL>insert into foobar values('Chris Kordish','20 Overlook Dr, Tyngsboro MA' );SQL>insert into foobar values('Tom Haight','46 River Road, Mahwah, NJ' ); SQL>insert into foobar values('Thom Schoeffling',2 Scottish Dr, Somerset, NJ');
the 'describe' SQL command tells about a table and how its columns(aka fields or attributes) are defined:
SQL> desc foobar;
Name Null? Type ------------------------------- -------- ---- name VARCHAR2(20) addr VARCHAR2(80)
Here is how do a simple query on the data we just put into our new table. Below we ask for all the "name" fields in the table foobar.
SQL> select name from foobar;
Name
Oracle databases are really just tables.
A table has rows and columns just like
you'd think. Except that every row is different
from every other row and it has to be or else
you don't have a database.
In Oracle's world tables live in something called a 'tablespace' which is 1 or more 'datafiles' that make up many tables or one very very large table.
So you know basically what a database is but a "Relational" Database or RDBMS means that tables are 'related' to one another via like data. I will save this for your reading enjoyment or a class.
DOING ORACLE BY HAND (EXPERTS ONLY) DETAILED IN WIZARDS FILE
NOW if you -really- want to know more then have a look at the files in $ORACLE_BASE/admin/u5/pfile and read through initTEST.ora because this file and also the files in the 'create' subdir are what actually allow you to build oracle 'by hand'
here's the quick and dirty on how that goes
setup and just install the oracle binaries only (don't CREATE a DATABASE in the INSTALL PROGRAM ABOVE )
oracle% svrmgrl
SVRMGR> connect internal
Connected.
SVRMGR> startup nomount pfile=../pfile/initTEST.ora
Instance Started ( shared memory initialized )
...
...
SVRMGR> @crdbTEST
...voluminous output shuttles by ...
SVRMGR> @crdb2TEST
... more voluminous output shuttles by ...
NOW you have a database - most DBA's have lots of scripts and startup files ready to work this way - work with them to get this data and ensure that they are laying their data out so to pay attention to the right RAID protection levels and to reduce io bottlenecks etc. most oracle DBA's are pretty nice people who will show you 'how things work and are setup' per their site. all this stuff above is pretty easy to them and several Oracle DBA's have tailored their environment.
DOCUMENTATION:
The Oracle Docs are installed too !!!!
(install and admin guides are in PDF and HTML)
just start netscape on the system and point at:
file:///export/home/oracle/doc/unixdoc/index.htm
Have at it ! If you want fire up a web server on the system and then make docs available via http then thats great.
UNIX STUFF:
here's what oracle processes get started:
oracle 4255 1 0 20:59:28 ? 0:00 /export/ho me/oracle/product/8.1.6/bin/tnslsnr LISTENER -inherit oracle 4301 1 0 21:05:44 ? 0:01 ora_ckpt_TEST oracle 4295 1 0 21:05:43 ? 0:00 ora_pmon_TEST oracle 4311 1 0 21:05:44 ? 0:00 ora_snp2_TEST oracle 4303 1 0 21:05:44 ? 0:01 ora_smon_TEST oracle 4297 1 0 21:05:43 ? 0:00 ora_dbw0_TEST oracle 4299 1 0 21:05:43 ? 0:00 ora_lgwr_TEST oracle 4305 1 0 21:05:44 ? 0:00 ora_reco_TEST oracle 4307 1 0 21:05:44 ? 0:00 ora_snp0_TEST oracle 4309 1 0 21:05:44 ? 0:00 ora_snp1_TEST oracle 4313 1 0 21:05:45 ? 0:00 ora_snp3_TEST oracle 4315 1 0 21:05:45 ? 0:00 ora_s000_TEST oracle 4317 1 0 21:05:45 ? 0:00 ora_d000_TEST
these 4 procs are core to oracle - you miss one then you have NO database:
pmon = process monitor - cleans dead threads smon = system monitor - instance recovery etc dbw0 = db writer - reads/writes db files lgwr = log writer - writes transaction data to redo logs
these others add value
tnslsnr = net8 network listener over tcp/ip
ckpt = checkpointer process
reco = recovery agent for distributed db/tx's
etc.. the docs tell more
a shared memory segment gets created and semaphores are used:
u5{oracle}194% ipcs
IPC status from <running system> as of Mon Apr 3 21:43:16 EDT 2000
Message Queue facility inactive.
T ID KEY MODE OWNER GROUP
Shared Memory:
m 0 0x50008525 --rw-r--r-- root root m 101 0x9c516b44 --rw-rw---- oracle dba Semaphores: s 458752 0x45b2f76 --ra-ra---- oracle dbau5{oracle}195%
Comments/Additions and Changes to: chris.kordish_at_East.Sun.COM 781-442-2784 ( x22784 )
--
Received on Wed May 09 2001 - 00:12:23 CDT