Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

November 21, 2018 Oracle 11gR2 installation of VMware virtual machine CentOS 7 environment

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I installed it by following the installation steps, https://blog.csdn.net/j754379117/article/details/40222467

Step one:

Software installation:

This dish is installed on the VMware virtual machine centOS 6.5. the virtual hard disk space must be more than 30g. (at the beginning, this dish only opened up 20g, but in the end, it was a painful experience, so the second time directly opened up 50g hard disk space.) it is recommended that in 40G~50G, the minimum memory should be 1GB.

As for the installation of VMware virtual machine and centOS is not the focus of this article, let alone the difficulty, you can refer to other content for installation, I will not repeat it here!

Software preparation:

The download of Oracle is divided into 32-bit and 64-bit, and the installation process is the same. If your machine is 32-bit, download 32-bit Oracle software, and if 64-bit, download 64-bit. The following installation process is exactly the same, at the beginning of this dish also hesitated for some time, sweat ~

Because I am a 32-bit operating system, I downloaded two compressed files, linux_11gR2_database_1of2 and linux_11gR2_database_2of2. If 64-bit, please download: linux.x64_11gR2_database_1of2 and linux.x64_11gR2_database_2of2 (note that you can download two files, both of which are indispensable). As shown in the figure:

The above is 32-bit, and I downloaded the 64-bit installation package at http://mirrors.163.com/centos/6/isos/x86_64/

Step 2: modify the hostname

Log in to the virtual machine with root permission, open the terminal and enter the command line, and change the hostname to oracledb:

[root@oracledb ~] # sed-I "s/HOSTNAME=localhost.localdomain/HOSTNAME=oracledb/" / etc/sysconfig/network

[root@oracledb ~] # hostname oracledb

This modification is not necessary, but it is best to modify it in order to be formal and easy to manage.

Step 3: modify the network connection mode

This step must be done! Because when installing centOS (bridging is selected for network connection, do not choose NAT, otherwise the external network cannot access your virtual machine), we all acquire IP dynamically, but when installing Oracle, we need to change it. We have to use static IP. It can be understood that with Oracle database installed, your virtual machine is the server that provides data access, and IP is like your ID card. If you change your identity every time, who can find you!

Now that you know why, it's time to modify the configuration:

1. Modify the configuration of the network card:

Enter the command line at the terminal: ifconfig can view the network card information, where inet addr is the meaning of the IP address.

A lot of people on the Internet are talking about using the command line: vi / etc/sysconfig/network-scripts/ifcfg-eth0 to modify the network card configuration information, but I did not modify it successfully. So just talk about my method! That is to find the file, open it and modify it. Open the file system filesystem, open the etc folder, then open the sysconfig folder, then open the network-scripts folder, and finally open the ifcfg-eth0 file for configuration.

My configuration information is as follows:

DEVICE=eth0 # describes the device alias corresponding to the Nic, for example, it is eth0 in the file of ifcfg-eth0

BOOTPROTO=static # (this needs to be modified from the original dhcp to static! ) set the way for the network card to obtain the ip address. The possible options are static and dhcp, corresponding to the statically specified ip address and the ip address obtained through the dhcp protocol, respectively.

BROADCAST=192.168.1.255 # (if not, you need to add it yourself. The last bit must be 255.The front is consistent with your external network ip).

Physical address of the network card corresponding to HWADDR=00:07:E9:05:E8:B4 #

IPADDR=12.168.1.118 # (manually added by yourself, it must be the same as the external local IP, that is, the first three digits 192.168.1 and the external native IP are the same) if you set the network card to obtain the ip address statically, this field specifies the ip address corresponding to the network card.

NETMASK=255.255.255.0 # (you need to add it yourself, all 255.255.255.0) the network mask corresponding to the Nic

GATEWAY=192.168.1.1 # (you need to add it by yourself, which is consistent with the external gateway)

NETWORK=192.168. 1.1 # (you need to add it yourself and keep it consistent with the gateway GATEWAY) the network address corresponding to the Nic.

As I have always said above, it is consistent with the external, or the same network segment as the external, so what do you think of the external information? open the network information outside and refer to the configuration, as shown in the figure:

two。 Modify gateway configuration

Step by step into the etc/sysconfig/network file and modify it as follows:

NETWORKING=yes (indicates whether the system uses a network, which is generally set to yes. If set to no, the network cannot be used, and many system services will not start)

