[Oracle entry series] Chapter 2 _ Oracle entry

Source: Internet
Author: User
[Oracle entry series] Chapter 2 _ Oracle entry-v512 workshop Editor: Xuan Yu
Install Oracle Oracle service   Send me an email
Uninstall Oracle Oracle terminology V512 Studio
Basic oracle tools Oracle Storage Structure Chinese Emy of Sciences

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.