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

How to install Oracle11G in centos

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

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to install Oracle11G in centos. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

Step one:

Software installation

As shown in the figure:

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~] # hostnameoracledb

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 if you install Oracle database, your virtual machine is the server that provides data access. 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 inetaddr 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,dhcp; corresponding to the statically specified ip address, and the ip address obtained through the dhcp protocol.

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

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

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

The network mask corresponding to the network card of NETMASK=255.255.255.0# (all 255.255.255.0).

GATEWAY=192.168.1.1# (need to be added by yourself, which is consistent with the external gateway)

The network address of the network card corresponding to the NETWORK=192.168.1.1# (which needs to be added by yourself and is consistent with the gateway GATEWAY)

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 for external connections on 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.

4. Restart network services

Execute the command:

Servicenetworkrestart or / etc/init.d/networkrestart

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

The command line is as follows:

[root@oracledb~] # vi/etc/hosts192.168.1.118oracledb

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.118oracledb

Step 5: turn off the firewall Selinux

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

Step 6: install the dependency package

The copy code is as follows:

[root@oracledb~] # yum-yinstallgccgcc-c++makebinutilscompat-libstdc++-33elfutils-libelfelfutils-libelf-develglibcglibc-commonglibc-devellibaiolibaio-devellibgcclibstdc++libstdc++-develunixODBCunixODBC-devel

Step 7: create users and groups

[root@oracledb~] # sysctl-p [root@oracledb~] # groupadd-g200oinstall [root@oracledb~] # groupadd-g201dba [root@oracledb~] # useradd-u440-goinstall-Gdbaoracle [root@oracledb~] # passwdoracle

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=900065500fs.file-max=6815744kernel.shmall=10523004kernel.shmmax=6465333657kernel.shmmni=4096kernel.sem=25032000100128net.core.rmem_default=262144net.core.wmem_default=262144net.core.rmem_max=4194304net.core.wmem_max=1048576fs.aio-max-nr=1048576

Step 9: modify the system resource limit

Add the following at the end of [root@oracledb~] # vi/etc/security/limits.conf# (Note: it is recommended for beginners to add to the file manually) oraclesoftnproc2047oraclehardnproc16384oraclesoftnofile1024oraclehardnofile65536 [root@oracledb~] # vi/etc/pam.d/login (Note: recommend novices to manually add to the file) add a pam_limits.sosessionrequiredpam_limits.so [root@oracledb~] # vi/etc/profile# under sessionrequiredpam_namespace.so# (Note: recommended for beginners to add to the file) Add noodles manually) if [$USER= "oracle"] Thenif [$SHELL= "/ bin/ksh"]; thenulimit-p16384ulimit-n65536elseulimit-u16384-n65536fifi

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~] # chmod755/opt/oracle/ [root@oracledb~] # chmod775/opt/oracle/app/ [root@oracledb~] # chownoracle.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) exportORACLE_BASE=/opt/oracle/appexportORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1exportPATH=$PATH:$ORACLE_HOME/binexportORACLE_SID=orclexportORACLE_PID=orcl

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:

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, but 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 went back to the root permission and added the command line: [root@oracledb~] # chmod755/home/oracle/database

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

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)

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 Charactorsets 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.

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

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:XXXcommandnotfound, then try using suoracle. 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:netservicenameisincorrectlyspecified" 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 to find .bash _ profile see step 11!)

[root@oracledb~] # su-oracle [oracle@oracledb~] # lsnrctlstart [oracle@oracledb~] # sqlplus/assysdba

SQL > startup# start the database instance

As shown in the figure:

# at this point, the database is open, and then you can operate the database! SQL > shutdownimmediate# close database instance SQL > select*fromtab;# view all tables SQL > selectnamefromv$datafile# view database storage directory SQL > showparameterservice# view service name SQL > select*fromv$instance;# view instance name SQL > selectnamefromv$database;# view database name SQL > select*fromdba_users;# view all user information SQL > selectusername,passwordfromdba_users;# query only 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 current user system permissions SQL > select*fromuser_role_privs# View current user role SQL > select*fromdba_sys_privs# View system permissions SQL > select*fromv$version# View oracle version SQL > select*fromuser_views# View Information [root@oracledb~] # lsnrctlstart# Open remote listening Port the above is how to install Oracle11G in centos. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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