HOSTNAME= oracledb (set the hostname of this machine, which corresponds to the hostname set in / etc/hosts)

GATEWAY=192.168. 1.1 # (if you need to add it yourself, set the gateway of the external connection of this machine to be consistent. )

3. Modify DNS configuration

Step by step into / etc/resolv.conf file and modify it as follows:

The nameserver (which you need to add yourself) is the DNS server IP address, the first is the preferred, and the second is the standby, consistent with the external DNS.

If you have only one DNS for querying your local computer, you can enter only one, but it must be consistent.

4. Restart network services

Execute the command:

Service network restart or / etc/init.d/network restart

Step 4: add a record corresponding to the hostname and IP

The command line is as follows:

[root@oracledb ~] # vi / etc/hosts 192.168.1.118 oracledb

Note: if the command line is not successful, you can still find the file to add, just add a line to the file:

192.168.1.118 oracledb

Step 5: turn off the firewall Selinux

[root@oracledb ~] # sed-I "s/SELINUX=enforcing/SELINUX=disabled/" / etc/selinux/config

[root@oracledb ~] # setenforce 0

Selinux is too complicated, in order to avoid trouble, it is better to close it directly.

Step 6: install the dependency package

[root@oracledb ~] # yum-y install gcc gcc-c++ make binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-commonglibc-devel libaio libaio-devel libgcclibstdc++ libstdc++-devel unixODBC unixODBC-devel

Some of the packages installed here may not be installed. Don't worry. When you go to the Oracle installer interface, you will self-test the default packages. At that time, you can install the checked-out default packages.

Step 7: create users and groups

[root@oracledb] # sysctl-p

[root@oracledb ~] # groupadd-g 200 oinstall

[root@oracledb] # groupadd-g 201 dba

[root@oracledb] # useradd-u 440-g oinstall-G dba oracle

[root@oracledb ~] # passwd oracle

The operation here is to create two oracle dedicated groups oinstall and dba, and create a user oracle to set them to belong to the two groups, and modify the oracle user password

Step 8: modify kernel parameters

Add the following at the end of [root@oracledb ~] # vi/etc/sysctl.conf # (Note: it is recommended that beginners find the corresponding file step by step and paste the following parameter information directly at the end of the file)

Net.ipv4.ip_local_port_range= 9000 65500

Fs.file-max = 6815744

Kernel.shmall = 10523004

Kernel.shmmax = 6465333657

Kernel.shmmni = 4096

Kernel.sem = 250 32000 100128

Net.core.rmem_default=262144

Net.core.wmem_default=262144

Net.core.rmem_max=4194304

Net.core.wmem_max=1048576

Fs.aio-max-nr = 1048576

Step 9: modify the system resource limit

[root@oracledb ~] # vi/etc/security/limits.conf # is added at the end as follows (Note: it is recommended that beginners add it manually to the file)

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

[root@oracledb ~] # vi/etc/pam.d/login (Note: it is recommended for beginners to add to the file manually)

Add a pam_limits.so under session required pam_namespace.so #

Session required pam_limits.so

[root@oracledb ~] # vi/etc/profile # (Note: it is recommended for beginners to add to the file manually)

If [$USER = "oracle"]; then

If [$SHELL = "/ bin/ksh"]; then

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Fi

