Sie sind auf Seite 1von 18

Shram Sadhana Bombay Trusts College of Engineering & Technology, Bambhori, Jalgaon

Department of Computer Engineering Name of Student:- Harsha V. Talele Date of Performance:3/3/12 Date of Completion: Experiment No: 02 TITLE:-. To study a recent version of Oracle (Oracle 10g). AIM:- Study a recent version of Oracle 10g. HARDWARE / SOFTWARE REQUIREMENTS:1. 256MB RAM 2. Windows XP Professional 3. 32MB hard disk requirements 4. Oracle 10g

THEORY:What is SQL?
SQL (pronounced "ess-que-el") stands for Structured Query Language. SQL is used to communicate with a database. According to ANSI (American National Standards Institute), it is the standard language for relational database management systems. SQL statements are used to perform tasks such as update data on a database, or retrieve data from a database. Some common relational database management systems that use SQL are: Oracle, Sybase, Microsoft SQL Server, Access, Ingres, etc. Although most database systems use SQL, most of them also have their own additional proprietary extensions that are usually only used on their system. However, the standard SQL commands such as "Select", "Insert", "Update", "Delete", "Create", and "Drop" can be used to accomplish almost everything that one needs to do with a database.

SQL Standard
The SQL Standard has gone through a lot of changes during the years, which have added a great deal of new functionality to the standard, such as support for XML, triggers, regular expression matching, recursive queries, standardized sequences and much more. Due to SQL

Standards sheer volume, a lot of database solutions based on it, such as MySQL or PostgreSQL, do not implement the whole standard. In a lot of cases, the database behavior for file storage or indexes is not well defined and it's up to the vendors of the various SQL implementations to decide how the database will behave. This is the reason why, even though all SQL implementations have the same base, they are rarely compatible.[1] Two Classes of SQL SQL falls into two classes : 1. Data Manipulation Language (DML) - SQL for retrieving and storing data. 2. Data Design Language (DDL) - SQL for creating, altering and dropping tables. Most of the time, the SQL you use is for manipulating the data but occasionally you'll need to create new tables, alter existing ones or add an index. One of the best things about SQL is that you can do all of these operations with just simple SQL commands.[2]

What is PL/SQL?
As you may have noticed from the preceding section, SQL statements are very concise and powerful, but do not do more as a group than they do individually. Generally speaking, SQL statements operate independently, having little effect on one another. This is of limited use for writing programs, where you must create a body of code that is going to vary its behavior according to the data and to user or other input. To develop applications with SQL, you generally have to either interface it to a standard programming language such as C, or extend it so that it becomes a useful programming language in itself. Oracle supports both approaches, but the latter approach has many advantages that are relevant to the Web, and is therefore the approach that the Oracle WebServer takes. PL/SQL, then, is an application-development language that is a superset of SQL, supplementing it with standard programming-language features that include the following: block (modular) structure flow-control statements and loops variables, constants, and types structured data customized error handling

Another feature of PL/SQL is that it allows you to store compiled code directly in the database. This enables any number of applications or users to share the same functions and

procedures. In fact, once a given block of code is loaded into memory, any number of users can use the same copy of it simultaneously (although behavior is as though each user had her own copy), which is useful for the Oracle WebServer. PL/SQL also enables you to define triggers, which are subprograms that the database executes automatically in response to specified events.[3]

History of Oracle 10g :Oracle9i :


Oracle9i, released in 2001, introduced Real Application Clusters as a replacement for Oracle Parallel Server, and added many management and data warehousing features. Oracle offers a comprehensive high-performance infrastructure for e-business. It is called Oracle9i. Oracle9i includes everything needed to develop, deploy, and manage Internet applications. Benefits include: Scalability from departments to enterprise e-business sites Robust, reliable, available, secure architecture One development model, easy deployment options Leverage an organizations current skill set throughout the Oracle platform One management interface for all applications Industry standard technologies, no proprietary lock-in. There are two products, Oracle9i Application Server and Oracle9i Database, that provide a complete and simple infrastructure for Internet applications. Oracle9i Application Server :The Oracle9i Application Server (Oracle9iAS) runs all your applications. The Oracle9i Database stores all your data. Oracle9i Application Server is the only application server to include services for all the different server applications you will want to run. Oracle9iAS can run your: Portals or Web sites Java transactional applications Business intelligence applications

It also provides integration between users, applications, and data throughout your organization. Oracle9i Database :The roles of the two products are very straightforward. Oracle9i Database manages all your data. This is not just the object relational data that you expect an enterprise database to manage. It can also be unstructured data like: Spreadsheets Word documents PowerPoint presentations XML Multimedia data types like MP3, graphics, video, and more The data does not even have to be in the database. Oracle9i Database has services through which you can store metadata about information stored in file systems. You can use the database server to manage and serve information wherever it is located.[4]

