Oracle-database

Java-Examples

                                                                                                                                                                                                                    Show all | Close all
  • Introduction to oracle database

    • What is oracle database

      The Oracle Database (commonly referred to as Oracle RDBMS or simply as Oracle) is an object-relational database management system (ORDBMS)[2] produced and marketed by Oracle Corporation.

      Larry Ellison and his friends, former co-workers Bob Miner and Ed Oates, started the consultancy Software Development Laboratories (SDL) in 1977. SDL developed the original version of the Oracle software. The name Oracle comes from the code-name of a CIA-funded project Ellison had worked on while previously employed by Ampex.
    • Physical and logical structures

      An Oracle database system-identified by an alphanumeric system identifier or SID[4]-comprises at least one instance of the application, along with data storage. An instance-identified persistently by an instantiation number (or activation id: SYS.V_$DATABASE.ACTIVATION#)-comprises a set of operating-system processes and memory-structures that interact with the storage. (Typical processes include PMON (the process monitor) and SMON (the system monitor).) Oracle documentation can refer to an active database instance as a "shared memory realm".[5]
      Users of Oracle databases refer to the server-side memory-structure as the SGA (System Global Area). The SGA typically holds cache information such as data-buffers, SQL commands, and user information. In addition to storage, the database consists of online redo logs (or logs), which hold transactional history. Processes can in turn archive the online redo logs into archive logs (offline redo logs), which provide the basis (if necessary) for data recovery and for the physical-standby forms of data replication using Oracle Data Guard.

      If the Oracle database administrator has implemented Oracle RAC (Real Application Clusters), then multiple instances, usually on different servers, attach to a central storage array. This scenario offers advantages such as better performance, scalability and redundancy. However, support becomes more complex, and many sites do not use RAC. In version 10g, grid computing introduced shared resources where an instance can use (for example) CPU resources from another node (computer) in the grid.

      The Oracle DBMS can store and execute stored procedures and functions within itself. PL/SQL (Oracle Corporation's proprietary procedural extension to SQL), or the object-oriented language Java can invoke such code objects and/or provide the programming structures for writing them.
    • Storage

      The Oracle RDBMS stores data logically in the form of tablespaces and physically in the form of data files ("datafiles").[6] Tablespaces can contain various types of memory segments, such as Data Segments, Index Segments, etc. Segments in turn comprise one or more extents. Extents comprise groups of contiguous data blocks. Data blocks form the basic units of data storage.
      Newer versions of the database can also include a partitioning feature: this allows the partioning of tables based on different set of keys. Specific partitions can then be easily added or dropped to help manage large data sets.

      Oracle database management tracks its computer data storage with the help of information stored in the SYSTEM tablespace. The SYSTEM tablespace contains the data dictionary-and often (by default) indexes and clusters. A data dictionary consists of a special collection of tables that contains information about all user-objects in the database. Since version 8i, the Oracle RDBMS also supports "locally managed" tablespaces which can store space management information in bitmaps in their own headers rather than in the SYSTEM tablespace (as happens with the default "dictionary-managed" tablespaces). Version 10g and later introduced the SYSAUX tablespace which contains some of the tables formerly in the SYSTEM tablespace.
  • Histroy

        1977: Larry Ellison and friends founded Software Development Laboratories (SDL)
          1979: SDL changed its company-name to "Relational Software, Inc." (RSI) and introduced its product Oracle V2 as an early commercially available relational database system. The version did not support transactions, but implemented the basic SQL functionality of queries and joins. (RSI never released a version
            1 - instead calling the first version version 2 as a marketing gimmick.).
            1982: RSI in its turn changed its name, becoming known as "Oracle Corporation",[44] to align itself more closely with its flagship product.
            1983: The company released Oracle version 3, which it had re-written using the C programming language and which supported COMMIT and ROLLBACK functionality for transactions. Version 3 extended platform support from the existing Digital VAX/VMS systems to include Unix environments.
            1984: Oracle Corporation released Oracle version 4, which supported read-consistency.
            1985: Oracle Corporation released Oracle version 5, which supported the client-server model-a sign of networks becoming more widely available in the mid-1980s.
            1986: Oracle version 5.1 started supporting distributed queries.
            1988: Oracle RDBMS version 6 came out with support for PL/SQL embedded within Oracle Forms v3 (version 6 could not store PL/SQL in the database proper), row-level locking and hot backups.
            1989: Oracle Corporation entered the application products market and developed its ERP product, (later to become part of the Oracle E-Business Suite), based on the Oracle relational database.
            1990: the release of Oracle Applications release 8[44]
              1992: Oracle version 7 appeared with support for referential integrity, stored procedures and triggers.
              1997: Oracle Corporation released version 8, which supported object-oriented development and multimedia applications.
              1999: The release of Oracle8i aimed to provide a database inter-operating better with the Internet (the i in the name stands for "Internet"). The Oracle8i database incorporated a native Java virtual machine (Oracle JVM, also known as "Aurora").
              2000: Oracle E-Business Suite 11i pioneers integrated enterprise application software[44]
                2001: Oracle9i went into release with 400 new features, including the ability to read and write XML documents. 9i also provided an option for Oracle RAC, or "Real Application Clusters", a computer-cluster database, as a replacement for the Oracle Parallel Server (OPS) option.
                2002: the release of Oracle 9i Database Release 2 (9.2.0).
                2003: Oracle Corporation released Oracle Database 10g, which supported regular expressions. (The g stands for "grid"; emphasizing a marketing thrust of presenting 10g as "grid computing ready".)
                2005: Oracle Database 10.2.0.1-also known as Oracle Database 10g Release 2 (10gR2)-appeared.
                    2006: Oracle Corporation announces Unbreakable Linux[44] and acquires i-flex.
                        2007: Oracle Database 10g release 2 sets a new world record TPC-H 3000 GB benchmark result.
                            2007: Oracle Corporation released Oracle Database 11g for Linux and for Microsoft Windows.
                                2008: Oracle Corporation acquires BEA Systems.
                                    2010: Oracle Corporation acquires Sun Microsystems.
                                        2011: Oracle Corporation acquires web content management system FatWire Software.
  • platform that works

    Prior to releasing Oracle 9i in 2001, Oracle Corporation ported its database product to a wide variety of platforms. More recently Oracle Corporation has consolidated on a smaller range of operating-system platforms.
    As of November 2011, Oracle Corporation supported the following operating systems and hardware platforms for Oracle Database 11g (11.2.0.2.0):
      zLinux64
      Microsoft Windows (32-bit)
      Microsoft Windows (x64)
      Linux x86
      Linux x86-64
      Solaris (SPARC) (64-bit)
      Solaris (x86-64)
      HP-UX Itanium
      HP-UX PA-RISC (64-bit)
      AIX (PPC64)

    In 2011, Oracle Corporation announced the availability of Oracle Database Appliance, a pre-built, pre-tuned, highly available clustered database server built using two SunFire X86 servers and direct attached storage.
  • How to install oracle database 11g

    [Oracle 11g Logo]This is a 16 step Oracle 11g installation guide that covers a typical installation scenario with screenshots.

    1. Select installation method

    Following two installation methods are available:
    • Basic Installation – Choose this to perform the full Oracle Database 11g installation with standard configuration options. You can use only filesystem for storage in this option.
    • Advanced Installation – This gives your full control over the installation, including the ability to choose Automatic Storage Management. Select this option as shown below.

    [Select Installation Method]
    Fig - Select Installation Method

    2. Specify Inventory directory and credentials

    Enter the following information:
    • Enter the inventory directory: /u01/app/oraInventory
    • Specify operating system group name: oinstall
    [Specify Inventory Directory]
    Fig - Specify Inventory directory and credentials

    3. Select Installation Type

    Following three installation types are available:
    • Enterprise Edition – Select this option.
    • Standard Edition
    • Custom
    [Select Installation Type]
    Fig - Select Installation Type

    4. Specify Install Location

    Enter the following information:
    • Oracle Base: /u01/app/oracle
    • Name: Oracle_Home
    • Path: /u01/app/oarcle/product/11.1.0
    [Specify Install Location]
    Fig - Select Install Location

    5. Product-Specific Prerequisite Checks

    In this screen, the Installer verifies that your environment meets all of the minimum requirements for installing and configuring the products that you have chosen to install. You must manually verify and confirm the items that are flagged with warnings and items that require manual checks.

    6. Select Configuration Option

    Following three configuration options are available:
    • Create a Database – Select this option.
    • Configure Automatic Storage Management (ASM)
    • Install Software Only
    [Select Configuration Option]
    Fig - Select Configuration Option

    7. Select a Database Configuration

    Following three database configuration options are available.
    • General Purpose/Transaction Processing – Select this option.
    • Data Warehouse
    • Advanced
    [Select Database Configuration]
    Fig - Select Database Configuration

    8. Specify Database Configuration

    Enter the following information:
    • Global Database Name: devdb.example.com . An Oracle database is uniquely identified by a Global Database Name, typically of the form “name.domain”
    • SID: devdb

    9. Specify Database Configuration Details

    There are four different tabs in this screen as shown below:
    • Memory Tab
      • Select the check-box to Enable Automatic Memory Management
      • Drag the bar to allocate the memory. This will automatically allocate memory size for SGA and PGA depending on the total database memory allocated.
    • Character Sets Tab. Following three character set options are given in this tab.
      • Use the default
      • Use Unicode (AL32UTF8)
      • Choose from the list of character sets. Select Database Character Set as Unicode standard UTF-8AL32UTF8 – Select this option.
    • Security Tab – Just leave the defaults in this tab.
    • Sample Schema Tab – Just leave the defaults in this tab.
    [Specify Config Details for Memory]
    Fig - Select Database Config Details with Memory Tab

    10. Select Database Management Option

    Following two management options are available:
    • Use Grid Control for Database Management
      • Management Service: Choose an agent.
    • Use Database Control for Database Management- Select this option.
      • Select the check-box to Enable Email Notifications
      • Outgoing mail (SMTP) Server:
      • Email Address:
    [Select DB Management Option]
    Fig - Select Database Management Option

    11. Specify Database Storage Option

    Following two storage options are available:
    • File System – Select this option.
      • Specify Database File location: /u01/app/oracle/oradata/
    • Automatic Storage Management. ASM simplifies database storage administration and optimizes database layout for I/O performance.

    12. Specify Backup and Recovery Option

    Enable automated backup as shown below. If you’ve configured ASM, you can choose to store the automated backups on ASM. If not, select File System option.
    [Specify Backup Recovery Option]
    Fig - Specify Backup and Recovery Options

    13. Specify database schema password

    Enter the password for sys, system, sysman, dbsnmp schemas. You have the option of either using the same passwords or different password for all the accounts in this screen.

    14. Privileged Operating System Groups

    Enter the following information in this screen:
    • Database Administrator (OSDBA) Group: dba
    • Database Operator (OSOPER) Group: dba
    • ASM administrator (OSASM) Group: dba

    15. Oracle Configuration Manager Registration

    You can associate your configration information with your metalink account as shown below.
    [Oracle Configuration Manager]
    Fig - Oracle Configuration Manager Registration

    16. Final Summary Screen

    This will display a summary of all the installation option you’ve selected so far. Click on Install to complete the installation.
  • How to install oracle database 10g

    Installing Oracle Database 10g on Windows

    In this tutorial, you learn how to install Oracle Database 10g on Windows.
    This tutorial covers the following topics:
    Overview
    Installing Oracle Database 10g on Windows
    Post Installation Tasks
    Testing Your Installation
    Summary
    Place the cursor over this icon to load and view all the screenshots for this tutorial. (Caution: This action loads all screenshots simultaneously, so response time may be slow depending on your Internet connection.)
    Note: Alternatively, you can place the cursor over an individual icon in the following steps to load and view only the screenshot associated with that step. You can hide an individual screenshot by clicking it.
    Using the Oracle Universal Installer, you install the Oracle Database 10g software and create a database.
    To install the Oracle software, you must use the Oracle Universal installer.
    1.
    For this installation you need either the DVDs or a downloaded version of the DVDs. In this tutorial, you install from the downloaded version. From the directory where the DVD files were unzipped, double-click setup.exe.
    2.
    The Oracle Universal Installer starts.
    3.
    You will perform a basic installation with a starter database. Enter orcl for the Global Database Name and oracle for the Database Password and Confirm Password. Then click Next.
    4.
    The installer now verifies that the system meets all the minimum requirements for installing and configuring the chosen product. Please correct any reported errors (warnings are OK) before continuing. When the check successfully completes (with or without warnings), click Next.
    5.
    If you received any warnings, you can proceed. Click Yes.
    6.
    Review the Summary window to verify what is to be installed. Then, click Install.
    7.
    The progress window appears.
    8.
    The Configuration Assistants window appears.
    9.
    Your database is now being created.
    10.
    When the database has been created, you can unlock the users you want to use. Click Password Management.
    11.
    Unlock SH, OE and HR users by clicking on the check mark in the Lock Account? column. Enter the same name as the user in the New Password and Confirm Password fields. For example, to unlock SH user, enter SH in the New Password and Confirm Password fields. Then, click OK.
    12.
    Click OK again.
    13.
    Click Exit.
    14.
    Click Yes to confirm exit.
    For additional functionality within DB Control, functionality such as starting and stopping the database, an operating system user must belong to the ORA_DBA group. An existing user can be used or a new user can be created. This topic shows you how to create the operating system user oracle and make the user part of the ORA_DBA group:
  • How to install oracle database 9i

      Installing the Oracle 9i Database
      Step 1

    Log into the host PC as Administrator or as a user with full administrative privileges. If you are not logged in with the proper privileges, log off and then log on with an appropriate account.
      Step 2
    Insert the Oracle installation CD into the CD-ROM drive of the host PC for the database. If the installer does not start automatically, use Start > Run to execute Oracle’s setup.exe program.
    The installer displays a Welcome panel.
      Step 3
    Click Next to proceed to the File Locations panel. The installer prompts you for an installation path in the File Locations panel. Oracle (9.2.0.1.0) requires about 2.8 GB of disk space.
      Step 4
    Enter an installation path that resides on a disk with adequate free space. Click
    Next to proceed.
    The installer prompts you for the Oracle product to install in the Available Products panel.
      Step 5

    Select the Oracle 9i Database product. Click Next to proceed. The installer prompts you for the type of installation in the Installation Types panel.
      Step 6

    Select a Personal, Standard, or Enterprise edition installation. Any of these editions can be used with Virtual Network Data Server. The Enterprise edition is recommended for best scalability and performance.
      Step 7

    Click Next to proceed. The installer prompts you for the type of database in the Database Configuration panel.
      Step 8>

    Select General Purpose. Click Next to proceed. The installer prompts you for the port number for the Oracle MTS Recovery Service.
      Step 9

    Leave the default port number (2030) unchanged. Click Next to proceed. The installer prompts you for a global database name (GDN) in the Database Identification panel. Virtual Network Data Server will work with any valid GDN and SID that Oracle accepts.
    Answer with a GDN constructed according to the following rules:

      Global Database Name = o92a..com
      Example: o92avnes.opnet.com
      The installer prompts you for a system ID (SID). Some examples follow:
        • o92a
        • o92avnes
        • vnesDB

        Step 10
      Enter the SID you wish to use. After entering a GDN and SID, click Next to continue to the Database File Location panel.
      The installer prompts you for the Database File Location.
        Step 11
      Keep the default location and click Next to proceed.
      The installer prompts you for the Database Character Set.
        Step 12
      Choose a supported character set and click Next to proceed with file installation.
      The Oracle installer takes up to 30 minutes to copy files to the installation directories. Oracle 9i has three installation CDs. The installer prompts you to insert a new CD in the CD-ROM drive when it is ready to copy files from the next CD.

      During this time, Install, Configuration Tools, and Database Creation panels appear.
        Step 13

      Click Next or OK to proceed through these panels.
      Oracle 9i (9.2.0.1.0) installation is now complete.
  • How to unistall oracle database

    1. Uninstall all Oracle components using the Oracle Universal Installer (OUI).
    2. Run regedit.exe and delete the HKEY_LOCAL_MACHINE/ SOFTWARE/ORACLE key. This contains registry entire for all Oracle products.
    3. Delete any references to Oracle services left behind in the following part of the registry: HKEY LOCAL MACHINE/ SYSTEM/ CurrentControlsSet/ Services/Ora*. It should be pretty obvious which ones relate to Oracle
    4. Reboot your machine.
    5. Delete the C: \Oracle directory, or whatever directory is your Oracle_Base.
    6. Delete the C:\Program Files \Oracle directory.
    7. Empty the contents of your c:\temp directory.
    8. Empty your recycle bin.

    Installing Oracle 10g database software :

    1. Insert Oracle CD , the autorun window opens automatically. If you are installing from network or hard disk, click setup.exe in the installation folder.
    2. The Oracle Universal Installer (OUI) will run and display the Select Installation Method Window. oracle10g installation
    3. Choose Basic Installation:
      Select this option to quickly install Oracle Database 10g. This method requires minimal user input. It installs the software and optionally creates a general-purpose database based on the information you provide.
      For basic installation, you specify the following:
      Oracle Home Location - Enter the directory in which to install the Oracle Database 10g software. You must specify a new Oracle home directory for each new installation of Oracle Database 10g. Use the default value, which is :
      c:\oracle\product\10.2.0\db_1

      Installation Type - Select Enterprise Edition :
      If you have limited space, select standard edition. Personal edition installs the same software as the Enterprise Edition, but supports only a single-user development and deployment environment.
      Create Starter Database - Check this box to create a database during installation. Oracle recommends that you create a starter database for first Create Starter Database - time installations. Choose a Global Database Name, like cs157b, or just use the default value.
      Type a password. Don't lose this password, since you will need it to connect to the database server.
      Click next
    4. The Product-Specific Prerequisite Checks window appears: Click next
      oracle10g installation
    5. A summary screen appears showing information such as your global settings, space requirements and the new products to be installed. Click Install to start the installation..
    6. The Install window appears showing installation progress.
      oracle10g_installation
    7. At the end of the installation phase, the Configuration Assistants window appears. This window lists the configuration assistants that are started automatically.
      If you are creating a database, then the Database Configuration Assistant starts automatically in a separate window.
      oracle 10g installation
      oracle 10g installation
      At the end of database creation, you are prompted to unlock user accounts to make the accounts accessible. The SYS and SYSTEM accounts are already unlocked. Click OK to bypass password management.
      oracle 10g installation

      Note: Oracle 10g still keeps scott / tiger username and password (UID=scott, PWD=tiger) from the old version of oracle. In the old version of oracle, scott/tiger user ID is available by default, but not in oracle 10g. If you want to use scott /tiger account, you must unlock it by clicking "Password Management" at the last window.
      Password Management window will appear like the one shown below. Find the user name "Scott" and uncheck the "Lock Account?" column for the user name.
    8. Your installation and database creation is now complete. The End of Installation window displays several important URLs, one of which is for Enterprise Manager.

      oracle 10g installation
    9. You can navigate to this URL in your browser and log in as the SYS user with the associated password, and connect as SYSDBA. You use Enterprise Manager to perform common database administration tasks
      Note : you can access Oracle Enterprise Manager using browser by typing the URL shown above in your browser. Instead of typing the IP address, you can also access the Enterprise Manager by typing http://localhost:1158/em or "http://[yourComputerName]:1158/em" or by clicking "Start >> All Programs >> Oracle - [YourOracleHome_home1] >> Database Control - [yourOracleID]" in Windows menu.
      By default, use user ID "SYSTEM", with the password that you have chosen at the beginning of installation, to connect to database, SQLPlus, etc. If you want to use other user ID, you may create a new user .
  • Version numbering...


    some sources refer to Oracle Applications Release 11i as Oracle 11i.[clarification needed] The suffixes "i", "g" and "c" do not actually represent a low-order part of the version number, as letters typically represent in software industry version numbering; that is, there is no predecessor version of Oracle 10g called Oracle 10f. Instead, the letters stand for "internet", "grid" and "cloud", respectively.[citation needed] Consequently many simply drop the "g" or "i" suffix when referring to specific versions of an Oracle product.

      Major database-related products and some of their versions include:

      Oracle Application Server 10g (also known as "Oracle AS 10g"): a middleware product;
      Oracle Applications Release 11i (aka Oracle e-Business Suite, Oracle Financials or Oracle 11i): a suite of business applications;
      Oracle Developer Suite 10g (9.0.4);
      Oracle JDeveloper 10g: a Java integrated development environment;
      Since version 5, Oracle's RDBMS release numbering has used the following codes:
      Oracle v5
      Oracle v6
      Oracle7: 7.0.16–7.3.4
      Oracle8 Database: 8.0.3–8.0.6
      Oracle8i Database Release 1: 8.1.5.0–8.1.5.1
      Oracle8i Database Release 2: 8.1.6.0–8.1.6.3
      Oracle8i Database Release 3: 8.1.7.0–8.1.7.4
      Oracle9i Database Release 1: 9.0.1.0–9.0.1.5 (patchset as of December 2003)
      Oracle9i Database Release 2: 9.2.0.1–9.2.0.8 (patchset as of April 2007)
      Oracle Database 10g Release 1: 10.1.0.2–10.1.0.5 (patchset as of February 2006)
      Oracle Database 10g Release 2: 10.2.0.1–10.2.0.5 (patchset as of April 2010)
      Oracle Database 11g Release 1: 11.1.0.6–11.1.0.7 (patchset as of September 2008)
      Oracle Database 11g Release 2: 11.2.0.1–11.2.0.3 (patchset as of September 2011)

    The version-numbering syntax within each release follows the pattern: major.maintenance.application-server.component-specific.platform-specific.

  • Download

    Click here to download Oracle database
    Click Here to download Oracle database 11g
    Click Here to download oracle database 10g
    Click Here to download Oracle database 9i