Oracle21C: Windows version installation, uninstallation, environment variable configuration, pit avoidance guide|ORA-12514|Why there is no bin directory in the installation directory

foreword

1. Suitable reading object

Install Oracle21C ( click to download ), because of the wrong method, various errors are reported, resulting in the inability to use Oracle normally . 

Reminder: The version is Oracle21C , and other versions may be different. Currently, the official website has been updated to Oracle23C (after entering the official website , scroll down to download other versions). 

2. Download various tools 

1) Oracle download address: official website download page

2) navecat download address: navecate
3) sqlplus download address: official website download page

Product number: kfsvzt6zh2exaxzxgjk44rv5kp2yp68vgk
Serial number: 186220
Password: xs374ca

3. Introduction

1) All the details are screenshots, which will lengthen the article. In order to save time, only the main points will be mentioned!

2) Focus on configuration and pit avoidance , and a rough introduction to uninstallation and installation !

Note: By following the steps below, many error pits can be avoided. 

4. System environment

 It is recommended to use Windows 10+ with at least 4G memory.

1. Oracle21C uninstallation _

(1) Win+R, enter services.msc, open the service, stop all Oracle-related services ( important )
(2) Win+R, enter regedit, open the registry, delete the relevant registration information at the beginning of Oracle ( including the file Folder )
    Note: When deleting, be careful
    1) Computer\HKEY_CURRENT_USER\SOFTWARE
    2) Computer\HKEY_LOCAL_MACHINE\SOFTWARE
    3) Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
    4) Computer\HKEY_LOCAL_MACHINE
    5) Computer\HKEY_LOCAL_MACHINE\SY STEM\CurrentControlSet\ Services\EventLog\Application
(3) Restart the computer
(4) Delete the Oracle installation directory and decompression directory.
    Note: The decompression directory must be deleted. After using the decompression directory to install once, a large number of files in it have been modified. If you need to reinstall, just decompress the installation package again.
(5) Delete multiple Oracle-related directories under the C drive:
    C:\ProgramData\Oracle
    C:\Program Files\Oracle
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Oracle - OraDB21Home1
(6) Delete Oracle-related environment variables
    Note: If you need to reinstall, you don’t need to delete them. After the installation is successful, you must remember to modify them on the basis of the original environment variables.

Reminder: Because the Oracle version has been iterating, the uninstallation process of each version is similar. This article introduces Oracle21C 

Second, the installation of Oracle21C

  Compressed package display ( after downloading and decompressing, it comes with setup.exe):

 

2.1 Preparations

(1) Download Oracle21C

(2) Create the Oracle installation directory, the local installation location: D:\Program\Oracle\product\21c

        And manually create two folders, home and base , respectively.

To avoid ambiguity: Let me explain that the oracle21c directory after decompression can be renamed home to keep the directory structure of the picture below. 

Directory description :

home is used to store all the files decompressed from the compressed package (after decompression, the original compressed package can be deleted as needed);

base is used to storethe Oracle files installed  after clicking setup.exe .

Note : When configuring the environment variables later , it is not the installation directory, but the decompressed home directory. Remember this ! Otherwise, when you configure environment variables, you will be confused why my installation directory does not have a bin directory (resulting in the inability to configure environment variables) 

2.2 Only install the Oracle database

2) The second installation method ( preferred choice )

Enter the home decompression directory, look for setup.exe , click Install, and in the installation interface, select " Install software only " first.

In this way, many errors can be avoided.

Note: During installation, you need to manually select the installation directory , such as D:\Program\Oracle\product\21c\base, and other options are directly defaulted, and you can click Next.

1) The first installation method ( second )

This method will directly " create and configure a database instance " (the default database name is EX, not ORCL)! Plug database name is XEPDB1 

Note: Choosing the first method is naturally beneficial, for example, it will automatically configure https://localhost:5500/em/login (you need to configure it manually if you only install the software).

em monitoring page: https://localhost:5500/em/login

 Note: Look at this picture carefully , it can help you avoid the problem of not being able to log in!