Architecture of Oracle 10g :

Oracle is an RDBMS (Relational Database Management System). The Oracle database architecture can be described in terms of logical and physical structures. The advantage of separating the logical and physical structure is that the physical storage structure can be changed without affecting the logical structure. Logical Structure : The logical structure for Oracle RDBMS consists of the following elements:

Tablespace Schema

TableSpace : The Oracle database consists of one or more logical portions called as Tablespaces. A tablespace is a logical grouping of related data. A database administrator can use Tablespaces to do the following:

Control disk space allocation for database data. Assign specific space quotas for database users. Perform partial database backup or recovery operations. Allocate data storage across devices to improve performance.

Each database has at least one Tablespace called SYSTEM Tablespace. As part of the process of creating the database, Oracle automatically creates the SYSTEM tablespace. Although a small database can fit within the SYSTEM tablespace, its recommended that to create a separate tablespace for user data. Oracle uses the SYSTEM tablespace to store information like the data dictionary. Data dictionary stores the metadata (or the data about data). This includes information like table access permissions, information about keys etc. Data is stored in the database in form of files called as datafiles. Each Tablespace is a collection of one or more Datafiles. Each data file consists of Data blocks, extents and segments. Data Blocks : At the finest level of granularity, an ORACLE databases data is stored in data blocks (a lso called logical blocks, ORACLE blocks, or pages). An ORACLE database uses and allocates free database space in ORACLE data blocks. Extent : The next level of logical database space is called an extent. An extent is a specific number of contiguous data blocks that are allocated for storing a specific type of information. Segment : The level of logical database storage above an extent is called a segment. A segment is a set of extents that have been allocated for a specific type of data structure, and all are stored in the same tablespace. For example, each tables data is stored in its own data segment, while each indexs data is stored in its own index segment. ORACLE allocates space for segments in extents. Therefore, when the existing extents of a segment are full, ORACLE allocates another extent for that segment. Because extents are allocated as needed, the extents of a segment may or may not be contiguous on disk, and may or may not span files. An Oracle database can use four types of segments:

Data segmentStores user data within the database. Index segmentStores indexes. Rollback segmentStores rollback information. This information is used when data must be rolled back.

Temporary segmentCreated when a SQL statement needs a temporary work area; these segments are destroyed when the SQL statement is finished. These segments are used during various database operations, such as sorts.

Schema : The database schema is a collection of logical-structure objects, known as schema objects that define how you see the databases data. A schema also defines a level of access for the users. All the logical objects in oracle are grouped into a schema. A schema is a logical grouping of objects such as:

Tables Clusters Indexes Views Stored procedures Triggers Sequences

Physical Structure : The physical layer of the database consists of three types of files: 1. One or more Datafiles 2. Two or more redo log files 3. One or more control files Datafiles (.DB F Files): Datafiles store the information contained in the database. One can have as few as one data file or as many as hundreds of datafiles. The information for a single table can span many datafiles or many tables can share a set of datafiles. Spreading tablespaces over many

datafiles can have a significant positive effect on performance. The number of datafiles that can be configured is limited by the Oracle parameter MAXDATAFILES. Redo Logs Files (.RDO & .ARC): Oracle maintains logs of all the transaction against the database. These transactions are recorded in files called Online Redo Log Files (Redo Logs). The main purpose of the Redo log files is to hold information as recovery in the event of a system failure. Redo log stores a log of all changes made to the database. The redo log files must perform well and be protected against hardware failures (through software or hardware fault tolerance). If redo log information is lost, one cannot recover the system. When a transaction occurs in the database, it is entered in the redo log buffers, while the data blocks affected by the transactions are not immediately written to disk. In an Oracle database there are at least three or more Redo Log files. Oracle writes to redo log file in a cyclical order i.e. after the first log file is filled, it writes to the second log file, until that one is filled. When all the Redo Log files have been filled, it returns to the first log file and begin overwrite its content with new transaction data. Note, if the database is running in the ARCHIVELOG Mode, the database will make a copy of the online redo log files before overwriting them. Control Files (.CTL ): Control files record control information about all of the files within the database. These files maintain internal consistency and guide recovery operation. Control files contain information used to start an instance, such as the location of datafiles and redo log files; Oracle needs this information to start the database instance. Control files must be protected. Oracle provides a mechanism for storing multiple copies of control files. These multiple copies are stored on separate disks to minimize the potential damage due to disk failure. The names of the databases control files are specified via the CONTROL_FILES initialization parameter. Oracle Instance: An Oracle Server instance is made up of Oracles main memory structure, called the System Global Area (SGA), and several Oracle background processes. It is with the SGA that the Server Process communicates when the user accesses the data in the database.

