add the following lines to the bottom
of the /etc/system file and reboot some sample entries are shown below:
set shmsys:shminfo_shmmax=30000000
set shmsys:shminfo_shmmin=1
set shmsys:shminfo_shmmni=100
set shmsys:shminfo_shmseg=10
set semsys:seminfo_semmns=200
set semsys:seminfo_semmni=50
BE SURE TO TYPE THE
PARAMETERS CORRECTLY as a typo error can make the system un-bootable.
(set shmsys:shminfo_shmmax greater
than the largest SGA size you will have on your system.)
HPUX:
Under the System Admin Manager, (SAM) goto Kernel Parameters, increase
the following values and reboot:
shminfo_shmmax->30000000
shminfo_shmmin->1
shminfo_shmmni->100
shminfo_shmseg->10
seminfo_semmns->200
seminfo_semmni->50
(set shminfo_shmmax greater than
the largest SGA size you will have on your system.)
Deciding
on an Oracle Install directory & Database Name:
As a general rule, it is not good to install Oracle software in the
home directory of the user, by convention oracle software is usually installed
two levels under that.
The first directory under is usually called 'product'
The next level underneath that is labeled with the version of the oracle
you are installing.
So for example, if you are installing oracle 8.0.5, and the home directory
of the oracle user is /opt/oracle, a typical directory to install
the oracle software would be /opt/oracle/product/8.0.5.
This convention is known as Oracle OFA. It becomes very useful when
you have more than one version of oracle running on the same system.
The directory that oracle software is to be installed under is designated
by a special environment variable, $ORACLE_HOME.
Once you have the location of the Oracle program files. You must also
decide on where to put the actual database datafiles. As a general rule
do not put them into $ORACLE_HOME. Create a directory outside of the oracle
software tree for these files.
Once you have $ORACLE_HOME and a datafile home set, decide on
a name for your database, every database on the machine must have a unique
name or SID (System IDentifier). The name for a database is designated
by another environment variable, $ORACLE_SID
Running the
Oracle Installer
Oracle software is installed by
special app known as the Oracle Installer.
This app runs in both xterm &
character terms for Oracle versions under Oracle 8i and only in xterm for
8i and above.
Just before running the Installer,
make sure the following unix environment variables are set properly:
ORACLE_HOME = <set to directory
you want oracle code to be placed in>
ORACLE_SID=<the name of
your database, max of 6 characters>
ORACLE_TERM=<Term of your
current session, most often vt100 or vt220>
under ksh, the commands to do so
would be the following:
ORACLE_HOME=/opt/oracle/product/8.0.5
; export ORACLE_HOME
ORACLE_SID=MYDB ; export ORACLE_SID
ORACLE_TERM=vt100 ; export ORACLE_TERM
As the oracle user, change directory
to the cdrom mount point, then go under the orainst directory, then run
the Oracle Installer.
$ cd /cdrom/orainst
(for character based installs)
$ ./orainst
OR
(for motif/xterm based installs)
$ ./orainst /m
Personally I prefer the character mode installer since it is much
faster.
Once the installer is run, you should
something that looks like:
Use the <Tab> & arrow keys
to navigate between the fields, hit <Enter> to make a selection. The
character mode installer is NOT very pretty, so make sure to get used to
the navigation keys before proceeding.
For the most part, choose default
options. When you are asked about installer options, select Install
New Product - Create DB Objects
11. Continue accepting default values
until you get to the Software Asset Manager screen. This is a split screen
which shows the items that can be installed on the left, which items already
installed are on the right. This screen will look something like:
For most Oracle installations, the
following components are needed:
a. Oracle
Server Manager
b. Oracle
Net8 Client
c. Oracle
Net8 Protocol/TCPIP Adapters
d. Oracle
RDBMS
e. Oracle
PLSQL
f. SQL*PLUS
Select the above components and then
select <Install>
Database
Creation:
During the install, the installer
will build an empty database. It will also prompt you for the location,
names, and sizes of controlfiles, datafiles, and logfiles. Place these
into the datafile home that was discussed earlier.
At this point, each datafile will
correspond to an Oracle tablespace. Below are some recommended sizes for
each tablespace.
Tablespace
Size
----------------------
SYSTEM
200M
TEMP
100M
USERS
100M
RBS
100M
TOOLS
100M
The installer will also prompt you
for the filenames of each tablespace. By convention, the filename format
is usually
<TABLESPACE NAME>_<DATABASE
NAME> _<File ID>.dbf
For example. if you a creating an
INDEX tablespace for the database name of MYDB, the first file should be
called
INDEX_MYDB_01.dbf, etc
Make all logfiles 5M and name them
with the convention
LOG_<DATABASE>_<FILE ID>.rdo
The installer will procede to build
the database after the software install is complete. This may take a while,
especially on slower systems.
Once the install is complete. Exit
the installer and return to the shell prompt.
Customizing
the Oracle Environment
Log in as root, then cd to oracle
software directory. Remember that this is the directory defined by $ORACLE_HOME
in previous steps.
Under the oracle software directory,
cd to orainst and run the following script (as root
# ./root.sh
This script will install several
files in /etc and the local-bin directory (typically /usr/local/bin)
Once root.sh has been run
by root, the install is complete.
Log back in as the oracle user,
and add the following lines to the user's .profile file located
in their home directory.
ORACLE_HOME=KANA ; export ORACLE_HOME
PATH=/usr/local/bin:$PATH ; export
PATH
. /usr/local/bin/oraenv
This will cause the proper Oracle
environment to be setup each time the user is logged into the system.
Each time unix user that will need
to access the database should have the above lines inserted into their
.profile login script.
Accessing
the database
To access the database, use Oracle's
Server Manager utility.
~$ svrmgrl
Oracle Server Manager Release
3.0.5.0.0 - Production
(c) Copyright 1997, Oracle Corporation.
SCT® and Banner® are registered trademarks of SCT Corporation.
Nyquest is not affiliated in any way with SCT.
All Rights Reserved.
Oracle8 Release 8.0.5.0.0 - Production
PL/SQL Release 8.0.5.0.0 - Production
SVRMGR>
You'll now be at a server manager
prompt. You now need to connect to the database. This is done with a "connect
internal" command.
SVRMGR> connect internal
Connected.
The command connects the user to
the database with full admin privileges. Notice that the connect does NOT
ask for a password. On unix systems, database security is defined under
/etc/group & /etc/passwd.
Basically,
any user that is put into the dba group is assumed by oracle to have full
admin rights to the database.
Once you are connected to the database
as internal, you can do anything to the database.
Starting
& Shutting the Database
To startup a database, connect as
internal and type "STARTUP"
SVRMGR> connect internal
Connected.
SVRMGR> startup
ORACLE instance started.
Total System Global Area
4554000 bytes
Fixed Size
48400 bytes
Variable Size
4225072 bytes
Database Buffers
204800 bytes
Redo Buffers
73728 bytes
Database mounted.
Database opened.
SVRMGR>
To shutdown a database type 全HUTDOWN'.
This command is typically NOT used, as it politely waits until all user
connections have closed before beginning the actual shutdown.
SVRMGR> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR>
To shutdown the database down immediately,
type 全HUTDOWN IMMEDIATE'. This command will immediately terminate all
user connections and close the database.
SVRMGR> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SVRMGR>
In emergencies, type 全HUTDOWN ABORT'.
This type of shutdown immediately kills all oracle processes. After this
type of shutdown, the database will require a recovery on the next startup
(usually automatic)
SVRMGR> shutdown abort
ORACLE instance shut down.
SVRMGR>
Database
Accounts
In addition to the internal account,
(which only can be used by user in the dba unix group), two other dba accounts
are created in a database creation.
The accounts
are SYS & SYSTEM. Their respective default passwords are CHANGE_ON_INSTALL
& MANAGER.
While both accounts are dba accounts,
they are not as powerful as the INTERNAL user since they cannot stop &
start the database. Each database has a collection of system tables/views
known as the data dictionary. The data dictionary is created under the
SYS ownership (or schema). The passwords for these accounts should be changed
immediately (using the ALTER USER SQL statement) for security.
Note that
these users, INTERNAL, SYS and SYSTEM are different from the 'oracle' user
created in the beginning. The latter represents an OS or unix user, while
the former three are database users. The OS user always has access to the
database (via the 'dba' group in /etc/group), while the Database
users DO NOT have access to the OS.
Rollback
Segments:
Rollback Segments. Each database
will also need non-SYSTEM Tablespace rollback segments. To create them
in the RBS tablespace, execute the following commands:
SVRMGR> CREATE ROLLBACK SEGMENT
RBS1
2> TABLESPACE RBS
3> STORAGE (INITIAL 100K
NEXT 100K MINEXTENTS 2
4> MAXEXTENTS 121);
Statement Processed.
SVRMGR> CREATE ROLLBACK SEGMENT
RBS2
2> TABLESPACE RBS
3> STORAGE (INITIAL 100K
NEXT 100K MINEXTENTS 2
4> MAXEXTENTS 121);
Statement Processed.
These segments now have to be defined
in the Oracle parameter file for them to properly startup.
Each database has a respective parameter
file that defines start parameters. These files are located under $ORACLE_HOME/dbs
and are named init<$ORACLE_SID>.ora
Add the following line to the parameter
file located in and then restart the database.
ROLLBACK_SEGMENTS=(RBS1,RBS2)
Starting the
Oracle Listener
The Oracle listener allows for remote connections to the database that
bypass the underlying OS
For more info about this click here.
Finally, the Oracle Networking configuration
file, listener.ora must be setup, this file resides under $ORACLE_HOME/network/admin.
This file defines the port, IP and databases that will be controlled by
the Oracle Listener. This file is essential for Oracle client/server services.
The general format of this file is
as follows:
LISTENER =
(ADDRESS_LIST =
(ADDRESS= (PROTOCOL= TCP)
(Host= <replace with you IP/HOST>)
(Port= <port #>))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= <oracle home directory of database #1>)
(SID_NAME = <oracle_sid of database #1>)
)
)
Most sites run the Oracle listener
on port 1521, but you are free to run it on any port above 1024.
For example, if your Database server
hostname is oracle.myhost.com, $ORACLE_HOME is /opt/oracle/product/805,
listener port is 1527, and database name is MYDB, then listener.ora should
look like:
LISTENER =
(ADDRESS_LIST =
(ADDRESS= (PROTOCOL= TCP)
(Host= oracle.myhost.com)
(Port= 1521))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME= /opt/oracle/product/805)
(SID_NAME = MYDB)
)
)
To start/stop services, login as
the unix oracle user, then type 銑SNRCTL'
$ lsnrctl
LSNRCTL for Linux: Version 8.0.5.0.0
- Production on 16-SEP-99 17:54:12
(c) Copyright 1997 Oracle Corporation.
All rights reserved.
Welcome to LSNRCTL, type "help"
for information.
LSNRCTL>
To start/stop services, just type
either 全TART' or 全TART'
Your database should now be ready
to go!