BlackFlame33

BlackFlame33

若无力驾驭,自由便是负担。个人博客 https://blackflame33.cn/

How to install Oracle Database 11gR2?

Windows 7 Ultimate Installation Process for Oracle Database 11gR2

1. What is Oracle Database?#

Oracle Database (Oracle Database, also known as Oracle RDBMS, or simply Oracle). The database system is a set of software products provided by Oracle Corporation (Oracle) that centers around distributed databases. It is one of the most popular client/server (Client/Server) or B/S architecture databases. For example, SilverStream is a middleware based on databases. Oracle Database is currently the most widely used database management system in the world. As a general-purpose database system, it has complete data management capabilities; as a relational database, it is a complete relational product; as a distributed database, it implements distributed processing capabilities. However, all its knowledge can be used on various types of machines as long as you have learned ORACLE knowledge on one type of machine.

2. What is the process for installing and using Oracle Database?#

  • Install a physical/virtual machine with a system that meets the installation requirements for Oracle Database and complete pre-installation checks.

  • Download the Oracle Database version that corresponds to the system version.

  • Execute different installation processes according to the system.

  • Verify the installation.

  • Use third-party software to connect to the database.

Let's try it step by step!

3. Actual Installation Process and Common Issues#

This process description takes Oracle Database 11g Release 2 as an example.

1. Check Installation Requirements#

Before officially installing, we need to do various preliminary preparations, one of which is to confirm whether the installation system supports the corresponding database version. The official “Database Quick Installation Guide” (English Only) lists the software and hardware requirements, so check if your desired operating system is listed. image

Ps: What is virtual memory? What is it used for? How to set it?#

Virtual memory is a technique for managing memory in computer systems. It allows applications to believe they have a continuous available memory (a contiguous complete address space), while in reality, it is often divided into multiple physical memory fragments, with some temporarily stored on external disk storage, exchanging data as needed. Currently, most operating systems use virtual memory, such as the "virtual memory" in the Windows family; Linux's "swap space," etc. Programs running on a computer must be executed via memory. If the executing program occupies a large amount of memory or many programs are running, it can lead to memory exhaustion. To solve this problem, Windows employs virtual memory technology, which allocates a portion of hard disk space to act as memory. When memory runs out, the computer automatically calls the hard disk to act as memory to alleviate the memory pressure.

In Windows 7, the official documentation mentions:

  1. Click the "Start" button, right-click "Computer," and then click "Properties" to open "System."

  2. In the left pane, click "Advanced system settings." If prompted for an administrator password or confirmation, type the password or provide confirmation.

  3. On the "Advanced" tab, under "Performance," click "Settings."

  4. Click the "Advanced" tab, and then under "Virtual memory," click "Change."

  5. Clear the checkbox for "Automatically manage paging file size for all drives."

  6. Under "Drive [Label]," click the drive where you want to change the paging file.

  7. Click "Custom size," type a new size in the "Initial size (MB)" or "Maximum size (MB)" box (in megabytes), click "Set," and then click "OK."

(Note: Increasing the size usually does not require a restart to take effect, but if you decrease the size, you need to restart the computer for the changes to take effect. It is recommended not to disable or delete the paging file.)

2. Install the Corresponding System#

After checking the system, we can install the corresponding supported operating system. I chose to install Windows 7 Ultimate on a VMware virtual machine; the installation details will be written in a separate article titled “Installing Windows or Linux Virtual Machine” definitely a pit...

Hehe, {% post_link How-to-install-Virtual-Machine 'How to Install a Virtual Machine' %} is now online!

3. Download the Oracle Database Installation Package#

After installing the system, we start downloading the installation package. The hardware requirements mention that Oracle Database requires at least 5.39G of space, and it is recommended to reserve at least 6~7G. Download two zip packages from the official download page, which requires agreeing to the terms and registering to log in, which takes some time and effort.

image

image

Then the download will start, so keep the network stable!

4. Install Oracle Database#

After the download is complete, we have two compressed packages. Extract these two compressed packages, cut one folder into the other folder, and merge them into the database folder. After merging, open the installer as Administrator.

PS: Note that the database folder must be placed in C drive for installation; otherwise, there may be issues with installation and service startup!!!

image

Uncheck "I wish to receive security updates through My Oracle Support."

image

Click next to proceed to the next step. Since this is my first installation on the system, select "Create and configure database," then click the "Next" button.

image

Since I am installing Oracle Database on a notebook virtual machine, I check the first option "Desktop class," then click the "Next" button.

image

This step is to fill in the installation path. If you do not want to use the default path, you can customize the path, but it is best not to change the path name. Choose the database version according to your requirements, and when you select one, there will be relevant explanations. After entering the database name and password, click "Next."

image

