Important! See new instructions in red and red/yellow at the bottom of this page!
CSCI 379 Students - How to get Oracle working in OCNL 241
Note: literal values for you to type are listed in quotation marks below.
Setting up your Display for Oracle Java tools -
1) Check to see what your hostname is by typing "hostname" and hitting the enter key.
2) Similarly, you can find out your machines IP address by typing "ifconfig -a" and hitting the enter key.
3) Suppose your machine is gunsmoke. You need to set up your display environment variable to reflect this, you type ( > is the Unix prompt)
> DISPLAY="gunsmoke:0"
>export DISPLAY
>xhost +gunsmoke
Now, the Oracle Java tools should be able to display properly. You can also put these lines in your .profile if you will always be sitting at the same machine.
Editing your .profile, executing it and getting Oracle running -
1) Login to your machine with your Unix login.
2) In the Common Desktop environment, get a terminal window by clicking on the up arrow above the cpu icon. Choose a host terminal window.
3) Edit your .profile
Make sure you are in your home directory. You can do this by typing "cd" at the Unix system prompt. To open your .profile for editing with the vi editor, type "vi .profile". Now, add the following lines to the end of your .profile -
ORACLE_HOME=/opt/Oracle8i/products/8.1.7
ORACLE_BASE=/opt/Oracle8i
ORACLE_SID=dbaclass
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME ORACLE_BASE ORACLE_SID PATH
Save the changes to your .profile by typing "<shift>:wq" in vi.
4) Execute your .profile by typing ". ./.profile". There is a space between the first two dots here.
5) Execute sqlplus by typing in "sqlplus" at the Unix prompt.
6) Give the user name of internal. No password is necessary.
7) Start the database by typing "startup" at the SQL prompt.
8) Connect to the database as the appropriate user. E.g., if I want to connect to the database as scott, I would type "connect scott/tiger" at the SQL prompt.
9) You are all set up to work with the dbaclass database now.
Other useful information on running Oracle Tools:
To run the Net8 Assistant, type "netasst" at the Unix prompt
To run the Database Configuration Assistant, type "dbassist" at the Unix prompt
To run the Enterprise Manager Configuration Assistant, type "emca" at the Unix prompt.
To run the Oracle Enterprise Manager (OEM) Console, type "oemapp console" at the Unix prompt.
Troubleshooting! If you have trouble running the OEM console, then
try these steps:
try starting the database listener for all databases you want to manage. The way to do this is type at the Unix prompt "lsnrctl". You can then always type "help" to see a list of commands. Type "start" to start the listener. If you have more than one listener, you need to add the name of the listener to the command.
be sure the databases you want to manage are started.
be sure the agent is running on the nodes you want to manage. To do this type "lsnrctl" at the Unix prompt. Type "dbsnmp_start" to start the agent on the node.
be sure the Oracle Management Server is running. To do this type "oemctrl" at the Unix prompt. Type "help for a list of commands. You will see how to start the management server.
VERY IMPORTANT!!
Please note - Once you have created your own personally created database in Lab 4, you will use that database for the duration of the course. Be sure to run all scripts from Labs 1-3 to get this database up to the state it should be in. Change your SID information in your .profile accordingly to this new SID if you so desire.
Always follow the procedure below as you regularly use the dbaclass (up through Lab 3) or your your own personally created database in lab sessions throughout the duration of the course:
login with your Unix account
set your ORACLE_SID to dbaclass or your own personally created database as described above
type sqlplus at the Unix prompt
when asked for a login, type "internal" (no quotes, I'm just using them to illustrate a literal value)
once you are in sqlplus type 'startup", and wait for your database to start up and open
You can now connect as the appropriate user(s) for the lab
once you are done working in a lab session, you will need to shut down your database. At the sqlplus prompt, now type "connect internal", then type "shutdown immediate" and wait for your database to shut down.
exit out of sqlplus
exit out of your Unix account