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

Installation and use of Oracle-11g

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

Share

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

I. installation and use of Oracle11g

1. Large relational database (Emurr diagram)

two。 Oracle (Java)

3.UNIX, Linux, Windows support

4.Oracle distribution

5. Database (software + database) MySQL

6. There is only one database by default

2. Installation of Oracle requires more than 1 GB of memory, and swap is more than 2 times the memory.

1G-> 1000m (actual use)

1G-> 1024m (standard size)

two。 Software package

3. Kernel parameter adjustment

4. User new, directory permission settin

5. User resource limit

6. Installation

Note: install Centos 6 (x64) or above or [Red Hat Enterprise 5.8 (x64) is the most stable version of Oracle server system officially recommended and support Chinese boot interface] disable firewall and Selinux, and install software development

Current experimental environment: centos6.8x64 linux.x64_11gR2_database_2of2 linux.x64_11gR2_database_1of2 pdksh-5.2.14-1.i386.rpm

Modify IP and host name (two network cards bridging and vm1 are installed in this lab to facilitate the installation of dependency packages)

1) vim / etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

TYPE=Ethernet

BOOTPROTO=static

IPADDR=192.168.1.100

NETMASK=255.255.255.0

ONBOOT=yes

2) vim / etc/sysconfig/network-scripts/ifcfg-eth2

DEVICE=eth2

TYPE=Ethernet

BOOTPROTO=dhcp

ONBOOT=yes

3) modify the domain name vim / etc/sysconfig/network

4) modify the hostname vim / etc/hosts

5) restart the server reboot

6) if it is centos7, restart the Nic by: systemctl restart network

Install dependent software packages

1) clear all native yum source rm-rf / etc/yum.repos.d/

2) configure local yum source vim / etc/yum.repos.d/local.repo (can also be used on line source)

[local]

Name=local

Baseurl= file:///mnt

Gpgcheck=0

Note: if the system is Red Hat Enterprise 5.8x64, the default location of the local yum source is / mnt/Server, so the mount directory should be changed to baseurl= file:///mnt/Server

3) Mount the CD mount / dev/cdrom / mnt

4) install the development environment yum-y groupinstall "Development Tools"

5) install the desktop environment yum-y groupinstall "Desktop" & & yum-y groupinstall "X Window System" (if the following screenshot reports an error to see the solution, if there is no error, you can continue to install the subsequent dependent package)

Solution: execute the command to view the package group installation name yum grouplist

According to the screenshot above, it is found that the package group name is the same on centos6.8, so if the command cannot be installed, ignore it first.

6) install multiple dependent packages yum-y install binutils compat-libstdc++-33 elfutils gcc gcc-c++ glibc kernel-headers ksh libaio libgcc libgomp libstdc++ numactl-devel sysstat unixODBC unixODBC-devel

7) installation depends on yum-y install xorg-x11-utils

8) installation depends on pdksh-5.2.14-1.i386 (currently Baidu downloads and uploads rpm packages and ignores dependent installation)

Rpm-ivh / root/pdksh-5.2.14-1.i386.rpm-nodeps*

Fifth, modify kernel parameters

1) modify the kernel parameter vim / etc/sysctl.conf

Fs.aio-max-nr = 1048576

Fs.file-max = 6815744

Kernel.shmmni = 4096

Kernel.sem = 250 32000 100 128

Net.ipv4.ip_local_port_range = 9000 65500

Net.core.rmem_default = 262144

Net.core.rmem_max = 4194304

Net.core.wmem_default = 262144

Net.core.wmem_max = 1048576

2) verify sysctl-p (no error message indicates success)

3) create users and groups (the following operations are successful as long as no errors are reported)

3.1) groupadd-g 500 oinstall

3.2) groupadd-g 501 dba

3) useradd-g oinstall-G dba oracle

Echo "123" | passwd-- stdin oracle

3. 5) create Oracle home directory mkdir / opt/oracle

3.60) change the owner and group chown oracle:oinstall / opt/oracle

Change Oracle directory permissions chmod 775 / opt/oracle

4) Edit Oracle environment variable vim / home/oracle/.bash_profile

Umask 022

Export ORACLE_BASE=/opt/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1

Export ORACLE_SID=orcl

Export LANG=en_US.UTF-8

Export NLS_LANG= "AMERICAN_AMERICA" .ZHS16GBK

Export PATH=$PATH:$ORACLE_HOME/bin

Export DISPLAY=192.168.1.254:0.0