The System Global Area: The SGA is made up of three required components and three optional components. Required Components Shared Pool (Required):Caches the most recently used SQL statements that have been issued by database users Database Buffer Cache (Required) : Caches the data that has been most recently accessed by database users Redo Log Buffer (Requires) : Stores transaction information for recovery purposes Java Pool (Optional): Caches the most recently used Java objects and application code when Oracles JVM option is used Large Pool (Optional):: Caches data for large operations such as Recovery Manager (RMAN) backup and restore activities and Shared Server components Streams Pool (Optional): Caches the data associated with queued message requests when Oracles Advanced Queuing option is used With the advent of so many big enterprises, the need to create a more sophisticated DBMS has also increased. For appointment as a DBA, a high level of skill and expertise is required. The major tasks that should be performed by a DBA are as follows:

Judging what server hardware will be required to run the Oracle 10g database software Installing and configuring the Oracle 10g database software on the server hardware Creating a database and managing tables and other database objects Creating and managing database users Configuring backup and recovery processes for the database Monitoring and tuning the database performance

Now, the point is how a DBA can perform the above-mentioned tasks. To perform all these tasks in an efficient manner, a DBA must be very well versed with the underlying Oracle architecture. The Oracle server architecture The Oracle server architecture is basically categorized as follows:

Logical layer Physical layer

The logical layer comprises one or more tablespaces and the database schema. The database schema consists of tables, clusters, indexes, views, procedures, triggers, sequences, and so on. The database schema is a collection of schema objects.

The relationship between segments, extents, and data blocks. The hierarchy of Oracle disk-space management is as follows:

Tablespaces: These are at the highest level of Oracle disk-space management. Segments Extents Data blocks: These are at the lowest level of Oracle disk-space management.[5]

Differences between Oracle 9i and Oracle 10g :Each release of Oracle has many differences, and Oracle 10g is a major re-write of the Oracle kernel from Oracle 9i. I keep a list of the differences. While there are several hundred new features and other differences between 9i and 10g, here are the major differences between Oracle9i and Oracle10g:

Major changes to SQL optimizer internals Oracle Grid computing AWR and ASH tables incorporated into Oracle Performance Pack and Diagnostic Pack options

Automated Session History (ASH) materializes the Oracle Wait Interface over time Data Pump replaces imp utility with impdp Automatic Database Diagnostic Monitor (ADDM) SQL Tuning Advisor SQL Access Advisor Rolling database upgrades (using Oracle10g RAC)

New Features of Oracle10g :

Web server load balancing - The web cache component includes Apache extension to load-balance transactions to the least-highly-loaded Oracle HTTP server (OHS).

RAC instance load balancing - Staring in Oracle 10g release 2, Oracle JDBC and ODP.NET provide connection pool load balancing facilities through integration with the new load balancing advisory tool. This replaces the more-cumbersome listenerbased load balancing technique.

Automated Storage Load balancing - Oracles Automatic Storage Management (SAM) now enables a single storage pool to be shared by multiple databases for optimal load balancing. Shared disk storage resources can alternatively be assigned to individual databases and easily moved from one database to another as processing requirements change.

Data Guard Load Balancing Oracle Data guard allows for load balancing between standby databases.

Listener Load Balancing - If advanced features such as load balancing and automatic failover are desired, there are optional sections of the listener.ora file that must be present. Automatic Storage Management (ASM) includes multiple disk operations and a non-ASM database migration utility

Extended use of Standard Chunk sizes - In 10gR2, the server has been enhanced to further leverage standard chunk allocation sizes. This additional improvement reduces the number of problems arising from memory fragmentation.

Mutexes - To improve cursor execution and also hard parsing, a new memory serialization mechanism has been created in 10gR2. For certain shared-cursor related operations, mutexes are used as a replacement for library cache latches and library cache pins. Using mutexes is faster, uses less CPU and also allows significantly improved concurrency over the existing latch mechanism. The use of mutexes for cursor pins can be enabled by setting the init.ora parameter_use_kks_mutex to TRUE.

V$OPEN_CURSOR - This implementation of this view has also been enhanced to be latchless, making it inexpensive to query.