After that, Oracle will check the software and hardware requirements before installation. If there are issues, they will be displayed. Fortunately, we checked the software and hardware requirements in the first step, so there are basically no problems. Click "Finish" to officially install. Even if there is an error, as long as you carefully check the hardware requirements and confirm there are no issues, you can check the "Ignore All" option in the upper right corner to continue the installation.

image

image

After a long wait, the installation is finally complete, but now we need to perform Password Management; do not just click OK!!!

In Password Management, unlock SYS, SYSTEM, and SCOTT and manually set a password. After that, click "OK."

image

At this point, Oracle Database 11gR2 has been installed, and the next step is to verify the installation.

5. Verify Installation#

  1. Now, theoretically, you should be able to see the Oracle folder in the Start menu:

    image

    Click "SQL Plus" or type sqlplus in cmd to enter the interactive screen of Oracle Database, where you will be prompted to enter a username and password. Here, enter sys as sysdba to log in with database administrator privileges and enter the password you set earlier. If you can log in successfully, it indicates that the operation is correct, and the installation is successful!

    image

  2. Check if the service is running

    Type services.msc in cmd to check.

    image

    Manually start any that are not running.

  3. Check Oracle port configuration

    Search for "Net Configuration Assistant" in the Oracle Database folder in the Start menu.

    image

    After the program initializes, select "Listener Configuration" -----> "Reconfigure" -----> "LISTENER | Next" -----> Add "TCP | Next" to the selected protocol, and here you can see the Oracle port status, which is generally set to 1521 by default. If it is not the default, it is recommended to modify it.

    image

  4. Some operations for users before use

    • Change username and password

      Enter cmd, type sqlplus/ as sysdba, press Enter to enter sql>

      Type alter user (username) identified by (password);

      【This line of code means to change the password of the system user to (password). Note that a semicolon “;” must be added at the end of the code; otherwise, it cannot be modified successfully.】

    • Create a user

      Enter cmd, type sqlplus/ as sysdba, press Enter to enter sql>

      Type create user (username) identified by (password)

      【The code means: create a user with the username (username) and password (password). Similarly, the code must end with a semicolon “;”.】

    • Set user permissions

      DBA: Has all privileges and is the highest authority in the system; only DBA can create database structures.

      RESOURCE: Users with Resource privileges can only create entities and cannot create database structures.

      CONNECT: Users with Connect privileges can only log in to Oracle and cannot create entities or database structures.

      For ordinary users: grant connect, resource privileges.

      For DBA management users: grant connect, resource, dba privileges.

      grant connect,resource,dba to (username);

OK! Done, at this point, Oracle Database has completed all the formal pre-usage processes and can be used.

4. Connecting to Oracle Database with Third-Party Software#

Here we use Navicat Premium as an example.

1. What is Navicat Premium?#

Navicat is a series of graphical database management and development software produced by Hong Kong Chuangru Digital Technology Co., Ltd. for MySQL, MariaDB, MongoDB, Oracle, SQLite, PostgreSQL, and Microsoft SQL Server. It has a browser-like graphical user interface and supports multiple connections to local and remote databases. Its design meets the needs of various users, from database administrators and programmers to various enterprises or companies that serve customers and share information with partners.

2. Download Navicat Premium Installation Package#

Download Navicat Premium from the official download page.

After downloading, double-click to open and install it on your computer; it is similar to regular software and does not require too much attention.

Ps: For cracking, please refer to this project on GitHub (with Chinese documentation): # navicat-keygen

After successful installation, open Navicat Premium. Select 【Connection】----->【Oracle】.

image

In the pop-up menu, enter the Oracle database account information created earlier: after entering, click 【Test Connection】 to see if the connection can be established.

image

If there are no errors at this point, everything is great; Navicat Premium successfully connects to Oracle. However, if you encounter the error 【ORA-28547: connection to server failed, probable Oracle Net admin error】,

please refer to this article.

The reason for the error is that the version of oci.dll in Navicat Premium does not match the version of the Oracle database files. Navicat connects to the Oracle server through the Oracle client, which comes in two versions: standard and compact, i.e., Oracle Instant Client. When using Navicat, it usually contains multiple versions of OCI in your installation path. If you encounter the ORA-28547 error when connecting to the Oracle server with Navicat, it is mostly due to a mismatch between the local OCI version and the Oracle server version. Therefore, we need to download the OCI to match the installed Oracle server.

oci download link, like Oracle Database, requires checking and logging in to download for free.

Place this dll file into Navicat Premium installation path\instantclient_11_2 to replace it.

image

Then select 【Tools】----->【Options】----->【Environment】, and choose the location of oci.dll in the OCI environment. After that, restart Navicat Premium and reconnect.

image

image

Reference articles:

Database Quick Installation Guide

Easy Bai Tutorial Oracle 11g Installation Guide

Troubleshooting Connection Errors 【ORA-28547】

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.