際際滷

際際滷Share a Scribd company logo
Oracle 10g Express
Download Oracle 10g Express
? Oracle 10g Express Edition:
   C http://www.oracle.com/technetwork/database/express-
     edition/overview/index.html
? Oracle? Database Express Edition Installation Guide
   C http://download.oracle.com/docs/cd/B25329_01/doc/install.1
     02/b25143/toc.htm#CIHBCFDD
? Oracle? Database Express Edition Getting Started
  Guide

  http://download.oracle.com/docs/cd/B25329_01/doc/
  admin.102/b25610/toc.htm
Start and Login to Oracle 10g Exp
? To start:Oracle PopUp menu
  C Start database: wait for the services to complete:
     ? The OracleXETNSListener service was started successfully.
     ? The OracleServiceXE service is starting..............................
     ? The OracleServiceXE service was started successfully.
  C Go to database home page
     ? Login
     ? Accounts
         C System administrator
         C User
     ? Logout
  C Stop database
Online Help
? SQL reference:
  C http://download.oracle.com/docs/cd/B14117_
    01/server.101/b10759/toc.htm
? Tutorial:
  C http://st-
    curriculum.oracle.com/tutorial/DBXETutorial/in
    dex.htm
Run SQL Command Line
           SQL*Plus
? First start Oracle
? Then choose Run SQL Command Line
  from Oracle menu
? At the prompt:
  C Connect accoutName
Commands at Oracle SQL>
? To list all commands:
  C SQL>help index
? To list all tables:
  C Select * from Cat;
? To display a table structure:
  C Describe tableName
? To run a DOS command from Oracle:
  C Host DOSCommand
  C Example: Host dir
Creating SQL Command Batch File

? Creating a batch file with .sql extension
  C At SQL>Edit filename
     ? Ex: SQL>edit c:batch1.sql
? Use START command to execute the
  batch file.
        C SQL>START c:batch1.sql

? See the batch file contents at SQL>
  C SQL>host type c:batch1.sql
Batch File Example
Drop table hotel;
Create table hotel (hotelno char(3), hotelname varchar(20),city varchar(20));
Insert into hotel values('h1', 'Grosvenor','CHICAGO');
Insert into hotel values('h2', 'Westin','SAN FRANCISCO')
Insert into hotel values('h3', 'Hilton','London');

Drop table room;
Create table room(roomno char(3),hotelno char(3),type char(6),
     price number(7,2));
Insert into room values('r1','h1','single', 200.00);
Insert into room values('r2','h1','single', 300.00);
Insert into room values('r3','h1','double', 440.00);
Insert into room values('r1','h2','single', 200.00);
Insert into room values('r2','h2','single', 300.00);
Insert into room values('r3','h2','double', 400.00);
Insert into room values('r1','h3','single', 200.00);
Insert into room values('r2','h3','single', 250.00);
Insert into room values('r3','h3','double', 300.00);
? To display complete field name:
   C Ex.
   C column sex format a3
   C Select * from student;
? To print output:
   C Screen capture
   C Command window:
      ? Click the SQL icon on the upper left corner
      ? Edit/Mark
      ? Edit/Copy
? Enter a date value: assume emp table has: eid,
  ename, hiredate and salary field:
   C Insert into emp values(`e1¨, `peter¨,¨10-Feb-
     04¨,5000.00);
Working with SQL Buffer
? SQL Buffer remembers the last SQL
  command executed.
? List: list the SQL statement with line
  number
? correct the line with error:
     ? line number correct statement
? Run

More Related Content

Intro oracle10gexpress

  • 2. Download Oracle 10g Express ? Oracle 10g Express Edition: C http://www.oracle.com/technetwork/database/express- edition/overview/index.html ? Oracle? Database Express Edition Installation Guide C http://download.oracle.com/docs/cd/B25329_01/doc/install.1 02/b25143/toc.htm#CIHBCFDD ? Oracle? Database Express Edition Getting Started Guide http://download.oracle.com/docs/cd/B25329_01/doc/ admin.102/b25610/toc.htm
  • 3. Start and Login to Oracle 10g Exp ? To start:Oracle PopUp menu C Start database: wait for the services to complete: ? The OracleXETNSListener service was started successfully. ? The OracleServiceXE service is starting.............................. ? The OracleServiceXE service was started successfully. C Go to database home page ? Login ? Accounts C System administrator C User ? Logout C Stop database
  • 4. Online Help ? SQL reference: C http://download.oracle.com/docs/cd/B14117_ 01/server.101/b10759/toc.htm ? Tutorial: C http://st- curriculum.oracle.com/tutorial/DBXETutorial/in dex.htm
  • 5. Run SQL Command Line SQL*Plus ? First start Oracle ? Then choose Run SQL Command Line from Oracle menu ? At the prompt: C Connect accoutName
  • 6. Commands at Oracle SQL> ? To list all commands: C SQL>help index ? To list all tables: C Select * from Cat; ? To display a table structure: C Describe tableName ? To run a DOS command from Oracle: C Host DOSCommand C Example: Host dir
  • 7. Creating SQL Command Batch File ? Creating a batch file with .sql extension C At SQL>Edit filename ? Ex: SQL>edit c:batch1.sql ? Use START command to execute the batch file. C SQL>START c:batch1.sql ? See the batch file contents at SQL> C SQL>host type c:batch1.sql
  • 8. Batch File Example Drop table hotel; Create table hotel (hotelno char(3), hotelname varchar(20),city varchar(20)); Insert into hotel values('h1', 'Grosvenor','CHICAGO'); Insert into hotel values('h2', 'Westin','SAN FRANCISCO') Insert into hotel values('h3', 'Hilton','London'); Drop table room; Create table room(roomno char(3),hotelno char(3),type char(6), price number(7,2)); Insert into room values('r1','h1','single', 200.00); Insert into room values('r2','h1','single', 300.00); Insert into room values('r3','h1','double', 440.00); Insert into room values('r1','h2','single', 200.00); Insert into room values('r2','h2','single', 300.00); Insert into room values('r3','h2','double', 400.00); Insert into room values('r1','h3','single', 200.00); Insert into room values('r2','h3','single', 250.00); Insert into room values('r3','h3','double', 300.00);
  • 9. ? To display complete field name: C Ex. C column sex format a3 C Select * from student; ? To print output: C Screen capture C Command window: ? Click the SQL icon on the upper left corner ? Edit/Mark ? Edit/Copy ? Enter a date value: assume emp table has: eid, ename, hiredate and salary field: C Insert into emp values(`e1¨, `peter¨,¨10-Feb- 04¨,5000.00);
  • 10. Working with SQL Buffer ? SQL Buffer remembers the last SQL command executed. ? List: list the SQL statement with line number ? correct the line with error: ? line number correct statement ? Run