Sie sind auf Seite 1von 111

1

CHAPTER 1: INTRODUCTION
Data migration is a key element to consider when adopting any new system either through purchase or new development. Data migration is not a simplistic task and if not given due consideration early in the process of developing or purchasing a new system it could become a very expensive task. In the introduction of our project problem is being stated as well as discussed. What is the problem that motivated us to undertake the project .Key aspects such as data migration , database management system, etc ., of the project are also discussed in the following sections. Scope and overview deals in how to solve the given problem ,using the key aspects.

1.1) What is Database?


A Database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality (for example, the availability of rooms in hotels), in a way that supports processes requiring this information (for example, finding a hotel with vacancies). The term "database" refers both to the way its users view it, and to the logical and physical materialization of its data, content, in files, computer memory, and computer data storage. This definition is very general, and is independent of the technology used. However, not every collection of data is a database; the term database implies that the data is managed to some level of quality (measured in terms of accuracy, availability, usability, and resilience) and this in turn often implies the use of a general-purpose Database management system (DBMS). A general-purpose DBMS is typically a complex software system that meets many usage requirements, and the databases that it maintains are often large and complex .The term database is correctly applied to the data itself, and is different from the DBMS which is a software system that allows to store and change the data, as well as retrieve information from it. The structure of a database is generally too complex to be handled without its DBMS, and any attempt to do otherwise is very likely to result in data corruption.

1.2) What is DBMS?


DBMSs are packaged as computer software products: well-known products include the Oracle DBMS, Access and SQL Server from Microsoft, DB2 from IBM and the Open source DBMS MySQL. Each such DBMS product currently supports many thousands of databases all over the world. The stored data in a database is not generally portable across different DBMS, but can inter-operate to some degree (while each DBMS type controls a database of its own database type) using standards like SQL and ODBC. A successful general-purpose DBMS is designed in a way that is can satisfy as many as possible different applications and application designers. A DBMS also needs to provide effective run-time execution to properly support (e.g., in terms of performance, availability, and security) as many end-users (the database's application users) as needed. Sometimes the combination of a database and its respective DBMS is referred to as a Database system (DBS).

1.3) PROBLEM
Various organizations hire database professionals to convert databases from one format to another. These professionals demand very high cost to get engaged in the database conversion process even then some data redundancies exist in the

resultant database. In order to avoid all these data replications database conversion software is created that provides professional services to the users for converting databases of earlier technology into the database of new and latest technologies in very less time. The Database Migration Tool enables you to quickly convert all database records from source database format to the destination database format. The database migration software consists of sophisticated methodology that successfully completes database migration project in few necessary steps using Wizard-driven interface. Converting a database using the database converter software reduces the risk associated with complex manual database migration process.

1.4) WHAT IS DATA MIGRATION?


Data migration is the process of transferring data between storage types, formats, or computer systems. Data migration is usually performed programmatically to achieve an automated migration, freeing up human resources from tedious tasks. It is required when organizations or individuals change computer systems or upgrade to new systems, or when systems merge (such as when the organizations that use them undergo a merger or takeover). To achieve an effective data migration procedure, data on the old system is mapped to the new system providing a design for data extraction and data loading. The design relates old data formats to the new system's formats and requirements. Programmatic data migration may involve many phases but it minimally includes data extraction where data is read from the old system and data loading where data is written to the new system. If a decision has been made to provide a set input file specification for loading data onto the target system, this allows a pre-load 'data validation' step to be put in place, interrupting the standard E(T)L process. Such a data validation process can be designed to interrogate the data to be transferred, to ensure that it meets the predefined criteria of the target environment, and the input file specification. After loading into the new system, results are subjected to data verification to determine whether data was accurately translated, is complete, and supports processes in the new system. During verification, there may be a need for a parallel run of both systems to identify areas of disparity and forestall erroneous data loss.

Automated and manual data cleaning is commonly performed in migration to improve data quality, eliminate redundant or obsolete information, and match the requirements of the new system. Data migration phases (design, extraction, cleansing, load, verification) for applications of moderate to high complexity are commonly repeated several times before the new system is deployed.

1.5) SCOPE AND OVERVIEW


Identifying the scope of the project

When reviewing your database to determine the scope of the cleanup projects and best course of action during the migration keep in mind the following questions: 1. How many records are affected by this issue? 2. Is this a problem that will affect retrieval or display of records?
Resolution of problems

Once you've identified your database's particular problems and issues Or, you may decide that the problem is not a high priority and does not require resolution at this time. In general, it is far easier and more efficient to perform data review and cleanup while you're still using the current LMS. Once the migration process is underway you'll be kept busy learning the new software. In addition, reviewing and cleaning up your databases now will put you in a better position to evaluate and test your data on the new system. You will be much more aware of the state of your data, and there will be fewer surprises after your data is loaded into the new system.
Which records should/should not migrate to the new system?

The most important challenge of a system migration is to make sure that all necessary data is migrated, but being aware of records that should not migrate is important as well. Records flagged for deletion, if migrated by mistake to a new database without being flagged as such, can cause problems in the new catalog. You may want to examine any records suppressed from the public catalog to determine if

they should be migrated to the new system, but if the answer is not clear then it may be better to migrate the records and if necessary delete them from the new system.

1.6) HISTORY
Data migration is a subset of the data integration market. However, it is a very large subset. According to our research the market for data migration (including services and people as well as products) was significantly in excess of $5bn in 2007. In our eyes that makes data migration a valid sub-market in its own right, just as ETL is a sub-market in its own right. Historically, data migration has been accomplished using conventional data integration and data quality tools, or by means of hand coding. However, research undertaken by the Standish Group in 1999 found that more than 80% of data migration projects ran over time or budget. When Bloor Research conducted a survey on the same topic in 2007 we found that that figure had not changed. In other words, seven years of general-purpose enhancements to the tools available made no difference in the success rate of such projects.One of the conclusions we can draw from this is that traditional tools, on their own, are not enough. We need data migration methodologies, we need experienced professionals, and we need special-purpose tools; or at least add-ons to conventional tools that have been specifically designed to support data migration. However, the tools vendors (with some notable exceptions) have been relatively slow to recognise the importance of data migration and that it has specialised requirements over and above those that apply to data integration in general. As a result the data migration market is immature in terms of technology.We could have included every data integration vendor in this Market Update. However, a Market Update on Data Integration Platforms is being published by Bloor Research alongside this one so we have here concentrated on those vendors that specialise in data migration, or have at least started to focus on data migration as a specialist sector. In terms of actually moving the data, traditional techniques assume that you are moving database tables (or their equivalent in a non-relational environment). However, a better approach is to migrate business entities (for example, a customer together with all of her orders). Amongst other things, this is easier to understand at a business level, enables incremental migration, facilitates parallel running and makes failback easier to implement. Unfortunately, we know of only one generalpurpose vendor that explicitly supports this sort of functionality today.The other big issue when it comes to data migration is how you perform cutover to the new system. Traditionally, this was a one-time big bang task, typically performed over aweekend. However, this is not practical for some mission critical 24 x 7 applications, which cannot be taken down at any time. Moreover, experiences such as those of Terminal 5 at Heathrow illustrate how dangerous such an approach can

be.The alternative to big bang is known as incremental migration and, in this scenario, you effectively run off both the old system and the new one in parallel. However, in order to tell user applications where to retrieve the data, the classical approach is to insert flags into the source system(s). In other words this is an intrusive approach where one would prefer to use a method that was non-intrusive. Software that enables such a non-intrusive approach is now starting to become available and it represents a significant advance over previous offerings.Also important in supporting what are becoming known as zero-downtime migrations is bi-directional synchronisation between the source and target systems. This allows the two systems to be run in parallel even after the migration is technically complete so that, for example, you might run the two systems together for a number of months until you feel completely happy about turning off the original system. This peace of mind can be further enhanced by failback facilities that automatically revert to the original system in the case of any sort of failure in the new environment. Richard Feynman, the Nobel award-winning physicist, was once asked what you need to know to be a physicist. His reply was that there were three things: mathematics, mathematics and mathematics. The same could be applied to data migration in that there are the three things that you need to do: profile your data, profile your data and profile your data. You need to know where your data is (if necessary going through a discovery exercise) and you need to understand it. If you understand your data fully (which is the role of profiling) then the remainder of any data migration project should be relatively straightforward.

1.7) Some key terms in understanding data migration


Legacy data is the recorded information that exists in your current storage system, and can include database records, spreadsheets, text files, scanned images and paper documents. All these data formats can be migrated to a new system. Data migration is the process of importing legacy data to a new system. This can involve entering the data manually, moving disk files from one folder (or computer) to another, database insert queries, developing custom software, or other methods. The specific method used for any particular system depends entirely on the systems involved and the nature and state of the data being migrated. Data cleansing is the process of preparing legacy data for migration to a new system. Because the architecture and storage method of new or updated systems are usually quite different, legacy data often does not meet the criteria set by the new system, and must be modified prior to migration. For example, the legacy system

may have allowed data to be entered in a way that is incompatible with the new system. Architecture differences, design flaws in the legacy system, or other factors can also render the data unfit for migration in its present state. The data cleansing process manipulates, or cleans, the legacy data so it conforms to the new system's requirements.

Do we migrate legacy data?


The "Do we migrate legacy data?" question has been asked ever since the first companies put data in one repository and decided to change systems. Here are some commonly asked questions:

Should we bring the data over to the new system? If so, should we bring all or part of the data? If just part, which parts? - based on creation date? based on status of case open or closed?or some combination of these? If we choose to bring over data on or after a certain date, which should it be last 3 months, last 6 months, last year?...should it be all the data? Should we filter in or out specific data? Are our desired criteria extractable from the existing database? Are the desired fields of data importable into the new system? Is data migration from our legacy system included in the purchase of the new system? If not, do we have the expertise in-house to script an automated process to migrate the data? If not, will we hire someone to do this? Will we perform this task manually?

How do we migrate data?


Once the decision is made to perform data migration and before migration can begin the following analyses must be performed:

Analyze and define source structure (structure of data in the legacy system) Analyze and define target structure (structure of data in the new system) Perform field mapping (mapping between the source and target structure with data cleansing, if necessary) Define the migration process (automated vs. manual)

CHAPTER 2 : CONCEPTS OF DATABASE


2.1) EVOLUTION OF DATA SYSTEMS
How were companies running their business before computers came into use? Even at that time, organizations needed information to execute the business processes, sell goods and services, and satisfy the needs of customers. Manual les supported business operations.Accounting personnel performed manual calculations and pre-pared invoices. Payroll departments manually wrote the checks. Business operations were reasonably satisfactory. So, what happened? How did we get to the computer database systems of today? When computers were introduced in the 1960s, computer le systems replaced themanual les. This marked a signicant leap in the way data was stored and retrieved for business operations. What has been really happening from that time until now, when database systems have become the norm? What prompted the progress toward database systems?

From the 1970s onward, two striking and remarkable phenomena were distinctly observed. Refer to Figure 1-1 indicating these two major developments. First, demand for information has escalated in every

organization. Organizations have steadily become global and widespread. Organizations have to contend with erce competitive pressures. They need vast and complex information to stay in business and make a prot. Second, the past three decades have witnessed a huge, explosive growth in information technology. Processors have become faster,cheaper, and smaller. Operating systems have become powerful and robust. Data storage mediahave expanded tremendously in capacity; data storage prices have tumbled. Network and communication technology can now connect any remote site without difculty. Application programming and people-machine interface have dramatically improved. The escalating demand for information and the explosive growth in information technology have worked hand in hand to bring about the evolution to database systems. Ever-increasing demand for information drives the need for better methods of storing and retrieving data, for faster ways of processing data, and for improved methods of providing information. The demand for more and better information drove the technology growth. Progress in technology, in turn, spurred the capability to provide different types of information, not just to run day-to-day operations of an organization, but also to make strategic decisions. Let us rst examine the pertinent aspects of the technology explosion as related to data systems, because these are what we are specically interested in. Then let us discuss the escalating demand for information that has prompted better and improved data systems.

2.2) TECHNOLOGY EXPLOSION


If you have been in the information technology area for 510 years, you are certainly an eyewitness to the explosive growth. Growth is not conned to any one sector. All aspects of the technology have been improving tremendously. Here are some specics: Twenty-ve years ago, there were only 50,000 computers in the whole world; now more than 500,000 are installed every day. More than 60% of American households have at least one computer;more than 50% have e-mail and Internet access. Growth of the Internet and the use of the Web have overshadowed the PC break through of the 1970s; at the beginning of 2000, about 50 million households worldwide were estimated to be using the Internet; by the end of 2005, this number is expected to grow 10-fold. About 7 years ago, there were only 50 websites; now 100,000 are added every hour. Databases in the terabyte range are becoming common; a few years ago, even the gigabyte range was unusual.

10

In the mid-1960s, programmers in large corporations had to write programs that had to run on 12K machines; today even your personal computer at home has 10,000 times larger memory. Growth has not been isolated here and there in hardware and software .We notice explosive growth in all sectors of information technology. Let us proceed further to look at specic areas of information technology that are related to data systems.

Data Systems What is the effect of the technology explosion on the way data is organized? Over the years, how were businesses organizing data? We just looked at the way applications have progressed from simpler types toward increasing sophistication.What about data systems? Manual-Type Records. Very early computer applications worked with data store on punched cards and paper tapes. Keypunch operators prepared data on these primitive media from manual les and records. Computer applications read data from cards and tapes to prepare reports. Sequential Files. Improved storage media such as magnetic tapes and early disk drives enabled application developers to organize data as sequential (or at) les. Each le contained data records of the same type arranged sequentially one after the other, usually in the order in which they were created. Sorting techniques allowed data records to be resorted in a different sequence. Databases. Increased sophistication in data storage techniques on hard disk drives and enhancements to operating systems enabled random and quick access of data. Data systems moved to a wholly new level. Applications were able to store data in databases and retrieve data sequentially and randomly.

2.3) DEMAND FOR INFORMATION


Of the two major factors that mutually contributed to the database approach to computing, so far we have considered the explosive growth of technology. Let us now turn our attention to the other factor, namely, the escalating demand for information. It is not just more information that organizations need. The demand for information includes several dimensions. Consider how billing requirements and sales analysis have changed. In the early years of computing, organizations were happy if they could bill their customers once a month and review total sales by product quarterly. Now it is completely different. Organizations must bill every sale right away to keep up the cash ow. They need up-to-date customer balance and daily and cumulative sales totals by products.What about inventory reconciliation?

11

Earlier systems provided reports to reconcile inventory or to determine protability only at the end of each month. Now organizations need daily inventory reconciliation to manage inventory better, daily protability analysis to plan sales campaigns, and daily customer information to improve customer service. In the earlier period of computing, organizations were satised with information showing only current activity. They could use the information to manage day-to-day business and make operational decisions. In the changed business climate of globalization and erce competition, this type of information alone is no longer adequate. Companies need information to plan and shape their future. They need information, not just to run day-today operations, but to make strategic decisions as well. What about the delivery of information now compared to the early days of computing? Today, online information is the norm for most companies. Fast response times and access to large volumes of data have become essential. Earlier computer systems just provided reports, mostly once a month, a few once a week, and a small number once a day. Organizations have come to realize that information is a key asset to be carefully managed and used for greater protability. In summary, demand for information by todays enterprises contains the following attributes: More information Newer purposes Different information types Integrated information Information to be shared Faster access to information

2.4) WHY DATABASE SYSTEMS?


We traced the evolution of data systems.We grasped the essentials of the explosive growth of information technology.We noted the escalating demand of organizations for information. We observed how growth in information technology and the increased demand for information worked hand in hand. Increasing demand for information spurred the growth of information technology. Growth of information technology, in turn, enabled organizations to satisfy the increasing demand for information. Let us summarize the driving forces for organizations to adopt database systems. A major reason is the inadequacy of the earlier le-oriented data systems.We shall review the limitations and see how database systems overcome the limitations and provide signicant benets. The Driving Forces Among others, four major forces drove organizations to adopt database systems. Figure 1-3 illustrates these four major forces.

12

Information as a Corporate Asset. Today, companies strongly realize that information is a corporate asset similar to other assets such as cash, plant and equipment, or inventory. Proper management of key assets is essential for success. Companies understand that it is essential to manage information as a key asset.They understand the need to nd improved methods for storing, retrieving, and using information. Explosive Growth of Computer Technology. Computer technology, especially data storage and retrieval systems, has grown in a phenomenal manner.Without growth in this sector, it is unlikely that we could have progressed to database systems that need sophisticated ways of data storage and retrieval. Escalating Demand for Information. We have noted the increase in demand for information by organizations, not only in volume but in the types of information as

well. If companies did not need more and newer types of information, there would have been no impetus for development of database systems.The earlier data systems might have been satisfactory. Inadequacy of Earlier Data Systems. Suppose the earlier data systems were able to meet the escalating demand for information. Then why bother to nd better methods? But the fact is that these earlier systems were grossly inadequate to meet the information demands. Storage and management of large volumes of data were not adequate. Finding and retrieving information were extremely difcult. Protecting the information asset of a company was nearly impossible with the earlier data systems.Why was this so? How were the earlier systems inadequate? In what ways could they not meet the information demands? Understanding the limitations will give you a better appreciation for database systems.

13

2.5) Database Systems Meet the Challenges


As the demand for information escalated, it became urgent to overcome the limitations of le-oriented data systems. With these limitations, companies could not meet the requirements of increased demand for information. They needed a different approach to storing, retrieving, and managing data. They could not afford the productivity losses. They could not waste space because of data duplication in le-oriented systems. Specialists at Rockwell and General Electric began to work on better methods for managing data. These methods attempted to overcome the limitations of le-oriented systems. Minimal Data Redundancy Unlike le-oriented data systems where data are duplicated among various applications, database systems integrate all the data into one logical structure. Duplication of data is minimized. Wastage of storage space is eliminated. Going back to the bank example, with a database, customer data is not duplicated in the checking account, savings account, and loan account applications. Customer data is entered and maintained in only one place in the database. Data Integrity Data integrity in a database means reduction of data inconsistency. Because of the elimination or control of data redundancy, a database is less prone to errors creeping in through data duplication. Field sizes and eld formats are the same for all applications. Each application uses the same data from one place in the database. In a bank, names and addresses will be the same for checking account, savings account, and loan applications. Data Sharing This benet of database systems follows from data integration. The various departments in any enterprise need to share the companys data for proper functioning.The sales department needs to share the data generated by the accounting department through the billing application. Consider the customer service department. Security Controls Information is a corporate asset and, therefore, must be protected through proper security controls. In le-oriented systems, security controls cannot be established easily. Imagine the data administrator wanting to restrict and control the use of data relating to employees. In le-oriented systems, control has to be exercised in all applications having separate employee les. However, in a database system, all data about employees are consolidated, integrated, and kept in one place. Security controls on employee data need to be applied in only one place in the database. Database systems

14

make centralized security controls possible. It is also easy to apply data access authorizations at various levels of data. Data Independence Remember the lack of data independence in le-oriented systems where computer programs have data structure denitions embedded within the programs themselves. In database systems, le or data denitions are separated out of the programs and kept within the database itself. Program logic and data structure denitions are not intricately bound together. In a client/server environment, data and descriptions of data structures reside on the database server, whereas the code for application logic executes on the client machine or on a separate application server. Reduced Program Maintenance This benet of database systems results primarily from data independence in applications. If the customer data structure changes by the addition of a eld for cellular phone numbers, then this change is made in only one place within the database itself. Only those programs that need the new eld need to be modied and recompiled to make use of the added piece of data.Within limits, you can change programs or data independently. Simpler Backup and Recovery In a database system, generally all data are in one place. Therefore, it becomes easy to establish procedures to back up data. All the relationships among the data structures are also in one place. The arrangement of data in database systems makes it easier not only for backing up the data but also for initiating procedures for recovery of data lost because of malfunctions.

2.6) Tables Records and Fields


The term 'database' is used by everyone now-a-days yet what exactly does the word mean? Most people, not being computer boffins, would find it difficult to provide an explanation but would, if pressed, suggest one or more of the following examples. For example, the method the bank uses to store details of their account, the medical records department of a large hospital or a card index of their own home video collection. The question is what exactly do all these examples have in common? A good definition of what a database is can be found on the Internet: "A database is one or more large structured tables of persistent data, usually associated with software to update and query the data.

15

A simple database might be a single table containing many records, each of which contains the same set of fields where each field is a certain fixed width." This definition clearly needs a lot of explaining, for one thing what is meant by a table? The following sections will take each of the terms in the above definition and provide examples, exercises and explanations. A database consists of tables which are composed of records which, in turn, are made up of fields.

The diagram below provides an example of a typical table consisting of patient details:

In the above diagram: A row = a record A column = a field A cell = a data item; a particular value in a field for a particular record. A table in a database may be empty, that is contain no records or contain many millions of them. Similarly, a single record may consist of one or thousands

16

of fields. Each field in turn contains a single data item. These data items can be categorised in a number of ways, which we discussed when taking about data types.

2.7) Database Management Systems (DBMS)


Although databases can be paper based most are computer based. DataBases in computers are usually handled by a special piece of software called a DataBase Management System (DBMS). Oracle,Access97 and Paradox are three such DBMSs. Before we discuss the general features of a DBMS we willtake a brief look at Access97.Access97 allows you to do most things in several different ways. For example, you can create the database by usiing the table definition window or you can define it using a standard language called SQL. Similarly you can enter data in one of two ways; the first, datasheet view is pretty crude but does the job if youre the only one using the database. Alternatively, you can create pretty screens called forms which make the job of entering data easier. You can manipulate or query your data in Access97 by using a graphical method (called Query by example QBE) or again using SQL. You can also create more user friendly versions of these results using reports which can provide high quality printed documents.

There is a great deal of information in the above paragraph, and do not worry if you do not understand it, as each of these aspects will be considered in depth latter in the course. DBMS is much more complex than a spreadsheet or a traditional card indexing system.

17

In general DBMSs have the following standard features: 1. Meta Data 2. Actions 3. Queries 4. Reporting 5. Views 6. Forms 7. Programming Language Obviously each supplier constantly tries to outdo the others in offering more features. However we will concentrate on the basic ones listed above.

2.7.1) Meta-Data
Besides the DBMS storing the actual data you put in it (e.g. names and date of births in the previous patienttable example), it also stores details about this data and the structure in which its kept. That is the DBMS 'knows' how many tables and records there are in the database as well as what data type each field is. All this additional information is called meta data and is very useful when you want to find out certain details. The data-dictionary you created earlier is an example of meta-data. In Access97 you can inspect the meta data that is stored about the current database you have open by clicking on the Tools menu -> Options ->View tab. Then under the Show section, select or clear the Hidden Objects check box and the System Objects check box. Access97 displays hidden objects with dimmed icons to distinguish them from objects that aren't defined as hidden.

2.7.2) Actions/Privileges
A DBMS allows the user to carry out the following activities which are often called user 'rights': Action: Level: Creates - tables / records / fields Reads - tables / records / fields Updates - tables / records / fields Deletes - tables / records / fields That is the user can possibly be allowed to create, Read, Update or Delete tables, records or fields. These actions / user rights are often referred to as 'CRUD'. The DBMS may also allow the user to carry out ad hoc: Searches -

18

tables / records / fields . The above 'CRUD' is very useful when considering what actions /access rights various people should have to a set of data. For example, a nurse may be able to Read the details of a computerised prescription but not allowed to carry out any of the other actions on the record. Similarly the doctor, who is a colleague of the one who Created the prescription may not be able to Delete it. Different professional groups, butnotably the administrative managers and the clinicians, will have very different rights to the same sets of data. Many health systems do not allow anyone to delete anything only what's known as 'delete flag' the data item. This tags the records as being deleted but does not remove it from the database. This is one way of keeping an audit trial, enabling computer user's movements to be recorded. There was recently a case of a GP changing prescriptions, only to be found out by the computers audit trail! Often database analysts draw what is known as a 'CRUD', matrix. The purpose of a CRUD matrix is to classify who should or does what to various data items (attributes,fields whatever),

19

2.7.3) Queries and reports


The most common complaint concerning databases is the ease of being able to enter data into them compared to the difficulty of getting it back out again.Query and reporting facilities are designed specifically to make the process of extracting data easier. We will be looking in more detail at queries and less so at reports in the practical sessions to this course.

2.7.4) Views
From the above it is clear that a database can offer a large number of things to a particular user. In large databases a particular group of users have a particular view of the data. This might well be the result of having few privileges to a very small subset of the database, where as other users will have far greater privileges applied to much more data. The important thing to realise is that what a particular user sees is not necessarily the same as the underlying data. The excellent recent novel 'Quite ugly one morning' by Robert Brookemyre describes this situation in a NHS context.

20

2.7.5) Forms
These provide a method of allowing users to enter data in a friendly manner. For example the screen may minic a paper data entry form and provide a method of entering data into several tables simultaneously. A practical session will teach you how to develop them.

2.7.6) Programming language


Whereas the first DBMS's did not provide a point and click interface, this is now the exception. Such developments have made databases more attractive to a much wider audience with the result that most researchers can now develop a simple Access97 database. Unfortunately the point and click interface is limited and to develop any database that is usable to any extent must include some programming. Traditionally different aspects of the database had different languages, there was a Data Definition Language (DDL) for creating the database than a Data Manipulation Language (DML) to allow the user to interrogate the database. There were also special reporting languages that provided formatting facilities. Most of these sublanguages have now been seamlessly incorporated into most major programming languages such as Microsoft Visual Basic (the language for Access97) and Delphi.

2.8) Keys and Indexes


These are both characteristics of tables. The words key and index are often used interchangeably. Traditionally the index was the way the computer implemented the key concept. A key is a field that has a unique value for each

21

record in the table, such as a PIN or ID of some sort. There are several variety of keys (superkeys, primary, candidate, foreign etc.) each has slightly different characteristics. At this point, we are only concerned with one type of key: Primary keys - The primary key is a field or combination of fields that uniquely identifies each record in a table. (e.g. patient ID). Every table must have a Primary key. 2.8.1 Types of primary keys Primary keys can be either simple or composite (compound). A simple Primary key is one that is made up of just one field. An example would be if we made the Patient ID the primary key for the Patient table. In this instance, no two patients would ever have the same ID only one record could exist for each patient unless we allowed patients to have more than one ID? A composite (compound) primary key is one where the key consists of more than one field. For example imagine we did not have a unique patient ID field in the patient table. We could possibly say that first name + last name + DOB + post code would give us a unique combination. However this is really a botch for several reasons. Firstly from the previous section I stated that a primary key must possess a valid value. It MUST NOT be empty. Considering our composite key it is highly probable that some of the fields will be empty (null). This means that we can't save any of the other details for the record, such as referral doctor and date placed on list, until we have all the details that make up the primary key. Some patients may be wait a very long time for referrals if this primary key were accepted. It is always better to have a primary key that is an abstract number rather than one which is made up of several fields which have meaning (see p126 Reingruber & Gregory). In fact the Object Oriented school of modelling considers this so important that they have given primary keys a special name oid which stands for object ID and which is a characteristic of all objects before any other is defined.

2.9) Normalization of Database Tables


Objectives The idea of Dependencies of Attributes Normalization and Database Design

22

Understand concepts of normalization (Higher-Level Normal Forms) Learn how to normalize tables Understand normalization and database design issues Denomalization

2.9.1) Functional Dependency


A Functional Dependency Is A Relationship Between Or Among Attributes Such That The Values Of One Attribute Depend On, Or Are Determined By, The Values Of The Other Attribute(s). Partial Dependency: Is A Relationship Between Attributes Such That The Values Of One Attribute Is Dependent On, Or Determined By, The Values Of Another Attribute Which Is Part Of The Composite Key. Partial Dependencies Are Not Good Due To duplication Of Data And Update Anomalies;

Examples of Functional Dependencies

23

2.9.2) Transitive Dependencies


Is A Relationship Between Attributes Such That The Values Of One Attribute Is Dependent On, Or Determined By, The Values Of Another Attribute Which Is Not A Part Of The Key. Exist when a nonkey attribute value is functionally dependent upon another nonkey value in the record. An employee data table that includes the hourly pay rate would require searching every employee record to properly update an hourly rate for a particular job category.

So Now what is Normalization?


GOLDEN RULE OF NORMALIZATION: Enter The Minimum Data Necessary, Avoiding Duplicate Entry Of Information, With Minimum Risks To Data Integrity. Goals Of Normalization: Eliminate Redundancies Caused By: Fields Repeated Within A File Fields Not Directly Describing The Key Entity Fields Derived From Other Fields Avoid Anomalies In Updating (Adding, Editing, Deleting) Represent Accurately The Items Being Modeled Simplify Maintenance And Retrieval Of Info Database Tables and Normalization Normalization is a process for assigning attributes to entities. It reduces data redundancies and helps eliminate the data anomalies. Normalization works through a series of stages called normal forms: First normal form (1NF) Second normal form (2NF) Third normal form (3NF) The highest level of normalization is not always desirable.

24

25

CHAPTER 3: TECHNIQUES OF DATA MIGRATION


There are several techniques for DataMigration . In the following sections we have discussed the parallel techniques for datamigration & the technique applied in our project is discussed in section 3.3.

3.1) Approach : USER ORIENTED APPROACH


1. Establish the business benefits of the proposed Migration. 2. Attend stakeholder workshops to agree data to be migrated. 3. Support design walkthrough and User Scenarios for potential software package. 4. Identify the preferred package. 5. Draft the Business Rules for Data Validation, Clean-up and Transformation. 6. Review the Business Rules with Users and modify according to User comments. 7. Obtain formal User sign-off for the Business Rules. 8. Define the End-to-End Data Load Processes, including procedures for resolving data quality discrepancies. 9. Select Data Modelling Tool,in accordance with relevant Standards. 10.Create Data Models for Sources and Targets. 11.Define procedures to maintain the Data Model as detailed in the Requirements Specification under Change Control (following system design changes) 12.Complex Change Management Projects. Carry out data preparation to defined business rules for data input. Carry out data cleansing to defined business rules for data input. Support data input processes, including resolving data quality queries.

26

3.2) APPROACH : David Barkaway Approach


Historically, data migration projects have had a tendency to fail. According to Bloor Research, as many as 60 percent do not succeed.* How can we prevent failure when migrating the data? Follow this seven-step process. 1)Source system exploration The first phase of a data migration project is to identify and explore the source data. The most appropriate route for identification is to group data, customer names, addresses and product descriptions based on the target model. 2)Data assessment The next logical phase is to assess the quality of this source data. If the new system fails due to data inconsistencies, incorrect or duplicate data, there is very limited value in migrating data to the target system. To assess the data, we recommend profiling the data. 3) Migration design In the migration design phase, the main tasks will be to define the technical architecture and design of the migration processes. In addition, you will define the testing processes and how to transition them to the production system. You will also determine whether there will be a parallel run, a zerodowntime migration, or whether you will be expecting to complete the migration and simply decommission the old system. 4) Migration build Be careful about using a just enough development approach with your data migration, simply because the migration will be executed only once and there will be limited reuse of the code. These assumptions explain why data migrations are prone to failure. 5) Execution After comprehensive testing, the time comes to run the migration. In the majority of cases, the source systems are shut down while the migration executes. To minimize impact, this is likely to occur over a weekend or public holiday. In some cases, where the source applications are required to run 24/7, 365 days a year, a zerodowntime migration approach may be needed. This requires a tool to provide the initial load processes, with additional data synchronization technology to capture any changes that took place during the initial load; then, it requires synchronizing the source and target data after the initial load finishes. 6) Transition At some point after the data has been migrated, decide when to move to the new

27

system, and where appropriate, retire the old system. During the execution phase, audit trails and logs will be created to ensure that all data has been correctly migrated and, when appropriate, that the correct synchronization has been achieved. Finally, after reviewing the audit trails and logs, you will be prepared to make the decision to transition users to the new system. 7) Production As part of the design process, a system retirement policy will be created to address the old system. There will also be ongoing data quality enhancements. Remember that because not all source systems will be retired, data quality issues may be identified and will need rectifying in several of the source systems.

3.3) Technique used in the Project


To analyze and define source and target structures, analysis must be performed on the existing system as well as the new system to understand how it works, who uses it, and what they use it for. A good starting point for gathering this information is in the existing documentation for each system. This documentation could take the form of the original specifications for the application, as well as the systems design and documentation produced once the application was completed. Often this information will be missing or incomplete with legacy applications, because there may be some time between when the application was first developed and now. You may also find crucial information in other forms of documentation, including guides, manuals, tutorials, and training materials that end-users may have used. Most often this type of material will provide background information on the functionality exposed to end-users but may not provide details of how the underlying processes work. For this part of the analysis, you may actually need to review and document the existing code. This may be difficult, depending on the legacy platform. For example, if data are being migrated from an AS/400 application written in RPG, assistance from an experienced RPG programmer will be required, if those skills are not available in-house. This can be an expensive part of the analysis process, because a resource to perform this analysis for you may be necessary, but it is a vital part of the process, especially if the application has been running and maintained over a long period of time. Undocumented code or fixes that are critical to the application and that have not been documented elsewhere may exist. Another key area to examine is how the data in the system are stored (i.e., in flat files, files, or tables). What fields are included in those files/tables and what indexes are in use? Also, a detailed analysis of any server processes that are running that may be related to the data must be performed (e.g., if a nightly process runs across a file and updates it from another system).

28

Now that the source and target structures are defined, the mapping from the legacy to the target should fall into place fairly easily. Mapping should include documentation that specifically identifies fields from the legacy system mapped to fields in the target system and any necessary conversion or cleansing. Once the analysis and mapping steps are completed, the process of importing the data into the new system must be defined. This process may be a combination of automation and manual processes or may be completely automated or may be completely manual. For example, a process may: Create data extractions from the legacy system Cleanse the data extractions according to mapping guidelines Import the data extractions into the new system using that system's import feature Verify and test samplings of the data in the new system by comparing data reports to the old system Understanding Your Data: The First Essential Step Before undertaking large scale legacy-to-x application data migrations, data analysts need to learn as much as possible about the data they plan to move. If, for example, you have a variety of pegs that you'd like to fit into round holes, it's best to find out which ones are already round and which ones are square, triangular, rectangular, etc. Considering the magnitude of an organization's data, the task of the data analyst to obtain this knowledge is overwhelming, to say the least. IT organizations can begin their data analysis by implementing a two-step process: data profiling and mapping. Data profiling involves studying the source data thoroughly to understand its content, structure, quality and integrity. Once the data has been profiled, an accurate set of mapping specifications can be developed based on this profile a process called data mapping. The combination of data profiling and mapping comprises the essential first step in any successful data migration project and should be completed prior to attempting to extract, scrub, transform and load the data into the target database. Conventional Techniques in Data Migration: Problems and Pitfalls The conventional approach to data profiling and mapping starts with a large team of people (data and business analysts, data administrators, database administrators, system designers, subject matter experts, etc.). These people meet in a series of joint application development (JAD) sessions and attempt to extract useful information about the content and structure of the legacy data sources by examining outdated documentation, COBOL copy books, inaccurate meta data and, in some cases, the physical data itself. Typically, this is a very labor- intensive process supplemented, in some cases, by semi-automated query techniques. Profiling legacy data in this way is extremely complex, time- intensive and error-prone. Once the process is complete, only a limited understanding of the source data is achieved.

29

At that point, according to the project flow chart, the data analyst moves on to the mapping phase. However, since the source data is so poorly understood and inferences about it are largely based on assumptions rather than facts, this phase typically results in an inaccurate data model and set of mapping specifications. Based on this information, the data is extracted, scrubbed, transformed and loaded into the new database. Not surprisingly, in almost all cases, the new system doesn't work correctly the first time. Then the rework process begins: redesigning, recoding, reloading and retesting. At best, the project incurs significant time and cost overruns. At worst, faced with runaway costs and no clear end in sight, senior management cancels the project, preferring to live with an inefficient but partially functional information system rather than incur the ongoing costs of an "endless" data migration project. Strategies for Data Migration: 6 Steps to Preparing Your Data Data profiling and mapping consist of six sequential steps, three for data profiling and three for data mapping, with each step building on the information produced in the previous steps. The resulting transformation maps, in turn, can be used in conjunction with third-party data migration tools to extract, scrub, transform and load the data from the old system to the new system. Data sources are profiled in three dimensions: down columns (column profiling) ; across rows (dependency profiling); and across tables (redundancy profiling). Column Profiling. Column profiling analyzes the values in each column or field of source data, inferring detailed characteristics for each column, including data type and size, range of values, frequency and distribution of values, cardinality and null and uniqueness characteristics. This step allows analysts to detect and analyze data content quality problems and evaluate discrepancies between the inferred, true meta data and the documented meta data. Dependency Profiling. Dependency profiling analyzes data across rows comparing values in every column with values in every other column and infers all dependency relationships that exist between attributes within each table. This process cannot be accomplished manually. Dependency profiling identifies primary keys and whether or not expected dependencies (e.g., those imposed by a new application) are supported by the data. It also identifies "gray-area dependencies" those that are true most of the time, but not all of the time, and are usually an indication of a data quality problem. Redundancy Profiling. Redundancy profiling compares data between tables of the same or different data sources, determining which columns contain overlapping or identical sets of values. It looks for repeating patterns among an organization's "islands of information" billing systems, sales force automation systems, post-sales support systems, etc. Redundancy profiling identifies attributes containing the same information but with different names (synonyms) and attributes that have the same

30

name but different business meaning (homonyms). It also helps determine which columns are redundant and can be eliminated and which are necessary to connect information between tables. Redundancy profiling eliminates processing overhead and reduces the probability of error in the target database. As with dependency profiling, this process cannot be accomplished manually.

Figure 1: Key steps in data profiling and mapping

Once the data profiling process is finished, the profile results can be used to complete the remaining three data mapping steps of a migration project: normalization, model enhancement and transformation mapping. Normalization. By building a fully normalized relational model based on and fully supported by the consolidation of all the data, the data model will not fail. Model Enhancement. This process involves modifying the normalized model by adding structures to support new requirements or by adding indexes and denormalizing the structures to enhance performance. Transformation Mapping. Once the data model modifications are complete, a set of transformation maps can be created to show the relationships between columns in the source files and tables in the enhanced model, including attribute-to-attribute flows. Ideally, these transformation maps facilitate the capture of scrubbing and transformation requirements and provide essential information to the programmers creating conversion routines to move data from the source to the target database. Developing an accurate profile of existing data sources is the essential first step in any successful data migration project. By executing a sound data profiling and mapping strategy, small, focused teams of technical and business users can quickly perform the highly complex tasks necessary to achieve a thorough understanding of

31

source data a level of understanding that simply cannot be achieved through conventional processes and semi-automated query techniques.

32

CHAPTER 4 : SOFTWARE REQUIREMENT SPECIFICATION


The Software Requirement Specification (SRS) is very important part of the software building process, which describes the actual user level requirement from technical point of view i.e. what the user exactly wants? Or For what purpose we are making every thing. The objective of preparing the software requirement specification is to represent the requirements of the software in such a manner that ultimately leads to successful software implementation. It is the result of the analysis process of the software development. It should contain all the data the software is going to process, the function it will provide, and the behavior it will exhibit. This Software Requirements Specifications (SRS) is defined in IEEE Std. 830-1993, IEEE Recommended Practice for Software Requirements Specifications. The document is organized in the following structure: Scope Functional Requirement Non-Functional Requirement System Analysis System Design Coding Testing Maintenance

4.1) SCOPE OF PROJECT


DMF(Data Migration Facility) creates and automatically manages a tiered virtual storage environment that can significantly reduce equipment and operating costs, improve service levels and lower risks. Based on user criteria DMF continuously monitors and automatically migrates data among storage assets with different cost and performance characteristics. Only the most critical or timely data resides on higher performance, more expensive storage media, while less critical or timely data is automatically migrated to less expensive, lower performance storage media.

33

Data always appears to be online to end users and applications regardless of its actual storage location. Unlike many other virtual storage managers, DMF can integrate "green" storage technologies, such as automated tape libraries, into its virtual storage pool. According to The Clipper Group, a Boston-based analyst firm, tape can be up to 23 times less expensive than SATA disk and use up to 290 times less energy. DMF's industry leading features include automatic data migration, automatic data recall, file and volume level migration policies, custom migration policies through user-defined plug-ins, accelerated data access, partial file migration and recall, Active Backup, GUI-based administration, tape library management and many more. DMF can manage Petabytes of data, hundreds of millions of files and run storage devices at their maximum rated speed. DMF operates in the background so there is no interruption or degradation of service to end users and applications. DMF delivers significant storage management benefits including:

Significantly reduce storage and storage management costs today Avoid future costs spiraling out of control Lower risks and improve service levels through reduced operator intervention Lower risk of data loss through DMF's Active Backup feature

4.2) FUNCTIONAL REQUIREMENT


Hardware Specification: 400Mz Processor 512MB RAM Pentium 4 CPU 80 GB HDD Corporate LAN and Internet Software Specification: Front end: VB.net Operating System: Windows 2000/XP Software required: Microsoft Visual Studio 2008

34

4.3) NON FUNCTIONAL REQUIREMENT


Portability:The project is developed in JSP, so it is platform independent. It can be run on any machine but the basic requirement of all the machines is that they should have JVM installed into their operating system. Traceability:In our project a given component can be traced to the corresponding design component, and a design component can be traced to a specific requirement it implements and vice versa. Correctness:The system will be able to satisfy the end user with the correct information. Hence, it will perfectly serve the needs of users. Maintainability:The system will be quite easy to maintain as we have adopt modular programming approach. So it can be easily maintained. Stability:The system will work properly as per the specification and it will be robust enough to handle any updating without manual interference. The response time for handling any query will optimal.

4.4) SYSTEM ANALYSIS


4.4.1) Problem identification is very first step of system analysis. The analyst meets with the customer and the end user. In this step, we are interested to understand the products objective and defined the goals required to meet the objective. After identifying overall goals, we moved towards evaluation of supplementary information during preliminary investigation. We also focused on Does the technology exit to build the system? and What bounds have been placed on costs and schedule? To perform it we scanned followings: The performance of the system The information being supplied and its form

35

The economy of processing The control of the information processing The efficiency of the existing system The security of the data & software

4.4.2) Preliminary Investigation Once the request for the information system development is received, the first system activity Preliminary Investigation begins. This activity is independent of the software-engineering paradigm. That means whether a system will be developed by means of the System Development Life Cycle (SDLC), a prototyping strategy, or the structured analysis method, or a combination of these methods, preliminary investigation must be performed first. This activity has three parts: Request Clarification Study and Approval It may be possible that the request that has been received is not clearly defined and it is difficult to figure out what for the request is. So, in that case, the person who has made the request is contacted and asked to explain the request. If the request is appropriate enough then in that case feasibility study is carried out for that request i.e. before the feasibility study, the request must be determined and defined precisely. After request clarification the feasibility study is performed. If the request for the information system is feasible in the request is approved and then starts the real analysis phase called Requirement study. The data that are collected from the organization as the part of preliminary investigation is follows three mechanisms also called Fact Finding Techniques: Reviewing existing Documents material and existing systems (web sites) Conducting Interviews and On-Site Observation. Information Content: Information content represents the individual data and control objects that constitute some larger collection of information transformed by the software. In our case the object, which is composite of a number of important pieces of data as project, package and item with its category? So the contents are defined by the necessary attributes required to create it. During the analysis of the information domain the inter relationship between objects is also defined. Information Flow: Information flow represents the manner in which data and control changes as each move through a system. Input objects are transformed into intermediate information,

36

which is further transformed to output. Here, additional information is also supplied and transformations are some engineering functions/formulae. Information Structure: Information structure represents the internal organization of various data and control items. Some queries are answered like How does information in one information structure relate to information in another structure?, Are all information contained within a single structure or are distinct structure to be used? 4.4.3) Feasibility Study: The feasibility study of any system is mainly intended to study and analyze the proposed system and to decide whether the system under consideration will be viable or not after implementation. That is it determines the usability of the project after deployment. To come to result a set of query is answered keeping the efficiency of the software and its impact on the domain for which it was developed. It main emphasis is on the following three questions elucidated below as: What are the users requirements and how does a candidate system meet them? What resources are available for the proposed systems? Is it worth solving the problem? What is the likely impact of the proposed system on the organization? I.e. how does the proposed system fit with in the organization? Thus since the feasibility study may lead to commitment of large resources, it becomes necessary that it should be conducted competently and no fundamental errors of judgment are made. Different types of feasibility study and the way we performed on our project Data Migration are enlighten below. Technical Feasibility: In technical feasibility, we study all technical issues regarding the proposed system. It is mainly concerned with the specifications of the equipments and the software, which successfully satisfies the end-users requirement. The technical needs of the system may vary accordingly but include: The feasibility to produce outputs in a given time. Response time under certain conditions. Ability to process a certain volume of the transaction at a particular speed. Facility to communicate data. Under this analysis process questions like:(i) does the compatible platform exist within our domain or can we procure it?

37

(ii) Does the proposed equipment have the technical capacity to hold the data required using the new system? Both at the development site and at server where we will be hiring the space for the website, and also the database (iii) Would it be possible to upgrade the system after it is developed and implemented, if necessary? And (iv)Would the recommended technology guarantee the reliability, accuracy and data security? This analysis process requires more emphasis on system configuration given more importance rather than the actual hardware specifications. Tools/Platform/Software 1. Platform Windows 2. The operating System Windows XP 3. Framework VISUAL STUDIO 4. Front-End Tool ADO.NET with Visual basic 5. Editing Tool MICROSOFT Visual Studio .NET 2005 6. Server IIS Windows XP Windows XP provides the core security, TCP/IP functionality and other fundamental requirement for a web operating system. Internet Information Server (IIS) Internet Information Server supports the core web server functionality. .NET Framework .NET is a framework that covers all the layers of software development from the operating system up. It provides the richest level of integration among presentation technologies, component technologies and data technologies. The entire architecture has been created to make it as easy to develop Internet applications, as it is to develop for the desktop environment. What is vb.net?? Visual Basic .NET is the next generation of Microsoft's popular Visual Basic programming languages. Some programmers refer to the new incarnation as VB 7, but this is incorrect. Visual Basic .NET is actually not backwards-compatible with VB6, meaning that code written in the old version will not compile under VB.NET. In fact, the languages are sufficiently different that many programmers consider them independent. As a language, Visual Basic.NET has the following traits: Object-Oriented

38

Visual Basic 6 included limited support for object-oriented design. Encapsulation was supported with Public and Private data types in Classes, as well as special accessor/mutator pairs called Properties (a feature unique to Visual Basic). Polymorphism received crude support through the Implements keyword, which would require that one class implement all of the methods in another, skeleton class. Inheritance was neglected completely. As of VB.NET, all of this has changed. As with all .NET languages, VB.NET includes full-blown support for object-oriented concepts, including simple inheritance. Unlike most other OOP languages, everything in VB.NET is an object, including all of the primitives (Short, Integer, Long, String, Boolean, etc.) as well as types, events, and even assemblies. Everything inherits from the Object base class. Event-Driven All previous versions of Visual Basic were event-driven, but this feature is heavily enhanced under the .NET framework. Events are no longer recognized because they use a certain naming convention (ObjectName_EventName), but now are declared with a Handles ObjectName.EventName clause. Event handlers can also be declared at runtime using the AddHandler command. .NET Framework As the name implies, VB.NET runs on top of Microsoft's .NET framework, meaning the language has full access to all of the supporting classes in the framework. It's also possible to run VB.NET programs on top of Mono, the open-source alternative to .NET, not only under Windows, but even Linux or Mac OSX. The CLR provides complete set of managed data access API for data-intensive application development. These API help to abstract the data and present it in a consistent way regardless of its actual source. A connection represents a physical connection to some data store, such as SQL Server or an XML file through ADO.NET As we know that the data base is repository for stored, operational data in a database environment and common data are available and used by several users. Instead of each program to manage its own data, the data across applications are shared by all authorized users with the help of database software managing the database entity. In this way, S.Q.L server 2000 is one of the leading R.D.B.M.S software in the world. It is characterized by the quick retrieval of information from huge tables. This quality allows it to cater to the ever-changing business needs of the present age. It support fourth generation language, SQL, thereby making it easier for the customers to grasp it, a development language where complicated, functions etc. can be used.

39

In this way, S.Q.L server 2000 include following features: Queries Constrains Procedures Triggers Batch implementation Functions Bul copy utility Cursors Stored procedures Economical Feasibility: Economic feasibility is the most frequently used technique for evaluating the effectiveness of the proposed system. More commonly known as cost/benefit analysis, the procedure is to determine the benefits and savings that are expected from the proposed system and compare them with the costs. If the benefits outweigh costs, a decision is taken to design and implement the system otherwise further justification or the alternative in the proposed system will have to be made if it is to have a chance of being approved. This outgoing effort improves in accuracy at each phase of the system development life cycle. Classification of Costs & Benefits: The various cost expected to incur & benefit expected to realize are given below. Tangible or Intangible Costs & Benefits: Tangibility refers to the ease with which costs or benefits can be measured. An outlay of cash for a specific item or activity is referred to as a tangible cost. The purchases of hardware or software, personnel training are examples of tangible costs. They are readily identified and measured. Costs that are known to exist but whose financial value cannot be accurately measured are referred to as an intangible costs. Benefits are also classified as tangible or intangible. Like costs, they are often difficult to specify accurately. Tangible benefits such as saving of material cost are quantifiable. Intangible benefits such as improved institution image is also taken into account in the system evaluation process. Direct or Indirect Costs & Benefits: Direct costs are those with which a monetary figure can be directly associated in a project. They are applied directly to the operation. Direct benefits can also be specified to the given project. Indirect costs are the results of operation that are not directly associated with the given system or activity. They are often referred to as overhead. Light, air conditioning,

40

maintenance, protection of the computer center is all tangible costs, but it is difficult to determine the proportion of each attribute to a specific activity. Indirect benefits are realized as a by-product of another activity or system. Fixed and Variable Costs and Benefits: Some costs and benefits are constant, regardless of how well a system is used. They are constant and do not change. Once encountered they will not reappear. In contrast, variable costs are incurred on a regular basis. They are proportion to work volume and continue as long as is in operation. For example, the cost of printer paper and cartridge. Fixed benefits are also constant and do not change. The variable benefits, on the other hand, are realized on a regular basis. For example, the system will save several hours of employees in preparing each report, which otherwise was prepared manually. Another examples are error free data entry, help about different topics and ease of use. Operational Feasibility: Proposed projects are beneficial only if they can be turned into information system that will meet the operating requirements for which they are designed and developed. It is mainly related to human organizational and political aspects. People are resistant to change and computers have been known to facilitate change. Findings of operational feasibility analysis can be summarized as given below: Since the users of our site are million of citizen who use it for information retrieval. So their will be many who will be benefited with this project End users are always welcome to have the technical support on the site.

4.5) CODING
accessFrm.vb :
Public Class accessFrm Dim pos As Integer Dim substr As String Dim atitlee As String = "Access Login" Dim atch() As Char = atitlee.ToCharArray() Dim ai As Integer = 0 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try If (flagg = 1) Then pos = TextBox1.Text.LastIndexOf(".")

41

Source=" +

Source=" + Source=" + Password="

Source=" +

Source=" + Source=" + Password="

substr = TextBox1.Text.Substring(pos + 1) If (substr = "accdb") Then If (TextBox2.Text = "" And TextBox3.Text = "") Then constring = "Provider=Microsoft.ACE.OLEDB.12.0;Data TextBox1.Text Else If (TextBox2.Text = "") Then constring = "Provider=Microsoft.ACE.OLEDB.12.0;Data TextBox1.Text + ";ACE OLEDB:Database Password=" + TextBox3.Text Else constring = "Provider=Microsoft.ACE.OLEDB.12.0;Data TextBox1.Text + ";User ID=" + TextBox2.Text + ";ACE OLEDB:Database + TextBox3.Text End If End If ocon.ConnectionString = constring ocon.Open() MsgBox("Connection open") ocon.Close() ElseIf (substr = "mdb") Then If (TextBox2.Text = "" And TextBox3.Text = "") Then constring = "Provider=Microsoft.Jet.OLEDB.4.0;Data TextBox1.Text Else If (TextBox2.Text = "") Then constring = "Provider=Microsoft.Jet.OLEDB.4.0;Data TextBox1.Text + ";Jet OLEDB:Database Password=" + TextBox3.Text Else constring = "Provider=Microsoft.Jet.OLEDB.4.0;Data TextBox1.Text + ";User ID=" + TextBox2.Text + ";Jet OLEDB:Database + TextBox3.Text End If End If ocon.ConnectionString = constring ocon.Open() MsgBox("Connection open") ocon.Close() Else

MsgBox("Unrecognized database") End If ElseIf (flagg = 2) Then pos = TextBox1.Text.LastIndexOf(".") substr = TextBox1.Text.Substring(pos + 1) If (substr = "accdb") Then If (TextBox2.Text = "" And TextBox3.Text = "") Then constring1 = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + TextBox1.Text Else If (TextBox2.Text = "") Then access_file_nm_pass = TextBox3.Text constring1 = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + TextBox1.Text + ";ACE OLEDB:Database Password=" + TextBox3.Text Else access_file_nm_pass = TextBox3.Text

42

constring1 = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + TextBox1.Text + ";User ID=" + TextBox2.Text + ";ACE OLEDB:Database Password=" + TextBox3.Text End If End If docon.ConnectionString = constring1 docon.Open() MsgBox("Connection open") dcon.Close() ElseIf (substr = "mdb") Then If (TextBox2.Text = "" And TextBox3.Text = "") Then constring1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + TextBox1.Text Else If (TextBox2.Text = "") Then access_file_nm_pass = TextBox3.Text constring1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + TextBox1.Text + ";Jet OLEDB:Database Password=" + TextBox3.Text Else access_file_nm_pass = TextBox3.Text constring1 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + TextBox1.Text + ";User ID=" + TextBox2.Text + ";Jet OLEDB:Database Password=" + TextBox3.Text End If End If docon.ConnectionString = constring1 docon.Open() MsgBox("Connection open") dcon.Close() Else MsgBox("Unrecognized database") End If End If 'MsgBox(access_file_nm_pass) Catch ex As Exception MsgBox("Failed to create connection") ocon.Close() dcon.Close() End Try End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click diares = openmdb.ShowDialog(Me) If (diares = Windows.Forms.DialogResult.OK) Then TextBox1.Text = openmdb.FileName Else TextBox1.Text = "" End If End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click If (flagg = 1) Then frmFirst.TextBox1.Text = TextBox1.Text

43

Else frmFirst.TextBox2.Text = TextBox1.Text End If Me.Close() End Sub Private Sub accessFrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" Me.Text = "" End Sub Private Sub atitle_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles atitle.Tick If (ai < atitlee.Length) Then Me.Text = Me.Text + atch(ai) ai = ai + 1 Else ai = 0 Me.Text = "" End If End Sub End Class

accessFrm.Designer.vb :
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class accessFrm Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container

44

Me.Label1 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.Button1 = New System.Windows.Forms.Button Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.TextBox3 = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.TextBox2 = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.Button2 = New System.Windows.Forms.Button Me.openmdb = New System.Windows.Forms.OpenFileDialog Me.Button3 = New System.Windows.Forms.Button Me.atitle = New System.Windows.Forms.Timer(Me.components) Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(16, 28) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(159, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Select Database File Name" ' 'TextBox1 ' Me.TextBox1.BackColor = System.Drawing.Color.White Me.TextBox1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox1.Location = New System.Drawing.Point(181, 25) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(197, 24) Me.TextBox1.TabIndex = 1 ' 'Button1 ' Me.Button1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(388, 18) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(99, 33) Me.Button1.TabIndex = 2 Me.Button1.Text = "Browse" Me.Button1.UseVisualStyleBackColor = True ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.TextBox3) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.TextBox2) Me.GroupBox1.Controls.Add(Me.Label2)

45

Me.GroupBox1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox1.Location = New System.Drawing.Point(41, 74) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(424, 143) Me.GroupBox1.TabIndex = 3 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Log on to the Database" ' 'TextBox3 ' Me.TextBox3.BackColor = System.Drawing.Color.White Me.TextBox3.Location = New System.Drawing.Point(139, 97) Me.TextBox3.Name = "TextBox3" Me.TextBox3.PasswordChar = Global.Microsoft.VisualBasic.ChrW(35) Me.TextBox3.Size = New System.Drawing.Size(198, 24) Me.TextBox3.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(27, 103) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(62, 17) Me.Label3.TabIndex = 2 Me.Label3.Text = "Password" ' 'TextBox2 ' Me.TextBox2.BackColor = System.Drawing.Color.White Me.TextBox2.Location = New System.Drawing.Point(139, 45) Me.TextBox2.Name = "TextBox2" Me.TextBox2.Size = New System.Drawing.Size(198, 24) Me.TextBox2.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(26, 48) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(72, 17) Me.Label2.TabIndex = 0 Me.Label2.Text = "User Name" ' 'Button2 ' Me.Button2.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button2.Location = New System.Drawing.Point(160, 234) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(138, 32) Me.Button2.TabIndex = 4 Me.Button2.Text = "Test Connection" Me.Button2.UseVisualStyleBackColor = True '

46

'openmdb ' Me.openmdb.Filter = "Access 2000-2003|*.mdb|Acess 2007|*.accdb" ' 'Button3 ' Me.Button3.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button3.Location = New System.Drawing.Point(329, 234) Me.Button3.Name = "Button3" Me.Button3.Size = New System.Drawing.Size(136, 31) Me.Button3.TabIndex = 5 Me.Button3.Text = "Close" Me.Button3.UseVisualStyleBackColor = True ' 'atitle ' Me.atitle.Enabled = True ' 'accessFrm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(218, Byte), Integer), CType(CType(226, Byte), Integer), CType(CType(250, Byte), Integer)) Me.ClientSize = New System.Drawing.Size(501, 277) Me.Controls.Add(Me.Button3) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Label1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.MaximizeBox = False Me.Name = "accessFrm" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.Text = "Access Login" Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents End Class Label1 As System.Windows.Forms.Label TextBox1 As System.Windows.Forms.TextBox Button1 As System.Windows.Forms.Button GroupBox1 As System.Windows.Forms.GroupBox Label2 As System.Windows.Forms.Label TextBox3 As System.Windows.Forms.TextBox Label3 As System.Windows.Forms.Label TextBox2 As System.Windows.Forms.TextBox Button2 As System.Windows.Forms.Button openmdb As System.Windows.Forms.OpenFileDialog Button3 As System.Windows.Forms.Button atitle As System.Windows.Forms.Timer

47

accessToaccess.vb :
Imports System.Data.SqlClient Imports Microsoft.SqlServer.Management.Common Imports System.Data.OleDb Imports Microsoft.SqlServer.Management.Smo Imports Microsoft.SqlServer.Server Imports Microsoft.SqlServer.Management Public Class accessToaccess Dim substr As String Dim pos As Integer Public Function accessAccess() As Boolean flag = 0 Dim table_name, dtable_name As String Try 'Source table name table_name = frmFirst.ComboBox3.SelectedItem.ToString() 'Destination Access Connection ' pos = frmFirst.TextBox2.Text.LastIndexOf(".") ' substr = frmFirst.TextBox2.Text.Substring(pos + 1) 'If (substr = "accdb") Then ' ocon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + frmFirst.TextBox2.Text 'ElseIf (substr = "mdb") Then ' ocon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + frmFirst.TextBox2.Text 'Else ' MsgBox("Unrecognized database") 'End If If Not (ocon.State = ConnectionState.Open) Then docon.Open() End If If Not (ocon.State = ConnectionState.Open) Then ocon.Open() End If 'MsgBox("Connection open") Dim ob() As Object = {vbNullString, vbNullString, vbNullString, "TABLE"} odt = docon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, ob) i = 0 For Each row As DataRow In odt.Rows tab_ex(i) = row("Table_Name").ToString() 'If (row("Table_Name").ToString().Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then ' flag = 1 ' Exit For 'End If

48

i = i + 1 Next j = 0 dtable_name = table_name While (j < i) If (tab_ex(j).Equals(dtable_name, StringComparison.OrdinalIgnoreCase)) Then dtable_name = InputBox("Table is allready exists Please give another name") j = -1 End If j = j + 1 End While 'If (flag = 1) Then ' dtable_name = InputBox("Table is allready exists Please give another name") 'Else ' dtable_name = table_name 'End If 'Source Access Connection 'ocon.Open() 'MsgBox("Connection open") If Not dtable_name = "" Then If access_file_nm_pass = "" Then docmd = New OleDbCommand("SELECT * INTO [MS Access;DATABASE=" + frmFirst.TextBox2.Text + ";].[" + dtable_name + "] FROM " + table_name, ocon) Else 'MsgBox(access_file_nm_pass) docmd = New OleDbCommand("SELECT * INTO [MS Access;DATABASE=" + frmFirst.TextBox2.Text + ";PWD=" + access_file_nm_pass + ";].[" + dtable_name + "] FROM " + table_name, ocon) End If 'docmd = New OleDbCommand("SELECT * INTO [" + constring1 + ";].[" + dtable_name + "] FROM " + table_name, ocon) docmd.ExecuteNonQuery() End If ocon.Close() docon.Close() access_file_nm_pass = "" Catch ex As Exception MsgBox("Error to migrate data") End Try End Function End Class

accessTooracle.vb :

49

Imports Imports Imports Imports Imports Imports Imports

System.Data.OleDb System.Data.OracleClient Microsoft.SqlServer.Management.Smo Microsoft.SqlServer.Server Microsoft.SqlServer.Management System.Data.SqlClient Microsoft.SqlServer.Management.Common

Public Class accessTooracle Public Function accessOracle() As Boolean flag = 0 Dim table_name, dtable_name As String 'Try 'Source table name table_name = frmFirst.ComboBox3.SelectedItem.ToString() 'Connection of oracle to check table is exists or not If (soracon.State = ConnectionState.Closed) Then soracon.Open() End If oracmd = New OracleCommand("Select Table_Name from cat where Table_Type='TABLE'", soracon) orareader = oracmd.ExecuteReader() i = 0 While (orareader.Read()) 'If (orareader(0).ToString().ToUpper() = table_name.ToUpper()) Then 'flag = 1 'Exit While tab_ex(i) = orareader(0).ToString() i = i + 1 'End If End While j = 0 While (j < i) If (tab_ex(j).Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then table_name = InputBox("Table is allready exists Please give another name") j = -1 End If j = j + 1 End While 'If (flag = 1) Then ' table_name = InputBox("Table is already exists please enter another table name") 'End If 'Connection for access to copy table structure If (ocon.State = ConnectionState.Closed) Then ocon.Open() End If oda = New OleDbDataAdapter("Select * from " + frmFirst.ComboBox3.Text, ocon) ods = New DataSet(frmFirst.ComboBox3.Text)

50

ods.Clear() oda.Fill(ods, frmFirst.ComboBox3.Text) odt = ods.Tables(frmFirst.ComboBox3.Text) i = 0 For Each dc As DataColumn In odt.Columns sttt(i, 0) = dc.ColumnName Select Case dc.DataType.ToString() Case ("System.Decimal") sttt(i, 1) = DataType.Decimal(2, 18).ToString() Case ("System.String") sttt(i, 1) = "VarChar2(4000)" Case ("System.Int32") sttt(i, 1) = "Number" Case ("System.DateTime") sttt(i, 1) = "Date" Case ("System.Boolean") sttt(i, 1) = "varchar2(5)" Case ("System.Byte[]") sttt(i, 1) = "BLOB" End Select i = i + 1 Next 'Connection of oracle to create table j = i - 1 'MsgBox(sttt(0, 0) + " and " + sttt(0, 1)) oracmd = New OracleCommand("create table " + table_name + "(" + sttt(0, 0).ToString() + " " + sttt(0, 1).ToString() + ")", soracon) oracmd.ExecuteNonQuery() i = 1 While (i <= j) 'MsgBox("alter table " + table_name + " add(" + sttt(i, 0).ToString() + " " + sttt(i, 1).ToString() + ")") oracmd = New OracleCommand("alter table " + table_name + " add(" + sttt(i, 0).ToString() + " " + sttt(i, 1).ToString() + ")", soracon) oracmd.ExecuteNonQuery() i = i + 1 End While 'Connection for access to copy data oda = New OleDbDataAdapter("Select * from " + frmFirst.ComboBox3.Text, ocon) ods.Clear() oda.Fill(ods, frmFirst.ComboBox3.Text) odt = ods.Tables(frmFirst.ComboBox3.Text) rcnt = odt.Rows.Count ccnt = odt.Columns.Count 'Connection to paste record in oracle table orada = New OracleDataAdapter("select * from " + table_name, soracon) orads = New DataSet(table_name) orads.Clear() orada.Fill(orads, table_name) oradt = orads.Tables(table_name) oracmb = New OracleCommandBuilder(orada) i = 0

51

j = 0 While (i < rcnt) odr = odt.Rows(i) oradr = oradt.NewRow() While (j < ccnt) oradr(j) = odr(j) j = j + 1 End While i = i + 1 oradt.Rows.Add(oradr) orada.Update(orads, table_name) End While 'Catch ex As Exception ' MsgBox("Error to migrate data") 'End Try End Function End Class

accessTosql.vb :
Imports Microsoft.SqlServer.Management.Smo Imports Microsoft.SqlServer.Server Imports Microsoft.SqlServer.Management Imports System.Data.SqlClient Imports Microsoft.SqlServer.Management.Common Imports System.Data.OleDb Public Class accessTosql Public Function accessSql() As Boolean flag = 0 Try 'Connection for destination table smo_server_con = New ServerConnection(con) smo_server = New Server(smo_server_con) smo_db = smo_server.Databases(frmFirst.ComboBox5.SelectedItem.ToString()) str = frmFirst.ComboBox3.SelectedItem.ToString().Trim() smo_table = New Table(smo_db, frmFirst.ComboBox3.SelectedItem.ToString()) i = 0 For Each smo_table In smo_db.Tables 'If (smo_table.Name.Equals(frmFirst.ComboBox3.SelectedItem.ToString().Trim())) Then ' flag = 1 ' Exit For 'End If tab_ex(i) = smo_table.Name i = i + 1

52

Next j = 0 While (j < i) If (tab_ex(j).Equals(str, StringComparison.OrdinalIgnoreCase)) Then str = InputBox("Given table is allready exists in destination table enter another name") j = -1 smo_table = New Table(smo_db, str) End If j = j + 1 End While 'If (flag = 1) Then ' str = InputBox("Given table is allready exists in destination table enter another name") ' 'MsgBox(str) ' smo_table = New Table(smo_db, str) 'ElseIf (flag = 0) Then ' smo_table = New Table(smo_db, frmFirst.ComboBox3.SelectedItem.ToString()) 'End If 'con.Open() 'Connection for source table If Not smo_table.Name = "" Then 'ocon.ChangeDatabase(frmFirst.ComboBox2.SelectedItem.ToString()) If (ocon.State = ConnectionState.Closed) Then ocon.Open() End If ods = New DataSet(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) oda = New OleDbDataAdapter("select * from " + frmFirst.ComboBox3.SelectedItem.ToString().Trim(), ocon) oda.Fill(ods, frmFirst.ComboBox3.SelectedItem.ToString().Trim()) odt = ods.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) 'Connection for source table to copy table structure Dim smo_ta As New Table 'smo_ddb = smo_server.Databases(frmFirst.ComboBox2.SelectedItem.ToString()) 'smo_ta = smo_ddb.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) Dim a As DataType For Each dc As DataColumn In odt.Columns Select Case dc.DataType.ToString() Case ("System.Decimal") a = DataType.Decimal(2, 18) Case ("System.String") a = DataType.Text Case ("System.Int32")

53

a = DataType.Int Case ("System.DateTime") a = DataType.DateTime Case ("System.Boolean") a = DataType.Bit Case ("System.Byte[]") a = DataType.Image End Select Dim col As New Column(smo_table, dc.ColumnName, a) smo_table.Columns.Add(col) Next smo_table.Create() Dim sqlbulk As New SqlBulkCopy(con) Using con Using sqlbulk sqlbulk.DestinationTableName = "dbo." + smo_table.Name Try sqlbulk.WriteToServer(odt) Catch ex As Exception MsgBox("Error to copy data") End Try End Using End Using End If ocon.Close() Catch ex As Exception 'MsgBox("Error to create table" & ex.StackTrace) MsgBox("Error to migrate data") 'con.Close() End Try End Function End Class

All.vb :
Imports System.Data.SqlClient Imports System.Data.OleDb Imports Microsoft.SqlServer.Management.Common Imports Microsoft.SqlServer.Server Imports Microsoft.SqlServer.Management.Smo Imports System.Data.OracleClient Module all Public diares As DialogResult Public sttt(100, 2) As String Public tab_ex(100) As String Public i, j, rcnt, ccnt, flag, flagg As Integer Public sa, str, constring, constring1, access_file_nm_pass As String Public con, dcon As New SqlConnection()

54

Public Public Public Public Public Public Public Public Public Public

cmd As New SqlCommand reader As SqlDataReader sds, ods, dods As DataSet sdt, odt, dodt As DataTable sdr, odr, dodr As DataRow da As SqlDataAdapter smo_server As Server smo_db, smo_ddb As Database smo_server_con As ServerConnection smo_table As Table

'Access database variables Public ocon, docon As New OleDbConnection() Public oda, doda As OleDbDataAdapter Public ocmb, docmb As OleDbCommandBuilder Public ocmd, docmd As New OleDbCommand Public oreader, doreader As OleDbDataReader 'Oracle database variables Public oracon, soracon As New OracleConnection() Public oracmd, doracmd As New OracleCommand Public orareader As OracleDataReader Public orada As New OracleDataAdapter Public orads As New DataSet Public oradt As DataTable Public oradr As DataRow Public oracmb As New OracleCommandBuilder End Module

frmFirst.Designer.vb :
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class frmFirst Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer

55

'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.Label1 = New System.Windows.Forms.Label Me.ComboBox1 = New System.Windows.Forms.ComboBox Me.ComboBox2 = New System.Windows.Forms.ComboBox Me.Label2 = New System.Windows.Forms.Label Me.ComboBox3 = New System.Windows.Forms.ComboBox Me.Button2 = New System.Windows.Forms.Button Me.TextBox1 = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.GroupBox2 = New System.Windows.Forms.GroupBox Me.TextBox2 = New System.Windows.Forms.TextBox Me.ComboBox5 = New System.Windows.Forms.ComboBox Me.Label5 = New System.Windows.Forms.Label Me.ComboBox4 = New System.Windows.Forms.ComboBox Me.Label4 = New System.Windows.Forms.Label Me.Button5 = New System.Windows.Forms.Button Me.nextbut = New System.Windows.Forms.Timer(Me.components) Me.back = New System.Windows.Forms.Timer(Me.components) Me.title = New System.Windows.Forms.Timer(Me.components) Me.GroupBox1.SuspendLayout() Me.GroupBox2.SuspendLayout() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Location = New System.Drawing.Point(25, 29) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(114, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Select Data Source" ' 'ComboBox1 ' Me.ComboBox1.FormattingEnabled = True Me.ComboBox1.Items.AddRange(New Object() {"SQL Server", "MS Access", "Oracle"}) Me.ComboBox1.Location = New System.Drawing.Point(139, 24) Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(308, 25) Me.ComboBox1.TabIndex = 1 ' 'ComboBox2 ' Me.ComboBox2.FormattingEnabled = True Me.ComboBox2.Location = New System.Drawing.Point(136, 69) Me.ComboBox2.Name = "ComboBox2" Me.ComboBox2.Size = New System.Drawing.Size(309, 25) Me.ComboBox2.TabIndex = 2 ' 'Label2 '

56

Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(27, 72) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(99, 17) Me.Label2.TabIndex = 3 Me.Label2.Text = "Select Database" ' 'ComboBox3 ' Me.ComboBox3.FormattingEnabled = True Me.ComboBox3.Location = New System.Drawing.Point(137, 121) Me.ComboBox3.Name = "ComboBox3" Me.ComboBox3.Size = New System.Drawing.Size(310, 25) Me.ComboBox3.TabIndex = 4 ' 'Button2 ' Me.Button2.BackColor = System.Drawing.Color.WhiteSmoke Me.Button2.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button2.Location = New System.Drawing.Point(331, 443) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(161, 38) Me.Button2.TabIndex = 6 Me.Button2.Text = "Migrate" Me.Button2.UseVisualStyleBackColor = False ' 'TextBox1 ' Me.TextBox1.Location = New System.Drawing.Point(137, 70) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(290, 24) Me.TextBox1.TabIndex = 9 Me.TextBox1.Visible = False ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(26, 125) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(76, 17) Me.Label3.TabIndex = 10 Me.Label3.Text = "Select Table" ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.TextBox1) Me.GroupBox1.Controls.Add(Me.ComboBox2) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.Label1) Me.GroupBox1.Controls.Add(Me.ComboBox1) Me.GroupBox1.Controls.Add(Me.Label2) Me.GroupBox1.Controls.Add(Me.ComboBox3) Me.GroupBox1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))

57

Me.GroupBox1.Location = New System.Drawing.Point(26, 50) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(466, 168) Me.GroupBox1.TabIndex = 11 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Source Database" ' 'GroupBox2 ' Me.GroupBox2.Controls.Add(Me.TextBox2) Me.GroupBox2.Controls.Add(Me.ComboBox5) Me.GroupBox2.Controls.Add(Me.Label5) Me.GroupBox2.Controls.Add(Me.ComboBox4) Me.GroupBox2.Controls.Add(Me.Label4) Me.GroupBox2.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox2.Location = New System.Drawing.Point(28, 286) Me.GroupBox2.Name = "GroupBox2" Me.GroupBox2.Size = New System.Drawing.Size(464, 134) Me.GroupBox2.TabIndex = 12 Me.GroupBox2.TabStop = False Me.GroupBox2.Text = "Destination Database" ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(138, 82) Me.TextBox2.Name = "TextBox2" Me.TextBox2.Size = New System.Drawing.Size(285, 24) Me.TextBox2.TabIndex = 4 Me.TextBox2.Visible = False ' 'ComboBox5 ' Me.ComboBox5.FormattingEnabled = True Me.ComboBox5.Location = New System.Drawing.Point(137, 82) Me.ComboBox5.Name = "ComboBox5" Me.ComboBox5.Size = New System.Drawing.Size(305, 25) Me.ComboBox5.TabIndex = 3 ' 'Label5 ' Me.Label5.AutoSize = True Me.Label5.Location = New System.Drawing.Point(20, 87) Me.Label5.Name = "Label5" Me.Label5.Size = New System.Drawing.Size(99, 17) Me.Label5.TabIndex = 2 Me.Label5.Text = "Select Database" ' 'ComboBox4 ' Me.ComboBox4.FormattingEnabled = True Me.ComboBox4.Items.AddRange(New Object() {"SQL Server", "Oracle", "MS Access"}) Me.ComboBox4.Location = New System.Drawing.Point(138, 22) Me.ComboBox4.Name = "ComboBox4" Me.ComboBox4.Size = New System.Drawing.Size(305, 25)

58

Me.ComboBox4.TabIndex = 1 ' 'Label4 ' Me.Label4.AutoSize = True Me.Label4.Location = New System.Drawing.Point(13, 26) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(114, 17) Me.Label4.TabIndex = 0 Me.Label4.Text = "Select Data Source" ' 'Button5 ' Me.Button5.BackColor = System.Drawing.Color.WhiteSmoke Me.Button5.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button5.Location = New System.Drawing.Point(367, 241) Me.Button5.Name = "Button5" Me.Button5.Size = New System.Drawing.Size(125, 30) Me.Button5.TabIndex = 13 Me.Button5.Text = "Next >>" Me.Button5.UseVisualStyleBackColor = False ' 'nextbut ' Me.nextbut.Interval = 1 ' 'back ' Me.back.Interval = 1 ' 'title ' Me.title.Enabled = True Me.title.Interval = 5000 ' 'frmFirst ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(218, Byte), Integer), CType(CType(226, Byte), Integer), CType(CType(250, Byte), Integer)) Me.ClientSize = New System.Drawing.Size(530, 537) Me.Controls.Add(Me.Button5) Me.Controls.Add(Me.GroupBox2) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.Button2) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.Location = New System.Drawing.Point(350, 50) Me.MaximizeBox = False Me.Name = "frmFirst" Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.GroupBox2.ResumeLayout(False) Me.GroupBox2.PerformLayout()

59

Me.ResumeLayout(False) End Sub Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents End Class Label1 As System.Windows.Forms.Label ComboBox1 As System.Windows.Forms.ComboBox ComboBox2 As System.Windows.Forms.ComboBox Label2 As System.Windows.Forms.Label ComboBox3 As System.Windows.Forms.ComboBox Button2 As System.Windows.Forms.Button TextBox1 As System.Windows.Forms.TextBox Label3 As System.Windows.Forms.Label GroupBox1 As System.Windows.Forms.GroupBox GroupBox2 As System.Windows.Forms.GroupBox Button5 As System.Windows.Forms.Button nextbut As System.Windows.Forms.Timer back As System.Windows.Forms.Timer Label4 As System.Windows.Forms.Label ComboBox4 As System.Windows.Forms.ComboBox ComboBox5 As System.Windows.Forms.ComboBox Label5 As System.Windows.Forms.Label TextBox2 As System.Windows.Forms.TextBox title As System.Windows.Forms.Timer

frmFirst.vb :
Imports System.Data.SqlClient Imports Microsoft.SqlServer.Management Imports Microsoft.SqlServer.Management.Smo Imports Microsoft.SqlServer.Management.Common Imports Microsoft.SqlServer.Server Imports System.Data.OleDb Imports System.Data.OracleClient Public Class frmFirst Dim db_name As String Dim substr As String Dim pos As Integer Dim col As New Column() Dim scon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\student.mdb") Dim titlee As String = "Data Migration" Dim tch() As Char = titlee.ToCharArray() Dim ii As Integer = 0 Private Sub frmFirst_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Height = 320 TextBox2.Text = "Text1" 'title.Enabled = True End Sub

60

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Try ComboBox2.Items.Clear() If (ComboBox1.Text.Equals("SQL Server")) Then flagg = 1 sqlfrm.ShowDialog(Me) ComboBox2.Items.Clear() ComboBox3.Items.Clear() ElseIf (ComboBox1.SelectedItem.ToString() = "MS Access") Then flagg = 1 ComboBox2.Items.Clear() ComboBox3.Items.Clear() ComboBox2.Items.Add("<Browse.....For Database>") ElseIf (ComboBox1.Text.Equals("Oracle")) Then flagg = 1 oracleFrm.ShowDialog(Me) ComboBox2.Items.Clear() ComboBox3.Items.Clear() ComboBox2.Items.Add(str) End If ComboBox2.Text = "" ComboBox3.Text = "" TextBox1.Visible = False 'openmdb.FileName = "" Catch ex As Exception End Try End Sub

Private Sub ComboBox2_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox2.DropDown Try If (ComboBox1.SelectedItem.ToString() = "MS Access") Then ComboBox3.Text = "" ElseIf (ComboBox1.SelectedItem.ToString() = "SQL Server") Then ComboBox2.Items.Clear() TextBox1.Visible = False con.ConnectionString = constring con.Open() cmd.Connection = con cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "sp_databases" reader = cmd.ExecuteReader() ComboBox2.Items.Clear() While (reader.Read()) 'MsgBox(reader.GetString(0)) ComboBox2.Items.Add(reader.GetString(0)) End While con.Close() End If Catch ex As Exception

61

MsgBox("Error to loading Databases") con.Close() End Try End Sub Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged flagg = 1 Try If (ComboBox1.SelectedItem.ToString() = "MS Access") Then TextBox1.Visible = True If (ComboBox2.SelectedItem.ToString() = "<Browse.....For Database>") Then accessFrm.ShowDialog(Me) ' access_file_nm = openmdb.FileName ' TextBox1.Text = access_file_nm flag = 0 Dim table_name As String 'Try 'Access Connection ocon.Open() Dim ob() As Object = {vbNullString, vbNullString, vbNullString, "TABLE"} odt = ocon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, ob) ComboBox3.Items.Clear() For Each row As DataRow In odt.Rows ComboBox3.Items.Add(row("Table_Name").ToString()) Next End If ElseIf (ComboBox1.SelectedItem.ToString() = "SQL Server") Then TextBox1.Visible = False con.Open() con.ChangeDatabase(ComboBox2.SelectedItem.ToString()) cmd.Connection = con cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "sp_tables" reader = cmd.ExecuteReader() ComboBox3.Items.Clear() ComboBox3.Text = "" While (reader.Read()) 'MsgBox(reader.GetString(0)) If (reader.GetString(0).Equals(ComboBox2.SelectedItem.ToString()) And reader.GetString(3).Equals("TABLE")) Then ComboBox3.Items.Add(reader.GetString(2)) End If End While con.Close() ElseIf (ComboBox1.SelectedItem.ToString() = "Oracle") Then If (oracon.State = ConnectionState.Closed) Then oracon.Open() End If oracmd = New OracleCommand("Select Table_Name from User_Tables order by Table_Name", oracon) orareader = oracmd.ExecuteReader() While (orareader.Read())

62

ComboBox3.Items.Add(orareader(0)) End While oracon.Close() End If Catch ex As Exception 'MsgBox("Failed to change database") 'con.Close() End Try End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try If (ComboBox4.Text = "" Or ComboBox5.Text = "" Or TextBox2.Text = "") Then MsgBox("Fill all required values") Else If (ComboBox1.SelectedItem.ToString() = "SQL Server" And ComboBox4.SelectedItem.ToString() = "SQL Server") Then Dim stq As New sqlTosql stq.sqlcon() ElseIf (ComboBox1.SelectedItem.ToString() = "SQL Server" And ComboBox4.SelectedItem.ToString() = "MS Access") Then Dim sta As New sqlToaccess sta.sqlAccess() ElseIf (ComboBox1.SelectedItem.ToString() = "MS Access" And ComboBox4.SelectedItem.ToString() = "MS Access") Then Dim a As New accessToaccess a.accessAccess() ElseIf (ComboBox1.SelectedItem.ToString() = "MS Access" And ComboBox4.SelectedItem.ToString() = "SQL Server") Then Dim a As New accessTosql a.accessSql() ElseIf (ComboBox1.SelectedItem.ToString() = "Oracle" And ComboBox4.SelectedItem.ToString() = "MS Access") Then Dim oa As New oracleToAccess oa.oracleAccess() ElseIf (ComboBox1.SelectedItem.ToString() = "Oracle" And ComboBox4.SelectedItem.ToString() = "SQL Server") Then Dim os As New oracleTosql os.oracleSql() ElseIf (ComboBox1.SelectedItem.ToString() = "MS Access" And ComboBox4.SelectedItem.ToString() = "Oracle") Then Dim mo As New accessTooracle mo.accessOracle() ElseIf (ComboBox1.SelectedItem.ToString() = "SQL Server" And ComboBox4.SelectedItem.ToString() = "Oracle") Then Dim so As New sqlTooracle so.sqlOracle() ElseIf (ComboBox1.SelectedItem.ToString() = "Oracle" And ComboBox4.SelectedItem.ToString() = "Oracle") Then Dim oo As New oracleTooracle

63

oo.oracleOracle() End If End If 'MsgBox("Data Migrated") Catch ex As Exception 'MsgBox("Error to migrate date") End Try End Sub Public Function getdatatype(ByVal datatyp As String) As DataType Dim dtype As DataType Select Case datatyp Case ("System.Decimal") dtype = DataType.Decimal(2, 18) Case ("System.String") dtype = DataType.Char(50) Case ("System.Int32") dtype = DataType.Int Return dtype End Select End Function

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Try If (Button5.Text = "Next >>") Then If Not (ComboBox1.Text = "" Or ComboBox2.Text = "" Or ComboBox3.Text = "") Then back.Enabled = False nextbut.Enabled = True End If If (ComboBox1.Text = "") Then MsgBox("Please select data source") ElseIf (ComboBox2.Text = "") Then MsgBox("Please select database") ElseIf (ComboBox3.Text = "") Then MsgBox("Please select source table") End If Else nextbut.Enabled = False back.Enabled = True End If Catch ex As Exception End Try End Sub

64

Private Sub nextbut_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles nextbut.Tick If (Me.Height <= 569) Then Me.Height = Me.Height + 10 Else Button5.Text = "<< Back" End If End Sub Private Sub back_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles back.Tick If (Me.Height >= 320) Then Me.Height = Me.Height - 10 Else Button5.Text = "Next >>" End If End Sub Private Sub ComboBox4_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox4.SelectedIndexChanged Try ComboBox5.Items.Clear() If (ComboBox4.Text.Equals("SQL Server")) Then flagg = 2 sqlfrm.ShowDialog(Me) ComboBox5.Items.Clear() ElseIf (ComboBox4.SelectedItem.ToString() = "MS Access") Then flagg = 2 ComboBox5.Items.Clear() ComboBox5.Items.Add("<Browse.....For Database>") ElseIf (ComboBox4.SelectedItem.ToString() = "Oracle") Then flagg = 2 oracleFrm.ShowDialog(Me) ComboBox5.Items.Clear() ComboBox5.Items.Add(str) End If ComboBox5.Text = "" TextBox2.Visible = False access_file_nm_pass = "" 'openmdb.FileName = "" Catch ex As Exception End Try End Sub Private Sub ComboBox5_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox5.DropDown Try If (ComboBox4.SelectedItem.ToString() = "MS Access") Then ElseIf (ComboBox4.SelectedItem.ToString() = "SQL Server") Then ComboBox5.Items.Clear() TextBox2.Visible = False con.ConnectionString = constring con.Open() cmd.Connection = con

65

cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "sp_databases" reader = cmd.ExecuteReader() ComboBox5.Items.Clear() While (reader.Read()) 'MsgBox(reader.GetString(0)) ComboBox5.Items.Add(reader.GetString(0)) End While con.Close() ElseIf (ComboBox4.SelectedItem.ToString() = "Oracle") Then End If Catch ex As Exception MsgBox("Error to loading Databases") con.Close() End Try End Sub

Private Sub ComboBox5_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox5.SelectedIndexChanged flagg = 2 Try If (ComboBox4.SelectedItem.ToString() = "MS Access") Then TextBox2.Visible = True If (ComboBox5.SelectedItem.ToString() = "<Browse.....For Database>") Then accessFrm.ShowDialog(Me) 'openmdb.ShowDialog(Me) 'access_file_nm = openmdb.FileName 'TextBox2.Text = access_file_nm 'access_file_nm_pass = "" End If End If Catch ex As Exception MsgBox("Error to change database") End Try ' ElseIf (ComboBox1.SelectedItem.ToString() = "SQL Server") Then ' TextBox2.Visible = False ' con.Open() ' con.ChangeDatabase(ComboBox2.SelectedItem.ToString()) ' cmd.Connection = con ' cmd.CommandType = CommandType.StoredProcedure ' cmd.CommandText = "sp_tables" ' reader = cmd.ExecuteReader() ' ComboBox3.Items.Clear() ' ComboBox3.Text = "" ' While (reader.Read()) ' 'MsgBox(reader.GetString(0)) ' If (reader.GetString(0).Equals(ComboBox2.SelectedItem.ToString()) And reader.GetString(3).Equals("TABLE")) Then ' ComboBox3.Items.Add(reader.GetString(2))

66

' ' ' '

End If End While con.Close() End If

'Catch ex As Exception ' MsgBox("Failed to change database") ' con.Close() 'End Try End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Dim test As New oracleTooracle test.oracleOracle() End Sub Private Sub ComboBox3_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox3.SelectedIndexChanged End Sub Private Sub title_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles title.Tick title.Interval = 100 If (ii < titlee.Length) Then Me.Text = Me.Text + tch(ii) ii = ii + 1 Else ii = 0 Me.Text = "" End If End Sub End Class

Oraclefrm.Designer.vb :
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class oracleFrm Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub

67

'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.Label1 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.TextBox3 = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.TextBox2 = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.otitle = New System.Windows.Forms.Timer(Me.components) Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(27, 17) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(83, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Server Name" ' 'TextBox1 ' Me.TextBox1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.TextBox1.Location = New System.Drawing.Point(117, 14) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(303, 24) Me.TextBox1.TabIndex = 1 ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.TextBox3) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.TextBox2) Me.GroupBox1.Controls.Add(Me.Label2) Me.GroupBox1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox1.Location = New System.Drawing.Point(25, 74) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(397, 130)

68

Me.GroupBox1.TabIndex = 2 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Log on to the database" ' 'TextBox3 ' Me.TextBox3.Location = New System.Drawing.Point(94, 88) Me.TextBox3.Name = "TextBox3" Me.TextBox3.PasswordChar = Global.Microsoft.VisualBasic.ChrW(35) Me.TextBox3.Size = New System.Drawing.Size(264, 24) Me.TextBox3.TabIndex = 3 ' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Location = New System.Drawing.Point(17, 94) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(62, 17) Me.Label3.TabIndex = 2 Me.Label3.Text = "Password" ' 'TextBox2 ' Me.TextBox2.Location = New System.Drawing.Point(94, 33) Me.TextBox2.Name = "TextBox2" Me.TextBox2.Size = New System.Drawing.Size(265, 24) Me.TextBox2.TabIndex = 1 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Location = New System.Drawing.Point(13, 37) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(72, 17) Me.Label2.TabIndex = 0 Me.Label2.Text = "User Name" ' 'Button1 ' Me.Button1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(184, 229) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(111, 30) Me.Button1.TabIndex = 3 Me.Button1.Text = "Test Connection" Me.Button1.UseVisualStyleBackColor = True ' 'Button2 ' Me.Button2.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button2.Location = New System.Drawing.Point(310, 229) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(110, 30)

69

Me.Button2.TabIndex = 4 Me.Button2.Text = "Close" Me.Button2.UseVisualStyleBackColor = True ' 'otitle ' Me.otitle.Enabled = True ' 'oracleFrm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(218, Byte), Integer), CType(CType(226, Byte), Integer), CType(CType(255, Byte), Integer)) Me.ClientSize = New System.Drawing.Size(444, 279) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.TextBox1) Me.Controls.Add(Me.Label1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.MaximizeBox = False Me.Name = "oracleFrm" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents Friend WithEvents End Class Label1 As System.Windows.Forms.Label TextBox1 As System.Windows.Forms.TextBox GroupBox1 As System.Windows.Forms.GroupBox TextBox3 As System.Windows.Forms.TextBox Label3 As System.Windows.Forms.Label TextBox2 As System.Windows.Forms.TextBox Label2 As System.Windows.Forms.Label Button1 As System.Windows.Forms.Button Button2 As System.Windows.Forms.Button otitle As System.Windows.Forms.Timer

Oraclefrm.vb :
Imports System.Data.OleDb Imports System.Data.OracleClient Public Class oracleFrm Dim txt As String = "Oracle Login" Dim ch() As Char Dim i As Integer = 0 Dim otitlee As String = "Oracle Login" Dim otch() As Char = otitlee.ToCharArray() Dim oi As Integer = 0 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If (flagg = 1) Then Try

70

If Not (TextBox1.Text = "") Then str = TextBox1.Text oracon = New OracleConnection("Data Source=" + TextBox1.Text + ";User ID=" + TextBox2.Text + ";Password=" + TextBox3.Text + ";Unicode=True") oracon.Open() MsgBox("Connection successful") Else MsgBox("Enter server name") End If oracon.Close() Catch ex As Exception MsgBox(ex.Message) oracon.Close() End Try Else Try If Not (TextBox2.Text = "") Then str = TextBox1.Text soracon = New OracleConnection("Data Source=" + TextBox1.Text + ";User ID=" + TextBox2.Text + ";Password=" + TextBox3.Text + ";Unicode=True") soracon.Open() MsgBox("Connection successful") Else MsgBox("Enter server name") End If soracon.Close() Catch ex As Exception MsgBox(ex.Message) soracon.Close() End Try End If End Sub Private Sub oracleFrm_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated End Sub Private Sub otitle_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles otitle.Tick If (oi < otitlee.Length) Then Me.Text = Me.Text + otch(oi) oi = oi + 1 Else oi = 0 Me.Text = "" End If End Sub Private Sub oracleFrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = ""

71

End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub End Class

Oracletooracle.vb :
Imports System.Data.OracleClient Public Class oracleTooracle Public Function oracleOracle() As Boolean flag = 0 Dim table_name, dtable_name As String Try 'Source table name table_name = frmFirst.ComboBox3.SelectedItem.ToString() 'Connection of oracle to check table is exists or not If (oracon.State = ConnectionState.Closed) Then oracon.Open() End If If (soracon.State = ConnectionState.Closed) Then soracon.Open() End If oracmd = New OracleCommand("Select Table_Name from cat where Table_Type='TABLE'", soracon) orareader = oracmd.ExecuteReader() i = 0 While (orareader.Read()) 'If (orareader(0).ToString().ToUpper() = table_name.ToUpper()) Then 'flag = 1 'Exit While tab_ex(i) = orareader(0).ToString() i = i + 1 'End If End While j = 0 While (j < i) If (tab_ex(j).Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then table_name = InputBox("Table is allready exists Please give another name") j = -1 End If j = j + 1 End While 'While (orareader.Read())

72

' Then

If (orareader(0).ToString().ToUpper() = table_name.ToUpper())

' flag = 1 ' Exit While ' End If 'End While 'If (flag = 1) Then ' table_name = InputBox("Table is already exists please enter another table name") 'End If If (soracon.State = ConnectionState.Closed) Then soracon.Open() End If 'Connection to copy structure of table oracmd = New OracleCommand("Select Column_Name, Data_Type, Data_Length from User_Tab_Columns where Table_Name='" + frmFirst.ComboBox3.Text + "'", oracon) orareader = oracmd.ExecuteReader() i = 0 While (orareader.Read()) 'MsgBox(orareader(0) + " " + orareader(1)) sttt(i, 0) = orareader(0).ToString() If (orareader(1).ToString().ToLower().Trim().Equals("varchar2")) Then sttt(i, 1) = orareader(1).ToString() + "(" + orareader(2).ToString() + ")" ElseIf (orareader(1).ToString().ToLower().Trim().Equals("char")) Then sttt(i, 1) = orareader(1).ToString() + "(" + orareader(2).ToString() + ")" ElseIf (orareader(1).ToString().ToLower().Trim().Equals("varchar")) Then sttt(i, 1) = orareader(1).ToString() + "(" + orareader(2).ToString() + ")" Else sttt(i, 1) = orareader(1).ToString() End If i = i + 1 End While orareader.Close() 'Connection to create destination table oracmd = New OracleCommand("create table " + table_name + "(" + sttt(0, 0).ToString() + " " + sttt(0, 1).ToString() + ")", soracon) oracmd.ExecuteNonQuery() oracmd.Dispose() j = i - 1 i = 1 While (i <= j) 'MsgBox("alter table " + table_name + " add(" + sttt(i, 0).ToString() + " " + sttt(i, 1).ToString() + ")")

73

oracmd = New OracleCommand("alter table " + table_name + " add(" + sttt(i, 0).ToString() + " " + sttt(i, 1).ToString() + ")", soracon) oracmd.ExecuteNonQuery() i = i + 1 End While 'Connection to read data from source table If (oracon.State = ConnectionState.Closed) Then oracon.Open() End If oracmd.Dispose() oracmd = New OracleCommand("select * from " + frmFirst.ComboBox3.SelectedItem.ToString(), oracon) orareader = oracmd.ExecuteReader() While (orareader.Read()) ccnt = orareader.FieldCount End While oracmd.Dispose() orareader.Close() i = 0 j = 0 If (soracon.State = ConnectionState.Closed) Then soracon.Open() End If orada = New OracleDataAdapter("select * from " + table_name, soracon) orada.Fill(orads, table_name) oradt = orads.Tables(table_name) oracmb = New OracleCommandBuilder(orada) oracmd.Dispose() oracmd = New OracleCommand("Select * from " + frmFirst.ComboBox3.Text, oracon) orareader = oracmd.ExecuteReader() While (orareader.Read()) oradr = oradt.NewRow() j = 0 While (j < ccnt) oradr(j) = orareader(j) j = j + 1 End While oradt.Rows.Add(oradr) orada.Update(orads, table_name) End While MsgBox("Export") oracon.Close() soracon.Close() 'j = 0 'oracmd = New OracleCommand("select * from " + frmFirst.ComboBox3.SelectedItem.ToString(), oracon) 'orareader = oracmd.ExecuteReader() Catch ex As Exception MsgBox("Error to migrate data") End Try

74

End Function End Class

Oracletoaccess.vb :
Imports System.Data.OleDb Imports System.Data.OracleClient Public Class oracleToAccess Public Function oracleAccess() As Boolean Try flag = 0 Dim table_name, substr As String 'Try 'Source table name table_name = frmFirst.ComboBox3.SelectedItem.ToString() 'Access Connection If (docon.State = ConnectionState.Closed) Then docon.Open() End If MsgBox("Connection open") Dim ob() As Object = {vbNullString, vbNullString, vbNullString, "TABLE"} odt = docon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, ob) 'For Each row As DataRow In odt.Rows ' If (row("Table_Name").ToString().Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then ' flag = 1 ' Exit For ' End If 'Next 'If (flag = 1) Then ' table_name = InputBox("Table is allready exists Please give another name") 'End If i = 0 For Each row As DataRow In odt.Rows tab_ex(i) = row("Table_Name").ToString() 'If (row("Table_Name").ToString().Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then ' flag = 1 ' Exit For 'End If i = i + 1 Next j = 0 While (j < i) If (tab_ex(j).Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then table_name = InputBox("Table is allready exists Please give another name") j = -1 End If j = j + 1

75

End While 'Oracle Connection to copy table structure If (oracon.State = ConnectionState.Closed) Then oracon.Open() End If oracmd = New OracleCommand("Select Column_Name, Data_Type from User_Tab_Columns where Table_Name='" + frmFirst.ComboBox3.Text + "'", oracon) orareader = oracmd.ExecuteReader() i = 0 While (orareader.Read()) substr = orareader(1).ToString() If (substr = "VARCHAR2") Then sttt(i, 0) = orareader(0) sttt(i, 1) = "Char(50)" ElseIf (substr = "RAW") Then sttt(i, 0) = orareader(0) sttt(i, 1) = "binary(255)" ElseIf (substr = "BLOB") Then sttt(i, 0) = orareader(0) sttt(i, 1) = "image" ElseIf (substr = "CLOB") Then sttt(i, 0) = orareader(0) sttt(i, 1) = "image" ElseIf (substr = "BFILE") Then sttt(i, 0) = orareader(0) sttt(i, 1) = "image" Else sttt(i, 0) = orareader(0) sttt(i, 1) = orareader(1) End If 'MsgBox(sttt(i, 0) + " and " + sttt(i, 1) + " and " + orareader(1)) i = i + 1 End While j = i - 1 'Coding for create table in Access ods = New DataSet(table_name) oda = New OleDbDataAdapter("create table " + table_name + "(" + sttt(0, 0) + " " + sttt(0, 1) + ")", docon) oda.Fill(ods, table_name) i = 1 While (i <= j) oda = New OleDbDataAdapter("alter table " + table_name + " add " + sttt(i, 0) + " " + sttt(i, 1), docon) oda.Fill(ods, table_name) i = i + 1 End While oracmd = New OracleCommand("Select * from " + frmFirst.ComboBox3.Text, oracon) orareader = oracmd.ExecuteReader() While (orareader.Read()) ccnt = orareader.FieldCount

76

End While i = 0 j = 0 oda = New OleDbDataAdapter("select * from " + table_name, docon) oda.Fill(ods, table_name) odt = ods.Tables(table_name) ocmb = New OleDbCommandBuilder(oda) oracmd = New OracleCommand("Select * from " + frmFirst.ComboBox3.Text, oracon) orareader = oracmd.ExecuteReader() While (orareader.Read()) odr = odt.NewRow() j = 0 While (j < ccnt) odr(j) = orareader(j) j = j + 1 End While odt.Rows.Add(odr) oda.Update(ods, table_name) End While MsgBox("Export") oracon.Close() docon.Close() Catch ex As Exception MsgBox("Error to migrate data") 'MsgBox("Error to export data") 'oracon.Close() 'docon.Close() End Try End Function End Class

Oracletosql.vb :
Imports Microsoft.SqlServer.Management.Smo Imports Microsoft.SqlServer.Server Imports Microsoft.SqlServer.Management Imports System.Data.SqlClient Imports Microsoft.SqlServer.Management.Common Imports System.Data.OracleClient Public Class oracleTosql Dim substr As String Dim col As New Column Public Function oracleSql() As Boolean flag = 0 Try 'Connection for destination table If (con.State = ConnectionState.Closed) Then con.Open() End If smo_server_con = New ServerConnection(con) smo_server = New Server(smo_server_con)

77

smo_db = smo_server.Databases(frmFirst.ComboBox5.SelectedItem.ToString()) str = frmFirst.ComboBox3.SelectedItem.ToString().Trim() smo_table = New Table(smo_db, frmFirst.ComboBox3.SelectedItem.ToString()) i = 0 For Each smo_table In smo_db.Tables 'If (smo_table.Name.Equals(frmFirst.ComboBox3.SelectedItem.ToString().Trim())) Then ' flag = 1 ' Exit For 'End If tab_ex(i) = smo_table.Name i = i + 1 Next j = 0 While (j < i) If (tab_ex(j).Equals(str, StringComparison.OrdinalIgnoreCase)) Then str = InputBox("Given table is allready exists in destination table enter another name") j = -1 smo_table = New Table(smo_db, str) End If j = j + 1 End While 'If (flag = 1) Then ' str = InputBox("Given table is allready exists in destination table enter another name") ' smo_table = New Table(smo_db, str) 'ElseIf (flag = 0) Then ' smo_table = New Table(smo_db, frmFirst.ComboBox3.SelectedItem.ToString()) 'End If 'Connection for copy structure of source table If (oracon.State = ConnectionState.Closed) Then oracon.Open() End If oracmd = New OracleCommand("Select Column_Name, Data_Type from User_Tab_Columns where Table_Name='" + frmFirst.ComboBox3.Text + "'", oracon) 'oracmd = New OracleCommand("Select * from bonus", oracon) orareader = oracmd.ExecuteReader() i = 0 While (orareader.Read()) substr = orareader(1).ToString() If (substr = "NUMBER") Then col = New Column(smo_table, orareader(0), DataType.Decimal(2, 18)) ElseIf (substr = "VARCHAR2") Then col = New Column(smo_table, orareader(0), DataType.VarChar(4000)) ElseIf (substr = "DATE") Then col = New Column(smo_table, orareader(0), DataType.DateTime) ElseIf (substr = "LONG") Then

78

col = New Column(smo_table, orareader(0), DataType.Decimal(2, 38)) ElseIf (substr = "RAW") Then col = New Column(smo_table, orareader(0), DataType.VarBinary(8000)) ElseIf (substr = "BLOB") Then col = New Column(smo_table, orareader(0), DataType.Image) ElseIf (substr = "CLOB") Then col = New Column(smo_table, orareader(0), DataType.Image) ElseIf (substr = "BFILE") Then col = New Column(smo_table, orareader(0), DataType.Image) Else col = New Column(smo_table, orareader(0), DataType.Variant) End If 'MsgBox(sttt(i, 0) + " and " + sttt(i, 1) + " and " + orareader(1)) 'i = i + 1 smo_table.Columns.Add(col) End While smo_table.Create() 'j = i - 1 If (con.State = ConnectionState.Closed) Then con.Open() End If orada = New OracleDataAdapter("Select * from " + frmFirst.ComboBox3.SelectedItem.ToString(), oracon) orads = New DataSet(frmFirst.ComboBox3.SelectedItem.ToString()) orads.Clear() orada.Fill(orads, frmFirst.ComboBox3.SelectedItem.ToString()) oradt = orads.Tables(frmFirst.ComboBox3.SelectedItem.ToString()) Dim sqlbulk As New SqlBulkCopy(con) Using con Using sqlbulk sqlbulk.DestinationTableName = "dbo." + smo_table.Name Try sqlbulk.WriteToServer(oradt) Catch ex As Exception MsgBox("Error to copy data") End Try End Using End Using oracon.Close() con.Close() Catch 'MsgBox("Error to export data") 'oracon.Close() 'con.Close() MsgBox("Error to migrate data") End Try End Function End Class

79

Sqlfrm.designer.vb :
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class sqlfrm Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Me.Label1 = New System.Windows.Forms.Label Me.ComboBox1 = New System.Windows.Forms.ComboBox Me.RadioButton1 = New System.Windows.Forms.RadioButton Me.RadioButton2 = New System.Windows.Forms.RadioButton Me.GroupBox1 = New System.Windows.Forms.GroupBox Me.TextBox2 = New System.Windows.Forms.TextBox Me.Label3 = New System.Windows.Forms.Label Me.TextBox1 = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.Button1 = New System.Windows.Forms.Button Me.stitle = New System.Windows.Forms.Timer(Me.components) Me.Button2 = New System.Windows.Forms.Button Me.GroupBox1.SuspendLayout() Me.SuspendLayout() ' 'Label1 ' Me.Label1.AutoSize = True Me.Label1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Label1.Location = New System.Drawing.Point(15, 25) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(83, 17) Me.Label1.TabIndex = 0 Me.Label1.Text = "Server Name" ' 'ComboBox1 '

80

Me.ComboBox1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.ComboBox1.FormattingEnabled = True Me.ComboBox1.Location = New System.Drawing.Point(118, 22) Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(291, 25) Me.ComboBox1.TabIndex = 1 ' 'RadioButton1 ' Me.RadioButton1.AutoSize = True Me.RadioButton1.Checked = True Me.RadioButton1.Location = New System.Drawing.Point(33, 30) Me.RadioButton1.Name = "RadioButton1" Me.RadioButton1.Size = New System.Drawing.Size(188, 21) Me.RadioButton1.TabIndex = 3 Me.RadioButton1.TabStop = True Me.RadioButton1.Text = "Use Windows Authentication" Me.RadioButton1.UseVisualStyleBackColor = True ' 'RadioButton2 ' Me.RadioButton2.AutoSize = True Me.RadioButton2.Location = New System.Drawing.Point(32, 63) Me.RadioButton2.Name = "RadioButton2" Me.RadioButton2.Size = New System.Drawing.Size(201, 21) Me.RadioButton2.TabIndex = 4 Me.RadioButton2.Text = "Use SQL Server Authentication" Me.RadioButton2.UseVisualStyleBackColor = True ' 'GroupBox1 ' Me.GroupBox1.Controls.Add(Me.TextBox2) Me.GroupBox1.Controls.Add(Me.Label3) Me.GroupBox1.Controls.Add(Me.TextBox1) Me.GroupBox1.Controls.Add(Me.Label2) Me.GroupBox1.Controls.Add(Me.RadioButton2) Me.GroupBox1.Controls.Add(Me.RadioButton1) Me.GroupBox1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox1.Location = New System.Drawing.Point(18, 67) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(391, 173) Me.GroupBox1.TabIndex = 5 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Log on to the server" ' 'TextBox2 ' Me.TextBox2.Enabled = False Me.TextBox2.Location = New System.Drawing.Point(142, 133) Me.TextBox2.Name = "TextBox2" Me.TextBox2.PasswordChar = Global.Microsoft.VisualBasic.ChrW(35) Me.TextBox2.Size = New System.Drawing.Size(220, 24) Me.TextBox2.TabIndex = 8

81

' 'Label3 ' Me.Label3.AutoSize = True Me.Label3.Enabled = False Me.Label3.Location = New System.Drawing.Point(63, 137) Me.Label3.Name = "Label3" Me.Label3.Size = New System.Drawing.Size(62, 17) Me.Label3.TabIndex = 7 Me.Label3.Text = "Password" ' 'TextBox1 ' Me.TextBox1.Enabled = False Me.TextBox1.Location = New System.Drawing.Point(141, 98) Me.TextBox1.Name = "TextBox1" Me.TextBox1.Size = New System.Drawing.Size(221, 24) Me.TextBox1.TabIndex = 6 ' 'Label2 ' Me.Label2.AutoSize = True Me.Label2.Enabled = False Me.Label2.Location = New System.Drawing.Point(62, 103) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(72, 17) Me.Label2.TabIndex = 5 Me.Label2.Text = "User Name" ' 'Button1 ' Me.Button1.Font = New System.Drawing.Font("Palatino Linotype", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button1.Location = New System.Drawing.Point(147, 259) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(132, 36) Me.Button1.TabIndex = 6 Me.Button1.Text = "Test Connection" Me.Button1.UseVisualStyleBackColor = True ' 'stitle ' Me.stitle.Enabled = True ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(290, 259) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(118, 35) Me.Button2.TabIndex = 7 Me.Button2.Text = "Close" Me.Button2.UseVisualStyleBackColor = True ' 'sqlfrm ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

82

Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(218, Byte), Integer), CType(CType(226, Byte), Integer), CType(CType(250, Byte), Integer)) Me.ClientSize = New System.Drawing.Size(425, 307) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Controls.Add(Me.GroupBox1) Me.Controls.Add(Me.ComboBox1) Me.Controls.Add(Me.Label1) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.MaximizeBox = False Me.Name = "sqlfrm" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent Me.GroupBox1.ResumeLayout(False) Me.GroupBox1.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox Friend WithEvents RadioButton1 As System.Windows.Forms.RadioButton Friend WithEvents RadioButton2 As System.Windows.Forms.RadioButton Private WithEvents GroupBox1 As System.Windows.Forms.GroupBox Friend WithEvents TextBox2 As System.Windows.Forms.TextBox Friend WithEvents Label3 As System.Windows.Forms.Label Friend WithEvents TextBox1 As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents stitle As System.Windows.Forms.Timer Friend WithEvents Button2 As System.Windows.Forms.Button End Class

Sqlfrm.vb :
Public Class sqlfrm Dim stitlee As String = "SQL Login" Dim stch() As Char = stitlee.ToCharArray() Dim si As Integer = 0 Private Sub sqlfrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Text = "" TextBox2.Text = "" ComboBox1.Text = "" End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged If (RadioButton2.Checked = True) Then Label2.Enabled = True Label3.Enabled = True TextBox1.Enabled = True TextBox2.Enabled = True ElseIf (RadioButton1.Checked = True) Then

83

Label2.Enabled = Label3.Enabled = TextBox1.Enabled TextBox2.Enabled End If End Sub

False False = False = False

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try con.Close() If (RadioButton1.Checked = True) Then constring = "Data Source=" + ComboBox1.Text + ";Integrated Security=True" ElseIf (RadioButton2.Checked = True) Then constring = "Data Source=" + ComboBox1.Text + ";User ID=" + TextBox1.Text + ";Password=" + TextBox2.Text End If con.ConnectionString = constring con.Open() MsgBox("Connection Successful") 'cmd.Connection = con 'cmd.CommandType = CommandType.StoredProcedure 'cmd.CommandText = "sp_databases" 'reader = cmd.ExecuteReader() 'frmFirst.ComboBox2.Items.Clear() 'While (reader.Read()) ' 'MsgBox(reader.GetString(0)) ' frmFirst.ComboBox2.Items.Add(reader.GetString(0)) 'End While con.Close() Catch ex As Exception MsgBox("Connection Failed") con.Close() End Try End Sub Private Sub GroupBox1_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter End Sub Private Sub stitle_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stitle.Tick If (si < stitlee.Length) Then Me.Text = Me.Text + stch(si) si = si + 1 Else si = 0 Me.Text = "" End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close()

84

End Sub End Class

Sqltoaccess.vb :
Imports Microsoft.SqlServer.Management.Smo Imports Microsoft.SqlServer.Server Imports Microsoft.SqlServer.Management Imports System.Data.SqlClient Imports Microsoft.SqlServer.Management.Common Imports System.Data.OleDb Public Class sqlToaccess Dim substr As String Dim pos As Integer Public Function sqlAccess() As Boolean flag = 0 Dim table_name As String Try 'Source table name table_name = frmFirst.ComboBox3.SelectedItem.ToString() 'Access Connection 'pos = frmFirst.TextBox2.Text.LastIndexOf(".") 'substr = frmFirst.TextBox2.Text.Substring(pos + 1) 'If (substr = "accdb") Then ' ocon.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + frmFirst.TextBox2.Text 'ElseIf (substr = "mdb") Then ' ocon.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + frmFirst.TextBox2.Text 'Else ' MsgBox("Unrecognized database") 'End If If (docon.State = ConnectionState.Closed) Then docon.Open() End If MsgBox("Connection open") Dim ob() As Object = {vbNullString, vbNullString, vbNullString, "TABLE"} odt = docon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, ob) i = 0 For Each row As DataRow In odt.Rows tab_ex(i) = row("Table_Name").ToString() 'If (row("Table_Name").ToString().Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then ' flag = 1 ' Exit For 'End If i = i + 1 Next j = 0 While (j < i) If (tab_ex(j).Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then

85

table_name = InputBox("Table is allready exists Please give another name") j = -1 End If j = j + 1 End While 'For Each row As DataRow In odt.Rows ' If (row("Table_Name").ToString().Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then ' flag = 1 ' Exit For ' End If 'Next 'If (flag = 1) Then ' table_name = InputBox("Table is allready exists Please give another name") 'End If 'Sqlconnection for copy table structure con.Open() 'con.ChangeDatabase(frmFirst.ComboBox2.SelectedItem.ToString()) 'sds = New DataSet(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) 'da = New SqlDataAdapter("select * from " + frmFirst.ComboBox3.SelectedItem.ToString().Trim(), con) 'da.Fill(sds, frmFirst.ComboBox3.SelectedItem.ToString().Trim()) 'sdt = sds.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) 'i = 0 'For Each dc As DataColumn In sdt.Columns ' MsgBox(Convert.ToString(dc.DataType)) ' Select Case dc.DataType.ToString() ' Case ("System.Decimal") ' sa = "Decimal(2, 18)" ' Case ("System.String") ' sa = "nchar(10)" ' Case ("System.Int32") ' sa = "Int" ' End Select ' sttt(i, 0) = dc.ColumnName ' sttt(i, 1) = sa ' i = i + 1 'Next smo_server_con = New ServerConnection(con) smo_server = New Server(smo_server_con) Dim smo_ta As New Table smo_ddb = smo_server.Databases(frmFirst.ComboBox2.SelectedItem.ToString()) smo_ta = smo_ddb.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) i = 0 For Each dc As Column In smo_ta.Columns 'MsgBox("Field name is " & dc.Name.ToString() + " Datatype is " + dc.DataType.ToString()) sttt(i, 0) = dc.Name sttt(i, 1) = dc.DataType.ToString() i = i + 1 Next

86

' code for copying record j = i - 1 ods = New DataSet(frmFirst.ComboBox3.Text) 'MsgBox(j) oda = New OleDbDataAdapter("create table " + table_name + "(" + sttt(0, 0) + " " + sttt(0, 1) + ")", docon) oda.Fill(ods, table_name) i = 1 While (i <= j) oda = New OleDbDataAdapter("alter table " + table_name + " add " + sttt(i, 0) + " " + sttt(i, 1), docon) oda.Fill(ods, table_name) i = i + 1 End While 'MsgBox("test") da = New SqlDataAdapter("select * from " + frmFirst.ComboBox3.SelectedItem.ToString().Trim(), con) sds = New DataSet(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) sds.Clear() da.Fill(sds, frmFirst.ComboBox3.SelectedItem.ToString().Trim()) sdt = sds.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) rcnt = sdt.Rows.Count ccnt = sdt.Columns.Count i = 0 j = 0 oda = New OleDbDataAdapter("select * from " + table_name, docon) oda.Fill(ods, table_name) odt = ods.Tables(table_name) ocmb = New OleDbCommandBuilder(oda) While (i < rcnt) sdr = sdt.Rows(i) odr = odt.NewRow() j = 0 While (j < ccnt) odr(j) = sdr(j) j = j + 1 End While i = i + 1 odt.Rows.Add(odr) oda.Update(ods, table_name) End While MsgBox("Export") con.Close() docon.Close() Catch ex As Exception 'MsgBox("Error hato he") MsgBox("Error to migrate data") End Try End Function End Class

87

Sqltooracle.vb :
Imports System.Data.OracleClient Imports Microsoft.SqlServer.Management.Smo Imports Microsoft.SqlServer.Server Imports Microsoft.SqlServer.Management Imports System.Data.SqlClient Imports Microsoft.SqlServer.Management.Common Public Class sqlTooracle Public Function sqlOracle() As Boolean flag = 0 Dim table_name, dtable_name As String Try 'Source table name table_name = frmFirst.ComboBox3.SelectedItem.ToString() 'Connection of oracle to check table is exists or not If (soracon.State = ConnectionState.Closed) Then soracon.Open() End If oracmd = New OracleCommand("Select Table_Name from cat where Table_Type='TABLE'", soracon) orareader = oracmd.ExecuteReader() i = 0 While (orareader.Read()) 'If (orareader(0).ToString().ToUpper() = table_name.ToUpper()) Then 'flag = 1 'Exit While tab_ex(i) = orareader(0).ToString() i = i + 1 'End If End While j = 0 While (j < i) If (tab_ex(j).Equals(table_name, StringComparison.OrdinalIgnoreCase)) Then table_name = InputBox("Table is allready exists Please give another name") j = -1 End If j = j + 1 End While 'If (flag = 1) Then ' table_name = InputBox("Table is already exists please enter another table name") 'End If 'Sqlconnection for copy table structure If (con.State = ConnectionState.Closed) Then con.Open() End If

88

smo_server_con = New ServerConnection(con) smo_server = New Server(smo_server_con) Dim smo_ta As New Table smo_ddb = smo_server.Databases(frmFirst.ComboBox2.SelectedItem.ToString()) smo_ta = smo_ddb.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) i = 0 For Each dc As Column In smo_ta.Columns MsgBox("Field name is " & dc.Name.ToString() + " Datatype is " + dc.DataType.ToString()) sttt(i, 0) = dc.Name 'sttt(i, 1) = dc.DataType.ToString() Select Case dc.DataType.ToString().ToLower() Case ("decimal") sttt(i, 1) = DataType.Decimal(2, 18).ToString() Case ("text") sttt(i, 1) = "VarChar2(4000)" Case ("int") sttt(i, 1) = "Number" Case ("datetime") sttt(i, 1) = "Date" Case ("bit") sttt(i, 1) = "varchar2(5)" Case ("image") sttt(i, 1) = "BLOB" Case ("binary") sttt(i, 1) = "BLOB" Case ("char") sttt(i, 1) = "VarChar2(4000)" Case ("bigint") sttt(i, 1) = "long" Case ("float") sttt(i, 1) = DataType.Decimal(2, 18).ToString() Case ("nchar") sttt(i, 1) = "VarChar2(4000)" Case ("ntext") sttt(i, 1) = "VarChar2(4000)" Case ("numeric") sttt(i, 1) = DataType.Decimal(2, 18).ToString() Case ("nvarchar") sttt(i, 1) = "VarChar2(4000)" Case ("nvarcharmax") sttt(i, 1) = "VarChar2(4000)" Case ("smalldatetime") sttt(i, 1) = "Date" Case ("smallint") sttt(i, 1) = "number" Case ("varbinary") sttt(i, 1) = "BLOB" Case ("varbinarymax") sttt(i, 1) = "BLOB" Case ("varchar") sttt(i, 1) = "VarChar2(4000)" Case ("varcharmax") sttt(i, 1) = "VarChar2(4000)" End Select

89

i = i + 1 Next j = i - 1 'MsgBox("Table name is " + table_name) orads = New DataSet(table_name) 'MsgBox("create table " + table_name + "(" + sttt(0, 0) + " " + sttt(0, 1) + ")") orada = New OracleDataAdapter("create table " + table_name + "(" + sttt(0, 0) + " " + sttt(0, 1) + ")", soracon) orada.Fill(orads, table_name) i = 1 While (i <= j) orada = New OracleDataAdapter("alter table " + table_name + " add " + sttt(i, 0) + " " + sttt(i, 1), soracon) orada.Fill(orads, table_name) i = i + 1 End While da = New SqlDataAdapter("select * from " + frmFirst.ComboBox3.Text, con) sds = New DataSet(frmFirst.ComboBox3.Text) sds.Clear() da.Fill(sds, frmFirst.ComboBox3.Text) sdt = sds.Tables(frmFirst.ComboBox3.Text) rcnt = sdt.Rows.Count ccnt = sdt.Columns.Count 'MsgBox("Rows " + rcnt.ToString() + " and Column " + ccnt.ToString()) orada = New OracleDataAdapter("Select * from " + table_name, soracon) orads = New DataSet(table_name) orads.Clear() orada.Fill(orads, table_name) oradt = orads.Tables(table_name) oracmb = New OracleCommandBuilder(orada) i = 0 j = 0 While (i < rcnt) oradr = oradt.NewRow() sdr = sdt.Rows(i) j = 0 While (j < ccnt) oradr(j) = sdr(j) j = j + 1 End While i = i + 1 oradt.Rows.Add(oradr) End While orada.Update(orads, table_name) Catch ex As Exception MsgBox("Error to migrate data") End Try

90

End Function End Class

Sqltosql.vb :
Imports Microsoft.SqlServer.Management.Smo Imports Microsoft.SqlServer.Server Imports Microsoft.SqlServer.Management Imports System.Data.SqlClient Imports Microsoft.SqlServer.Management.Common Public Class sqlTosql Public Function sqlcon() As Boolean flag = 0 Try 'Connection for destination table smo_server_con = New ServerConnection(con) smo_server = New Server(smo_server_con) smo_db = smo_server.Databases(frmFirst.ComboBox5.SelectedItem.ToString()) str = frmFirst.ComboBox3.SelectedItem.ToString().Trim() smo_table = New Table(smo_db, frmFirst.ComboBox3.SelectedItem.ToString()) i = 0 For Each smo_table In smo_db.Tables 'If (smo_table.Name.Equals(frmFirst.ComboBox3.SelectedItem.ToString().Trim())) Then ' flag = 1 ' Exit For 'End If tab_ex(i) = smo_table.Name i = i + 1 Next j = 0 While (j < i) If (tab_ex(j).Equals(str, StringComparison.OrdinalIgnoreCase)) Then str = InputBox("Given table is allready exists in destination table enter another name") j = -1 smo_table = New Table(smo_db, str) End If j = j + 1 End While 'For Each smo_table In smo_db.Tables ' If (smo_table.Name.Equals(frmFirst.ComboBox3.SelectedItem.ToString().Trim())) Then ' flag = 1 ' Exit For ' End If 'Next

91

'If (flag = 1) Then ' str = InputBox("Given table is allready exists in destination table enter another name") ' 'MsgBox(str) ' smo_table = New Table(smo_db, str) 'ElseIf (flag = 0) Then ' smo_table = New Table(smo_db, frmFirst.ComboBox3.SelectedItem.ToString()) 'End If 'con.Open() 'Connection for source table If Not smo_table.Name = "" Then con.ChangeDatabase(frmFirst.ComboBox2.SelectedItem.ToString()) sds = New DataSet(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) da = New SqlDataAdapter("select * from " + frmFirst.ComboBox3.SelectedItem.ToString().Trim(), con) da.Fill(sds, frmFirst.ComboBox3.SelectedItem.ToString().Trim()) sdt = sds.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) 'Connection for source table to copy table structure Dim smo_ta As New Table smo_ddb = smo_server.Databases(frmFirst.ComboBox2.SelectedItem.ToString()) smo_ta = smo_ddb.Tables(frmFirst.ComboBox3.SelectedItem.ToString().Trim()) For Each dc As Column In smo_ta.Columns 'MsgBox("Field name is " & dc.Name.ToString() + " Datatype is " + dc.DataType.ToString()) Dim col As New Column(smo_table, dc.Name, dc.DataType) 'Select Case dc.DataType.ToString() ' Case ("System.Decimal") ' col.DataType = DataType.Decimal(2, 18) ' Case ("System.String") ' col.DataType = DataType.Char(50) ' Case ("System.Int32") ' col.DataType = DataType.Int 'End Select smo_table.Columns.Add(col) Next smo_table.Create() Dim sqlbulk As New SqlBulkCopy(con) Using con Using sqlbulk sqlbulk.DestinationTableName = "dbo." + smo_table.Name Try sqlbulk.WriteToServer(sdt) Catch ex As Exception MsgBox("Error to copy data") End Try End Using End Using End If con.Close() Catch ex As Exception

92

MsgBox("Error to migrate data") 'MsgBox("Error to create table" & ex.StackTrace) 'con.Close() End Try End Function End Class

4.6) TESTING & IMPLEMENTATION

Testing is the filter to catch defects before they are discovered by the customer or end user. Every time a customer runs the program, he/she generates a test-case. We tried the test cases to find the defects first since software development is a human activity and there may be potential errors. So testing before the product is delivered helped us to assure the quality and saved resources. Testing Objective Objective of testing is to find errors, demonstrate that software functions that satisfy the specification reduce the number of errors detected by customer, and have confidence in the software system. A good test always tries to discover undetected errors and is successful when errors are found since zero defects is not possible. There is always a condition or usage that can lead to an incorrect behavior. Testing Steps We started testing each individual new component and worked out as unit test, integration test, high order test, customer acceptance testing and different testing techniques are used at different times in the process. Testing Techniques Following testing techniques are used.

93

A)White Box Testing In white box testing we exercises the internal logic of a program, examine internal program structure and derived tests from an examination of the programs logic, tested internal paths and working of the software. To perform this we used to develop test cases for unit and integration testing. B)Black Box Testing In black box testing we exercises the input and output requirements of a program, tested by conducting specifications of requirement for which the software should do. This test is derived from the I/O specification and used in most functional tests.Finally with the modular concept inside the application it is being also tested for its Reliability: The system reliability will be insured through data integrity rules built into the database at the backend and the system rules built into the front-end application. The system will take assurance from the user before making any changes permanent. Testing Options for Data Migrations The fact approach to testing data and content migrations relies upon sampling, where some subset of random data or content is selected and inspected to ensure the migration was completed as designed. Those that have tested migrations using this approach are familiar with the typical iterative test, debug and retest method, where subsequent executions of the testing process reveal different error conditions as new samples are reviewed. Sampling works, but is reliant upon an acceptable level of error and an assumption pertaining to repeatability. An acceptable level of error implies that less than 100% of the data will be migrated without error and the level of error is inversely proportionate to the number of samples tested(refer to sampling standards such as ANSI/ASQ Z1.4). As per the assumption on repeatability, the fact that many migrations require four, five or more iterations of testing with differing results implies that one of the key tenets of sampling is not upheld, i.e., non-conformities occur randomly and with statistical independence. Even with these shortcomings, sampling has a role in a well defined testing strategy, but what are the other testing options? The following lists options for testing by the phase of the migration process:

94

a)Pre-migration testing These tests occur early in the migration process, before any migration, even migration for testing purposes, is completed. The pre-migration testing options include:Verify scope of source systems and data with user community and IT. Verification should include data to be included as well as excluded and, if applicable, tied to the specific queries being used for the migration. Define the source to target high-level mappings for each category of data or content and verify that the desired type has been defined in the destination system. Verify destination system data requirements such as the field names, field type, mandatory fields, valid value lists and other field-level validation checks. Using the source to destination mappings, test the source data against the requirements of the destination system. For example, if the destination system has a mandatory field, ensure that the appropriate source is not null, or if the destination system field has a list of valid values, test to ensure that the appropriate source fields contain these valid values. Test the fields that uniquely link source and target records and ensure that there is a definitive mapping between the record sets Test source and target system connections from the migration platform. Test tool configuration against the migration specification which can often be completed via black box testing on a field by- field basis. If clever, testing here can also be used to verify that a migration specifications mappings are complete and accurate. b)Formal Design Review Conduct a formal design review of the migration specification when the premigration testing in near complete, or during the earliest stages of the migration tool configuration. The specification should include: A definition of the source systems The source systems data sets and queries The mappings between the source system fields and the destination system Number of source records Number of source systems records created per unit time (to be used to define the migration timing and downtime Identification of supplementary sources Data cleansing requirements Performance requirements Testing requirements The formal design review should include representatives from the appropriate user communities, IT and management. The outcome of a formal design review should

95

include a list of open issues, the means to close each issue and approve the migration specification and a process to maintain the specification in sync with the migration tool configuration (which seems to continuously change until the production migration). c)Post-Migration Testing Once a migration has been executed, additional end to end testing can be executed. Expect a significant sum of errors to be identified during the initial test runs although it will be minimized if sufficient pre-migration testing is well executed. Post-migration is typically performed in a test environment and includes: Test the throughput of the migration process (number of records per unit time). This testing will be used to verify that the planned downtime is sufficient. For planning purposes, consider the time to verify that the migration process was completed successfully. Compare Migrated Records to Records Generated by the Destination System Ensure that migrated records are complete and of the appropriate context. Summary Verification There are several techniques that provide summary information including record counts and checksums. Here, the number of records migrated is compiled from the destination system and then compared to the number of records migrated. This approach provides only summary information and if any issue exists, it does not often provide insight to an issues root cause. Compare Migrated Records to Sources Tests should verify that fields values are migrated as per the migration specification. In short, source values and the field level mappings are used to calculate the expected results at the destination. This testing can be completed using sampling if appropriate or if the migration includes data that poses significant business or compliance risk, 100% of the migrated data can be verified using an automated testing tool. The advantages of the automated approach include the ability to identify errors that are less likely to occur (the proverbial needles in a haystack). Additionally, as an automated testing tool can be configured in parallel with the configuration of the migration tool, the ability to test 100% of the migrated data is available immediately following the first test migration. When compared to sampling approaches, it is easy to see that automated testing saves significant time and minimizes the typical iterative test, debug and retest found with sampling. Migrated content has special considerations. For those cases where content is being migrated without change, testing should verify the integrity of the content is maintained and the content is associated with the correct destination record. This can be completed using sampling or as already described, automated tools can be used to verify 100% of the result.

96

d) User Acceptance Testing Functional subtleties related to the co-mingling of migrated data and data created in the destination system may be difficult to identify early in the migration process. User acceptance testing provides an opportunity for the user community to interact with legacy data in the destination system prior to production release, and most often, this is the first such opportunity for the users. Attention should be given to reporting, downstream feeds, and other system processes that rely on migrated data. e) Production Migration All of the testing completed prior to the production migration does not guarantee that the production process will be completed without error. Challenges seen at this point include procedural errors and at times, production system configuration errors. If an automated testing tool has been used for post migration testing of data and content, executing another testing run is straightforward and recommended. If an automated approach had not been used, some level of sampling or summary verification is still recommended.

4.7) MAINTAINANCE
Software maintenance is a set of software engineering activities that occur after software has been delivered to the customer and put into operation. A primary goal of software engineering is to improve the ease with which changes can be made. The software maintenance can be defined by four activities: Corrective Maintenance Adaptive Maintenance Perceptive Maintenance or Enhancement Preventive Maintenance or Reengineering The software documentation is very important job regarding maintenance, because it is a big problem for the user to make any change in working version of software without consent of the developer. In out context as we developed and designed the core software for a website having the maximum possibility of change we have kept the copy of documentation on the site .As well as we are always ready to edit it when any major change is being done at the design and coding part.

97

CHAPTER 5: IMPLEMENTATION OF DATA MIGRATION

5.1) ALGORITHM
The aim of the algorithm is to migrate data from one database to another that has a different structure without changing the meaning of the data or their correctness. Considering the fact approach on data, we reformulate the aim of the algorithm into: migrating the facts from one database to another that has a different structure without altering the facts. In order to assure the correctness of the data during the migration (facts must be unchangeable), we consider moving a single fact as the most elementary data migration operation in the algorithm. If every fact found in the source database is still the same in the target database from a domain perspective point of view, then the migration was carried out correctly.The algorithm goes through different phases: - Mapping the source database structure to the target database structure - Migrating facts Lets take a simple example to explain the algorithm: Note that the table Student used as an example above is not normalized. We represented it in an elementary model and generated a normalized relational model to store the data. The new database is the target database named StudentNew.

Mapping the source database structure and destination database structure Mapping between two database structures is possible only if they belong to the same Universe of Discourse [1]. Suppose that there is no fact in the target database that cannot be found in or derived from facts in the source database. Then this means that although

98

the structure of the target and the source databases can be different, they belong to the same elementary model. Mapping consists of two steps: determining the elementary fact types in the relational model and mapping the elementary fact types of the source and target.

Identifying elementary fact types in the relational model This step in other words will create a fact type representation of the relational model in which every column in the tables of the relational model will belong to a fact type and every atomic data item in the table to a fact. There are many ways of achieving this: If the database is generated by an FCO-IM modeling tool such as CaseTalk [3], then the representation is already present. If the relational model has a good structure, then we can reverse-engineer [4] the database. If the database structure does not give us enough information to use the reverse-engineering algorithm [4], then we have to do it manually. After this step, we will have an elementary model in which the elementary fact types are present. We also still have the relational model and the proper mapping between elementary fact types and the relational model is present as well. The mapping between elementary fact type structures of the source and the target database The mapping between elementary models can be done in different ways: Source and Target are automatically derived from the same elementary model Depending on the reason why we need the database, we can have different structures that are based on the same elementary model. Example: If we want to build an OLTP system, the database must be normalized. If for the same model we like to define also an OLAP system, then a redundancy-free structure is not very well suited and we transform it to a redundant structure optimized for retrieving information. In this case, as we transform the model we keep track of its references to the elementary model by automatically preserving the information about the mapping between the two systems. Source and Target are

99

generated by different ways In this case, again the set of fact types found in the target database corresponds to the set of fact types found in the source database, but they are not expressed in the same way. The names of the elementary fact types might be different although they express the same fact type. In this case, the process of mapping is done manually. Example: In our example, from the source database is generated the elementary fact type model by interfering manually because the source is not redundancy-free. Then from the elementary model we generate the relational model of the target database. Migrating facts The process of migrating facts will use the information introduced during the mapping process. There are two main sub-processes in this phase: Moving the independent facts and moving the dependent facts. Moving the independent facts It is obvious to move the independent facts first, since these facts can stand alone in the target database. Below are given different steps of this sub-process.

Recognize the independent fact types in the target We consider a subset of the independent fact types, namely those that fulfill the condition that the corresponding columns in the relational model belong to the primary key of a table. In the elementary model there might be independent fact types that are not independent in the structure of the relational model (because they are not a primary key in any table). If this is the case, then the relational model is not redundancy-free. To find such fact types we use the information generated during the mapping of the source relational model to the Information grammar and the target relational model. Example: There are fact types Student and Project, and their corresponding relational structure is Student (First Name, Surname) and Project (Project). Find out the corresponding fact types in the source Using the information from the mapping between the source and target information grammars, we find the corresponding fact types in the source information grammar and their representation in the relational model of the source. It might be possible that an independent fact type in the target corresponds to a dependent fact type in the source. In this case the relational model of the source is not redundancy-free.

100

Example: The Student fact type in the source is found in Student(First Name, Surname), which is independent as well, but the Project fact type is found in Student(Project), which is not independent. Move independent facts We know where these facts reside in the source and where they must go in the target. This information is enough to move the facts from the source to the target. There must be the same number of atomic values in the relational model of the source and in the target for each fact. If this is not the case, then the target structure is a derivation of the source structure which means that the facts in the destination system are derived from the facts in the source system. In this case there must be a derivation rule in the mapping between the elementary fact type structures of the source and destination. Example: The independent fact types of the StudentNew are populated.

Moving the dependent facts The process of moving the dependent facts is a recursive process if the target database is not redundancy-free. The schema below gives the algorithm for moving the dependent facts.

The steps explained below are repeated until all fact types have been treated. Recognize the dependent fact types that depend on fact types already treated During this step, the algorithm finds fact types that depend on the fact types that have already been treated. Being treated means that the facts related to these fact types are already present in the target. For every fact type treated, find all dependent fact types that are dependent on them in the relational model. In the first occurrence of this step, only the independent fact types are treated (during the stepMoving the

101

independent facts). If there are no more fact types depending on the already treated fact types, then the fact transferring process has finished. Example: The fact types that are treated are: Student and Project. Fact types that are dependent on them are: for Student: Mentorship, Project Assignment and for Project: ProjectDescription. Find the corresponding fact types in the source Using the mapping information between the source and target information grammars, we find the corresponding fact types in the source information grammar and their representation in the relational model of the source. Always a dependent fact type in the target will map to a dependent fact type in the source. Example: The Mentorship fact type in the source is found in Student(First Name, Surname, Mentor) and the Project Assignment fact type is found in Student(First Name, Surname,Project).For these two fact types the independent fact type is Student. The ProjectDescription fact type in the source is found in Student(Project, ProjectDescription). For this fact type the independent fact type is Project. Move dependent facts To find out where the dependent facts reside in the source, we need also the fact on which these dependent facts depend. Now we have all the information to move the dependent facts from the source to the target. As in the case of moving independent facts, there must be the same number of atomic values in the relational model of the source and in the target for each fact. If this is not the case, then the target structure is a derivation of the source structure which means that the facts in the destination system are derived from the facts in the source system. In this case there must be a derivation rule in the mapping between the elementary fact type structures of the source and destination. Example: The case of Mentorship fact type: For every fact present in StudentNew of fact type Student, on which the fact type Mentorship depends, the algorithm looks into the source. From there it retrieves the corresponding Student(Mentor) for the Student(First Name, Surname) and puts it in the target. The same will happen for Project Assignment and ProjectDescription.

5.2) CODING
Refer section 4.5 for coding.

102

5.3) RESULTS AND SNAPSHOTS


Snapshots of the module. Access to SQL:

103

104

105

106

107

108

CHAPTER 6 : FUTURE PROSPECT & CONCLUSION

6.1) CONCLUSION
Data Migration is the process of transferring data between storage types, formats, or computer systems. Data migration is usually performed programmatically to achieve an automated migration, freeing up human resources from tedious tasks. It is required when organizations or individuals change computer systems or upgrade to new systems, or when systems merge (such as when the organizations that use them undergo a merger/takeover). To achieve an effective data migration procedure, data on the old system is mapped to the new system providing a design for data extraction and data loading. The design relates old data formats to the new system's formats and requirements. Programmatic data migration may involve many phases but it minimally includes data extraction where data is read from the old system and data loading where data is written to the new system. If a decision has been made to provide a set input file specification for loading data onto the target system, this allows a pre-load 'data validation' step to be put in place, interrupting the standard E(T)L process. Such a data validation process can be designed to interrogate the data to be transferred, to ensure that it meets the predefined criteria of the target environment, and the input file specification. An alternative strategy is to have on-the fly data validation occurring at the point of loading, which can be designed to report on load rejection errors as the load progresses. However, in the event that the extracted and transformed data elements are highly 'integrated' with one another, and the presence of all extracted data in the target system is essential to system functionality, this strategy can have detrimental, and not easily quantifiable effects. After loading into the new system, results are subjected to data verification to determine whether data was accurately translated, is complete, and supports processes in the new system. During verification, there may be a need for a parallel run of both systems to identify areas of disparity and forestall erroneous data loss. Automated and manual data cleaning is commonly performed in migration to improve data quality, eliminate redundant or obsolete information, and match the requirements of the new system.

109

Data migration phases (design, extraction, cleansing, load, verification) for applications of moderate to high complexity are commonly repeated several times before the new system is deployed.

6.2) FUTURE SCOPE


It is highly likely that the scope will change as the web application project moves forward; the web process model should be incremental. This allows the development team to freeze the scope for one increment so that an operational web application release can be created. The next increment may scope changes suggested by a review of the preceding increment, but once the second increment commences, scope is again frozen temporarily. This approach enables the Web Application team to work without having to accommodate a continual stream of changes but still recognizes the continuous evolution characteristics of most web application. Besides that, the following basic quality in the software always safeguards the future scope of the software. Reusability: Reusability is possible as and when we require in this application. We can update it next version. Reusable software reduces design, coding and testing cost by amortizing effort over several designs. Reducing the amount of code also simplifies understanding, which increases the likelihood that the code is correct. We follow up both types of reusability: Sharing of newly written code within a project and reuse of previously written code on new projects. Extensibility: This software is extended in ways that its original developers may not expect. The following principles enhance extensibility like Hide data structure, avoid traversing multiple links or methods, Avoid case statements on object type and distinguish public and private operations. Robustness: Its method is robust if it does not fail even if it receives improper parameters. There is some facilities like Protect against errors, Optimize after the program runs, validate arguments and Avoid predefined limits. Portability: Since it is an internet based application so its portability and usability depends upon the Clint connected with the internet. The interface designed that is the web page designing which is one of the major part of web application because it is the first impression regardless of the value of its contents interface must grab a potential user immediately.

110

REFERENCES
www.amazon.com www.wikipedia.com www.informatica.com www.datamigrationpro.com Van der Hoeven, Jeffery, Brian Lohman, and Remco Verdegem. "Emulation for Digital Preservation in Practice: The Results." The International Journal of Digital Curation 2.2 (2007): 123-132. Muira, Gregory. "Pushing the Boundaries of Traditional Heritage Policy: maintaining long-term access to multimedia content." IFLA Journal 33 (2007): 323-326. www.datanomic.com www.databaseanswers.org www.transcendata.com

111

Das könnte Ihnen auch gefallen