For the above red USER, I need to change it to lowercase user during my installation, otherwise it will prompt the error-bash: [oracle: command not found, but in the process of looking up the information, I found that most of them use uppercase USER. And the solution when the above error occurs is to change [$USER = "oracle"], [$SHELL = "/ bin/ksh"] to [[$USER = "oracle"], [[$SHELL = "/ bin/ksh"]]

The above standard blue part of the original author suggested directly in the graphical interface to find the file to add, I think it is best to use vi to modify, feel more intuitive

Step 10: create the installation directory and set permissions, enter the command line:

[root@oracledb ~] # mkdir / opt/oracle/app/

[root@oracledb ~] # mkdir / opt/oracle/oradata/

[root@oracledb ~] # chmod 755 / opt/oracle/

[root@oracledb ~] # chmod 775 / opt/oracle/app/

[root@oracledb] # chown oracle.oinstall-R / opt/oracle/

Step 11: (it's important, the second installation almost screwed it up) set the environment variable!

[oracle@oracledb] $vi ~ / .bash_profile (Note: ~ / means the root directory of the currently logged-in user)

Export ORACLE_BASE=/opt/oracle/app

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

Export PATH=$PATH:$ORACLE_HOME/bin

Export ORACLE_SID=orcl

Export ORACLE_PID=orcl

Step 10 is continuous with step 11, that is, the path of step 11 comes from installing the directory created in step 10. In the actual installation, you need to determine the path of the above files after installation, and add the actual path to the environment variable, otherwise it will cause lrnsctl start to start the database monitoring times error, the specific error report content is forgotten, and the actual situation can be analyzed.

If the above information cannot be modified on the command line, we still need to find the file to add the information manually, but you will find that you can't find it! Because。 The files at the beginning are hidden files! So at this time you need to access the oracle user's file system, press CTRL+H to make all the hidden files appear, and then add information!

[oracle@oracledb ~] $source .bash _ profile # effective immediately

Step 12: copy the two downloaded oracle files into the / media folder, as shown in the figure:

I downloaded these two Oracle installation packages under the native Windows and transferred them to the directory specified by the virtual machine system using the FileZilla FTP Client software.

Step 13: extract the oracle file:

[root@oracledb~] # unzip / media/linux_11gR2_database_1of2.zip (if you are a 64-bit compressed file, the command should be unzip / media/linux.x64_11gR2_database_1of2.zip)

[root@oracledb~] # unzip / media/linux_11gR2_database_2of2.zip

[root@oracledb~] # xhost + # enables all users to access the graphical desktop

[root@oracledb~] # su-oracle

[oracle@oracle~] # / media/database/runInstaller (Note: the extracted files I saw on the Internet are placed in the / media folder by default, but mine is not in it. Instead, the folder database is generated in the root directory of root, so the file path in this step is wrong, so runInstaller cannot run), as shown in the figure:

I wasted a lot of time on this step, and I don't know how to solve it, because it is different from the position of decompression on the Internet, and it will be full of mistakes when I type the command line later. The later solution is actually very simple: manually cut the database folder into / home/oracle under the file system. As shown in the figure:

Then enter the command line: [oracle@oracle~] #. / home/oracle/database/runInstaller

You can run the oracle installation operation.

If you successfully enter the graphical interface installation, you can skip the following paragraph! )

But this dish encountered another problem, that is, when I entered this command line, it prompted me that I did not have permission. In that case, I go back to the root permission and add the command line:

[root@oracledb ~] # chmod 755 / home/oracle/database

Then use the command line: [root@oracledb ~] # su oracle

Enter the oracle user and execute the command line: [oracle@oracle~] #. / home/oracle/database/runInstaller

(if it doesn't work here, it is recommended to find the compressed package under the oracle user, right-click directly, decompress it manually, specify it and store it in / home/oracle; after decompression is complete, and then run installer on the command line)

The installation of Oracle needs to be installed on a system that supports a graphical interface

Step 14: successfully enter the graphical interface installation:

1. Do not enter an Email address, just next

two。 Choose to install the database software and create the data, or you can choose the second option to install only the database software, and then next

3. Select the server version, as shown in the figure, and click next

4. Singleton database, as shown in the figure, click next

5. Advanced mode installation, as shown in the figure, click next

6. Add supported languages, as shown in the figure, and click next

7. Select the version you want to install, as shown in the figure, and click next

8. Install the database directory, as shown in the figure, click next

9. Create a detailed catalog

10. Select configuration Typ

11. Database and service name

twelve。 Turn on automatic memory management (if the 512m is too large, you will be prompted to reduce it a little), and then instead of clicking next, click the Charactor sets option next to Memory.

13. Set the default encoding to UTF8

14. Enable oracle Enterprise Management console OEM

15. Select the database file directory

16. Automatic backup settin

17. Set the database user name and password, he has a password suggestion, otherwise it will prompt an error, the password recommendation is to contain uppercase and lowercase letters, the total length can not be less than 8 digits.

18. Authorized group

19. Check some installation requirements of oracle. All the packages have been installed. Ignore them directly.

Here, in the course of my installation, the default installation packages that appear are re-yum install installed, those that can be installed are installed, and those that cannot be installed are already installed with other versions, and those that are not installed do not need to be taken care of. Just go ahead.

20. Start installation (slow speed, wait patiently, have a cup of coffee)

21. Create a backup database

twenty-two。 Installation complete!

After the installation is complete, a dialog box appears, prompting the user using root to execute the two scripts

[root@oracledb ~] $/ opt/oracle/oraInventory/orainstRoot.sh

[root@oracledb ~] $/ opt/oracle/app/product/11.2.0/dbhome_1/root.sh

This script path needs to be run according to the actual path, and needs to be photographed! I just didn't pay attention to it at that time. I confirmed it directly. I didn't remember the path. I found it later.

Step 15: enter the database on the command line and oracle it!

(note: if you enter the command to open the database, it is very likely that you did not enter the command line under the oracle user when you prompt bash:XXX command not found, then try using su oracle. If it still does not work, you can go to the / opt/oracle/app/product/11.2.0/dbhome_1/bin directory to confirm whether this command exists!

If the statement ERROR:ORA-12162: TNS:net service name is incorrectly specified appears in the opening process, it is very likely that the environment variables are not configured properly. It is recommended that you check the .bash _ profile file in oracle users. See step 11 for how to find .bash _ profile! )

[root@oracledb ~] # su-oracle

[oracle@oracledb ~] # lsnrctl start

[oracle@oracledb ~] # sqlplus / as sysdba

SQL > startup # start the database instance

As shown in the figure:

When I first started running startup, I reported an error ORA-00119: invalid specification for system parameter LOCAL_LISTENER

ORA-00130: invalid listener address'(ADDRESS= (PROTOCOL=TCP) (HOST=oracledb) (PORT=1521))'

I solved it using the following solution

Ora11g > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jan 5 18:50:29 2015

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance.

SQL > startup

ORA-00119: invalid specification for system parameter LOCAL_LISTENER

ORA-00130: invalid listener address'(ADDRESS= (PROTOCOL=TCP) (HOST=dcsopen2Node) (PORT=1521))'

The above error is reported. When you see that the listening message is HOST=dcsopen2Node, the first reaction is that there is something wrong with the listening file. Check the following listener.ora file:

# listener.ora Network Configuration File: / opt/app/ora11g/product/11.2.0/dcsopen/network/admin/listener.ora

# Generated by Oracle configuration tools.

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521))

)

)

