Oracle installation overview: Install Oracle9i (9.2 Enterprise Edition ). Start from the installation file softwareoracle9i_9.2disk1setup.exe. Step: 01, OracleUniversalInstaller: Welcome to use OracleUniversalInstaller: Oracle's common Installation tool. It can install or Uninstall all or part of Oracle
Oracle installation overview: Install Oracle9i (9.2 Enterprise Edition ). Steps from the installation file software \ Oracle9i_9.2 \ Disk1 \ setup.exe: 01. Oracle Universal Installer: Welcome to the Oracle Universal Installer: Oracle Universal Installation tool. It can install or Uninstall all or part of Oracle
Install Oracle
Overview: Install Oracle9i (9.2 Enterprise Edition ). Start from the installation file software \ Oracle9i_9.2 \ Disk1 \ setup.exe
Step: 01. Oracle Universal Installer: Welcome
Oracle Universal Installer: A common Installation Tool for Oracle. It can install or Uninstall all or part of Oracle components
02. Universal Installer: File Location
In the source path, the system automatically monitors the path of resources required by the current installer. Set the work main directory and complete path in the target Block
The main directory name can be set to OraHome92, which is specified by the system. The path can be saved in other partitions.
During database installation, Oracle automatically creates an oracle folder in the system disk's program files as the system directory
In practice, to ensure data security and operational efficiency, it is not recommended to place the home directory and system directory on the same disk partition.
03. Universal Installer: available products
Oracle9i Database 9.2.0.1.0 install the Database. Select to install the database. It already contains the following two components:
Oracle9i Management and Integration 9.2.2.1.0 install Management and Integration tools
Oracle9i Client 9.2.0.1.0 install the Client
04. Universal Installer: installation type
Install the Enterprise Edition (2.86 GB ). It is relatively larger and more powerful
05. Universal Installer: Database Configuration
Choose to install universal configuration here
06. Universal Installer: Oracle Services for Microsoft Transaction Server
By default. When Oracle9i is installed in this tutorial, the port number is 2030. In this tutorial, select the default
07. Universal Installer: Database ID
In the tutorial, set the global database name to ora9. The system identifier SID follows the default value, that is, ora9.
The system identifier SID identifies an instance when the operating system is used to deal with an instance of a database.
In real applications, you can add the Domain Name of the database server after the global database name, such as Beijing: ora9.bj. china
In this way, you can have multiple database servers in the same domain and database servers with the same name in different domains.
That is to say, the global database name includes the Database Name and domain name. For the sake of simplicity, the tutorial only sets the Database Name
08. Universal Installer: Database File Location
Here is the location of the database file. Such as data files, control files, and redo logs
Use the default settings in the tutorial, that is, under C: \ oralce \ ora92 \ oradata. You can also set it to another drive letter.
09. Universal Installer: Database Character Set
The default character set is used here, which is consistent with the current language settings of the operating system. In the tutorial, The ZHS16GBK encoding is used.
The GBK-encoded character set is a variable character set. Each character in it may occupy one to three bytes.
10. Universal Installer: Abstract
The installation has not started yet. After confirming that the installation summary is explicitly configured correctly, click Install.
11. Universal Installer: Installation
If the installation program of the optical disk version is used, the 9.2 version is generally three CDs. During the installation process, the system will remind you to change the disk twice.
12. Universal Installer: Configuration Tool
The Database Configuration Assistant dialog box is displayed, that is, the Database Configuration Assistant window.
Here, you need to set the passwords of SYSTEM users SYS and SYSTEM. The specific passwords are determined by the installer.
Before 9i, the system will provide the default password for both. From 9i, for security reasons, the installation must have an explicit password instead of the original default value.
After setting the password, click OK to return to the configuration tool window.
Then a console window named C: \ oralce \ ora92 \ bin \ agentctl.exe is displayed. At this time, the system is configuring and starting other tools. Still waiting
13. Universal Installer: installation is complete
Since Oracle uses the Java Runtime Environment, some of its tools are actually developed using Swing, so you need to remove the corresponding java block or apache block.
14. Now the Server installation is complete. You can select "exit"
After exiting, an OEM window is automatically displayed: Oracle Enterprise Manager Console
This is the Oracle Enterprise Manager Console window. After the OEM is turned off, an Oracle HTTP Server console window is left over.
This is a Web server that comes with Oracle. It uses apache's HTTP Server. Ignore it and turn it off.
Oracle service
Overview: You can view the nine functional modules installed as a service project in the service. You can open the service window by running services. msc.
Service: OracleMTSRecoveryService, OracleOraHome92Agent, OracleOraHome92ClientCache, OracleOraHome92PagingServer
OracleOraHome92SNMPPeerEncapsulator, OracleOraHome92SNMPPeerMasterAgent
OracleOraHome92HTTPServer: uses a browser as a client to access the database over the network. Generally, it does not use a lot
OracleOraHome92TNSListener: used to receive connection requests sent from the client. When the client connects to the server, the server first runs a listener program.
OracleServiceORA9: ORA9 is the name of the previously set database instance
Unused services have a certain amount of memory overhead when running. To avoid resource consumption, it is best to set it to manual startup after the service is stopped.
Or simply disable it. You don't want to use it any more. In daily applications, only the last two services, Listener and ORA9, are used.
Oracle has a high overhead. If the last three services are started, the memory overhead will be increased by about MB. We recommend that you do not start related services when you do not need them.
Supplement: two items are added in Start> program>. One is Oracle-OraHome92
One is Oracle Installation Products, which provides its Universal tool Universal Installer
Uninstall Oracle
Overview: Oracle cannot be fully detached using its own uninstall tool. That is to say, You need to perform manual settings that are troublesome.
If the Oracle database cannot be uninstalled normally, other versions cannot be successfully installed.
Step: 1. Stop all Oracle services
2. run Oracle Universal Installer to uninstall Oracle
In the Universal Installer: Welcome window, click the uninstall product button, expand the sub-item in the Inventory directory, and select all components
Click Delete and then click yes in the confirmation dialog box. Some components can also be retained as needed without being uninstalled.
After the uninstallation is completed, the Inventory directory displays: no installed products. Click exit to exit the current general Oracle Installation tool.
3. Modify the registry and delete Oracle-related information.
Oracle SOFTWARE has key-value: HKEY_LOCAL_MACHINE \ SOFTWARE \ Oracle
Oracle service: HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 and CurrentControlSet \ Services \
Oracle Event Log: HKEY_LOCAL_MACHINE \ SYSTEM \ ControlSet001 and CurrentControlSet \ Services \ Eventlog \ Application \
4. Delete the Oracle System Directory
5. Delete Oracle environment variables
6. Delete the Oracle menu in the program menu item
7. Delete the Oracle working Home Directory D: \ oracle
Note: if an error occurs during database installation, you may not be able to see Oracle services in the service. You can skip step 1.
The uninstallation process in step 1 may also fail. For example, after Oracle exits due to an installation error
Oracle General Installation tool cannot be found in the program menu. In this case, you can skip step 1 and directly start the manual uninstallation operation from step 1.
If steps 1 are successfully executed, steps 2 and 6 are automatically executed. Check whether the environment variables and program menus are clean.
Since the general Installation Tools of databases of different versions cannot completely uninstall Oracle, manual intervention is required by modifying the registry.
Step 2: delete all folders starting with Oracle in Services and Application.
If you cannot delete the directory in step 2, restart the system and delete the directory.
Oracle terminology
Concept: Database: a collection of data stored on a disk. Including configuration files, data files, log files, and control files
Database Instance: A group of Oracle processes/threads running on Database files and a shared memory Zone
Oracle Real-time Application cluster (RAC): Oracle Parallel Server Architecture/RAC Architecture
Database Service name (Database Service_Name): Introduced from oracle8i. We recommend that you specify the Database Service name instead of the Instance name when connecting the client to the server.
Net Service Name: indicates the logical representation of a database on the client. It contains the Database Service Name and network address.
Listener (Monitor)
Object: Table: Two-dimensional table of a relational database
View: an abstract representation created based on a table, equivalent to a virtual table. Extract part of the information from the physical table to form a view. However, it is not recommended to use a view to manipulate the base table information.
Constraint: association between tables or tables
Index: facilitates data query and Retrieval
Sequence: an automatic sequence number generator in Oracle.
Synonym: alias defined for database objects
Stored Procedure: it is equivalent to a function without a return value. You can integrate an operation instruction. Its parameters can be outputted by the IN/OUT/in out conversion.
Function: it is equivalent to a function in the conventional sense. It has a return value.
Trigger: The event processing code prepared by the server. When an event occurs, the Code agreed upon by the trigger is executed. It is equivalent to the event processing code in Java.
Package: equivalent to a namespace, which can define program units such as stored procedures, functions, and triggers.
Security: User: represents an Oracle authorization. You can use user information to log on to the database and perform authorized operations.
Solution: it is a concept in Oracle, which is equivalent to the Database in SQL Server. In Oracle, each user automatically corresponds to a solution with the same name as it.
That is, the user's workspace, which can save the database objects owned by the user. After authorization, you can perform operations on database objects in other schemes across different schemes.
Permission: the user's right to use and operate objects in the database
Role: a set of permissions. Usually, a common permission combination is called a role.
Quota: limits the user's storage space size or growth mode. You can manage quotas, permissions, or create new users in database management tools.
Audit: tracking, recording, or checking certain operations of some users. For example, you can monitor the operations performed by a user, including the operations that are successful or failed.
It can be recorded at the session level or at each SQL command level. The final audit result is equivalent to the security monitoring video.
Release 1: Database Instance is a running Database. When dealing with databases, they all deal with running database instances, rather than directly manipulating databases.
Each database generally corresponds to a database instance. The two databases are usually in a one-to-one relationship. Database instances can be loaded and opened by instances.
The database instance is the SID set during the Oracle installation process, that is, the name of the system identifier, usually the Instance name of the database.
By default, it is named the same as the database. In fact, it can be changed to a different name, but this is not necessary.
Release 2: the RAC architecture uses multiple servers to implement the Oracle Parallel Server architecture. It can be understood that Oracle is installed on multiple servers, which form a parallel structure.
It can be considered a database. They can share data files. Even if these data files are stored on different machines, they still belong to a physical database.
In this case, multiple instances can exist at the same time, or even multiple Oracle processes/threads running on multiple machines in a distributed manner.
They may have a shared memory zone or independent memory space. However, when multiple groups of instances are running, the same underlying database file may be manipulated.
In this case, there is a one-to-many relationship between the database and the database instance.
Release 3: Database Service_Name has no impact on current applications. The database name, Instance name, and service name can all be considered the same.
For the Parallel Server architecture that may correspond to multiple instances of the same database, the user does not have to care about how many instances it has.
You do not need to specify which instance is connected to in the parallel server architecture. Instead, you only need to specify its database service name.
If an instance goes down, the Oracle process/thread on a group of machines will die. The system automatically switches instances to achieve load balancing between instances.
Of course, you can also specify the Instance name to connect to a specific instance. In fact, applications at this level are rarely used in application development.
Release 4: Monitor monitors the specified port, such as port 1521 of Oracle. Take the remote client as an example to initiate a connection request to the current database server.
The listener receives connection requests from remote clients through the port it listens to, and sends the received SQL commands to the database server.
The database server then performs subsequent processing. It is equivalent to a listener in Java event processing.
Oracle Storage Structure
Physical storage structure
Data File: stores information that users really care about, such as tables, views, and stored procedures.
Redo Log File: records operations performed by the database one by one. When the database is damaged, you can restore the database according to the operations recorded by the database.
There must be at least two Oracle redo log files, which can be used in an alternative way. For example, first use the first log file
Records the transaction commands of each database operation one by one. When it is fully recorded, Oracle will not immediately clear its content
Oracle records operation commands in the second redo log file. When the second file is full, the first file will be cleared.
Then use the first file. This guarantees the redo of the database, even if recent operations can be saved.
Control File: records information about the current database data File and redo log File. When database instances manipulate data files
In fact, it will first check the control file and the system information such as the data file or the name or storage location of the redo log file.
Logical Storage Structure
Table Space: When writing data to Oracle, you must first create a Table Space. The data file is actually in the existing tablespace.
When the database is installed for the first time, the system will automatically create a tablespace called system. In addition, there may be other user tablespaces.
When creating a user, you can specify the tablespace it uses. A tablespace can belong to only one database, but a database can have multiple tablespaces at the same time.
Segment: located in a tablespace, it is a component element of the tablespace. Segments are allocated in units of zones. Every object stored in the database, such as tables and views, is a segment.
Area (Extent): the unit in which the Organization allocates disk space when allocating space to segments. In Oracle, the partition size is 1 to 2 GB. Each data block consists of 1 MB to 4 MB bytes.
Block: it is the unit of the partition and the smallest operating unit for Oracle to read and write data. As a user, you do not have to worry about the hierarchy between them and the management of the allocated space.
Basic Oracle tools
OEM Overview: it is an Oracle Server management tool, which is equivalent to the Enterprise Manager in SQL Server. It provides an integrated system Management Console
Provides the functions of managing, diagnosing, and optimizing databases. You can remotely manage multiple network database nodes and services. You can also manage parallel servers.
OEM open: Program → Oracle-OraHome92 → Enterprise Manager Console → select standalone boot → then the OEM window opens
Expand the menu items, select the installed database ORA9, enter the password in the pop-up window, and select SYSDBA as the connection identity, that is, the Administrator identity.
OEM example: routine: database instance. It is usually a one-to-one relationship with the database, but there may be one-to-many relationships in the RAC architecture, and the instance names are different.
Solution: each user has his/her own solution or workspace. Equivalent to the concept of Workspace
Security: allows you to create and authorize users.
SqlPlus: Program → Oracle-OraHome92 → Application Development → SQL Plus → input ora9 in the host string, that is, the data service name
ISqlplus: If the OracleOraHome92HTTPServer service is enabled, enter ora9 In the http: // 127.0.0.1/isqlplus connection identifier of IE
Other machines can also use its client browser software to access the local Oracle server, and the client does not need any configuration.
SqlPlus WorkSheet: Programs → Oracle-OraHome92 → Application Development → SQLPlus Worksheet
Choose to directly connect to the database, and enter the Database Service name (ora9) in the service, which is actually a local database.