存档

2005年10月 的存档

Oracle lesson preparation for Nov 1st

2005年10月31日 没有评论

1st Part : Introduction
———————————————————-
Oracle 9i offers comprehensive high-performance infrastructure including everything needed to develop,depoly and manage the internet applications:
Benifits:
1.Scalable from department to enterprise
2.Robust reliable available secure archetecture.
3.One development model, easy deployment options.
4.Leverage an organzation’s current skillset throught oracle applications(SQL,PL/SQL,XML,and Java)
5.One management interface
6.Industry standard technology.

Two productes:
1.Oracle9i Application Server
2.Oracle Database

Oracle Application Server runs all your applications:
1.Portal and website
2.Java transaction progress
3.Bussiness transaction process

Oracle database manage and store all the data:
1.object relational data
2.spreadsheet
3.work document
4.powerpoint presentations
5.XML
6.Multimedia file like Mp3,video and graphics.

Oracle 9i is object relational database management system.
1.Use defined types and objects
2.Full compatible with RDBMS
3.support multimedia and large objects
4.improve the performance and function in OLTP(online transaction process)

System development cycle life
1.strategy and analysis
2.design
3.build and document
4.transition
5.production

Database: an organized collection of information.
DBMS: is a progrom that could store,retrieve and modify the data in the database on request.
Four database: Flat-system,network,RDBMS,ORDBMS

RDBMS concepts:
1.1970,Dr E.F.Codd
2.RDBMS models consists the following:
collection of objects and relations
sets of operators act on relations
integraty of data for accuracy and consistency

RDBMS properties:
1.Can be accessed by executing SQL statement
2.Contains collection of tables with no physical points.
3.User operators.

ANSI(American National Standard Institute)
By useing SQL,
1.efficient
2.easy to learn and use
3.functional complete

—————————————————–
2nd Part : Write the basic SELECT statement

Syntax:
SELECT *|{[DISTINCT] column,expression [alias]}
FROM table

* : select all columns
DISTINCT: must following SELECT key word,it is used to encluding duplications.
Alias: 1.following the column
2.use AS key work
3.use double quatotion to include long strings.

DESC table
——————————————————-
3rd Part : Restricting and softing

Restricting by using WHERE clause:
Syntax:
SELECT *|{[DISTINCT] column,express[alias]}
FROM table
WHERE conditions

Conditions include:
1.=,>,>=,<,<=,<>
2.BETWEEN AND,IN(set),LIKE,NULL
3.NOT,AND,OR

In the WHERE conditions,the data and characters must be enclosed by singe quotations.

Softing:
Syntax:
ORDER BY column|expression ASC|DESC
We could also manipulate multiple columns.

——————————————–
4th Part : Sing row Functions

Character functions:
1.Case-sence: UPPER(column|expression)
LOWER(column|expression)
INITCAP(column|expression)
2.Manipulation functions:
CONCAT(column1|expression1,column2|expression2)
LENGTH(column|expression)
SUBSTR(column,m,n)
INSTR(column,m,n)
LPAD|RPAD(column,n,’strings’)
TRIM(leading|tailing|both,trim_string FROM trim_resouce)
REPLACE(test,seaching_String,replace_string)

Date functions:
MONTHS_BETWEEN(date1,date2)
ADD_MONTHS(date1,n)
NEXT_DAY(date,’strings’)
LAST_DAY(date)
ROUND(date,’string’)
TRUNC(date,’string’)

Numeric functions: Round(m,demical n)
TRUNC(m,n)
MOD(m,n)

Conversation functions:
TO_CHAR(date|number,’format’)
TO_NUMBER(character,’format’)
TO_DATE(character,’format’)

General functions:
NVL(expr1,expr2)
NVL2(expr1,expr2,expr3)
IFNULL(expr1,expr2)
COALESCE(expr1,expr2,expr3),return first non-null expression

Two expression: CASE, DECODE
CASE syntax:
CASE expr WHEN comparasion THEN returun_expr1
[WHEN comparasion THEN returun_expr2
WHEN comparasion THEN returun_expr3
]
ELSE exprn
END

DECODE syntax:
DECODE(expr1,search1,result1
search2,result2

default)

分类: 科技 标签:

Oracle Training

2005年10月31日 没有评论

Next week,I will give Oracle training to some people.
It has important meaning.

分类: 科技 标签:

Linux Tips

2005年10月19日 没有评论

Modify the kernel to make Linux run faster:

# cd /usr/src/linux-2.4 
# make mrproper 
# make menuconfig

This step will display a dialog,and I exclude some items which will never be used, for example, Fiber channel,isdr,and pcmcia,(Type “N”),and then save the new configuration,issue the following command:

# make dep (it will take about 5 minutes) 
# make clean (5 seconds) 
# make bzImage (10 minutes) 
# make modules (it's long and will take about 30 minutes) 
# make modules_install

Note: it is “modules_install” which have no backspace between “modules” and “_install”. and if issue the “make modules -install”, the process will failed with error. The final step is issueing the “reboot”. I’ve tried all the above steps, and my Linux runs faster after rebooting.

