Difference between revisions of "Oracle:SQLPlus"

From mi-linux
Jump to navigationJump to search
(Created page with "Main Page >> Oracle and SQL >> Getting Started >> SQL*Plus == SQL*Plus - First Time == The first time you use SQL*Plus you will need t...")
 
 
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Main Page]] >> [[Oracle|Oracle and SQL]] >> [[OracleGettingStarted|Getting Started]] >> SQL*Plus
+
[[Main Page]] >> [[Oracle|Oracle and SQL]] >> [[Oracle_Workbook|Workbook]] >> [[Oracle_Getting_Started|Getting Started]] >> SQL*Plus
== SQL*Plus - First Time ==
 
  
The first time you use SQL*Plus you will need to launch it from the Apps Anywhere Software Hub
+
== SQL*Plus Client ==
  
== Apps Anyhere ==
+
First of all start SQL*Plus - see this page for details: [[Oracle:Apps_Anywhere|Starting SQL*Plus]]
The Oracle database can be accessed via different clients. When using the software at the University, it is available via the Applications Anywhere software hub:
 
[[http://www.wlv.ac.uk/appsanywhere Apps Anywhere]]
 
  
The first time you use Oracle, click the Apps Anywhere icon on your desktop:  
+
It will then present you with a log on screen similar to the following figure:
  
http://mi-linux.wlv.ac.uk/~oracle/wiki/Apps.png  
+
https://mi-linux.wlv.ac.uk/~oracle/wiki/InstantClient19c.png  
  
Which will bring up the following window:
+
Fill in the following, note the format of the username carefully:
 +
<table>
 +
<tr><td>User-name:</td><td>This is your student number, preceded by <b>OPS$</b> and followed by <b>@ora19c</b></td></tr>
 +
<tr><td>&nbsp;</td><td>
 +
E.g., if your username is 0912345, then type in: <b>OPS$0912345@ora19c</b></td></tr>
 +
<tr><td>Password:</td><td>When you registered for Oracle, you will have been given a password. Type this in when prompted.</td></tr>
 +
<tr><td>&nbsp;</td><td>
 +
<font color="red">Note, the password will not be echoed on the screen, nor any asterisks shown.</font></td></tr>
 +
</table>
 +
 
 +
Do note that the password is <b>case sensitive</b>, but the user-name is not. Generally the initial password given starts with a capital letter. You can change this once you have logged in.
 +
 
 +
If you have logged in successfully you will be presented with the <b>SQL></b> prompt:
 +
 
 +
https://mi-linux.wlv.ac.uk/~oracle/wiki/InstantClient19cLogin.png
  
http://mi-linux.wlv.ac.uk/~oracle/wiki/appsAnywhere.png
+
== Easy Connect String ==
  
Click where it says CLICK HERE and then search for <b>Oracle</b>. It will install as a group of 3 tools:
+
If you find the ''@ora19c'' returns with
 +
<pre>
 +
ORA-12154: TNS:could not resolve the connect identifier specified
 +
</pre>
  
Oracle Data Modeller<br>
+
Then when prompted for a username in SQL*Plus, type in:
Oracle SQL Data Developer<br>
+
<pre>
Oracle SQL*Plus
+
yourOracleUsername/yourOraclePassword@ora-srv.wlv.ac.uk:1521/catdb.wlv.ac.uk
 +
</pre>
  
Note, you may have to install this for every PC that you use.
+
This must be entered as one line at the ''Enter user-name:'' prompt. Replace ''yourOracleUsername'' and ''yourOraclePassword'' with your own details.
  
== SQL*Plus Client ==
+
== SQL*Plus Command Line ==
 +
 
 +
The prompt: <b>SQL></b> means the system is waiting for you to enter a command.
 +
 
 +
There are two types of command that you may enter:
 +
 
 +
• SQL commands. For manipulating data in the database. Each SQL command is terminated by a semi-colon, which will be seen later.
 +
 
 +
• Control commands. For formatting results and editing. The semi-colon is optional for these commands.
 +
 
 +
== Changing Your Password ==
 +
 
 +
It is advisable to change your initial password to something else. To do this, once you have logged in, type:
  
Once SQL*Plus has been installed you should find it has been added to your program menu (or select from new window - check):
+
  password
  
http://mi-linux.wlv.ac.uk/~oracle/wiki/oracle_options.png
+
It will ask for your old password first, before you can set a new one.
  
In which case you can start the program by clicking on:
+
If you forget your new password and the system locks you out after several attempts, re-run the registration program and it will reset it back to the original password:
  
  Start>All Programs>Oracle >SQL Plus 12.1
+
[https://mi-linux.wlv.ac.uk/~oracle/reg12c/orareg.php Oracle registration program]
  
It will then present you with a log on screen as shown on the following figure:
+
Please note: we can not access any updates to your password once you change it!
  
http://mi-linux.wlv.ac.uk/~oracle/wiki/SQLPlus_Client.png
+
== Next: Setting up the Sample Database ==
  
Fill in the following, note the format of the username carefully:
+
Initially you will have no tables in your database. The next step is to: [[Oracle:Sample_Database|set up the sample database]]
<table>
 
<tr><td>User-name:</td><td>This is your student number, preceded by <b>OPS$</b> and followed by <b>@ora12c</b></td></tr>
 
<tr><td>&nbsp;</td><td>
 
E.g., if your username is 0912345, then type in: OPS$0912345@ora12c</td></tr>
 
<tr><td>Password:</td><td>When you registered for Oracle, you will have been given a password. Type this in when prompted.</td></tr>
 
<tr><td>&nbsp;</td><td>
 
<font color="red">Note, the password will not be echoed on the screen, nor any asterisks shown.</font></td></tr>
 
</table>
 

Latest revision as of 20:19, 28 September 2020

Main Page >> Oracle and SQL >> Workbook >> Getting Started >> SQL*Plus

SQL*Plus Client

First of all start SQL*Plus - see this page for details: Starting SQL*Plus

It will then present you with a log on screen similar to the following figure:

InstantClient19c.png

Fill in the following, note the format of the username carefully:

User-name:This is your student number, preceded by OPS$ and followed by @ora19c
  E.g., if your username is 0912345, then type in: OPS$0912345@ora19c
Password:When you registered for Oracle, you will have been given a password. Type this in when prompted.
  Note, the password will not be echoed on the screen, nor any asterisks shown.

Do note that the password is case sensitive, but the user-name is not. Generally the initial password given starts with a capital letter. You can change this once you have logged in.

If you have logged in successfully you will be presented with the SQL> prompt:

InstantClient19cLogin.png

Easy Connect String

If you find the @ora19c returns with

ORA-12154: TNS:could not resolve the connect identifier specified

Then when prompted for a username in SQL*Plus, type in:

yourOracleUsername/yourOraclePassword@ora-srv.wlv.ac.uk:1521/catdb.wlv.ac.uk

This must be entered as one line at the Enter user-name: prompt. Replace yourOracleUsername and yourOraclePassword with your own details.

SQL*Plus Command Line

The prompt: SQL> means the system is waiting for you to enter a command.

There are two types of command that you may enter:

• SQL commands. For manipulating data in the database. Each SQL command is terminated by a semi-colon, which will be seen later.

• Control commands. For formatting results and editing. The semi-colon is optional for these commands.

Changing Your Password

It is advisable to change your initial password to something else. To do this, once you have logged in, type:

 password

It will ask for your old password first, before you can set a new one.

If you forget your new password and the system locks you out after several attempts, re-run the registration program and it will reset it back to the original password:

Oracle registration program

Please note: we can not access any updates to your password once you change it!

Next: Setting up the Sample Database

Initially you will have no tables in your database. The next step is to: set up the sample database