Installation Steps on Windows :Step 1: Installing Personal Oracle 10g 1-1. Insert the Oracle 10g Database10.1. 1-2. Select the Install/Deinstall Products button. 1-3. The Welcome window opens. 1-4. Select Advanced Installation 1-5. Click the Next button. 1-6. The File Locations window opens. 1-7. Change the Destination Name to: OraHome10 1-8. Change the Destination Path to c:\oracle\product\10.1.0\OraHome10

NOTE: Adjust accordingly if you want to install Oracle on a drive other than C:. If you use a different destination path, please write it down. You will need to enter this path later during configuration. 1-9. Click the Next button. 1-10. The Select Installation Type window opens. 1-11. Select Personal Edition (804 MB). 1-12. Click the Next button. 1-13. You may see the following error message several times during your installation. Click the Continue button each time you see the message.

1-14. The Select Database Configuration window opens. 1-15. Select General Purpose. 1-16. Click the Next button. 1-17. The Specify Database Configuration Options window opens. Enter: a. Global Database Name: db1 b. SID: db1 c. Select Create database with samples schemas. 1-18. Click the Next button. 1-19. The Select Database Management Option window opens 1-20. Click the Next button. 1-21. The Specify Database File Storage Option window opens. 1-22. Keep the default or select a different directory for your database files. 1-23. Click the Next button. 1-24. The Specify Backup and Recovery Options window opens. 1-25. Keep the default settings and click the Next button. 1-26. The Specify Database Schema Passwords window opens. a. Select Use the same password for all the accounts b. In the Enter Password and Confirm Password fields type johnheinz 1-27. Click the Next button. 1-28. The Summary window opens. 1-29. Click the Install button. 1-30. The Install window opens. During the Installation: a. The Configuration Assistant window appears. No action is required. b. The Database Configuration Assistant progress window appears. No action is

required. 1-31. The Database Configuration Assistant window opens. 1-32. Click the OK button. 1-33. The Configuration Assistant window reappears. Take no action. 1-34. The End of Installation window will appear. 1-35. Click the Exit button. 1-36. The Exit window will display. 1-37. Click the Yes button. 1-38. After a minute or two, Internet Explorer will open and the Oracle Enterprise Manager Database Control site opens. Login to the control using the following credentials: a. User Name: sys b. Password johnheinz (or the password you choose to use in step 1-27) c. Connect As: change to SYSDBA NOTE: If the Oracle Enterprise Manager Database Control site does not open automatically, open Internet Explorer and go to http://localhost:5500/em 1-39. Click the Login button. 1-40. The Oracle Database Licensing Information 10g web page appears. 1-41. Click the I Agree button located at the bottom of the page. 1-42. The Database Control web page appears. You can view the many of the database management metrics like status, uptime and availability. You can also perform many administrative functions like user management and maintenance. 1-43. Click the Administration link. 1-44. Under the Security section, click the Users link. 1-45. The Users web page appears. 1-46. In the UserName column, click Scott 1-47. The Scott User web page appears. By default, all user accounts are locked when Oracle is installed. The Scott user account is used for testing and tutorial purposes. 1-48. In the Enter Password and Confirm Password fields, type tiger 1-49. In the Status field, select Unlocked. 1-50. Click the Apply button. 1-51. The Scott User web page will refresh and an update message will appear at the top of the page. 1-52. Close Internet Explorer.

Step 2: Confirm the test database is functioning properly 2-1. Start Oracle SQL Plus: a. Click Start b. Select All Programs. c. Select Oracle OraHome10 d. Select Application Development e. Select SQL Plus 2-2. The Log On window opens. 2-3. Login as: a. User Name: scott b. Password: tiger c. Host string is blank. 2-4. Click the OK button. 2-5. The Oracle SQL Plus window opens.

Step 3: Configure the Listener. By changing the Host name to the localhost (127.0.0.1) you can change your computer name without changing the Oracle configuration. 3-1. Start the Oracle Net Manager a. Click Start b. Select All Programs c. Select Oracle OraHome10 d. Select Configuration and Migration Tools e. Select Net Manager 3-2. Expand the Local folder by double clicking it. 3-3. Expand the Listeners folder by double clicking it. 3-4. Select LISTENER by single clicking it. 3-5. Select the Address2 Tab. 3-6. Change Host to 127.0.0.1 Note: Accept all other default settings, dont change them. 3-7. At the top of the configuration page, select Database Services. 3-8. The Database Services page appears. At the bottom of the page, click the Add Database button.

3-9. The Database Services page will refresh. Enter the following into the fields: a. Global Database Name: DB1 b. Oracle Home Directory: c:\oracle\product\10.1.0\OraHome10 c. SID: DB1 3-10. From the File menu select Exit. 3-11. In the Changed Configuration Confirmation dialog box, select Save.