nroff: emulate nroff command with groff.

# nroff -man man/libnet.3 | less

Issue the commands as other user account:

# su - username -c "ls"

For example, let root issues “ls” :

# su - root -c "ls"

Uncompress the “.bz” file:

# tar -jvxf xxx.bz

If the file “/etc/inittab” was modified, issue the following command to make the configuration activity.

# init q

Q or q, tell init to re-examine the /etc/inittab fill.
S or s, tell init to switch to single user mode.

Issue some continuous commands, and it will break as soon as error happens.

# command1 && command2 && command3 

Uncompress the file included in rpm:

# cat xxx.rpm | rpm2cpio | pax -r

How to mount harddisk and directory owned by local Windows system or Remote windows system?

# mount -t smbfs -o username=x, password=x, //share_path /mnt/c 

Ethereal — capture packets.

Create and use .iso file:

# mkisofs -J -r -o xxx.iso /test 
# mount -o loop xxx.iso /mnt/cdrom 

Uncompress xxx.bz file:

# tar -I xxx.bz or # bunzip2 xxx.bz

Check the file’s rpm name:

# rpm -qf /usr/bin/ls

List description information:

# rpm - qpi

List file information:

# rpm - qpl

Configure the Memory limitation in Grub:

grub> kernel /boot/vmlinuz-2.4.19 20 boot=/dev/hda2 mem=120MB 

Type Chinese output:

# ls --show-control-chars

Make a Linux boot disk:

# mkbootdisk --device /dev/fd0 2.4.20 

Where 2.4.20 is directory in /lib/modules

Modify the ethernet device’s MAC address:

# ifconfig eth0 down 
# ifconfig eth0 hw ether 00:AA:BB:CC:DD 
# ifconfig eth0 up 

A very important command which is used to check ethernet card’s statue:

# mii-tool -v 

mii-tool -view, manipulate media-independent interface status.This utility checks or sets the status of a network interface Media Independent Interface(MII) .
-w watch monitor for link status changes

# du ./ --max-depth=1 
# du -sm /directory

List the existed users account in the Linux:

# cat -fl -d: /etc/passwd 

Find the MAC address of local ethernet card:

# arp 
# /sbin/arp 
分类: 科技 标签:

Remote desktop connection

2005年10月19日 没有评论

I have two computers in the office, the better one is installed RHEL3.0 update4. It used one Pentium4 775 3.2Ghz CPU and 4GB DDR2 memory,all these were based on Intel SE7221BA1-E engineer sample board. How fastly it runs! Another contains Celeron 533 and poorly 128MB memory,there are two operating system installed in this PC, windows 2000 Professional and Red Hat Linux 9.0.

The Lutos Notes is released by MI recently,and every employees must use this office system. I think the software is famous and be benifit for increasing work rate, but in facl it runs very very slowly so that I have no patience to wait. Through almost my work is done on Linux, I tried to control the Windows computer in my own Linux environment.

I found two tools, VNC and rdesktop. Both of these software were installed successfully, but it seemed that VNC could not response. Rdesktop would work but still could not connect to the windows. It said the windows refused connections. Why?

After reading some document in the Internet, I found that Windows 2000 Professional does not support remote connection ablity or terminal utility. However, Windows 2000 Server families could do this after installing external packages. Remote desktop was embeded in Windows XP and 2003 server. So, I installed a new Windows XP Professional in the PC whose cpu was celeron 533Mhz.

And then issue the rdesktop in the Linux command line:

# rdesktop -u phillip -g "1024*768" 192.168.1.143

“u” means username, phillip is an account of Windows XP
“g” configure the screen displayed in Linux environment
192.168.1.143, IP address of Windows machine.

By the way, the port number, for example 45272, could also be added to the following IP address.It will be useful when connecting to a server has firewall protecting. Everything of the Windows runs well in the Linux rdesktop connection session.

分类: 科技 标签:

Cluster-Fork

2005年10月11日 没有评论

Often we want to execute parallel jobs consisting of standard UNIX commands.By “parallel” we mean the same command runs on multiple nodes of the cluster.Rocks provides a simple tools for this purpose called cluster-fork.

By default,cluster-fork uses a simple series of ssh connections to launch the task serially on every compute node in the cluster.
Cluster-fork is smart enough to ignore dead nodes.Usually the job is “blocking”,cluster-fork waits for the job to start on one node before moving to the next.
By using the “–bg” flag you can instruct cluster-fork to start the jobs in the background.

Often you wish to name the nodes your job is started on,this can be done by using SQL statement or by specifying the nodes using a specific shorthand.

1.frontend,use the SQL database on the frontend:

$ cluster-fork --query 
"select name from nodes where name like 'compute-1-%'" [cmd]

2.Second method
requires us to explicitly name each node:

--node=compute-0-%d:0-2  : compute-0-0,compute-0-1,compute-0-2
--node=compute-0-%d;0,2-3  : compute-0-0,compute-0-2,compute-0-3 
分类: 科技 标签:

Compute nodes Installation

2005年10月11日 没有评论

