The oracle documentation for installs is horrendous. So is the install proceedure. There are a lot of steps that oracle could have automated, but didn't. So here's a very simple checklist of how to get oracle running on solaris. (There are also a few random oracle tips at the bottom)
This page assumes you want an oracle install on a SINGLE DISK, with minimum memory, to just play around with oracle and learn the basics.
[A "real" installation of oracle would distribute data, indexes, and logs to separate disks. Which CAN be done after doing an initial install as detailed on this page. But details on tuning would make this page way longer than it already is.]
WARNING!!!
I strongly advise that you dont try to run oracle with less than 256 megs
of RAM.
Oracle took a page from microsoft documentation when it claimed you only
need 128megs to run it.
* For ORACLE: * 1 meg = 1048576 * 200 meg = 209715200 * 4 gig = 4294967295 set shmsys:shminfo_shmmax=209715200 set shmsys:shminfo_shmmin=1 set shmsys:shminfo_shmmni=100 set shmsys:shminfo_shmseg=10 set semsys:seminfo_semmni=100 set semsys:seminfo_semmsl=256 set semsys:seminfo_semmns=256 set semsys:seminfo_semopm=100 set semsys:seminfo_semvmx=32767
That creates the basic oracle account, and the top level dir. Use the# groupadd dba # groupadd oinstall # useradd -G oinstall -g dba -m -d /opt/oracle -s /bin/ksh oracle
oinstall
group for folks you want to install
additional oracle software. Use the dba
group for folks you
want to have DBA SQL access to the database (when locally logged on)
Now you need to fill out the .profile for the oracle account. In ~oracle/.profile, put
export ORACLE_BASE ORACLE_HOME ORACLE_SID DISPLAY LD_LIBRARY_PATH PATH ORACLE_BASE=$HOME # change 8.1.5 if you are installing a different release of oracle!! ORACLE_HOME=$ORACLE_BASE/software/8.1.5 LD_LIBRARY_PATH=/usr/lib:/usr/dt/lib:/usr/openwin/lib:$ORACLE_HOME/lib PATH=/usr/bin:/usr/dt/bin:/usr/openwin/bin:$ORACLE_HOME/bin # This is where you pick the name of your database!!! # Make it 8 letters or less ORACLE_SID=ORCLTST
(Note: root.sh SHOULD make the above soft-link, but doesnt. So make it!)# mkdir /var/opt/oracle # chown oracle:oinstall /var/opt/oracle # ln -s /var/opt/oracle/oratab /etc/oratab
Another thing the root scripts will do, is install three special utility scripts in /usr/local/bin (or whereever you tell it to):
You should then basically be able to accept the default to all the questions, and much, much later, have oracle installed.
You probably also want to allow ALL folks to see and link to the oracle libraries! Start with
Run the same chmod command on any other lib directories as needed.chmod 0755 $ORACLE_HOME/lib
/var/opt/oracle/oratab
and change 'N' to 'Y' for the database you want to autostart. Then create
the following file as /etc/init.d/oracle
#!/sbin/sh #Match ORACLE_HOME with whatever is in ~oracle/.profile!!! ORACLE_HOME=/export/home/oracle/software case $1 in start) su - oracle -c $ORACLE_HOME/bin/dbstart su - oracle -c "$ORACLE_HOME/bin/lsnrctl start" exit 0 ;; stop) su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop" su - oracle -c $ORACLE_HOME/bin/dbshut ;; esacYou're not done yet! You now have to dl
ln -s ../init.d/oracle /etc/rc3.d/S95oracle ln -s ../init.d/oracle /etc/rc0.d/K15oracle chmod 0755 /etc/init.d/oracle
Side notes: You will probably want to link /etc/oratab to the newly created file /var/opt/oracle/oratab, if you havent already done so:
ln -s /var/opt/oracle/oratab /etc/oratab
VERSION=`$ORACLE_HOME/bin/svrmgrl command=exit | awk ' /PL\/SQL (Release|Version)/ {print substr($3,1,3); blah blah }'`to VERSION=`$ORACLE_HOME/bin/svrmgrl command=exit | awk ' /PL\/SQL (Release|Version)/ {print substr($3,1,3)} /Edition (Release|Version)/ {printsubstr($5,1,3)}'`
create user username identified by password_here; grant connect, resource to username;
create table pubtable (value1 int, value2 char); create public synonym pubtable for pubtable;
However, be warned that this can spew out a LOT of tables. There are lots of system-level predefined "special" ones.select table_name from cat;
- Finding primary/nonprimary keys for a table
select * from user_constraints where TABLE_NAME = "yourtable";
- Finding column names/types for a table(in sqlplus only)
desc tablename;
- Finding all database names
- Remember that what mysql calls a "database", oracle actually calls a "schema".
select ?? from v$??
Sorry, need to re-research this again. sigh.- Find current "schema" that you are in:
select sys_context( 'userenv', 'current_schema' ) from dual;
- Change "current schema"
alter session set current_schema="SOME_SCHEMA";
- Finding oracle session id (SID) from a unix process id
select SPID,SID,ADDR from v$process,v$session where ADDR = PADDR and SPID={UNIX pid} ;
cdemo82.sql has a very special and interesting line in it, if you have access to the oracle account, but get locked out of the database.
PS: system/manager, sys/change_on_install
If you want to download oracle 8.1.7 for solaris INTEL for trial purposes, you can sometimes download it from http://demo.oracle.com.pl. It comes and goes from month to month, it seems.
Note that oracle for solaris x86 was tabled for a while.. (No Oracle 9) but now it is BACK! Oracle 10 ships for both Solaris sparc and x86. Yaaay!!
First , download the tclodbc library from sourceforge. Then download Odbcisql from Tom Poindexter's TCL page
Or as a simpler (but more memory-intensive) alternative, try
DB Visualizer,
(previously at
www.minq.se)
which is written in java, and pretty much always works.
(whereas you may or may not have trouble getting other third-party stuff to
talk to oracle across a network)
Note that if you specifically want to use the oracle jdbc drivers,
configure the classpath for $ORACLE_HOME/jdbc/lib/classes_12.zip
Places to get 3rd party ODBC drivers, if you need them:
If you are interested in Oracle Parallel Server, you may be interested in this SunManagers archive