Three, Oracle21C configuration


Special Note: The following configurations are only for the second method (only Oracle is installed, and no instance is installed at the same time) . If you have installed both the database and the database instance at one time, this step is not required ( unless you want to create multiple database instances )!


3.1 Create a new database instance

As shown below:

Open the start menu: select Database Configuration Assistant-Application, and click to enter: 

As shown below:

The arrow is the position that needs to be entered manually. Due to the complexity of the password, it can be set as: 123abcABC .

For some options in the back, just go to the next step. This process is relatively time-consuming, and it may take ten or twenty minutes .

Tip: If you set the password yourself, be sure to write it in Notepad and store it in the installation directory, so as not to forget it in the future. 

 

Note: After this step is completed, open the service through services.msc , and when you search for the Oracle service, you will find that there are only 2 services in the figure below, and Oracle cannot be used normally at this time.

  

3.2 New Listener monitoring

As shown below:

Open the start menu: select Net Configuration Assistant, and click to enter, and then default all the way.

 

Just go to the next step, and the next step is fine.

Purpose:

After configuration, the listener.ora file will be automatically added in the D:\Program\Oracle\product\21c\home\network\admin directory . Its role is to allow you to access Oracle through third-party client (plsql, etc.) tools.

Note: After this step is completed, open the service through services.msc , and when searching for the Oracle service, you will find that there is an additional OracleOraDB21Home1TNSListener service, and you still cannot use Oracle normally at this time.

3.3 Net Manager network configuration

3.3.1 Open the start menu

As shown below:

Open the start menu: select Net Manager, and click to enter, and then default all the way.

3.3.2 Enter, configure the page, as shown in the figure  

Of course, in the production environment, another address 3 must be configured, and the local configuration is not too redundant. 

3.3.3 Enter the listener.ora directory to see what happened

Directory location: D:\Program\Oracle\product\21c\home\network\admin

You will find that these two monitors have been written in. 

Special Note:

According to the feedback from the friends in the message area , the listener.ora file is not generated under home, but under base. According to the usual practice, it should be generated under the base installation directory, but the version I downloaded is generated under home\network \admin directory.

If yours is just generated under the base, don’t panic (maybe your version is not oracle21C), it doesn’t matter where it is generated, what is important is that you know the function of this file, in short, the contents of the file can be  manually Add, you can also manually add in the format shown in the above figure, configure multiple monitors, this monitor address is for yourself and others to access (if you only configure 127.0.0.1, others will never be able to directly access your machine oracle) !   

To learn more about  the role of listener.ora , click to enter the role of listener.ora and tnsnames.ora in the Oracle database

3.4 Manually open tnsnames.ora to configure the alias information for accessing the database

Directory location: D:\Program\Oracle\product\21c\home\network\admin

Put the following configuration:

ORCL_localhost =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

The same reason: if your tnsnames.ora is not under home\network\admin, but under base\network\admin, it is also possible, the important thing is to configure the above content (of course, if you really can’t find it, you can also create it manually OK)

 As shown in the figure below, after configuration, it can be selected and used in plsql

4. Environment variable configuration

What needs to be explained is: after Oracle21C is successfully installed, the bin directory D:\Program\Oracle\product\21c\home\bin of its decompressed directory will be automatically added to the path ;

1. Modify the Oracle bin directory of the path

However, in most cases, we prefer to configure it manually, change this option to %ORACLE_HOME%\bin , and move to the top! 

Expansion: If your environment variables are not displayed vertically, just add  C:\Windows\System64 to the head of the path environment variable, and then reopen the system environment variable.

2. Create a new ORACLE_HOME

ORACLE_HOME  D:\Program\Oracle\product\21c\home

[Pit Avoidance Guide] :

In Oracle21C, ORACLE_HOME is the home path of the decompression directory of the installation file , not the installation directory base . I think it should be under the base, and there is a bin directory under the base, but my version is under the home decompression directory.

on the contrary