Note: if the remote test must have the same line as the real vmnet1 network card IP and export DISPLAY, but I am testing in the local virtual machine, so I do not need to add this line. After saving and exiting, source executes the file.

5) Oracle user resource limit

Edit Oracle security authentication module vim / etc/pam.d/login

Session required / lib64/security/pam_limits.so

Session required pam_limits.so

6.5.2) Editing Oracle resource restrictions vim / etc/security/limits.conf

Oracle soft nproc 2047

Oracle hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

Oracle soft stack 10240

6) Edit the global environment variable vim / etc/profile

If [$USER = "oracle"]; then

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

Ulimit-p 16384

Ulimit-p 65536

Else

Ulimit-u 16384-n 65536

Fi

Fi

6. Install Oracle database

1) upload two Oracle 11g packages

2) copy the Oracle package to the Oracle home directory

Cp / root/linux.x64_11gR2database* / home/oracle/

Change the linux.x6411gR2database owner and group under the Oracle home directory

Chown oracle:oinstall / home/oracle/linux.x6411gR2database*

3) switch Oracle users and log in to su-oracle

4) extract the two Oracle packages to the current

5) execute the command xhost + (choose one of the following methods, the second one is used here)

The first method is remote execution. The Prime Minister opens the tools in xshell and then executes xhost+, as follows:

The second way is to execute init 5 locally, switch to the desktop on the server, and then use the command line to execute xhost +

Note: root users can only be used to log in here, and then switch oracle users after login

Note: the above has successfully logged in to the system with root users and switched to oracle users.

Execute the command xhost + (if the following black screenshot error occurs, white is normal)

Solution:

(5) first check whether the IP export DISPLAY=192.168.1.254:0.0 in the vim / home/oracle/.bash_ profile is the same as the real vm1IP

Note: this method is limited to remote test checking.

6) execute script file. / database/runInstaller

7) switch to root user

Note: in the graphical installation interface to install according to your own needs, halfway through the installation, you need to immediately use the root user to execute the following two scripts, and then continue with the installation. (script is as follows)

/ opt/oracle/oraInventory/orainstRoot.sh

/ opt/oracle/product/11.2/db_1/root.sh

8) web Management

IE-- > 192.168.1.100:1158/em

EM (Oracle graphical Web management interface)

Su-oracle

Emctl start dbconsole / / start EM

Emctl stop dbconsole / / stop EM

7. Start the Oracle service (must be an oracle user)

Start Oracle: first start Oracle, start listening

Stop Oracle: stop monitoring first, and then stop Oracle

1. Monitor

Lsnrctl start / / start listening

Lsnrctl stop / / stop snooping

two。 Database open

1) Open the database 1 / / start the system-- >

Sqlplus sys as sysdba / / Log in to Oracle

SQL > startup nomount; / / Open the instance

SQL > alter database mount; / / Mount the database

SQL > alter database open; / / Open the database

2) Open database 2 / / boot system-- > mount / mnt-- >

Sqlplus sys as sysdba / / Log in to Oracle

SQL > startup mount; / / Open the instance and mount the database

SQL > alter database open; / / Open the database

3) Open the database 3 / / start the system-- > mount / mnt-- > cd / mnt

Sqlplus sys as sysdba / / Log in to Oracle

SQL > startup; / / Open instance, mount database and open

3. Shut down the database

2) stop the database

Sqlplus sys as sysdba / / Log in to Oracle

SQL > shutdown [normal | immediate | transcaction | abort] / / close the database

Detailed explanation of the options:

The default value of shutdown NORMAL / / is the same as that of shutdown. After all users have finished writing, exit the database and close it.

Shutdown IMMEDIATE / / rollback all uncommitted transaction operations, exit the database and close

Shutdown TRANSCACTION / / wait for all user operations to finish before exiting the database and closing it. It is generally used to shut down the database on a regular basis.

Shutdown ABORT / / forcibly disconnect all users and do not save all data, which will result in data loss. Generally speaking, it is not recommended to use

Centos 6.7 pre-shutdown operation

2) 1) su-oracle

2) lsnrctl stop

3) sqlplus sys as sysdba

SQL > shutdown IMMEDIATE

SQL > QUIT

4) emctl stop dbconsole

Centos 6.7 post-boot operation

1) su-oracle

2) lsnrctl start

3) sqlplus sys as sysdba

SQL > startup

SQL > QUIT

4) emctl start dbconsole

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