Thursday, March 5, 2015

IGNOU MCA Solved Lab Manuals of all Semesters


IGNOU MCA Solved Lab Manuals of all Semesters

Get IGNOU MCA Solved Lab Manuals for 1st Semester, 2nd Semester, 3rd Semester, 4th Semester and 5th Semester .
1 – First Semester
C and Assembly Language Programming (MCSL-017)
Download IGNOU First Semester Solved Lab Manual
2 – Second Semester
Lab Course (MCS-025)
Download IGNOU Second Semester Solved Lab Manual
3 – Third Semester
Lab Course ( MCSL-036 )
Download IGNOU Third Semester Solved Lab Manual
4 – Fourth Semester
UNIX and DBMS Lab (MCSL-045)
Download IGNOU First Semester Solved Lab Manual
5 – Fifth Semester
Laboratory Course (MCSL-054)
Download IGNOU First Semester Solved Lab Manual
If any question is missing on Solved Lab Manuals, please post here in comments and we will try to provide solution as soon as possible

 

Download IGNOU Second Semester Solved Lab Manual

SECTION – 2
Operating System & Networking Lab
Session 1 : Network Configuration
Ex 1: Run the following commands and write the use of each command.-
Answer :
Ipconfig
C:\Documents and Settings\Administrator>ipconfig
Windows 2000 IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.227.1.81
Subnet Mask . . . . . . . . . . . : 255.255.255.128
Default Gateway . . . . . . . . . : 10.227.1.1
ping
C:\Documents and Settings\Administrator>ping
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] destination-list
telnet
Microsoft (R) Windows 2000 (TM) Version 5.00 (Build 2195)
Welcome to Microsoft Telnet Client
Telnet Client Build 5.00.99206.1
Escape Character is 'CTRL+]'
Microsoft Telnet>
diskperf
C:\Documents and Settings\Administrator>diskperf
1 Physical Disk Performance counters on this system are currently set to start At boot.
netdiag
C:\Documents and Settings\Administrator>netdiag
'netdiag' is not recognized as an internal or external command,
operable program or batch file.
netstat
C:\Documents and Settings\Administrator>netstat
Active Connections
Proto Local Address Foreign Address State
TCP Amb:1208 72.20.27.115:8080 SYN_SENT
TCP Amb:2380 105.173.200.246:microsoft-ds SYN_SENT
TCP Amb:2381 17.43.237.130:microsoft-ds SYN_SENT
pathping
C:\Documents and Settings\Administrator>pathping
Usage: pathping [-n] [-h maximum_hops] [-g host-list] [-p period]
[-q num_queries] [-w timeout] [-t] [-R] [-r] target_name
ftp
C:\Documents and Settings\Administrator>ftp
ftp>
sfc
C:\Documents and Settings\Administrator>sfc
Microsoft(R) Windows 2000 Windows File Checker Version 5.00
(C) 1999 Microsoft Corp. All rights reserved
Scans all protected system files and replaces incorrect versions with correct Microsoft versions.
SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/CANCEL] [/ENABLE] [/PURGECACHE]
[/CACHE SIZE=x] [/QUIET]
nbtstat
C:\Documents and Settings\Administrator>nbtstat
Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).
rcp
C:\Documents and Settings\Administrator>rcp
Copies files to and from computer running the RCP service.
lpr
C:\Documents and Settings\Administrator>lpr
Sends a print job to a network printer Usage: lpr -S server -P printer [-C class] [-J job] [-o option] [-x] [-d]
filename
tracert
C:\Documents and Settings\Administrator>tracert
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
nslookup
C:\Documents and Settings\Administrator>nslookup
*** Default servers are not available
Default Server: UnKnown
Address: 127.0.0.1
route
C:\Documents and Settings\Administrator>route
Manipulates network routing tables.
lpq
C:\Documents and Settings\Administrator>lpq
Displays the state of a remote lpd queue.
Usage: lpq -Sserver -Pprinter [-l]
net session
C:\Documents and Settings\Administrator>net session
There are no entries in the list.
drivers
C:\Documents and Settings\Administrator>drivers
'drivers' is not recognized as an internal or external command, operable program or batch file.
nettime
C:\Documents and Settings\Administrator>nettime
'nettime' is not recognized as an internal or external command, operable program or batch file.
rsh
C:\Documents and Settings\Administrator>rsh
Runs commands on remote hosts running the RSH service.
RSH host [-l username] [-n] command
host Specifies the remote host on which to run command.
chkdsk
C:\Documents and Settings\Administrator>chkdsk
The type of the file system is FAT32.
Volume HCL created 22/08/2002 5:53 PM
Volume Serial Number is 3A51-1906
Windows is verifying files and folders...
File and folder verification is complete.
Windows has checked the file system and found no problem.
39,058,992 KB total disk space.
1,287,888 KB in 734 hidden files.
53,440 KB in 3,223 folders.
22,328,464 KB in 67,626 files.
15,389,184 KB are available.
16,384 bytes in each allocation unit.
2,441,187 total allocation units on disk.
961,824 allocation units available on disk.
hostname
C:\Documents and Settings\Administrator>hostname Amb
net account
C:\Documents and Settings\Administrator>net account
The syntax of this command is:
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
Ex 2: Use arp command to find your Ethernet physical address.
Answer :
arp
C:\Documents and Settings\Administrator>arp
Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP).
ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]
Example:
> arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.
> arp -a .... Displays the arp table.
Ex 3: Modify the routing table using ipxroute.
Answer :
C:\Documents and Settings\Administrator>ipxroute
NWLink IPX Routing and Source Routing Control Program v2.00
Unable to open transport \Device\NwlnkIpx.
Ex 4: View the TCP/IP settings.
Answer :
Show tcp/ip
netsh>show mode tcp/ip
online
Ex 5: Configure interfaces.
Answer :
Configure interfaces:
netsh>set
The following commands are available:
Commands in this context:
set machine - Sets the current machine on which to operate.
set mode - Sets the current mode to online or offline.
netsh>set interface
The following command was not found: set interface.
netsh>set mode interface
'mode' is not an acceptable value for 'interface'.
The parameter is incorrect.
netsh>set mode
Usage: set mode [ mode= ] { online | offline }
Parameters:
Tag Value
mode - One of the following values:
online: Commit changes immediately
offline: Delay commit until explicitly requested
Remarks:
Sets the current mode to online or offline.
netsh>set machine
Session 2 : Linux / Unix Operating System
Ex 11: First try to execute the following commands on your operating system and write down the results and use of each command.
Answer :
Ls aa ab abc agm rajesh biju sem2
Pwd home\sem
Ls –x a1 a2 a.c agm a.out desktop frmstat.ui install.log
Ls –al drwxr-x- - 33 root root 4096 oct 2 10:12 .
drwx—xr-x 33 root root 6 oct 2 10:42 a1
-rw-r- -r-- 33 root root 5 oct 2 12:30 a2
-rwxr-x— 33 root root 4 oct 2 12:45 a.c
Ex 13: Make your own subdirectories called uni and linu in your home directory, Made? Ok, now delete the subdirectory called uni.
Answer :
Mkdir uni
Mkdir linu
Rmdir linu
Ex 14: Create a file called ignou.txt that contains the words "hello I am student of IGNOU". Now copy this file and paste to other director. Copied? Can you move the file also from one directory to another?
Answer :
Cat > ignou.txt
Cp ignou.txt \ab\a.txt
Mv ignou.txt \linu
Ex 15: In the previous question you have a file ignou.txt; change its permission to rwxrwxr-x. You can try different possibilities to changes in its permissions. One possibility may be rwxr-xr-x permissions. Find out what are the different commands available that can be used to change the permissions of a file/files.
Answer :
Chmod a+x ignou.txt
Chmod g-w ignou.txt
Chmod o-w ignou.txt
Ex 19: Change your password and write down the restrictions for given password.
Answer :
Passwd
Enter new password:
Re enter new password:
Restrictions to password
1.different from previous password
2.Have atleast 6 characters
3.Are not common words found in dictionary
Session 3 : Linux / Unix Operating System
Ex 21: Find the files (with full path) in your home directory those name are starting with the character ‘s’ and redirect the output into a file redirecting.txt and if you receive any error message on execution of the command redirect into errors.txt.
Answer : Ls –l s* >redirecting.txt
Ex 22: Execute sleep 25 in the foreground, suspend it with Ctrl-z and then put it into the background with bg. show all process running in background, bring any process back into the foreground with fg. Repeat the same exercise using kill to terminate the process and use & for sending into background. (You need to see different options of the kill command)
Answer : Sleep 25 –s
Ex 24: Write a shell script, which returns the PID of a process and accept the name of the process.
Answer : Ps e | grep init
Echo $a | cut –f1 –d ― ―
Ex 25: Use ping to find the round-trip delay to www.ignou.ac.in
Answer : Use ping to find the round-trip delay to www.ignou.ac.in
Ping ―www.ignou.ac.in‖
Ex 26: Send a message to all users which are online. Make provision so that you can send messages to other users but others cannot. Use talk to send messages.
Answer : Mesg n
Ex 28: Send a mail to yourself, and include ignou.txt inside the mail. Read the mail you have sent to yourself. Save the piece of message and file into some folder. Reply to yourself.
Answer : Mail root(user 1) ->
Mail amb(user 2)
Ex 30: Use the ls command and grep to display all names starting with "s".
Answer : Ls|grep[^s]
Session 4 : System Administrator Using Unix & Linux
Ex 33: Delete the user, which just now you have added.
Answer : Deluser abc
Ex 38: Write a message to inform all users that "they should shut down their machine after completing the lab exercises".
Answer : Wall “they should shut down their machine after completing the lab exercise”
Session 5 : Windows 2000 : Introduction to Networking
Ex 42: Add different users and groups. Also configure their permissions.
Answer :
To add a new user to the computer
1. Open Users and Passwords in Control Panel.
2. Click Add.
3. Follow the instructions on the screen.
Notes
· You must be logged on as an administrator or a member of the Administrators group to use Users and Passwords.
· To open a Control Panel item, click Start, point to Settings, click Control Panel, and then double-click the appropriate icon.
· If the computer is part of a domain, Add New User gives an existing domain user permission to use the computer. If the computer is not part of a domain, Add New User creates a new local user.
· If the computer is part of a domain, you can only add existing domain users with Users and Passwords. To add a new local user, click the Advanced tab and then click the Advanced button. In Local Users and Groups, click Users, click Action, and then click Create User.
· You should not add a new user to the Administrators group unless the user will perform only administrative tasks. For more information, see Related Topics.
Types of access permissions for shares
The following types of access permissions can be applied to shared folders.
Read
Read permission allows:
o Viewing file names and subfolder names.
o Traversing to subfolders.
o Viewing data in files.
o Running program files.
Change
Change permission allows all Read permissions, plus:
o Adding files and subfolders.
o Changing data in files.
o Deleting subfolders and files.
Full Control
Full Control is the default permission applied to any new shares you create.
It allows all Read and Change permissions, plus:
o Changing permissions (NTFS files and folders only).
o Taking ownership (NTFS files and folders only).
Note
When a folder is shared, the default is to grant Full Access permissions to
the Everyone group.
Ex 42 (ii): Exercise Install and configure a local printer
Answer :
1. Go to Settings, Printers, and start the add printer wizard.
2. Select Local Printer and Click next
3. Select the Printer Port. Say LPT1.
4. Select The Printer Manufacturer and Model.
5. Name the printer and Set to share the Printer if it has to be available in the Network.
6. After giving Location command and Print the test page. If all are ok, Finalise the setting and complete the wizard.
Ex 43: Connect and configure your computer with a Local Network Printer.
Answer :
To connect to a printer on a network
1. Open Printers.
2. Double-click Add Printer to start the Add Printer wizard, and then click Next.
3. Click Network printer, and then click Next.
4. Connect to the desired printer by:
o Searching for it in the Active Directory.
o Typing its name using the following format, or clicking Next to locate the printer on the network:
o Typing its URL using the following format:
5. Follow the instructions on the screen to finish connecting to the network printer.
Notes
To open Printers, click Start, point to Settings, and then click Printers.
If you are not logged on to a Windows 2000 domain running Active Directory, the option to Find a
printer in the Directory will not be available.
Connecting to a printer using its URL allows you to connect to printers across the Internet providing
you have permission to use that printer.
If you cannot connect to your printer using the general URL format above, please see your printer's
documentation or contact your network administrator.
You can also connect to a printer by dragging the printer from the Printers folder on the print server
and dropping it into your Printers folder, or by simply right-clicking the icon and then clicking
Connect.
After you have connected to a shared printer on the network, you can use it as if it were attached to
your computer.
Ex 45: Create a Hierarchical Directory Tree.
Answer : Create a Hierarchical Directory Tree
A hierarchical representation of the folders, files, disk drives, and other resources connected to a
computer or network. For example, Windows Explorer uses a tree view to display the resources that
are attached to a computer or a network.
.
Ex 46: Share any folder available in your directory, also configure its share permissions for different users.
Answer : Share and Share Permissions.
I create a folder test uder c:\temp directry and set permissions as follows.
Take Properties of Local Area Connction
Ex 47: Install and Configure TCP/IP.
Answer : Install and Configure TCP/IP
Properties of TCP/IP
Enter Ip address, Subnet Mask, Default Gateway, and DNS Server entries.
Add WINS server Entries and Complete the Settings.
Ex 48: Install a caching DNS server and find out how it reduces the network traffic.
Answer : Install a caching DNS server and find out how it reduces the network traffic
Windows 2000 authentication is implemented in two steps: an interactive logon process and a
network
authentication process. Typically, the same set of credentials is used by the interactive logon process and
the network authentication process. If your credentials differ, you are prompted to provide Windows domain
credentials each time you access a network resource. You can avoid this by logging on to your computer
using your Windows domain name, your Windows domain user name, and Windows domain password
before you try to connect to a network resource. If you log on without being connected to the network,
Windows 2000 recognizes the information from a previous successful logon. You receive the message
"Windows cannot connect to a server to confirm your logon settings. You have been logged on using
previously stored account information." When you connect to your network, the cached credentials are
passed to your Windows 2000 domain and you are able to access network resources without having to
provide a password again. Limiting the number of protocols on your computer enhances network
performance and reduces network traffic.
Ex 50: Implement delegated zones for a Domain Name Server.
Answer : Implement delegated zones for a Doman Name server
In the Macintosh environment, a logical grouping that simplifies browsing the network for resources,
such as servers and printers. It is similar to a domain in Windows 2000 Server networking. In a DNS
(Domain Name System) database, a zone is a sub tree of the DNS database that is administered as a single
separate entity, a DNS server. This administrative unit can consist of a single domain or a domain with
subdomains. A DNS zone administrator sets up one or more name servers for the zone.
Session 6 : Windows 2000 : Server Management
Ex 51-60: Install and Configure Windows 2000 Client & server.
Answer : Configuring Windows client as VPN client
VPN Client is an application that runs on a Microsoft® Windows®-based PC, a Sun ultraSPARC
workstations, a Linux desktop, or a Macintosh (Mac) personal computer that meets the system requirements
stated in the next section. In this document, the term "PC" applies generically to all these computers, unless
specified otherwise. The VPN Client on a remote PC, communicating with a Cisco VPN device at an
enterprise or service provider, creates a secure connection over the Internet that lets you access a private
network as if you were an on-site user. This secure connection is a Virtual Private Network (VPN).
System Requirements
To install the VPN Client on any system, you need–CD-ROM drive (if you are installing from CD-ROM) –
Administrator privileges •The following table indicates the system requirements to install the VPN Client on
each of the supported platforms.
Computer Operating System Requirements
Computer with a Pentium®- class processor or greater
•Microsoft® Windows® 98 or Windows 98 (second edition)
•Windows ME
•Windows NT® 4.0 (with Service Pack 6, or higher)
•Windows 2000
•Windows XP
•Microsoft TCP/IP installed. (Confirm via Start > Settings > Control Panel > Network > Protocols or Configuration.)
•50 MB hard disk space.
•RAM:
–32 MB for Windows 98
–64 MB for Windows NT and Windows ME
–64 MB for Windows 2000 (128 MB recommended)
–128 MB for Windows XP (256 MB recommended) Computer with and Intel x86 processor
RedHat Version 6.2 or later Linux (Intel), or compatible libraries with glibc Version 2.1.1-6 or later, using kernel Versions 2.2.12 or later
Note
The VPN Client does not support SMP (multiprocessor) or 64-bit processor kernels.
•32 MB Ram
•50 MB hard disk space Sun UltraSPARC computer
32-bit or 64-bit Solaris kernel OS Version 2.6 or later
• 32 MB Ram
• 50 MB hard disk space
Macintosh computer
Mac OS X, Version 10.2.0 or later
50 MB hard disk space
The VPN Client supports the following Cisco VPN devices:
•Cisco VPN 3000 Concentrator Series, Version 3.0 and later.
•Cisco PIX Firewall, Version 6.2.2(122) or Version 6.3(1).
•isco IOS Routers, Version 12.2(8)T and later
If you are using Internet Explorer, use version 5.0, Service Pack 2 or higher.
Installation Notes
The following files are included in this release:
vpnclient-win-msi-4.6.00.0049-k9.zip Windows client MSI installer
vpnclient-win-is-4.6.00.0045-k9.zip Windows client IS installer
vpnclient-darwin-4.6.00.0045-GUI-k9.dmg Mac OS X installer
vpnclient-linux-4.6.00.0045-k9.tar.gz Linux package
vpnclient-solaris-4.6.00.0045-k9.tar.Z Solaris package
vpn3000-4.1.6.bin VPN 30xx Concentrator code
vpn3005-4.1.6.bin VPN 3005 Concentrator code
update-4.6.00.0045.zip VPN Client AutoUpdate package
Because of platform differences, the installation instructions for Windows and non-Windows platforms also differ.
The following notes are important for users who are upgrading to Windows XP and users who want to downgrade to an earlier version of the VPN Client software.
Installation Notes - Windows Platforms
Release 4.6 includes the following installation considerations for Windows users:
Installing the VPN Client Software Using InstallShield Installing the VPN Client software on Windows NT, Windows 2000, or Windows XP with InstallShield requires Administrator privileges. If you do not have Administrator privileges, you must have someone who has Administrator privileges install the product for you.
Note
The VPN Client Installer does not allow installations from a network drive (CSCeb43490).
Installing the VPN Client Software Using the MSI Installer
If you are using the MSI installer, you must have Windows NT-based products such as Windows NT 4.0 (with SP6), Windows 2000, or Windows XP.
Installing with MSI also requires Administrator privileges.
When installing the Windows MSI installation package, the user must manually uninstall the previous VPN Client if it is older than version 4.6. The version 4.6 MSI installer does not detect older versions, and the installer will attempt to install before aborting gracefully. Once a version 4.6 MSI package has been installed, future client versions will be able to detect the existing version 4.6 installation and automatically begin the uninstallation process.
VPN Client Installation Using Windows Installer (MSI) Requires Windows NT SP6 When you attempt to install the VPN Client using MSI install (vpnclient_en.exe) on NT SP3, SP4, or SP5, the error messages do not indicate
that the VPN Client cannot be installed on those operating systems because they are unsupported. Once the errors occur, no other messages are displayed and the installation is aborted.
When you attempt to run vpnclient_en.exe on Windows NT SP3, SP4, or SP5 you see the following messages:
"Cannot find the file instmsiw.exe (or one of its components). Make sure the path and filename are correct and that all the required libraries are available."
-then-
"Cannot find the file MSIEXEC (or one of its components). Make sure the path and filename are correct and that all the required libraries are available."
The Windows Installer (MSI) can be installed only on NT SP6, so the error messages you see using earlier service packs are due to an MSI incompatibility (CSCdy05049).
Installation Notes - Solaris Platforms
The following sections describe actions you must take when installing the VPN Client on a Solaris platform.
Uninstall an Older VPN Client If Present on a Solaris Platform If you have a previous version of the VPN Client running under Solaris, you must uninstall the older VPN Client before installing a new VPN Client.
You are not required to uninstall an old VPN Client, if one is present, before installing a new VPN Client for Linux or Mac OS X. Disable the ipfilter Firewall Kernel Module Before Installing the VPN Client on a Solaris Platform
If have an IP firewall installed on your workstation, the reboot after installation of the VPN Client takes an inordinate amount of time. This is caused by a conflict between the vpnclient kernel module cipsec and the
ipfilter firewall module. To work around this issue, disable the ipfilter firewall kernel module before you install the VPN Client (CSCdw27781).
Using the VPN Client
•To use the VPN Client, you need –Direct network connection (cable or DSL modem and network adapter/interface card), or –Internal or external modem, and
•To connect using a digital certificate for authentication, you need a digital certificate signed by one of the following Certificate Authorities (CAs) installed on your PC:
–Baltimore Technologies (www.baltimoretechnologies.com)
–Entrust Technologies (www.entrust.com)
– Netscape (www.netscape.com)
–Verisign, Inc. (www.verisign.com)
–Microsoft Certificate Services
— Windows 2000
–A digital certificate stored on a smart card. The VPN Client supports smart cards via the MS CAPI Interface.
Session 8 : Windows 2000 : Security
Ex 72: Protect client machine by using Internet Connection Firewall (ICF).
Answer : Protect client machine by using Internet Connection Firewall(ICF)
Windows 2000 includes a Firewall to protect your system against unwanted "visitors" from the Internet (but not controlling connections from your system to the Internet, for which you would need to install a Non-Microsoft Firewall, like ZoneAlarm), which is configured using the Properties of the modem-connection: (using the Firewall on a LAN connection will cause network access problems to your system)
In the properties of the Internet Connection : tab : Advanced.
make sure, that the checkmark is placed for the Internet Connection Firewall.
Using Settings, you can configure the firewall.
tab : Services
The list of programs, which could run on your system. By default, no access is allowed from the Internet to your system to any of these services.
Unless you need to grant such an access, do NOT activate any of these services.
tab: Security Logging
Allows to activate a log-file tab : ICMP
ICMP (Internet Control Message Protocol is part of TCP/IP, the most common use is the PING program to test a network connection.
By default, the firewall will NOT respond to any ICMP , incl. PING, from the Internet.
Advanced Setup:
In case you have the Internet Information Server (maybe including the FTP server) installed and you like to allow access from the Internet, then you need to place the Check-marks (you are prompted to confirm the system allowed to be accessed) Activate ONLY the service, which people need to access from the Internet.
tab: ICMP To allow people on the Internet to test, that the connection is working to your system, you should allow incoming echo requests (PING-requests).
Warning: now your systems becomes also visible for all these "bad boys and girls", which probe all IP-addresses on the Internet and then try to find out which system they had found, and some of them may try to damage your system !
Ex 73: Configure TCP/IP packet filter.
Answer : Configure TCP/IP packet filter
1. Click Start , point to Settings , click Control Panel , and then double-click Network and Dial-up Connections .
2. Right-click the interface on which you want to configure inbound access control, and then click Properties .
3. In the Components checked are used by this connection box, click Internet Protocol (TCP/IP) , and then click Properties .
4. In the Internet Protocol (TCP/IP) Properties dialog box, click Advanced .
5. Click the Options tab.
6. Click TCP/IP filtering , and then click Properties .
7. Select the Enable TCP/IP Filtering (All adapters) check box. When you select this check box, you enable filtering for all adapters, but you configure the filters on a per-adapter basis. The same filters do not apply to all adapters.
8. There are three columns with the following labels:
TCP Ports
UDP Ports
IP Protocols
In each column, you must select either of the following options:
Permit All . If you want to permit all packets for TCP or UDP traffic, leave Permit All activated. Permit Only . If you want to allow only selected TCP or UDP traffic, click Permit Only , click Add , and then type the appropriate port in the Add Filter dialog box. If you want to block all UDP or TCP traffic, click Permit Only , but do not add any port numbers in the UDP Ports or TCP Port column. You cannot block UDP or TCP traffic by selecting Permit Only for IP Protocols and excluding IP protocols 6 and 17.
Note that you cannot block ICMP messages, even if you select Permit Only in the IP Protocols column and you do not include IP protocol 1.
TCP/IP Filtering can filter only inbound traffic. This feature does not affect outbound traffic or response ports that are created to accept responses from outbound requests. Use IPSec Policies or packet filtering if you require more control over outbound access.
Ex 75: Customize and configure IPsec policy and rules for transport mode on the local computer.
Answer : To create an IPSec Policy
1. Using HQ-RES-WRK-01, in the left pane of the MMC Console, right-click IP Security Policies on Local Machine, and then click Create IP Security Policy. The IP Security Policy Wizard appears.
2. Click Next.
3. Type Partner as the name of your policy, and click Next.
4. Clear the Activate the default response rule check box, and then click Next.
5. Make sure the Edit Properties check box is selected (it is by default), and then click Finish.
6. In the Properties dialog box for the policy you have just created, ensure that Use Add Wizard check box in the lower-right corner is selected, and then click Add to start the Security Rule Wizard.
7. Click Next to proceed through the Security Rule Wizard, which you started at the end of the previous section.
8. Select This rule does not specify a tunnel, (selected by default) and then click Next.
9. Select the radio button for All network connections, (selected by default) and click Next.
Session 9 : Windows 2000 : Network Management
Ex 81: Create a Group Policy Object (GPO) and Console.
Answer : Creation of Group Policy objects
1. Open Active Directory Users and Computers.
2. In the console tree, click Users.
3. In the Name column in the details pane, double-click Group Policy Creator Owners.
4. In the Group Policy Creator Owners Properties dialog box, click the Members tab.
5. Click Add, and then double click the name of each user or security group to whom you want to delegate creation rights.
6. Click OK in the Select Users, Contacts, or Computers dialog box, and then click OK in the Group Policy Creator Owners Properties dialog box.
Notes
· To start Active Directory Users and Computers, open a Remote Desk Top connection to either a Windows 2000 domain controller or a member server that has Windows 2000 Administration Tools installed. You must log on to the server as a domain administrator in order to complete this procedure.
· By default, only domain administrators, enterprise administrators, Group Policy Creator Owners, and the operating system can create new Group Policy Objects. If the domain administrator wants a
Non administrator or a group to be able to create Group Policy objects, that user or group can be added to the Group Policy Creator Owners security group. When a user who is not an administrator, but who is a member of the Group Policy Creator Owners group, creates a Group Policy object, that user becomes the creator and owner of the Group Policy object; therefore, that user can edit the Group Policy object. Being a member of the Group Policy Creator Owners group gives the user full control of only those Group Policy objects that the user creates or those Group Policy objects that are explicitly delegated to that user. It does not give the non administrator user any additional rights over other Group Policy objects for the domain—these users are not granted rights over Group Policy objects that they did not create.
· When an administrator creates a Group Policy object, the Domain Administrators group becomes the Creator Owner of the Group Policy object.
· When you delegate this task to non administrators, also consider delegating the ability to manage the links for a specific organizational unit. The reason for this is that, by default, non administrators cannot manage links, and the inability to manage links prevents them from being able to use the Active Directory Users and Computers snap-in to create a Group Policy object.
Session 10 : Windows 2000 : Troubleshooting
Ex 94: Back up the recovery agent Encrypting File System (EFS) private key.
Answer : Backup the recovery agent Encrypting File System9EFS) Private key:
1. Use Backup or another backup tool to restore a user's backup version of the encrypted file or folder to the computer where your file recovery certificate and recovery key are located.
2. Open windows Explorer.
3. Right-click the file or folder and then click Properties.
4. On the General tab, click Advanced.
5. Clear the Encrypt contents to secure data check box.
6. Make a backup version of the decrypted file or folder and return the backup version to the user.
Notes
· To open Windows Explorer, click Start, point to All Programs, point to Accessories, and then click Windows Explorer.
· You can return the backup version of the decrypted file or folder to the user as an e-mail attachment, on a floppy disk, or on a network share.
· You can also physically transport the recovery agent's private key and certificate, import the private key and certificate, decrypt the file or folder, and then delete the imported private key and certificate. This procedure exposes the private key more than the procedure above but does not require any backup or restore operations or file transportation.
· If you are the recovery agent, use the Export command from Certificates in Microsoft Management Console (MMC) to export the file recovery certificate and private key to a floppy disk. Keep the floppy disk in a secure location. Then, if the file recovery certificate or private key on your computer is ever damaged or deleted, you can use the Import command from Certificates in MMC to replace the damaged or deleted certificate and private key with the ones you have backed up on the floppy disk.
· For more information about using Certificates in MMC, see Related Topics.

