if statment
IF expression THEN commands
[ELSEIF expression THEN commands]
[ELSE commands]
END IF;
IF quantity_in_stock < 100 THEN
INSERT INTO infologs(msg)
VALUES (prd_code);
END IF;
FETCH cur_product INTO prd_code;
UNTIL no_more_products = 1
END REPEAT;
CLOSE cur_product;
SELECT * FROM infologs;
DROP TABLE infologs;
END$$
DELIMITER;
It is my Computer Notes. Using Guide : object-key or object-key-key e.g. Step 1 Blog Search : [mysql-run] and then Step 2 ctrl+F [mysql-run] {bookMark me : Ctrl+D}
2013年8月31日 星期六
mysql-procedure example sample eg e.g.
DELIMITER //
CREATE PROCEDURE GetOfficeByCountry(IN countryName VARCHAR(255))
BEGIN
SELECT city, phone
FROM offices
WHERE country = countryName;
END //
DELIMITER ;
CALL GetOfficeByCountry('USA')
CALL GetOfficeByCountry(‘France’)
/***********************************************************/
NO PARAMETER
DELIMITER $$
DROP PROCEDURE UPDATE_TEMP_SUMMARY_VIEW01 $$
CREATE PROCEDURE UPDATE_TEMP_SUMMARY_VIEW01()
BEGIN
truncate table TEMP_SUMMARY_VIEW01;
insert ignore into TEMP_SUMMARY_VIEW01 select * from SOINVPOSUMMARY;
END ;
$$
DELIMITER ;
linux-lan
/etc/sysconfig/network-scripts
ifdown ifcfg-eth0
ifup
ifconfig
szexzdz
ifdown ifcfg-eth0
ifup
ifconfig
szexzdz
/etc/sysconfig/network[top] gateway
- NETWORKING=yes
- HOSTNAME=host.domainname.com ## set Host Name
- GATEWAY=20.0.0.254 && SET THE ROUTER'S GATEWAY
net.ipv4.ip_forward=1 && 0 for disable routner, default is 0
net.ipv4.tcp_syncookies = 1 && prevents the Linux machine from sync flood attacks
net.ipv4.icmp_echo_ignore_broadcasts = 1 && prevents attackers make use smurf attacks.
kernel.shmmax = 5000000
net.ipv4.tcp_syncookies = 1 && prevents the Linux machine from sync flood attacks
net.ipv4.icmp_echo_ignore_broadcasts = 1 && prevents attackers make use smurf attacks.
kernel.shmmax = 5000000
- DEVICE=eth0 &ð0 it must match the file name , when second id, then the eth0, change to eth0:0
- BOOTPROTO =dhcp ii(dhcp , none, dhcp or static)
- HWADDR==00:12:34:56:78:90
- ONBOOT=yes && when linux boot up
- DHCP_HOSTNAME=servera.domain.com
- SEARCH=
- NM_CONTROLLED=
- IPADDR=192.168.65.31 && iif(dhcp, 192.168.65.31, no this line)
- NETMASK=255.255.255.0 && iif(dhcp, 255.255.255.0, no this line)
- GATEWAY=192.168.65.254 && iif(dhcp, 192.168.65.3254, no this line)
Remark : The Second will call ifcfg-eth1
/etc/resolv.conf ## DNS Setting
echo "nameserver 202.14.67.4" >> /etc/resolv.conf
tcp-port
| TCP port (Listen) | Service | ||
|---|---|---|---|
| 20 | Ftp data | ||
| 21 | Ftp command | ||
| 22 | SSH | ||
| 23 | Telnet | ||
| 25 | SMTP | ||
| 37 | Time Protocol | ||
| 53 | DNS | ||
| 66 | Oracle Sql-net | ||
| 67 | DHCP | ||
| 80 | Http | ||
| 88 | Authentication | ||
| 110 | POP3 | ||
| 119 | NNTP | ||
| 123 | NTP | network time protocol | |
| 135 | epmap | end point map for mc rpc locator | |
| 137 | samba (nmbd) for net bios | ||
| 138 | samba | ||
| 139 | samba (smbd for printer share and file share) | ||
| 143 | IMAP | ||
| 389 | LDAP | http://www.hkitn.com/article.php/4897AD Active Directory windows2003 firwall setting, 流覽當前正在使用 NetMeeting 2.0 的用戶名單 | |
| 443 | https | ||
| 445 | samba, microsoft-ds | smb protocol , directory share | |
| 631 | cups | ||
| 636 | LDAPS | ||
| 873 | rsyncd | ||
| 993 | imaps | ||
| 995 | Pop 3 (ssh) | ||
| 1158 | oracle em | http://localhost.localdomain:1158/em | |
| 1154-1500 | Ip-Phone | ||
| 1521 | Oracle | http://localhost.localdomain:1521/isqplus/dba | |
| 1526 | Oracle Listen Port | ||
| 1720 | H323 | IP Phone | |
| 1723 | VPN | ||
| 1863 | xp 一般連線,msm | ||
| 3128 | squid (proxy server) | ||
| 3306 | MySql | ||
| 3389 |
| ||
| 5100 | 即時影音通訊 | ||
| 5560 | Oracle isqplus |
| |
| 5631 | Anywhere | ||
| 6000 | TCP guarantees delivery of data and also guarantees that packets will be delivered on port 6000 in the same order in which they were sent. Guaranteed communication over port 6000 is the key difference between TCP and UDP. UDP port 6000 would not have guaranteed communication in the same way as TCP. ...more, | ||
| 6346 | foxy | ||
| 6501 udp | xp | ||
| 6885-6889 | BT | ||
| 8080 | IPPhone Hutch... | ||
| 30000-31000 | IP-Phone | ||
| 6891-6900 | |||
| 7800-7825 |
abc class private-network private-lan
| TCP Class | Ip Network | Private LAN | Must mask | subnet | |
|---|---|---|---|---|---|
| A | 1-126 [00000001] [01111111] | 10.0.0.0 /8 | 255.0.0.0 | 255.128.0.0 | |
| B | 128-191 [10000001] [10111111] | 172.16.0.0 /16 to 172.31.0.0 /16 | 255.255.0.0 | 255.255.192.0 | |
| C | 192-223 [11000000] [11011111] | 192.168.0.0 /24 to 192.168.255.0 /24 | 255.255.255.0 | 255.255.255.224 | |
| D | 224-239 | Multi case | |||
| E | 240-255 | Remain | |||
| Class D is multicase purpose. Some software can add a ip number on the lan Card for rec'd purpose. A lan can have more than 1 this number. 1 < many. Subnet Mask option : 0,128,192,224,240,248,252,254,255, A subnet mask is used to idenify the network ID or the Host ID of an IP address. | |||||
sub-net-mask
subnet mask
A /24 network may be divided into the following subnets by increasing the subnet mask successively by one bit. This affects the total number of hosts that can be addressed in the /24 network (last column).
| Prefix size | Network mask | Available subnets | Usable hosts per subnet | Total usable hosts |
|---|---|---|---|---|
| /24 | 255.255.255.0 | 1 | 254 | 254 |
| /25 | 255.255.255.128 | 2 | 126 | 252 |
| /26 | 255.255.255.192 | 4 | 62 | 248 |
| /27 | 255.255.255.224 | 8 | 30 | 240 |
| /28 | 255.255.255.240 | 16 | 14 | 224 |
| /29 | 255.255.255.248 | 32 | 6 | 192 |
| /30 | 255.255.255.252 | 64 | 2 | 128 |
| /31 | 255.255.255.254 | 128 | 2 * | 256 |
osi-7layer
osi7layer
| 1 Physical | 2 Data-Link | 3 Network | 4 Transport | 5 Session | 6 Presen tation | 7 Application | |
|---|---|---|---|---|---|---|---|
| Example | Cables, Adapters | Ethernet Lan, PPP, Token Ring, Frame Relay, Telephone Lines, ATM | IP | TCP, UDP | NetBIOS Check Point open 1 IE connect | ASCII | FTP, SMTP, Telnet |
| Address | MAC | Network | |||||
| Protocol | Transfer logical device to prhysical device protocol (DNS, NBP, X500) | IPX,IP NWLINK, NetBeui, DECnet, XNS, DDP (datagram delivery Protocol : Apple talk) | SPX,TCP,NWLink, ATP (Apple Talk Protocol) NBP (Name binding Protocol) Netbeui (not routable) LAT (loca area trasnport , not routable) | NetBIOS | APPC - AS400 Advance Protoprog comm FTAM OSI, File Transfer access Management, X.400; x.500, SMTP, FTP, SNMP, Telnet, NCP (novell core protocol) , SMB (server manage Block), AFP (Apple Talk Filing Protocol) , DAP (Data access protocol) DEC (Apple Talke/ Apple Share) | ||
| Hardware | Hub, Switch, Bridge, Repeater 100M bit per second = 30 g Byte transfer per hour. | Router | Gateway | ||||
| Oracle | Oracle Net | ||||||
| ARP | ARP | ||||||
| Netbeui | netbeui | ||||||
*
訂閱:
文章 (Atom)