ADR_BASE_LISTENER = / opt/app/ora11g

There is no HOST=dcsopen2Node configuration.

Check the machine name:

Ora11g > hostname

Dcsopen2Node

Found that the native name is dcsopen2Node. Refer to some posts, saying that it is possible for oracle to register a monitor with the same name as hostname when it starts, so the error prompt here is (ADDRESS= (PROTOCOL=TCP) (HOST=dcsopen2Node) (PORT=1521)), indicating an invalid address, and then check the / etc/hosts file:

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

It is found that there is no hostname counterpart at all, so it is speculated that it may be Oracle registration and hostname snooping with the same name, but there is no hostname-IP counterpart defined in / etc/hosts, so this listening address is considered invalid.

Solution:

Add items to / etc/hosts:

172.27.19.57 dcsopen2Node

Restart the service:

Ora11g > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Mon Jan 5 20:33:32 2015

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance.

SQL > startup

ORACLE instance started.

Total System Global Area 3290345472 bytes

Fixed Size 2217832 bytes

Variable Size 2533361816 bytes

Database Buffers 738197504 bytes

Redo Buffers 16568320 bytes

Database mounted.

Database opened.

Everything is calm again.

# at this point, the database is open, and then you can operate the database!

SQL > shutdown immediate # close the database instance

SQL > select * from tab; # View all tables

SQL > select name from v$datafile # View the database storage directory

SQL > show parameter service # View the service name

SQL > select * from instance; # View instance name

SQL > select name from vault database; # View the database name

SQL > select * fromdba_users; # View all user information

SQL > select username,password from dba_users; # only query users and passwords

SQL > select * fromv$pwfile_users; # View users with sysdba permissions

SQL > select * fromdba_ustats; # View current user information

SQL > select * fromuser_sys_privs # View the current user's system permissions

SQL > select * fromuser_role_privs # View current user roles

SQL > select * fromdba_sys_privs # View the system permissions of the specified user

SQL > select * fromv$version # View oracle version

SQL > select * fromuser_views # View View Information

[root@oracledb ~] # lsnrctl start # Open remote listening port

Oracle11gR2 silent installation

Https://www.cnblogs.com/ivictor/p/4384583.html

Https://blog.csdn.net/gumengkai/article/details/53349749

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report