Download IGNOU Second Semester Solved Lab Manual

  1. SECTION – 4
  2. Java Programming Lab
  3. Session 1 : Data Types, Variables & Operators
Ex 1: Write a program in Java to implement the formula (Area = Height ×Width) to find the area of a rectangle. Where Height and Width are the rectangle‟s height and width.
Code:
class rectangle
{
int h,w;
rectangle(int x,int y)
{
h=x; w=y;
}
int area()
{
return(h*w);
}
}
class s01_01
{
public static void main(String args[])
{
rectangle r=new rectangle(10,20);
int area=r.area();
System.out.println("Area of Rectangle="+area);
}
}
Ex 2: Write a program in Java to find the result of following expression (Assume a = 10, b = 5)
i) (a < < 2) + (b > > 2)
ii) (a) | | (b > 0)
iii) (a + b ∗100) / 10
iv) a & b
Code:
class s01_02
{
public static void main(String args[])
{
int a=10,b=5;
System.out.println(" i) (a<<2)+(b>>2): "+(a<<2)+(b>>2) );
System.out.println(" ii) (a)||(b>0) : "+(a)||(b>0) );
System.out.println("iii) (a+b*100)/10 : "+(a+b*100)/10 );
System.out.println(" iv) (a&b) : "+(a&b) );
}
}
Ex 3: Write a program in Java to explain the use of break and continue statements.
Code:
class s01_03
{
public static void main(String args[])
{
int i = 0;
int j = 0;
for(int k=0; ;k++)
{
if(k>=args.length) break;
int l;
try
{
l = Integer.parseInt(args[k]);
}
catch(NumberFormatException e)
{
j++;
System.out.println("INVALID ARGUMENT :" + args[k]);
continue;
}
i++;
System.out.println("VALID ARGUMENT :" + args[k]);
}
System.out.println("NUMBER OF VALID ARGUMENTS :" + i);
System.out.println("NUMBER OF INVALID ARGUMENT:" + j);
}
}
Ex 4: Write a program in Java to find the average of marks you obtained in your 10+2 class.
Code:
class s01_04
{
public static void main(String args[])
{
int reg,m1,m2,m3;
String name;
reg=Integer.parseInt(args[0]);
name=args[1];
m1=Integer.parseInt(args[2]);
m2=Integer.parseInt(args[3]);
m3=Integer.parseInt(args[4]);
System.out.println("------------------------");
System.out.println(" MARK LIST ");
System.out.println("------------------------");
System.out.println("Register No : "+reg);
System.out.println("Name : "+name);
System.out.println("Mark1 : "+m1);
System.out.println("Mark2 : "+m2);
System.out.println("Mark3 : "+m3);
System.out.println("Total : "+(m1+m2+m3));
System.out.println("Average : "+(float)(m1+m2+m3)/3);
System.out.println("------------------------");
}
}
Session 2 : Statements and Array
Ex 5: Write a program in Java to find A×B where A is a matrix of 3×3 and B is a matrix of 3×4. Take the values in matrixes A and B from the user.
Code:
class s02_01
{
public static void main(String arg[])
{
int a[][]=new int[3][3];
int b[][]=new int[3][3];
int c[][]=new int[3][3];
int n=0;
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
a[i][j]=Integer.parseInt(arg[n++]);
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
b[i][j]=Integer.parseInt(arg[n++]);
//multipying the two matrix
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
{
c[i][j]=0;
for(int k=0;k<3;k++)
c[i][j]+=(a[i][k]*b[k][j]);
}
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
System.out.print(c[i][j]+" ");
System.out.println();
}
}
}
Ex 6: Write a program in Java to compute the sum of the digits of a given integer. Remember, your integer should not be less than the five digits.
Code:
class s02_02
{
public static void main(String arg[])
{
int sum=0;
long n=Long.parseLong(arg[0]);
while(n>0)
{
sum+=n%10;
n/=10;
}
System.out.println("Sum="+sum);
}
}
Session 3 : Class And Objects
Ex 7: Write a program in Java with class Rectangle with the data fields width, length, area and colour. The length, width and area are of double type and colour is of string type .The methods are set_ length () , set_width (), set_ colour(), and find_ area ().
Code:
import java.io.*;
class rect
{
int width,length;
String color;
void set_length(int a)
{ length=a; }
void set_width(int a)
{ width=a; }
void set_color(String a)
{ color=a; }
int area()
{ return(width*length); }
String getcolor()
{ return(color); }
}
class s03_01
{
public static void main(String arg[])throws Exception
{
String s=null;
DataInputStream in=new DataInputStream(System.in);
rect a=new rect();
System.out.println("Enter the length for first rectangle");
s=in.readLine();
a.set_length(Integer.parseInt(s));
System.out.println("Enter the width for first rectangle");
s=in.readLine();
a.set_width(Integer.parseInt(s));
System.out.println("Enter the Color for first rectangle");
a.set_color(in.readLine());
rect b=new rect();
System.out.println("Enter the length for second rectangle");
s=in.readLine();
b.set_length(Integer.parseInt(s));
System.out.println("Enter the width for second rectangle");
s=in.readLine();
b.set_width(Integer.parseInt(s));
System.out.println("Enter the Color for second rectangle");
b.set_color(in.readLine());
if(a.area()==b.area() && a.getcolor().equals(b.getcolor()))
System.out.println("Matching Rectangle ");
else
System.out.println("Non Matching Rectangle ");
}
}
Ex 8: Create a class Account with two overloaded constructors. The first constructor is used for initializing, the name of account holder, the account number and the initial amount in the account. The second constructor is used for initializing the name of the account holder, the account number, the addresses, the type of account and the current balance. The Account class is having methods Deposit (), Withdraw (), and Get_Balance(). Make the necessary assumption for data members and return types of the methods. Create objects of Account class and use them.
Code:
class account
{
String name,address,type;
int accno,bal;
account(String n,int no,int b)
{ name=n; accno=no; bal=b; }
account(String n,int no,String addr,String t,int b)
{
name=n; accno=no;
address=addr;
type=t; bal=b;
}
void deposite(int a) { bal+=a; }
void withdraw(int a) { bal-=a; }
int getbalance() { return(bal); }
void show()
{
System.out.println("________________________");
System.out.println(" ACCOUNT DETAILS");
System.out.println("------------------------");
System.out.println("Name : "+name);
System.out.println("Account No : "+accno);
System.out.println("Address : "+address);
System.out.println("Type : "+type);
System.out.println("Balance : "+bal);
System.out.println("------------------------");
}
}
class s03_02
{
public static void main(String arg[])throws Exception
{
account a1=new account("Anil",555,5000);
account a2=new account("Anil",666,"Tirur","Current account",1000);
a1.address="Calicut";
a1.type="fixed deposite";
a1.deposite(5000);
a2.withdraw(350);
a2.deposite(a2.getbalance());
a1.show();
a2.show();
}
}
Ex 9: Write a program in Java to create a stack class of variable size with push() and pop () methods. Create two objects of stack with 10 data items in both. Compare the top elements of both stack and print the comparison result.
Code:
import java.io.*;
class stack
{
int data[]=new int[50];
int sp=0;
int pop()
{
if(sp<=0)
{
System.out.println("Stack is empty");
return(0);
}
else
return(data[sp--]);
}
void push(int a)
{
if(sp>=50)
System.out.println("Stack overflow");
else
data[sp++]=a;
}
}
class s03_03
{
public static void main(String arg[])
{
DataInputStream in=null;
String s;
int d;
stack s1=new stack();
stack s2=new stack();
try
{
in=new DataInputStream(System.in);
for(int i=0;i<10;i++)
{
System.out.println(1+i+") Enter data for the first stack");
s=in.readLine();
d=Integer.parseInt(s);
s1.push(d);
}
for(int i=0;i<10;i++)
{
System.out.println(1+i+") Enter data for the second stack");
s=in.readLine();
d=Integer.parseInt(s);
s2.push(d);
}
if(s1.pop()==s2.pop())
System.out.println("The top of the stacks are same");
else
System.out.println("The top of the stacks are same");
}
catch(Exception e) { System.out.println(e); }
}
}
Session 4 : Inheritance and Polymorphism
Ex 10: Write a Java program to show that private member of a super class cannot be accessed from derived classes.
Code:
class room
{
private int l,b;
room(int x,int y)
{ l=x; b=y;}
int area()
{return(l*b);}
}
class class_room extends room
{
int h;
class_room(int x,int y,int z)
{
super(x,y);
h=z;
}
int volume()
{
return(area()*h);
}
}
class s04_01
{
public static void main(String args[])
{
class_room cr=new class_room(10,20,15);
int a1=cr.area();
int v1=cr.volume();
System.out.println("Area of Room : "+a1);
System.out.println("Volume of Room : "+v1);
}
}
Ex 11: Write a program in Java to create a Player class. Inherit the classes Cricket _Player, Football _Player and Hockey_ Player from Player class.
Code:
class player
{
String name;
int age;
player(String n,int a)
{ name=n; age=a; }
void show()
{
System.out.println("\n");
System.out.println("Player name : "+name);
System.out.println("Age : "+age);
}
}
class criket_player extends player
{
String type;
criket_player(String n,String t,int a)
{
super(n,a);
type=t;
}
public void show()
{
super.show();
System.out.println("Player type : "+type);
}
}
class football_player extends player
{
String type;
football_player(String n,String t,int a)
{
super(n,a);
type=t;
}
public void show()
{
super.show();
System.out.println("Player type : "+type);
}
}
class hockey_player extends player
{
String type;
hockey_player(String n,String t,int a)
{
super(n,a);
type=t;
}
public void show()
{
super.show();
System.out.println("Player type : "+type);
}
}
//--------- main -----------
class s04_02
{
public static void main(String args[])
{
criket_player c=new criket_player("Ameer","criket",25);
football_player f=new football_player("arun","foot ball",25);
hockey_player h=new hockey_player("Ram","hockey",25);
c.show();
f.show();
h.show();
}
}
Ex 12: Write a class Worker and derive classes DailyWorker and SalariedWorker from it. Every worker has a name and a salary rate. Write method ComPay (int hours) to compute the week pay of every worker. A Daily Worker is paid on the basis of the number of days s/he works. The Salaried Worker gets paid the wage for 40 hours a week no matter what the actual hours are. Test this program to calculate the pay of workers. You are expected to use the concept of polymorphism to write this program.
Code:
class worker
{
String name;
int empno;
worker(int no,String n)
{ empno=no; name=n; }
void show()
{
System.out.println("\n--------------------------");
System.out.println("Employee number : "+empno);
System.out.println("Employee name : "+name);
}
}
class dailyworker extends worker
{
int rate;
dailyworker(int no,String n,int r)
{
super(no,n);
rate=r;
}
void compay(int h)
{
show();
System.out.println("Salary : "+rate*h);
}
}
class salariedworker extends worker
{
int rate;
salariedworker(int no,String n,int r)
{
super(no,n);
rate=r;
}
int hour=40;
void compay()
{
show();
System.out.println("Salary : "+rate*hour);
}
}
//--------- main -----------
class s04_03
{
public static void main(String args[])
{
dailyworker d=new dailyworker(254,"Arjun",75);
salariedworker s=new salariedworker(666,"Unni",100);
d.compay(45);
s.compay();
}
}
Ex 13: Consider the trunk calls of a telephone exchange. A trunk call can be ordinary, urgent or lightning. The charges depend on the duration and the type of the call. Writ a program using the concept of polymorphism in Java to calculate the charges.
Code:
import java.io.*;
class call
{
float dur;
String type;
float rate()
{
if(type.equals("urgent"))
return 4.5f;
else if(type=="lightning")
return 3.5f;
else
return 3f;
}
}
class bill extends call
{
float amount;
DataInputStream in=null;
bill()
{
try
{
in=new DataInputStream(System.in);
}
catch(Exception e)
{ System.out.println(e); }
}
void read()throws Exception
{
String s;
System.out.println("enter call type(urgent,lightning,ordinary):");
type=in.readLine();
System.out.println("enter call duration:");
s=in.readLine();
dur=Float.valueOf(s).floatValue();
}
void calculate()
{
if(dur<=1.5)
amount=rate()*dur+1.5f;
else if(dur<=3)
amount=rate()*dur+2.5f;
else if(dur<=5)
amount=rate()*dur+4.5f;
else
amount=rate()*dur+5f;
}
void print()
{
System.out.println("**********************");
System.out.println(" PHONE BILL ");
System.out.println("**********************");
System.out.println(" Call type : "+type);
System.out.println(" Duration : "+dur);
System.out.println(" CHARGE : "+amount);
System.out.println("**********************");
}
}
class s04_04
{
public static void main(String arg[])throws Exception
{
bill b=new bill();
b.read();
b.calculate();
b.print();
}
}
Session 5 : Package and Interrface
Ex 14: Write a program to make a package Balance in which has Account class with Display_Balance method in it. Import Balance package in another program to access Display_Balance method of Account class.
Code:
class s05_01
{
public static void main(String ar[])
{
try
{
balance.account a=new balance.account();
a.read();
a.disp();
}
catch(Exception e)
{ System.out.println(e); }
}
}
package balance;
import java.io.*;
public class account
{
long acc,bal;
String name;
public void read()throws Exception
{
DataInputStream in=new DataInputStream(System.in);
System.out.println("Enter the name :");
name=in.readLine();
System.out.println("Enter the account number :");
acc=Long.parseLong(in.readLine());
System.out.println("Enter the account balance :");
bal=Long.parseLong(in.readLine());
}
public void disp()
{
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println("--- Account Details ---");
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println("Name :"+name);
System.out.println("Account number :"+acc);
System.out.println("Balance :"+bal);
}
}
Ex 15: Write a program in Java to show the usefulness of Interfaces as a place to keep constant value of the program.
Code:
interface area
{
static final float pi=3.142f;
float compute(float x,float y);
}
class rectangle implements area
{
public float compute(float x,float y)
{return(x*y);}
}
class circle implements area
{
public float compute(float x,float y)
{return(pi*x*x);}
}
class s05_02
{
public static void main(String args[])
{
rectangle rect=new rectangle();
circle cr=new circle();
area ar;
ar=rect;
System.out.println("Area of the rectangle= "+ar.compute(10,20));
ar=cr;
System.out.println("Area of the circle= "+ar.compute(10,0));
}
}
Ex 16: Create an Interface having two methods division and modules. Create a class, which overrides these methods.
Code:
interface course
{
void division(int a);
void modules(int b);
}
class stud implements course
{
String name;
int div,mod;
void name(String n)
{ name=n; }
public void division(int a)
{ div=a; }
public void modules(int b)
{ mod=b; }
void disp()
{
System.out.println("Name :"+name);
System.out.println("Division :"+div);
System.out.println("Modules :"+mod);
}
}
//--------main---------------
class s05_03
{
public static void main(String args[])
{ stud s=new stud();
s.name("Arun");
s.division(5);
s.modules(15);
s.disp();
}
}
Session 6 : Exception Handling
Ex 18: Write a program in Java to display the names and roll numbers of students. Initialize respective array variables for 10 students. Handle Array Index Out Of Bounds Exeption, so that any such problem doesn‟t cause illegal termination of program.
Code:
import java.io.*;
class student
{
String name,grade;
int reg,m1,m2,m3;
void read()throws Exception
{
DataInputStream in= new DataInputStream(System.in);
System.out.println("enter the register no : ");
reg=Integer.parseInt(in.readLine());
System.out.println("enter the name : ");
name=in.readLine();
System.out.println("enter mark1 : ");
m1=Integer.parseInt(in.readLine());
System.out.println("enter mark2 : ");
m2=Integer.parseInt(in.readLine());
System.out.println("enter mark3 : ");
m3=Integer.parseInt(in.readLine());
}
public void disp_grade()
{
int tt=m1+m2+m3;
if(tt>=250) grade="A";
else if(tt>=200) grade="B";
else if(tt>=150) grade="C";
else if(tt>=100) grade="D";
else grade="E";
System.out.println("Grade :"+grade);
}
void disp()
{
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println(" MARK LIST OF STUDENTS ");
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println("Register No :"+reg);
System.out.println("Name :"+name);
System.out.println("Mark1 :"+m1);
System.out.println("Mark2 :"+m2);
System.out.println("Mark3 :"+m3);
disp_grade();
}
}
class s06_01
{
public static void main(String ar[])
{
int no=0;
student s=new student();
try
{
DataInputStream in= new DataInputStream(System.in);
System.out.println("enter the number of students : ");
no=Integer.parseInt(in.readLine());
for(int i=0;i<no;i++);
s.read();
}
catch(ArrayIndexOutOfBoundsException e)
{
System.out.println("the maximum students should be ten\n");
no=10;
}
catch(Exception e)
{ System.out.println(e); }
for(int i=0;i<no;i++);
s.disp();
}
}
Ex 19: Write a Java program to enable the user to handle any chance of divide by zero exception.
Code:
class s06_02
{
public static void main(String ar[])
{
int no=0,m=10,result=0;
try
{
result=m/no;
}
catch(ArithmeticException e)
{
System.out.println(" division by zero ");
System.out.println(" value of result has been set as one");
result=1;
}
catch(Exception e)
{
System.out.println(e);
}
System.out.println("Result :"+result);
}
}
Ex 20: Create an exception class, which throws an exception if operand is nonnumeric in calculating modules. (Use command line arguments).
Code:
class NonNum extends Exception
{
NonNum()
{ super("the value is non numeric \n"); }
}
class s06_03
{
public static void main(String ar[])
{
int a,b,c=0;
try
{
a=Integer.parseInt(ar[0]);
throw new NonNum();
}
catch(NumberFormatException e)
{System.out.println(e);}
catch(NonNum e)
{ System.out.println(e);}
}
}
Ex 21: On a single track two vehicles are running. As vehicles are going in same direction there is no problem. If the vehicles are running in different direction there is a chance of collision. To avoid collisions write a Java program using exception handling. You are free to make necessary assumptions.
Code:
import java.io.*;
class collision extends Exception
{
collision(String s)
{ super(s); }
}
class s06_04
{
public static void main(String ar[])
{
String t1=null,t2=null;
try
{
DataInputStream in= new DataInputStream(System.in);
System.out.println("enter the direction of vehicle1:(left/right):");
t1=in.readLine();
System.out.println("enter the direction of vehicle2:(left/right):");
t2=in.readLine();
if(!t1.equals(t2))
throw new collision("truck2 has to go on "+ t1 +" direction");
}
catch(collision e)
{
System.out.println(e);
t2=t1;
System.out.println("the collision has been avoided by redirection
truck2");
}
catch(Exception e)
{ System.out.println(e); }
System.out.println("direction of truck1 :"+t1);
System.out.println("direction of truck2 :"+t2);
}
}
Session 7 : Multithreading
Ex 23: Write a program to launch 10 threads. Each thread increments a counter variable. Run the program with synchronization.
Code:
class s07_02
{
public static void main(String arg[])throws Exception
{
data d1=new data();
data d2=new data();
data d3=new data();
data d4=new data();
data d5=new data();
data d6=new data();
data d7=new data();
data d8=new data();
data d9=new data();
data d10=new data();
System.out.println(d10.count);
}
}
//---------------------------
class item { static int count=0; }
class data extends item implements Runnable
{
item d=this;
Thread t;
data()
{
t=new Thread(this);
t.start();
}
public void run()
{ d=syn.increment(d); }
}
//==============================
class syn
{
synchronized static item increment(item i)
{
i.count++;
return(i);
}
}
Ex 24: Write a program for generating 2 threads, one for printing even numbers and the other for printing odd numbers.
Code:
class even extends Thread
{
Thread t=null;
even()
{
t=new Thread(this);
start();
}
public void run()
{
try
{
for(int i=2;i<50;i+=2)
System.out.print(i+" ");
Thread.sleep(100);
}
catch(Exception e)
{System.out.println("thread interepted");}
}
}
class odd extends Thread
{
Thread t=null;
odd()
{
t=new Thread(this);
start();
}
public void run()
{
try
{
for(int i=1;i<50;i+=2)
System.out.print(i+" ");
Thread.sleep(100);
}
catch(Exception e)
{System.out.println("thread interepted");}
}
}
class s07_03
{
public static void main(String arg[])
{
even e=new even();
odd o=new odd();
}
}
Session 8 : Reading, Writing & String Handling in Java
Ex 26: Writ a program in Java to create a String object. Initialize this object with your name. Find the length of your name using the appropriate String method. Find whether the character „a‟ is in your name or not; if yes find the number of times „a‟ appears in your name. Print locations of occurrences of „a‟ .Try the same for different String objects.
Code:
class data
{
String name;
data(String n){ name=n; }
void disp()
{
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
System.out.println("Name :"+name);
int c=0;
int len=name.length();
for(int i=0;i<len;i++)
if(name.charAt(i)=='A'||name.charAt(i)=='a')
{
c++;
System.out.println("number of occurance :"+c);
System.out.println("Possition :"+(i+1));
}
if(c==0)
System.out.println("there is no 'A' available in the string");
}
}
class s08_01
{
public static void main(String ar[])
{
data d1=new data("anil kumar");
d1.disp();
data d2=new data("biju");
d2.disp();
}
}
Ex 28: Write a program for searching strings for the first occurrence of a character or substring and for the last occurrence of a character or substring.
Code:
import java.io.*;
class s08_03
{
public static void main(String[]args) throws Exception
{
int len1,len2,last=0;
DataInputStream in=new DataInputStream(System.in);
System.out.println("Enter the string:");
String s1=in.readLine();
System.out.println("Enter searching string:");
String s2=in.readLine();
len1=s1.length();
len2=s2.length();
for(int i=0;i<=(len1-len2);i++)
{
if(s1.substring(i,len2+i).equals(s2))
{
if(last==0)
System.out.println("first occurance is at possition :"+(i+1));
last=i+1;
}
}
if(last!=0)
System.out.println("last occurance is at possition :"+last);
else
System.out.println("the string is not found");
}
}
Ex 29: Write a program in Java to read a statement from console, convert it into upper case and again print on console.
Code:
import java.io.*;
class s08_04
{
public static void main(String a[]) throws IOException
{
DataInputStream in=new DataInputStream(System.in);
System.out.println("Enter file Statement:");
String s1=in.readLine();
System.out.println(s1.toUpperCase());
}
}
Ex 30: Write a program in Java, which takes the name of a file from user, read the contents of the file and display it on the console.
Code:
import java.io.*;
class s08_05
{
public static void main(String args[])
{
FileInputStream fis=null;
Try
{
fis=new FileInputStream(args[0]);
byte ch;
while((ch=(byte)fis.read())!=-1)
{System.out.print((char)ch); }
}
catch(IOException e)
{ System.out.println("interrupted");}
finally
{
try
{fis.close();}
catch(IOException e)
{System.out.println("error in closing");}
}
}
}
Ex 31: Write a Java program to copy a file into another file.
Code:
import java.io.*;
class s08_06
{
public static void main(String a[]) throws IOException
{
int d=0;
FileInputStream fi=null;
FileOutputStream fo=null;
DataInputStream in=new DataInputStream(System.in);
System.out.println("Enter file name:");
String s1=in.readLine();
System.out.println("Enter new file name:");
String s2=in.readLine();
try
{
fi=new FileInputStream(s1);
fo=new FileOutputStream(s2);
System.out.println("Copying file");
while((d=fi.read())!=-1)
fo.write((byte)d);
System.out.println("File copyied");
}
catch(IOException e)
{System.out.println(e);}
}
}
Session 9 : Applets and its Application
Ex 32: Write a Java Applet program which reads your name and address in different text fields and when a button named find is pressed the sum of the length of characters in name and address is displayed in another text field. Use appropriate colors, layout to make your applet look good.
Code:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class s09_01 extends Applet implements ActionListener
{
public void init()
{
label1 = new Label();
label2 = new Label();
label3 = new Label();
t1 = new TextField();
t2 = new TextField();
t3 = new TextField();
b1 = new Button();
setLayout(null);
setBackground(new Color(0, 153, 102));
label1.setAlignment(Label.RIGHT);
label1.setText("Name");
add(label1);
label1.setBounds(140, 60, 50, 20);
label2.setAlignment(Label.RIGHT);
label2.setText("Address");
add(label2);
label2.setBounds(140, 90, 50, 20);
label3.setAlignment(Label.RIGHT);
label3.setText("Total length");
add(label3);
label3.setBounds(130, 120, 60, 20);
add(t1);
t1.setBounds(200, 60, 100, 20);
add(t2);
t2.setBounds(200, 90, 100, 20);
add(t3);
t3.setBounds(200, 120, 100, 20);
b1.setBackground(new Color(255, 204, 153));
b1.setLabel("Total");
b1.addActionListener(this);
add(b1);
b1.setBounds(150, 180, 80, 24);
}
public void actionPerformed(ActionEvent ae)
{
int a=t1.getText().length();
a+=t2.getText().length();
t3.setText(Integer.toString(a));
}
Label label1;
Label label2;
Label label3;
TextField t1;
TextField t2;
TextField t3;
Button b1;
}
<html>
<body>
<applet code="s09_01.class" width=400 height=400>
</applet>
</body>
</html>
Ex 33: Create an applet which displays a rectangle/string with specified color & coordinate passed as parameter from the HTML file.
Code:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class s09_02 extends Applet implements ActionListener
{
public void init()
{
setLayout(null);
setBackground(new Color(0,10,100));
}
public void paint(Graphics p)
{
String t=null;
int x,y,w,h,r,g,b;
t=getParameter("xx");
x=Integer.parseInt(t);
t=getParameter("yy");
y=Integer.parseInt(t);
t=getParameter("ww");
w=Integer.parseInt(t);
t=getParameter("hh");
h=Integer.parseInt(t);
t=getParameter("rr");
r=Integer.parseInt(t);
t=getParameter("gg");
g=Integer.parseInt(t);
t=getParameter("bb");
b=Integer.parseInt(t);
p.setColor(new Color(r,g,b));
p.fillRect(x,y,w,h);
}
}
<html>
<body>
<applet code="s09_02.class" width=400 height=400>
<param name="xx" value="25">
<param name="yy" value="25">
<param name="ww" value="150">
<param name="hh" value="150">
<param name="rr" value="0">
<param name="gg" value="150">
<param name="bb" value="100">
</applet>
</body>
</html>
Ex 34: Create an applet which will display the calendar of a given date.
Code:
import java.util.*;
import java.awt.*;
import java.applet.*;
public class s9e3 extends Applet
{
GregorianCalendar cal=new GregorianCalendar();
String s,s1,s2,s3,s4;
int a=0,b=0,c=0,d=0;
public void start()
{
s=getParameter("fg");
s1=getParameter("as");
s2=getParameter("as1");
s3=getParameter("as2");
s4=getParameter("as3");
a=Integer.parseInt(s1);
b=Integer.parseInt(s2);
c=Integer.parseInt(s3);
d=Integer.parseInt(s4);
}
public void paint(Graphics g)
{
if(s.equals("red"))
g.setColor(Color.red);
g.drawRect(a,b,c,d);
g.drawString("Color = "+"",25,25);
g.drawString("Calendar is"+cal.DATE+"/"+cal.MONTH+"/"+cal.YEAR,34,36);
}
}
Ex 35: Write a program to store student‟s detail using Card Layout.
Code:
class s9e4 extends Applet
{
CardLayout c1;
Panel p;
Label l1;
Label l2;
Label l3;
Label l4;
TextField t1;
TextField t2;
TextField t3;
TextField t4;
public void start()
{
}
public void init()
{
c1=new CardLayout();
l1=new Label("Enter Name :");
l2=new Label("Enter Place :");
l3=new Label("Address :mo(ho)");
l4=new Label("Pin :670571 ");
t1=new TextField(20);
p=new Panel();
p.setLayout(c1);
add(l1);
add(t1);
add(l2);
// add(t2);
add(l3);
// add(t3);
add(l4);
// add(t4);
}
public void paint(Graphics g)
{
}
}
Session 10 : Networking & Other Advanced Feature of JAVA
Ex 37: Write a Java program to find the numeric address of the following web sites
i. www.ignou.ac.in
ii. www.indiatimes.com
iii. www.rediff.com
iv. www.apple.com
In addition to this, find the Internet Address of your local host.
Code:
import java.net.*;
class s10_01
{
public static void main(String ar[])throws Exception
{
InetAddress a=InetAddress.getLocalHost();
System.out.println("The Local Host IP:"+a);
a=InetAddress.getByName("www.ignou.ac.in");
System.out.println("The IP of www.ignou.ac.in :"+a);
a=InetAddress.getByName("www.indiatimes.com");
System.out.println("The IP of www.indiatimes.com :"+a);
a=InetAddress.getByName("www.apple.com");
System.out.println("The IP of www.apple.com :"+a);
InetAddress s[]=InetAddress.getAllByName("www.rediff.com");
for(int i=0;i<s.length;i++)
System.out.println("The IP of www.rediff.com :"+s[i]);
}
}
Ex 38: Create an applet which takes name and age as parameters and display the message “<name> is <age> year old.”. Print the URL of the class file.
Code:
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class s10_02 extends Applet
{
public void init()
{
Font f=new Font("adobe-courier",Font.PLAIN,18);
setFont(f);
setLayout(null);
setForeground(Color.green);
setBackground(new Color(200,0,200));
}
public void paint(Graphics g)
{
String n,a,msg;
n=getParameter("name");
a=getParameter("age");
msg=n+" is "+a+" year old. ";
g.drawString(msg,25,25);
}
}
<html>
<body>
<applet code="s10_02.class" width=400 height=400>
<param name="name" value="Anil kumar">
<param name="age" value="25">
</applet>
</body></html>

Download IGNOU Second Semester Solved Lab Manual


SECTION – 3
Database Management System Lab
Session 1
:

Ex 1: In this session you need to create database for an Employee management system of an ABC organization. The details about different tables are given below. According to that you can proceed further and create tables using MS-Access.
Answer :
EMPLOYEE MANAGEMENT SYSTEM
EMPLOYEE TABLE
CREATE TABLE EMPLOYEE (FIRSTNAME VARCHAR(20) NOT NULL, MIDDLENAME VARCHAR(20), LASTNAME VARCHAR(20) NOT NULL, EMPLOYEE_ID NUMBER PRIMARY KEY, DATEOFBIRTH DATE,ADDRESS VARCHAR(50), GENDER VARCHAR(2), SALARY NUMBER, DATEOFJOINING DATE, DEPT_NUMBER NUMBER);
DEPARTMENT TABLE
CREATE TABLE DEPARTMENT (DEPT_NAME VARCHAR(20) NOT NULL, DEPT_NUMBER NUMBER PRIMARY KEY, MANAGER_ID NUMBER, MA_DATE_OF_JOIN DATE);
DEPARTMENT LOCATION TABLE
CREATE TABLE DEPT_LOC (DEPT_NUMBER N UMBER, DEPT_LOC VARCHAR(30), DETP_LOC NUMBER PRIMARY KEY);
PROJECT TABLE
CREATE TABLE PROJECT (PROJECT_NAME VARCHAR(20), PROJECT_NUMBER NUMBER PRIMARY KEY, PROJECT_LOC VARCHAR(30) NOT NULL, DEPT_NUMBER NUMBER);
WORKS_ON TABLE
CREATE TABLE WORKS_ON (EMPLOYEE_ID NUMBER NOT NULL, PROJECT_NUMBER NUMBER NOT NULL, HOURS NOT NULL, EMP_PROJ NUMBER PRIMARY KEY);
DEPANDENT TABLE
CREATE TABLE DEPENDENT (EMPLOYEE_ID NUMBER, DEPENDENT_NAME VARCHAR(20), GENDER VARCHAR(2), DATEOFBIRTH DATE NOT NULL, REPLATIONSHIP VARCHAR(20) NOT NULL);
1) DEPAATMENT WISE DETAILS
SELECT FIRSTNAME, MIDDLENAME, LASTNAME, EMPLOYEE_ID, DATEOFBIRTH, GENDER, DEPT_NAME FROM EMPLOYEE, DEPARTMENT WHERE EMPLOYEE.DEPTNUMBER=Department.DEPT_NUMBER ORDER BY DEPARTMENT.DEPT_NUMBER;
2) DEPARTMENTS LOCATED IN MORE THAN ONE LOCATION
SELECT DISTINCT(DEPT_LOC) FROM DEPARTMENT_LOCATION D WHERE EXISTS (SELECT *FROM DEPARTMENT D1 WHERE D.DEPT_NUMBER =D1.DEPT_NUMBER);
3) LIST PROJECTS
SELECT PROJECT_NUMBER, PROJECT_NAME FROM PROJECT;
Employee_id
Dept_name
Gender
Date of birth
relationship
Computers
M
10/18/2007
manager
ISBN_nubmer
author
publisher
price
XYZABC
XXXXXXX
XYZABC
XXXXXXX
XYZABC
XXXXXXX
10000
XYZABC
YYYYYY
Member_id
Member_name
Max_no_books
Max_no_days
XZXZXZ
XYXYXY
YXYXYXY
YZYZYZ
4) DEPENDENT OF THE EMPLOYEE WHOSE ID IS ‘1’
SELECT *FROM DEPENDENT WHERE EMPLOYEE_ID=1
Session 2:
Ex 2: This session assume that you are developing a prototype database of the IGNOU library management system, for that you need to create the following tables:
(a) Book Records
(b) Book details
(c) Member details and
(d) Book issue details
Answer : LIBRARY MANAGEMENT SYSTEM
BOOK_RECORDS TABLE
CREATE TABLE BOOK_RECORDS (ACC_NUMBER NUMBER, ISBN_NUMBER NUMBER);
INSERT INTO BOOK_RECORDS VALUES(100,10);
INSERT INTO BOOK_RECORDS VALUES(101,11);
INSERT INTO BOOK_RECORDS VALUES(102,12);
INSERT INTO BOOK_RECORDS VALUES(103,13);
INSERT INTO BOOK_RECORDS VALUES(104,14);
INSERT INTO BOOK_RECORDS VALUES(105,15);
BOOKS
CREATE TABLE BOOKS (ISBN_NUMBER NUMBER PRIMARY KEY, AUTHOR VARCHAR(30), PUBLISHER VARCHAR(30), PRICE NUMBER);
INSERT INTO BOOKS VALUES(10,'XYZABC','XXXXXXX',100);
INSERT INTO BOOKS VALUES(11,'XYZABC','XXXXXXX',110);
INSERT INTO BOOKS VALUES(12,'XYZABC','XXXXXXX',210);
MEMBERS TABLE
CREATE TABLE MEMBERS (MEMBER_ID NUBMER PRIMARY KEY,
MEMBER_NAME VARCHAR(30), MAX_BOOKS NUMBER, MAX_DAYS NUMBER);
INSERT INTO MEMBERS VALUES(10,'XZXZXZ',2,20);
INSERT INTO MEMBERS VALUES(11,'XYXYXY',2,20);
INSERT INTO MEMBERS VALUES(12,'YXYXYXY',2,20);
INSERT INTO MEMBERS VALUES(13,'YZYZYZ',2,20);
BOOKS_ISSUE
CREATE TABLE BOOKS_ISSUE (MEMBER_ID NUMBER, ACC_NUMBER NUMBER, ISSUE_ATE DATE, RETURN_DATE DATE);
INSERT INTO BOOK_ISSUE VALUES(10,10,'12-03-2007','13-03-2007');
INSERT INTO BOOK_ISSUE VALUES(10,11,'12-03-2007','13-03-2007');
INSERT INTO BOOK_ISSUE VALUES(11,10,'12-03-2007','13-03-2007');
INSERT INTO BOOK_ISSUE VALUES(11,11,'12-03-2007','13-03-2007');
INSERT INTO BOOK_ISSUE VALUES(12,10,'12-03-2007','13-03-2007');
a) Get the list of all books
SELECT *FROM BOOKS;
b) Get list of all members
SELECT *FROM MEMBERS;
Member_id
Acc_number
Issue_date
Return_date
12/3/2007
3/13/2007
ISBN_nubmer
author
publisher
price
XYZABC
XXXXXXX
10000
XYZABC
YYYYYY
Member_id
Acc_number
Issue_date
Return_date
12/3/2007
3/13/2007
12/3/2007
3/13/2007
12/3/2007
3/13/2007
1/1/2005
3/13/2007
1/1/2005
3/13/2007
Customer_id
Name
Area
Phone
1
XYXYXY
040
5252525
2
XYXYXY
040
2525250
3
YZYZYZY
040
222222
4
XZXZXZXZ
080
232323
5
XYZXYZ
080
242424
c) Get the accession number of the books which are available in the library
SELECT DISTINCT(ACC_NUMBER) FROM BOOK_RECORDS; acc_number
100
101
102
103
104
105
d) List of books issued on 01-jan-2005
SELECT *FROM BOOK_ISSUE WHERE ISSUE_DATE=01/01/2005
e) Get list of all books having price greater than Rs. 500/-
SELECT *FROM BOOKS WHERE PRICE > 500
f) Get the members who have not returned the book
SELECT DISTINCT(MEMBERS.MEMBER_NAME) FROM BOOK_ISSUE, MEMBERS
WHERE (MEMBERS.MEMBER_ID) NOT IN (BOOK_ISSUE.MEMBER_ID) MEMBER_NAME
XYXYXY
XZXZXZ
YXYXYXY
YZYZYZ
g) Book issue details
SELECT *FROM BOOK_ISSUE;
h) Find the no of copies available of a book of given number
SELECT COUNT (*) FROM BOOK RECORDS WHERE ISBN_NUMBER=10; Expr1000
2
Session 4:
Ex 4: Create the following table and perform the necessary tasks defined below one by one. You must use the query tools/ SQL/ Reports/ Forms/ Graphs/Views/ using client/server wherever needed.
Answer : CUSTOMER TABLE
a) Print entire customer table
SELECT *FROM CUSTOMER;
Customer_id
Name
1
XEXYXY
2
XEXYXY
Customer_id
Name
Area
Phone
1
XEXYXY
ABC
5252525
5
XYZXYZ
ABC
242424
Expr1000
AREA
ABC
ACD
DEF
XYZ
Customer_id
Name
Area
Phone
1
XEXYXY
ABC
5252525
5
ABCDEFG
ABC
242424
MEMBER_ID
MEMBER_NAME
YXYXYXY
YZYZYZ
MEMBER_ID
MEMBER_NAME
XZXZXZ
XYXYXY
b) List the names of those customers who have ‘e’ as second letter in their names
SELECT NAME FROM CUSTOMER WHERE NAME LIKE '_i%'
c) Find out the customer belonging to area ‘abc’
SELECT *FROM CUSTOMER WHERE AREA LIKE 'ABC'
e) Delete record where area is NULL
DELETE FROM CUSTOMER WHERE AREA IS NULL
g) Create a table temp from customer having customer_id, name, and area
CREATE TEMPORARY TABLE TEMPTABLE (CUSTOMER_ID NUMBER,NAME VARCHAR(20),AREA VARCHAR(20));
h) Display area and number of records from customer table within each area
SELECT COUNT (*), AREA FROM CUSTOMER GROUP BY AREA
i) Display all those records from customer table where name starts with ‘a’ or area is ‘abc’
SELECT *FROM CUSTOMER WHERE NAME LIKE 'A%' OR AREA LIKE '%ABC%'
Ex 5: Answer the following queries using Library system as created earlier. You must create a view to know member name and name of the book issued to them, use any inbuilt function and operators like IN, ANY, ALL, EXISTS
Answer : LIBRARY MANAGEMENT SYSTEM
a) List the recors of members who have not been issues any book using EXISTS operator
SELECT MEMBER_ID, MEMBER_NAME FROM MEMBERS M WHERE NOT EXISTS
(SELECT *FROM BOOK_ISSUE B WHERE M.MEMBER_ID = B.MEMBER_ID);
b) List the members who have got issued at least one book.
SELECT MEMBER_ID, MEMBER_NAME FROM MEMBERS M WHERE
M.MEMBER_ID IN (SELECT MEMBER_ID FROM BOOK_ISSUE);
EMP_NO
NAME
SALARY
XYXYXY
50000
ZXZXZX
50000
EMP_NO
NAME
DEPT
SALARY
XYXYXY
50000
ZXZXZX
50000
YZYZYZ
50000
ZXYZXZ
50000
ABCDEF
50000
Ex 6: Create a table of Employee (emp-number, name, dept, salary) and Department (dept number, dept name). Insert some records in the tables through appropriate forms having integrity checks. Add some records in employee table where department value is not present in department table.
Answer : EMPOYEE MANAGEMENT SYSTEM
EMPLOYEE TABLE
CREATE TABLE EMPLOYEE(EMP_NO NUMBER PRIMARY KEY, NAME VARCHAR(20) NOT NULL, DEPT NUMBER, SALARY NUMBER NOT NULL);
INSERT INTO EMPLOYEE VALUES(100, 'XYZABC',1,50000);
INSERT INTO EMPLOYEE(EMP_NO, NAME, SALARY) VALUES(101, 'XYXYXY',50000);
INSERT INTO EMPLOYEE(EMP_NO, NAME, SALARY) VALUES(102, 'ZXZXZX',50000);
INSERT INTO EMPLOYEE VALUES(103, 'YZYZYZ',1,50000);
INSERT INTO EMPLOYEE VALUES(104, 'ZXYZXZ',1,50000);
INSERT INTO EMPLOYEE VALUES(105, 'ABCDEF',1,50000);
DEPARTMENT TABLE
CREATE TABLE DEPARTMENT(DEPT_NO NUMBER PRIMARY KEY, DEPT_NAME VARCHAR(30) NOT NULL);
INSERT INTO DEPARTMENT VALUES(1,’COMPUTERS’);
INSERT INTO DEPARTMENT VALUES(2,’ACCOUNTS’);
INSERT INTO DEPARTMENT VALUES(3,’SALES’);
a) display employee where department is NULL
SELECT EMP_NO, NAME, SALARY FROM EMPLOYEE WHERE DEPT IS NULL
b) Employee table report
c) Employee records whose salary less than the salary of employee code is ‘A100’
SELECT *FROM EMPLOYEE WHERE SALARY <(SELECT SALARY FROM
EMPLOYEE WHERE EMP_NO = 100);
d) Creating sales_data table
CREATE TABLE SALES_DATA(REGION_CODE NUMBER PRIMARY KEY, CITY VARCHAR(30), SALESPERSON_CODE NUMBER, SALE_QTY NUMBER)
SELECT *FROM SALES_DATA
REGION_CODE
CITY
SALESPERSON_CODE
SALE_QTY
HYDERABAD
DELHI
VIZAG
REGION_CODE
CITY
SALESPERSON_CODE
SALE_QTY
DELHI
VIZAG
e) Sales person sales details
SELECT *FROM SALES_DATA WHERE SALE_QTY >= 5;
Session 6 :
Ex 8: Create the following tables:
Order party : (Order number, Order date, customer code)
Order : Order number, Item code, Quantity
The key to the second table is order-number + item-code
Create a form for data entry to both the tables.
Answer : ORDER MANAGEMENT
ORDER PARTY TABLE
CREATE TABLE ORDER_PARTY(ORDER_NO NUMBER PRIMARY KEY, ORDER_DATE DATE, CURSTOMER_CODE NUMBER)
ORDER TABLE
CREATE TABLE ORDER(ORDER_NO NUMBER PRIMARY KEY, ITEM_CODE NUMBER, QUANTITY NUMBER);
1)ORDER AND ORDER PARTY DATA ENTRY FORM
Ex 9: Create a form for storing Bio-data of students. Create the supporting tables to store the data.
Answer : BIO DATA FORM
BIO DATA TABLE
CREATE TABLE BIO_DATE(NUM NUMBER PRIMARY KEY, NAME VARCHAR(20), DOB DATE, PLACE VARCHAR(20), QUALIFICATION VARCHAR(10), SKILLS VARCHAR(10), EXP NUMBER, ADDRESS VARCHAR(100));
BIO DATA ENTRY FORM
Ex 10: Design a suitable form for storing basic information and salary details of employees of an organization. Design and implement the necessary tables.
Answer : EMPLOYEE SALARY DETAILS
EMP TABLE
CREATE TABLE EMP(ENO NUMBER, ENAME VARCHAR(20), DEPT VARCHAR(20), SALARY NUMBER);
EMPLOYEE SALARY ENTRY FORM
Session 8 :
Ex 11: Design a form that shows the status of books pending on a member on entering the member-id.
Answer : Member book issue details using member id and member name
MEMBERS REPORT
Ex 12: Design a form that modifies the records of an Item Table having the fields: Item Code, Item Name, Quantity, Price, Re-order Level.
Answer : ITEM TABLE DETAILS
ITEM TABLE
CREATE TABLE ITEM(ITEM_CODE NUMBER PRIMARY KEY, ITEM_NAME VARCHAR(50), QUANTITY NUMBER, PRICE NUMBER, RE_ORDER_LEVEL NUMBER);
ITEM DETAILS ENTRY FORM
Ex 13: Design the form to display the leave information of each employee following. The validations must be made for the fields.
Answer : Employee leave table
EMP_LEAVE TABLE
CREATE TABLE EMP_LEAVE (EMP_ID NUMBER, REASON VARCHAR(50), L_DATE DATE, MONTH VARCHAR(5));
a) Leaves information group by Month
b) Leaves information group by Employee id

