|
Installing Oracle 8i release 3 (version 8.1.7) on Redhat LinuxNews
IntroductionThis Tech Note describes the installation of Oracle version 8.1.7 on RedHat 7.1, or more precisely the Fried Chicken Linux distributed at LinuxLab. It probably works on other RedHat releases including RedHat 6.2. However, a glibc problem appeared in RedHat version 7.0 and 7.1, and a fix is described below. You should skip the fix, if you install on a RedHat version less than 7.0. HardwareThe directions in this note has been successfully carried out on my IBM ThinkPad T21 running the Fried Chicken Linux which is basically a RedHat 7.1. Documentation and DownloadsOracle is a big thing with lots of documentation. A full installation is at least one day work - well that is what I used to get my first Oracle up and running. To obtain Oracle 8i release 3 (version 8.1.7.0.1) you visit http://technet.oracle.com/software/products/oracle8i/content.html. After signing up, you download a 500Mb tar file:
You can get an overwhelming amount of information at the Oracle Technology Network Library. I also downloaded a few other installation-guides:
On Oracle Technology Network you find the Oracle Documentation Library for Oracle 8i, release 3. Unpack the Oracle DistributionYou unpack the file # whoami root # cd /usr/src/ # mkdir oracle # cd oracle/ # tar xvf ~nh/Install/Oracle/linux81701.tar Before You InstallThere are a number of issues to consider before you start the installation.
Pre-InstallationChapter 2 of the Oracle Installation Guide (Pre--Installation) mentions various kernel parameters to be changed in order to run Oracle. I did not recompile the kernel because all the parameters were already above the required values except for theSHMMAX
parameter which can be set in the file
/proc/sys/kernel/shmmax .
In file
/usr/src/linux-2.4/include/linux/sem.h I found
the following values:
Users and GroupsWe create three groups:
We create the# whoami root # groupadd orainstall # groupadd oradba # groupadd oraoper oracle user account that runs the
installation with primary group orainstall and secondary
groups oradba and oraoper .
# useradd oracle -g orainstall -G oradba,oraoper # passwd oracle Changing password for user oracle New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully Creating Mount PointsThe file system used by Oracle can be organized in various ways. A simple approach is to use two mount points with one containing the software and one containing the database files. Another approch is to use four mount points in accordance with the Optimal Flexible Architecture (OFA); one for the software and three for the database files. If you use the three mount points then you should put them on different discs to get optimal performance.
I use the simple approach and use one mount point for the datafiles. I
have a 4 Gb. Windows partition which I convert to a and afterDevice Boot Start End Blocks Id System /dev/hda1 * 1 555 4195768+ 7 HPFS/NTFS /dev/hda2 556 691 1028160 82 Linux swap /dev/hda3 692 4134 26029080 83 Linux fdisk :
The partitionDevice Boot Start End Blocks Id System /dev/hda1 1 555 4195768+ 83 Linux /dev/hda2 556 691 1028160 82 Linux swap /dev/hda3 692 4134 26029080 83 Linux /dev/hda1 is mounted as
/ora01 . We update owner and access permissions:
# whoami # chown oracle.oradba /ora01 # chmod 755 /ora01 The Oracle User EnvironmentOpen a terminal window and log in as useroracle :
Verify that# su - oracle Password: umask defaults to 022 (if not you add
umask 022 to the file .bash_profile below):
I added the following lines to the file$ umask 022 /home/oracle/.bash_profile (umask only
necessary if it does not default to 022, see above).
You check the fileJAVA_HOME=/usr/local/java; export JAVA_HOME CLASSPATH=${JAVA_HOME}/lib/classes.zip; export CLASSPATH ORACLE_BASE=/ora01/app/oracle; export ORACLE_BASE ORACLE_HOME=$ORACLE_BASE/product/8.1.7; export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin; export PATH # NLS_LANG=UTF8; export NLS_LANG ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data; export ORA_NLS33 ORACLE_SID=odb; export ORACLE_SID if [ "${LD_LIBRARY_PATH:-}" == "" ]; then LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/usr/local/lib else LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH} fi export LD_LIBRARY_PATH # umask 022 (uncomment if umask is not 022 above) .bash_profile by logging out and then
in again as oracle and test the environment variables:
You check that$ env | grep ORA ORACLE_SID=odb ORACLE_BASE=/ora01/app/oracle ORACLE_HOME=/ora01/app/oracle/product/8.1.7 ORA_NLS33=/ora01/app/oracle/product/8.1.7/ocommon/nls/admin/data $ env | grep PATH LD_LIBRARY_PATH=/ora01/app/oracle/product/8.1.7/lib:/usr/lib:/usr/local/lib CLASSPATH=/usr/local/java/lib/classes.zip PATH=/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/X11R6/bin: /home/oracle/bin:/ora01/app/oracle/product/8.1.7/bin $ /bin , /usr/bin and
/usr/local/bin is in the PATH .
InstallationYou are finally ready to install Oracle. If you are on a RedHat 7.0 or 7.1, then issue the following command in the terminal windows where you will start the Oracle Installer as useroracle :
This will fix the glibc problem mentioned above. You can read more abount this in the RedHat 7.1 Release Notes.export LD_ASSUME_KERNEL=2.2.5 . /usr/i386-glibc21-linux/bin/i386-glibc21-linux-env.sh Enter the directory# su - oracle Password: $ env | grep ORA ORACLE_SID=odb ORACLE_BASE=/ora01/app/oracle ORACLE_HOME=/ora01/app/oracle/product/8.1.7 ORA_NLS33=/ora01/app/oracle/product/8.1.7/ocommon/nls/admin/data $ env | grep PATH LD_LIBRARY_PATH=/ora01/app/oracle/product/8.1.7/lib:/usr/lib:/usr/local/lib CLASSPATH=/usr/local/java/lib/classes.zip PATH=/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/bin/X11: /usr/X11R6/bin:/home/oracle/bin:/ora01/app/oracle/product/8.1.7/bin $ export LD_ASSUME_KERNEL=2.2.5 $ . /usr/i386-glibc21-linux/bin/i386-glibc21-linux-env.sh /usr/src/oracle/Disk1 and execute the
Oracle Installer runInstaller :
$ cd /usr/src/oracle/Disk1/ $ ./runInstaller
/ora01/app/oracle/oraInventory/logs/installActions.log .Got error after 97%: At this point you need the fileError in invoking target install of makefile /ora01/app/oracle/product/8.1.7/ctx/lib/ins_ctx.mk glibc-2.1.3-stubs.tar.gz . As user oracle do
the following:
and then continue the installation, that is, click Ignore.$ cd $ORACLE_HOME $ tar -xvzf /tmp/glibc-2.1.3-stubs.tar.gz ./ ./lib/ ./lib/stubs/ ./lib/stubs/libc-2.1.3-stub.so ... ./lib/stubs/libnss_files.so ./setup_stubs.sh ./README.stub $ ./setup_stubs.sh Setting up patch files...done. Patching makefiles as necessary: checking file '/ora01/app/oracle/product/8.1.7/rdbms/demo/demo_rdbms.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/rdbms/demo/ociucb.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/rdbms/lib/ins_rdbms.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/rdbms/lib/env_rdbms.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/network/lib/ins_net_client.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/network/lib/env_network.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/network/lib/ins_cman.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/network/lib/ins_names.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/network/lib/ins_oemagent.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/network/lib/env_oemagent.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/network/lib/ins_net_server.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/network/lib/ins_nau.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/plsql/lib/env_plsql.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/plsql/lib/ins_plsql.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/plsql/demo/demo_plsql.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/precomp/lib/ins_precomp.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/precomp/lib/env_precomp.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/ldap/lib/env_ldap.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/ldap/lib/ins_ldap.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/ldap/demo/demo_ldap.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/sqlplus/lib/env_sqlplus.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/sqlplus/lib/ins_sqlplus.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/ord/im/lib/env_ordim.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/ord/img/demo/demo_ordimg.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/ord/ts/demo/oci/src/demo_ordts.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/ord/ts/demo/proc/src/demo_ordts.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/ord/ts/lib/env_ordts.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/md/demo/examples/demo_sdo.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/md/demo/unix/motif/src/demo_motif.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/md/demo/unix/motif/src/db_src/demo_dbsrc.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/md/demo/unix/motif/src/main_src/demo_mainsrc.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/otrace/demo/atmoci.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/otrace/lib/env_otrace.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/otrace/lib/ins_otrace.mk'...OK. checking file '/ora01/app/oracle/product/8.1.7/ctx/lib/env_ctx.mk'...patched. checking file '/ora01/app/oracle/product/8.1.7/ctx/lib/ins_ctx.mk'...OK. Rebuilding client shared library...done. Relinking executables: running 'ins_rdbms.mk'...done. running 'ins_net_client.mk'...done. running 'ins_cman.mk'...done. running 'ins_names.mk'...done. running 'ins_oemagent.mk'...done. running 'ins_net_server.mk'...done. running 'ins_nau.mk'...done. running 'ins_plsql.mk'...done. running 'ins_precomp.mk'...done. running 'ins_ldap.mk'...done. running 'ins_sqlplus.mk'...done. running 'ins_otrace.mk'...done. running 'ins_ctx.mk'...done. $
A popup window then appears asking to execute the script
is changed intoRMF=/bin/rm -f and line 156RMF="/bin/rm -f" is changed intoRUID=`/usr/bin/id|$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}` Execute the scriptRUID=`/usr/bin/id|$AWK -F\( '{print $2}'|$AWK -F\) '{print $1}'` root.sh as user root :
Hit Enter# whoami root # /ora01/app/oracle/product/8.1.7/root.sh 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. Running Oracle8 root.sh script... \nThe following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /ora01/app/oracle/product/8.1.7 ORACLE_SID= odb Enter the full pathname of the local bin directory: [/usr/local/bin]: \nCreating /etc/oratab file... Entry will be added to the /etc/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. [root@nh 8.1.7]#
The Net8 Configuration Assistant hang for a while and then the window Database Creation Progress appeared. After a while a pupop window with database information appeared: A window End of installation appears; click Exit, and then Yes.Database creation completed. Database information: global database name: oradb.localdomain database system identifier(SID): odb SYS account passwrod: change_on_install SYSTEM account password: manager
You can now start the $ sqlplus scott/tiger SQL*Plus: Release 8.1.7.0.0 - Production on Tue Jul 10 22:59:52 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SQL> exit Disconnected from Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production $ Setting up the representation of datesBy default, Oracle does not store dates in ANSI-compliant date format which is YYYY-MM-DD:You correct this by addingSQL> select sysdate from dual; SYSDATE --------- 10-JUL-01 SQL> at the end of filenls_date_format = "YYYY-MM-DD" $ORACLE_HOME/dbs/initodb.ora (e.g., we
used odb as our sid). After restarting the server,
you can check the new setting using sqlplus :
SQL> select sysdate from dual; SYSDATE ---------- 2001-07-10 SQL> Manually start the server
Manually stop the server
Automating Startup and ShutdownThe scriptdbstart is used to start the database and the
script dbshut is used to stop the database. To activate
the scripts automatically, do the following:
Acceptance testAt ArsDigita I found the following acceptance test which you can download into/tmp/acceptance.sql and run as follows:
It should end with the current date in ANSI compliant format (i.e., YYYY-MM-DD).# su - oracle Password: $ sqlplus scott/tiger SQL*Plus: Release 8.1.7.0.0 - Production on Wed Jul 11 00:47:01 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SQL> @/tmp/acceptance.sql; Table created. Index created. ... SYSDATE ---------- 2001-07-11 SQL>
I also found a more system oriented test
at ArsDigita. Download it into
The test file contains comments on why you get the above results and how you change them; if you wish to do that.$ sqlplus SYSTEM/manager SQL*Plus: Release 8.1.7.0.0 - Production on Wed Jul 11 01:07:15 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SQL> @/tmp/system-test.sql; COUNT(*) ---------- 0 COUNT(*) ---------- 0 COUNT(*) ---------- 8 LOWER_BOUND ----------- 1.5061E+10 SQL> Remove an Oracle Installation
Net8 configurationWhen you have computers connected via a network and want to access an Oracle server, you need to setup Net8. There are various ways to setup Net8 and I describe the simplets setup that I could come up with.There are various good documents that describe Net8 configuration: ListenersYour Oracle database server must contain a listener.ora file listing the names and addresses of all of the listener processes on the server. An examplelistener.ora file:
The first part says that the listener is listening on TCP and IPC requests. The second part identifies the Oracle software used for each of the above addresses (i.e., IPC and TCP).# LISTENER.ORA Network Configuration File: /ora01/app/oracle/product/8.1.7/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(HOST = host.big-company.com)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = PNPKEY)) ) SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (SID_NAME=PLSExtProc) (ORACLE_HOME=/ora01/app/oracle/product/8.1.7) (PROGRAM=extproc) ) (SID_DESC= (GLOBAL_NAME=oradb) (SID_NAME=odb) (ORACLE_HOME=/ora01/app/oracle/product/8.1.7) ) )
Starting the ListenerFirst you must start a listener process on the Oracle database server. Put a listener.ora file in directory$ORACLE_HOME/network/admin/listener.ora
(as user oracle):
Options:[oracle@host admin]$ ll listener.ora -rw-rw-r-- 1 oracle orainsta 607 Nov 5 14:57 listener.ora [oracle@host admin]$
lsnrctl start :
The listener started successfully and has two listener instances (i.e., tcp and ipc). It also shows you the parameter and log file used. The listener reports one service handler for each instance; if you get the message[oracle@nh oracle]$ lsnrctl start LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 12-DEC-2001 09:41:23 (c) Copyright 1998 Oracle Corporation. All rights reserved. Starting /ora01/app/oracle/product/8.1.7/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 8.1.7.0.0 - Production System parameter file is /ora01/app/oracle/product/8.1.7/network/admin/listener.ora Log messages written to /ora01/app/oracle/product/8.1.7/network/log/listener.log Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=host.big-company.com)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY))) Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=host.big-company.com)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 8.1.7.0.0 - Production Start Date 12-DEC-2001 09:41:23 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /ora01/app/oracle/product/8.1.7/network/admin/listener.ora Listener Log File /ora01/app/oracle/product/8.1.7/network/log/listener.log Services Summary... PLSExtProc has 1 service handler(s) odb has 1 service handler(s) The command completed successfully The listener supports no services it
may still work as service handlers are created dynamically as needed
(i.e., when you log into the database).
You stop the listener with You can get the listener status as follows:[oracle@host oracle]$ lsnrctl stop LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 12-DEC-2001 09:46:53 (c) Copyright 1998 Oracle Corporation. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=host.big-company.dk)(PORT=1521)) The command completed successfully [oracle@host oracle]$ [oracle@host admin]$ lsnrctl status LSNRCTL for Linux: Version 8.1.7.0.0 - Production on 12-DEC-2001 10:34:58 (c) Copyright 1998 Oracle Corporation. All rights reserved. Connecting to (ADDRESS=(PROTOCOL=TCP)(HOST=host.big-company.com)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 8.1.7.0.0 - Production Start Date 12-DEC-2001 10:34:56 Uptime 0 days 0 hr. 0 min. 2 sec Trace Level off Security OFF SNMP OFF Listener Parameter File /ora01/app/oracle/product/8.1.7/network/admin/listener.ora Listener Log File /ora01/app/oracle/product/8.1.7/network/log/listener.log Services Summary... PLSExtProc has 1 service handler(s) odb has 1 service handler(s) The command completed successfully [oracle@host admin]$ Connect Descriptors and Service NamesA connect descriptor specifies the communiacation protocol (e.g., TCP), server name (host) and port (default is 1521) to use when communicating to the Oracle server (filetnsnames.ora ):
Above we specify a TCP based communication protocol to hostDESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = host.big-company.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = odb) ) host.big-company.com using the default port 1521. The
CONNECT_DATA section specifies the database we want
access to using the SERVICE_NAME ; this should be
odb if you followed the installation above.
Users should not type in the connect descriptors each time they log
on, so we want to set up service names that refer to the
connection descriptors. A service name is an alias for a connection
descriptor. This is done in the
You can also install it in directory I have included a sample tnsnames.ora file that works for me (you must edit the host name).
Configuring Local Naming MethodThere are serveral naming methods to choose among and you will probably use either local naming method or Oracle Names Server. I use the simplets, local naming method, which require you to install thetnsnames.ora file and another file
sqlnet.ora locally on each client connecting to the
database. This is not required with Oracle Names Server.
To setup local naming method you must install a tnsnames.ora file in directory
Windows clients running the Oracle client programs (i.e.,[oracle@host admin]$ ll tnsnames.ora -rw-rw-r-- 1 oracle orainsta 1064 Nov 5 15:03 tnsnames.ora [oracle@host admin]$ win817client.zip ) are described below. Options to
tnsnames.ora :
An example sqlnet.ora file The# SQLNET.ORA Network Configuration File: /ora01/app/oracle/product/8.1.7/network/admin/sqlnet.ora # Generated by Oracle configuration tools. NAMES.DEFAULT_DOMAIN = big-company.com SQLNET.EXPIRE_TIME = 10 NAMES.DIRECTORY_PATH= (TNSNAMES) NAMES.DEFAULT_DOMAIN parameter specifies that any
unqualified name (e.g., odb) should have big-company.com
appended. The NAMES.DIRECTORY_PATH specified that Net8
uses tnsnames to resolve connect identifiers (e.g., odb
to connect descriptors, that is, tcp and all the other information
stored in a connect descriptor). The SQLNET.EXPIRE_TIME
entry determines time interval in minutes to send a probe to verify
the session is alive.
Listener Log FilesThe listener log file is located in directory$ORACLE_HOME/network/log/ assuming that you have not
specified otherwise in the listener configuration file
listener.ora above (e.g., with a LOG_FILE
entry). You can use the command tail -f listener.log to
view changes in the log file.
Testing a UNIX clientAssuming, that you have installed thelistener.ora ,
sqlnet.ora and tnsnames.ora on the Oracle
server and started the listener with lsnrctl start you
are ready to connect from another UNIX client.
On the UNIX client you install the Oracle client software (or the
entire database which is what I did) and then installs the
You can then try ping'ing the server from the client: The listener.log on the server shows something like this:[16:34-Oracle]# tnsping odb 4 TNS Ping Utility for Linux: Version 8.1.7.0.0 - Production on 12-DEC-2001 16:34:30 (c) Copyright 1997 Oracle Corporation. All rights reserved. Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=host.big-company.com)(PORT=1521)) OK (0 msec) OK (10 msec) OK (0 msec) OK (10 msec) [16:34-Oracle]# The real test is to connect to a database using12-DEC-2001 16:04:55 * ping * 0 12-DEC-2001 16:04:55 * ping * 0 12-DEC-2001 16:04:55 * ping * 0 12-DEC-2001 16:04:55 * ping * 0 sqlplus . From the client we try connecting to the scott
database:
The listener.log on the server shows the connection (I have erased the host and port entry):[16:34-Oracle]# sqlplus scott/tiger@odb SQL*Plus: Release 8.1.7.0.0 - Production on Wed Dec 12 16:37:12 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SQL> 12-DEC-2001 16:07:37 * (CONNECT_DATA=(SERVICE_NAME=odb)(CID=(PROGRAM=) (HOST=localhost.localdomain)(USER=nh))) * (ADDRESS=(PROTOCOL=tcp)(HOST=xxx.xxx.xxx.xxx)(PORT=xxxxx)) * establish * odb * 0 Windows ClientsOn Windows clients you install thewin817client.zip file
as follows:
Creating Oracle Users With Read Permissions OnlyOften you install the Windows client software for users that need read only access to a limited number of tables in the database, maybe they use a report-tool (e.g., Crystal Reports) to access tables and make queries.
The following command creates a user with no priviledges (with
Joe can't even log onto Oracle:create user joe identified by joe; We grant Joe the create session privilege (with[23:45-~]# sqlplus joe/joe SQL*Plus: Release 8.1.7.0.0 - Production on Wed Dec 12 23:45:14 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. ERROR: ORA-01045: user JOE lacks CREATE SESSION privilege; logon denied sqlplus
system/manager ):
Joe can now log into Oracle, but Joe has not access to any tables - Joe can't even create a table:SQL> grant create session to joe; We now grant Joe access rights (i.e., select priviledge) on each table that Joe must access. This is done by defining a new role, say[23:46-~]# sqlplus joe/joe SQL*Plus: Release 8.1.7.0.0 - Production on Wed Dec 12 23:47:14 2001 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.0.1 - Production With the Partitioning option JServer Release 8.1.7.0.1 - Production SQL> select table_name from user_tables; no rows selected SQL> create table test (id int primary key); create table test (id int primary key) * ERROR at line 1: ORA-01031: insufficient privileges SQL> DW_JOE holding the select priviledges and then assign Joe
that role (with sqlplus system/manager ):
We now add select priviledges on one tableSQL> create role DW_JOE; Role created. auth_user to
the role DW_JOE (using an Oracle user that owns the
example table auth_user ):
We grant Joe theSQL> grant select on auth_user to DW_JOE; Grant succeeded. DW_JOE role and then makes it the
default role when Joe logs in (with sqlplus
system/manager ).
SQL> grant DW_JOE to joe; Grant succeeded. SQL> alter user joe default role DW_JOE; User altered. nh@it.edu [ View comment(s) ] [ Post comment ] |
|