If you tell me that there is a bin in the base itself in your installation directory, then congratulations, it is also possible, it should be like this, the important thing is that when configuring the path environment variable below, you need to use the path of this bin ,

Don't worry about whether it is under home or base. If there is no base, just go to home to find it.

Section: Where is your bin,  which directory is configured in ORACLE_HOME , the version is different, some are under base, some are under home!

Explanation: If the environment variable is not configured properly, the cmd window cannot be in any directory, and the sqlplus command can be used happily , such as: sqlplus / as sysdba ; when using this command, an error will be reported, indicating that the command does not exist!

3. Create a new TNS_ADMIN

TNS_ADMIN %ORACLE_HOME%\network\admin

4. Create a new ORACLE_SID

ORACLE_SID  orcl

5. Final Notes

After configuring the environment variables, be sure to click the confirmation button in turn to exit the environment variable configuration interface in turn!

5. Guide to error reporting and avoiding pitfalls

1. ORA-12514 error

There are two main reasons for this error:

1) Use services.msc , enter the service list, check whether the OracleOraDB21Home1TNSListener service is started, if not start it.

2) Open the listener.ora file and configure it

Directory location: D:\Program\Oracle\product\21c\home\network\admin ,

Again, the location of listener.ora under Orace21C is the home decompression directory, not the base installation directory. If yours is under the base, don’t worry about it. It may be a different version, just configure it as follows.

 (SID_DESC =
	  (GLOBAL_DBNAME = ORCL)
	  (ORACLE_HOME = D:\Program\Oracle\product\21c\home)  
	  (SID_NAME = ORCL)
	)

Note, if you have multiple Oracle instances locally, not only orcl, just copy it and configure multiple copies. 

6. Other related important configurations

1. Unlock the sys and system users, and change the password to manager

Win+R, open the cmd window, and enter the following commands in sequence

sqlplus / as sysdba;
alter user system account unlock;
commit;

alter user system identified by manager;
commit;

Expansion: This step is not necessary, but it is recommended to do it yourself. Of course, whether these users are unlocked or not, and the password setting can also be set when installing Oracle, as shown in the following figure:

2. Oracle background monitoring configuration

What needs to be explained in advance is:

If you use the first installation method , directly install the database + create a database instance , the background monitoring will be automatically configured, as shown in the following figure: 

Conversely, if the address cannot be accessed, you need to configure it manually.

1) Open the cmd window (the port number of the earlier version is 1158)

打开cmd窗口
sqlplus / as sysdba;
exec DBMS_XDB_CONFIG.SETHTTPSPORT(5500);
commit;

2. ipconfig, check the local IP

3. Edit the hosts file

File location: C:\Windows\System32\drivers\etc

Check the configuration below to see if it has been filled.

127.0.0.1 localhost
192.168.18.60 localhost

4. Access background monitoring

https://localhost:5500/em

  So far, the visit is successful! 

7. Effect display

Username: system

Password: manager

Database: orcl

1. Use plsql to log in

Version information, a good horse with a good saddle, it is recommended to use a higher version , the download link is indicated at the beginning of the article!

 Version information: 15.0.3

  

2. Use navicat to log in

Version information: 15.0.2

Relatively speaking, the use of navicat can avoid many errors, that is to say, when plsql is still reporting various errors, the use of Navicat is normal at this time, and the effect is as follows: 

Summarize

So far, the uninstallation, installation, configuration, and pit avoidance of Oracle21c have basically been introduced. Of course, the respective computer environments are different, and the test results may be slightly different.

Epilogue

Follow these steps to install , and you can basically avoid most of the error prompts. If you still report various errors after all kinds of troubles, I suggest you uninstall and reinstall!

If you think the content is not bad, welcome to like, comment, and leave a message!

Explanation: The post has been updated for the problem that the listener.ora is not in the decompression directory but in the base.

This problem is not very important. Whether it is under base or home, we need to manually configure the content inside.

Guess you like

Origin blog.csdn.net/xp871038951/article/details/128364735