Download IGNOU Second Semester Solved Lab Manual

SECTION – 2
Operating System & Networking Lab
Session 1 : Network Configuration

Ex 1: Run the following commands and write the use of each command.-
Answer :
Ipconfig
C:\Documents and Settings\Administrator>ipconfig
Windows 2000 IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 10.227.1.81
Subnet Mask . . . . . . . . . . . : 255.255.255.128
Default Gateway . . . . . . . . . : 10.227.1.1
ping
C:\Documents and Settings\Administrator>ping
Usage: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] destination-list
telnet
Microsoft (R) Windows 2000 (TM) Version 5.00 (Build 2195)
Welcome to Microsoft Telnet Client
Telnet Client Build 5.00.99206.1
Escape Character is 'CTRL+]'
Microsoft Telnet>
diskperf
C:\Documents and Settings\Administrator>diskperf
1 Physical Disk Performance counters on this system are currently set to start At boot.
netdiag
C:\Documents and Settings\Administrator>netdiag
'netdiag' is not recognized as an internal or external command,
operable program or batch file.
netstat
C:\Documents and Settings\Administrator>netstat
Active Connections
Proto Local Address Foreign Address State
TCP Amb:1208 72.20.27.115:8080 SYN_SENT
TCP Amb:2380 105.173.200.246:microsoft-ds SYN_SENT
TCP Amb:2381 17.43.237.130:microsoft-ds SYN_SENT
pathping
C:\Documents and Settings\Administrator>pathping
Usage: pathping [-n] [-h maximum_hops] [-g host-list] [-p period]
[-q num_queries] [-w timeout] [-t] [-R] [-r] target_name
ftp
C:\Documents and Settings\Administrator>ftp
ftp>
sfc
C:\Documents and Settings\Administrator>sfc
Microsoft(R) Windows 2000 Windows File Checker Version 5.00
(C) 1999 Microsoft Corp. All rights reserved
Scans all protected system files and replaces incorrect versions with correct Microsoft versions.
SFC [/SCANNOW] [/SCANONCE] [/SCANBOOT] [/CANCEL] [/ENABLE] [/PURGECACHE]
[/CACHE SIZE=x] [/QUIET]
nbtstat
C:\Documents and Settings\Administrator>nbtstat
Displays protocol statistics and current TCP/IP connections using NBT (NetBIOS over TCP/IP).
rcp
C:\Documents and Settings\Administrator>rcp
Copies files to and from computer running the RCP service.
lpr
C:\Documents and Settings\Administrator>lpr
Sends a print job to a network printer Usage: lpr -S server -P printer [-C class] [-J job] [-o option] [-x] [-d]
filename
tracert
C:\Documents and Settings\Administrator>tracert
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
nslookup
C:\Documents and Settings\Administrator>nslookup
*** Default servers are not available
Default Server: UnKnown
Address: 127.0.0.1
route
C:\Documents and Settings\Administrator>route
Manipulates network routing tables.
lpq
C:\Documents and Settings\Administrator>lpq
Displays the state of a remote lpd queue.
Usage: lpq -Sserver -Pprinter [-l]
net session
C:\Documents and Settings\Administrator>net session
There are no entries in the list.
drivers
C:\Documents and Settings\Administrator>drivers
'drivers' is not recognized as an internal or external command, operable program or batch file.
nettime
C:\Documents and Settings\Administrator>nettime
'nettime' is not recognized as an internal or external command, operable program or batch file.
rsh
C:\Documents and Settings\Administrator>rsh
Runs commands on remote hosts running the RSH service.
RSH host [-l username] [-n] command
host Specifies the remote host on which to run command.
chkdsk
C:\Documents and Settings\Administrator>chkdsk
The type of the file system is FAT32.
Volume HCL created 22/08/2002 5:53 PM
Volume Serial Number is 3A51-1906
Windows is verifying files and folders...
File and folder verification is complete.
Windows has checked the file system and found no problem.
39,058,992 KB total disk space.
1,287,888 KB in 734 hidden files.
53,440 KB in 3,223 folders.
22,328,464 KB in 67,626 files.
15,389,184 KB are available.
16,384 bytes in each allocation unit.
2,441,187 total allocation units on disk.
961,824 allocation units available on disk.
hostname
C:\Documents and Settings\Administrator>hostname Amb
net account
C:\Documents and Settings\Administrator>net account
The syntax of this command is:
NET [ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP | NAME | PAUSE | PRINT | SEND | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
Ex 2: Use arp command to find your Ethernet physical address.
Answer :
arp
C:\Documents and Settings\Administrator>arp
Displays and modifies the IP-to-Physical address translation tables used by address resolution protocol (ARP).
ARP -s inet_addr eth_addr [if_addr]
ARP -d inet_addr [if_addr]
ARP -a [inet_addr] [-N if_addr]
Example:
> arp -s 157.55.85.212 00-aa-00-62-c6-09 .... Adds a static entry.
> arp -a .... Displays the arp table.
Ex 3: Modify the routing table using ipxroute.
Answer :
C:\Documents and Settings\Administrator>ipxroute
NWLink IPX Routing and Source Routing Control Program v2.00
Unable to open transport \Device\NwlnkIpx.
Ex 4: View the TCP/IP settings.
Answer :
Show tcp/ip
netsh>show mode tcp/ip
online
Ex 5: Configure interfaces.
Answer :
Configure interfaces:
netsh>set
The following commands are available:
Commands in this context:
set machine - Sets the current machine on which to operate.
set mode - Sets the current mode to online or offline.
netsh>set interface
The following command was not found: set interface.
netsh>set mode interface
'mode' is not an acceptable value for 'interface'.
The parameter is incorrect.
netsh>set mode
Usage: set mode [ mode= ] { online | offline }
Parameters:
Tag Value
mode - One of the following values:
online: Commit changes immediately
offline: Delay commit until explicitly requested
Remarks:
Sets the current mode to online or offline.
netsh>set machine
Session 2 : Linux / Unix Operating System
Ex 11: First try to execute the following commands on your operating system and write down the results and use of each command.
Answer :
Ls aa ab abc agm rajesh biju sem2
Pwd home\sem
Ls –x a1 a2 a.c agm a.out desktop frmstat.ui install.log
Ls –al drwxr-x- - 33 root root 4096 oct 2 10:12 .
drwx—xr-x 33 root root 6 oct 2 10:42 a1
-rw-r- -r-- 33 root root 5 oct 2 12:30 a2
-rwxr-x— 33 root root 4 oct 2 12:45 a.c
Ex 13: Make your own subdirectories called uni and linu in your home directory, Made? Ok, now delete the subdirectory called uni.
Answer :
Mkdir uni
Mkdir linu
Rmdir linu
Ex 14: Create a file called ignou.txt that contains the words "hello I am student of IGNOU". Now copy this file and paste to other director. Copied? Can you move the file also from one directory to another?
Answer :
Cat > ignou.txt
Cp ignou.txt \ab\a.txt
Mv ignou.txt \linu
Ex 15: In the previous question you have a file ignou.txt; change its permission to rwxrwxr-x. You can try different possibilities to changes in its permissions. One possibility may be rwxr-xr-x permissions. Find out what are the different commands available that can be used to change the permissions of a file/files.
Answer :
Chmod a+x ignou.txt
Chmod g-w ignou.txt
Chmod o-w ignou.txt
Ex 19: Change your password and write down the restrictions for given password.
Answer :
Passwd
Enter new password:
Re enter new password:
Restrictions to password
1.different from previous password
2.Have atleast 6 characters
3.Are not common words found in dictionary
Session 3 : Linux / Unix Operating System
Ex 21: Find the files (with full path) in your home directory those name are starting with the character ‘s’ and redirect the output into a file redirecting.txt and if you receive any error message on execution of the command redirect into errors.txt.
Answer : Ls –l s* >redirecting.txt
Ex 22: Execute sleep 25 in the foreground, suspend it with Ctrl-z and then put it into the background with bg. show all process running in background, bring any process back into the foreground with fg. Repeat the same exercise using kill to terminate the process and use & for sending into background. (You need to see different options of the kill command)
Answer : Sleep 25 –s
Ex 24: Write a shell script, which returns the PID of a process and accept the name of the process.
Answer : Ps e | grep init
Echo $a | cut –f1 –d ― ―
Ex 25: Use ping to find the round-trip delay to www.ignou.ac.in
Answer : Use ping to find the round-trip delay to www.ignou.ac.in
Ping ―www.ignou.ac.in‖
Ex 26: Send a message to all users which are online. Make provision so that you can send messages to other users but others cannot. Use talk to send messages.
Answer : Mesg n
Ex 28: Send a mail to yourself, and include ignou.txt inside the mail. Read the mail you have sent to yourself. Save the piece of message and file into some folder. Reply to yourself.
Answer : Mail root(user 1) ->
Mail amb(user 2)
Ex 30: Use the ls command and grep to display all names starting with "s".
Answer : Ls|grep[^s]
Session 4 : System Administrator Using Unix & Linux
Ex 33: Delete the user, which just now you have added.
Answer : Deluser abc
Ex 38: Write a message to inform all users that "they should shut down their machine after completing the lab exercises".
Answer : Wall “they should shut down their machine after completing the lab exercise”
Session 5 : Windows 2000 : Introduction to Networking
Ex 42: Add different users and groups. Also configure their permissions.
Answer :
To add a new user to the computer
1. Open Users and Passwords in Control Panel.
2. Click Add.
3. Follow the instructions on the screen.
Notes
· You must be logged on as an administrator or a member of the Administrators group to use Users and Passwords.
· To open a Control Panel item, click Start, point to Settings, click Control Panel, and then double-click the appropriate icon.
· If the computer is part of a domain, Add New User gives an existing domain user permission to use the computer. If the computer is not part of a domain, Add New User creates a new local user.
· If the computer is part of a domain, you can only add existing domain users with Users and Passwords. To add a new local user, click the Advanced tab and then click the Advanced button. In Local Users and Groups, click Users, click Action, and then click Create User.
· You should not add a new user to the Administrators group unless the user will perform only administrative tasks. For more information, see Related Topics.
Types of access permissions for shares
The following types of access permissions can be applied to shared folders.
Read
Read permission allows:
o Viewing file names and subfolder names.
o Traversing to subfolders.
o Viewing data in files.
o Running program files.
Change
Change permission allows all Read permissions, plus:
o Adding files and subfolders.
o Changing data in files.
o Deleting subfolders and files.
Full Control
Full Control is the default permission applied to any new shares you create.
It allows all Read and Change permissions, plus:
o Changing permissions (NTFS files and folders only).
o Taking ownership (NTFS files and folders only).
Note
When a folder is shared, the default is to grant Full Access permissions to
the Everyone group.
Ex 42 (ii): Exercise Install and configure a local printer
Answer :
1. Go to Settings, Printers, and start the add printer wizard.
2. Select Local Printer and Click next
3. Select the Printer Port. Say LPT1.
4. Select The Printer Manufacturer and Model.
5. Name the printer and Set to share the Printer if it has to be available in the Network.
6. After giving Location command and Print the test page. If all are ok, Finalise the setting and complete the wizard.
Ex 43: Connect and configure your computer with a Local Network Printer.
Answer :
To connect to a printer on a network
1. Open Printers.
2. Double-click Add Printer to start the Add Printer wizard, and then click Next.
3. Click Network printer, and then click Next.
4. Connect to the desired printer by:
o Searching for it in the Active Directory.
o Typing its name using the following format, or clicking Next to locate the printer on the network:
o Typing its URL using the following format:
5. Follow the instructions on the screen to finish connecting to the network printer.
Notes
To open Printers, click Start, point to Settings, and then click Printers.
If you are not logged on to a Windows 2000 domain running Active Directory, the option to Find a
printer in the Directory will not be available.
Connecting to a printer using its URL allows you to connect to printers across the Internet providing
you have permission to use that printer.
If you cannot connect to your printer using the general URL format above, please see your printer's
documentation or contact your network administrator.
You can also connect to a printer by dragging the printer from the Printers folder on the print server
and dropping it into your Printers folder, or by simply right-clicking the icon and then clicking
Connect.
After you have connected to a shared printer on the network, you can use it as if it were attached to
your computer.
Ex 45: Create a Hierarchical Directory Tree.
Answer : Create a Hierarchical Directory Tree
A hierarchical representation of the folders, files, disk drives, and other resources connected to a
computer or network. For example, Windows Explorer uses a tree view to display the resources that
are attached to a computer or a network.
.
Ex 46: Share any folder available in your directory, also configure its share permissions for different users.
Answer : Share and Share Permissions.
I create a folder test uder c:\temp directry and set permissions as follows.
Take Properties of Local Area Connction
Ex 47: Install and Configure TCP/IP.
Answer : Install and Configure TCP/IP
Properties of TCP/IP
Enter Ip address, Subnet Mask, Default Gateway, and DNS Server entries.
Add WINS server Entries and Complete the Settings.
Ex 48: Install a caching DNS server and find out how it reduces the network traffic.
Answer : Install a caching DNS server and find out how it reduces the network traffic
Windows 2000 authentication is implemented in two steps: an interactive logon process and a
network
authentication process. Typically, the same set of credentials is used by the interactive logon process and
the network authentication process. If your credentials differ, you are prompted to provide Windows domain
credentials each time you access a network resource. You can avoid this by logging on to your computer
using your Windows domain name, your Windows domain user name, and Windows domain password
before you try to connect to a network resource. If you log on without being connected to the network,
Windows 2000 recognizes the information from a previous successful logon. You receive the message
"Windows cannot connect to a server to confirm your logon settings. You have been logged on using
previously stored account information." When you connect to your network, the cached credentials are
passed to your Windows 2000 domain and you are able to access network resources without having to
provide a password again. Limiting the number of protocols on your computer enhances network
performance and reduces network traffic.
Ex 50: Implement delegated zones for a Domain Name Server.
Answer : Implement delegated zones for a Doman Name server
In the Macintosh environment, a logical grouping that simplifies browsing the network for resources,
such as servers and printers. It is similar to a domain in Windows 2000 Server networking. In a DNS
(Domain Name System) database, a zone is a sub tree of the DNS database that is administered as a single
separate entity, a DNS server. This administrative unit can consist of a single domain or a domain with
subdomains. A DNS zone administrator sets up one or more name servers for the zone.
Session 6 : Windows 2000 : Server Management
Ex 51-60: Install and Configure Windows 2000 Client & server.
Answer : Configuring Windows client as VPN client
VPN Client is an application that runs on a Microsoft® Windows®-based PC, a Sun ultraSPARC
workstations, a Linux desktop, or a Macintosh (Mac) personal computer that meets the system requirements
stated in the next section. In this document, the term "PC" applies generically to all these computers, unless
specified otherwise. The VPN Client on a remote PC, communicating with a Cisco VPN device at an
enterprise or service provider, creates a secure connection over the Internet that lets you access a private
network as if you were an on-site user. This secure connection is a Virtual Private Network (VPN).
System Requirements
To install the VPN Client on any system, you need–CD-ROM drive (if you are installing from CD-ROM) –
Administrator privileges •The following table indicates the system requirements to install the VPN Client on
each of the supported platforms.
Computer Operating System Requirements
Computer with a Pentium®- class processor or greater
•Microsoft® Windows® 98 or Windows 98 (second edition)
•Windows ME
•Windows NT® 4.0 (with Service Pack 6, or higher)
•Windows 2000
•Windows XP
•Microsoft TCP/IP installed. (Confirm via Start > Settings > Control Panel > Network > Protocols or Configuration.)
•50 MB hard disk space.
•RAM:
–32 MB for Windows 98
–64 MB for Windows NT and Windows ME
–64 MB for Windows 2000 (128 MB recommended)
–128 MB for Windows XP (256 MB recommended) Computer with and Intel x86 processor
RedHat Version 6.2 or later Linux (Intel), or compatible libraries with glibc Version 2.1.1-6 or later, using kernel Versions 2.2.12 or later
Note
The VPN Client does not support SMP (multiprocessor) or 64-bit processor kernels.
•32 MB Ram
•50 MB hard disk space Sun UltraSPARC computer
32-bit or 64-bit Solaris kernel OS Version 2.6 or later
• 32 MB Ram
• 50 MB hard disk space
Macintosh computer
Mac OS X, Version 10.2.0 or later
50 MB hard disk space
The VPN Client supports the following Cisco VPN devices:
•Cisco VPN 3000 Concentrator Series, Version 3.0 and later.
•Cisco PIX Firewall, Version 6.2.2(122) or Version 6.3(1).
•isco IOS Routers, Version 12.2(8)T and later
If you are using Internet Explorer, use version 5.0, Service Pack 2 or higher.
Installation Notes
The following files are included in this release:
vpnclient-win-msi-4.6.00.0049-k9.zip Windows client MSI installer
vpnclient-win-is-4.6.00.0045-k9.zip Windows client IS installer
vpnclient-darwin-4.6.00.0045-GUI-k9.dmg Mac OS X installer
vpnclient-linux-4.6.00.0045-k9.tar.gz Linux package
vpnclient-solaris-4.6.00.0045-k9.tar.Z Solaris package
vpn3000-4.1.6.bin VPN 30xx Concentrator code
vpn3005-4.1.6.bin VPN 3005 Concentrator code
update-4.6.00.0045.zip VPN Client AutoUpdate package
Because of platform differences, the installation instructions for Windows and non-Windows platforms also differ.
The following notes are important for users who are upgrading to Windows XP and users who want to downgrade to an earlier version of the VPN Client software.
Installation Notes - Windows Platforms
Release 4.6 includes the following installation considerations for Windows users:
Installing the VPN Client Software Using InstallShield Installing the VPN Client software on Windows NT, Windows 2000, or Windows XP with InstallShield requires Administrator privileges. If you do not have Administrator privileges, you must have someone who has Administrator privileges install the product for you.
Note
The VPN Client Installer does not allow installations from a network drive (CSCeb43490).
Installing the VPN Client Software Using the MSI Installer
If you are using the MSI installer, you must have Windows NT-based products such as Windows NT 4.0 (with SP6), Windows 2000, or Windows XP.
Installing with MSI also requires Administrator privileges.
When installing the Windows MSI installation package, the user must manually uninstall the previous VPN Client if it is older than version 4.6. The version 4.6 MSI installer does not detect older versions, and the installer will attempt to install before aborting gracefully. Once a version 4.6 MSI package has been installed, future client versions will be able to detect the existing version 4.6 installation and automatically begin the uninstallation process.
VPN Client Installation Using Windows Installer (MSI) Requires Windows NT SP6 When you attempt to install the VPN Client using MSI install (vpnclient_en.exe) on NT SP3, SP4, or SP5, the error messages do not indicate
that the VPN Client cannot be installed on those operating systems because they are unsupported. Once the errors occur, no other messages are displayed and the installation is aborted.
When you attempt to run vpnclient_en.exe on Windows NT SP3, SP4, or SP5 you see the following messages:
"Cannot find the file instmsiw.exe (or one of its components). Make sure the path and filename are correct and that all the required libraries are available."
-then-
"Cannot find the file MSIEXEC (or one of its components). Make sure the path and filename are correct and that all the required libraries are available."
The Windows Installer (MSI) can be installed only on NT SP6, so the error messages you see using earlier service packs are due to an MSI incompatibility (CSCdy05049).
Installation Notes - Solaris Platforms
The following sections describe actions you must take when installing the VPN Client on a Solaris platform.
Uninstall an Older VPN Client If Present on a Solaris Platform If you have a previous version of the VPN Client running under Solaris, you must uninstall the older VPN Client before installing a new VPN Client.
You are not required to uninstall an old VPN Client, if one is present, before installing a new VPN Client for Linux or Mac OS X. Disable the ipfilter Firewall Kernel Module Before Installing the VPN Client on a Solaris Platform
If have an IP firewall installed on your workstation, the reboot after installation of the VPN Client takes an inordinate amount of time. This is caused by a conflict between the vpnclient kernel module cipsec and the
ipfilter firewall module. To work around this issue, disable the ipfilter firewall kernel module before you install the VPN Client (CSCdw27781).
Using the VPN Client
•To use the VPN Client, you need –Direct network connection (cable or DSL modem and network adapter/interface card), or –Internal or external modem, and
•To connect using a digital certificate for authentication, you need a digital certificate signed by one of the following Certificate Authorities (CAs) installed on your PC:
–Baltimore Technologies (www.baltimoretechnologies.com)
–Entrust Technologies (www.entrust.com)
– Netscape (www.netscape.com)
–Verisign, Inc. (www.verisign.com)
–Microsoft Certificate Services
— Windows 2000
–A digital certificate stored on a smart card. The VPN Client supports smart cards via the MS CAPI Interface.
Session 8 : Windows 2000 : Security
Ex 72: Protect client machine by using Internet Connection Firewall (ICF).
Answer : Protect client machine by using Internet Connection Firewall(ICF)
Windows 2000 includes a Firewall to protect your system against unwanted "visitors" from the Internet (but not controlling connections from your system to the Internet, for which you would need to install a Non-Microsoft Firewall, like ZoneAlarm), which is configured using the Properties of the modem-connection: (using the Firewall on a LAN connection will cause network access problems to your system)
In the properties of the Internet Connection : tab : Advanced.
make sure, that the checkmark is placed for the Internet Connection Firewall.
Using Settings, you can configure the firewall.
tab : Services
The list of programs, which could run on your system. By default, no access is allowed from the Internet to your system to any of these services.
Unless you need to grant such an access, do NOT activate any of these services.
tab: Security Logging
Allows to activate a log-file tab : ICMP
ICMP (Internet Control Message Protocol is part of TCP/IP, the most common use is the PING program to test a network connection.
By default, the firewall will NOT respond to any ICMP , incl. PING, from the Internet.
Advanced Setup:
In case you have the Internet Information Server (maybe including the FTP server) installed and you like to allow access from the Internet, then you need to place the Check-marks (you are prompted to confirm the system allowed to be accessed) Activate ONLY the service, which people need to access from the Internet.
tab: ICMP To allow people on the Internet to test, that the connection is working to your system, you should allow incoming echo requests (PING-requests).
Warning: now your systems becomes also visible for all these "bad boys and girls", which probe all IP-addresses on the Internet and then try to find out which system they had found, and some of them may try to damage your system !
Ex 73: Configure TCP/IP packet filter.
Answer : Configure TCP/IP packet filter
1. Click Start , point to Settings , click Control Panel , and then double-click Network and Dial-up Connections .
2. Right-click the interface on which you want to configure inbound access control, and then click Properties .
3. In the Components checked are used by this connection box, click Internet Protocol (TCP/IP) , and then click Properties .
4. In the Internet Protocol (TCP/IP) Properties dialog box, click Advanced .
5. Click the Options tab.
6. Click TCP/IP filtering , and then click Properties .
7. Select the Enable TCP/IP Filtering (All adapters) check box. When you select this check box, you enable filtering for all adapters, but you configure the filters on a per-adapter basis. The same filters do not apply to all adapters.
8. There are three columns with the following labels:
TCP Ports
UDP Ports
IP Protocols
In each column, you must select either of the following options:
Permit All . If you want to permit all packets for TCP or UDP traffic, leave Permit All activated. Permit Only . If you want to allow only selected TCP or UDP traffic, click Permit Only , click Add , and then type the appropriate port in the Add Filter dialog box. If you want to block all UDP or TCP traffic, click Permit Only , but do not add any port numbers in the UDP Ports or TCP Port column. You cannot block UDP or TCP traffic by selecting Permit Only for IP Protocols and excluding IP protocols 6 and 17.
Note that you cannot block ICMP messages, even if you select Permit Only in the IP Protocols column and you do not include IP protocol 1.
TCP/IP Filtering can filter only inbound traffic. This feature does not affect outbound traffic or response ports that are created to accept responses from outbound requests. Use IPSec Policies or packet filtering if you require more control over outbound access.
Ex 75: Customize and configure IPsec policy and rules for transport mode on the local computer.
Answer : To create an IPSec Policy
1. Using HQ-RES-WRK-01, in the left pane of the MMC Console, right-click IP Security Policies on Local Machine, and then click Create IP Security Policy. The IP Security Policy Wizard appears.
2. Click Next.
3. Type Partner as the name of your policy, and click Next.
4. Clear the Activate the default response rule check box, and then click Next.
5. Make sure the Edit Properties check box is selected (it is by default), and then click Finish.
6. In the Properties dialog box for the policy you have just created, ensure that Use Add Wizard check box in the lower-right corner is selected, and then click Add to start the Security Rule Wizard.
7. Click Next to proceed through the Security Rule Wizard, which you started at the end of the previous section.
8. Select This rule does not specify a tunnel, (selected by default) and then click Next.
9. Select the radio button for All network connections, (selected by default) and click Next.
Session 9 : Windows 2000 : Network Management
Ex 81: Create a Group Policy Object (GPO) and Console.
Answer : Creation of Group Policy objects
1. Open Active Directory Users and Computers.
2. In the console tree, click Users.
3. In the Name column in the details pane, double-click Group Policy Creator Owners.
4. In the Group Policy Creator Owners Properties dialog box, click the Members tab.
5. Click Add, and then double click the name of each user or security group to whom you want to delegate creation rights.
6. Click OK in the Select Users, Contacts, or Computers dialog box, and then click OK in the Group Policy Creator Owners Properties dialog box.
Notes
· To start Active Directory Users and Computers, open a Remote Desk Top connection to either a Windows 2000 domain controller or a member server that has Windows 2000 Administration Tools installed. You must log on to the server as a domain administrator in order to complete this procedure.
· By default, only domain administrators, enterprise administrators, Group Policy Creator Owners, and the operating system can create new Group Policy Objects. If the domain administrator wants a
Non administrator or a group to be able to create Group Policy objects, that user or group can be added to the Group Policy Creator Owners security group. When a user who is not an administrator, but who is a member of the Group Policy Creator Owners group, creates a Group Policy object, that user becomes the creator and owner of the Group Policy object; therefore, that user can edit the Group Policy object. Being a member of the Group Policy Creator Owners group gives the user full control of only those Group Policy objects that the user creates or those Group Policy objects that are explicitly delegated to that user. It does not give the non administrator user any additional rights over other Group Policy objects for the domain—these users are not granted rights over Group Policy objects that they did not create.
· When an administrator creates a Group Policy object, the Domain Administrators group becomes the Creator Owner of the Group Policy object.
· When you delegate this task to non administrators, also consider delegating the ability to manage the links for a specific organizational unit. The reason for this is that, by default, non administrators cannot manage links, and the inability to manage links prevents them from being able to use the Active Directory Users and Computers snap-in to create a Group Policy object.
Session 10 : Windows 2000 : Troubleshooting
Ex 94: Back up the recovery agent Encrypting File System (EFS) private key.
Answer : Backup the recovery agent Encrypting File System9EFS) Private key:
1. Use Backup or another backup tool to restore a user's backup version of the encrypted file or folder to the computer where your file recovery certificate and recovery key are located.
2. Open windows Explorer.
3. Right-click the file or folder and then click Properties.
4. On the General tab, click Advanced.
5. Clear the Encrypt contents to secure data check box.
6. Make a backup version of the decrypted file or folder and return the backup version to the user.
Notes
· To open Windows Explorer, click Start, point to All Programs, point to Accessories, and then click Windows Explorer.
· You can return the backup version of the decrypted file or folder to the user as an e-mail attachment, on a floppy disk, or on a network share.
· You can also physically transport the recovery agent's private key and certificate, import the private key and certificate, decrypt the file or folder, and then delete the imported private key and certificate. This procedure exposes the private key more than the procedure above but does not require any backup or restore operations or file transportation.
· If you are the recovery agent, use the Export command from Certificates in Microsoft Management Console (MMC) to export the file recovery certificate and private key to a floppy disk. Keep the floppy disk in a secure location. Then, if the file recovery certificate or private key on your computer is ever damaged or deleted, you can use the Import command from Certificates in MMC to replace the damaged or deleted certificate and private key with the ones you have backed up on the floppy disk.
· For more information about using Certificates in MMC, see Related Topics.