Install Oracle database and create users under Linux

Source: Internet
Author: User
Tags dba

1. Install Redhat operating system (version custom)


(1) Installation table interview:

Yum groupinstall "X window System"-y

Yum Groupinstall desktop-y


2. Planning for storage

Oracle RDBMS installed locally (/oracle directory)

Oracle datafile stored on storage (/oradata)

3. Configure the Network

Execute command Setup,

or directly modify the file

Vi/etc/sysconfig/network-scripts/ifcfg-eth0

4. Modify Host Name

Vi/etc/hosts

Add the host name and IP correspondence in the last line as follows:

192.168.1.100 rh66.4 rh6.4 for the configured host name


Edit

Vi/etc/sysconfig/network

hostname=rh6.4


Modify the size of the SHM

Vi/etc/fstab

Tmpfs/dev/shm Tmpfs defaults,size=4g 0 0

Mount-o REMOUNT,SIZE=4G/DEV/SHM Modify the size of the/DEV/SHM


5. Turn off the firewall, SELinux

Chkconfig iptables off

Chkconfig Ip6tables off


Vi/etc/selinux/config s set SELinux to Disabled

Selinux=disabled

6. Close Unrelated services

chkconfig postfix off

Chkconfig ntpd off

Mv/etc/ntp.conf/etc/ntp.conf.bak


7. Configure the local yum to install the required packages


7.1 Mount Image

Df-h View

/dev/sr0 3.5G 3.5G 0 100%/media/rhel_6.3 x86_64 Disc 1

Mount/dev/sr0/mnt

7.2 Create your own repo file

Vi/etc/yum.repos.d/local.repo

[Local]

Name=local

Baseurl=file:///mnt

Enabled=1

Gpgcheck=0


7.3 Modifying yumrepo.py

vi/usr/lib/python2.6/site-packages/yum/yumrepo.py

Find

Remote = URL + '/' +relative

Switch

Remote = URL + '/local_yum_source ' + relative

7.4 Use,

Yum Clean All

Yum Install httpd* test whether it can be installed


8. Install the required packages


binutils-2.17.50.0.6

compat-libstdc++-33-3.2.3

compat-libstdc++-33-3.2.3 (+ bit)

elfutils-libelf-0.125

elfutils-libelf-devel-0.125

gcc-4.1.2

gcc-c++-4.1.2

Glibc-2.5-24

Glibc-2.5-24 (+ bit)

glibc-common-2.5

glibc-devel-2.5

glibc-devel-2.5 (+ bit)

glibc-headers-2.5

ksh-20060214

libaio-0.3.106

libaio-0.3.106 (+ bit)

libaio-devel-0.3.106

libaio-devel-0.3.106 (+ bit)

libgcc-4.1.2

libgcc-4.1.2 (+ bit)

libstdc++-4.1.2

libstdc++-4.1.2 (+ bit)

Libstdc++-devel 4.1.2

make-3.81

Numactl-devel-0.9.8.x86_64

sysstat-7.0.2



Check which packages are not installed

Rpm-q--qf '%{name}-%{version}-%{release} (%{arch}) \ n ' binutils \

compat-libstdc++-\

compat-libstdc++-\

elfutils-libelf-\

Elfutils-libelf-devel \

GCC \

gcc-c++ \

GLIBC \

GLIBC \

Glibc-common \

Glibc-devel \

Glibc-devel \

Glibc-headers \

Ksh \

Libaio \

Libaio-devel \

LIBGCC \

libstdc++ \

Libstdc++-devel \

Make \

Numactl-devel \

Sysstat



Yum install binutils* compat-libstdc* elfutils-libelf* gcc* glibc* ksh* libaio* libgcc* libstdc* make* numactl-devel*


sysstat* compat* elfutils* unix* libxp*-y


9. Check Swap

grep swaptotal/proc/meminfo requires more than 4.35GB


10. Create users and Groups

Groupadd-g Oinstall

GROUPADD-G 1001 DBA

USERADD-G oinstall-g dba Oracle


echo Oracle | passwd--stdin Oracle modifies Oracle's password for Oracle


10. Create an Oracle installation directory

Mkdir-p/oracle/app/oracle

Chown-r oracle:oinstall/oracle

Chmod-r 775/oracle