Step 4: Reboot your computer. Close all open windows. Remove the CD. Reboot your computer.

Step 5: Create a Net Service Name for the Oracle database. The net services name DB1 will be used as the Host string for your personal database. 5-1. Start the Oracle Net Configuration Assistant a. Click Start b. Select All Programs c. Select Oracle OraHome10 d. Select Configuration and Migration Tools e. Select Net Configuration Assistant 5-2. Select Local Net Service Name configuration. 5-3. Click the Next button. 5-4. The Net Service Name Configuration window opens. 5-5. Select Add 5-6. Click the Next button. 5-7. The Service Name window opens. 5-8. Enter DB1 in the Service Name field. 5-9. Click the Next button. 5-10. The Select Protocols window opens. 5-11. Select TCP. 5-12. Click the Next button. 5-13. The TCP/IP Protocols window opens. 5-14. Enter 127.0.0.1 in the Host Name: field. 5-15. Click the Next Button.

5-16. The Test window prompts to test the connection. 5-17. Select Yes, perform a test. 5-18. Click the Next button. 5-19. The ConnectingTest successful message window opens. Note: If you receive the following error message ORA-01017: invalid username/password; logon denied, click the Change Login button. The Change Logon window appears. For the Username type: scott for the Password type: tiger. Click OK button. The test should succeed. 5-20. Click the Next button. 5-21. The Net Service Name window opens. 5-22. Enter DB1 for the Net Service Name. 5-23. Click the Next button. 5-24. The Another Net Service Name? window opens. 5-25. Select a No. 5-26. Click the Next button. 5-27. The Net Service Name Configuration Done window opens. 5-28. The Net service name Configuration Complete message opens. 5-29. Click the Next button. 5-30. The Net8 Configuration Assistant: Welcome window reopens. 5-31. Click the Finish button.

Step 6 Install the Oracle 10g Client and Administration Tools 6-1. Insert the Oracle 10g Client CD. The installer program will autostart. 6-2. Select the Install/Deinstall Products button. 6-3. The Welcome window appears. Click the Next button. 6-4. The Specify File Locations window opens. At the end of the Name field, click on the arrow and select OraHome10. The Path field should change to c:\oracle\products\10.1.0\OraHome10. Click the Next button. 6-5. The Select Installation Type window appears. Select Administrator (460 MB) and click the Next button. 6-6. The Summary window appears. Click the Install button. 6-7. The Install window appears. 6-8. During the install, you may receive the following error message. Click the Ignore button.

6-9. The End of Installation window appears. Oracle 10g Client is now installed. Click the Exit button. 6-10. The Confirm Exit dialog box appears. Click the Yes button.

Step 7: Install Oracle 10g Web Server 7-1. Insert the Oracle 10g Database Companion CD. The autostart program will appear. Click the Install/Deinstall Products button. 7-2. The Welcome window appears. Click the Next button. 7-3. The Specify File Locations window appears. In the Destination section, change the following fields: a. Name: OraComp10 b. Path: c:\oracle\product\10.1.0\OraComp10 Click the Next button. 7-4. The Select a Product to Install window appears. Select Oracle Database 10g Companion Products 10.1.0.2.0 and click the Next button. 7-5. The Available Product Components window opens. In the Components column, select Apache Standalone 9.0.4.0.0 and HTML DB 10.1.0.2.0. Click the Next button. 7-6. The Enter HTML DB Configuration Information window appears. Enter the following in the fields: a. Hostname: 127.0.0.1 b. Port: 1521 c. Database Service Name: db1 d. SYS password: johnheinz e. HTML DB Password: johnheinz f. Confirm HTML DB Password johnheinz g. TABLESPACE Name: SYSAUX Click the Next button. 7-7. The Summary window appears. Click the Install button. 7-8. The Install window appears. 7-9. The End of Installation window appears. Click the Exit button. 7-10. The Exit dialog box opens. Click the Yes button.[6]

REFERENCES:1. http://www.ntchosting.com/databases/structured-query-language.html 2. http://cplus.about.com/od/thebusinessofsoftware/a/whatissql.html 3. http://lambda.uta.edu/cse5331/spring98/plsql.html 4. http://lrc.surcollege.net/ebooks/Arabic_Books/Oracle/Books/Introduction%20t o%20Oracle9i_SQL-Instructor%20Guide%20Volume%201.pdf 5. http://initora.wordpress.com/article/oracle-10g-architecture-with-diagram232y3pcqwxodx-32/ 6. students.heinz.cmu.edu/docs/Oracle_10g_Installation.pdf

Name of Teacher

Sign

Das könnte Ihnen auch gefallen