Professional Documents
Culture Documents
Module 1.1 Connecting To An SIUE Oracle Server Using PuTTY
Module 1.1 Connecting To An SIUE Oracle Server Using PuTTY
This document is designed to assist you in getting started with using Oracle
software provided by the Department of Computer Management and Information
Systems. Topics covered:
Departmental Databases
The primary databases for student use on the sobora1 server are:
The primary databases for student use on the sobora2 server are:
Student Databases each student group in CMIS565 will build their own Oracle
database(s) on this server.
Student accounts for your use in your course of enrollment will be distributed to
you by your instructor in class.
Secure Login
In the past you may have connected remotely to a server or database through the
use of Telnet. Unfortunately, Telnet does not provide a secure connection
information is transmitted in plain text and a computer hacker can steal a
login/password combination. Additionally, to provide proper security, the Telnet
software on CMIS departmental database servers is not enabled.
In order to connect to the operating system level on the one of our database
servers, you must connect with a secure login session (termed SSH). You can use
any SSH client to make your connection if you dont have one, we recommend a
freeware product named PuTTY that is available by free download from the
Internet. PuTTY is installed in the computer classrooms and laboratories in
Founders Hall.
To connect to a departmental database using PuTTY you need two login accounts
one will enable you to connect to the computer at the operating system level. The
second will enable you to connect to the actual database.
similar name). The database login user name is only active for the term in which
you are enrolled.
Port 22.
Saved Sessions use this textbox to enter a name for the session. Click the
Save button to save the session information. The next time you use PuTTY,
you can simply double-click the session name in order to complete your
connection to the server. In the figure shown below the session has been
saved with the name SOBORA2. Saving the session name is optional you
do not have to save it.
If you explore the various links under the Category list box youll discover that
you can modify the appearance and other features to suit your personal
preferences.
If you enter the IP address to make the connection, you will probably see an alert
like the one shown in the next figure. Click the Yes button to confirm that you
trust the sobora2 server as a host.
you connect to a database named with your user name if that database
doesnt actually exist??? The answer is NO so remember to type
DBORCL some other value depending on the database identifier to which
you need connection.
Theres a good reason for asking you the database name to which you
need to connect CMIS 565 students build their own database. They will
name the database following guidelines distributed in the CMIS 565 class
none of their databases will be named DBORCL. If you are a CMIS 565
student desiring to connect to your database, then you must enter the
name of YOUR database, not DBORCL.
The SQL*Plus software provided with the Oracle relational database management
system is an extension of the ISO/ANSI standard structured query language.
SQL*Plus enables you to work with an oracle database to write queries that
retrieve information, statements that modify the structure of a database, and
execute scripts that contain a series of SQL*Plus commands.
Starting SQL*Plus
Oracles SQL*Plus software is used primarily to write database queries. To start
using SQL*Plus you issue the name of the program at the LINUX operating
system prompt. Note that SQL*Plus is entered in lower case (sqlplus) as shown
in the series of commands shown below.
dbock/@sobora2.isg.siue.edu=>sqlplus
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
Production
With the Partitioning, OLAP, Data Mining and Real Application
Testing options
login.sql loaded.
SQL>
Enter your Oracle login user name and Oracle password (remember that these
accounts will be distributed by your instructor in class). A successful login results
in the display of the SQL> prompt. You have just successfully connected to the
database and are now ready to use Oracles SQL*Plus software to type SQL
queries.
If you are unable to connect to a specific database and receive a system message
that Oracle is not available there are two possibilities: (1) the value for the
Oracle_SID is not correct go back to the above section and logout then login in
again and type the correct name for ORACLE_SID, or (2) the database has been
shutdown either inadvertently, the server is down, or the database is offline for
system backup. You may send an email to your instructor to check the status of the
database and server.
Did you notice the message login.sql loaded in the above output listing?
Each time you connect to SQL*Plus, Oracle checks to determine if you
have a login.sql file in the current working directory (the current directory
when you connect is your home directory unless youve changed it). If the
file exists, then SQL*Plus processes the commands stored in this file
during the load process.
There are two ways to create the file. You can create it with Windows Notepad
(the file must be a plain text file so using Microsoft Word or Wordpad WILL NOT
work), or you can use the LINUX vi editor to create the file. The file must be
named login.sql, not login.sql.txt or some other name. The exact name must
match or else SQL*Plus will not process the file. If you use Windows Notepad to
create the file, you will need to transfer the file from your client computer to your
assigned user directory on the server (either sobora1 or sobora2 depending on the
server assigned for your class work) the steps on using file transfer protocol
(FTP) to transfer files to the server are covered later in this document.
The login.sql file needs to contain the following commands at a minimum. You
may wish to experiment with the pagesize because your client computer
may display more than 23 lines depending on the size font that you have
set as your default within PuTTY.
While connected to SQL*Plus, use the Alter User command to change your
password within the database. A sample command is shown here. Replace
USER001 with your assigned login name and new_password with the new
password that you wish to use.
Example:
You will often need to transfer files from your client computer to your assigned
working directory on the sobora1 or sobora2 server. An example is the login.sql
file described in the previous section. Another example might be a script file that
you create that contains SQL code as a series of SQL*Plus statements. It is much
easier to work with Windows Notepad to write SQL code than it is to use the vi
editor provided with LINUX.
In order to transfer files you need to use client software that provides for secure
copying of documents to and from your assigned database server a secure form
of FTP.
While you can use any secure SCP (secure copy) software, we recommend the
WinSCP freeware product that is available from many different sites on the
Internet. You can simply search on WinSCP and download and install the product
to the client computer.
During installation of WinSCP you can select the user interface we recommend
a Norton Commander style of user interface as it is very easy to use.
Port number: 22
After you connect to the server, you will find that the user interface (if you selected
the Norton Commander interface) has two panels as shown in the next figure. The
left panel displays file information for the client computer while the right panel
displays file information for the server. You can explore the menus and shortcut
buttons in order to discover how to change directories (folders) on the client and
server computers.
Transferring Files
Files are transferred from the client to the server (or the other way around) by
simple drag-and-drop. Use the mouse to select a file to be transferred (copied) and
drag the file from one panel to the other. This will cause a Copy window like the
one shown below to display. The window has many options to enable you to
specify whether to rename the file, transfer text or binary I have had trouble
using Automatic to let the software decide whether the file is text or binaryit
doesn't seem to work consistently. So, when transferring plain text files that
contain script code you wish to execute, you should select Text as a Transfer mode
see the figure below. Clicking the Copy button completes the transfer.
can also damage one. Each of you will be building a database and you
must act with professionalism.
You may check the environment variable settings by typing the UNIX env
command at the operating system command prompt. The particular
environment variables we are concerned with are:
PATH specifies the path for your account to various Oracle software
server subdirectories. Programs and files on these subdirectories can be
executed directly without specifying the subdirectory location as part of the
execution command.
You may set values for environment variables by entering them directly at
the operating system command prompt. The commands shown below
provide examples that show you how to set values for environment
variables for the version of the LINUX shell that we are using. Do not type
the information shown in brackets.
The listing shown below gives a typical display as output from the env command.
If you discover that an environment variable is wrong, then you can modify the
.profile file that is located on your home directory for your server account. This
can be accomplished by using a text editor such as vi to edit your .profile file, or
by FTPing the file to your client computer, using Notepad to edit the file, then
FTPing the file back to your Oracle home directory. ALWAYS MAKE A
BACKUP COPY OF ANY SYSTEM FILE THAT YOU EDIT BEFORE EDITING
IT.
dbock/@sobora2.isg.siue.edu=>env
_=/bin/env
SSH_CONNECTION=::ffff:146.163.164.19 2884
::ffff:146.163.252.102 22
PATH=/u01/app/oracle/product/10.2.0/db_1/bin:/bin:/usr/bin:/usr/l
ocal/bin:.
SHELL=/bin/ksh
HOSTNAME=sobora2.isg.siue.edu
USER=dbock
SSH_CLIENT=::ffff:146.163.164.19 2884 22
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
TERM=xterm
INPUTRC=/etc/inputrc
G_BROKEN_FILENAMES=1
ORACLE_SID=DBORCL
LANG=en_US.UTF-8
SSH_TTY=/dev/pts/3
LOGNAME=dbock
LS_COLORS=no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:
bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;3
2:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:
*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=0
0;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2
=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;3
5:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35
:*.tif=00;35:
MAIL=/var/spool/mail/dbock
LD_LIBRARY_PATH=/u01/app/oracle/product/10.2.0/db_1/lib
HOME=/home/dbock
HISTSIZE=1000
LESSOPEN=|/usr/bin/lesspipe.sh %s
/home/dbock
You can access your server home directory with the operating system command:
cd $HOME. Note that this command must be typed in caps as shown. All
environment variables are capitalized by convention. In order to refer to the
contents of the variable, you preface the variable name with the $ symbol.
You can confirm you have a .profile file by listing the files on your home
directory with the operating system command:
ls -al
END OF NOTES.