1 / 9

Introduction to UNIX (AIX)

Introduction to UNIX (AIX). Todd Bacastow IST 210: Organization of Data. Introduction to UNIX (AIX). UNIX developed at Bell Labs in 70s One of the oldest and most reliable OS Linux, SUN/Solaris are UNIX kernel with additional features. Introduction to UNIX. Basic Commands (like DOS prompt)

temple
Download Presentation

Introduction to UNIX (AIX)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to UNIX (AIX) Todd Bacastow IST 210: Organization of Data

  2. Introduction to UNIX (AIX) • UNIX developed at Bell Labs in 70s • One of the oldest and most reliable OS • Linux, SUN/Solaris are UNIX kernel with additional features

  3. Introduction to UNIX • Basic Commands (like DOS prompt) • List files - ls • Copy files - cp file1 file2 • Move/Rename files – mv file1 file2 • Delete files – rm • DANGEROUS COMMAND • One can delete all his/her files by mistake • Write alias rm ‘rm –i’ every time log on to play safe

  4. Introduction to UNIX • Some more commands • mkdir mydir – to make a new directory • cd mydir – to change directory • man mkdir – display help about a command • cd - to come back to your home directory • We will use ssh client to log onto UNIX machines

  5. Connect to IBM DB2 • First log on to rs6klab.aset.psu.edu • Enter username and password (CAC) • Type the following commands • >source /home/db2clnt/sqllib/db2cshrc • >db2

  6. Inside IBM DB2 • Some simple commands • db2>list database directory – to show databases • db2>connect to classale – to connect to a database • db2>select * from pennstate.zipcodes • Now you can start typing SQL • Remember no semi-colons needed

  7. Dot notation • Dot notation refers to prefixing the table names to column names, to avoid ambiguity, as such: SELECT S.sname FROM Sailors S, Reserves R WHERE S.sid = R.sid AND R.bid = 103 Or it can be used to identify [schema].[tablename] SELECT * FROM tsb4.names

  8. Example • If user tsb4 creates the table ‘test’ as below: db2 => CREATE TABLE test (item1 INT,item2 CHAR(50)) db2 => INSERT INTO test VALUES (10, ‘Test’) you would have to access that users table by first connecting to tsb4 and then querying the table similar to the command below. Db2 => connect to tsb4 db2 => select * from tsb4.test

  9. Running SQL From File in UNIX • Create a file (create.sql ) with the SQL statements using PICO in the UNIX window: Connect to classale; Create Table Sample1(Partno Int, Partdesc Char(50)) • 'cd' to the directory where you have stored the script. Type and run the following command: [UNIX Prompt]: db2 -tvf create.sql The parameter 't' refers that the default statement delimiter(;) has been used, 'v' represents verbose mode output and 'f' tells the command that the string following is the name of a file containing SQL Statements.

More Related