Mkdir/oradata Data File storage location

Chown-r Oracle:oinstall/oradata


11. Configuring Kernel Parameters

11.1 vi/etc/sysctl.conf # Official Document Kernel.shmmax = 536870912,

The actual software requires Kernel.shmmax = 980742144


# Add by MJT for Oracle 20150323

FS.AIO-MAX-NR = 1048576

Fs.file-max = 6815744

Kernel.shmall = 2097152

Kernel.shmmax = 980742144

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 = 1048586



FS.AIO-MAX-NR = 1048576

Fs.file-max = 6815744

Kernel.shmall = 2097152

Kernel.shmmax = 4294967295

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

Vi



Sysctl-p Z execute this command to make the parameters effective


11.2 vi/etc/security/limits.conf

# Add by MJT for Oracle 20150323

Oracle Soft Nproc 2047

Oracle Hard Nproc 16384

Oracle Soft Nofile 1024

Oracle Hard Nofile 65536

Oracle Soft Stack 10240



11.3 Vi/etc/pam.d/login


Session Required Pam_limits.so


12. Switch to Oracle User, configure environment variables


Su-oracle

VI. bash_profile

Export Oracle_base=/oracle/app/oracle

Export Oracle_home= $ORACLE _base/product/11.2/db_1

Export Oracle_sid=test

Export path= $ORACLE _home/bin: $PATH

Save exit

source. Bash_profile Make it effective

echo oracle_home Check for occurrences and paths configured in environment variables


13. Upload Oracle RDBMS software, unzip ready to install

Upload Software (3 is grid,1, 2 is Oracle)

P10404530_112030_linux-x86-64_1of7.zip

P10404530_112030_linux-x86-64_2of7.zip

P10404530_112030_linux-x86-64_3of7.zip


If the file system is installed, upload only 1 2

Unzip P10404530_112030_linux-x86-64_1of7.zip

Unzip P10404530_112030_linux-x86-64_2of7.zip


Chown-r Oracle:oinstall Database


14. Installing the Oracle RDBMS

Go to the Software storage directory

./runinstaller


Remove I wish to recive security updates via M Oracle support

Next click "Yes"

Tick Skip software Updates

Tick Install database software only

Tick Single Instance database installation

Default Selection 中文版

Tick Enterprise Edition

See if the path shown is the same as the environment variable settings oracle_base and Oracle_home


Drop down, select Oinstall


Check those failures, which must be resolved, have shown warning, see Situation handling (some direct ignore)




15. Execute the script using the root user, do not close the page, run out of script after the problem and then close

/u01/app/orainventory/orainstroot.sh

/u01/app/oracle/product/11.2/db_1/root.sh


Installation log:

/u01/app/orainventory/logs/installactions2015-03-22_08-39-53pm.log


16 Configuring monitoring:


NETCA has been the next step, finally select Finish to


17. Using DBCA to build a library


Next

"CREATE DATABASE" next

"Custom Database" next

Enter a database name such as "test"


Remove the configuration of EM


Select the option below, using the same password may say the password strength is not enough, click Yes


Select the location where the data files are stored next

Select the required components next


Block size default 8K

Selection of character sets next

Next




Sqlplus/as SYSDBA//Enter SQL statement


Shutdown immediate//close the database immediately


Startup//Start database


LSNRCTL Status//Open database Listener


echo $ORACLE _sid//Display text


/* Step 1th: Create a temporary tablespace */

Create temporary tablespace orcl_temp tempfile '/home/oracle/racdb/datafile/orcl_temp.dbf ' size 50m autoextend on next 50 M maxsize 20480m extent management local;


/* Step 2nd: Create a data table space */

Create tablespace orcl_data logging datafile '/home/oracle/racdb/datafile/orcl_data.dbf ' size 50m autoextend on next 50m m Axsize 2048m extent management local;


/* 3rd step: Create user and specify Tablespace */

Create user mcp2015test identified by mcp2015test default tablespace orcl_data temporary tablespace orcl_temp;


/* Step 4th: Grant permissions to the user *

Grant CONNECT,RESOURCE,DBA to Mcp2015test;



/* Delete User */

Drop User Mcp2015test


This article from the "10607620" blog, reproduced please contact the author!

Install Oracle database and create users under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.