By Vinod Kurup
</authorblurb>If you are installing PostGreSQL instead of Oracle, skip this @@ -65,7 +65,7 @@ expect that you used the defaults, so a change made here will necessitate further changes later. For a guide to the defaults, please see the section -called “Defaults”.
In order for OpenACS to work properly you need to set the +called “Defaults”.
In order for OpenACS to work properly you need to set the environment appropriately.
export ORACLE_BASE=/ora8/m01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/8.1.7 @@ -75,12 +75,9 @@ export ORACLE_TERM=vt100 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data -umask 022 -
-open_cursors = 500 -
-nls_date_format = "YYYY-MM-DD" -
For additional resources/documentation, please see this +umask 022
+open_cursors = 500
+nls_date_format = "YYYY-MM-DD"
For additional resources/documentation, please see this thread and Andrew Piskorski's mini-guide.
Login as a non-root user and start X by typing startx
-[joeuser ~]$ startx -+[joeuser ~]$ startx
Open a terminal window type and login as root
[joeuser ~]$ su - Password: *********** -[root ~]# -+[root ~]#
Create and setup the oracle
group and oracle
account
We need to create a user oracle
, which is used to install the
@@ -108,8 +103,7 @@
[root ~]# groupadd oinstall
[root ~]# groupadd oracle
[root ~]# useradd -g dba -G oinstall,oracle -m oracle
-[root ~]# passwd oracle
-
You will be prompted for the New Password and Confirmation of +[root ~]# passwd oracle
You will be prompted for the New Password and Confirmation of that password.
Setup the installation location for Oracle. While Oracle can @@ -122,33 +116,27 @@ root:/ora8# cd /ora8 root:/ora8# mkdir -p m01 m02 m03/oradata/ora8 root:/ora8# chown -R oracle.dba /ora8 -root:/ora8# exit - +root:/ora8# exit
Set up the oracle
user's
environment
Log in as the user oracle
by
typing the following:
[joeuser ~]$ su - oracle -Password: ******** -+Password: ********
Use a text editor to edit the .bash_profile
file in the oracle
account home directory.
-[oracle ~]$ emacs .bash_profile -
You may get this error trying to start emacs:
+[oracle ~]$ emacs .bash_profile
You may get this error trying to start emacs:
Xlib: connection to ":0.0" refused by server Xlib: Client is not authorized to connect to Server emacs: Cannot connect to X server :0. Check the DISPLAY environment variable or use `-d'. Also use the `xhost' program to verify that it is set to permit -connections from your machine. -
If so, open a new terminal window and do the following:
-[joeuser ~]$ xhost +localhost -
Now, back in the oracle terminal:
+connections from your machine.
If so, open a new terminal window and do the following:
+[joeuser ~]$ xhost +localhost
Now, back in the oracle terminal:
[oracle ~]$ export DISPLAY=localhost:0.0 -[oracle ~]$ emacs .bash_profile -
Try this procedure anytime you get an Xlib connection refused +[oracle ~]$ emacs .bash_profile
Try this procedure anytime you get an Xlib connection refused error.
Add the following lines (substituting your Oracle version number @@ -161,43 +149,37 @@ export ORACLE_TERM=vt100 export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data -umask 022 -
Save the file by typing Save the file by typing CTRL-X
+umask 022
CTRL-X
CTRL-S
and then exit by typing CTRL-X CTRL-C
. Alternatively, use the
menus.
Make sure that you do not add any lines like the following
# NLS_LANG=american -# export NLS_LANG -
These lines will change the Oracle date settings and will break +# export NLS_LANG
These lines will change the Oracle date settings and will break OpenACS since OpenACS depends on the ANSI date format, YYYY-MM-DD dates.
Log out as oracle
-[oracle ~]$ exit -+[oracle ~]$ exit
Log back in as oracle
and
double check that your environment variables are as intended. The
env
command lists all of the
variables that are set in your environment, and grep
shows you just the lines you want
(those with ORA in it).
[joeuser ~]$ su - oracle -[oracle ~]$ env | grep ORA -
If it worked, you should see:
+[oracle ~]$ env | grep ORA
If it worked, you should see:
ORACLE_SID=ora8 ORACLE_BASE=/ora8/m01/app/oracle ORACLE_TERM=vt100 ORACLE_HOME=/ora8/m01/app/oracle/product/8.1.7 -ORA_NLS33=/ora8/m01/app/oracle/product/8.1.7/ocommon/nls/admin/data -
If not, try adding the files to ~/.bashrc
instead of .bash_profile
. Then logout and log back in
+ORA_NLS33=/ora8/m01/app/oracle/product/8.1.7/ocommon/nls/admin/data
If not, try adding the files to ~/.bashrc
instead of .bash_profile
. Then logout and log back in
again. Also, be certain you are doing su - oracle
and not just su oracle
. The -
means that .bashrc
and .bash_profile
will be evaluated.
Make sure that /bin
,
/usr/bin
, and /usr/local/bin
are in your path by
typing:
[oracle ~]$ echo $PATH -/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/oracle/bin:/ora8/m01/app/oracle/product/8.1.7/bin -
If they are not, then add them to the .bash_profile
by changing the PATH
+/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin:/home/oracle/bin:/ora8/m01/app/oracle/product/8.1.7/bin
If they are not, then add them to the .bash_profile
by changing the PATH
statement above to PATH=$PATH:/usr/local/bin:$ORACLE_HOME/bin
Find the runInstaller
script
If you are installing from the tarball, the install script is
located in the Oracle8iR2
directory that was created when you expanded the archive.
-[oracle ~]$ cd /where/oracle/Disk1 -+[oracle ~]$ cd /where/oracle/Disk1
Check to make sure the file is there.
oracle:/where/oracle/Disk1$ ls -doc index.htm install runInstaller stage starterdb -
If you don't see runInstaller
, you are in the wrong
+doc index.htm install runInstaller stage starterdb
If you don't see runInstaller
, you are in the wrong
directory.
Run the installer
-oracle:/where/oracle/Disk1$ ./runInstaller -
A window will open that welcomes you to the 'Oracle +oracle:/where/oracle/Disk1$ ./runInstaller
A window will open that welcomes you to the 'Oracle
Universal Installer' (OUI). Click on "Next
"
Some people have had trouble with this step on RedHat 7.3 and 8.0. If so, try the following steps before calling ./runInstaller:
/stage/products.jar
""destination" path says "/ora8/m01/app/oracle/product/8.1.7
"
If the destination is not correct it is because your environment
variables are not set properly. Make sure you logged on as
-oracle
using su - oracle
. If so, edit the ~/.bash_profile
as you did in the section called
-“Pre-Installation Tasks”
+oracle
using su - oracle
. If so, edit the ~/.bash_profile
as you did in the section called “Pre-Installation
+Tasks”
Click "Next" (a pop up window will display Loading Product information).
Debian users need to link /bin/awk
to /usr/bin/awk
before running the script
below
[joueser ~]$ su - -[root ~]# ln -s /usr/bin/awk /bin/awk -+[root ~]# ln -s /usr/bin/awk /bin/awk
Open a new terminal window, then type:
-[joeuser ~]$ su - +Open a new terminal window, then type:
[joeuser ~]$ su - [root ~]# cd /ora8/m01/app/oracle/product/8.1.7 [root ~]# ./orainstRoot.sh ; You should see: Creating Oracle Inventory pointer file (/etc/oraInst.loc) Changing groupname of /ora8/m01/app/oracle/oraInventory to oinstall. [root ~]# mkdir -p /usr/local/java [root ~]# exit -[joeuser ~]$ exit -+[joeuser ~]$ exit
Click "Retry"
Do not follow the instructions on deleting trace and log files, it is not necessary.
[root ~]# exit -[joeuser ~]$ exit -+[joeuser ~]$ exit
Go back to the pop-up window and click "OK"
The "Configuration Tools" screen in the OUI
This window displays the config tools that will automatically be launched.
The "Welcome" screen in the Oracle Database Configuration Agent (ODCA)
$ORACLE_HOME
matches our default of /ora8/m01/app/oracle/product/8.1.7
, the
following will open the file for editing.-[oracle ~]$ emacs /ora8/m01/app/oracle/product/8.1.7/dbs/initora8.ora -+[oracle ~]$ emacs /ora8/m01/app/oracle/product/8.1.7/dbs/initora8.ora
Add the following line to the end:
-nls_date_format = "YYYY-MM-DD" -+nls_date_format = "YYYY-MM-DD"
Now find the open_cursors
line in the file. If you're using emacs
scroll up to the top of the buffer
and do CTRL-S
and type
open_cursors
to find the line.
The default is 100
. Change it
to 500
.
-open_cursors = 500 -+open_cursors = 500
Save the file. In emacs, do CTRL-X
CTRL-S
to save followed by CTRL-X CTRL-C
to exit or use the menu.
At this point, you are ready to initiate database creation. We recommend shutting down X to free up some RAM unless you have 256 @@ -512,8 +480,7 @@
Change to the directory where the database creation script is and run it:
[oracle ~]$ cd /ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib -oracle:/ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib$ ./sqlora8.sh -
In some instances, Oracle will save the file to /ora8/m01/app/oracle/product/8.1.7/assistants/dbca
+oracle:/ora8/m01/app/oracle/product/8.1.7/assistants/dbca/jlib$ ./sqlora8.sh
In some instances, Oracle will save the file to /ora8/m01/app/oracle/product/8.1.7/assistants/dbca
Try running the script there if your first attempt does not
succeed.
/var/tmp
In the oracle shell, copy the file.
-[oracle ~]$ cp /var/tmp/acceptance-sql.txt /var/tmp/acceptance.sql -+[oracle ~]$ cp /var/tmp/acceptance-sql.txt /var/tmp/acceptance.sql
Once you've got the acceptance test file all set, stay in your term and type the following:
-[oracle ~]$ sqlplus system/manager -
SQL*Plus should startup. If you get an ORA-01034: Oracle not Available
error, it
+[oracle ~]$ sqlplus system/manager
SQL*Plus should startup. If you get an ORA-01034: Oracle not Available
error, it
is because your Oracle instance is not running. You can manually
start it as the oracle
user.
[oracle ~]$ svrmgrl SVRMGR> connect internal -SVRMGR> startup -+SVRMGR> startup
Now that you're into SQL*Plus, change the default passwords for system, sys, and ctxsys to "alexisahunk" (or to something you'll remember):
SQL> alter user system identified by alexisahunk; SQL> alter user sys identified by alexisahunk; -SQL> alter user ctxsys identified by alexisahunk; -+SQL> alter user ctxsys identified by alexisahunk;
Verify that your date settings are correct.
-SQL> select sysdate from dual; -
If you don't see a date that fits the format YYYY-MM-DD
, please read the section called
-“Troubleshooting Oracle
-Dates”.
If you don't see a date that fits the format YYYY-MM-DD
, please read the section called “Troubleshooting
+Oracle Dates”.
At this point we are going to hammer your database with an intense acceptance test. This usually takes around 30 minutes.
@@ -573,19 +534,17 @@ ---------- 2000-06-10 -SQL> -
Many people encounter an error regarding maximum key length
:
+SQL>
Many people encounter an error regarding maximum key length
:
ERROR at line 1: -ORA-01450: maximum key length (758) exceeded -
This error occurs if your database block size is wrong and is +ORA-01450: maximum key length (758) exceeded
This error occurs if your database block size is wrong and is
usually suffered by people trying to load OpenACS into a
pre-existing database. Unfortunately, the only solution is to
create a new database with a block size of at least 4096
. For instructions on how to do this,
-see the section called
-“Creating the First Database”
-above. You can set the parameter using the dbassist
program or by setting the
-DB_BLOCK_SIZE
parameter in your
-database's creation script.
If there were no errors, then consider yourself fortunate. Your
+see the section called “Creating the
+First Database” above. You can set the parameter using the
+dbassist
program or by setting
+the DB_BLOCK_SIZE
parameter in
+your database's creation script.
If there were no errors, then consider yourself fortunate. Your Oracle installation is working.
/var/tmp
. Then, as oracle
, do the following:[oracle ~]$ cp /var/tmp/dbstart.txt /ora8/m01/app/oracle/product/8.1.7/bin/dbstart -[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/dbstart -+[oracle ~]$ chmod 755 /ora8/m01/app/oracle/product/8.1.7/bin/dbstart
While you're logged in as oracle
, you should configure the
oratab
file to load your
database at start. Edit the file /etc/oratab
:
You will see this line.
-ora8:/ora8/m01/app/oracle/product/8.1.7:N -
By the way, if you changed the service name or have multiple +ora8:/ora8/m01/app/oracle/product/8.1.7:N
By the way, if you changed the service name or have multiple databases, the format of this file is:
service_name:$ORACLE_HOME:Y || N (for
autoload)
Change the last letter from "N" to "Y". This tells Oracle that you want the database to start when the machine boots. It should look like this.
-ora8:/ora8/m01/app/oracle/product/8.1.7:Y -+ora8:/ora8/m01/app/oracle/product/8.1.7:Y
Save the file & quit the terminal.
Test the script by typing the following commands and checking
the output. (Debian Users: as root, do mkdir /var/lock/subsys
first)
@@ -677,8 +632,7 @@ Database "ora8" warm started. -Database "ora8" warm started. -+Database "ora8" warm started.
If it worked, then run these commands to make the startup and shutdown automatic.
Debian users:
[root ~]# update-rc.d oracle8i defaults @@ -700,8 +653,7 @@ /etc/rc2.d/S20oracle8i -> ../init.d/oracle8i /etc/rc3.d/S20oracle8i -> ../init.d/oracle8i /etc/rc4.d/S20oracle8i -> ../init.d/oracle8i - /etc/rc5.d/S20oracle8i -> ../init.d/oracle8i -+ /etc/rc5.d/S20oracle8i -> ../init.d/oracle8i
SuSE users:
[root ~]# cd /etc/rc.d/init.d @@ -743,8 +695,7 @@ Executing /sbin/conf.d/SuSEconfig.tetex... Executing /sbin/conf.d/SuSEconfig.ypclient... Processing index files of all manpages... -Finished. -+Finished.
Test the listener automation by running the following commands +root:/etc/rc.d/init.d# chmod 755 listener8i
Test the listener automation by running the following commands and checking the output.
root:/etc/rc.d/init.d# ./listener8i stop Oracle 8i listener start/stop @@ -808,8 +758,7 @@ Services Summary... PLSExtProc has 1 service handler(s) ora8 has 1 service handler(s) -The command completed successfully -
This test will verify that the listener is operating normally. +The command completed successfully
This test will verify that the listener is operating normally. Login into the database using the listener naming convention.
sqlplus
username/password/\@SID
@@ -824,16 +773,14 @@ SQL> exit [oracle ~]$ exit -[root ~]# -
RedHat users:
Now run chkconfig
on the
listener8i
script.
[root ~]# cd /etc/rc.d/init.d/ root:/etc/rc.d/init.d# chkconfig --add listener8i root:/etc/rc.d/init.d# chkconfig --list listener8i -listener8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off -+listener8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off
Debian users:
Now run update-rc.d
on the
listener8i
script.
@@ -845,20 +792,17 @@ /etc/rc2.d/S21listener8i -> ../init.d/listener8i /etc/rc3.d/S21listener8i -> ../init.d/listener8i /etc/rc4.d/S21listener8i -> ../init.d/listener8i - /etc/rc5.d/S21listener8i -> ../init.d/listener8i -+ /etc/rc5.d/S21listener8i -> ../init.d/listener8i
Test the automation
As a final test, reboot your computer and make sure Oracle comes up. You can do this by typing
-[root ~]# /sbin/shutdown -r -t 0 now -
Log back in and ensure that Oracle started automatically.
+[root ~]# /sbin/shutdown -r -t 0 now
Log back in and ensure that Oracle started automatically.
[joeuser ~]$ su - oracle [oracle ~]$ sqlplus system/alexisahunk\@ora8 -SQL> exit -+SQL> exit
Congratulations, your installation of Oracle 8.1.7 is complete.
@@ -874,17 +818,14 @@'YYYY-MM-DD'
.To fix this, you should include the following line in
$ORACLE_HOME/dbs/init
SID.ora
or for the default case, $ORACLE_HOME/dbs/initora8.ora
-nls_date_format = "YYYY-MM-DD" -
You test whether this solved the problem by firing up +nls_date_format = "YYYY-MM-DD"
You test whether this solved the problem by firing up
sqlplus
and typing:
-SQL> select sysdate from dual; -
You should see back a date like 2000-06-02
. If some of the date is chopped
+SQL> select sysdate from dual;
You should see back a date like 2000-06-02
. If some of the date is chopped
off, i.e. like 2000-06-0
,
everything is still fine. The problem here is that sqlplus
is simply truncating the output.
You can fix this by typing:
SQL> column sysdate format a15 -SQL> select sysdate from dual; -
If the date does not conform to this format, double-check that +SQL> select sysdate from dual;
If the date does not conform to this format, double-check that you included the necessary line in the init scripts. If it still isn't working, make sure that you have restarted the database since adding the line:
@@ -896,16 +837,13 @@ Database dismounted. ORACLE instance shut down. SVRMGR> startup -ORACLE instance started. -
If you're sure that you have restarted the database since +ORACLE instance started.
If you're sure that you have restarted the database since adding the line, check your initialization scripts. Make sure that the following line is not included:
-export nls_lang = american -
Setting this environment variable will override the date +export nls_lang = american
Setting this environment variable will override the date
setting. Either delete this line and login again or add the
following entry to your login scripts after the nls_lang
line:
-export nls_date_format = 'YYYY-MM-DD' -
Log back in again. If adding the nls_date_format
line doesn't help, you
+export nls_date_format = 'YYYY-MM-DD'
Log back in again. If adding the nls_date_format
line doesn't help, you
can ask for advice in our OpenACS
forums.
Dropping a tablespace
Run sqlplus as the dba:
-[oracle ~]$ sqlplus system/changeme -+[oracle ~]$ sqlplus system/changeme
To drop a user and all of the tables and data owned by that user:
-SQL> drop user oracle_user_name cascade;
-
+SQL> drop user oracle_user_name cascade;
To drop the tablespace: This will delete everything in the tablespace overriding any referential integrity constraints. Run this command only if you want to clean out your database entirely.
-SQL> drop tablespace table_space_name including contents cascade constraints;
-
+SQL> drop tablespace table_space_name including contents cascade constraints;
For more information on Oracle, please consult the documentation.
the -section called “Creating an appropriate tuning -and monitoring environment”
+section called “Creating an appropriate tuning and monitoring +environment”