Compute nodes Installation: 1.Login to the frontend as root; 2.Run a program which capture a compute node DHCP requestes and put their information into the Rocks MySQL database:

# insert-ethers

If the frontend and compute nodes are connected via a managed ethernet switch,select “Ethernet Switches”.”Insert-ethers” is waiting for new compute nodes.Power up the first compute node,when the frontend machine receives the DHCP request from the compute node,it indicates that insert-ethers received the DHCP request from the compute node,inserted it into the database and update all configuration files.

When reinstalling very large clusters,load is managed on the frontend by telling compute nodes to back off and retry if the server is too busy.Specially,if the number of concurrently running kickstart.cgi processes exceeds some threshold,the fronted will send a “negative acknowledge” in the form of 503 http error signal.When a compute node receive this signal,it takes a reasonable action and retries its installation later.While the load threshold is reasonable for most clusters,it may be adjusted in the /opt/rocks/etc/kcgive file.Once adjusted,the value is used immediately.

Crossing kickstart:Contain nodes of different hardware architectures.

Mount the CD’s as ISO format:

# mount -o loop *.iso /mnt/cdrom
分类: 科技 标签:

Frontend Installation

2005年10月11日 没有评论

Frontend installation

Required the following CDs: Rocks Base CD,HPC Roll CD,Kernel Roll CD.As soon as boot off from CD,type “frontend”.This step must be operated fastly before the screen displays the “boot” prompt,or the CD will be told to install a compute node,not frontend we need. We could access the kickstart system by pressing Alt+F3 and Alt+F4 respectively.According to IA-64,the following command should be used:

$ frontend driverload=ide-scsi(or hdb=ide-scsi)

Installation steps:

1.Input CDs,and type “frontend”;
2.Input the cluster information;
3.Partition (Automatic or Disk Druid),If select manual partitioning,you must specify at least 6GB for the root partition and you must create a sperate /export partition.
The default configuration is automatic.
4.Private cluster network configuration;
5.Public cluster network configuration,Note,DHCP is not supported,we must specify the IP address.
6.Configure the gateway and DNS entries;
7.Set the timezone and NTP server;
8.Input the root password;

Then the frontend will format it’s file systems,and install the packages.

分类: 科技 标签:

Introduction of NPACI Rocks

2005年10月10日 没有评论

Customers can concentrate on their scientific computing instead of worrying about the management of their cluster.Stability,maintainability,ease of installation are the target of NPACI Rocks.

Complexity of cluster management,for example,determine if all nodes have a consistent set of software.In additional,this structure insures any upgrade will not interface with actively running jobs.

A cluster contains compute nodes,frontend nodes,and monitoring nodes.Within a distribution,different node types are defined with a machine specific Red Hat kickstart file,made from a Rocks Kickstart Graph.

A kickstart file is a text-based description of all the software packages and software configuration to be deployed on a node.I found Kickstart item in the Red Hat AS3.0 update4 which is the operating system of my office computer.It shows the information of the setup and configuration about hardware.

Rocks is robust system.Rocks makes complete operating system installation on a node the base management tool.With attention to complete automation of this process,it became FASTER to reinstall all nodes to a KNOWN CONFIGURATION than it is to determine if nodes were out of sychronization in the first place.So,it is a useful way to reinstall the system than determination the difference of nodes.

Rocks suppors all the hardware component that Red Hat support,but only support the following types hardware:x86,IA-64 architecture(No SPARC,Alpha or Yamhill):

Support:x86(IA32,AMD),IA-64(Itanium,Mckinley),x86-64(AMD opteron)
Network:Ethernet,Myrinet(Lanai 9x)

Physicial setup for Rocks:

1.Frontend

Nodes of this type are exposed to the outside world,many services run on there nodes.Frontend nodes are where users login in,submit jobs,and compute code,etc.This node can also act as router for other cluster nodes by using network address translation.Frontend nodes generally have the followiing characts:Two ethernte interface,one public,one private; Lots of disk to store file.

2.Compute

There area the workhorse nodes.They are also disposed. The complete OS to be reinstalled on every compute node in a short amount of time(~10min).There nodes are not seen on the public Internet.The main component:Power cable,Ethernet Connection for administration,Disk drive for caching the operating system(OS and libraries),optional high-performance network(Myrinet).

3.Ethernet Network

All compute nodes are connected with ethernet on the private network.This network is used for administration,monitoring,and basic file sharing.

4.Application Message Pass Network

All nodes can be connected with Gigabit-class network and required switches.

On the compute nodes,the Ethernet interface that Linux maps to eth0 must be connected to the cluster’s Ethernet switchs.This network is consided private,that is,all traffic on this network is physically separated from external public network.
On the frontend,two ethernet interface are required.The interface that Linux maps to eth0 must be connected to the same ethernet network as compute nodes.The interface that Linux maps to eth1 must be connected to external network.

Once you’ve physically assembled your cluster,each node needs to be set to boot without a keyboard.This procedure requires setting BIOS values and,unfortunataly,is different for every motherboard.We’ve seen some machines where you cannot set them to boot without a keyboard.

分类: 科技 标签: