Vous êtes sur la page 1sur 18

Solved Assignments Search this site Navigation Home MCA Semester1 Semester2 Semester3 Semester4 Semester5 Semester6 Sitemap

MCA > Semester4 > MC0077 > Q. What are differences in Centralized and Distributed Database Systems? List the relative advantages of data distribution? A distributed database is a database that is under the control of a central database management system (DBMS) in which storage devices are not all attached to a common CPU. It may be stored in multiple computers located in the same physical location, or may be dispersed over a network of interconnected computers.

Collections of data (e.g. in a database) can be distributed across multiple physical locations. A distributed database can reside on network servers on the Internet, on corporate intranets or extranets, or on other company networks. The replication and distribution of databases improves database performance at end-user worksites.

To ensure that the distributive databases are up to date and current, there are two processes: replication and duplication. Replication involves using specialized software that looks for changes in the distributive database. Once the changes have been identified, the replication process makes all the databases look the same. The replication process can be very complex and time consuming depending on the size and number of the distributive databases. This process can also require a lot of time and computer resources. Duplication on the other hand is not as complicated. It basically identifies one database as a master and then duplicates that database. The duplication process is normally done at a set time after hours. This is to ensure that each distributed location has the same data. In the duplication process, changes to the master database only are allowed. This is to ensure that local data will not be overwritten. Both of the processes can keep the data current in all distributive locations.

Besides distributed database replication and fragmentation, there are many other distributed database design technologies. For example, local autonomy, synchronous and asynchronous distributed database technologies. These technologies' implementation can and does depend on the needs of the business and the sensitivity/confidentiality of the data to be stored in the database, and hence the price the business is willing to spend on ensuring data security, consistency and integrity.

Basic architecture

A database User accesses the distributed database through:

Local applications;

Applications which do not require data from other sites.

Global applications:

Applications which do require data from other sites.

A distributed database does not share main memory or disks.

A centralized database has all its data on one place. As it is totally different from distributed database which has data on different places. In centralized database as all the data reside on one place so problem of bottle-neck can occur, and data availability is not efficient as in distributed database. Let me define some advantages of distributed database, it will clear the difference between centralized and distributed database.

Advantages of Data Distribution

The primary advantage of distributed database systems is the ability to share and access data in a reliable and efficient manner.

Data sharing and Distributed Control:

If a number of different sites are connected to each other, then a user at one site may be able to access data that is available at another site. For example, in the distributed banking system, it is possible for a user in one branch to access data in another branch. Without this capability, a user wishing to transfer funds from one branch to another would have to resort to some external mechanism for such a transfer. This external mechanism would, in effect, be a single centralized database.

The primary advantage to accomplishing data sharing by means of data distribution is that each site is able to retain a degree of control over data stored locally. In a centralized system, the database administrator of the central site controls the database. In a distributed system, there is a global database administrator responsible for the entire system. A part of these responsibilities is delegated to the local database administrator for each site. Depending upon the design of the distributed database system, each local administrator may have a different degree of autonomy which is often a major advantage of distributed databases.

Reliability and Availability:

If one site fails in distributed system, the remaining sited may be able to continue operating. In particular, if data are replicated in several sites, transaction needing a particular data item may find it in several sites. Thus, the failure of a site does not necessarily imply the shutdown of the system.

The failure of one site must be detected by the system, and appropriate action may be needed to recover from the failure. The system must no longer use the service of the failed site. Finally, when the failed site recovers or is repaired, mechanisms must be available to integrate it smoothly back into the system.

Although recovery from failure is more complex in distributed systems than in a centralized system, the ability of most of the systems to continue to operate despite failure of one site, results in increased availability. Availability is crucial for database systems used for real-time applications. Loss of access to data, for example, in an airline may result in the loss of potential ticket buyers to competitors.

Speedup Query Processing:

If a query involves data at several sites, it may be possible to split the query into subqueries that can be executed in parallel by several sites. Such parallel computation allows for faster processing of a users query. In those cases in which data is replicated, queries may be directed by the system to the least heavily loaded sites. Comments You have no permission to add comments. For inquiry mail to query.assignments@gmail.com

Report Abuse|Remove Access|Powered By Google Sites

Solved Assignments Search this site Navigation Home MCA Semester1 Semester2 Semester3 Semester4 Semester5 Semester6 Sitemap MCA > Semester4 > MC0078 > Q. Describe the following with respect to Exception Handling? A) Exception Classes B) Common Exceptions This class is the base class for all exceptions. When an error occurs, either the system or the currently executing application reports it by throwing an exception containing information about the error. Once thrown, an exception is handled by the application or by the default exception handler.

The common language runtime provides an exception handling model that is based on the representation of exceptions as objects, and the separation of program code and exception handling code into try blocks and catch blocks, respectively. There can be one or more catch blocks, each designed to handle a particular type of exception, or one block designed to catch a more specific exception than another block.

If an application handles exceptions that occur during the execution of a block of application code, the code must be placed within a try statement. Application code within a try statement is a try block. Application code that handles exceptions thrown by a try block is placed within a catch statement, and is called a catch block. Zero or more catch blocks are associated with a try block, and each catch block includes a type filter that determines the types of exceptions it handles.

When an exception occurs in a try block, the system searches the associated catch blocks in the order they appear in application code, until it locates a catch block that handles the exception. A catch block handles an exception of type T if the type filter of the catch block specifies T or any type that T derives from. The system stops searching after it finds the first catch block that handles the exception. For this reason, in application code, a catch block that handles a type must be specified before a catch block that handles its base types, as demonstrated in the example that follows this section. A catch block that handles System.Exception is specified last.

If none of the catch blocks associated with the current try block handle the exception, and the current try block is nested within other try blocks in the current call, the catch blocks associated with the next enclosing try block are searched. If no catch block for the exception is found, the system searches previous nesting levels in the current call. If no catch block for the exception is found in the current call, the exception is passed up the call stack, and the previous stack frame is searched for a catch block that handles the exception. The search of the call stack continues until the exception is handled or until no more frames exist on the call stack. If the top of the call stack is reached without finding a catch block that handles the exception, the default exception handler handles it and the application terminates.

Exception types support the following features:

Human-readable text that describes the error. When an exception occurs, the runtime makes available a text message to inform the user of the nature of the error and to suggest action to resolve the problem. This text message

is held in the Message property of the exception object. During the creation of the exception object, you can pass a text string to the constructor to describe the details of that particular exception. If no error message argument is supplied to the constructor, the default error message is used.

The state of the call stack when the exception was thrown. The StackTrace property carries a stack trace that can be used to determine where in the code the error occurs. The stack trace lists all the called methods, and the line numbers in the source file where the calls are made.

Two categories of exceptions exist under the base class Exception:

The pre-defined common language runtime exception classes derived from SystemException.

The user-defined application exception classes derived from ApplicationException.

Exception includes a number of properties that help identify the code location, the type, the help file, and the reason for the exception: StackTrace, InnerException, Message, HelpLink, HResult, Source, and TargetSite.

When a causal relationship exists between two or more exceptions, the InnerException property maintains this information. The outer exception is thrown in response to this inner exception. The code that handles the outer exception can use the information from the earlier inner exception to handle the error more appropriately.

The error message string passed to the constructor during the creation of the exception object should be localized, and can be supplied from a resource file using the ResourceManager. For more information on localized resources, see the System.Resources namespace overview and Packaging and Deploying .NET Framework Application.

To provide the user with extensive information concerning why the exception occurred, the HelpLink property can hold a URL (or URN) to a help file.

Exception uses the HRESULT COR_E_EXCEPTION, which has the value 0x80131500.

For a list of initial property values for an instance of Exception, see the Exception constructors.

1. java.sql.SQLException:Stored procedure call failed

If this error comes, just check in the stored procedure as it simply indicates some internal call to some other procedure is getting failed in Stored procedure which you are invoking from Java class.

2. PLS-00306: wrong number or types of arguments in call to PROC_NAME

This error indicates that mismatch in stored procedure arguments with the one which we are passing in java class method. Quickest workaround is to check number of input and output parameter in the procedure and set the same in Java class method.

3. java.sql.SQLException: Cursor is closed.

at oracle.jdbc.driver.T4CResultSetAccessor.getCursor(T4CResultSetAccessor.jav a:332)

This exception raised if your procedure has returned a closed cursor, the quickest workaround is to put a null check for ResultSet object. e.g

ResultSet rs=(ResultSet)callableStmt.getObject(2);

if(rs!=null){ // put this check before invoking the resultset.next;

while(rs.next){

4. java.sql.SQLException: ORA-06550: line 1, column 7: PLS-00201: identifier DB_PKG.MY_PROC_NAME must be declared ORA-06550: line 1, column 7:

This error indicates that the DB object is missing or having some compilation problems. Just check in the corresponding DB package for the same.

5.java.sql.SQLException: Invalid column name

at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java :70)

at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)

This is perhaps the most easiest error to catch in JDBC, This simply states that column name which are trying to read from result set is missing in the output of the query or missing in the Cursor output(Stored procedure)

The workaround is to cross check all the column name in the query or cursor.

6. java.sql.SQLException: Inconsistent java and sql object types

This error comes when we use SQL collection in JDBC, As SQL collection is a kind of Associative array, so while creating a Array Descriptor we need to make sure the data should match the length of SQL Collection.

if some mismatch left then this is exception which will appear in the logs/console.

7.Exception in thread main java.lang.Error: Unresolved compilation problem:

If you face this error in your stand alone java program check if there are any syntax errors or any reference errors. Fix those and run the program again.

8.java.sql.SQLException: Missing IN or OUT parameter at index:: <<any_number>>

This error simply indicates that some of the IN or OUT parameter has been missed while invoking the procedure or prepared statement.

9. java.sql.SQLException: ORA-00900: invalid SQL statement

This error usually indicates a typo mistake while calling a stored procedure. as we always mentioned the keyword call in the procedure string in prepareCall method of CallableStatement. Ig you miss to specify the same

you will face this exception.

Wrong

cstmt = (OracleCallableStatement) getConnection1().prepareCall({DB_PKG.PROC_NAME(?,?,?,?,?,?)});

Right

cstmt = (OracleCallableStatement) getConnection1().prepareCall({call DB_PKG.PROC_NAME(?,?,?,?,?,?)});

10.java.sql.SQLException: ORA-01033: ORACLE initialization or shutdown in progress

The ORA-01033: ORACLE initialization or shutdown in progress. error can also happen when Oracle is attempting startup or shutdown and is hanging on a resource such as a failed disk, writing to redo, etc.

11. java.sql.SQLException: ORA-06576: not a valid function or procedure name

This error occurred if you some type mistake in the procedure or function name while calling from java. Simply cross check the names and run again.

12.java.sql.SQLException:ORA-01034: ORACLE not available

Check if database is running. This happens when DB goes down or shutdown.

14. java.sql.SQLRecoverableException: No more data to read from socket

This is communication break with the weblogic server and Database.

15. Caused by: com.myapp.exception.SysException: java.sql.SQLException: Invalid argument(s) in call.

Make sure you are not sending any null values to any Object(like SQL Aarry)set any input parameter in DB Stored procedure.

If in case your object remains null before sending to the CallableStatament, just use the setNull method to set such objects null.

e.g

callableStatement.setNull(1,OracleTypes.ARRAY,NAME_OF_TABLE_TYPE);

16 java.lang.ClassCastException: oracle.sql.StructDescriptor cannot be cast to oracle.sql.ArrayDescriptor

at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:191)

at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:165)

To Fix this problem check the Collection Name given. It should be Table Type name not the Object Name.

e.g Lets say you have created a Object MY_SCHEMA_OBJ

and you have Table Type defined for the same MY_SCHEMA_OBJ_TBL

And while creating the ArrayDescriptor if you pass the Object then it cause this problem

Wrong

ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(MY_SCHEMA_OBJ,con);

Correct

ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor(MY_SCHEMA_OBJ_TBL,con);

Comments For inquiry mail to query.assignments@gmail.com Report Abuse|Remove Access|Powered By Google Sites

77 data mining function

Data mining refers to the broadly-defined set of techniques involving finding meaningful patterns - or information - in large amounts of raw data.

At a very high level, data mining is performed in the following stages (note that terminology and steps taken in the data mining process varies by data mining practitioner):

1. Data collection: gathering the input data you intend to analyze 2. Data scrubbing: removing missing records, filling in missing values where appropriate 3. Pre-testing: determining which variables might be important for inclusion during the analysis stage 4. Analysis/Training: analyzing the input data to look for patterns 5. Model building: drawing conclusions from the analysis phase and determining a mathematical model to be applied to future sets of input data 6. Application: applying the model to new data sets to find meaningful patterns

Data mining can be used to classify or cluster data into groups or to predict likely future outcomes based upon a set of input variables/data.

Common data mining techniques and tools include, for example:

a. decision tree learning b. Bayesian classification c. neural networks

During the analysis phase (sometimes also called the training phase), it is customary to set aside some of the input data so that it can be used to crossvalidate and test the model, respectively. This is an important step taken in order to to avoid "over-fitting" the model to the original data set used to train the model, which would make it less applicable to real-world applications.

Data Mining Techniques

Data mining is one part of the process of Knowledge Discovery in Databases. There are many techniques within data mining that aim to accomplish

different tasks. Generally tasks fall into one of two categories, predictive or descriptive. Predictive tasks look at historical data to predict what will happen in the future. Descriptive tasks will look at some given data and find patterns in it. Since data mining is a growing area, the techniques are constantly changing, as new improved methods are discovered. At present, some of the most well known predictive algorithms, known as classification algorithms include Naive Bayes, SVM, Decision Trees (such as C4.5), Artificial Neural Networks, kNearest Neighbour and more. Some predictive algorithms are able to perform regression, a form of prediction for non-categorical data. Some of the most well known descriptive algorithms include the Apriori and FP-tree algorithms (for finding association rules), K-Means and Hierarchical clustering algorithms, GSP and PrefixSpan for Sequential Pattern Mining and various algorithms for Outlier Detection. In 2006, at the International Conference on Data Mining (ICDM), the top algorithms were discussed .This is a very limited list and many more algorithms have been and are being developed, as this area continues to grow and expand to encompass new problems and applications.

Vous aimerez peut-être aussi